Skip to content

Commit

Permalink
[MERGE #1604 @leirocks] fix pinning number chunks for in-proc JIT
Browse files Browse the repository at this point in the history
Merge pull request #1604 from leirocks:inprocnumber
  • Loading branch information
leirocks committed Sep 20, 2016
2 parents b45eaf8 + fb128e5 commit 8d56262
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
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

0 comments on commit 8d56262

Please sign in to comment.