Uh oh!
There was an error while loading. Please reload this page.
Use enum for frametype not v table - #112166
Conversation
…ize, and make it reviewable
…s easier to search for
…ForFrametypeNotVTable
Tagging subscribers to this area: @mangod9 |
Uh oh!
There was an error while loading. Please reload this page.
…ForFrametypeNotVTable
…ForFrametypeNotVTable
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| // This hashtable contains the vtable value of every Frame type. | ||
| static PtrHashMap* s_pFrameVTables = NULL; | ||
| // static |
| // Implementation of the global table of names. On the DAC side, just the global pointer. | ||
| // On the runtime side, the array of names. | ||
| #define FRAME_TYPE_NAME(x) {x::GetMethodFrameVPtr(), #x} , | ||
| #define FRAME_TYPE_NAME(x) {FrameIdentifier::x, #x} , |
There was a problem hiding this comment.
FrameIdentifier does not need to be in the table anymore. We can just index into the table.
| @@ -198,19 +445,19 @@ const size_t FRAME_TYPES_COUNT = | |||
| //----------------------------------------------------------------------- | |||
There was a problem hiding this comment.
FRAME_TYPES_COUNT above can be deleted
| // static | ||
| bool Frame::HasValidVTablePtr(Frame * pFrame) | ||
| bool Frame::HasFrameIdentifier(Frame * pFrame) |
There was a problem hiding this comment.
| boolFrame::HasFrameIdentifier(Frame * pFrame) | |
| boolFrame::HasValidFrameIdentifier(Frame * pFrame) |
?
| #endif // DACCESS_COMPILE | ||
| // Returns true if the Frame's VTablePtr is valid |
There was a problem hiding this comment.
| // Returns true if the Frame's VTablePtr is valid | |
| // Returns true if the Frame has a valid FrameIdentifier |
| void Frame::GcScanRoots(promote_func *fn, ScanContext* sc) | ||
| { | ||
| switch (this->GetFrameIdentifier()) |
There was a problem hiding this comment.
| switch (this->GetFrameIdentifier()) | |
| switch (GetFrameIdentifier()) |
Nit: this-> should not be needed
| FRAME_POLYMORPHIC_DISPATCH_UNREACHABLE(); | ||
| return NULL; | ||
| } | ||
| } |
| #endif |
| } | ||
| } | ||
max-charlamb
commented
Feb 10, 2025
Resolves #111875 |
davidwrighton
commented
Feb 11, 2025
This change refactors the frame identification mechanism in the runtime by replacing the use of the VTable with an enum Key changes include: Renaming FrameType to FrameIdentifier |
* main: [Android] Run CoreCLR functional tests on Android (dotnet#112283) [LoongArch64] Fix some assertion failures for Debug ILC building Debug NativeAOT testcases. (dotnet#112229) Fix suspicious code fragments (dotnet#112384) `__ComObject` doesn't support dynamic interface map (dotnet#112375) Native DLLs: only load imported DLLs from System32 (dotnet#112359) [main] Update dependencies from dotnet/roslyn (dotnet#112314) Update SVE instructions that writes to GC regs (dotnet#112389) Bring up android+coreclr windows build. (dotnet#112256) Never use heap for return buffers (dotnet#112060) Wait to complete the test before releasing the agile reference. (dotnet#112387) Prevent returning disposed HTTP/1.1 connections to the pool (dotnet#112383) Fingerprint dotnet.js if writing import map to html is enabled (dotnet#112407) Remove duplicate definition of CORECLR_HOSTING_API_LINKAGE (dotnet#112096) Update the exception message to reflect current behavior. (dotnet#112355) Use enum for frametype not v table (dotnet#112166) Enable AltJits build for LoongArch64 and RiscV64 (dotnet#110282) Guard members of MonoType union & fix related bugs (dotnet#111645) Add optional hooks for debugging OpenSSL memory allocations (dotnet#111539) JIT: Optimize struct parameter register accesses in the backend (dotnet#110819) NativeAOT: Cover more opcodes in type preinitializer (dotnet#112073)
Frames are currently identified by VTable, which is convenient for writing C++ code, but less so for writing asm, or out of process inspection. This change changes that to a
FrameIdentifierenum, make the polymorphic dispatch occur using if statements, and removes GS cookies for Frame's as we no longer need to protect the vtable.