Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix pinning number chunks for in-proc JIT #1604

Merged
merged 2 commits into from
Sep 20, 2016
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/Backend/JITOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ JITOutput::FinalizeNativeCode(Func *func, EmitBufferAllocation * alloc)
{
func->GetInProcJITEntryPointInfo()->SetInProcJITNativeCodeData(func->GetNativeCodeDataAllocator()->Finalize());
func->GetInProcJITEntryPointInfo()->GetJitTransferData()->SetRawData(func->GetTransferDataAllocator()->Finalize());
#if !FLOATVAR
CodeGenNumberChunk * numberChunks = func->GetNumberAllocator()->Finalize();
func->GetInProcJITEntryPointInfo()->SetNumberChunks(numberChunks);
#endif
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Runtime/Base/FunctionBody.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7790,9 +7790,9 @@ namespace Js

if (this->numberPageSegments)
{
auto numberChunks = this->GetScriptContext()->GetThreadContext()
auto numberArray = this->GetScriptContext()->GetThreadContext()
->GetXProcNumberPageSegmentManager()->RegisterSegments(this->numberPageSegments);
this->SetNumberChunks(numberChunks);
this->SetNumberArray(numberArray);
this->numberPageSegments = nullptr;
}
}
Expand Down
16 changes: 13 additions & 3 deletions lib/Runtime/Base/FunctionBody.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
struct CodeGenWorkItem;
class SourceContextInfo;
struct DeferredFunctionStub;
struct CodeGenNumberChunk;
#ifdef DYNAMIC_PROFILE_MUTATOR
class DynamicProfileMutator;
class DynamicProfileMutatorImpl;
Expand Down Expand Up @@ -512,7 +513,11 @@ namespace Js
#if ENABLE_NATIVE_CODEGEN
NativeCodeData * inProcJITNaticeCodedata;
char* nativeDataBuffer;
Js::JavascriptNumber** numberChunks;
union
{
Js::JavascriptNumber** numberArray;
CodeGenNumberChunk* numberChunks;
};
XProcNumberPageSegment* numberPageSegments;
#endif

Expand Down Expand Up @@ -577,11 +582,16 @@ namespace Js
char** GetNativeDataBufferRef() { return &nativeDataBuffer; }
char* GetNativeDataBuffer() { return nativeDataBuffer; }
void SetInProcJITNativeCodeData(NativeCodeData* nativeCodeData) { inProcJITNaticeCodedata = nativeCodeData; }
void SetNumberChunks(Js::JavascriptNumber** chunks)
void SetNumberChunks(CodeGenNumberChunk* chunks)
{
Assert(numberPageSegments != nullptr);
Assert(numberPageSegments == nullptr);
numberChunks = chunks;
}
void SetNumberArray(Js::JavascriptNumber** array)
{
Assert(numberPageSegments != nullptr);
numberArray = array;
}
void SetNumberPageSegment(XProcNumberPageSegment * segments)
{
Assert(numberPageSegments == nullptr);
Expand Down