- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.2k
Move GenTreeIntCon::gtCompileTimeHandle field to be a global map #115542
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 5 commits
5e6e387
              991347b
              a8a58bc
              ab5c1c0
              8ad1bec
              f886f7e
              5cdcb09
              8c8f8d9
              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 | ||||
|---|---|---|---|---|---|---|
|  | @@ -1489,13 +1489,7 @@ inline GenTreeIntCon* Compiler::gtNewIconHandleNode(size_t value, GenTreeFlags f | |||||
|  | ||||||
| inline GenTree* Compiler::gtNewIconEmbScpHndNode(CORINFO_MODULE_HANDLE scpHnd) | ||||||
| { | ||||||
| void *embedScpHnd, *pEmbedScpHnd; | ||||||
|  | ||||||
| embedScpHnd = (void*)info.compCompHnd->embedModuleHandle(scpHnd, &pEmbedScpHnd); | ||||||
|  | ||||||
| assert((!embedScpHnd) != (!pEmbedScpHnd)); | ||||||
|  | ||||||
| return gtNewIconEmbHndNode(embedScpHnd, pEmbedScpHnd, GTF_ICON_SCOPE_HDL, scpHnd); | ||||||
| return gtNewIconEmbHndNode((void*)scpHnd, nullptr, GTF_ICON_SCOPE_HDL, scpHnd); | ||||||
| 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. Isn't this introducing an abstraction violation?  It happens to work since these module handles are only used with JIT currently, but this change does not look like an improvement to me. 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. @jkotas I just assumed that almost 300 LOC is too much for an API that is just no-op (and CoreCLR only), I can revert this part. Looks like the only case where we need to embed a field handle is CoreCLR jitting a method that accesses a field it has no access for, so JIT emits an exception telling about the field access violation. Isn't part of the IL verification that we got rid some time ago? As for the modules, I presume they're only used to embed strings as helper calls, so JIT only. 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. 
 It is more like 20 lines of actual code. The rest is boiler plate. 
 I think the part that's introducing JIT/EE interface abstraction violations should be reverted. 
 We have not removed visibility checks to enforce good hygiene. 
 If we were to fail the JITing of the whole method instead, the user would just see that there is a visibility problem somewhere in method, without seeing the precise location. 
 There is a TODO to implement this optimization for R2R runtime/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs Lines 3591 to 3592 in 8df4955 
 Where possible, we should be building JIT/EE interactions such that they are JIT/AOT agnostic even if it is not needed at the moment. | ||||||
| } | ||||||
|  | ||||||
| //----------------------------------------------------------------------------- | ||||||
|  | @@ -1513,6 +1507,13 @@ inline GenTree* Compiler::gtNewIconEmbClsHndNode(CORINFO_CLASS_HANDLE clsHnd) | |||||
|  | ||||||
| //----------------------------------------------------------------------------- | ||||||
|  | ||||||
| inline GenTree* Compiler::gtNewIconEmbObjHndNode(CORINFO_OBJECT_HANDLE objHnd) | ||||||
| { | ||||||
| return gtNewIconEmbHndNode((void*)objHnd, nullptr, GTF_ICON_OBJ_HDL, nullptr); | ||||||
| } | ||||||
|  | ||||||
| //----------------------------------------------------------------------------- | ||||||
|  | ||||||
| inline GenTree* Compiler::gtNewIconEmbMethHndNode(CORINFO_METHOD_HANDLE methHnd) | ||||||
| { | ||||||
| void *embedMethHnd, *pEmbedMethHnd; | ||||||
|  | @@ -1528,13 +1529,7 @@ inline GenTree* Compiler::gtNewIconEmbMethHndNode(CORINFO_METHOD_HANDLE methHnd) | |||||
|  | ||||||
| inline GenTree* Compiler::gtNewIconEmbFldHndNode(CORINFO_FIELD_HANDLE fldHnd) | ||||||
| { | ||||||
| void *embedFldHnd, *pEmbedFldHnd; | ||||||
|  | ||||||
| embedFldHnd = (void*)info.compCompHnd->embedFieldHandle(fldHnd, &pEmbedFldHnd); | ||||||
|  | ||||||
| assert((!embedFldHnd) != (!pEmbedFldHnd)); | ||||||
|  | ||||||
| return gtNewIconEmbHndNode(embedFldHnd, pEmbedFldHnd, GTF_ICON_FIELD_HDL, fldHnd); | ||||||
| return gtNewIconEmbHndNode((void*)fldHnd, nullptr, GTF_ICON_FIELD_HDL, fldHnd); | ||||||
| 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. Same here | ||||||
| } | ||||||
|  | ||||||
| /*****************************************************************************/ | ||||||
|  | ||||||
Uh oh!
There was an error while loading. Please reload this page.