Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
chakrashim: update chakracore to
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Halliday committed Nov 21, 2016
1 parent 9c745fd commit ff2d221
Show file tree
Hide file tree
Showing 59 changed files with 2,481 additions and 1,895 deletions.
28 changes: 28 additions & 0 deletions deps/chakrashim/core/lib/Runtime/Base/EtwTrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ void EtwTrace::PerformRundown(bool start)

scriptContext->MapFunction([&start] (FunctionBody* body)
{
#if DYNAMIC_INTERPRETER_THUNK
if(body->HasInterpreterThunkGenerated())
{
if(start)
Expand All @@ -158,7 +159,9 @@ void EtwTrace::PerformRundown(bool start)
LogMethodInterpretedThunkEvent(EventWriteMethodDCEnd, body);
}
}
#endif

#if ENABLE_NATIVE_CODEGEN
body->MapEntryPoints([&](int index, FunctionEntryPointInfo * entryPoint)
{
if(entryPoint->IsCodeGenDone())
Expand Down Expand Up @@ -191,6 +194,7 @@ void EtwTrace::PerformRundown(bool start)
}
});
});
#endif
});

scriptContext = scriptContext->next;
Expand Down Expand Up @@ -260,33 +264,57 @@ void EtwTrace::LogSourceUnloadEvents(ScriptContext* scriptContext)

void EtwTrace::LogMethodInterpreterThunkLoadEvent(FunctionBody* body)
{
#if DYNAMIC_INTERPRETER_THUNK
LogMethodInterpretedThunkEvent(EventWriteMethodLoad, body);
#else
Assert(false); // Caller should not be enabled if Dynamic Interpreter Thunks are disabled
#endif
}

void EtwTrace::LogMethodNativeLoadEvent(FunctionBody* body, FunctionEntryPointInfo* entryPoint)
{
#if ENABLE_NATIVE_CODEGEN
LogMethodNativeEvent(EventWriteMethodLoad, body, entryPoint);
#else
Assert(false); // Caller should not be enabled if JIT is disabled
#endif
}

void EtwTrace::LogLoopBodyLoadEvent(FunctionBody* body, LoopHeader* loopHeader, LoopEntryPointInfo* entryPoint, uint16 loopNumber)
{
#if ENABLE_NATIVE_CODEGEN
LogLoopBodyEventBG(EventWriteMethodLoad, body, loopHeader, entryPoint, loopNumber);
#else
Assert(false); // Caller should not be enabled if JIT is disabled
#endif
}

void EtwTrace::LogMethodInterpreterThunkUnloadEvent(FunctionBody* body)
{
#if DYNAMIC_INTERPRETER_THUNK
LogMethodInterpretedThunkEvent(EventWriteMethodUnload, body);
#else
Assert(false); // Caller should not be enabled if dynamic interpreter thunks are disabled
#endif
}


void EtwTrace::LogMethodNativeUnloadEvent(FunctionBody* body, FunctionEntryPointInfo* entryPoint)
{
#if ENABLE_NATIVE_CODEGEN
LogMethodNativeEvent(EventWriteMethodUnload, body, entryPoint);
#else
Assert(false); // Caller should not be enabled if JIT is disabled
#endif
}

void EtwTrace::LogLoopBodyUnloadEvent(FunctionBody* body, LoopHeader* loopHeader, LoopEntryPointInfo* entryPoint)
{
#if ENABLE_NATIVE_CODEGEN
LogLoopBodyEvent(EventWriteMethodUnload, body, loopHeader, entryPoint);
#else
Assert(false); // Caller should not be enabled if JIT is disabled
#endif
}


Expand Down
20 changes: 11 additions & 9 deletions deps/chakrashim/core/lib/Runtime/Base/FunctionBody.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,10 +747,10 @@ namespace Js
return !!pActiveFuncs->TestAndSet(this->GetFunctionNumber());
}

