void PropertyCondition::validateReferences(const TrackedReferences& tracked) const { if (hasPrototype()) tracked.check(prototype()); if (hasRequiredValue()) tracked.check(requiredValue()); }
void MinifiedGraph::validateReferences(const TrackedReferences& trackedReferences) { for (MinifiedNode& node : m_list) { if (node.hasConstant()) trackedReferences.check(node.constant()); } }
void StructureSet::validateReferences(const TrackedReferences& trackedReferences) const { forEach( [&] (Structure* structure) { trackedReferences.check(structure); }); }
void RegisteredStructureSet::validateReferences(const TrackedReferences& trackedReferences) const { // The type system should help us here, but protect people from getting that wrong using bitwise_cast or something crazy. forEach( [&] (RegisteredStructure structure) { trackedReferences.check(structure.get()); }); }
void ObjectPropertyCondition::validateReferences(const TrackedReferences& tracked) const { if (!*this) return; tracked.check(m_object); m_condition.validateReferences(tracked); }
void CommonData::validateReferences(const TrackedReferences& trackedReferences) { if (InlineCallFrameSet* set = inlineCallFrames.get()) { for (InlineCallFrame* inlineCallFrame : *set) { for (ValueRecovery& recovery : inlineCallFrame->arguments) { if (recovery.isConstant()) trackedReferences.check(recovery.constant()); } if (CodeBlock* baselineCodeBlock = inlineCallFrame->baselineCodeBlock.get()) trackedReferences.check(baselineCodeBlock); if (inlineCallFrame->calleeRecovery.isConstant()) trackedReferences.check(inlineCallFrame->calleeRecovery.constant()); } } for (AdaptiveStructureWatchpoint* watchpoint : adaptiveStructureWatchpoints) watchpoint->key().validateReferences(trackedReferences); }
CompilationResult Plan::finalizeWithoutNotifyingCallback() { // We will establish new references from the code block to things. So, we need a barrier. vm->heap.writeBarrier(codeBlock); if (!isStillValid()) { CODEBLOCK_LOG_EVENT(codeBlock, "dfgFinalize", ("invalidated")); return CompilationInvalidated; } bool result; if (codeBlock->codeType() == FunctionCode) result = finalizer->finalizeFunction(); else result = finalizer->finalize(); if (!result) { CODEBLOCK_LOG_EVENT(codeBlock, "dfgFinalize", ("failed")); return CompilationFailed; } reallyAdd(codeBlock->jitCode()->dfgCommon()); if (validationEnabled()) { TrackedReferences trackedReferences; for (WriteBarrier<JSCell>& reference : codeBlock->jitCode()->dfgCommon()->weakReferences) trackedReferences.add(reference.get()); for (WriteBarrier<Structure>& reference : codeBlock->jitCode()->dfgCommon()->weakStructureReferences) trackedReferences.add(reference.get()); for (WriteBarrier<Unknown>& constant : codeBlock->constants()) trackedReferences.add(constant.get()); // Check that any other references that we have anywhere in the JITCode are also // tracked either strongly or weakly. codeBlock->jitCode()->validateReferences(trackedReferences); } CODEBLOCK_LOG_EVENT(codeBlock, "dfgFinalize", ("succeeded")); return CompilationSuccessful; }
void AbstractValue::validateReferences(const TrackedReferences& trackedReferences) { trackedReferences.check(m_value); m_structure.validateReferences(trackedReferences); }