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
11 changes: 10 additions & 1 deletion src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,16 @@ void MyICJI::notifyInstructionSetUsage(CORINFO_InstructionSet instructionSet, bo
DWORD MyICJI::getJitFlags(CORJIT_FLAGS* jitFlags, DWORD sizeInBytes)
{
jitInstance->mc->cr->AddCall("getJitFlags");
return jitInstance->mc->repGetJitFlags(jitFlags, sizeInBytes);
DWORD ret = jitInstance->mc->repGetJitFlags(jitFlags, sizeInBytes);
if (jitInstance->forceClearAltJitFlag)
{
jitFlags->Clear(CORJIT_FLAGS::CORJIT_FLAG_ALT_JIT);
}
else if (jitInstance->forceSetAltJitFlag)
{
jitFlags->Set(CORJIT_FLAGS::CORJIT_FLAG_ALT_JIT);
}
return ret;
}

// Runs the given function with the given parameter under an error trap
Expand Down
31 changes: 30 additions & 1 deletion src/coreclr/src/ToolBox/superpmi/superpmi/jitinstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,38 @@ JitInstance* JitInstance::InitJit(char* nameOfJit,
}

jit->forceOptions = forceOptions;

jit->options = options;

// The flag to cause the JIT to be invoked as an altjit is stored in the jit flags, not in
// the environment. If the user uses the "-jitoption force" flag to force AltJit off (it was
// probably on during collection), or to force it on, then propagate that to the jit flags.
jit->forceClearAltJitFlag = false;
jit->forceSetAltJitFlag = false;
const WCHAR* altJitFlag = jit->getForceOption(W("AltJit"));
if (altJitFlag != nullptr)
{
if (wcscmp(altJitFlag, W("")) == 0)
{
jit->forceClearAltJitFlag = true;
}
else
{
jit->forceSetAltJitFlag = true;
}
}
const WCHAR* altJitNgenFlag = jit->getForceOption(W("AltJitNgen"));
if (altJitNgenFlag != nullptr)
{
if (wcscmp(altJitNgenFlag, W("")) == 0)
{
jit->forceClearAltJitFlag = true;
}
else
{
jit->forceSetAltJitFlag = true;
}
}

jit->environment.getIntConfigValue = nullptr;
jit->environment.getStingConfigValue = nullptr;

Expand Down
4 changes: 4 additions & 0 deletions src/coreclr/src/ToolBox/superpmi/superpmi/jitinstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ class JitInstance
void timeResult(CORINFO_METHOD_INFO info, unsigned flags);

public:

bool forceClearAltJitFlag;
bool forceSetAltJitFlag;

enum Result
{
RESULT_ERROR,
Expand Down