void FunctionBody::UpdateActiveFunctionsForOneDataSet(ActiveFunctionSet *pActiveFuncs, FunctionCodeGenRuntimeData **dataSet) const
void FunctionBody::UpdateActiveFunctionsForOneDataSet(ActiveFunctionSet *pActiveFuncs, FunctionCodeGenRuntimeData **dataSet, uint count) const
{
FunctionCodeGenRuntimeData *inlineeData;
for (uint i = 0; i < this->GetProfiledCallSiteCount(); i++)
for (uint i = 0; i < count; i++)
{
for (inlineeData = dataSet[i]; inlineeData; inlineeData = inlineeData->GetNext())
{
Expand All @@ -762,16 +762,15 @@ namespace Js
void FunctionBody::UpdateActiveFunctionSet(ActiveFunctionSet *pActiveFuncs, FunctionCodeGenRuntimeData *callSiteData) const
{
// Always walk the inlinee and ldFldInlinee data (if we have them), as they are different at each call site.

if (callSiteData)
{
if (callSiteData->GetInlinees())
{
this->UpdateActiveFunctionsForOneDataSet(pActiveFuncs, callSiteData->GetInlinees());
this->UpdateActiveFunctionsForOneDataSet(pActiveFuncs, callSiteData->GetInlinees(), this->GetProfiledCallSiteCount());
}
if (callSiteData->GetLdFldInlinees())
{
this->UpdateActiveFunctionsForOneDataSet(pActiveFuncs, callSiteData->GetLdFldInlinees());
this->UpdateActiveFunctionsForOneDataSet(pActiveFuncs, callSiteData->GetLdFldInlinees(), this->GetInlineCacheCount());
}
}

Expand All @@ -782,12 +781,15 @@ namespace Js
return;
}
FunctionCodeGenRuntimeData **data = this->GetCodeGenRuntimeData();
if (data == nullptr)
if (data != nullptr)
{
return;
this->UpdateActiveFunctionsForOneDataSet(pActiveFuncs, data, this->GetProfiledCallSiteCount());
}
data = this->GetCodeGenGetSetRuntimeData();
if (data != nullptr)
{
this->UpdateActiveFunctionsForOneDataSet(pActiveFuncs, data, this->GetInlineCacheCount());
}

this->UpdateActiveFunctionsForOneDataSet(pActiveFuncs, data);
}

bool FunctionBody::DoRedeferFunction(uint inactiveThreshold) const
Expand Down
2 changes: 1 addition & 1 deletion deps/chakrashim/core/lib/Runtime/Base/FunctionBody.h
Original file line number Diff line number Diff line change
Expand Up @@ -2581,7 +2581,7 @@ namespace Js
bool IsActiveFunction(ActiveFunctionSet * pActiveFuncs) const;
bool TestAndUpdateActiveFunctions(ActiveFunctionSet * pActiveFuncs) const;
void UpdateActiveFunctionSet(ActiveFunctionSet * pActiveFuncs, FunctionCodeGenRuntimeData *callSiteData) const;
void UpdateActiveFunctionsForOneDataSet(ActiveFunctionSet *pActiveFuncs, FunctionCodeGenRuntimeData **dataSet) const;
void UpdateActiveFunctionsForOneDataSet(ActiveFunctionSet *pActiveFuncs, FunctionCodeGenRuntimeData **dataSet, uint count) const;
uint GetInactiveCount() const { return inactiveCount; }
void SetInactiveCount(uint count) { inactiveCount = count; }
void IncrInactiveCount(uint increment);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ namespace Js
for (int i = 0; i < WAsmJs::LIMIT; ++i)
{
WAsmJs::Types type = (WAsmJs::Types)i;
if (func->GetTypedRegisterAllocator().IsTypeExcluded(type))
{
continue;
}
uint constCount = func->GetTypedRegisterAllocator().GetRegisterSpace(type)->GetConstCount();
if (constCount > 0)
{
Expand Down
2 changes: 1 addition & 1 deletion deps/chakrashim/core/lib/Runtime/Library/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if(BuildJIT)
add_definitions(-D_ENABLE_ASM_JS=1)
add_definitions(-D_ENABLE_DYNAMIC_THUNKS=1)
endif()

set(CRLIB_SOURCE_CODES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
</ItemGroup>
<ItemGroup>
<MASM Include="$(MSBuildThisFileDirectory)amd64\JavascriptFunctionA.asm">
<PreprocessorDefinitions Condition="'$(BuildJIT)'!='false'">%(PreprocessorDefinitions);_ENABLE_ASM_JS=1</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(BuildJIT)'!='false'">%(PreprocessorDefinitions);_ENABLE_DYNAMIC_THUNKS=1</PreprocessorDefinitions>
<ExcludedFromBuild Condition="'$(Platform)'!='x64'">true</ExcludedFromBuild>
</MASM>
<ARMASM Include="$(MSBuildThisFileDirectory)arm\arm_DeferredDeserializeThunk.asm">
Expand Down
Loading

0 comments on commit ff2d221

Please sign in to comment.