-
Notifications
You must be signed in to change notification settings - Fork 5k
Move GetMethodTable and IsReference to JIT #88860
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
Changes from all 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 |
---|---|---|
|
@@ -4889,6 +4889,32 @@ bool Compiler::gtMarkAddrMode(GenTree* addr, int* pCostEx, int* pCostSz, var_typ | |
return false; | ||
} | ||
|
||
//------------------------------------------------------------------------------ | ||
// gtGetFlagsForOperand : Get flags for an operation over the operant | ||
// | ||
// Arguments: | ||
// oper - Performed operation | ||
// op - Operand | ||
// | ||
// Return Value: | ||
// Flags required by the operand | ||
GenTreeFlags Compiler::gtGetFlagsForOperand(genTreeOps oper, GenTree* op) | ||
{ | ||
GenTreeFlags flags = GTF_EMPTY; | ||
if ((oper == GT_IND) && op->IsIconHandle()) | ||
{ | ||
flags |= GTF_IND_NONFAULTING; | ||
|
||
GenTreeFlags handleKind = op->GetIconHandleFlag(); | ||
if ((handleKind != GTF_ICON_STATIC_HDL) && (handleKind != GTF_ICON_BBC_PTR) && | ||
(handleKind != GTF_ICON_GLOBAL_PTR)) | ||
{ | ||
flags |= GTF_IND_INVARIANT; | ||
} | ||
} | ||
Comment on lines
+4903
to
+4914
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. This invariantness setting is fragile; it does not check what type is being loaded. 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. Yes, I had the same concern - like why do we expect invariantess if we acess a byte location with long type |
||
return flags; | ||
} | ||
|
||
/***************************************************************************** | ||
* | ||
* Given a tree, figure out the order in which its sub-operands should be | ||
|
@@ -8214,6 +8240,7 @@ GenTreeBlk* Compiler::gtNewBlkIndir(ClassLayout* layout, GenTree* addr, GenTreeF | |
// | ||
GenTreeIndir* Compiler::gtNewIndir(var_types typ, GenTree* addr, GenTreeFlags indirFlags) | ||
{ | ||
indirFlags |= gtGetFlagsForOperand(GT_IND, addr); | ||
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. Why is this needed here? The caller is expected to pass the right 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. I bet it's not needed it's just how @MichalPetryka was trying to find the case where it's not set (turned out be assertprop) |
||
GenTreeIndir* indir = new (this, GT_IND) GenTreeIndir(GT_IND, typ, addr, nullptr); | ||
gtInitializeIndirNode(indir, indirFlags); | ||
|
||
|
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.
This flag updating call should be moved to this place in morph:
runtime/src/coreclr/jit/morph.cpp
Lines 9568 to 9571 in 7980417