Changeset 243467 in webkit
- Timestamp:
- Mar 25, 2019, 3:40:58 PM (7 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 60 edited
-
API/JSAPIWrapperObject.mm (modified) (1 diff)
-
API/JSMarkingConstraintPrivate.cpp (modified) (1 diff)
-
API/glib/JSAPIWrapperObjectGLib.cpp (modified) (1 diff)
-
ChangeLog (modified) (1 diff)
-
builtins/BuiltinExecutables.cpp (modified) (1 diff)
-
bytecode/AccessCase.cpp (modified) (3 diffs)
-
bytecode/CallLinkInfo.cpp (modified) (4 diffs)
-
bytecode/CallLinkStatus.cpp (modified) (1 diff)
-
bytecode/CallLinkStatus.h (modified) (1 diff)
-
bytecode/CallVariant.cpp (modified) (1 diff)
-
bytecode/CallVariant.h (modified) (1 diff)
-
bytecode/CodeBlock.cpp (modified) (26 diffs)
-
bytecode/CodeBlock.h (modified) (1 diff)
-
bytecode/ExecutableToCodeBlockEdge.cpp (modified) (3 diffs)
-
bytecode/GetByIdStatus.cpp (modified) (1 diff)
-
bytecode/GetByIdStatus.h (modified) (1 diff)
-
bytecode/GetByIdVariant.cpp (modified) (1 diff)
-
bytecode/GetByIdVariant.h (modified) (1 diff)
-
bytecode/InByIdStatus.cpp (modified) (1 diff)
-
bytecode/InByIdStatus.h (modified) (1 diff)
-
bytecode/InByIdVariant.cpp (modified) (1 diff)
-
bytecode/InByIdVariant.h (modified) (1 diff)
-
bytecode/ObjectPropertyCondition.cpp (modified) (1 diff)
-
bytecode/ObjectPropertyCondition.h (modified) (1 diff)
-
bytecode/ObjectPropertyConditionSet.cpp (modified) (1 diff)
-
bytecode/ObjectPropertyConditionSet.h (modified) (1 diff)
-
bytecode/PolymorphicAccess.cpp (modified) (1 diff)
-
bytecode/PropertyCondition.cpp (modified) (2 diffs)
-
bytecode/PropertyCondition.h (modified) (1 diff)
-
bytecode/PutByIdStatus.cpp (modified) (1 diff)
-
bytecode/PutByIdStatus.h (modified) (1 diff)
-
bytecode/PutByIdVariant.cpp (modified) (1 diff)
-
bytecode/PutByIdVariant.h (modified) (1 diff)
-
bytecode/RecordedStatuses.cpp (modified) (3 diffs)
-
bytecode/RecordedStatuses.h (modified) (1 diff)
-
bytecode/StructureSet.cpp (modified) (1 diff)
-
bytecode/StructureSet.h (modified) (1 diff)
-
bytecode/StructureStubInfo.cpp (modified) (2 diffs)
-
dfg/DFGPlan.cpp (modified) (2 diffs)
-
heap/GCIncomingRefCounted.h (modified) (1 diff)
-
heap/GCIncomingRefCountedInlines.h (modified) (1 diff)
-
heap/GCIncomingRefCountedSet.h (modified) (1 diff)
-
heap/GCIncomingRefCountedSetInlines.h (modified) (4 diffs)
-
heap/Heap.cpp (modified) (4 diffs)
-
heap/Heap.h (modified) (1 diff)
-
heap/HeapInlines.h (modified) (2 diffs)
-
heap/HeapSnapshotBuilder.cpp (modified) (1 diff)
-
heap/SlotVisitor.cpp (modified) (2 diffs)
-
jit/PolymorphicCallStubRoutine.cpp (modified) (1 diff)
-
runtime/ErrorInstance.cpp (modified) (1 diff)
-
runtime/InferredValueInlines.h (modified) (1 diff)
-
runtime/StackFrame.h (modified) (1 diff)
-
runtime/Structure.cpp (modified) (2 diffs)
-
runtime/Structure.h (modified) (1 diff)
-
runtime/TypeProfiler.cpp (modified) (1 diff)
-
runtime/TypeProfiler.h (modified) (1 diff)
-
runtime/TypeSet.cpp (modified) (1 diff)
-
runtime/TypeSet.h (modified) (1 diff)
-
runtime/WeakMapImpl.cpp (modified) (2 diffs)
-
runtime/WeakMapImplInlines.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSAPIWrapperObject.mm
r235271 r243467 64 64 if (!wrapperObject->wrappedObject()) 65 65 return false; 66 return JSC::Heap::isMarked(wrapperObject->structure()->globalObject()) && visitor.containsOpaqueRoot(wrapperObject->wrappedObject());66 return visitor.vm().heap.isMarked(wrapperObject->structure()->globalObject()) && visitor.containsOpaqueRoot(wrapperObject->wrappedObject()); 67 67 } 68 68 -
trunk/Source/JavaScriptCore/API/JSMarkingConstraintPrivate.cpp
r225524 r243467 41 41 }; 42 42 43 bool isMarked(JSMarkerRef , JSObjectRef objectRef)43 bool isMarked(JSMarkerRef markerRef, JSObjectRef objectRef) 44 44 { 45 45 if (!objectRef) 46 46 return true; // Null is an immortal object. 47 47 48 return Heap::isMarked(toJS(objectRef));48 return static_cast<Marker*>(markerRef)->visitor->vm().heap.isMarked(toJS(objectRef)); 49 49 } 50 50 -
trunk/Source/JavaScriptCore/API/glib/JSAPIWrapperObjectGLib.cpp
r235271 r243467 63 63 if (!wrapperObject->wrappedObject()) 64 64 return false; 65 return JSC::Heap::isMarked(wrapperObject->structure()->globalObject()) && visitor.containsOpaqueRoot(wrapperObject->wrappedObject());65 return visitor.vm().heap.isMarked(wrapperObject->structure()->globalObject()) && visitor.containsOpaqueRoot(wrapperObject->wrappedObject()); 66 66 } 67 67 -
trunk/Source/JavaScriptCore/ChangeLog
r243448 r243467 1 2019-03-25 Yusuke Suzuki <ysuzuki@apple.com> 2 3 Heap::isMarked and friends should be instance methods 4 https://bugs.webkit.org/show_bug.cgi?id=179988 5 6 Reviewed by Saam Barati. 7 8 Almost all the callers of Heap::isMarked have VM& reference. We should make Heap::isMarked instance function instead of static function 9 so that we do not need to look up Heap from the cell. 10 11 * API/JSAPIWrapperObject.mm: 12 (JSAPIWrapperObjectHandleOwner::isReachableFromOpaqueRoots): 13 * API/JSMarkingConstraintPrivate.cpp: 14 (JSC::isMarked): 15 * API/glib/JSAPIWrapperObjectGLib.cpp: 16 (JSAPIWrapperObjectHandleOwner::isReachableFromOpaqueRoots): 17 * builtins/BuiltinExecutables.cpp: 18 (JSC::BuiltinExecutables::finalizeUnconditionally): 19 * bytecode/AccessCase.cpp: 20 (JSC::AccessCase::visitWeak const): 21 (JSC::AccessCase::propagateTransitions const): 22 * bytecode/CallLinkInfo.cpp: 23 (JSC::CallLinkInfo::visitWeak): 24 * bytecode/CallLinkStatus.cpp: 25 (JSC::CallLinkStatus::finalize): 26 * bytecode/CallLinkStatus.h: 27 * bytecode/CallVariant.cpp: 28 (JSC::CallVariant::finalize): 29 * bytecode/CallVariant.h: 30 * bytecode/CodeBlock.cpp: 31 (JSC::CodeBlock::shouldJettisonDueToWeakReference): 32 (JSC::CodeBlock::shouldJettisonDueToOldAge): 33 (JSC::shouldMarkTransition): 34 (JSC::CodeBlock::propagateTransitions): 35 (JSC::CodeBlock::determineLiveness): 36 (JSC::CodeBlock::finalizeLLIntInlineCaches): 37 (JSC::CodeBlock::finalizeUnconditionally): 38 (JSC::CodeBlock::jettison): 39 * bytecode/CodeBlock.h: 40 * bytecode/ExecutableToCodeBlockEdge.cpp: 41 (JSC::ExecutableToCodeBlockEdge::visitChildren): 42 (JSC::ExecutableToCodeBlockEdge::finalizeUnconditionally): 43 (JSC::ExecutableToCodeBlockEdge::runConstraint): 44 * bytecode/GetByIdStatus.cpp: 45 (JSC::GetByIdStatus::finalize): 46 * bytecode/GetByIdStatus.h: 47 * bytecode/GetByIdVariant.cpp: 48 (JSC::GetByIdVariant::finalize): 49 * bytecode/GetByIdVariant.h: 50 * bytecode/InByIdStatus.cpp: 51 (JSC::InByIdStatus::finalize): 52 * bytecode/InByIdStatus.h: 53 * bytecode/InByIdVariant.cpp: 54 (JSC::InByIdVariant::finalize): 55 * bytecode/InByIdVariant.h: 56 * bytecode/ObjectPropertyCondition.cpp: 57 (JSC::ObjectPropertyCondition::isStillLive const): 58 * bytecode/ObjectPropertyCondition.h: 59 * bytecode/ObjectPropertyConditionSet.cpp: 60 (JSC::ObjectPropertyConditionSet::areStillLive const): 61 * bytecode/ObjectPropertyConditionSet.h: 62 * bytecode/PolymorphicAccess.cpp: 63 (JSC::PolymorphicAccess::visitWeak const): 64 * bytecode/PropertyCondition.cpp: 65 (JSC::PropertyCondition::isStillLive const): 66 * bytecode/PropertyCondition.h: 67 * bytecode/PutByIdStatus.cpp: 68 (JSC::PutByIdStatus::finalize): 69 * bytecode/PutByIdStatus.h: 70 * bytecode/PutByIdVariant.cpp: 71 (JSC::PutByIdVariant::finalize): 72 * bytecode/PutByIdVariant.h: 73 * bytecode/RecordedStatuses.cpp: 74 (JSC::RecordedStatuses::finalizeWithoutDeleting): 75 (JSC::RecordedStatuses::finalize): 76 * bytecode/RecordedStatuses.h: 77 * bytecode/StructureSet.cpp: 78 (JSC::StructureSet::isStillAlive const): 79 * bytecode/StructureSet.h: 80 * bytecode/StructureStubInfo.cpp: 81 (JSC::StructureStubInfo::visitWeakReferences): 82 * dfg/DFGPlan.cpp: 83 (JSC::DFG::Plan::finalizeInGC): 84 (JSC::DFG::Plan::isKnownToBeLiveDuringGC): 85 * heap/GCIncomingRefCounted.h: 86 * heap/GCIncomingRefCountedInlines.h: 87 (JSC::GCIncomingRefCounted<T>::filterIncomingReferences): 88 * heap/GCIncomingRefCountedSet.h: 89 * heap/GCIncomingRefCountedSetInlines.h: 90 (JSC::GCIncomingRefCountedSet<T>::lastChanceToFinalize): 91 (JSC::GCIncomingRefCountedSet<T>::sweep): 92 (JSC::GCIncomingRefCountedSet<T>::removeAll): Deleted. 93 (JSC::GCIncomingRefCountedSet<T>::removeDead): Deleted. 94 * heap/Heap.cpp: 95 (JSC::Heap::addToRememberedSet): 96 (JSC::Heap::runEndPhase): 97 (JSC::Heap::sweepArrayBuffers): 98 (JSC::Heap::addCoreConstraints): 99 * heap/Heap.h: 100 * heap/HeapInlines.h: 101 (JSC::Heap::isMarked): 102 * heap/HeapSnapshotBuilder.cpp: 103 (JSC::HeapSnapshotBuilder::appendNode): 104 * heap/SlotVisitor.cpp: 105 (JSC::SlotVisitor::appendToMarkStack): 106 (JSC::SlotVisitor::visitChildren): 107 * jit/PolymorphicCallStubRoutine.cpp: 108 (JSC::PolymorphicCallStubRoutine::visitWeak): 109 * runtime/ErrorInstance.cpp: 110 (JSC::ErrorInstance::finalizeUnconditionally): 111 * runtime/InferredValueInlines.h: 112 (JSC::InferredValue::finalizeUnconditionally): 113 * runtime/StackFrame.h: 114 (JSC::StackFrame::isMarked const): 115 * runtime/Structure.cpp: 116 (JSC::Structure::isCheapDuringGC): 117 (JSC::Structure::markIfCheap): 118 * runtime/Structure.h: 119 * runtime/TypeProfiler.cpp: 120 (JSC::TypeProfiler::invalidateTypeSetCache): 121 * runtime/TypeProfiler.h: 122 * runtime/TypeSet.cpp: 123 (JSC::TypeSet::invalidateCache): 124 * runtime/TypeSet.h: 125 * runtime/WeakMapImpl.cpp: 126 (JSC::WeakMapImpl<WeakMapBucket<WeakMapBucketDataKeyValue>>::visitOutputConstraints): 127 * runtime/WeakMapImplInlines.h: 128 (JSC::WeakMapImpl<WeakMapBucket>::finalizeUnconditionally): 129 1 130 2019-03-25 Keith Miller <keith_miller@apple.com> 2 131 -
trunk/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp
r242722 r243467 263 263 { 264 264 for (auto*& unlinkedExecutable : m_unlinkedExecutables) { 265 if (unlinkedExecutable && ! Heap::isMarked(unlinkedExecutable))265 if (unlinkedExecutable && !m_vm.heap.isMarked(unlinkedExecutable)) 266 266 unlinkedExecutable = nullptr; 267 267 } -
trunk/Source/JavaScriptCore/bytecode/AccessCase.cpp
r242397 r243467 324 324 bool AccessCase::visitWeak(VM& vm) const 325 325 { 326 if (m_structure && ! Heap::isMarked(m_structure.get()))326 if (m_structure && !vm.heap.isMarked(m_structure.get())) 327 327 return false; 328 328 if (m_polyProtoAccessChain) { 329 329 for (Structure* structure : m_polyProtoAccessChain->chain()) { 330 if (! Heap::isMarked(structure))330 if (!vm.heap.isMarked(structure)) 331 331 return false; 332 332 } 333 333 } 334 if (!m_conditionSet.areStillLive( ))334 if (!m_conditionSet.areStillLive(vm)) 335 335 return false; 336 336 if (isAccessor()) { … … 338 338 if (accessor.callLinkInfo()) 339 339 accessor.callLinkInfo()->visitWeak(vm); 340 if (accessor.customSlotBase() && ! Heap::isMarked(accessor.customSlotBase()))340 if (accessor.customSlotBase() && !vm.heap.isMarked(accessor.customSlotBase())) 341 341 return false; 342 342 } else if (type() == IntrinsicGetter) { 343 343 auto& intrinsic = this->as<IntrinsicGetterAccessCase>(); 344 if (intrinsic.intrinsicFunction() && ! Heap::isMarked(intrinsic.intrinsicFunction()))344 if (intrinsic.intrinsicFunction() && !vm.heap.isMarked(intrinsic.intrinsicFunction())) 345 345 return false; 346 346 } else if (type() == ModuleNamespaceLoad) { 347 347 auto& accessCase = this->as<ModuleNamespaceAccessCase>(); 348 if (accessCase.moduleNamespaceObject() && ! Heap::isMarked(accessCase.moduleNamespaceObject()))348 if (accessCase.moduleNamespaceObject() && !vm.heap.isMarked(accessCase.moduleNamespaceObject())) 349 349 return false; 350 if (accessCase.moduleEnvironment() && ! Heap::isMarked(accessCase.moduleEnvironment()))350 if (accessCase.moduleEnvironment() && !vm.heap.isMarked(accessCase.moduleEnvironment())) 351 351 return false; 352 352 } else if (type() == InstanceOfHit || type() == InstanceOfMiss) { 353 if (as<InstanceOfAccessCase>().prototype() && ! Heap::isMarked(as<InstanceOfAccessCase>().prototype()))353 if (as<InstanceOfAccessCase>().prototype() && !vm.heap.isMarked(as<InstanceOfAccessCase>().prototype())) 354 354 return false; 355 355 } … … 372 372 switch (m_type) { 373 373 case Transition: 374 if ( Heap::isMarked(m_structure->previousID()))374 if (visitor.vm().heap.isMarked(m_structure->previousID())) 375 375 visitor.appendUnbarriered(m_structure.get()); 376 376 else -
trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.cpp
r234086 r243467 211 211 { 212 212 auto handleSpecificCallee = [&] (JSFunction* callee) { 213 if ( Heap::isMarked(callee->executable()))213 if (vm.heap.isMarked(callee->executable())) 214 214 m_hasSeenClosure = true; 215 215 else … … 229 229 m_clearedByGC = true; 230 230 } 231 } else if (! Heap::isMarked(m_calleeOrCodeBlock.get())) {231 } else if (!vm.heap.isMarked(m_calleeOrCodeBlock.get())) { 232 232 if (isDirect()) { 233 233 if (Options::verboseOSR()) { … … 253 253 } 254 254 unlink(vm); 255 } else if (isDirect() && ! Heap::isMarked(m_lastSeenCalleeOrExecutable.get())) {255 } else if (isDirect() && !vm.heap.isMarked(m_lastSeenCalleeOrExecutable.get())) { 256 256 if (Options::verboseOSR()) { 257 257 dataLog( … … 265 265 } 266 266 } 267 if (!isDirect() && haveLastSeenCallee() && ! Heap::isMarked(lastSeenCallee())) {267 if (!isDirect() && haveLastSeenCallee() && !vm.heap.isMarked(lastSeenCallee())) { 268 268 if (lastSeenCallee()->type() == JSFunctionType) 269 269 handleSpecificCallee(jsCast<JSFunction*>(lastSeenCallee())); -
trunk/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp
r243232 r243467 419 419 } 420 420 421 bool CallLinkStatus::finalize( )421 bool CallLinkStatus::finalize(VM& vm) 422 422 { 423 423 for (CallVariant& variant : m_variants) { 424 if (!variant.finalize( ))424 if (!variant.finalize(vm)) 425 425 return false; 426 426 } -
trunk/Source/JavaScriptCore/bytecode/CallLinkStatus.h
r234086 r243467 107 107 unsigned maxNumArguments() const { return m_maxNumArguments; } 108 108 109 bool finalize( );109 bool finalize(VM&); 110 110 111 111 void merge(const CallLinkStatus&); -
trunk/Source/JavaScriptCore/bytecode/CallVariant.cpp
r237241 r243467 32 32 namespace JSC { 33 33 34 bool CallVariant::finalize( )34 bool CallVariant::finalize(VM& vm) 35 35 { 36 if (m_callee && ! Heap::isMarked(m_callee))36 if (m_callee && !vm.heap.isMarked(m_callee)) 37 37 return false; 38 38 return true; -
trunk/Source/JavaScriptCore/bytecode/CallVariant.h
r241037 r243467 138 138 } 139 139 140 bool finalize( );140 bool finalize(VM&); 141 141 142 142 bool merge(const CallVariant&); -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r243232 r243467 999 999 } 1000 1000 1001 bool CodeBlock::shouldJettisonDueToWeakReference( )1001 bool CodeBlock::shouldJettisonDueToWeakReference(VM& vm) 1002 1002 { 1003 1003 if (!JITCode::isOptimizingJIT(jitType())) 1004 1004 return false; 1005 return ! Heap::isMarked(this);1005 return !vm.heap.isMarked(this); 1006 1006 } 1007 1007 … … 1041 1041 bool CodeBlock::shouldJettisonDueToOldAge(const ConcurrentJSLocker&) 1042 1042 { 1043 if ( Heap::isMarked(this))1043 if (m_vm->heap.isMarked(this)) 1044 1044 return false; 1045 1045 … … 1054 1054 1055 1055 #if ENABLE(DFG_JIT) 1056 static bool shouldMarkTransition( DFG::WeakReferenceTransition& transition)1057 { 1058 if (transition.m_codeOrigin && ! Heap::isMarked(transition.m_codeOrigin.get()))1056 static bool shouldMarkTransition(VM& vm, DFG::WeakReferenceTransition& transition) 1057 { 1058 if (transition.m_codeOrigin && !vm.heap.isMarked(transition.m_codeOrigin.get())) 1059 1059 return false; 1060 1060 1061 if (! Heap::isMarked(transition.m_from.get()))1061 if (!vm.heap.isMarked(transition.m_from.get())) 1062 1062 return false; 1063 1063 … … 1087 1087 Structure* newStructure = 1088 1088 vm.heap.structureIDTable().get(newStructureID); 1089 if ( Heap::isMarked(oldStructure))1089 if (vm.heap.isMarked(oldStructure)) 1090 1090 visitor.appendUnbarriered(newStructure); 1091 1091 continue; … … 1113 1113 1114 1114 for (auto& transition : dfgCommon->transitions) { 1115 if (shouldMarkTransition( transition)) {1115 if (shouldMarkTransition(vm, transition)) { 1116 1116 // If the following three things are live, then the target of the 1117 1117 // transition is also live: … … 1145 1145 1146 1146 #if ENABLE(DFG_JIT) 1147 if (Heap::isMarked(this)) 1147 VM& vm = *m_vm; 1148 if (vm.heap.isMarked(this)) 1148 1149 return; 1149 1150 … … 1161 1162 for (unsigned i = 0; i < dfgCommon->weakReferences.size(); ++i) { 1162 1163 JSCell* reference = dfgCommon->weakReferences[i].get(); 1163 ASSERT(!jsDynamicCast<CodeBlock*>( *reference->vm(), reference));1164 if (! Heap::isMarked(reference)) {1164 ASSERT(!jsDynamicCast<CodeBlock*>(vm, reference)); 1165 if (!vm.heap.isMarked(reference)) { 1165 1166 allAreLiveSoFar = false; 1166 1167 break; … … 1169 1170 if (allAreLiveSoFar) { 1170 1171 for (unsigned i = 0; i < dfgCommon->weakStructureReferences.size(); ++i) { 1171 if (! Heap::isMarked(dfgCommon->weakStructureReferences[i].get())) {1172 if (!vm.heap.isMarked(dfgCommon->weakStructureReferences[i].get())) { 1172 1173 allAreLiveSoFar = false; 1173 1174 break; … … 1192 1193 const Vector<InstructionStream::Offset>& propertyAccessInstructions = m_unlinkedCode->propertyAccessInstructions(); 1193 1194 1194 auto handleGetPutFromScope = [ ](auto& metadata) {1195 auto handleGetPutFromScope = [&] (auto& metadata) { 1195 1196 GetPutInfo getPutInfo = metadata.m_getPutInfo; 1196 1197 if (getPutInfo.resolveType() == GlobalVar || getPutInfo.resolveType() == GlobalVarWithVarInjectionChecks … … 1198 1199 return; 1199 1200 WriteBarrierBase<Structure>& structure = metadata.m_structure; 1200 if (!structure || Heap::isMarked(structure.get()))1201 if (!structure || vm.heap.isMarked(structure.get())) 1201 1202 return; 1202 1203 if (Options::verboseOSR()) … … 1214 1215 break; 1215 1216 StructureID oldStructureID = metadata.m_modeMetadata.defaultMode.structureID; 1216 if (!oldStructureID || Heap::isMarked(vm.heap.structureIDTable().get(oldStructureID)))1217 if (!oldStructureID || vm.heap.isMarked(vm.heap.structureIDTable().get(oldStructureID))) 1217 1218 break; 1218 1219 if (Options::verboseOSR()) … … 1224 1225 auto& metadata = curInstruction->as<OpGetByIdDirect>().metadata(this); 1225 1226 StructureID oldStructureID = metadata.m_structureID; 1226 if (!oldStructureID || Heap::isMarked(vm.heap.structureIDTable().get(oldStructureID)))1227 if (!oldStructureID || vm.heap.isMarked(vm.heap.structureIDTable().get(oldStructureID))) 1227 1228 break; 1228 1229 if (Options::verboseOSR()) … … 1237 1238 StructureID newStructureID = metadata.m_newStructureID; 1238 1239 StructureChain* chain = metadata.m_structureChain.get(); 1239 if ((!oldStructureID || Heap::isMarked(vm.heap.structureIDTable().get(oldStructureID)))1240 && (!newStructureID || Heap::isMarked(vm.heap.structureIDTable().get(newStructureID)))1241 && (!chain || Heap::isMarked(chain)))1240 if ((!oldStructureID || vm.heap.isMarked(vm.heap.structureIDTable().get(oldStructureID))) 1241 && (!newStructureID || vm.heap.isMarked(vm.heap.structureIDTable().get(newStructureID))) 1242 && (!chain || vm.heap.isMarked(chain))) 1242 1243 break; 1243 1244 if (Options::verboseOSR()) … … 1255 1256 case op_to_this: { 1256 1257 auto& metadata = curInstruction->as<OpToThis>().metadata(this); 1257 if (!metadata.m_cachedStructure || Heap::isMarked(metadata.m_cachedStructure.get()))1258 if (!metadata.m_cachedStructure || vm.heap.isMarked(metadata.m_cachedStructure.get())) 1258 1259 break; 1259 1260 if (Options::verboseOSR()) … … 1269 1270 break; 1270 1271 JSCell* cachedFunction = cacheWriteBarrier.get(); 1271 if ( Heap::isMarked(cachedFunction))1272 if (vm.heap.isMarked(cachedFunction)) 1272 1273 break; 1273 1274 if (Options::verboseOSR()) … … 1282 1283 auto& metadata = curInstruction->as<OpResolveScope>().metadata(this); 1283 1284 WriteBarrierBase<SymbolTable>& symbolTable = metadata.m_symbolTable; 1284 if (!symbolTable || Heap::isMarked(symbolTable.get()))1285 if (!symbolTable || vm.heap.isMarked(symbolTable.get())) 1285 1286 break; 1286 1287 if (Options::verboseOSR()) … … 1315 1316 }; 1316 1317 1317 if (! Heap::isMarked(std::get<0>(pair.key)))1318 if (!vm.heap.isMarked(std::get<0>(pair.key))) 1318 1319 return clear(); 1319 1320 1320 1321 for (const LLIntPrototypeLoadAdaptiveStructureWatchpoint* watchpoint : pair.value) { 1321 if (!watchpoint->key().isStillLive( ))1322 if (!watchpoint->key().isStillLive(vm)) 1322 1323 return clear(); 1323 1324 } … … 1327 1328 1328 1329 forEachLLIntCallLinkInfo([&](LLIntCallLinkInfo& callLinkInfo) { 1329 if (callLinkInfo.isLinked() && ! Heap::isMarked(callLinkInfo.callee.get())) {1330 if (callLinkInfo.isLinked() && !vm.heap.isMarked(callLinkInfo.callee.get())) { 1330 1331 if (Options::verboseOSR()) 1331 1332 dataLog("Clearing LLInt call from ", *this, "\n"); 1332 1333 callLinkInfo.unlink(); 1333 1334 } 1334 if (!!callLinkInfo.lastSeenCallee && ! Heap::isMarked(callLinkInfo.lastSeenCallee.get()))1335 if (!!callLinkInfo.lastSeenCallee && !vm.heap.isMarked(callLinkInfo.lastSeenCallee.get())) 1335 1336 callLinkInfo.lastSeenCallee.clear(); 1336 1337 }); … … 1357 1358 #endif 1358 1359 1359 void CodeBlock::finalizeUnconditionally(VM&) 1360 { 1360 void CodeBlock::finalizeUnconditionally(VM& vm) 1361 { 1362 UNUSED_PARAM(vm); 1363 1361 1364 updateAllPredictions(); 1362 1365 … … 1372 1375 if (JITCode::isOptimizingJIT(jitType())) { 1373 1376 DFG::CommonData* dfgCommon = m_jitCode->dfgCommon(); 1374 dfgCommon->recordedStatuses.finalize( );1377 dfgCommon->recordedStatuses.finalize(vm); 1375 1378 } 1376 1379 #endif // ENABLE(DFG_JIT) … … 1953 1956 UNUSED_PARAM(detail); 1954 1957 #endif 1958 1959 VM& vm = *m_vm; 1955 1960 1956 1961 CODEBLOCK_LOG_EVENT(this, "jettison", ("due to ", reason, ", counting = ", mode == CountReoptimization, ", detail = ", pointerDump(detail))); … … 1977 1982 JSCell* from = transition.m_from.get(); 1978 1983 JSCell* to = transition.m_to.get(); 1979 if ((!origin || Heap::isMarked(origin)) && Heap::isMarked(from))1984 if ((!origin || vm.heap.isMarked(origin)) && vm.heap.isMarked(from)) 1980 1985 continue; 1981 1986 dataLog(" Transition under ", RawPointer(origin), ", ", RawPointer(from), " -> ", RawPointer(to), ".\n"); … … 1983 1988 for (unsigned i = 0; i < dfgCommon->weakReferences.size(); ++i) { 1984 1989 JSCell* weak = dfgCommon->weakReferences[i].get(); 1985 if ( Heap::isMarked(weak))1990 if (vm.heap.isMarked(weak)) 1986 1991 continue; 1987 1992 dataLog(" Weak reference ", RawPointer(weak), ".\n"); … … 1991 1996 #endif // ENABLE(DFG_JIT) 1992 1997 1993 VM& vm = *m_vm;1994 1998 DeferGCForAWhile deferGC(*heap()); 1995 1999 … … 2011 2015 if (!jitCode()->dfgCommon()->invalidate()) { 2012 2016 // We've already been invalidated. 2013 RELEASE_ASSERT(this != replacement() || (vm.heap.isCurrentThreadBusy() && ! Heap::isMarked(ownerExecutable())));2017 RELEASE_ASSERT(this != replacement() || (vm.heap.isCurrentThreadBusy() && !vm.heap.isMarked(ownerExecutable()))); 2014 2018 return; 2015 2019 } … … 2043 2047 // Jettison can happen during GC. We don't want to install code to a dead executable 2044 2048 // because that would add a dead object to the remembered set. 2045 if (vm.heap.isCurrentThreadBusy() && ! Heap::isMarked(ownerExecutable()))2049 if (vm.heap.isCurrentThreadBusy() && !vm.heap.isMarked(ownerExecutable())) 2046 2050 return; 2047 2051 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r242928 r243467 920 920 921 921 bool shouldVisitStrongly(const ConcurrentJSLocker&); 922 bool shouldJettisonDueToWeakReference( );922 bool shouldJettisonDueToWeakReference(VM&); 923 923 bool shouldJettisonDueToOldAge(const ConcurrentJSLocker&); 924 924 -
trunk/Source/JavaScriptCore/bytecode/ExecutableToCodeBlockEdge.cpp
r240951 r243467 76 76 visitor.appendUnbarriered(codeBlock); 77 77 78 if (! Heap::isMarked(codeBlock))78 if (!vm.heap.isMarked(codeBlock)) 79 79 vm.executableToCodeBlockEdgesWithFinalizers.add(edge); 80 80 … … 126 126 CodeBlock* codeBlock = m_codeBlock.get(); 127 127 128 if (! Heap::isMarked(codeBlock)) {129 if (codeBlock->shouldJettisonDueToWeakReference( ))128 if (!vm.heap.isMarked(codeBlock)) { 129 if (codeBlock->shouldJettisonDueToWeakReference(vm)) 130 130 codeBlock->jettison(Profiler::JettisonDueToWeakReference); 131 131 else … … 190 190 codeBlock->determineLiveness(locker, visitor); 191 191 192 if ( Heap::isMarked(codeBlock))192 if (vm.heap.isMarked(codeBlock)) 193 193 vm.executableToCodeBlockEdgesWithConstraints.remove(this); 194 194 } -
trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp
r243232 r243467 477 477 } 478 478 479 bool GetByIdStatus::finalize( )479 bool GetByIdStatus::finalize(VM& vm) 480 480 { 481 481 for (GetByIdVariant& variant : m_variants) { 482 if (!variant.finalize( ))482 if (!variant.finalize(vm)) 483 483 return false; 484 484 } 485 if (m_moduleNamespaceObject && ! Heap::isMarked(m_moduleNamespaceObject))485 if (m_moduleNamespaceObject && !vm.heap.isMarked(m_moduleNamespaceObject)) 486 486 return false; 487 if (m_moduleEnvironment && ! Heap::isMarked(m_moduleEnvironment))487 if (m_moduleEnvironment && !vm.heap.isMarked(m_moduleEnvironment)) 488 488 return false; 489 489 return true; -
trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.h
r242659 r243467 142 142 143 143 void markIfCheap(SlotVisitor&); 144 bool finalize( ); // Return true if this gets to live.144 bool finalize(VM&); // Return true if this gets to live. 145 145 146 146 void dump(PrintStream&) const; -
trunk/Source/JavaScriptCore/bytecode/GetByIdVariant.cpp
r239427 r243467 150 150 } 151 151 152 bool GetByIdVariant::finalize( )152 bool GetByIdVariant::finalize(VM& vm) 153 153 { 154 if (!m_structureSet.isStillAlive( ))154 if (!m_structureSet.isStillAlive(vm)) 155 155 return false; 156 if (!m_conditionSet.areStillLive( ))156 if (!m_conditionSet.areStillLive(vm)) 157 157 return false; 158 if (m_callLinkStatus && !m_callLinkStatus->finalize( ))158 if (m_callLinkStatus && !m_callLinkStatus->finalize(vm)) 159 159 return false; 160 if (m_intrinsicFunction && ! Heap::isMarked(m_intrinsicFunction))160 if (m_intrinsicFunction && !vm.heap.isMarked(m_intrinsicFunction)) 161 161 return false; 162 162 return true; -
trunk/Source/JavaScriptCore/bytecode/GetByIdVariant.h
r239427 r243467 75 75 76 76 void markIfCheap(SlotVisitor&); 77 bool finalize( );77 bool finalize(VM&); 78 78 79 79 void dump(PrintStream&) const; -
trunk/Source/JavaScriptCore/bytecode/InByIdStatus.cpp
r243232 r243467 259 259 } 260 260 261 bool InByIdStatus::finalize( )261 bool InByIdStatus::finalize(VM& vm) 262 262 { 263 263 for (InByIdVariant& variant : m_variants) { 264 if (!variant.finalize( ))264 if (!variant.finalize(vm)) 265 265 return false; 266 266 } -
trunk/Source/JavaScriptCore/bytecode/InByIdStatus.h
r234086 r243467 107 107 108 108 void markIfCheap(SlotVisitor&); 109 bool finalize( );109 bool finalize(VM&); 110 110 111 111 void dump(PrintStream&) const; -
trunk/Source/JavaScriptCore/bytecode/InByIdVariant.cpp
r234090 r243467 73 73 } 74 74 75 bool InByIdVariant::finalize( )75 bool InByIdVariant::finalize(VM& vm) 76 76 { 77 if (!m_structureSet.isStillAlive( ))77 if (!m_structureSet.isStillAlive(vm)) 78 78 return false; 79 if (!m_conditionSet.areStillLive( ))79 if (!m_conditionSet.areStillLive(vm)) 80 80 return false; 81 81 return true; -
trunk/Source/JavaScriptCore/bytecode/InByIdVariant.h
r234086 r243467 58 58 59 59 void markIfCheap(SlotVisitor&); 60 bool finalize( );60 bool finalize(VM&); 61 61 62 62 void dump(PrintStream&) const; -
trunk/Source/JavaScriptCore/bytecode/ObjectPropertyCondition.cpp
r243420 r243467 143 143 } 144 144 145 bool ObjectPropertyCondition::isStillLive( ) const145 bool ObjectPropertyCondition::isStillLive(VM& vm) const 146 146 { 147 147 if (!*this) 148 148 return false; 149 149 150 if (! Heap::isMarked(m_object))150 if (!vm.heap.isMarked(m_object)) 151 151 return false; 152 152 153 return m_condition.isStillLive( );153 return m_condition.isStillLive(vm); 154 154 } 155 155 -
trunk/Source/JavaScriptCore/bytecode/ObjectPropertyCondition.h
r231961 r243467 245 245 246 246 // This means that the objects involved in this are still live. 247 bool isStillLive( ) const;247 bool isStillLive(VM&) const; 248 248 249 249 void validateReferences(const TrackedReferences&) const; -
trunk/Source/JavaScriptCore/bytecode/ObjectPropertyConditionSet.cpp
r233124 r243467 142 142 } 143 143 144 bool ObjectPropertyConditionSet::areStillLive( ) const145 { 146 for (const ObjectPropertyCondition& condition : *this) { 147 if (!condition.isStillLive( ))144 bool ObjectPropertyConditionSet::areStillLive(VM& vm) const 145 { 146 for (const ObjectPropertyCondition& condition : *this) { 147 if (!condition.isStillLive(vm)) 148 148 return false; 149 149 } -
trunk/Source/JavaScriptCore/bytecode/ObjectPropertyConditionSet.h
r232313 r243467 112 112 113 113 bool needImpurePropertyWatchpoint() const; 114 bool areStillLive( ) const;114 bool areStillLive(VM&) const; 115 115 116 116 void dumpInContext(PrintStream&, DumpContext*) const; -
trunk/Source/JavaScriptCore/bytecode/PolymorphicAccess.cpp
r235527 r243467 325 325 if (Vector<WriteBarrier<JSCell>>* weakReferences = m_weakReferences.get()) { 326 326 for (WriteBarrier<JSCell>& weakReference : *weakReferences) { 327 if (! Heap::isMarked(weakReference.get()))327 if (!vm.heap.isMarked(weakReference.get())) 328 328 return false; 329 329 } -
trunk/Source/JavaScriptCore/bytecode/PropertyCondition.cpp
r239062 r243467 353 353 } 354 354 355 bool PropertyCondition::isStillLive( ) const356 { 357 if (hasPrototype() && prototype() && ! Heap::isMarked(prototype()))355 bool PropertyCondition::isStillLive(VM& vm) const 356 { 357 if (hasPrototype() && prototype() && !vm.heap.isMarked(prototype())) 358 358 return false; 359 359 … … 361 361 && requiredValue() 362 362 && requiredValue().isCell() 363 && ! Heap::isMarked(requiredValue().asCell()))363 && !vm.heap.isMarked(requiredValue().asCell())) 364 364 return false; 365 365 -
trunk/Source/JavaScriptCore/bytecode/PropertyCondition.h
r234677 r243467 298 298 299 299 // This means that the objects involved in this are still live. 300 bool isStillLive( ) const;300 bool isStillLive(VM&) const; 301 301 302 302 void validateReferences(const TrackedReferences&) const; -
trunk/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp
r243232 r243467 387 387 } 388 388 389 bool PutByIdStatus::finalize( )389 bool PutByIdStatus::finalize(VM& vm) 390 390 { 391 391 for (PutByIdVariant& variant : m_variants) { 392 if (!variant.finalize( ))392 if (!variant.finalize(vm)) 393 393 return false; 394 394 } -
trunk/Source/JavaScriptCore/bytecode/PutByIdStatus.h
r238346 r243467 117 117 118 118 void markIfCheap(SlotVisitor&); 119 bool finalize( );119 bool finalize(VM&); 120 120 121 121 void merge(const PutByIdStatus&); -
trunk/Source/JavaScriptCore/bytecode/PutByIdVariant.cpp
r240023 r243467 271 271 } 272 272 273 bool PutByIdVariant::finalize( )274 { 275 if (!m_oldStructure.isStillAlive( ))276 return false; 277 if (m_newStructure && ! Heap::isMarked(m_newStructure))278 return false; 279 if (!m_conditionSet.areStillLive( ))280 return false; 281 if (m_callLinkStatus && !m_callLinkStatus->finalize( ))273 bool PutByIdVariant::finalize(VM& vm) 274 { 275 if (!m_oldStructure.isStillAlive(vm)) 276 return false; 277 if (m_newStructure && !vm.heap.isMarked(m_newStructure)) 278 return false; 279 if (!m_conditionSet.areStillLive(vm)) 280 return false; 281 if (m_callLinkStatus && !m_callLinkStatus->finalize(vm)) 282 282 return false; 283 283 return true; -
trunk/Source/JavaScriptCore/bytecode/PutByIdVariant.h
r242657 r243467 133 133 134 134 void markIfCheap(SlotVisitor&); 135 bool finalize( );135 bool finalize(VM&); 136 136 137 137 void dump(PrintStream&) const; -
trunk/Source/JavaScriptCore/bytecode/RecordedStatuses.cpp
r234086 r243467 86 86 } 87 87 88 void RecordedStatuses::finalizeWithoutDeleting( )88 void RecordedStatuses::finalizeWithoutDeleting(VM& vm) 89 89 { 90 90 // This variant of finalize gets called from within graph safepoints -- so there may be DFG IR in … … 93 93 // anything from the vector or delete the unique_ptrs. 94 94 95 auto finalize = [ ] (auto& vector) {95 auto finalize = [&] (auto& vector) { 96 96 for (auto& pair : vector) { 97 if (!pair.second->finalize( ))97 if (!pair.second->finalize(vm)) 98 98 *pair.second = { }; 99 99 } … … 102 102 } 103 103 104 void RecordedStatuses::finalize( )104 void RecordedStatuses::finalize(VM& vm) 105 105 { 106 auto finalize = [ ] (auto& vector) {106 auto finalize = [&] (auto& vector) { 107 107 vector.removeAllMatching( 108 108 [&] (auto& pair) -> bool { 109 return !*pair.second || !pair.second->finalize( );109 return !*pair.second || !pair.second->finalize(vm); 110 110 }); 111 111 vector.shrinkToFit(); -
trunk/Source/JavaScriptCore/bytecode/RecordedStatuses.h
r234086 r243467 51 51 void markIfCheap(SlotVisitor& slotVisitor); 52 52 53 void finalizeWithoutDeleting( );54 void finalize( );53 void finalizeWithoutDeleting(VM&); 54 void finalize(VM&); 55 55 56 56 void shrinkToFit(); -
trunk/Source/JavaScriptCore/bytecode/StructureSet.cpp
r234086 r243467 38 38 } 39 39 40 bool StructureSet::isStillAlive( ) const40 bool StructureSet::isStillAlive(VM& vm) const 41 41 { 42 42 for (Structure* structure : *this) { 43 if (! Heap::isMarked(structure))43 if (!vm.heap.isMarked(structure)) 44 44 return false; 45 45 } -
trunk/Source/JavaScriptCore/bytecode/StructureSet.h
r243163 r243467 56 56 57 57 void markIfCheap(SlotVisitor&) const; 58 bool isStillAlive( ) const;58 bool isStillAlive(VM&) const; 59 59 60 60 void dumpInContext(PrintStream&, DumpContext*) const; -
trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp
r235517 r243467 273 273 bufferedStructures.genericFilter( 274 274 [&] (Structure* structure) -> bool { 275 return Heap::isMarked(structure);275 return vm.heap.isMarked(structure); 276 276 }); 277 277 … … 280 280 case CacheType::PutByIdReplace: 281 281 case CacheType::InByIdSelf: 282 if ( Heap::isMarked(u.byIdSelf.baseObjectStructure.get()))282 if (vm.heap.isMarked(u.byIdSelf.baseObjectStructure.get())) 283 283 return; 284 284 break; -
trunk/Source/JavaScriptCore/dfg/DFGPlan.cpp
r242812 r243467 665 665 void Plan::finalizeInGC() 666 666 { 667 m_recordedStatuses.finalizeWithoutDeleting(); 667 ASSERT(m_vm); 668 m_recordedStatuses.finalizeWithoutDeleting(*m_vm); 668 669 } 669 670 … … 672 673 if (m_stage == Cancelled) 673 674 return false; 674 if (! Heap::isMarked(m_codeBlock->ownerExecutable()))675 if (!m_vm->heap.isMarked(m_codeBlock->ownerExecutable())) 675 676 return false; 676 if (! Heap::isMarked(m_codeBlock->alternative()))677 if (!m_vm->heap.isMarked(m_codeBlock->alternative())) 677 678 return false; 678 if (!!m_profiledDFGCodeBlock && ! Heap::isMarked(m_profiledDFGCodeBlock))679 if (!!m_profiledDFGCodeBlock && !m_vm->heap.isMarked(m_profiledDFGCodeBlock)) 679 680 return false; 680 681 return true; -
trunk/Source/JavaScriptCore/heap/GCIncomingRefCounted.h
r222113 r243467 83 83 // you're also walking the GC's list. 84 84 template<typename FilterFunctionType> 85 bool filterIncomingReferences(FilterFunctionType& );85 bool filterIncomingReferences(FilterFunctionType&&); 86 86 87 87 private: -
trunk/Source/JavaScriptCore/heap/GCIncomingRefCountedInlines.h
r206525 r243467 58 58 template<typename T> 59 59 template<typename FilterFunctionType> 60 bool GCIncomingRefCounted<T>::filterIncomingReferences(FilterFunctionType& filterFunction)60 bool GCIncomingRefCounted<T>::filterIncomingReferences(FilterFunctionType&& filterFunction) 61 61 { 62 62 const bool verbose = false; -
trunk/Source/JavaScriptCore/heap/GCIncomingRefCountedSet.h
r206525 r243467 42 42 bool addReference(JSCell*, T*); 43 43 44 void sweep( );44 void sweep(VM&); 45 45 46 46 size_t size() const { return m_bytes; }; 47 47 48 48 private: 49 static bool removeAll(JSCell*);50 static bool removeDead(JSCell*);51 52 49 Vector<T*> m_vector; 53 50 size_t m_bytes; -
trunk/Source/JavaScriptCore/heap/GCIncomingRefCountedSetInlines.h
r206525 r243467 41 41 { 42 42 for (size_t i = m_vector.size(); i--;) 43 m_vector[i]->filterIncomingReferences( removeAll);43 m_vector[i]->filterIncomingReferences([] (JSCell*) { return false; }); 44 44 } 45 45 … … 60 60 61 61 template<typename T> 62 void GCIncomingRefCountedSet<T>::sweep( )62 void GCIncomingRefCountedSet<T>::sweep(VM& vm) 63 63 { 64 64 for (size_t i = 0; i < m_vector.size(); ++i) { … … 67 67 ASSERT(object->isDeferred()); 68 68 ASSERT(object->numberOfIncomingReferences()); 69 if (!object->filterIncomingReferences( removeDead))69 if (!object->filterIncomingReferences([&] (JSCell* cell) { return vm.heap.isMarked(cell); })) 70 70 continue; 71 71 m_bytes -= size; … … 75 75 } 76 76 77 template<typename T>78 bool GCIncomingRefCountedSet<T>::removeAll(JSCell*)79 {80 return false;81 }82 83 template<typename T>84 bool GCIncomingRefCountedSet<T>::removeDead(JSCell* cell)85 {86 return Heap::isMarked(cell);87 }88 89 77 } // namespace JSC -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r243312 r243467 1011 1011 } 1012 1012 } else 1013 ASSERT( Heap::isMarked(cell));1013 ASSERT(isMarked(cell)); 1014 1014 // It could be that the object was *just* marked. This means that the collector may set the 1015 1015 // state to DefinitelyGrey and then to PossiblyOldOrBlack at any time. It's OK for us to … … 1495 1495 1496 1496 if (vm()->typeProfiler()) 1497 vm()->typeProfiler()->invalidateTypeSetCache( );1497 vm()->typeProfiler()->invalidateTypeSetCache(*vm()); 1498 1498 1499 1499 reapWeakHandles(); … … 2213 2213 void Heap::sweepArrayBuffers() 2214 2214 { 2215 m_arrayBuffers.sweep( );2215 m_arrayBuffers.sweep(*vm()); 2216 2216 } 2217 2217 … … 2834 2834 [&] (CodeBlock* codeBlock) { 2835 2835 // Visit the CodeBlock as a constraint only if it's black. 2836 if ( Heap::isMarked(codeBlock)2836 if (isMarked(codeBlock) 2837 2837 && codeBlock->cellState() == CellState::PossiblyBlack) 2838 2838 slotVisitor.visitAsConstraint(codeBlock); -
trunk/Source/JavaScriptCore/heap/Heap.h
r243086 r243467 124 124 static const unsigned s_timeCheckResolution = 16; 125 125 126 staticbool isMarked(const void*);126 bool isMarked(const void*); 127 127 static bool testAndSetMarked(HeapVersion, const void*); 128 128 -
trunk/Source/JavaScriptCore/heap/HeapInlines.h
r242070 r243467 69 69 } 70 70 71 // FIXME: This should be an instance method, so that it can get the markingVersion() quickly.72 // https://bugs.webkit.org/show_bug.cgi?id=17998873 71 ALWAYS_INLINE bool Heap::isMarked(const void* rawCell) 74 72 { … … 77 75 return cell->largeAllocation().isMarked(); 78 76 MarkedBlock& block = cell->markedBlock(); 79 return block.isMarked( block.vm()->heap.objectSpace().markingVersion(), cell);77 return block.isMarked(m_objectSpace.markingVersion(), cell); 80 78 } 81 79 -
trunk/Source/JavaScriptCore/heap/HeapSnapshotBuilder.cpp
r241787 r243467 81 81 ASSERT(m_profiler.activeSnapshotBuilder() == this); 82 82 83 ASSERT( Heap::isMarked(cell));83 ASSERT(m_profiler.vm().heap.isMarked(cell)); 84 84 85 85 NodeIdentifier identifier; -
trunk/Source/JavaScriptCore/heap/SlotVisitor.cpp
r242096 r243467 286 286 ALWAYS_INLINE void SlotVisitor::appendToMarkStack(ContainerType& container, JSCell* cell) 287 287 { 288 ASSERT( Heap::isMarked(cell));288 ASSERT(m_heap.isMarked(cell)); 289 289 ASSERT(!cell->isZapped()); 290 290 … … 355 355 ALWAYS_INLINE void SlotVisitor::visitChildren(const JSCell* cell) 356 356 { 357 ASSERT( Heap::isMarked(cell));357 ASSERT(m_heap.isMarked(cell)); 358 358 359 359 SetCurrentCellScope currentCellScope(*this, cell); -
trunk/Source/JavaScriptCore/jit/PolymorphicCallStubRoutine.cpp
r234086 r243467 131 131 } 132 132 133 bool PolymorphicCallStubRoutine::visitWeak(VM& )133 bool PolymorphicCallStubRoutine::visitWeak(VM& vm) 134 134 { 135 135 for (auto& variant : m_variants) { 136 if (! Heap::isMarked(variant.get()))136 if (!vm.heap.isMarked(variant.get())) 137 137 return false; 138 138 } -
trunk/Source/JavaScriptCore/runtime/ErrorInstance.cpp
r243232 r243467 213 213 // get caught in a trace. 214 214 for (const auto& frame : *m_stackTrace.get()) { 215 if (!frame.isMarked( )) {215 if (!frame.isMarked(vm)) { 216 216 computeErrorInfo(vm); 217 217 return; -
trunk/Source/JavaScriptCore/runtime/InferredValueInlines.h
r240965 r243467 35 35 36 36 if (value && value.isCell()) { 37 if ( Heap::isMarked(value.asCell()))37 if (vm.heap.isMarked(value.asCell())) 38 38 return; 39 39 -
trunk/Source/JavaScriptCore/runtime/StackFrame.h
r240255 r243467 59 59 60 60 void visitChildren(SlotVisitor&); 61 bool isMarked( ) const { return (!m_callee || Heap::isMarked(m_callee.get())) && (!m_codeBlock || Heap::isMarked(m_codeBlock.get())); }61 bool isMarked(VM& vm) const { return (!m_callee || vm.heap.isMarked(m_callee.get())) && (!m_codeBlock || vm.heap.isMarked(m_codeBlock.get())); } 62 62 63 63 private: -
trunk/Source/JavaScriptCore/runtime/Structure.cpp
r243069 r243467 1055 1055 } 1056 1056 1057 bool Structure::isCheapDuringGC( )1057 bool Structure::isCheapDuringGC(VM& vm) 1058 1058 { 1059 1059 // FIXME: We could make this even safer by returning false if this structure's property table … … 1061 1061 // https://bugs.webkit.org/show_bug.cgi?id=157334 1062 1062 1063 return (!m_globalObject || Heap::isMarked(m_globalObject.get()))1064 && (hasPolyProto() || !storedPrototypeObject() || Heap::isMarked(storedPrototypeObject()));1063 return (!m_globalObject || vm.heap.isMarked(m_globalObject.get())) 1064 && (hasPolyProto() || !storedPrototypeObject() || vm.heap.isMarked(storedPrototypeObject())); 1065 1065 } 1066 1066 1067 1067 bool Structure::markIfCheap(SlotVisitor& visitor) 1068 1068 { 1069 if (!isCheapDuringGC()) 1070 return Heap::isMarked(this); 1069 VM& vm = visitor.vm(); 1070 if (!isCheapDuringGC(vm)) 1071 return vm.heap.isMarked(this); 1071 1072 1072 1073 visitor.appendUnbarriered(this); -
trunk/Source/JavaScriptCore/runtime/Structure.h
r242100 r243467 300 300 // returns true if all user-controlled (and hence unbounded in size) objects referenced from the 301 301 // Structure are already marked. 302 bool isCheapDuringGC( );302 bool isCheapDuringGC(VM&); 303 303 304 304 // Returns true if this structure is now marked. -
trunk/Source/JavaScriptCore/runtime/TypeProfiler.cpp
r221954 r243467 149 149 } 150 150 151 void TypeProfiler::invalidateTypeSetCache( )151 void TypeProfiler::invalidateTypeSetCache(VM& vm) 152 152 { 153 153 for (Bag<TypeLocation>::iterator iter = m_typeLocationInfo.begin(); !!iter; ++iter) { 154 154 TypeLocation* location = *iter; 155 location->m_instructionTypeSet->invalidateCache( );155 location->m_instructionTypeSet->invalidateCache(vm); 156 156 if (location->m_globalTypeSet) 157 location->m_globalTypeSet->invalidateCache( );157 location->m_globalTypeSet->invalidateCache(vm); 158 158 } 159 159 } -
trunk/Source/JavaScriptCore/runtime/TypeProfiler.h
r218794 r243467 125 125 GlobalVariableID getNextUniqueVariableID() { return m_nextUniqueVariableID++; } 126 126 TypeLocation* nextTypeLocation(); 127 void invalidateTypeSetCache( );127 void invalidateTypeSetCache(VM&); 128 128 void dumpTypeProfilerData(VM&); 129 129 -
trunk/Source/JavaScriptCore/runtime/TypeSet.cpp
r242812 r243467 80 80 } 81 81 82 void TypeSet::invalidateCache( )82 void TypeSet::invalidateCache(VM& vm) 83 83 { 84 84 ConcurrentJSLocker locker(m_lock); 85 auto keepMarkedStructuresFilter = [] (Structure* structure) -> bool { return Heap::isMarked(structure); }; 85 auto keepMarkedStructuresFilter = [&] (Structure* structure) -> bool { 86 return vm.heap.isMarked(structure); 87 }; 86 88 m_structureSet.genericFilter(keepMarkedStructuresFilter); 87 89 } -
trunk/Source/JavaScriptCore/runtime/TypeSet.h
r242812 r243467 87 87 TypeSet(); 88 88 void addTypeInformation(RuntimeType, RefPtr<StructureShape>&&, Structure*, bool sawPolyProtoStructure); 89 void invalidateCache( );89 void invalidateCache(VM&); 90 90 String dumpTypes() const; 91 91 String displayName() const; -
trunk/Source/JavaScriptCore/runtime/WeakMapImpl.cpp
r233765 r243467 65 65 void WeakMapImpl<WeakMapBucket<WeakMapBucketDataKeyValue>>::visitOutputConstraints(JSCell* cell, SlotVisitor& visitor) 66 66 { 67 VM& vm = visitor.vm(); 67 68 auto* thisObject = jsCast<WeakMapImpl*>(cell); 68 69 auto locker = holdLock(thisObject->cellLock()); … … 72 73 if (bucket->isEmpty() || bucket->isDeleted()) 73 74 continue; 74 if (! Heap::isMarked(bucket->key()))75 if (!vm.heap.isMarked(bucket->key())) 75 76 continue; 76 77 bucket->visitAggregate(visitor); -
trunk/Source/JavaScriptCore/runtime/WeakMapImplInlines.h
r226017 r243467 32 32 // Note that this function can be executed in parallel as long as the mutator stops. 33 33 template<typename WeakMapBucket> 34 void WeakMapImpl<WeakMapBucket>::finalizeUnconditionally(VM& )34 void WeakMapImpl<WeakMapBucket>::finalizeUnconditionally(VM& vm) 35 35 { 36 36 auto* buffer = this->buffer(); … … 40 40 continue; 41 41 42 if ( Heap::isMarked(bucket->key()))42 if (vm.heap.isMarked(bucket->key())) 43 43 continue; 44 44
Note:
See TracChangeset
for help on using the changeset viewer.