Plan::Plan(CodeBlock* passedCodeBlock, CodeBlock* profiledDFGCodeBlock,
CompilationMode mode, unsigned osrEntryBytecodeIndex,
const Operands<JSValue>& mustHandleValues)
- : vm(*passedCodeBlock->vm())
+ : vm(passedCodeBlock->vm())
, codeBlock(passedCodeBlock)
, profiledDFGCodeBlock(profiledDFGCodeBlock)
, mode(mode)
, osrEntryBytecodeIndex(osrEntryBytecodeIndex)
, mustHandleValues(mustHandleValues)
- , compilation(codeBlock->vm()->m_perBytecodeProfiler ? adoptRef(new Profiler::Compilation(codeBlock->vm()->m_perBytecodeProfiler->ensureBytecodesFor(codeBlock), profilerCompilationKindForMode(mode))) : 0)
+ , compilation(vm->m_perBytecodeProfiler ? adoptRef(new Profiler::Compilation(vm->m_perBytecodeProfiler->ensureBytecodesFor(codeBlock), profilerCompilationKindForMode(mode))) : 0)
, inlineCallFrames(adoptRef(new InlineCallFrameSet()))
, identifiers(codeBlock)
, weakReferences(codeBlock)
{
return reportCompileTimes()
|| Options::reportTotalCompileTimes()
- || vm.m_perBytecodeProfiler;
+ || (vm && vm->m_perBytecodeProfiler);
}
bool Plan::reportCompileTimes() const
dataLog("\n");
}
- Graph dfg(vm, *this, longLivedState);
+ Graph dfg(*vm, *this, longLivedState);
if (!parse(dfg)) {
finalizer = std::make_unique<FailedFinalizer>(*this);
void Plan::reallyAdd(CommonData* commonData)
{
watchpoints.reallyAdd(codeBlock, *commonData);
- identifiers.reallyAdd(vm, commonData);
- weakReferences.reallyAdd(vm, commonData);
- transitions.reallyAdd(vm, commonData);
+ identifiers.reallyAdd(*vm, commonData);
+ weakReferences.reallyAdd(*vm, commonData);
+ transitions.reallyAdd(*vm, commonData);
}
void Plan::notifyCompiling()
CompilationResult Plan::finalizeWithoutNotifyingCallback()
{
// We will establish new references from the code block to things. So, we need a barrier.
- vm.heap.writeBarrier(codeBlock);
+ vm->heap.writeBarrier(codeBlock);
if (!isStillValid()) {
CODEBLOCK_LOG_EVENT(codeBlock, "dfgFinalize", ("invalidated"));
void Plan::cancel()
{
+ vm = nullptr;
codeBlock = nullptr;
profiledDFGCodeBlock = nullptr;
mustHandleValues.clear();