Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Backend/CodeGenWorkItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct CodeGenWorkItem : public JsUtil::Job

uint GetFunctionNumber() const
{
return this->jitData.jitData->bodyData->funcNumber;
return this->functionBody->GetFunctionNumber();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this->functionBody [](start = 15, length = 18)

What the difference between this->functionBody and this->jitData.jitData->bodyData? Also wondering why we could get AV in the latter case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this->jitData.jitData is not initialized until NativeCodeGenerator::CodeGen, whereas functionBody is passed as argument to the constructor of CodeGenWorkItem so is there from the beginning.

This area definitely got a bit messy with OOP JIT, and I'm planning on doing bigger cleanup of CodeGenWorkItem to address this sort of strangeness.

}

ExecutionMode GetJitMode() const
Expand Down
4 changes: 2 additions & 2 deletions lib/Backend/NativeCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -958,8 +958,6 @@ NativeCodeGenerator::CodeGen(PageAllocator * pageAllocator, CodeGenWorkItem* wor
(((double)((end_time.QuadPart - jitWriteData.startTime)* (double)1000.0 / (double)freq.QuadPart))) / (1));
Output::Flush();
}
NativeCodeGenerator::LogCodeGenDone(workItem, &start_time);


workItem->GetFunctionBody()->SetFrameHeight(workItem->GetEntryPoint(), jitWriteData.frameHeight);

Expand Down Expand Up @@ -1151,6 +1149,8 @@ NativeCodeGenerator::CodeGen(PageAllocator * pageAllocator, CodeGenWorkItem* wor
}
#endif

NativeCodeGenerator::LogCodeGenDone(workItem, &start_time);

#ifdef ENABLE_BASIC_TELEMETRY
scriptContext->GetThreadContext()->JITTelemetry.LogTime(scriptContext->GetThreadContext()->JITTelemetry.Now() - startTime);
#endif
Expand Down