Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
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
17 changes: 17 additions & 0 deletions src/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16209,6 +16209,23 @@ GenTreePtr Compiler::fgInitThisClass()
}
else
{
#ifdef FEATURE_READYTORUN_COMPILER
// Only CoreRT understands CORINFO_HELP_READYTORUN_GENERIC_STATIC_BASE. Don't do this on CoreCLR.
if (opts.IsReadyToRun() && eeGetEEInfo()->targetAbi == CORINFO_CORERT_ABI)
{
CORINFO_RESOLVED_TOKEN resolvedToken;
ZeroMemory(&resolvedToken, sizeof(resolvedToken));
Copy link

Choose a reason for hiding this comment

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

IIRC we prefer memset in the JIT to ZeroMemory.

Copy link

Choose a reason for hiding this comment

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

CORINFO_RESOLVED_TOKEN resolvedToken { }; 😁

Copy link
Member Author

@MichalStrehovsky MichalStrehovsky Oct 27, 2016

Choose a reason for hiding this comment

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

I copypasted this from the nongeneric ReadyToRun path. I will fix it in both in a separate pull request. I really want to merge this before the "#7837 Introduce new CORJIT_FLAGS type" pull request gets merged because I need this to unblock myself on CoreRT and I would rather not deal with updating JitInterface on CoreRT right now.


GenTreePtr ctxTree = getRuntimeContextTree(kind.runtimeLookupKind);

// CORINFO_HELP_READYTORUN_GENERIC_STATIC_BASE with a zeroed out resolvedToken means "get the static
// base of the class that owns the method being compiled". If we're in this method, it means we're not
// inlining and there's no ambiguity.
return impReadyToRunHelperToTree(&resolvedToken, CORINFO_HELP_READYTORUN_GENERIC_STATIC_BASE, TYP_BYREF,
gtNewArgList(ctxTree), &kind);
}
#endif

// Collectible types requires that for shared generic code, if we use the generic context paramter
// that we report it. (This is a conservative approach, we could detect some cases particularly when the
// context parameter is this that we don't need the eager reporting logic.)
Expand Down