Skip to content

Commit 8e1ec0a

Browse files
author
Thomas Moore (CHAKRA)
committed
Fix assertion when dumping encoder with foreground JIT
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.
1 parent cf87c70 commit 8e1ec0a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,13 @@ 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 (PHASE_DUMP(Js::EncoderPhase, workItem->GetFunctionBody()) && Js::Configuration::Global.flags.Verbose && !JITManager::GetJITManager()->IsOOPJITEnabled())
1196+
{
1197+
workItem->GetEntryPoint()->DumpNativeOffsetMaps();
1198+
workItem->GetEntryPoint()->DumpNativeThrowSpanSequence();
1199+
Output::Flush();
1200+
}
1201+
11951202
if (jitWriteData.hasBailoutInstr != FALSE)
11961203
{
11971204
body->SetHasBailoutInstrInJittedCode(true);

0 commit comments

Comments
 (0)