-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
JIT: save generics context for late devirtualization #63420
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9950,6 +9950,22 @@ var_types Compiler::impImportCall(OPCODE opcode, | |
} | ||
else | ||
{ | ||
// If the call is virtual, and has a generics context, and is not going to have a class probe, | ||
// record the context for possible use during late devirt. | ||
// | ||
// If we ever want to devirt at Tier0, and/or see issues where OSR methods under PGO lose | ||
// important devirtualizations, we'll want to allow both a class probe and a captured context. | ||
// | ||
if (origCall->IsVirtual() && (origCall->gtCallType != CT_INDIRECT) && (exactContextHnd != nullptr) && | ||
(origCall->gtClassProfileCandidateInfo == nullptr)) | ||
{ | ||
JITDUMP("\nSaving context %p for call [%06u]\n", exactContextHnd, dspTreeID(origCall)); | ||
origCall->gtCallMoreFlags |= GTF_CALL_M_LATE_DEVIRT; | ||
LateDevirtualizationInfo* const info = new (this, CMK_Inlining) LateDevirtualizationInfo; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you planning to add more fields to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe? That's what I meant by
|
||
info->exactContextHnd = exactContextHnd; | ||
origCall->gtLateDevirtualizationInfo = info; | ||
} | ||
|
||
if (isFatPointerCandidate) | ||
{ | ||
// fatPointer candidates should be in statements of the form call() or var = call(). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a nit: there is
IsTailPrefixedCall()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, will change it over. Also, we already know
call
isGenTreeCall*
.