This repository was archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Enable checking of GTF_EXCEPT and GTF_ASG flags. #13668
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
479ebf7
Enable checking of GTF_EXCEPT and GTF_ASG flags.
erozenfeld f38b45b
Address code review feedback.
erozenfeld f85d335
Additional code review feedback.
erozenfeld 7121a43
Move GTF_ARRLEN_NONFAULTING down.
erozenfeld b4eda94
More review feedback.
erozenfeld File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1121,8 +1121,21 @@ inline GenTreePtr Compiler::gtNewIconEmbFldHndNode(CORINFO_FIELD_HANDLE fldHnd, | |
|
|
||
| /*****************************************************************************/ | ||
|
|
||
| inline GenTreeCall* Compiler::gtNewHelperCallNode(unsigned helper, var_types type, unsigned flags, GenTreeArgList* args) | ||
| //------------------------------------------------------------------------------ | ||
| // gtNewHelperCallNode : Helper to create a call helper node. | ||
| // | ||
| // | ||
| // Arguments: | ||
| // helper - Call helper | ||
| // type - Type of the node | ||
| // args - Call args | ||
| // | ||
| // Return Value: | ||
| // New CT_HELPER node | ||
|
|
||
| inline GenTreeCall* Compiler::gtNewHelperCallNode(unsigned helper, var_types type, GenTreeArgList* args) | ||
| { | ||
| unsigned flags = s_helperCallProperties.NoThrow((CorInfoHelpFunc)helper) ? 0 : GTF_EXCEPT; | ||
| GenTreeCall* result = gtNewCallNode(CT_HELPER, eeFindHelper(helper), type, args); | ||
| result->gtFlags |= flags; | ||
|
|
||
|
|
@@ -1228,6 +1241,43 @@ inline GenTreePtr Compiler::gtNewIndexRef(var_types typ, GenTreePtr arrayOp, Gen | |
| return gtIndx; | ||
| } | ||
|
|
||
| //------------------------------------------------------------------------------ | ||
| // gtNewArrLen : Helper to create an array length node. | ||
| // | ||
| // | ||
| // Arguments: | ||
| // typ - Type of the node | ||
| // arrayOp - Array node | ||
| // lenOffset - Offset of the length field | ||
| // | ||
| // Return Value: | ||
| // New GT_ARR_LENGTH node | ||
|
|
||
| inline GenTreeArrLen* Compiler::gtNewArrLen(var_types typ, GenTree* arrayOp, int lenOffset) | ||
| { | ||
| GenTreeArrLen* arrLen = new (this, GT_ARR_LENGTH) GenTreeArrLen(typ, arrayOp, lenOffset); | ||
| static_assert_no_msg(GTF_ARRLEN_NONFAULTING == GTF_IND_NONFAULTING); | ||
| arrLen->SetIndirExceptionFlags(this); | ||
| return arrLen; | ||
| } | ||
|
|
||
| //------------------------------------------------------------------------------ | ||
| // gtNewIndir : Helper to create an indirection node. | ||
| // | ||
| // Arguments: | ||
| // typ - Type of the node | ||
| // addr - Address of the indirection | ||
| // | ||
| // Return Value: | ||
| // New GT_IND node | ||
|
|
||
| inline GenTree* Compiler::gtNewIndir(var_types typ, GenTree* addr) | ||
| { | ||
| GenTree* indir = gtNewOperNode(GT_IND, typ, addr); | ||
| indir->SetIndirExceptionFlags(this); | ||
| return indir; | ||
| } | ||
|
|
||
| /***************************************************************************** | ||
| * | ||
| * Create (and check for) a "nothing" node, i.e. a node that doesn't produce | ||
|
|
@@ -1512,8 +1562,13 @@ inline void GenTree::ChangeOper(genTreeOps oper, ValueNumberUpdate vnUpdate) | |
| { | ||
| assert(!OperIsConst(oper)); // use ChangeOperLeaf() instead | ||
|
|
||
| unsigned mask = GTF_COMMON_MASK; | ||
| if (this->OperIsIndirOrArrLength() && OperIsIndirOrArrLength(oper)) | ||
| { | ||
| mask |= GTF_IND_NONFAULTING; | ||
| } | ||
| SetOper(oper, vnUpdate); | ||
| gtFlags &= GTF_COMMON_MASK; | ||
| gtFlags &= mask; | ||
|
|
||
| // Do "oper"-specific initializations... | ||
| switch (oper) | ||
|
|
@@ -1529,8 +1584,13 @@ inline void GenTree::ChangeOper(genTreeOps oper, ValueNumberUpdate vnUpdate) | |
|
|
||
| inline void GenTree::ChangeOperUnchecked(genTreeOps oper) | ||
|
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. Would it make sense for
Member
Author
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. ChangeOper calls SetOper while ChangeOperUnchecked calls SetOperRaw so ChangeOper can's call ChangeOperUnchecked. |
||
| { | ||
| unsigned mask = GTF_COMMON_MASK; | ||
| if (this->OperIsIndirOrArrLength() && OperIsIndirOrArrLength(oper)) | ||
| { | ||
| mask |= GTF_IND_NONFAULTING; | ||
| } | ||
| SetOperRaw(oper); // Trust the caller and don't use SetOper() | ||
| gtFlags &= GTF_COMMON_MASK; | ||
| gtFlags &= mask; | ||
| } | ||
|
|
||
| /***************************************************************************** | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Suggestion: I would simply say "Create a node that calls a helper method.". The repetition of "helper" is somewhat confusing, and although a number of these
gtNewmethods are described as helpers, I'm not sure I'd really call them that.