Skip to content

Commit 834293b

Browse files
author
Thomas Moore (CHAKRA)
committed
[MERGE #5284 @thomasmo] Fix assertion when dumping encoder with foreground JIT
Merge pull request #5284 from thomasmo:dump_encoder_assert While outputting offsets in the EncoderPhase, several asserts can be hit because the state of the EntryPointInfo is Queued, where it is expected to be Recorded or Done. The effect is that there is no base address available for the right output. The fix is to move the calls with that dependency to after the state transitions to Recorded.
2 parents cf87c70 + f1a6bee commit 834293b

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/Backend/Encoder.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,8 +797,6 @@ Encoder::Encode()
797797

798798
if (PHASE_DUMP(Js::EncoderPhase, m_func) && Js::Configuration::Global.flags.Verbose && !m_func->IsOOPJIT())
799799
{
800-
m_func->GetInProcJITEntryPointInfo()->DumpNativeOffsetMaps();
801-
m_func->GetInProcJITEntryPointInfo()->DumpNativeThrowSpanSequence();
802800
this->DumpInlineeFrameMap(m_func->GetJITOutput()->GetCodeAddress());
803801
Output::Flush();
804802
}

lib/Backend/NativeCodeGenerator.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,15 @@ NativeCodeGenerator::CodeGen(PageAllocator * pageAllocator, CodeGenWorkItem* wor
11921192

11931193
workItem->GetEntryPoint()->SetCodeGenRecorded((Js::JavascriptMethod)jitWriteData.thunkAddress, (Js::JavascriptMethod)jitWriteData.codeAddress, jitWriteData.codeSize, (void *)this);
11941194

1195+
#if DBG_DUMP
1196+
if (PHASE_DUMP(Js::EncoderPhase, workItem->GetFunctionBody()) && Js::Configuration::Global.flags.Verbose && !JITManager::GetJITManager()->IsOOPJITEnabled())
1197+
{
1198+
workItem->GetEntryPoint()->DumpNativeOffsetMaps();
1199+
workItem->GetEntryPoint()->DumpNativeThrowSpanSequence();
1200+
Output::Flush();
1201+
}
1202+
#endif
1203+
11951204
if (jitWriteData.hasBailoutInstr != FALSE)
11961205
{
11971206
body->SetHasBailoutInstrInJittedCode(true);

0 commit comments

Comments
 (0)