From 47bf469d879613b6f6eaca134925aba6723b6f0d Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Wed, 14 Jun 2023 18:45:13 -0700 Subject: [PATCH 01/16] Clean up JIT flags 1. Remove never set CORJIT_MCJIT_BACKGROUND. 2. Remove never checked CORJIT_PINVOKE_RESTORE_ESP (x86 only). Remove related `COMPUTED_IS_PRE_V4_ASSEMBLY`, `IS_PRE_V4_ASSEMBLY`, `IsPreV4Assembly()`. 3. Remove unused CORJIT_FEATURE_SIMD. 4. Remove all the "UNUSED" flags, which only cause clutter. 5. Renumber/pack all the remaining flags. Ensure that all flags have unique numbers, even for different platforms. 6. Add missing flags in a few cases: the JIT/CORJIT equality asserts, mcs "-jitflags" dumpers, `CorJitFlagToString()`, `CorJitFlag` type. --- src/coreclr/inc/corjitflags.h | 113 +++++---------- src/coreclr/inc/jiteeversionguid.h | 10 +- src/coreclr/jit/jitee.h | 137 +++++------------- .../tools/Common/JitInterface/CorInfoTypes.cs | 80 +++++----- .../superpmi-shared/methodcontext.cpp | 25 ++-- .../superpmi/superpmi-shared/methodcontext.h | 11 -- .../superpmi-shared/spmidumphelper.cpp | 30 +--- src/coreclr/vm/ceeload.cpp | 31 ---- src/coreclr/vm/ceeload.h | 14 -- src/coreclr/vm/jitinterface.cpp | 19 +-- 10 files changed, 137 insertions(+), 333 deletions(-) diff --git a/src/coreclr/inc/corjitflags.h b/src/coreclr/inc/corjitflags.h index 6f7b00cb6f9197..dce9a9f00b3998 100644 --- a/src/coreclr/inc/corjitflags.h +++ b/src/coreclr/inc/corjitflags.h @@ -22,97 +22,52 @@ class CORJIT_FLAGS { public: + // Note: these flags can be #ifdef'ed, but no number should be re-used between different #ifdef conditions, + // so platform-independent code can know uniquely which number corresponds to which flag. enum CorJitFlag { CORJIT_FLAG_CALL_GETJITFLAGS = 0xffffffff, // Indicates that the JIT should retrieve flags in the form of a // pointer to a CORJIT_FLAGS value via ICorJitInfo::getJitFlags(). - CORJIT_FLAG_SPEED_OPT = 0, - CORJIT_FLAG_SIZE_OPT = 1, + + CORJIT_FLAG_SPEED_OPT = 0, // optimize for speed + CORJIT_FLAG_SIZE_OPT = 1, // optimize for code size CORJIT_FLAG_DEBUG_CODE = 2, // generate "debuggable" code (no code-mangling optimizations) CORJIT_FLAG_DEBUG_EnC = 3, // We are in Edit-n-Continue mode CORJIT_FLAG_DEBUG_INFO = 4, // generate line and local-var info CORJIT_FLAG_MIN_OPT = 5, // disable all jit optimizations (not necessarily debuggable code) - CORJIT_FLAG_ENABLE_CFG = 6, // generate control-flow guard checks - CORJIT_FLAG_MCJIT_BACKGROUND = 7, // Calling from multicore JIT background thread, do not call JitComplete - - #if defined(TARGET_X86) - CORJIT_FLAG_PINVOKE_RESTORE_ESP = 8, // Restore ESP after returning from inlined PInvoke - #else // !defined(TARGET_X86) - CORJIT_FLAG_UNUSED2 = 8, - #endif // !defined(TARGET_X86) - - CORJIT_FLAG_UNUSED3 = 9, - CORJIT_FLAG_UNUSED4 = 10, - CORJIT_FLAG_UNUSED5 = 11, - CORJIT_FLAG_UNUSED6 = 12, - - CORJIT_FLAG_OSR = 13, // Generate alternate method for On Stack Replacement - - CORJIT_FLAG_ALT_JIT = 14, // JIT should consider itself an ALT_JIT - CORJIT_FLAG_FROZEN_ALLOC_ALLOWED = 15, // JIT is allowed to use *_MAYBEFROZEN allocators - CORJIT_FLAG_UNUSED9 = 16, - CORJIT_FLAG_UNUSED10 = 17, - - CORJIT_FLAG_MAKEFINALCODE = 18, // Use the final code generator, i.e., not the interpreter. - CORJIT_FLAG_READYTORUN = 19, // Use version-resilient code generation - CORJIT_FLAG_PROF_ENTERLEAVE = 20, // Instrument prologues/epilogues - CORJIT_FLAG_UNUSED11 = 21, - CORJIT_FLAG_PROF_NO_PINVOKE_INLINE = 22, // Disables PInvoke inlining - CORJIT_FLAG_UNUSED12 = 23, - CORJIT_FLAG_PREJIT = 24, // jit or prejit is the execution engine. - CORJIT_FLAG_RELOC = 25, // Generate relocatable code - CORJIT_FLAG_UNUSED13 = 26, - CORJIT_FLAG_IL_STUB = 27, // method is an IL stub - CORJIT_FLAG_PROCSPLIT = 28, // JIT should separate code into hot and cold sections - CORJIT_FLAG_BBINSTR = 29, // Collect basic block profile information - CORJIT_FLAG_BBOPT = 30, // Optimize method based on profile information - CORJIT_FLAG_FRAMED = 31, // All methods have an EBP frame - CORJIT_FLAG_BBINSTR_IF_LOOPS = 32, // JIT must instrument current method if it has loops - CORJIT_FLAG_PUBLISH_SECRET_PARAM = 33, // JIT must place stub secret param into local 0. (used by IL stubs) - CORJIT_FLAG_UNUSED14 = 34, - CORJIT_FLAG_UNUSED37 = 35, - CORJIT_FLAG_USE_PINVOKE_HELPERS = 36, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions - CORJIT_FLAG_REVERSE_PINVOKE = 37, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog - CORJIT_FLAG_TRACK_TRANSITIONS = 38, // The JIT should insert the REVERSE_PINVOKE helper variants that track transitions. - CORJIT_FLAG_TIER0 = 39, // This is the initial tier for tiered compilation which should generate code as quickly as possible - CORJIT_FLAG_TIER1 = 40, // This is the final tier (for now) for tiered compilation which should generate high quality code + CORJIT_FLAG_ENABLE_CFG = 6, // generate CFG enabled code + CORJIT_FLAG_OSR = 7, // Generate alternate version for On Stack Replacement + CORJIT_FLAG_ALT_JIT = 8, // JIT should consider itself an ALT_JIT + CORJIT_FLAG_FROZEN_ALLOC_ALLOWED = 9, // JIT is allowed to use *_MAYBEFROZEN allocators + CORJIT_FLAG_MAKEFINALCODE = 10, // Use the final code generator, i.e., not the interpreter. + CORJIT_FLAG_READYTORUN = 11, // Use version-resilient code generation + CORJIT_FLAG_PROF_ENTERLEAVE = 12, // Instrument prologues/epilogues + CORJIT_FLAG_PROF_NO_PINVOKE_INLINE = 13, // Disables PInvoke inlining + CORJIT_FLAG_PREJIT = 14, // prejit is the execution engine. + CORJIT_FLAG_RELOC = 15, // Generate relocatable code + CORJIT_FLAG_IL_STUB = 16, // method is an IL stub + CORJIT_FLAG_PROCSPLIT = 17, // JIT should separate code into hot and cold sections + CORJIT_FLAG_BBINSTR = 18, // Collect basic block profile information + CORJIT_FLAG_BBINSTR_IF_LOOPS = 19, // JIT must instrument current method if it has loops + CORJIT_FLAG_BBOPT = 20, // Optimize method based on profile information + CORJIT_FLAG_FRAMED = 21, // All methods have an EBP frame + CORJIT_FLAG_PUBLISH_SECRET_PARAM = 22, // JIT must place stub secret param into local 0. (used by IL stubs) + CORJIT_FLAG_USE_PINVOKE_HELPERS = 23, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions + CORJIT_FLAG_REVERSE_PINVOKE = 24, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog + CORJIT_FLAG_TRACK_TRANSITIONS = 25, // The JIT should insert the helper variants that track transitions. + CORJIT_FLAG_TIER0 = 26, // This is the initial tier for tiered compilation which should generate code as quickly as possible + CORJIT_FLAG_TIER1 = 27, // This is the final tier (for now) for tiered compilation which should generate high quality code + CORJIT_FLAG_NO_INLINING = 28, // JIT should not inline any called method into this method #if defined(TARGET_ARM) - CORJIT_FLAG_RELATIVE_CODE_RELOCS = 41, // JIT should generate PC-relative address computations instead of EE relocation records -#else // !defined(TARGET_ARM) - CORJIT_FLAG_UNUSED15 = 41, -#endif // !defined(TARGET_ARM) + CORJIT_FLAG_RELATIVE_CODE_RELOCS = 29, // JIT should generate PC-relative address computations instead of EE relocation records + CORJIT_FLAG_SOFTFP_ABI = 30, // Enable armel calling convention +#endif - CORJIT_FLAG_NO_INLINING = 42, // JIT should not inline any called method into this method +#if defined(TARGET_X86) || defined(TARGET_AMD64) + CORJIT_FLAG_VECTOR512_THROTTLING = 31, // On x86/x64, 512-bit vector usage may incur CPU frequency throttling +#endif -#if defined(TARGET_ARM) - CORJIT_FLAG_SOFTFP_ABI = 43, // On ARM should enable armel calling convention -#elif defined(TARGET_X86) || defined(TARGET_AMD64) - CORJIT_FLAG_VECTOR512_THROTTLING = 43, // On Xarch, 512-bit vector usage may incur CPU frequency throttling -#else - CORJIT_FLAG_UNUSED16 = 43, -#endif // !defined(TARGET_ARM) - - CORJIT_FLAG_UNUSED17 = 44, - CORJIT_FLAG_UNUSED18 = 45, - CORJIT_FLAG_UNUSED19 = 46, - CORJIT_FLAG_UNUSED20 = 47, - CORJIT_FLAG_UNUSED21 = 48, - CORJIT_FLAG_UNUSED22 = 49, - CORJIT_FLAG_UNUSED23 = 50, - CORJIT_FLAG_UNUSED24 = 51, - CORJIT_FLAG_UNUSED25 = 52, - CORJIT_FLAG_UNUSED26 = 53, - CORJIT_FLAG_UNUSED27 = 54, - CORJIT_FLAG_UNUSED28 = 55, - CORJIT_FLAG_UNUSED29 = 56, - CORJIT_FLAG_UNUSED30 = 57, - CORJIT_FLAG_UNUSED31 = 58, - CORJIT_FLAG_UNUSED32 = 59, - CORJIT_FLAG_UNUSED33 = 60, - CORJIT_FLAG_UNUSED34 = 61, - CORJIT_FLAG_UNUSED35 = 62, - CORJIT_FLAG_UNUSED36 = 63 }; CORJIT_FLAGS() diff --git a/src/coreclr/inc/jiteeversionguid.h b/src/coreclr/inc/jiteeversionguid.h index ebcf4919cb6afb..36f906df5e7eda 100644 --- a/src/coreclr/inc/jiteeversionguid.h +++ b/src/coreclr/inc/jiteeversionguid.h @@ -43,11 +43,11 @@ typedef const GUID *LPCGUID; #define GUID_DEFINED #endif // !GUID_DEFINED -constexpr GUID JITEEVersionIdentifier = { /* fda2f9dd-6b3e-4ecd-a7b8-79e5edf1f072 */ - 0xfda2f9dd, - 0x6b3e, - 0x4ecd, - {0xa7, 0xb8, 0x79, 0xe5, 0xed, 0xf1, 0xf0, 0x72} +constexpr GUID JITEEVersionIdentifier = { /* 88398e9f-093a-4212-85bc-bebb8c14cd24 */ + 0x88398e9f, + 0x093a, + 0x4212, + {0x85, 0xbc, 0xbe, 0xbb, 0x8c, 0x14, 0xcd, 0x24} }; ////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/coreclr/jit/jitee.h b/src/coreclr/jit/jitee.h index ac51df952ab420..27963ac356efb5 100644 --- a/src/coreclr/jit/jitee.h +++ b/src/coreclr/jit/jitee.h @@ -1,109 +1,56 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// This class wraps the CORJIT_FLAGS type in the JIT-EE interface (in corjit.h) such that the JIT can -// build with either the old flags (COR_JIT_EE_VERSION <= 460) or the new flags (COR_JIT_EE_VERSION > 460). -// It actually is exactly the same as the new definition, and must be kept up-to-date with the new definition. -// When built against an old JIT-EE interface, the old flags are converted into this structure. +// This class wraps the CORJIT_FLAGS type in the JIT-EE interface (in corjit.h). +// If this changes, also change spmidumphelper.cpp. class JitFlags { public: // clang-format off enum JitFlag { - JIT_FLAG_SPEED_OPT = 0, - JIT_FLAG_SIZE_OPT = 1, + JIT_FLAG_SPEED_OPT = 0, // optimize for speed + JIT_FLAG_SIZE_OPT = 1, // optimize for code size JIT_FLAG_DEBUG_CODE = 2, // generate "debuggable" code (no code-mangling optimizations) JIT_FLAG_DEBUG_EnC = 3, // We are in Edit-n-Continue mode JIT_FLAG_DEBUG_INFO = 4, // generate line and local-var info JIT_FLAG_MIN_OPT = 5, // disable all jit optimizations (not necessarily debuggable code) JIT_FLAG_ENABLE_CFG = 6, // generate CFG enabled code - JIT_FLAG_MCJIT_BACKGROUND = 7, // Calling from multicore JIT background thread, do not call JitComplete - - #if defined(TARGET_X86) - JIT_FLAG_PINVOKE_RESTORE_ESP = 8, // Restore ESP after returning from inlined PInvoke - #else // !defined(TARGET_X86) - JIT_FLAG_UNUSED2 = 8, - #endif // !defined(TARGET_X86) - - JIT_FLAG_UNUSED3 = 9, - JIT_FLAG_UNUSED4 = 10, - JIT_FLAG_UNUSED5 = 11, - JIT_FLAG_UNUSED6 = 12, - - JIT_FLAG_OSR = 13, // Generate alternate version for On Stack Replacement - - JIT_FLAG_ALT_JIT = 14, // JIT should consider itself an ALT_JIT - JIT_FLAG_FROZEN_ALLOC_ALLOWED = 15, // JIT is allowed to use *_MAYBEFROZEN allocators - JIT_FLAG_UNUSED9 = 16, - - #if defined(TARGET_X86) || defined(TARGET_AMD64) || defined(TARGET_ARM64) - JIT_FLAG_FEATURE_SIMD = 17, - #else - JIT_FLAG_UNUSED10 = 17, - #endif // !(defined(TARGET_X86) || defined(TARGET_AMD64) || defined(TARGET_ARM64)) - - JIT_FLAG_MAKEFINALCODE = 18, // Use the final code generator, i.e., not the interpreter. - JIT_FLAG_READYTORUN = 19, // Use version-resilient code generation - JIT_FLAG_PROF_ENTERLEAVE = 20, // Instrument prologues/epilogues - JIT_FLAG_UNUSED11 = 21, - JIT_FLAG_PROF_NO_PINVOKE_INLINE = 22, // Disables PInvoke inlining - JIT_FLAG_UNUSED12 = 23, - JIT_FLAG_PREJIT = 24, // jit or prejit is the execution engine. - JIT_FLAG_RELOC = 25, // Generate relocatable code - JIT_FLAG_IMPORT_ONLY = 26, // Only import the function - JIT_FLAG_IL_STUB = 27, // method is an IL stub - JIT_FLAG_PROCSPLIT = 28, // JIT should separate code into hot and cold sections - JIT_FLAG_BBINSTR = 29, // Collect basic block profile information - JIT_FLAG_BBOPT = 30, // Optimize method based on profile information - JIT_FLAG_FRAMED = 31, // All methods have an EBP frame - JIT_FLAG_BBINSTR_IF_LOOPS = 32, // JIT must instrument current method if it has loops - JIT_FLAG_PUBLISH_SECRET_PARAM = 33, // JIT must place stub secret param into local 0. (used by IL stubs) - JIT_FLAG_UNUSED13 = 34, - JIT_FLAG_UNUSED14 = 35, - JIT_FLAG_USE_PINVOKE_HELPERS = 36, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions - JIT_FLAG_REVERSE_PINVOKE = 37, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog - JIT_FLAG_TRACK_TRANSITIONS = 38, // The JIT should insert the helper variants that track transitions. - JIT_FLAG_TIER0 = 39, // This is the initial tier for tiered compilation which should generate code as quickly as possible - JIT_FLAG_TIER1 = 40, // This is the final tier (for now) for tiered compilation which should generate high quality code + JIT_FLAG_OSR = 7, // Generate alternate version for On Stack Replacement + JIT_FLAG_ALT_JIT = 8, // JIT should consider itself an ALT_JIT + JIT_FLAG_FROZEN_ALLOC_ALLOWED = 9, // JIT is allowed to use *_MAYBEFROZEN allocators + JIT_FLAG_MAKEFINALCODE = 10, // Use the final code generator, i.e., not the interpreter. + JIT_FLAG_READYTORUN = 11, // Use version-resilient code generation + JIT_FLAG_PROF_ENTERLEAVE = 12, // Instrument prologues/epilogues + JIT_FLAG_PROF_NO_PINVOKE_INLINE = 13, // Disables PInvoke inlining + JIT_FLAG_PREJIT = 14, // prejit is the execution engine. + JIT_FLAG_RELOC = 15, // Generate relocatable code + JIT_FLAG_IL_STUB = 16, // method is an IL stub + JIT_FLAG_PROCSPLIT = 17, // JIT should separate code into hot and cold sections + JIT_FLAG_BBINSTR = 18, // Collect basic block profile information + JIT_FLAG_BBINSTR_IF_LOOPS = 19, // JIT must instrument current method if it has loops + JIT_FLAG_BBOPT = 20, // Optimize method based on profile information + JIT_FLAG_FRAMED = 21, // All methods have an EBP frame + JIT_FLAG_PUBLISH_SECRET_PARAM = 22, // JIT must place stub secret param into local 0. (used by IL stubs) + JIT_FLAG_USE_PINVOKE_HELPERS = 23, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions + JIT_FLAG_REVERSE_PINVOKE = 24, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog + JIT_FLAG_TRACK_TRANSITIONS = 25, // The JIT should insert the helper variants that track transitions. + JIT_FLAG_TIER0 = 26, // This is the initial tier for tiered compilation which should generate code as quickly as possible + JIT_FLAG_TIER1 = 27, // This is the final tier (for now) for tiered compilation which should generate high quality code + JIT_FLAG_NO_INLINING = 28, // JIT should not inline any called method into this method #if defined(TARGET_ARM) - JIT_FLAG_RELATIVE_CODE_RELOCS = 41, // JIT should generate PC-relative address computations instead of EE relocation records -#else // !defined(TARGET_ARM) - JIT_FLAG_UNUSED15 = 41, -#endif // !defined(TARGET_ARM) - - JIT_FLAG_NO_INLINING = 42, // JIT should not inline any called method into this method - -#if defined(TARGET_ARM) - JIT_FLAG_SOFTFP_ABI = 43, // On ARM should enable armel calling convention -#elif defined(TARGET_XARCH) - JIT_FLAG_VECTOR512_THROTTLING = 43, // On Xarch, 512-bit vector usage may incur CPU frequency throttling -#else - JIT_FLAG_UNUSED16 = 43, + JIT_FLAG_RELATIVE_CODE_RELOCS = 29, // JIT should generate PC-relative address computations instead of EE relocation records + JIT_FLAG_SOFTFP_ABI = 30, // Enable armel calling convention #endif - JIT_FLAG_UNUSED17 = 44, - JIT_FLAG_UNUSED18 = 45, - JIT_FLAG_UNUSED19 = 46, - JIT_FLAG_UNUSED20 = 47, - JIT_FLAG_UNUSED21 = 48, - JIT_FLAG_UNUSED22 = 49, - JIT_FLAG_UNUSED23 = 50, - JIT_FLAG_UNUSED24 = 51, - JIT_FLAG_UNUSED25 = 52, - JIT_FLAG_UNUSED26 = 53, - JIT_FLAG_UNUSED27 = 54, - JIT_FLAG_UNUSED28 = 55, - JIT_FLAG_UNUSED29 = 56, - JIT_FLAG_UNUSED30 = 57, - JIT_FLAG_UNUSED31 = 58, - JIT_FLAG_UNUSED32 = 59, - JIT_FLAG_UNUSED33 = 60, - JIT_FLAG_UNUSED34 = 61, - JIT_FLAG_UNUSED35 = 62, - JIT_FLAG_UNUSED36 = 63 +#if defined(TARGET_XARCH) + JIT_FLAG_VECTOR512_THROTTLING = 31, // On Xarch, 512-bit vector usage may incur CPU frequency throttling +#endif + // Note: the mcs tool uses the currently unused upper flags bits when outputting SuperPMI MC file flags. + // See EXTRA_JIT_FLAGS and spmidumphelper.cpp. Currently, these are bits 56 through 63. If they overlap, + // something needs to change. }; // clang-format on @@ -171,12 +118,7 @@ class JitFlags FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_DEBUG_INFO, JIT_FLAG_DEBUG_INFO); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_MIN_OPT, JIT_FLAG_MIN_OPT); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_ENABLE_CFG, JIT_FLAG_ENABLE_CFG); - FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_MCJIT_BACKGROUND, JIT_FLAG_MCJIT_BACKGROUND); - -#if defined(TARGET_X86) - FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_PINVOKE_RESTORE_ESP, JIT_FLAG_PINVOKE_RESTORE_ESP); -#endif - + FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_OSR, JIT_FLAG_OSR); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_ALT_JIT, JIT_FLAG_ALT_JIT); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_FROZEN_ALLOC_ALLOWED, JIT_FLAG_FROZEN_ALLOC_ALLOWED); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_MAKEFINALCODE, JIT_FLAG_MAKEFINALCODE); @@ -194,17 +136,18 @@ class JitFlags FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_PUBLISH_SECRET_PARAM, JIT_FLAG_PUBLISH_SECRET_PARAM); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_USE_PINVOKE_HELPERS, JIT_FLAG_USE_PINVOKE_HELPERS); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_REVERSE_PINVOKE, JIT_FLAG_REVERSE_PINVOKE); + FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_TRACK_TRANSITIONS, JIT_FLAG_TRACK_TRANSITIONS); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_TIER0, JIT_FLAG_TIER0); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_TIER1, JIT_FLAG_TIER1); + FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_NO_INLINING, JIT_FLAG_NO_INLINING); #if defined(TARGET_ARM) FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_RELATIVE_CODE_RELOCS, JIT_FLAG_RELATIVE_CODE_RELOCS); + FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_SOFTFP_ABI, JIT_FLAG_SOFTFP_ABI); #endif // TARGET_ARM - FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_NO_INLINING, JIT_FLAG_NO_INLINING); - -#if defined(TARGET_ARM) - FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_SOFTFP_ABI, JIT_FLAG_SOFTFP_ABI); +#if defined(TARGET_X86) || defined(TARGET_AMD64) + FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_VECTOR512_THROTTLING, JIT_FLAG_VECTOR512_THROTTLING); #endif // TARGET_ARM #undef FLAGS_EQUAL diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs b/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs index d2a792e25a0c18..c592be43407689 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs @@ -1391,49 +1391,43 @@ public enum CorJitFlag : uint { CORJIT_FLAG_CALL_GETJITFLAGS = 0xffffffff, // Indicates that the JIT should retrieve flags in the form of a // pointer to a CORJIT_FLAGS value via ICorJitInfo::getJitFlags(). - CORJIT_FLAG_SPEED_OPT = 0, - CORJIT_FLAG_SIZE_OPT = 1, - CORJIT_FLAG_DEBUG_CODE = 2, // generate "debuggable" code (no code-mangling optimizations) - CORJIT_FLAG_DEBUG_EnC = 3, // We are in Edit-n-Continue mode - CORJIT_FLAG_DEBUG_INFO = 4, // generate line and local-var info - CORJIT_FLAG_MIN_OPT = 5, // disable all jit optimizations (not necessarily debuggable code) - CORJIT_FLAG_ENABLE_CFG = 6, // generate CFG enabled code - CORJIT_FLAG_MCJIT_BACKGROUND = 7, // Calling from multicore JIT background thread, do not call JitComplete - CORJIT_FLAG_UNUSED2 = 8, - CORJIT_FLAG_UNUSED3 = 9, - CORJIT_FLAG_UNUSED4 = 10, - CORJIT_FLAG_UNUSED5 = 11, - CORJIT_FLAG_UNUSED6 = 12, - CORJIT_FLAG_OSR = 13, // Generate alternate version for On Stack Replacement - CORJIT_FLAG_ALT_JIT = 14, // JIT should consider itself an ALT_JIT - CORJIT_FLAG_FROZEN_ALLOC_ALLOWED = 15, // JIT is allowed to use *_MAYBEFROZEN allocators - CORJIT_FLAG_UNUSED10 = 17, - CORJIT_FLAG_MAKEFINALCODE = 18, // Use the final code generator, i.e., not the interpreter. - CORJIT_FLAG_READYTORUN = 19, // Use version-resilient code generation - CORJIT_FLAG_PROF_ENTERLEAVE = 20, // Instrument prologues/epilogues - CORJIT_FLAG_UNUSED7 = 21, - CORJIT_FLAG_PROF_NO_PINVOKE_INLINE = 22, // Disables PInvoke inlining - CORJIT_FLAG_UNUSED8 = 23, - CORJIT_FLAG_PREJIT = 24, // jit or prejit is the execution engine. - CORJIT_FLAG_RELOC = 25, // Generate relocatable code - CORJIT_FLAG_IMPORT_ONLY = 26, // Only import the function - CORJIT_FLAG_IL_STUB = 27, // method is an IL stub - CORJIT_FLAG_PROCSPLIT = 28, // JIT should separate code into hot and cold sections - CORJIT_FLAG_BBINSTR = 29, // Collect basic block profile information - CORJIT_FLAG_BBOPT = 30, // Optimize method based on profile information - CORJIT_FLAG_FRAMED = 31, // All methods have an EBP frame - CORJIT_FLAG_BBINSTR_IF_LOOPS = 32, // JIT must instrument current method if it has loops - CORJIT_FLAG_PUBLISH_SECRET_PARAM = 33, // JIT must place stub secret param into local 0. (used by IL stubs) - CORJIT_FLAG_UNUSED9 = 34, - CORJIT_FLAG_UNUSED1 = 35, - CORJIT_FLAG_USE_PINVOKE_HELPERS = 36, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions - CORJIT_FLAG_REVERSE_PINVOKE = 37, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog - CORJIT_FLAG_TRACK_TRANSITIONS = 38, // The JIT should insert the helper variants that track transitions. - CORJIT_FLAG_TIER0 = 39, // This is the initial tier for tiered compilation which should generate code as quickly as possible - CORJIT_FLAG_TIER1 = 40, // This is the final tier (for now) for tiered compilation which should generate high quality code - CORJIT_FLAG_RELATIVE_CODE_RELOCS = 41, // JIT should generate PC-relative address computations instead of EE relocation records - CORJIT_FLAG_NO_INLINING = 42, // JIT should not inline any called method into this method - CORJIT_FLAG_SOFTFP_ABI = 43, // On ARM should enable armel calling convention + + CORJIT_FLAG_SPEED_OPT = 0, // optimize for speed + CORJIT_FLAG_SIZE_OPT = 1, // optimize for code size + CORJIT_FLAG_DEBUG_CODE = 2, // generate "debuggable" code (no code-mangling optimizations) + CORJIT_FLAG_DEBUG_EnC = 3, // We are in Edit-n-Continue mode + CORJIT_FLAG_DEBUG_INFO = 4, // generate line and local-var info + CORJIT_FLAG_MIN_OPT = 5, // disable all jit optimizations (not necessarily debuggable code) + CORJIT_FLAG_ENABLE_CFG = 6, // generate CFG enabled code + CORJIT_FLAG_OSR = 7, // Generate alternate version for On Stack Replacement + CORJIT_FLAG_ALT_JIT = 8, // JIT should consider itself an ALT_JIT + CORJIT_FLAG_FROZEN_ALLOC_ALLOWED = 9, // JIT is allowed to use *_MAYBEFROZEN allocators + CORJIT_FLAG_MAKEFINALCODE = 10, // Use the final code generator, i.e., not the interpreter. + CORJIT_FLAG_READYTORUN = 11, // Use version-resilient code generation + CORJIT_FLAG_PROF_ENTERLEAVE = 12, // Instrument prologues/epilogues + CORJIT_FLAG_PROF_NO_PINVOKE_INLINE = 13, // Disables PInvoke inlining + CORJIT_FLAG_PREJIT = 14, // prejit is the execution engine. + CORJIT_FLAG_RELOC = 15, // Generate relocatable code + CORJIT_FLAG_IL_STUB = 16, // method is an IL stub + CORJIT_FLAG_PROCSPLIT = 17, // JIT should separate code into hot and cold sections + CORJIT_FLAG_BBINSTR = 18, // Collect basic block profile information + CORJIT_FLAG_BBINSTR_IF_LOOPS = 19, // JIT must instrument current method if it has loops + CORJIT_FLAG_BBOPT = 20, // Optimize method based on profile information + CORJIT_FLAG_FRAMED = 21, // All methods have an EBP frame + CORJIT_FLAG_PUBLISH_SECRET_PARAM = 22, // JIT must place stub secret param into local 0. (used by IL stubs) + CORJIT_FLAG_USE_PINVOKE_HELPERS = 23, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions + CORJIT_FLAG_REVERSE_PINVOKE = 24, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog + CORJIT_FLAG_TRACK_TRANSITIONS = 25, // The JIT should insert the helper variants that track transitions. + CORJIT_FLAG_TIER0 = 26, // This is the initial tier for tiered compilation which should generate code as quickly as possible + CORJIT_FLAG_TIER1 = 27, // This is the final tier (for now) for tiered compilation which should generate high quality code + CORJIT_FLAG_NO_INLINING = 28, // JIT should not inline any called method into this method + + // ARM only + CORJIT_FLAG_RELATIVE_CODE_RELOCS = 29, // JIT should generate PC-relative address computations instead of EE relocation records + CORJIT_FLAG_SOFTFP_ABI = 30, // Enable armel calling convention + + // x86/x64 only + CORJIT_FLAG_VECTOR512_THROTTLING = 31, // On x86/x64, 512-bit vector usage may incur CPU frequency throttling } public struct CORJIT_FLAGS diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp index 70378310e449a3..38188259333124 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp @@ -1181,14 +1181,6 @@ const char* CorJitFlagToString(CORJIT_FLAGS::CorJitFlag flag) return "CORJIT_FLAG_MIN_OPT"; case CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_ENABLE_CFG: return "CORJIT_FLAG_ENABLE_CFG"; - case CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_MCJIT_BACKGROUND: - return "CORJIT_FLAG_MCJIT_BACKGROUND"; - -#if defined(TARGET_X86) - case CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_PINVOKE_RESTORE_ESP: - return "CORJIT_FLAG_PINVOKE_RESTORE_ESP"; -#endif // defined(TARGET_X86) - case CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_OSR: return "CORJIT_FLAG_OSR"; case CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_ALT_JIT: @@ -1213,12 +1205,12 @@ const char* CorJitFlagToString(CORJIT_FLAGS::CorJitFlag flag) return "CORJIT_FLAG_PROCSPLIT"; case CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_BBINSTR: return "CORJIT_FLAG_BBINSTR"; + case CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_BBINSTR_IF_LOOPS: + return "CORJIT_FLAG_BBINSTR_IF_LOOPS"; case CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_BBOPT: return "CORJIT_FLAG_BBOPT"; case CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_FRAMED: return "CORJIT_FLAG_FRAMED"; - case CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_BBINSTR_IF_LOOPS: - return "CORJIT_FLAG_BBINSTR_IF_LOOPS"; case CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_PUBLISH_SECRET_PARAM: return "CORJIT_FLAG_PUBLISH_SECRET_PARAM"; case CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_USE_PINVOKE_HELPERS: @@ -1231,20 +1223,21 @@ const char* CorJitFlagToString(CORJIT_FLAGS::CorJitFlag flag) return "CORJIT_FLAG_TIER0"; case CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_TIER1: return "CORJIT_FLAG_TIER1"; - -#if defined(TARGET_ARM) - case CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_RELATIVE_CODE_RELOCS: - return "CORJIT_FLAG_RELATIVE_CODE_RELOCS"; -#endif // defined(TARGET_ARM) - case CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_NO_INLINING: return "CORJIT_FLAG_NO_INLINING"; #if defined(TARGET_ARM) + case CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_RELATIVE_CODE_RELOCS: + return "CORJIT_FLAG_RELATIVE_CODE_RELOCS"; case CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_SOFTFP_ABI: return "CORJIT_FLAG_SOFTFP_ABI"; #endif // defined(TARGET_ARM) +#if defined(TARGET_X86) || defined(TARGET_AMD64) + case CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_VECTOR512_THROTTLING: + return "CORJIT_FLAG_VECTOR512_THROTTLING"; +#endif // defined(TARGET_XARCH) + default: return ""; } diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h index e6dacd31f2a3ca..d139aa87094914 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h @@ -59,17 +59,6 @@ enum EXTRA_JIT_FLAGS HAS_LIKELY_METHOD = 56, }; -// Asserts to catch changes in corjit flags definitions. - -static_assert((int)EXTRA_JIT_FLAGS::HAS_PGO == (int)CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_UNUSED36, "Jit Flags Mismatch"); -static_assert((int)EXTRA_JIT_FLAGS::HAS_EDGE_PROFILE == (int)CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_UNUSED35, "Jit Flags Mismatch"); -static_assert((int)EXTRA_JIT_FLAGS::HAS_CLASS_PROFILE == (int)CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_UNUSED34, "Jit Flags Mismatch"); -static_assert((int)EXTRA_JIT_FLAGS::HAS_LIKELY_CLASS == (int)CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_UNUSED33, "Jit Flags Mismatch"); -static_assert((int)EXTRA_JIT_FLAGS::HAS_STATIC_PROFILE == (int)CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_UNUSED32, "Jit Flags Mismatch"); -static_assert((int)EXTRA_JIT_FLAGS::HAS_DYNAMIC_PROFILE == (int)CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_UNUSED31, "Jit Flags Mismatch"); -static_assert((int)EXTRA_JIT_FLAGS::HAS_METHOD_PROFILE == (int)CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_UNUSED30, "Jit Flags Mismatch"); -static_assert((int)EXTRA_JIT_FLAGS::HAS_LIKELY_METHOD == (int)CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_UNUSED29, "Jit Flags Mismatch"); - class MethodContext { friend class CompileResult; diff --git a/src/coreclr/tools/superpmi/superpmi-shared/spmidumphelper.cpp b/src/coreclr/tools/superpmi/superpmi-shared/spmidumphelper.cpp index 0ce0a4ccb39d16..9595d88ba68e6b 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/spmidumphelper.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/spmidumphelper.cpp @@ -234,55 +234,37 @@ std::string SpmiDumpHelper::DumpJitFlags(unsigned long long flags) AddFlag(DEBUG_INFO); AddFlag(MIN_OPT); AddFlag(ENABLE_CFG); - AddFlag(MCJIT_BACKGROUND); - - // x86 only - // - AddFlagNumeric(PINVOKE_RESTORE_ESP, 8); - - // UNUSED = 9 - // UNUSED = 10 - // UNUSED = 11 - // UNUSED = 12 - AddFlag(OSR); AddFlag(ALT_JIT); AddFlag(FROZEN_ALLOC_ALLOWED); - // UNUSED = 16 - // UNUSED = 17 AddFlag(MAKEFINALCODE); AddFlag(READYTORUN); AddFlag(PROF_ENTERLEAVE); - // UNUSED = 21 AddFlag(PROF_NO_PINVOKE_INLINE); - // UNUSED = 23 AddFlag(PREJIT); AddFlag(RELOC); - // UNUSED = 26 AddFlag(IL_STUB); AddFlag(PROCSPLIT); AddFlag(BBINSTR); + AddFlag(BBINSTR_IF_LOOPS); AddFlag(BBOPT); AddFlag(FRAMED); - AddFlag(BBINSTR_IF_LOOPS); AddFlag(PUBLISH_SECRET_PARAM); - // UNUSED = 34 - // UNUSED = 35 AddFlag(USE_PINVOKE_HELPERS); AddFlag(REVERSE_PINVOKE); AddFlag(TRACK_TRANSITIONS); AddFlag(TIER0); AddFlag(TIER1); + AddFlag(NO_INLINING); // arm32 only // - AddFlagNumeric(RELATIVE_CODE_RELOCS, 41); - - AddFlag(NO_INLINING); + AddFlagNumeric(RELATIVE_CODE_RELOCS, 29); + AddFlagNumeric(SOFTFP_ABI, 30); - // x86/x64 only + // xarch only // - AddFlagNumeric(VECTOR512_THROTTLING, 43); + AddFlagNumeric(VECTOR512_THROTTLING, 31); // "Extra jit flag" support // diff --git a/src/coreclr/vm/ceeload.cpp b/src/coreclr/vm/ceeload.cpp index 3655045215d3cc..46e596e29c49af 100644 --- a/src/coreclr/vm/ceeload.cpp +++ b/src/coreclr/vm/ceeload.cpp @@ -1537,37 +1537,6 @@ BOOL Module::IsRuntimeMarshallingEnabled() return hr != S_OK; } -BOOL Module::IsPreV4Assembly() -{ - CONTRACTL - { - THROWS; - GC_NOTRIGGER; - } - CONTRACTL_END - - if (!(m_dwPersistedFlags & COMPUTED_IS_PRE_V4_ASSEMBLY)) - { - IMDInternalImport *pImport = GetAssembly()->GetMDImport(); - _ASSERTE(pImport); - - BOOL fIsPreV4Assembly = FALSE; - LPCSTR szVersion = NULL; - if (SUCCEEDED(pImport->GetVersionString(&szVersion))) - { - if (szVersion != NULL && strlen(szVersion) > 2) - { - fIsPreV4Assembly = (szVersion[0] == 'v' || szVersion[0] == 'V') && - (szVersion[1] == '1' || szVersion[1] == '2'); - } - } - - InterlockedOr((LONG*)&m_dwPersistedFlags, COMPUTED_IS_PRE_V4_ASSEMBLY | - (fIsPreV4Assembly ? IS_PRE_V4_ASSEMBLY : 0)); - } - - return !!(m_dwPersistedFlags & IS_PRE_V4_ASSEMBLY); -} DWORD Module::AllocateDynamicEntry(MethodTable *pMT) { diff --git a/src/coreclr/vm/ceeload.h b/src/coreclr/vm/ceeload.h index 56dd2a4d25a6ab..4eff6e66aab090 100644 --- a/src/coreclr/vm/ceeload.h +++ b/src/coreclr/vm/ceeload.h @@ -679,10 +679,6 @@ class Module : public ModuleBase // This flag applies to assembly, but is also stored here so that it can be cached in ngen image COLLECTIBLE_MODULE = 0x00000080, - // Caches metadata version - COMPUTED_IS_PRE_V4_ASSEMBLY = 0x00000100, - IS_PRE_V4_ASSEMBLY = 0x00000200, - //If attribute value has been cached before DEFAULT_DLL_IMPORT_SEARCH_PATHS_IS_CACHED = 0x00000400, @@ -1711,21 +1707,11 @@ class Module : public ModuleBase return (m_DefaultDllImportSearchPathsAttributeValue & 0x2) != 0; } - //----------------------------------------------------------------------------------------- - // True iff metadata version string is 1.* or 2.*. - // @TODO (post-Dev10): All places that need this information should call this function - // instead of parsing the version themselves. - //----------------------------------------------------------------------------------------- - BOOL IsPreV4Assembly(); - protected: - // initialize Crst controlling the Dynamic IL hashtables void InitializeDynamicILCrst(); -public: - private: // This struct stores the data used by the managed debugging infrastructure. If it turns out that diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index 6727949fea6d59..71badca705f7e1 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -12771,10 +12771,6 @@ CorJitResult invokeCompileMethod(EEJitManager *jitMgr, CORJIT_FLAGS flags; if (g_pConfig->JitFramed()) flags.Set(CORJIT_FLAGS::CORJIT_FLAG_FRAMED); -#ifdef TARGET_X86 - if (g_pConfig->PInvokeRestoreEsp(ftn->GetModule()->IsPreV4Assembly())) - flags.Set(CORJIT_FLAGS::CORJIT_FLAG_PINVOKE_RESTORE_ESP); -#endif // TARGET_X86 // Set flags based on method's ImplFlags. if (!ftn->IsNoMetadata()) @@ -13237,17 +13233,14 @@ PCODE UnsafeJitFunction(PrepareCodeConfig* config, { jitInfo.WriteCode(jitMgr); #if defined(DEBUGGING_SUPPORTED) - if (!pJitFlags->IsSet(CORJIT_FLAGS::CORJIT_FLAG_MCJIT_BACKGROUND)) + // + // Notify the debugger that we have successfully jitted the function + // + if (g_pDebugInterface) { - // - // Notify the debugger that we have successfully jitted the function - // - if (g_pDebugInterface) + if (!jitInfo.JitAgain()) { - if (!jitInfo.JitAgain()) - { - g_pDebugInterface->JITComplete(nativeCodeVersion, (TADDR)nativeEntry); - } + g_pDebugInterface->JITComplete(nativeCodeVersion, (TADDR)nativeEntry); } } #endif // DEBUGGING_SUPPORTED From 4464b5777df86f9bc4096f301139d0e4d55cef98 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Thu, 15 Jun 2023 14:23:55 -0700 Subject: [PATCH 02/16] Remove unused STRESS_PINVOKE_RESTORE_ESP --- src/coreclr/jit/compiler.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 753f484466aa7e..1118668799cdc6 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -9757,7 +9757,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX STRESS_MODE(CATCH_ARG) /* Will spill catch arg */ \ STRESS_MODE(UNSAFE_BUFFER_CHECKS) \ STRESS_MODE(NULL_OBJECT_CHECK) \ - STRESS_MODE(PINVOKE_RESTORE_ESP) \ STRESS_MODE(RANDOM_INLINE) \ STRESS_MODE(SWITCH_CMP_BR_EXPANSION) \ STRESS_MODE(GENERIC_VARN) \ From d74006ae998134c95d4c2bcd781a852414370e72 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Thu, 15 Jun 2023 14:54:05 -0700 Subject: [PATCH 03/16] Remove isCompatibleDelegate --- src/coreclr/inc/corinfo.h | 11 - src/coreclr/inc/icorjitinfoimpl_generated.h | 7 - src/coreclr/jit/ICorJitInfo_names_generated.h | 1 - .../jit/ICorJitInfo_wrapper_generated.hpp | 13 - .../tools/Common/JitInterface/CorInfoImpl.cs | 2 - .../JitInterface/CorInfoImpl_generated.cs | 328 +++++++++--------- .../ThunkGenerator/ThunkInput.txt | 1 - .../aot/jitinterface/jitinterface_generated.h | 14 - .../tools/superpmi/superpmi-shared/agnostic.h | 8 - .../tools/superpmi/superpmi-shared/lwmlist.h | 1 - .../superpmi-shared/methodcontext.cpp | 51 --- .../superpmi/superpmi-shared/methodcontext.h | 15 +- .../superpmi-shim-collector/icorjitinfo.cpp | 18 - .../icorjitinfo_generated.cpp | 11 - .../icorjitinfo_generated.cpp | 10 - .../tools/superpmi/superpmi/icorjitinfo.cpp | 14 - src/coreclr/vm/comdelegate.cpp | 62 ---- src/coreclr/vm/comdelegate.h | 3 - src/coreclr/vm/jitinterface.cpp | 50 --- 19 files changed, 157 insertions(+), 463 deletions(-) diff --git a/src/coreclr/inc/corinfo.h b/src/coreclr/inc/corinfo.h index 04a8f2fb898d4d..2c8c341cf7b79b 100644 --- a/src/coreclr/inc/corinfo.h +++ b/src/coreclr/inc/corinfo.h @@ -2178,17 +2178,6 @@ class ICorStaticInfo CORINFO_METHOD_HANDLE method ) = 0; - // Given a delegate target class, a target method parent class, a target method, - // a delegate class, check if the method signature is compatible with the Invoke method of the delegate - // (under the typical instantiation of any free type variables in the memberref signatures). - virtual bool isCompatibleDelegate( - CORINFO_CLASS_HANDLE objCls, /* type of the delegate target, if any */ - CORINFO_CLASS_HANDLE methodParentCls, /* exact parent of the target method, if any */ - CORINFO_METHOD_HANDLE method, /* (representative) target method, if any */ - CORINFO_CLASS_HANDLE delegateCls, /* exact type of the delegate */ - bool *pfIsOpenDelegate /* is the delegate open */ - ) = 0; - // load and restore the method virtual void methodMustBeLoadedBeforeCodeIsRun( CORINFO_METHOD_HANDLE method diff --git a/src/coreclr/inc/icorjitinfoimpl_generated.h b/src/coreclr/inc/icorjitinfoimpl_generated.h index f3d93194df2588..bbbefb165338fd 100644 --- a/src/coreclr/inc/icorjitinfoimpl_generated.h +++ b/src/coreclr/inc/icorjitinfoimpl_generated.h @@ -117,13 +117,6 @@ bool satisfiesMethodConstraints( CORINFO_CLASS_HANDLE parent, CORINFO_METHOD_HANDLE method) override; -bool isCompatibleDelegate( - CORINFO_CLASS_HANDLE objCls, - CORINFO_CLASS_HANDLE methodParentCls, - CORINFO_METHOD_HANDLE method, - CORINFO_CLASS_HANDLE delegateCls, - bool* pfIsOpenDelegate) override; - void methodMustBeLoadedBeforeCodeIsRun( CORINFO_METHOD_HANDLE method) override; diff --git a/src/coreclr/jit/ICorJitInfo_names_generated.h b/src/coreclr/jit/ICorJitInfo_names_generated.h index b93f42dfba8ffe..0ddf2537a9002d 100644 --- a/src/coreclr/jit/ICorJitInfo_names_generated.h +++ b/src/coreclr/jit/ICorJitInfo_names_generated.h @@ -27,7 +27,6 @@ DEF_CLR_API(isIntrinsicType) DEF_CLR_API(getUnmanagedCallConv) DEF_CLR_API(pInvokeMarshalingRequired) DEF_CLR_API(satisfiesMethodConstraints) -DEF_CLR_API(isCompatibleDelegate) DEF_CLR_API(methodMustBeLoadedBeforeCodeIsRun) DEF_CLR_API(mapMethodDeclToMethodImpl) DEF_CLR_API(getGSCookie) diff --git a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp index da369eda01a370..bec5cae85b7dc8 100644 --- a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp +++ b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp @@ -238,19 +238,6 @@ bool WrapICorJitInfo::satisfiesMethodConstraints( return temp; } -bool WrapICorJitInfo::isCompatibleDelegate( - CORINFO_CLASS_HANDLE objCls, - CORINFO_CLASS_HANDLE methodParentCls, - CORINFO_METHOD_HANDLE method, - CORINFO_CLASS_HANDLE delegateCls, - bool* pfIsOpenDelegate) -{ - API_ENTER(isCompatibleDelegate); - bool temp = wrapHnd->isCompatibleDelegate(objCls, methodParentCls, method, delegateCls, pfIsOpenDelegate); - API_LEAVE(isCompatibleDelegate); - return temp; -} - void WrapICorJitInfo::methodMustBeLoadedBeforeCodeIsRun( CORINFO_METHOD_HANDLE method) { diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs index f831e74c904a8d..4429981d86151b 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs @@ -1565,8 +1565,6 @@ private static CorInfoCallConvExtension ToCorInfoCallConvExtension(UnmanagedCall private bool satisfiesMethodConstraints(CORINFO_CLASS_STRUCT_* parent, CORINFO_METHOD_STRUCT_* method) { throw new NotImplementedException("satisfiesMethodConstraints"); } - private bool isCompatibleDelegate(CORINFO_CLASS_STRUCT_* objCls, CORINFO_CLASS_STRUCT_* methodParentCls, CORINFO_METHOD_STRUCT_* method, CORINFO_CLASS_STRUCT_* delegateCls, ref bool pfIsOpenDelegate) - { throw new NotImplementedException("isCompatibleDelegate"); } private void setPatchpointInfo(PatchpointInfo* patchpointInfo) { throw new NotImplementedException("setPatchpointInfo"); } private PatchpointInfo* getOSRInfo(ref uint ilOffset) diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs index 772a97e0cfb822..eb19af6574c9f7 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs @@ -349,21 +349,6 @@ private static byte _satisfiesMethodConstraints(IntPtr thisHandle, IntPtr* ppExc } } - [UnmanagedCallersOnly] - private static byte _isCompatibleDelegate(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* objCls, CORINFO_CLASS_STRUCT_* methodParentCls, CORINFO_METHOD_STRUCT_* method, CORINFO_CLASS_STRUCT_* delegateCls, bool* pfIsOpenDelegate) - { - var _this = GetThis(thisHandle); - try - { - return _this.isCompatibleDelegate(objCls, methodParentCls, method, delegateCls, ref *pfIsOpenDelegate) ? (byte)1 : (byte)0; - } - catch (Exception ex) - { - *ppException = _this.AllocException(ex); - return default; - } - } - [UnmanagedCallersOnly] private static void _methodMustBeLoadedBeforeCodeIsRun(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method) { @@ -2657,7 +2642,7 @@ private static uint _getJitFlags(IntPtr thisHandle, IntPtr* ppException, CORJIT_ private static IntPtr GetUnmanagedCallbacks() { - void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 179); + void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 178); callbacks[0] = (delegate* unmanaged)&_isIntrinsic; callbacks[1] = (delegate* unmanaged)&_getMethodAttribs; @@ -2682,162 +2667,161 @@ private static IntPtr GetUnmanagedCallbacks() callbacks[20] = (delegate* unmanaged)&_getUnmanagedCallConv; callbacks[21] = (delegate* unmanaged)&_pInvokeMarshalingRequired; callbacks[22] = (delegate* unmanaged)&_satisfiesMethodConstraints; - callbacks[23] = (delegate* unmanaged)&_isCompatibleDelegate; - callbacks[24] = (delegate* unmanaged)&_methodMustBeLoadedBeforeCodeIsRun; - callbacks[25] = (delegate* unmanaged)&_mapMethodDeclToMethodImpl; - callbacks[26] = (delegate* unmanaged)&_getGSCookie; - callbacks[27] = (delegate* unmanaged)&_setPatchpointInfo; - callbacks[28] = (delegate* unmanaged)&_getOSRInfo; - callbacks[29] = (delegate* unmanaged)&_resolveToken; - callbacks[30] = (delegate* unmanaged)&_tryResolveToken; - callbacks[31] = (delegate* unmanaged)&_findSig; - callbacks[32] = (delegate* unmanaged)&_findCallSiteSig; - callbacks[33] = (delegate* unmanaged)&_getTokenTypeAsHandle; - callbacks[34] = (delegate* unmanaged)&_isValidToken; - callbacks[35] = (delegate* unmanaged)&_isValidStringRef; - callbacks[36] = (delegate* unmanaged)&_getStringLiteral; - callbacks[37] = (delegate* unmanaged)&_printObjectDescription; - callbacks[38] = (delegate* unmanaged)&_asCorInfoType; - callbacks[39] = (delegate* unmanaged)&_getClassNameFromMetadata; - callbacks[40] = (delegate* unmanaged)&_getTypeInstantiationArgument; - callbacks[41] = (delegate* unmanaged)&_printClassName; - callbacks[42] = (delegate* unmanaged)&_isValueClass; - callbacks[43] = (delegate* unmanaged)&_canInlineTypeCheck; - callbacks[44] = (delegate* unmanaged)&_getClassAttribs; - callbacks[45] = (delegate* unmanaged)&_getClassModule; - callbacks[46] = (delegate* unmanaged)&_getModuleAssembly; - callbacks[47] = (delegate* unmanaged)&_getAssemblyName; - callbacks[48] = (delegate* unmanaged)&_LongLifetimeMalloc; - callbacks[49] = (delegate* unmanaged)&_LongLifetimeFree; - callbacks[50] = (delegate* unmanaged)&_getClassModuleIdForStatics; - callbacks[51] = (delegate* unmanaged)&_getIsClassInitedFlagAddress; - callbacks[52] = (delegate* unmanaged)&_getStaticBaseAddress; - callbacks[53] = (delegate* unmanaged)&_getClassSize; - callbacks[54] = (delegate* unmanaged)&_getHeapClassSize; - callbacks[55] = (delegate* unmanaged)&_canAllocateOnStack; - callbacks[56] = (delegate* unmanaged)&_getClassAlignmentRequirement; - callbacks[57] = (delegate* unmanaged)&_getClassGClayout; - callbacks[58] = (delegate* unmanaged)&_getClassNumInstanceFields; - callbacks[59] = (delegate* unmanaged)&_getFieldInClass; - callbacks[60] = (delegate* unmanaged)&_checkMethodModifier; - callbacks[61] = (delegate* unmanaged)&_getNewHelper; - callbacks[62] = (delegate* unmanaged)&_getNewArrHelper; - callbacks[63] = (delegate* unmanaged)&_getCastingHelper; - callbacks[64] = (delegate* unmanaged)&_getSharedCCtorHelper; - callbacks[65] = (delegate* unmanaged)&_getTypeForBox; - callbacks[66] = (delegate* unmanaged)&_getBoxHelper; - callbacks[67] = (delegate* unmanaged)&_getUnBoxHelper; - callbacks[68] = (delegate* unmanaged)&_getRuntimeTypePointer; - callbacks[69] = (delegate* unmanaged)&_isObjectImmutable; - callbacks[70] = (delegate* unmanaged)&_getStringChar; - callbacks[71] = (delegate* unmanaged)&_getObjectType; - callbacks[72] = (delegate* unmanaged)&_getReadyToRunHelper; - callbacks[73] = (delegate* unmanaged)&_getReadyToRunDelegateCtorHelper; - callbacks[74] = (delegate* unmanaged)&_initClass; - callbacks[75] = (delegate* unmanaged)&_classMustBeLoadedBeforeCodeIsRun; - callbacks[76] = (delegate* unmanaged)&_getBuiltinClass; - callbacks[77] = (delegate* unmanaged)&_getTypeForPrimitiveValueClass; - callbacks[78] = (delegate* unmanaged)&_getTypeForPrimitiveNumericClass; - callbacks[79] = (delegate* unmanaged)&_canCast; - callbacks[80] = (delegate* unmanaged)&_compareTypesForCast; - callbacks[81] = (delegate* unmanaged)&_compareTypesForEquality; - callbacks[82] = (delegate* unmanaged)&_mergeClasses; - callbacks[83] = (delegate* unmanaged)&_isMoreSpecificType; - callbacks[84] = (delegate* unmanaged)&_isEnum; - callbacks[85] = (delegate* unmanaged)&_getParentType; - callbacks[86] = (delegate* unmanaged)&_getChildType; - callbacks[87] = (delegate* unmanaged)&_satisfiesClassConstraints; - callbacks[88] = (delegate* unmanaged)&_isSDArray; - callbacks[89] = (delegate* unmanaged)&_getArrayRank; - callbacks[90] = (delegate* unmanaged)&_getArrayIntrinsicID; - callbacks[91] = (delegate* unmanaged)&_getArrayInitializationData; - callbacks[92] = (delegate* unmanaged)&_canAccessClass; - callbacks[93] = (delegate* unmanaged)&_printFieldName; - callbacks[94] = (delegate* unmanaged)&_getFieldClass; - callbacks[95] = (delegate* unmanaged)&_getFieldType; - callbacks[96] = (delegate* unmanaged)&_getFieldOffset; - callbacks[97] = (delegate* unmanaged)&_getFieldInfo; - callbacks[98] = (delegate* unmanaged)&_getThreadLocalFieldInfo; - callbacks[99] = (delegate* unmanaged)&_getThreadLocalStaticBlocksInfo; - callbacks[100] = (delegate* unmanaged)&_isFieldStatic; - callbacks[101] = (delegate* unmanaged)&_getArrayOrStringLength; - callbacks[102] = (delegate* unmanaged)&_getBoundaries; - callbacks[103] = (delegate* unmanaged)&_setBoundaries; - callbacks[104] = (delegate* unmanaged)&_getVars; - callbacks[105] = (delegate* unmanaged)&_setVars; - callbacks[106] = (delegate* unmanaged)&_reportRichMappings; - callbacks[107] = (delegate* unmanaged)&_allocateArray; - callbacks[108] = (delegate* unmanaged)&_freeArray; - callbacks[109] = (delegate* unmanaged)&_getArgNext; - callbacks[110] = (delegate* unmanaged)&_getArgType; - callbacks[111] = (delegate* unmanaged)&_getExactClasses; - callbacks[112] = (delegate* unmanaged)&_getArgClass; - callbacks[113] = (delegate* unmanaged)&_getHFAType; - callbacks[114] = (delegate* unmanaged)&_runWithErrorTrap; - callbacks[115] = (delegate* unmanaged)&_runWithSPMIErrorTrap; - callbacks[116] = (delegate* unmanaged)&_getEEInfo; - callbacks[117] = (delegate* unmanaged)&_getJitTimeLogFilename; - callbacks[118] = (delegate* unmanaged)&_getMethodDefFromMethod; - callbacks[119] = (delegate* unmanaged)&_printMethodName; - callbacks[120] = (delegate* unmanaged)&_getMethodNameFromMetadata; - callbacks[121] = (delegate* unmanaged)&_getMethodHash; - callbacks[122] = (delegate* unmanaged)&_findNameOfToken; - callbacks[123] = (delegate* unmanaged)&_getSystemVAmd64PassStructInRegisterDescriptor; - callbacks[124] = (delegate* unmanaged)&_getLoongArch64PassStructInRegisterFlags; - callbacks[125] = (delegate* unmanaged)&_getRISCV64PassStructInRegisterFlags; - callbacks[126] = (delegate* unmanaged)&_getThreadTLSIndex; - callbacks[127] = (delegate* unmanaged)&_getInlinedCallFrameVptr; - callbacks[128] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; - callbacks[129] = (delegate* unmanaged)&_getHelperFtn; - callbacks[130] = (delegate* unmanaged)&_getFunctionEntryPoint; - callbacks[131] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; - callbacks[132] = (delegate* unmanaged)&_getMethodSync; - callbacks[133] = (delegate* unmanaged)&_getLazyStringLiteralHelper; - callbacks[134] = (delegate* unmanaged)&_embedModuleHandle; - callbacks[135] = (delegate* unmanaged)&_embedClassHandle; - callbacks[136] = (delegate* unmanaged)&_embedMethodHandle; - callbacks[137] = (delegate* unmanaged)&_embedFieldHandle; - callbacks[138] = (delegate* unmanaged)&_embedGenericHandle; - callbacks[139] = (delegate* unmanaged)&_getLocationOfThisType; - callbacks[140] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; - callbacks[141] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; - callbacks[142] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; - callbacks[143] = (delegate* unmanaged)&_getJustMyCodeHandle; - callbacks[144] = (delegate* unmanaged)&_GetProfilingHandle; - callbacks[145] = (delegate* unmanaged)&_getCallInfo; - callbacks[146] = (delegate* unmanaged)&_canAccessFamily; - callbacks[147] = (delegate* unmanaged)&_isRIDClassDomainID; - callbacks[148] = (delegate* unmanaged)&_getClassDomainID; - callbacks[149] = (delegate* unmanaged)&_getStaticFieldContent; - callbacks[150] = (delegate* unmanaged)&_getObjectContent; - callbacks[151] = (delegate* unmanaged)&_getStaticFieldCurrentClass; - callbacks[152] = (delegate* unmanaged)&_getVarArgsHandle; - callbacks[153] = (delegate* unmanaged)&_canGetVarArgsHandle; - callbacks[154] = (delegate* unmanaged)&_constructStringLiteral; - callbacks[155] = (delegate* unmanaged)&_emptyStringLiteral; - callbacks[156] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; - callbacks[157] = (delegate* unmanaged)&_GetDelegateCtor; - callbacks[158] = (delegate* unmanaged)&_MethodCompileComplete; - callbacks[159] = (delegate* unmanaged)&_getTailCallHelpers; - callbacks[160] = (delegate* unmanaged)&_convertPInvokeCalliToCall; - callbacks[161] = (delegate* unmanaged)&_notifyInstructionSetUsage; - callbacks[162] = (delegate* unmanaged)&_updateEntryPointForTailCall; - callbacks[163] = (delegate* unmanaged)&_allocMem; - callbacks[164] = (delegate* unmanaged)&_reserveUnwindInfo; - callbacks[165] = (delegate* unmanaged)&_allocUnwindInfo; - callbacks[166] = (delegate* unmanaged)&_allocGCInfo; - callbacks[167] = (delegate* unmanaged)&_setEHcount; - callbacks[168] = (delegate* unmanaged)&_setEHinfo; - callbacks[169] = (delegate* unmanaged)&_logMsg; - callbacks[170] = (delegate* unmanaged)&_doAssert; - callbacks[171] = (delegate* unmanaged)&_reportFatalError; - callbacks[172] = (delegate* unmanaged)&_getPgoInstrumentationResults; - callbacks[173] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; - callbacks[174] = (delegate* unmanaged)&_recordCallSite; - callbacks[175] = (delegate* unmanaged)&_recordRelocation; - callbacks[176] = (delegate* unmanaged)&_getRelocTypeHint; - callbacks[177] = (delegate* unmanaged)&_getExpectedTargetArchitecture; - callbacks[178] = (delegate* unmanaged)&_getJitFlags; + callbacks[23] = (delegate* unmanaged)&_methodMustBeLoadedBeforeCodeIsRun; + callbacks[24] = (delegate* unmanaged)&_mapMethodDeclToMethodImpl; + callbacks[25] = (delegate* unmanaged)&_getGSCookie; + callbacks[26] = (delegate* unmanaged)&_setPatchpointInfo; + callbacks[27] = (delegate* unmanaged)&_getOSRInfo; + callbacks[28] = (delegate* unmanaged)&_resolveToken; + callbacks[29] = (delegate* unmanaged)&_tryResolveToken; + callbacks[30] = (delegate* unmanaged)&_findSig; + callbacks[31] = (delegate* unmanaged)&_findCallSiteSig; + callbacks[32] = (delegate* unmanaged)&_getTokenTypeAsHandle; + callbacks[33] = (delegate* unmanaged)&_isValidToken; + callbacks[34] = (delegate* unmanaged)&_isValidStringRef; + callbacks[35] = (delegate* unmanaged)&_getStringLiteral; + callbacks[36] = (delegate* unmanaged)&_printObjectDescription; + callbacks[37] = (delegate* unmanaged)&_asCorInfoType; + callbacks[38] = (delegate* unmanaged)&_getClassNameFromMetadata; + callbacks[39] = (delegate* unmanaged)&_getTypeInstantiationArgument; + callbacks[40] = (delegate* unmanaged)&_printClassName; + callbacks[41] = (delegate* unmanaged)&_isValueClass; + callbacks[42] = (delegate* unmanaged)&_canInlineTypeCheck; + callbacks[43] = (delegate* unmanaged)&_getClassAttribs; + callbacks[44] = (delegate* unmanaged)&_getClassModule; + callbacks[45] = (delegate* unmanaged)&_getModuleAssembly; + callbacks[46] = (delegate* unmanaged)&_getAssemblyName; + callbacks[47] = (delegate* unmanaged)&_LongLifetimeMalloc; + callbacks[48] = (delegate* unmanaged)&_LongLifetimeFree; + callbacks[49] = (delegate* unmanaged)&_getClassModuleIdForStatics; + callbacks[50] = (delegate* unmanaged)&_getIsClassInitedFlagAddress; + callbacks[51] = (delegate* unmanaged)&_getStaticBaseAddress; + callbacks[52] = (delegate* unmanaged)&_getClassSize; + callbacks[53] = (delegate* unmanaged)&_getHeapClassSize; + callbacks[54] = (delegate* unmanaged)&_canAllocateOnStack; + callbacks[55] = (delegate* unmanaged)&_getClassAlignmentRequirement; + callbacks[56] = (delegate* unmanaged)&_getClassGClayout; + callbacks[57] = (delegate* unmanaged)&_getClassNumInstanceFields; + callbacks[58] = (delegate* unmanaged)&_getFieldInClass; + callbacks[59] = (delegate* unmanaged)&_checkMethodModifier; + callbacks[60] = (delegate* unmanaged)&_getNewHelper; + callbacks[61] = (delegate* unmanaged)&_getNewArrHelper; + callbacks[62] = (delegate* unmanaged)&_getCastingHelper; + callbacks[63] = (delegate* unmanaged)&_getSharedCCtorHelper; + callbacks[64] = (delegate* unmanaged)&_getTypeForBox; + callbacks[65] = (delegate* unmanaged)&_getBoxHelper; + callbacks[66] = (delegate* unmanaged)&_getUnBoxHelper; + callbacks[67] = (delegate* unmanaged)&_getRuntimeTypePointer; + callbacks[68] = (delegate* unmanaged)&_isObjectImmutable; + callbacks[69] = (delegate* unmanaged)&_getStringChar; + callbacks[70] = (delegate* unmanaged)&_getObjectType; + callbacks[71] = (delegate* unmanaged)&_getReadyToRunHelper; + callbacks[72] = (delegate* unmanaged)&_getReadyToRunDelegateCtorHelper; + callbacks[73] = (delegate* unmanaged)&_initClass; + callbacks[74] = (delegate* unmanaged)&_classMustBeLoadedBeforeCodeIsRun; + callbacks[75] = (delegate* unmanaged)&_getBuiltinClass; + callbacks[76] = (delegate* unmanaged)&_getTypeForPrimitiveValueClass; + callbacks[77] = (delegate* unmanaged)&_getTypeForPrimitiveNumericClass; + callbacks[78] = (delegate* unmanaged)&_canCast; + callbacks[79] = (delegate* unmanaged)&_compareTypesForCast; + callbacks[80] = (delegate* unmanaged)&_compareTypesForEquality; + callbacks[81] = (delegate* unmanaged)&_mergeClasses; + callbacks[82] = (delegate* unmanaged)&_isMoreSpecificType; + callbacks[83] = (delegate* unmanaged)&_isEnum; + callbacks[84] = (delegate* unmanaged)&_getParentType; + callbacks[85] = (delegate* unmanaged)&_getChildType; + callbacks[86] = (delegate* unmanaged)&_satisfiesClassConstraints; + callbacks[87] = (delegate* unmanaged)&_isSDArray; + callbacks[88] = (delegate* unmanaged)&_getArrayRank; + callbacks[89] = (delegate* unmanaged)&_getArrayIntrinsicID; + callbacks[90] = (delegate* unmanaged)&_getArrayInitializationData; + callbacks[91] = (delegate* unmanaged)&_canAccessClass; + callbacks[92] = (delegate* unmanaged)&_printFieldName; + callbacks[93] = (delegate* unmanaged)&_getFieldClass; + callbacks[94] = (delegate* unmanaged)&_getFieldType; + callbacks[95] = (delegate* unmanaged)&_getFieldOffset; + callbacks[96] = (delegate* unmanaged)&_getFieldInfo; + callbacks[97] = (delegate* unmanaged)&_getThreadLocalFieldInfo; + callbacks[98] = (delegate* unmanaged)&_getThreadLocalStaticBlocksInfo; + callbacks[99] = (delegate* unmanaged)&_isFieldStatic; + callbacks[100] = (delegate* unmanaged)&_getArrayOrStringLength; + callbacks[101] = (delegate* unmanaged)&_getBoundaries; + callbacks[102] = (delegate* unmanaged)&_setBoundaries; + callbacks[103] = (delegate* unmanaged)&_getVars; + callbacks[104] = (delegate* unmanaged)&_setVars; + callbacks[105] = (delegate* unmanaged)&_reportRichMappings; + callbacks[106] = (delegate* unmanaged)&_allocateArray; + callbacks[107] = (delegate* unmanaged)&_freeArray; + callbacks[108] = (delegate* unmanaged)&_getArgNext; + callbacks[109] = (delegate* unmanaged)&_getArgType; + callbacks[110] = (delegate* unmanaged)&_getExactClasses; + callbacks[111] = (delegate* unmanaged)&_getArgClass; + callbacks[112] = (delegate* unmanaged)&_getHFAType; + callbacks[113] = (delegate* unmanaged)&_runWithErrorTrap; + callbacks[114] = (delegate* unmanaged)&_runWithSPMIErrorTrap; + callbacks[115] = (delegate* unmanaged)&_getEEInfo; + callbacks[116] = (delegate* unmanaged)&_getJitTimeLogFilename; + callbacks[117] = (delegate* unmanaged)&_getMethodDefFromMethod; + callbacks[118] = (delegate* unmanaged)&_printMethodName; + callbacks[119] = (delegate* unmanaged)&_getMethodNameFromMetadata; + callbacks[120] = (delegate* unmanaged)&_getMethodHash; + callbacks[121] = (delegate* unmanaged)&_findNameOfToken; + callbacks[122] = (delegate* unmanaged)&_getSystemVAmd64PassStructInRegisterDescriptor; + callbacks[123] = (delegate* unmanaged)&_getLoongArch64PassStructInRegisterFlags; + callbacks[124] = (delegate* unmanaged)&_getRISCV64PassStructInRegisterFlags; + callbacks[125] = (delegate* unmanaged)&_getThreadTLSIndex; + callbacks[126] = (delegate* unmanaged)&_getInlinedCallFrameVptr; + callbacks[127] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; + callbacks[128] = (delegate* unmanaged)&_getHelperFtn; + callbacks[129] = (delegate* unmanaged)&_getFunctionEntryPoint; + callbacks[130] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; + callbacks[131] = (delegate* unmanaged)&_getMethodSync; + callbacks[132] = (delegate* unmanaged)&_getLazyStringLiteralHelper; + callbacks[133] = (delegate* unmanaged)&_embedModuleHandle; + callbacks[134] = (delegate* unmanaged)&_embedClassHandle; + callbacks[135] = (delegate* unmanaged)&_embedMethodHandle; + callbacks[136] = (delegate* unmanaged)&_embedFieldHandle; + callbacks[137] = (delegate* unmanaged)&_embedGenericHandle; + callbacks[138] = (delegate* unmanaged)&_getLocationOfThisType; + callbacks[139] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; + callbacks[140] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; + callbacks[141] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; + callbacks[142] = (delegate* unmanaged)&_getJustMyCodeHandle; + callbacks[143] = (delegate* unmanaged)&_GetProfilingHandle; + callbacks[144] = (delegate* unmanaged)&_getCallInfo; + callbacks[145] = (delegate* unmanaged)&_canAccessFamily; + callbacks[146] = (delegate* unmanaged)&_isRIDClassDomainID; + callbacks[147] = (delegate* unmanaged)&_getClassDomainID; + callbacks[148] = (delegate* unmanaged)&_getStaticFieldContent; + callbacks[149] = (delegate* unmanaged)&_getObjectContent; + callbacks[150] = (delegate* unmanaged)&_getStaticFieldCurrentClass; + callbacks[151] = (delegate* unmanaged)&_getVarArgsHandle; + callbacks[152] = (delegate* unmanaged)&_canGetVarArgsHandle; + callbacks[153] = (delegate* unmanaged)&_constructStringLiteral; + callbacks[154] = (delegate* unmanaged)&_emptyStringLiteral; + callbacks[155] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; + callbacks[156] = (delegate* unmanaged)&_GetDelegateCtor; + callbacks[157] = (delegate* unmanaged)&_MethodCompileComplete; + callbacks[158] = (delegate* unmanaged)&_getTailCallHelpers; + callbacks[159] = (delegate* unmanaged)&_convertPInvokeCalliToCall; + callbacks[160] = (delegate* unmanaged)&_notifyInstructionSetUsage; + callbacks[161] = (delegate* unmanaged)&_updateEntryPointForTailCall; + callbacks[162] = (delegate* unmanaged)&_allocMem; + callbacks[163] = (delegate* unmanaged)&_reserveUnwindInfo; + callbacks[164] = (delegate* unmanaged)&_allocUnwindInfo; + callbacks[165] = (delegate* unmanaged)&_allocGCInfo; + callbacks[166] = (delegate* unmanaged)&_setEHcount; + callbacks[167] = (delegate* unmanaged)&_setEHinfo; + callbacks[168] = (delegate* unmanaged)&_logMsg; + callbacks[169] = (delegate* unmanaged)&_doAssert; + callbacks[170] = (delegate* unmanaged)&_reportFatalError; + callbacks[171] = (delegate* unmanaged)&_getPgoInstrumentationResults; + callbacks[172] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; + callbacks[173] = (delegate* unmanaged)&_recordCallSite; + callbacks[174] = (delegate* unmanaged)&_recordRelocation; + callbacks[175] = (delegate* unmanaged)&_getRelocTypeHint; + callbacks[176] = (delegate* unmanaged)&_getExpectedTargetArchitecture; + callbacks[177] = (delegate* unmanaged)&_getJitFlags; return (IntPtr)callbacks; } diff --git a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt index 89d87da12f848e..e4acd24d26213a 100644 --- a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt +++ b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt @@ -182,7 +182,6 @@ FUNCTIONS CorInfoCallConvExtension getUnmanagedCallConv( CORINFO_METHOD_HANDLE method, CORINFO_SIG_INFO* callSiteSig, bool* pSuppressGCTransition); bool pInvokeMarshalingRequired( CORINFO_METHOD_HANDLE method, CORINFO_SIG_INFO* callSiteSig ); bool satisfiesMethodConstraints( CORINFO_CLASS_HANDLE parent, CORINFO_METHOD_HANDLE method ); - bool isCompatibleDelegate( CORINFO_CLASS_HANDLE objCls, CORINFO_CLASS_HANDLE methodParentCls, CORINFO_METHOD_HANDLE method, CORINFO_CLASS_HANDLE delegateCls, bool *pfIsOpenDelegate ); void methodMustBeLoadedBeforeCodeIsRun( CORINFO_METHOD_HANDLE method ); CORINFO_METHOD_HANDLE mapMethodDeclToMethodImpl( CORINFO_METHOD_HANDLE method ); void getGSCookie( GSCookie * pCookieVal, GSCookie ** ppCookieVal ); diff --git a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h index 56fb164b359563..11bb9e9a5236c5 100644 --- a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h +++ b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h @@ -34,7 +34,6 @@ struct JitInterfaceCallbacks CorInfoCallConvExtension (* getUnmanagedCallConv)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE method, CORINFO_SIG_INFO* callSiteSig, bool* pSuppressGCTransition); bool (* pInvokeMarshalingRequired)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE method, CORINFO_SIG_INFO* callSiteSig); bool (* satisfiesMethodConstraints)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE parent, CORINFO_METHOD_HANDLE method); - bool (* isCompatibleDelegate)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE objCls, CORINFO_CLASS_HANDLE methodParentCls, CORINFO_METHOD_HANDLE method, CORINFO_CLASS_HANDLE delegateCls, bool* pfIsOpenDelegate); void (* methodMustBeLoadedBeforeCodeIsRun)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE method); CORINFO_METHOD_HANDLE (* mapMethodDeclToMethodImpl)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE method); void (* getGSCookie)(void * thisHandle, CorInfoExceptionClass** ppException, GSCookie* pCookieVal, GSCookie** ppCookieVal); @@ -431,19 +430,6 @@ class JitInterfaceWrapper : public ICorJitInfo return temp; } - virtual bool isCompatibleDelegate( - CORINFO_CLASS_HANDLE objCls, - CORINFO_CLASS_HANDLE methodParentCls, - CORINFO_METHOD_HANDLE method, - CORINFO_CLASS_HANDLE delegateCls, - bool* pfIsOpenDelegate) -{ - CorInfoExceptionClass* pException = nullptr; - bool temp = _callbacks->isCompatibleDelegate(_thisHandle, &pException, objCls, methodParentCls, method, delegateCls, pfIsOpenDelegate); - if (pException != nullptr) throw pException; - return temp; -} - virtual void methodMustBeLoadedBeforeCodeIsRun( CORINFO_METHOD_HANDLE method) { diff --git a/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h b/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h index 0783fa52962a49..dbbd6461feaea1 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h @@ -474,14 +474,6 @@ struct Agnostic_GetStaticBaseAddress DWORD result; }; -struct Agnostic_IsCompatibleDelegate -{ - DWORDLONG objCls; - DWORDLONG methodParentCls; - DWORDLONG method; - DWORDLONG delegateCls; -}; - struct Agnostic_PgoInstrumentationSchema { DWORDLONG Offset; // size_t diff --git a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h index 9ea8c6ada013c9..69f09073b47528 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h @@ -144,7 +144,6 @@ LWM(GetObjectType, DWORDLONG, DWORDLONG) LWM(GetVarArgsHandle, GetVarArgsHandleValue, DLDL) LWM(GetVars, DWORDLONG, Agnostic_GetVars) LWM(InitClass, Agnostic_InitClass, DWORD) -LWM(IsCompatibleDelegate, Agnostic_IsCompatibleDelegate, DD) LWM(IsDelegateCreationAllowed, DLDL, DWORD) LWM(IsFieldStatic, DWORDLONG, DWORD) LWM(GetArrayOrStringLength, DWORDLONG, DWORD) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp index 38188259333124..5afe7208ef5bec 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp @@ -5248,57 +5248,6 @@ bool MethodContext::repCanTailCall(CORINFO_METHOD_HANDLE callerHnd, return value != 0; } -void MethodContext::recIsCompatibleDelegate(CORINFO_CLASS_HANDLE objCls, - CORINFO_CLASS_HANDLE methodParentCls, - CORINFO_METHOD_HANDLE method, - CORINFO_CLASS_HANDLE delegateCls, - bool* pfIsOpenDelegate, - bool result) -{ - if (IsCompatibleDelegate == nullptr) - IsCompatibleDelegate = new LightWeightMap(); - - Agnostic_IsCompatibleDelegate key; - ZeroMemory(&key, sizeof(key)); // Zero key including any struct padding - key.objCls = CastHandle(objCls); - key.methodParentCls = CastHandle(methodParentCls); - key.method = CastHandle(method); - key.delegateCls = CastHandle(delegateCls); - - DD value; - value.A = (DWORD)*pfIsOpenDelegate; - value.B = (DWORD)result; - - IsCompatibleDelegate->Add(key, value); - DEBUG_REC(dmpIsCompatibleDelegate(key, value)); -} -void MethodContext::dmpIsCompatibleDelegate(const Agnostic_IsCompatibleDelegate& key, DD value) -{ - printf("IsCompatibleDelegate key objCls-%016" PRIX64 " methodParentCls-%016" PRIX64 " method-%016" PRIX64 " delegateCls-%016" PRIX64 ", value " - "pfIsOpenDelegate-%08X result-%08X", - key.objCls, key.methodParentCls, key.method, key.delegateCls, value.A, value.B); -} -bool MethodContext::repIsCompatibleDelegate(CORINFO_CLASS_HANDLE objCls, - CORINFO_CLASS_HANDLE methodParentCls, - CORINFO_METHOD_HANDLE method, - CORINFO_CLASS_HANDLE delegateCls, - bool* pfIsOpenDelegate) -{ - Agnostic_IsCompatibleDelegate key; - ZeroMemory(&key, sizeof(key)); // Zero key including any struct padding - key.objCls = CastHandle(objCls); - key.methodParentCls = CastHandle(methodParentCls); - key.method = CastHandle(method); - key.delegateCls = CastHandle(delegateCls); - - DD value = LookupByKeyOrMissNoMessage(IsCompatibleDelegate, key); - - DEBUG_REP(dmpIsCompatibleDelegate(key, value)); - - *pfIsOpenDelegate = value.A != 0; - return value.B != 0; -} - void MethodContext::recIsDelegateCreationAllowed(CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeHnd, bool result) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h index d139aa87094914..081a637fcf2133 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h @@ -675,19 +675,6 @@ class MethodContext CORINFO_METHOD_HANDLE exactCalleeHnd, bool fIsTailPrefix); - void recIsCompatibleDelegate(CORINFO_CLASS_HANDLE objCls, - CORINFO_CLASS_HANDLE methodParentCls, - CORINFO_METHOD_HANDLE method, - CORINFO_CLASS_HANDLE delegateCls, - bool* pfIsOpenDelegate, - bool result); - void dmpIsCompatibleDelegate(const Agnostic_IsCompatibleDelegate& key, DD value); - bool repIsCompatibleDelegate(CORINFO_CLASS_HANDLE objCls, - CORINFO_CLASS_HANDLE methodParentCls, - CORINFO_METHOD_HANDLE method, - CORINFO_CLASS_HANDLE delegateCls, - bool* pfIsOpenDelegate); - void recIsDelegateCreationAllowed(CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeHnd, bool result); void dmpIsDelegateCreationAllowed(DLDL key, DWORD value); bool repIsDelegateCreationAllowed(CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeHnd); @@ -1061,7 +1048,7 @@ enum mcPackets Packet_GetVars = 96, Packet_InitClass = 97, //Packet_InitConstraintsForVerification = 98, - Packet_IsCompatibleDelegate = 99, + //Packet_IsCompatibleDelegate = 99, //Packet_IsInstantiationOfVerifiedGeneric = 100, Packet_IsSDArray = 101, //Packet_IsStructRequiringStackAllocRetBuf = 102, diff --git a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp index c746be1fe5bd69..7467083c9da3ed 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp @@ -298,24 +298,6 @@ bool interceptor_ICJI::satisfiesMethodConstraints(CORINFO_CLASS_HANDLE parent, return temp; } -// Given a delegate target class, a target method parent class, a target method, -// a delegate class, check if the method signature is compatible with the Invoke method of the delegate -// (under the typical instantiation of any free type variables in the memberref signatures). -bool interceptor_ICJI::isCompatibleDelegate( - CORINFO_CLASS_HANDLE objCls, /* type of the delegate target, if any */ - CORINFO_CLASS_HANDLE methodParentCls, /* exact parent of the target method, if any */ - CORINFO_METHOD_HANDLE method, /* (representative) target method, if any */ - CORINFO_CLASS_HANDLE delegateCls, /* exact type of the delegate */ - bool* pfIsOpenDelegate /* is the delegate open */ - ) -{ - mc->cr->AddCall("isCompatibleDelegate"); - bool temp = - original_ICorJitInfo->isCompatibleDelegate(objCls, methodParentCls, method, delegateCls, pfIsOpenDelegate); - mc->recIsCompatibleDelegate(objCls, methodParentCls, method, delegateCls, pfIsOpenDelegate, temp); - return temp; -} - // load and restore the method void interceptor_ICJI::methodMustBeLoadedBeforeCodeIsRun(CORINFO_METHOD_HANDLE method) { diff --git a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp index 6d301f516f60b0..69716778ca72ee 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp @@ -200,17 +200,6 @@ bool interceptor_ICJI::satisfiesMethodConstraints( return original_ICorJitInfo->satisfiesMethodConstraints(parent, method); } -bool interceptor_ICJI::isCompatibleDelegate( - CORINFO_CLASS_HANDLE objCls, - CORINFO_CLASS_HANDLE methodParentCls, - CORINFO_METHOD_HANDLE method, - CORINFO_CLASS_HANDLE delegateCls, - bool* pfIsOpenDelegate) -{ - mcs->AddCall("isCompatibleDelegate"); - return original_ICorJitInfo->isCompatibleDelegate(objCls, methodParentCls, method, delegateCls, pfIsOpenDelegate); -} - void interceptor_ICJI::methodMustBeLoadedBeforeCodeIsRun( CORINFO_METHOD_HANDLE method) { diff --git a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp index 7dd611b5283dc4..fdf48da58fcad7 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp @@ -177,16 +177,6 @@ bool interceptor_ICJI::satisfiesMethodConstraints( return original_ICorJitInfo->satisfiesMethodConstraints(parent, method); } -bool interceptor_ICJI::isCompatibleDelegate( - CORINFO_CLASS_HANDLE objCls, - CORINFO_CLASS_HANDLE methodParentCls, - CORINFO_METHOD_HANDLE method, - CORINFO_CLASS_HANDLE delegateCls, - bool* pfIsOpenDelegate) -{ - return original_ICorJitInfo->isCompatibleDelegate(objCls, methodParentCls, method, delegateCls, pfIsOpenDelegate); -} - void interceptor_ICJI::methodMustBeLoadedBeforeCodeIsRun( CORINFO_METHOD_HANDLE method) { diff --git a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp index 16d52438b6c405..6894bf92ed564c 100644 --- a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp @@ -252,20 +252,6 @@ bool MyICJI::satisfiesMethodConstraints(CORINFO_CLASS_HANDLE parent, // the exa return jitInstance->mc->repSatisfiesMethodConstraints(parent, method); } -// Given a delegate target class, a target method parent class, a target method, -// a delegate class, check if the method signature is compatible with the Invoke method of the delegate -// (under the typical instantiation of any free type variables in the memberref signatures). -bool MyICJI::isCompatibleDelegate(CORINFO_CLASS_HANDLE objCls, /* type of the delegate target, if any */ - CORINFO_CLASS_HANDLE methodParentCls, /* exact parent of the target method, if any */ - CORINFO_METHOD_HANDLE method, /* (representative) target method, if any */ - CORINFO_CLASS_HANDLE delegateCls, /* exact type of the delegate */ - bool* pfIsOpenDelegate /* is the delegate open */ - ) -{ - jitInstance->mc->cr->AddCall("isCompatibleDelegate"); - return jitInstance->mc->repIsCompatibleDelegate(objCls, methodParentCls, method, delegateCls, pfIsOpenDelegate); -} - // load and restore the method void MyICJI::methodMustBeLoadedBeforeCodeIsRun(CORINFO_METHOD_HANDLE method) { diff --git a/src/coreclr/vm/comdelegate.cpp b/src/coreclr/vm/comdelegate.cpp index 32b5af3d0238f7..a98268aa8f453c 100644 --- a/src/coreclr/vm/comdelegate.cpp +++ b/src/coreclr/vm/comdelegate.cpp @@ -3020,68 +3020,6 @@ MethodDesc* COMDelegate::GetDelegateCtor(TypeHandle delegateType, MethodDesc *pT } -/*@GENERICSVER: new (works for generics too) - Does a static validation of parameters passed into a delegate constructor. - - - For "new Delegate(obj.method)" where method is statically typed as "C::m" and - the static type of obj is D (some subclass of C)... - - Params: - instHnd : Static type of the instance, from which pFtn is obtained. Ignored if pFtn - is static (i.e. D) - ftnParentHnd: Parent of the MethodDesc, pFtn, used to create the delegate (i.e. type C) - pFtn : (possibly shared) MethodDesc of the function pointer used to create the delegate (i.e. C::m) - pDlgt : The delegate type (i.e. Delegate) - module: The module scoping methodMemberRef and delegateConstructorMemberRef - methodMemberRef: the MemberRef, MemberDef or MemberSpec of the target method (i.e. a mdToken for C::m) - delegateConstructorMemberRef: the MemberRef, MemberDef or MemberSpec of the delegate constructor (i.e. a mdToken for Delegate::.ctor) - - Validates the following conditions: - 1. If the function (pFtn) is not static, pInst should be equal to the type where - pFtn is defined or pInst should be a parent of pFtn's type. - 2. The signature of the function should be compatible with the signature - of the Invoke method of the delegate type. - The signature is retrieved from module, methodMemberRef and delegateConstructorMemberRef - - NB: Although some of these arguments are redundant, we pass them in to avoid looking up - information that should already be available. - Instead of comparing type handles modulo some context, the method directly compares metadata to avoid - loading classes referenced in the method signatures (hence the need for the module and member refs). - Also, because this method works directly on metadata, without allowing any additional instantiation of the - free type variables in the signature of the method or delegate constructor, this code - will *only* verify a constructor application at the typical (ie. formal) instantiation. -*/ -/* static */ -bool COMDelegate::ValidateCtor(TypeHandle instHnd, - TypeHandle ftnParentHnd, - MethodDesc *pFtn, - TypeHandle dlgtHnd, - bool *pfIsOpenDelegate) - -{ - CONTRACTL - { - THROWS; - GC_TRIGGERS; - MODE_ANY; - - PRECONDITION(CheckPointer(pFtn)); - PRECONDITION(!dlgtHnd.IsNull()); - PRECONDITION(!ftnParentHnd.IsNull()); - - INJECT_FAULT(COMPlusThrowOM()); // from MetaSig::CompareElementType - } - CONTRACTL_END; - - DelegateEEClass *pdlgEEClass = (DelegateEEClass*)dlgtHnd.AsMethodTable()->GetClass(); - PREFIX_ASSUME(pdlgEEClass != NULL); - MethodDesc *pDlgtInvoke = pdlgEEClass->GetInvokeMethod(); - if (pDlgtInvoke == NULL) - return false; - return IsMethodDescCompatible(instHnd, ftnParentHnd, pFtn, dlgtHnd, pDlgtInvoke, DBF_RelaxedSignature, pfIsOpenDelegate); -} - BOOL COMDelegate::IsWrapperDelegate(DELEGATEREF dRef) { CONTRACTL diff --git a/src/coreclr/vm/comdelegate.h b/src/coreclr/vm/comdelegate.h index 0b280afc914ba3..4f693ccae82748 100644 --- a/src/coreclr/vm/comdelegate.h +++ b/src/coreclr/vm/comdelegate.h @@ -132,9 +132,6 @@ class COMDelegate int flags, bool *pfIsOpenDelegate); static MethodDesc* GetDelegateCtor(TypeHandle delegateType, MethodDesc *pTargetMethod, DelegateCtorArgs *pCtorData); - //@GENERICSVER: new (suitable for generics) - // Method to do static validation of delegate .ctor - static bool ValidateCtor(TypeHandle objHnd, TypeHandle ftnParentHnd, MethodDesc *pFtn, TypeHandle dlgtHnd, bool *pfIsOpenDelegate); private: static void BindToMethod(DELEGATEREF *pRefThis, diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index 71badca705f7e1..0868885a71c46a 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -10127,56 +10127,6 @@ bool CEEInfo::satisfiesMethodConstraints( } - -/*********************************************************************/ -// Given a delegate target class, a target method parent class, a target method, -// a delegate class, check if the method signature is compatible with the Invoke method of the delegate -// (under the typical instantiation of any free type variables in the memberref signatures). -// -// objCls should be NULL if the target object is NULL -//@GENERICSVER: new (suitable for generics) -bool CEEInfo::isCompatibleDelegate( - CORINFO_CLASS_HANDLE objCls, - CORINFO_CLASS_HANDLE methodParentCls, - CORINFO_METHOD_HANDLE method, - CORINFO_CLASS_HANDLE delegateCls, - bool* pfIsOpenDelegate) -{ - CONTRACTL { - THROWS; - GC_TRIGGERS; - MODE_PREEMPTIVE; - } CONTRACTL_END; - - bool result = false; - - JIT_TO_EE_TRANSITION(); - - _ASSERTE(method != NULL); - _ASSERTE(delegateCls != NULL); - - TypeHandle delegateClsHnd = (TypeHandle) delegateCls; - - _ASSERTE(delegateClsHnd.GetMethodTable()->IsDelegate()); - - TypeHandle methodParentHnd = (TypeHandle) (methodParentCls); - MethodDesc* pMDFtn = GetMethod(method); - TypeHandle objClsHnd(objCls); - - EX_TRY - { - result = COMDelegate::ValidateCtor(objClsHnd, methodParentHnd, pMDFtn, delegateClsHnd, pfIsOpenDelegate); - } - EX_CATCH - { - } - EX_END_CATCH(SwallowAllExceptions) - - EE_TO_JIT_TRANSITION(); - - return result; -} - /*********************************************************************/ // return address of fixup area for late-bound N/Direct calls. void CEEInfo::getAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, From 7159062f867f21a92d2566e382ee27acc7084fa3 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Thu, 15 Jun 2023 16:06:51 -0700 Subject: [PATCH 04/16] Remove mergeClasses --- src/coreclr/inc/corinfo.h | 6 - src/coreclr/inc/icorjitinfoimpl_generated.h | 4 - src/coreclr/jit/ICorJitInfo_names_generated.h | 1 - .../jit/ICorJitInfo_wrapper_generated.hpp | 10 - src/coreclr/jit/gentree.cpp | 4 +- .../tools/Common/JitInterface/CorInfoImpl.cs | 52 ----- .../JitInterface/CorInfoImpl_generated.cs | 210 ++++++++---------- .../ThunkGenerator/ThunkInput.txt | 1 - .../aot/jitinterface/jitinterface_generated.h | 11 - .../tools/superpmi/superpmi-shared/lwmlist.h | 1 - .../superpmi-shared/methodcontext.cpp | 31 --- .../superpmi/superpmi-shared/methodcontext.h | 6 +- .../superpmi-shim-collector/icorjitinfo.cpp | 9 - .../icorjitinfo_generated.cpp | 8 - .../icorjitinfo_generated.cpp | 7 - .../tools/superpmi/superpmi/icorjitinfo.cpp | 7 - src/coreclr/vm/jitinterface.cpp | 68 ------ 17 files changed, 99 insertions(+), 337 deletions(-) diff --git a/src/coreclr/inc/corinfo.h b/src/coreclr/inc/corinfo.h index 2c8c341cf7b79b..9d334039c31ae3 100644 --- a/src/coreclr/inc/corinfo.h +++ b/src/coreclr/inc/corinfo.h @@ -2610,12 +2610,6 @@ class ICorStaticInfo CORINFO_CLASS_HANDLE cls2 ) = 0; - // Returns the intersection of cls1 and cls2. - virtual CORINFO_CLASS_HANDLE mergeClasses( - CORINFO_CLASS_HANDLE cls1, - CORINFO_CLASS_HANDLE cls2 - ) = 0; - // Returns true if cls2 is known to be a more specific type // than cls1 (a subtype or more restrictive shared type) // for purposes of jit type tracking. This is a hint to the diff --git a/src/coreclr/inc/icorjitinfoimpl_generated.h b/src/coreclr/inc/icorjitinfoimpl_generated.h index bbbefb165338fd..2dd0b19b651407 100644 --- a/src/coreclr/inc/icorjitinfoimpl_generated.h +++ b/src/coreclr/inc/icorjitinfoimpl_generated.h @@ -340,10 +340,6 @@ TypeCompareState compareTypesForEquality( CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) override; -CORINFO_CLASS_HANDLE mergeClasses( - CORINFO_CLASS_HANDLE cls1, - CORINFO_CLASS_HANDLE cls2) override; - bool isMoreSpecificType( CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) override; diff --git a/src/coreclr/jit/ICorJitInfo_names_generated.h b/src/coreclr/jit/ICorJitInfo_names_generated.h index 0ddf2537a9002d..290e122f6a144f 100644 --- a/src/coreclr/jit/ICorJitInfo_names_generated.h +++ b/src/coreclr/jit/ICorJitInfo_names_generated.h @@ -85,7 +85,6 @@ DEF_CLR_API(getTypeForPrimitiveNumericClass) DEF_CLR_API(canCast) DEF_CLR_API(compareTypesForCast) DEF_CLR_API(compareTypesForEquality) -DEF_CLR_API(mergeClasses) DEF_CLR_API(isMoreSpecificType) DEF_CLR_API(isEnum) DEF_CLR_API(getParentType) diff --git a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp index bec5cae85b7dc8..061714a83e2743 100644 --- a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp +++ b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp @@ -800,16 +800,6 @@ TypeCompareState WrapICorJitInfo::compareTypesForEquality( return temp; } -CORINFO_CLASS_HANDLE WrapICorJitInfo::mergeClasses( - CORINFO_CLASS_HANDLE cls1, - CORINFO_CLASS_HANDLE cls2) -{ - API_ENTER(mergeClasses); - CORINFO_CLASS_HANDLE temp = wrapHnd->mergeClasses(cls1, cls2); - API_LEAVE(mergeClasses); - return temp; -} - bool WrapICorJitInfo::isMoreSpecificType( CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) diff --git a/src/coreclr/jit/gentree.cpp b/src/coreclr/jit/gentree.cpp index ea50cb24b231bf..6f022d5e8bbb98 100644 --- a/src/coreclr/jit/gentree.cpp +++ b/src/coreclr/jit/gentree.cpp @@ -18194,9 +18194,7 @@ CORINFO_CLASS_HANDLE Compiler::gtGetHelperCallClassHandle(GenTreeCall* call, boo // for the result, unless it is an interface type. // // TODO-CQ: when we have default interface methods then - // this might not be the best assumption. We could also - // explore calling something like mergeClasses to identify - // the more specific class. A similar issue arises when + // this might not be the best assumption. A similar issue arises when // typing the temp in impCastClassOrIsInstToTree, when we // expand the cast inline. if (castHnd != nullptr) diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs index 4429981d86151b..4389476a4c86a3 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs @@ -2673,58 +2673,6 @@ private TypeCompareState compareTypesForEquality(CORINFO_CLASS_STRUCT_* cls1, CO }; } - private CORINFO_CLASS_STRUCT_* mergeClasses(CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2) - { - TypeDesc type1 = HandleToObject(cls1); - TypeDesc type2 = HandleToObject(cls2); - - TypeDesc merged = TypeExtensions.MergeTypesToCommonParent(type1, type2); - -#if DEBUG - // Make sure the merge is reflexive in the cases we "support". - TypeDesc reflexive = TypeExtensions.MergeTypesToCommonParent(type2, type1); - - // If both sides are classes than either they have a common non-interface parent (in which case it is - // reflexive) - // OR they share a common interface, and it can be order dependent (if they share multiple interfaces - // in common) - if (!type1.IsInterface && !type2.IsInterface) - { - if (merged.IsInterface) - { - Debug.Assert(reflexive.IsInterface); - } - else - { - Debug.Assert(merged == reflexive); - } - } - // Both results must either be interfaces or classes. They cannot be mixed. - Debug.Assert(merged.IsInterface == reflexive.IsInterface); - - // If the result of the merge was a class, then the result of the reflexive merge was the same class. - if (!merged.IsInterface) - { - Debug.Assert(merged == reflexive); - } - - // If both sides are arrays, then the result is either an array or g_pArrayClass. The above is - // actually true for reference types as well, but it is a little excessive to deal with. - if (type1.IsArray && type2.IsArray) - { - TypeDesc arrayClass = _compilation.TypeSystemContext.GetWellKnownType(WellKnownType.Array); - Debug.Assert((merged.IsArray && reflexive.IsArray) - || ((merged == arrayClass) && (reflexive == arrayClass))); - } - - // The results must always be assignable - Debug.Assert(type1.CanCastTo(merged) && type2.CanCastTo(merged) && type1.CanCastTo(reflexive) - && type2.CanCastTo(reflexive)); -#endif - - return ObjectToHandle(merged); - } - private bool isMoreSpecificType(CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2) { TypeDesc type1 = HandleToObject(cls1); diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs index eb19af6574c9f7..0a1e2b6254a7c6 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs @@ -1210,21 +1210,6 @@ private static TypeCompareState _compareTypesForEquality(IntPtr thisHandle, IntP } } - [UnmanagedCallersOnly] - private static CORINFO_CLASS_STRUCT_* _mergeClasses(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2) - { - var _this = GetThis(thisHandle); - try - { - return _this.mergeClasses(cls1, cls2); - } - catch (Exception ex) - { - *ppException = _this.AllocException(ex); - return default; - } - } - [UnmanagedCallersOnly] private static byte _isMoreSpecificType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2) { @@ -2642,7 +2627,7 @@ private static uint _getJitFlags(IntPtr thisHandle, IntPtr* ppException, CORJIT_ private static IntPtr GetUnmanagedCallbacks() { - void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 178); + void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 177); callbacks[0] = (delegate* unmanaged)&_isIntrinsic; callbacks[1] = (delegate* unmanaged)&_getMethodAttribs; @@ -2725,103 +2710,102 @@ private static IntPtr GetUnmanagedCallbacks() callbacks[78] = (delegate* unmanaged)&_canCast; callbacks[79] = (delegate* unmanaged)&_compareTypesForCast; callbacks[80] = (delegate* unmanaged)&_compareTypesForEquality; - callbacks[81] = (delegate* unmanaged)&_mergeClasses; - callbacks[82] = (delegate* unmanaged)&_isMoreSpecificType; - callbacks[83] = (delegate* unmanaged)&_isEnum; - callbacks[84] = (delegate* unmanaged)&_getParentType; - callbacks[85] = (delegate* unmanaged)&_getChildType; - callbacks[86] = (delegate* unmanaged)&_satisfiesClassConstraints; - callbacks[87] = (delegate* unmanaged)&_isSDArray; - callbacks[88] = (delegate* unmanaged)&_getArrayRank; - callbacks[89] = (delegate* unmanaged)&_getArrayIntrinsicID; - callbacks[90] = (delegate* unmanaged)&_getArrayInitializationData; - callbacks[91] = (delegate* unmanaged)&_canAccessClass; - callbacks[92] = (delegate* unmanaged)&_printFieldName; - callbacks[93] = (delegate* unmanaged)&_getFieldClass; - callbacks[94] = (delegate* unmanaged)&_getFieldType; - callbacks[95] = (delegate* unmanaged)&_getFieldOffset; - callbacks[96] = (delegate* unmanaged)&_getFieldInfo; - callbacks[97] = (delegate* unmanaged)&_getThreadLocalFieldInfo; - callbacks[98] = (delegate* unmanaged)&_getThreadLocalStaticBlocksInfo; - callbacks[99] = (delegate* unmanaged)&_isFieldStatic; - callbacks[100] = (delegate* unmanaged)&_getArrayOrStringLength; - callbacks[101] = (delegate* unmanaged)&_getBoundaries; - callbacks[102] = (delegate* unmanaged)&_setBoundaries; - callbacks[103] = (delegate* unmanaged)&_getVars; - callbacks[104] = (delegate* unmanaged)&_setVars; - callbacks[105] = (delegate* unmanaged)&_reportRichMappings; - callbacks[106] = (delegate* unmanaged)&_allocateArray; - callbacks[107] = (delegate* unmanaged)&_freeArray; - callbacks[108] = (delegate* unmanaged)&_getArgNext; - callbacks[109] = (delegate* unmanaged)&_getArgType; - callbacks[110] = (delegate* unmanaged)&_getExactClasses; - callbacks[111] = (delegate* unmanaged)&_getArgClass; - callbacks[112] = (delegate* unmanaged)&_getHFAType; - callbacks[113] = (delegate* unmanaged)&_runWithErrorTrap; - callbacks[114] = (delegate* unmanaged)&_runWithSPMIErrorTrap; - callbacks[115] = (delegate* unmanaged)&_getEEInfo; - callbacks[116] = (delegate* unmanaged)&_getJitTimeLogFilename; - callbacks[117] = (delegate* unmanaged)&_getMethodDefFromMethod; - callbacks[118] = (delegate* unmanaged)&_printMethodName; - callbacks[119] = (delegate* unmanaged)&_getMethodNameFromMetadata; - callbacks[120] = (delegate* unmanaged)&_getMethodHash; - callbacks[121] = (delegate* unmanaged)&_findNameOfToken; - callbacks[122] = (delegate* unmanaged)&_getSystemVAmd64PassStructInRegisterDescriptor; - callbacks[123] = (delegate* unmanaged)&_getLoongArch64PassStructInRegisterFlags; - callbacks[124] = (delegate* unmanaged)&_getRISCV64PassStructInRegisterFlags; - callbacks[125] = (delegate* unmanaged)&_getThreadTLSIndex; - callbacks[126] = (delegate* unmanaged)&_getInlinedCallFrameVptr; - callbacks[127] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; - callbacks[128] = (delegate* unmanaged)&_getHelperFtn; - callbacks[129] = (delegate* unmanaged)&_getFunctionEntryPoint; - callbacks[130] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; - callbacks[131] = (delegate* unmanaged)&_getMethodSync; - callbacks[132] = (delegate* unmanaged)&_getLazyStringLiteralHelper; - callbacks[133] = (delegate* unmanaged)&_embedModuleHandle; - callbacks[134] = (delegate* unmanaged)&_embedClassHandle; - callbacks[135] = (delegate* unmanaged)&_embedMethodHandle; - callbacks[136] = (delegate* unmanaged)&_embedFieldHandle; - callbacks[137] = (delegate* unmanaged)&_embedGenericHandle; - callbacks[138] = (delegate* unmanaged)&_getLocationOfThisType; - callbacks[139] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; - callbacks[140] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; - callbacks[141] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; - callbacks[142] = (delegate* unmanaged)&_getJustMyCodeHandle; - callbacks[143] = (delegate* unmanaged)&_GetProfilingHandle; - callbacks[144] = (delegate* unmanaged)&_getCallInfo; - callbacks[145] = (delegate* unmanaged)&_canAccessFamily; - callbacks[146] = (delegate* unmanaged)&_isRIDClassDomainID; - callbacks[147] = (delegate* unmanaged)&_getClassDomainID; - callbacks[148] = (delegate* unmanaged)&_getStaticFieldContent; - callbacks[149] = (delegate* unmanaged)&_getObjectContent; - callbacks[150] = (delegate* unmanaged)&_getStaticFieldCurrentClass; - callbacks[151] = (delegate* unmanaged)&_getVarArgsHandle; - callbacks[152] = (delegate* unmanaged)&_canGetVarArgsHandle; - callbacks[153] = (delegate* unmanaged)&_constructStringLiteral; - callbacks[154] = (delegate* unmanaged)&_emptyStringLiteral; - callbacks[155] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; - callbacks[156] = (delegate* unmanaged)&_GetDelegateCtor; - callbacks[157] = (delegate* unmanaged)&_MethodCompileComplete; - callbacks[158] = (delegate* unmanaged)&_getTailCallHelpers; - callbacks[159] = (delegate* unmanaged)&_convertPInvokeCalliToCall; - callbacks[160] = (delegate* unmanaged)&_notifyInstructionSetUsage; - callbacks[161] = (delegate* unmanaged)&_updateEntryPointForTailCall; - callbacks[162] = (delegate* unmanaged)&_allocMem; - callbacks[163] = (delegate* unmanaged)&_reserveUnwindInfo; - callbacks[164] = (delegate* unmanaged)&_allocUnwindInfo; - callbacks[165] = (delegate* unmanaged)&_allocGCInfo; - callbacks[166] = (delegate* unmanaged)&_setEHcount; - callbacks[167] = (delegate* unmanaged)&_setEHinfo; - callbacks[168] = (delegate* unmanaged)&_logMsg; - callbacks[169] = (delegate* unmanaged)&_doAssert; - callbacks[170] = (delegate* unmanaged)&_reportFatalError; - callbacks[171] = (delegate* unmanaged)&_getPgoInstrumentationResults; - callbacks[172] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; - callbacks[173] = (delegate* unmanaged)&_recordCallSite; - callbacks[174] = (delegate* unmanaged)&_recordRelocation; - callbacks[175] = (delegate* unmanaged)&_getRelocTypeHint; - callbacks[176] = (delegate* unmanaged)&_getExpectedTargetArchitecture; - callbacks[177] = (delegate* unmanaged)&_getJitFlags; + callbacks[81] = (delegate* unmanaged)&_isMoreSpecificType; + callbacks[82] = (delegate* unmanaged)&_isEnum; + callbacks[83] = (delegate* unmanaged)&_getParentType; + callbacks[84] = (delegate* unmanaged)&_getChildType; + callbacks[85] = (delegate* unmanaged)&_satisfiesClassConstraints; + callbacks[86] = (delegate* unmanaged)&_isSDArray; + callbacks[87] = (delegate* unmanaged)&_getArrayRank; + callbacks[88] = (delegate* unmanaged)&_getArrayIntrinsicID; + callbacks[89] = (delegate* unmanaged)&_getArrayInitializationData; + callbacks[90] = (delegate* unmanaged)&_canAccessClass; + callbacks[91] = (delegate* unmanaged)&_printFieldName; + callbacks[92] = (delegate* unmanaged)&_getFieldClass; + callbacks[93] = (delegate* unmanaged)&_getFieldType; + callbacks[94] = (delegate* unmanaged)&_getFieldOffset; + callbacks[95] = (delegate* unmanaged)&_getFieldInfo; + callbacks[96] = (delegate* unmanaged)&_getThreadLocalFieldInfo; + callbacks[97] = (delegate* unmanaged)&_getThreadLocalStaticBlocksInfo; + callbacks[98] = (delegate* unmanaged)&_isFieldStatic; + callbacks[99] = (delegate* unmanaged)&_getArrayOrStringLength; + callbacks[100] = (delegate* unmanaged)&_getBoundaries; + callbacks[101] = (delegate* unmanaged)&_setBoundaries; + callbacks[102] = (delegate* unmanaged)&_getVars; + callbacks[103] = (delegate* unmanaged)&_setVars; + callbacks[104] = (delegate* unmanaged)&_reportRichMappings; + callbacks[105] = (delegate* unmanaged)&_allocateArray; + callbacks[106] = (delegate* unmanaged)&_freeArray; + callbacks[107] = (delegate* unmanaged)&_getArgNext; + callbacks[108] = (delegate* unmanaged)&_getArgType; + callbacks[109] = (delegate* unmanaged)&_getExactClasses; + callbacks[110] = (delegate* unmanaged)&_getArgClass; + callbacks[111] = (delegate* unmanaged)&_getHFAType; + callbacks[112] = (delegate* unmanaged)&_runWithErrorTrap; + callbacks[113] = (delegate* unmanaged)&_runWithSPMIErrorTrap; + callbacks[114] = (delegate* unmanaged)&_getEEInfo; + callbacks[115] = (delegate* unmanaged)&_getJitTimeLogFilename; + callbacks[116] = (delegate* unmanaged)&_getMethodDefFromMethod; + callbacks[117] = (delegate* unmanaged)&_printMethodName; + callbacks[118] = (delegate* unmanaged)&_getMethodNameFromMetadata; + callbacks[119] = (delegate* unmanaged)&_getMethodHash; + callbacks[120] = (delegate* unmanaged)&_findNameOfToken; + callbacks[121] = (delegate* unmanaged)&_getSystemVAmd64PassStructInRegisterDescriptor; + callbacks[122] = (delegate* unmanaged)&_getLoongArch64PassStructInRegisterFlags; + callbacks[123] = (delegate* unmanaged)&_getRISCV64PassStructInRegisterFlags; + callbacks[124] = (delegate* unmanaged)&_getThreadTLSIndex; + callbacks[125] = (delegate* unmanaged)&_getInlinedCallFrameVptr; + callbacks[126] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; + callbacks[127] = (delegate* unmanaged)&_getHelperFtn; + callbacks[128] = (delegate* unmanaged)&_getFunctionEntryPoint; + callbacks[129] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; + callbacks[130] = (delegate* unmanaged)&_getMethodSync; + callbacks[131] = (delegate* unmanaged)&_getLazyStringLiteralHelper; + callbacks[132] = (delegate* unmanaged)&_embedModuleHandle; + callbacks[133] = (delegate* unmanaged)&_embedClassHandle; + callbacks[134] = (delegate* unmanaged)&_embedMethodHandle; + callbacks[135] = (delegate* unmanaged)&_embedFieldHandle; + callbacks[136] = (delegate* unmanaged)&_embedGenericHandle; + callbacks[137] = (delegate* unmanaged)&_getLocationOfThisType; + callbacks[138] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; + callbacks[139] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; + callbacks[140] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; + callbacks[141] = (delegate* unmanaged)&_getJustMyCodeHandle; + callbacks[142] = (delegate* unmanaged)&_GetProfilingHandle; + callbacks[143] = (delegate* unmanaged)&_getCallInfo; + callbacks[144] = (delegate* unmanaged)&_canAccessFamily; + callbacks[145] = (delegate* unmanaged)&_isRIDClassDomainID; + callbacks[146] = (delegate* unmanaged)&_getClassDomainID; + callbacks[147] = (delegate* unmanaged)&_getStaticFieldContent; + callbacks[148] = (delegate* unmanaged)&_getObjectContent; + callbacks[149] = (delegate* unmanaged)&_getStaticFieldCurrentClass; + callbacks[150] = (delegate* unmanaged)&_getVarArgsHandle; + callbacks[151] = (delegate* unmanaged)&_canGetVarArgsHandle; + callbacks[152] = (delegate* unmanaged)&_constructStringLiteral; + callbacks[153] = (delegate* unmanaged)&_emptyStringLiteral; + callbacks[154] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; + callbacks[155] = (delegate* unmanaged)&_GetDelegateCtor; + callbacks[156] = (delegate* unmanaged)&_MethodCompileComplete; + callbacks[157] = (delegate* unmanaged)&_getTailCallHelpers; + callbacks[158] = (delegate* unmanaged)&_convertPInvokeCalliToCall; + callbacks[159] = (delegate* unmanaged)&_notifyInstructionSetUsage; + callbacks[160] = (delegate* unmanaged)&_updateEntryPointForTailCall; + callbacks[161] = (delegate* unmanaged)&_allocMem; + callbacks[162] = (delegate* unmanaged)&_reserveUnwindInfo; + callbacks[163] = (delegate* unmanaged)&_allocUnwindInfo; + callbacks[164] = (delegate* unmanaged)&_allocGCInfo; + callbacks[165] = (delegate* unmanaged)&_setEHcount; + callbacks[166] = (delegate* unmanaged)&_setEHinfo; + callbacks[167] = (delegate* unmanaged)&_logMsg; + callbacks[168] = (delegate* unmanaged)&_doAssert; + callbacks[169] = (delegate* unmanaged)&_reportFatalError; + callbacks[170] = (delegate* unmanaged)&_getPgoInstrumentationResults; + callbacks[171] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; + callbacks[172] = (delegate* unmanaged)&_recordCallSite; + callbacks[173] = (delegate* unmanaged)&_recordRelocation; + callbacks[174] = (delegate* unmanaged)&_getRelocTypeHint; + callbacks[175] = (delegate* unmanaged)&_getExpectedTargetArchitecture; + callbacks[176] = (delegate* unmanaged)&_getJitFlags; return (IntPtr)callbacks; } diff --git a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt index e4acd24d26213a..80611f129761e6 100644 --- a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt +++ b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt @@ -240,7 +240,6 @@ FUNCTIONS bool canCast(CORINFO_CLASS_HANDLE child, CORINFO_CLASS_HANDLE parent) TypeCompareState compareTypesForCast(CORINFO_CLASS_HANDLE fromClass, CORINFO_CLASS_HANDLE toClass) TypeCompareState compareTypesForEquality(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) - CORINFO_CLASS_HANDLE mergeClasses(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) bool isMoreSpecificType(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) TypeCompareState isEnum(CORINFO_CLASS_HANDLE cls, CORINFO_CLASS_HANDLE* underlyingType) CORINFO_CLASS_HANDLE getParentType(CORINFO_CLASS_HANDLE cls) diff --git a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h index 11bb9e9a5236c5..b4a87770f41a39 100644 --- a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h +++ b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h @@ -92,7 +92,6 @@ struct JitInterfaceCallbacks bool (* canCast)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE child, CORINFO_CLASS_HANDLE parent); TypeCompareState (* compareTypesForCast)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE fromClass, CORINFO_CLASS_HANDLE toClass); TypeCompareState (* compareTypesForEquality)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2); - CORINFO_CLASS_HANDLE (* mergeClasses)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2); bool (* isMoreSpecificType)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2); TypeCompareState (* isEnum)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE cls, CORINFO_CLASS_HANDLE* underlyingType); CORINFO_CLASS_HANDLE (* getParentType)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE cls); @@ -992,16 +991,6 @@ class JitInterfaceWrapper : public ICorJitInfo return temp; } - virtual CORINFO_CLASS_HANDLE mergeClasses( - CORINFO_CLASS_HANDLE cls1, - CORINFO_CLASS_HANDLE cls2) -{ - CorInfoExceptionClass* pException = nullptr; - CORINFO_CLASS_HANDLE temp = _callbacks->mergeClasses(_thisHandle, &pException, cls1, cls2); - if (pException != nullptr) throw pException; - return temp; -} - virtual bool isMoreSpecificType( CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h index 69f09073b47528..1221439f7abbe4 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h @@ -158,7 +158,6 @@ LWM(PrintFieldName, DWORDLONG, Agnostic_PrintResult) LWM(PrintMethodName, DWORDLONG, Agnostic_PrintResult) LWM(IsValidToken, DLD, DWORD) LWM(IsValueClass, DWORDLONG, DWORD) -LWM(MergeClasses, DLDL, DWORDLONG) LWM(IsMoreSpecificType, DLDL, DWORD) LWM(IsEnum, DWORDLONG, DLD) LWM(PInvokeMarshalingRequired, MethodOrSigInfoValue, DWORD) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp index 5afe7208ef5bec..5ab02df51b41af 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp @@ -5811,37 +5811,6 @@ HRESULT MethodContext::repGetPgoInstrumentationResults(CORINFO_METHOD_HANDLE ftn return result; } -void MethodContext::recMergeClasses(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2, CORINFO_CLASS_HANDLE result) -{ - if (MergeClasses == nullptr) - MergeClasses = new LightWeightMap(); - - DLDL key; - ZeroMemory(&key, sizeof(key)); // Zero key including any struct padding - key.A = CastHandle(cls1); - key.B = CastHandle(cls2); - - DWORDLONG value = CastHandle(result); - MergeClasses->Add(key, value); - DEBUG_REC(dmpMergeClasses(key, value)); -} -void MethodContext::dmpMergeClasses(DLDL key, DWORDLONG value) -{ - printf("MergeClasses NYI"); -} -CORINFO_CLASS_HANDLE MethodContext::repMergeClasses(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) -{ - DLDL key; - ZeroMemory(&key, sizeof(key)); // Zero key including any struct padding - key.A = CastHandle(cls1); - key.B = CastHandle(cls2); - - DWORDLONG value = LookupByKeyOrMiss(MergeClasses, key, ": key %016" PRIX64 " %016" PRIX64 "", key.A, key.B); - - DEBUG_REP(dmpMergeClasses(key, value)); - return (CORINFO_CLASS_HANDLE)value; -} - void MethodContext::recIsMoreSpecificType(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2, bool result) { if (IsMoreSpecificType == nullptr) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h index 081a637fcf2133..b8d6c1e031f65d 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h @@ -714,10 +714,6 @@ class MethodContext void dmpGetPgoInstrumentationResults(DWORDLONG key, const Agnostic_GetPgoInstrumentationResults& value); HRESULT repGetPgoInstrumentationResults(CORINFO_METHOD_HANDLE ftnHnd, ICorJitInfo::PgoInstrumentationSchema** pSchema, UINT32* pCountSchemaItems, BYTE** pInstrumentationData, ICorJitInfo::PgoSource* pPgoSource); - void recMergeClasses(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2, CORINFO_CLASS_HANDLE result); - void dmpMergeClasses(DLDL key, DWORDLONG value); - CORINFO_CLASS_HANDLE repMergeClasses(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2); - void recIsMoreSpecificType(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2, bool result); void dmpIsMoreSpecificType(DLDL key, DWORD value); bool repIsMoreSpecificType(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2); @@ -1056,7 +1052,7 @@ enum mcPackets //Retired6 = 104, Packet_IsValueClass = 105, //Packet_IsWriteBarrierHelperRequired = 106, - Packet_MergeClasses = 107, + //Packet_MergeClasses = 107, Packet_PInvokeMarshalingRequired = 108, Packet_ResolveToken = 109, Packet_SatisfiesClassConstraints = 110, diff --git a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp index 7467083c9da3ed..2aa3459f52fc83 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp @@ -900,15 +900,6 @@ TypeCompareState interceptor_ICJI::compareTypesForEquality(CORINFO_CLASS_HANDLE return temp; } -// returns the intersection of cls1 and cls2. -CORINFO_CLASS_HANDLE interceptor_ICJI::mergeClasses(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) -{ - mc->cr->AddCall("mergeClasses"); - CORINFO_CLASS_HANDLE temp = original_ICorJitInfo->mergeClasses(cls1, cls2); - mc->recMergeClasses(cls1, cls2, temp); - return temp; -} - // Returns true if cls2 is known to be a more specific type than cls1. bool interceptor_ICJI::isMoreSpecificType(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) { diff --git a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp index 69716778ca72ee..9fc7daea3fc606 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp @@ -655,14 +655,6 @@ TypeCompareState interceptor_ICJI::compareTypesForEquality( return original_ICorJitInfo->compareTypesForEquality(cls1, cls2); } -CORINFO_CLASS_HANDLE interceptor_ICJI::mergeClasses( - CORINFO_CLASS_HANDLE cls1, - CORINFO_CLASS_HANDLE cls2) -{ - mcs->AddCall("mergeClasses"); - return original_ICorJitInfo->mergeClasses(cls1, cls2); -} - bool interceptor_ICJI::isMoreSpecificType( CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) diff --git a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp index fdf48da58fcad7..f3d9d062520b81 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp @@ -574,13 +574,6 @@ TypeCompareState interceptor_ICJI::compareTypesForEquality( return original_ICorJitInfo->compareTypesForEquality(cls1, cls2); } -CORINFO_CLASS_HANDLE interceptor_ICJI::mergeClasses( - CORINFO_CLASS_HANDLE cls1, - CORINFO_CLASS_HANDLE cls2) -{ - return original_ICorJitInfo->mergeClasses(cls1, cls2); -} - bool interceptor_ICJI::isMoreSpecificType( CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) diff --git a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp index 6894bf92ed564c..cb82cd902b7286 100644 --- a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp @@ -761,13 +761,6 @@ TypeCompareState MyICJI::compareTypesForEquality(CORINFO_CLASS_HANDLE cls1, CORI return jitInstance->mc->repCompareTypesForEquality(cls1, cls2); } -// returns the intersection of cls1 and cls2. -CORINFO_CLASS_HANDLE MyICJI::mergeClasses(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) -{ - jitInstance->mc->cr->AddCall("mergeClasses"); - return jitInstance->mc->repMergeClasses(cls1, cls2); -} - // Returns true if cls2 is known to be a more specific type than cls1 bool MyICJI::isMoreSpecificType(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) { diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index 0868885a71c46a..169fee55848c57 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -4464,74 +4464,6 @@ TypeCompareState CEEInfo::compareTypesForEquality( return result; } -/*********************************************************************/ -// returns the intersection of cls1 and cls2. -CORINFO_CLASS_HANDLE CEEInfo::mergeClasses( - CORINFO_CLASS_HANDLE cls1, - CORINFO_CLASS_HANDLE cls2) -{ - CONTRACTL { - THROWS; - GC_TRIGGERS; - MODE_PREEMPTIVE; - } CONTRACTL_END; - - CORINFO_CLASS_HANDLE result = NULL; - - JIT_TO_EE_TRANSITION(); - - TypeHandle merged = TypeHandle::MergeTypeHandlesToCommonParent(TypeHandle(cls1), TypeHandle(cls2)); -#ifdef _DEBUG - { - //Make sure the merge is reflexive in the cases we "support". - TypeHandle hnd1 = TypeHandle(cls1); - TypeHandle hnd2 = TypeHandle(cls2); - TypeHandle reflexive = TypeHandle::MergeTypeHandlesToCommonParent(hnd2, hnd1); - - //If both sides are classes than either they have a common non-interface parent (in which case it is - //reflexive) - //OR they share a common interface, and it can be order dependent (if they share multiple interfaces - //in common) - if (!hnd1.IsInterface() && !hnd2.IsInterface()) - { - if (merged.IsInterface()) - { - _ASSERTE(reflexive.IsInterface()); - } - else - { - _ASSERTE(merged == reflexive); - } - } - //Both results must either be interfaces or classes. They cannot be mixed. - _ASSERTE((!!merged.IsInterface()) == (!!reflexive.IsInterface())); - - //If the result of the merge was a class, then the result of the reflexive merge was the same class. - if (!merged.IsInterface()) - { - _ASSERTE(merged == reflexive); - } - - // If both sides are arrays, then the result is either an array or g_pArrayClass. The above is - // actually true for reference types as well, but it is a little excessive to deal with. - if (hnd1.IsArray() && hnd2.IsArray()) - { - _ASSERTE((merged.IsArray() && reflexive.IsArray()) - || ((merged == g_pArrayClass) && (reflexive == g_pArrayClass))); - } - - //Can I assert anything about generic variables? - - //The results must always be assignable - _ASSERTE(hnd1.CanCastTo(merged) && hnd2.CanCastTo(merged) && hnd1.CanCastTo(reflexive) - && hnd2.CanCastTo(reflexive)); - } -#endif - result = CORINFO_CLASS_HANDLE(merged.AsPtr()); - - EE_TO_JIT_TRANSITION(); - return result; -} /*********************************************************************/ static BOOL isMoreSpecificTypeHelper( From 74d66b3f93a3ded0d7096ff5cb47b5ca613b2f97 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Thu, 15 Jun 2023 16:14:27 -0700 Subject: [PATCH 05/16] Remove satisfiesClassConstraints --- src/coreclr/inc/corinfo.h | 6 - src/coreclr/inc/icorjitinfoimpl_generated.h | 3 - src/coreclr/jit/ICorJitInfo_names_generated.h | 1 - .../jit/ICorJitInfo_wrapper_generated.hpp | 9 - .../tools/Common/JitInterface/CorInfoImpl.cs | 3 - .../JitInterface/CorInfoImpl_generated.cs | 200 ++++++++---------- .../ThunkGenerator/ThunkInput.txt | 1 - .../aot/jitinterface/jitinterface_generated.h | 10 - .../tools/superpmi/superpmi-shared/lwmlist.h | 1 - .../superpmi-shared/methodcontext.cpp | 22 -- .../superpmi/superpmi-shared/methodcontext.h | 6 +- .../superpmi-shim-collector/icorjitinfo.cpp | 10 - .../icorjitinfo_generated.cpp | 7 - .../icorjitinfo_generated.cpp | 6 - .../tools/superpmi/superpmi/icorjitinfo.cpp | 8 - src/coreclr/vm/jitinterface.cpp | 22 -- 16 files changed, 93 insertions(+), 222 deletions(-) diff --git a/src/coreclr/inc/corinfo.h b/src/coreclr/inc/corinfo.h index 9d334039c31ae3..f50c8f6ea66b70 100644 --- a/src/coreclr/inc/corinfo.h +++ b/src/coreclr/inc/corinfo.h @@ -2172,7 +2172,6 @@ class ICorStaticInfo ) = 0; // Check constraints on method type arguments (only). - // The parent class should be checked separately using satisfiesClassConstraints(parent). virtual bool satisfiesMethodConstraints( CORINFO_CLASS_HANDLE parent, // the exact parent of the method CORINFO_METHOD_HANDLE method @@ -2646,11 +2645,6 @@ class ICorStaticInfo CORINFO_CLASS_HANDLE *clsRet ) = 0; - // Check constraints on type arguments of this class and parent classes - virtual bool satisfiesClassConstraints( - CORINFO_CLASS_HANDLE cls - ) = 0; - // Check if this is a single dimensional array type virtual bool isSDArray( CORINFO_CLASS_HANDLE cls diff --git a/src/coreclr/inc/icorjitinfoimpl_generated.h b/src/coreclr/inc/icorjitinfoimpl_generated.h index 2dd0b19b651407..d3237cc71b1d6f 100644 --- a/src/coreclr/inc/icorjitinfoimpl_generated.h +++ b/src/coreclr/inc/icorjitinfoimpl_generated.h @@ -355,9 +355,6 @@ CorInfoType getChildType( CORINFO_CLASS_HANDLE clsHnd, CORINFO_CLASS_HANDLE* clsRet) override; -bool satisfiesClassConstraints( - CORINFO_CLASS_HANDLE cls) override; - bool isSDArray( CORINFO_CLASS_HANDLE cls) override; diff --git a/src/coreclr/jit/ICorJitInfo_names_generated.h b/src/coreclr/jit/ICorJitInfo_names_generated.h index 290e122f6a144f..7f22091bf8dfd0 100644 --- a/src/coreclr/jit/ICorJitInfo_names_generated.h +++ b/src/coreclr/jit/ICorJitInfo_names_generated.h @@ -89,7 +89,6 @@ DEF_CLR_API(isMoreSpecificType) DEF_CLR_API(isEnum) DEF_CLR_API(getParentType) DEF_CLR_API(getChildType) -DEF_CLR_API(satisfiesClassConstraints) DEF_CLR_API(isSDArray) DEF_CLR_API(getArrayRank) DEF_CLR_API(getArrayIntrinsicID) diff --git a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp index 061714a83e2743..9da2a06ba146de 100644 --- a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp +++ b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp @@ -839,15 +839,6 @@ CorInfoType WrapICorJitInfo::getChildType( return temp; } -bool WrapICorJitInfo::satisfiesClassConstraints( - CORINFO_CLASS_HANDLE cls) -{ - API_ENTER(satisfiesClassConstraints); - bool temp = wrapHnd->satisfiesClassConstraints(cls); - API_LEAVE(satisfiesClassConstraints); - return temp; -} - bool WrapICorJitInfo::isSDArray( CORINFO_CLASS_HANDLE cls) { diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs index 4389476a4c86a3..237233e6a07b60 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs @@ -2748,9 +2748,6 @@ private CorInfoType getChildType(CORINFO_CLASS_STRUCT_* clsHnd, CORINFO_CLASS_ST return result; } - private bool satisfiesClassConstraints(CORINFO_CLASS_STRUCT_* cls) - { throw new NotImplementedException("satisfiesClassConstraints"); } - private bool isSDArray(CORINFO_CLASS_STRUCT_* cls) { var td = HandleToObject(cls); diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs index 0a1e2b6254a7c6..6e2bcadd0687dd 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs @@ -1270,21 +1270,6 @@ private static CorInfoType _getChildType(IntPtr thisHandle, IntPtr* ppException, } } - [UnmanagedCallersOnly] - private static byte _satisfiesClassConstraints(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) - { - var _this = GetThis(thisHandle); - try - { - return _this.satisfiesClassConstraints(cls) ? (byte)1 : (byte)0; - } - catch (Exception ex) - { - *ppException = _this.AllocException(ex); - return default; - } - } - [UnmanagedCallersOnly] private static byte _isSDArray(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { @@ -2627,7 +2612,7 @@ private static uint _getJitFlags(IntPtr thisHandle, IntPtr* ppException, CORJIT_ private static IntPtr GetUnmanagedCallbacks() { - void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 177); + void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 176); callbacks[0] = (delegate* unmanaged)&_isIntrinsic; callbacks[1] = (delegate* unmanaged)&_getMethodAttribs; @@ -2714,98 +2699,97 @@ private static IntPtr GetUnmanagedCallbacks() callbacks[82] = (delegate* unmanaged)&_isEnum; callbacks[83] = (delegate* unmanaged)&_getParentType; callbacks[84] = (delegate* unmanaged)&_getChildType; - callbacks[85] = (delegate* unmanaged)&_satisfiesClassConstraints; - callbacks[86] = (delegate* unmanaged)&_isSDArray; - callbacks[87] = (delegate* unmanaged)&_getArrayRank; - callbacks[88] = (delegate* unmanaged)&_getArrayIntrinsicID; - callbacks[89] = (delegate* unmanaged)&_getArrayInitializationData; - callbacks[90] = (delegate* unmanaged)&_canAccessClass; - callbacks[91] = (delegate* unmanaged)&_printFieldName; - callbacks[92] = (delegate* unmanaged)&_getFieldClass; - callbacks[93] = (delegate* unmanaged)&_getFieldType; - callbacks[94] = (delegate* unmanaged)&_getFieldOffset; - callbacks[95] = (delegate* unmanaged)&_getFieldInfo; - callbacks[96] = (delegate* unmanaged)&_getThreadLocalFieldInfo; - callbacks[97] = (delegate* unmanaged)&_getThreadLocalStaticBlocksInfo; - callbacks[98] = (delegate* unmanaged)&_isFieldStatic; - callbacks[99] = (delegate* unmanaged)&_getArrayOrStringLength; - callbacks[100] = (delegate* unmanaged)&_getBoundaries; - callbacks[101] = (delegate* unmanaged)&_setBoundaries; - callbacks[102] = (delegate* unmanaged)&_getVars; - callbacks[103] = (delegate* unmanaged)&_setVars; - callbacks[104] = (delegate* unmanaged)&_reportRichMappings; - callbacks[105] = (delegate* unmanaged)&_allocateArray; - callbacks[106] = (delegate* unmanaged)&_freeArray; - callbacks[107] = (delegate* unmanaged)&_getArgNext; - callbacks[108] = (delegate* unmanaged)&_getArgType; - callbacks[109] = (delegate* unmanaged)&_getExactClasses; - callbacks[110] = (delegate* unmanaged)&_getArgClass; - callbacks[111] = (delegate* unmanaged)&_getHFAType; - callbacks[112] = (delegate* unmanaged)&_runWithErrorTrap; - callbacks[113] = (delegate* unmanaged)&_runWithSPMIErrorTrap; - callbacks[114] = (delegate* unmanaged)&_getEEInfo; - callbacks[115] = (delegate* unmanaged)&_getJitTimeLogFilename; - callbacks[116] = (delegate* unmanaged)&_getMethodDefFromMethod; - callbacks[117] = (delegate* unmanaged)&_printMethodName; - callbacks[118] = (delegate* unmanaged)&_getMethodNameFromMetadata; - callbacks[119] = (delegate* unmanaged)&_getMethodHash; - callbacks[120] = (delegate* unmanaged)&_findNameOfToken; - callbacks[121] = (delegate* unmanaged)&_getSystemVAmd64PassStructInRegisterDescriptor; - callbacks[122] = (delegate* unmanaged)&_getLoongArch64PassStructInRegisterFlags; - callbacks[123] = (delegate* unmanaged)&_getRISCV64PassStructInRegisterFlags; - callbacks[124] = (delegate* unmanaged)&_getThreadTLSIndex; - callbacks[125] = (delegate* unmanaged)&_getInlinedCallFrameVptr; - callbacks[126] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; - callbacks[127] = (delegate* unmanaged)&_getHelperFtn; - callbacks[128] = (delegate* unmanaged)&_getFunctionEntryPoint; - callbacks[129] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; - callbacks[130] = (delegate* unmanaged)&_getMethodSync; - callbacks[131] = (delegate* unmanaged)&_getLazyStringLiteralHelper; - callbacks[132] = (delegate* unmanaged)&_embedModuleHandle; - callbacks[133] = (delegate* unmanaged)&_embedClassHandle; - callbacks[134] = (delegate* unmanaged)&_embedMethodHandle; - callbacks[135] = (delegate* unmanaged)&_embedFieldHandle; - callbacks[136] = (delegate* unmanaged)&_embedGenericHandle; - callbacks[137] = (delegate* unmanaged)&_getLocationOfThisType; - callbacks[138] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; - callbacks[139] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; - callbacks[140] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; - callbacks[141] = (delegate* unmanaged)&_getJustMyCodeHandle; - callbacks[142] = (delegate* unmanaged)&_GetProfilingHandle; - callbacks[143] = (delegate* unmanaged)&_getCallInfo; - callbacks[144] = (delegate* unmanaged)&_canAccessFamily; - callbacks[145] = (delegate* unmanaged)&_isRIDClassDomainID; - callbacks[146] = (delegate* unmanaged)&_getClassDomainID; - callbacks[147] = (delegate* unmanaged)&_getStaticFieldContent; - callbacks[148] = (delegate* unmanaged)&_getObjectContent; - callbacks[149] = (delegate* unmanaged)&_getStaticFieldCurrentClass; - callbacks[150] = (delegate* unmanaged)&_getVarArgsHandle; - callbacks[151] = (delegate* unmanaged)&_canGetVarArgsHandle; - callbacks[152] = (delegate* unmanaged)&_constructStringLiteral; - callbacks[153] = (delegate* unmanaged)&_emptyStringLiteral; - callbacks[154] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; - callbacks[155] = (delegate* unmanaged)&_GetDelegateCtor; - callbacks[156] = (delegate* unmanaged)&_MethodCompileComplete; - callbacks[157] = (delegate* unmanaged)&_getTailCallHelpers; - callbacks[158] = (delegate* unmanaged)&_convertPInvokeCalliToCall; - callbacks[159] = (delegate* unmanaged)&_notifyInstructionSetUsage; - callbacks[160] = (delegate* unmanaged)&_updateEntryPointForTailCall; - callbacks[161] = (delegate* unmanaged)&_allocMem; - callbacks[162] = (delegate* unmanaged)&_reserveUnwindInfo; - callbacks[163] = (delegate* unmanaged)&_allocUnwindInfo; - callbacks[164] = (delegate* unmanaged)&_allocGCInfo; - callbacks[165] = (delegate* unmanaged)&_setEHcount; - callbacks[166] = (delegate* unmanaged)&_setEHinfo; - callbacks[167] = (delegate* unmanaged)&_logMsg; - callbacks[168] = (delegate* unmanaged)&_doAssert; - callbacks[169] = (delegate* unmanaged)&_reportFatalError; - callbacks[170] = (delegate* unmanaged)&_getPgoInstrumentationResults; - callbacks[171] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; - callbacks[172] = (delegate* unmanaged)&_recordCallSite; - callbacks[173] = (delegate* unmanaged)&_recordRelocation; - callbacks[174] = (delegate* unmanaged)&_getRelocTypeHint; - callbacks[175] = (delegate* unmanaged)&_getExpectedTargetArchitecture; - callbacks[176] = (delegate* unmanaged)&_getJitFlags; + callbacks[85] = (delegate* unmanaged)&_isSDArray; + callbacks[86] = (delegate* unmanaged)&_getArrayRank; + callbacks[87] = (delegate* unmanaged)&_getArrayIntrinsicID; + callbacks[88] = (delegate* unmanaged)&_getArrayInitializationData; + callbacks[89] = (delegate* unmanaged)&_canAccessClass; + callbacks[90] = (delegate* unmanaged)&_printFieldName; + callbacks[91] = (delegate* unmanaged)&_getFieldClass; + callbacks[92] = (delegate* unmanaged)&_getFieldType; + callbacks[93] = (delegate* unmanaged)&_getFieldOffset; + callbacks[94] = (delegate* unmanaged)&_getFieldInfo; + callbacks[95] = (delegate* unmanaged)&_getThreadLocalFieldInfo; + callbacks[96] = (delegate* unmanaged)&_getThreadLocalStaticBlocksInfo; + callbacks[97] = (delegate* unmanaged)&_isFieldStatic; + callbacks[98] = (delegate* unmanaged)&_getArrayOrStringLength; + callbacks[99] = (delegate* unmanaged)&_getBoundaries; + callbacks[100] = (delegate* unmanaged)&_setBoundaries; + callbacks[101] = (delegate* unmanaged)&_getVars; + callbacks[102] = (delegate* unmanaged)&_setVars; + callbacks[103] = (delegate* unmanaged)&_reportRichMappings; + callbacks[104] = (delegate* unmanaged)&_allocateArray; + callbacks[105] = (delegate* unmanaged)&_freeArray; + callbacks[106] = (delegate* unmanaged)&_getArgNext; + callbacks[107] = (delegate* unmanaged)&_getArgType; + callbacks[108] = (delegate* unmanaged)&_getExactClasses; + callbacks[109] = (delegate* unmanaged)&_getArgClass; + callbacks[110] = (delegate* unmanaged)&_getHFAType; + callbacks[111] = (delegate* unmanaged)&_runWithErrorTrap; + callbacks[112] = (delegate* unmanaged)&_runWithSPMIErrorTrap; + callbacks[113] = (delegate* unmanaged)&_getEEInfo; + callbacks[114] = (delegate* unmanaged)&_getJitTimeLogFilename; + callbacks[115] = (delegate* unmanaged)&_getMethodDefFromMethod; + callbacks[116] = (delegate* unmanaged)&_printMethodName; + callbacks[117] = (delegate* unmanaged)&_getMethodNameFromMetadata; + callbacks[118] = (delegate* unmanaged)&_getMethodHash; + callbacks[119] = (delegate* unmanaged)&_findNameOfToken; + callbacks[120] = (delegate* unmanaged)&_getSystemVAmd64PassStructInRegisterDescriptor; + callbacks[121] = (delegate* unmanaged)&_getLoongArch64PassStructInRegisterFlags; + callbacks[122] = (delegate* unmanaged)&_getRISCV64PassStructInRegisterFlags; + callbacks[123] = (delegate* unmanaged)&_getThreadTLSIndex; + callbacks[124] = (delegate* unmanaged)&_getInlinedCallFrameVptr; + callbacks[125] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; + callbacks[126] = (delegate* unmanaged)&_getHelperFtn; + callbacks[127] = (delegate* unmanaged)&_getFunctionEntryPoint; + callbacks[128] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; + callbacks[129] = (delegate* unmanaged)&_getMethodSync; + callbacks[130] = (delegate* unmanaged)&_getLazyStringLiteralHelper; + callbacks[131] = (delegate* unmanaged)&_embedModuleHandle; + callbacks[132] = (delegate* unmanaged)&_embedClassHandle; + callbacks[133] = (delegate* unmanaged)&_embedMethodHandle; + callbacks[134] = (delegate* unmanaged)&_embedFieldHandle; + callbacks[135] = (delegate* unmanaged)&_embedGenericHandle; + callbacks[136] = (delegate* unmanaged)&_getLocationOfThisType; + callbacks[137] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; + callbacks[138] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; + callbacks[139] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; + callbacks[140] = (delegate* unmanaged)&_getJustMyCodeHandle; + callbacks[141] = (delegate* unmanaged)&_GetProfilingHandle; + callbacks[142] = (delegate* unmanaged)&_getCallInfo; + callbacks[143] = (delegate* unmanaged)&_canAccessFamily; + callbacks[144] = (delegate* unmanaged)&_isRIDClassDomainID; + callbacks[145] = (delegate* unmanaged)&_getClassDomainID; + callbacks[146] = (delegate* unmanaged)&_getStaticFieldContent; + callbacks[147] = (delegate* unmanaged)&_getObjectContent; + callbacks[148] = (delegate* unmanaged)&_getStaticFieldCurrentClass; + callbacks[149] = (delegate* unmanaged)&_getVarArgsHandle; + callbacks[150] = (delegate* unmanaged)&_canGetVarArgsHandle; + callbacks[151] = (delegate* unmanaged)&_constructStringLiteral; + callbacks[152] = (delegate* unmanaged)&_emptyStringLiteral; + callbacks[153] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; + callbacks[154] = (delegate* unmanaged)&_GetDelegateCtor; + callbacks[155] = (delegate* unmanaged)&_MethodCompileComplete; + callbacks[156] = (delegate* unmanaged)&_getTailCallHelpers; + callbacks[157] = (delegate* unmanaged)&_convertPInvokeCalliToCall; + callbacks[158] = (delegate* unmanaged)&_notifyInstructionSetUsage; + callbacks[159] = (delegate* unmanaged)&_updateEntryPointForTailCall; + callbacks[160] = (delegate* unmanaged)&_allocMem; + callbacks[161] = (delegate* unmanaged)&_reserveUnwindInfo; + callbacks[162] = (delegate* unmanaged)&_allocUnwindInfo; + callbacks[163] = (delegate* unmanaged)&_allocGCInfo; + callbacks[164] = (delegate* unmanaged)&_setEHcount; + callbacks[165] = (delegate* unmanaged)&_setEHinfo; + callbacks[166] = (delegate* unmanaged)&_logMsg; + callbacks[167] = (delegate* unmanaged)&_doAssert; + callbacks[168] = (delegate* unmanaged)&_reportFatalError; + callbacks[169] = (delegate* unmanaged)&_getPgoInstrumentationResults; + callbacks[170] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; + callbacks[171] = (delegate* unmanaged)&_recordCallSite; + callbacks[172] = (delegate* unmanaged)&_recordRelocation; + callbacks[173] = (delegate* unmanaged)&_getRelocTypeHint; + callbacks[174] = (delegate* unmanaged)&_getExpectedTargetArchitecture; + callbacks[175] = (delegate* unmanaged)&_getJitFlags; return (IntPtr)callbacks; } diff --git a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt index 80611f129761e6..ba14b0dbdce974 100644 --- a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt +++ b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt @@ -244,7 +244,6 @@ FUNCTIONS TypeCompareState isEnum(CORINFO_CLASS_HANDLE cls, CORINFO_CLASS_HANDLE* underlyingType) CORINFO_CLASS_HANDLE getParentType(CORINFO_CLASS_HANDLE cls) CorInfoType getChildType(CORINFO_CLASS_HANDLE clsHnd, CORINFO_CLASS_HANDLE* clsRet) - bool satisfiesClassConstraints(CORINFO_CLASS_HANDLE cls) bool isSDArray(CORINFO_CLASS_HANDLE cls) unsigned getArrayRank(CORINFO_CLASS_HANDLE cls) CorInfoArrayIntrinsic getArrayIntrinsicID(CORINFO_METHOD_HANDLE ftn) diff --git a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h index b4a87770f41a39..a24c9126276ab7 100644 --- a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h +++ b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h @@ -96,7 +96,6 @@ struct JitInterfaceCallbacks TypeCompareState (* isEnum)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE cls, CORINFO_CLASS_HANDLE* underlyingType); CORINFO_CLASS_HANDLE (* getParentType)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE cls); CorInfoType (* getChildType)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE clsHnd, CORINFO_CLASS_HANDLE* clsRet); - bool (* satisfiesClassConstraints)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE cls); bool (* isSDArray)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE cls); unsigned (* getArrayRank)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE cls); CorInfoArrayIntrinsic (* getArrayIntrinsicID)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE ftn); @@ -1030,15 +1029,6 @@ class JitInterfaceWrapper : public ICorJitInfo return temp; } - virtual bool satisfiesClassConstraints( - CORINFO_CLASS_HANDLE cls) -{ - CorInfoExceptionClass* pException = nullptr; - bool temp = _callbacks->satisfiesClassConstraints(_thisHandle, &pException, cls); - if (pException != nullptr) throw pException; - return temp; -} - virtual bool isSDArray( CORINFO_CLASS_HANDLE cls) { diff --git a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h index 1221439f7abbe4..c0bb36a349c119 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h @@ -164,7 +164,6 @@ LWM(PInvokeMarshalingRequired, MethodOrSigInfoValue, DWORD) LWM(ResolveToken, Agnostic_CORINFO_RESOLVED_TOKENin, ResolveTokenValue) LWM(ResolveVirtualMethod, Agnostic_ResolveVirtualMethodKey, Agnostic_ResolveVirtualMethodResult) LWM(TryResolveToken, Agnostic_CORINFO_RESOLVED_TOKENin, TryResolveTokenValue) -LWM(SatisfiesClassConstraints, DWORDLONG, DWORD) LWM(SatisfiesMethodConstraints, DLDL, DWORD) LWM(GetUnmanagedCallConv, MethodOrSigInfoValue, DD) LWM(DoesFieldBelongToClass, DLDL, DWORD) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp index 5ab02df51b41af..e2577367b50174 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp @@ -5158,28 +5158,6 @@ void MethodContext::repGetAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, C pLookup->accessType = (InfoAccessType)value.B; } -void MethodContext::recSatisfiesClassConstraints(CORINFO_CLASS_HANDLE cls, bool result) -{ - if (SatisfiesClassConstraints == nullptr) - SatisfiesClassConstraints = new LightWeightMap(); - - DWORDLONG key = CastHandle(cls); - DWORD value = result ? 1 : 0; - SatisfiesClassConstraints->Add(key, value); - DEBUG_REC(dmpSatisfiesClassConstraints(key, value)); -} -void MethodContext::dmpSatisfiesClassConstraints(DWORDLONG key, DWORD value) -{ - printf("SatisfiesClassConstraints key cls-%016" PRIX64 ", value res-%u", key, value); -} -bool MethodContext::repSatisfiesClassConstraints(CORINFO_CLASS_HANDLE cls) -{ - DWORDLONG key = CastHandle(cls); - DWORD value = LookupByKeyOrMiss(SatisfiesClassConstraints, key, ": key %016" PRIX64 "", key); - DEBUG_REP(dmpSatisfiesClassConstraints(key, value)); - return value != 0; -} - void MethodContext::recGetMethodHash(CORINFO_METHOD_HANDLE ftn, unsigned result) { if (GetMethodHash == nullptr) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h index b8d6c1e031f65d..756469c1daca18 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h @@ -656,10 +656,6 @@ class MethodContext void dmpGetAddressOfPInvokeTarget(DWORDLONG key, DLD value); void repGetAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP* pLookup); - void recSatisfiesClassConstraints(CORINFO_CLASS_HANDLE cls, bool result); - void dmpSatisfiesClassConstraints(DWORDLONG key, DWORD value); - bool repSatisfiesClassConstraints(CORINFO_CLASS_HANDLE cls); - void recGetMethodHash(CORINFO_METHOD_HANDLE ftn, unsigned result); void dmpGetMethodHash(DWORDLONG key, DWORD value); unsigned repGetMethodHash(CORINFO_METHOD_HANDLE ftn); @@ -1055,7 +1051,7 @@ enum mcPackets //Packet_MergeClasses = 107, Packet_PInvokeMarshalingRequired = 108, Packet_ResolveToken = 109, - Packet_SatisfiesClassConstraints = 110, + //Packet_SatisfiesClassConstraints = 110, Packet_SatisfiesMethodConstraints = 111, Packet_DoesFieldBelongToClass = 112, PacketCR_AddressMap = 113, diff --git a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp index 2aa3459f52fc83..b94641179ff933 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp @@ -288,7 +288,6 @@ bool interceptor_ICJI::pInvokeMarshalingRequired(CORINFO_METHOD_HANDLE method, C } // Check constraints on method type arguments (only). -// The parent class should be checked separately using satisfiesClassConstraints(parent). bool interceptor_ICJI::satisfiesMethodConstraints(CORINFO_CLASS_HANDLE parent, // the exact parent of the method CORINFO_METHOD_HANDLE method) { @@ -950,15 +949,6 @@ CorInfoType interceptor_ICJI::getChildType(CORINFO_CLASS_HANDLE clsHnd, CORINFO_ return temp; } -// Check constraints on type arguments of this class and parent classes -bool interceptor_ICJI::satisfiesClassConstraints(CORINFO_CLASS_HANDLE cls) -{ - mc->cr->AddCall("satisfiesClassConstraints"); - bool temp = original_ICorJitInfo->satisfiesClassConstraints(cls); - mc->recSatisfiesClassConstraints(cls, temp); - return temp; -} - // Check if this is a single dimensional array type bool interceptor_ICJI::isSDArray(CORINFO_CLASS_HANDLE cls) { diff --git a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp index 9fc7daea3fc606..42475319229d64 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp @@ -686,13 +686,6 @@ CorInfoType interceptor_ICJI::getChildType( return original_ICorJitInfo->getChildType(clsHnd, clsRet); } -bool interceptor_ICJI::satisfiesClassConstraints( - CORINFO_CLASS_HANDLE cls) -{ - mcs->AddCall("satisfiesClassConstraints"); - return original_ICorJitInfo->satisfiesClassConstraints(cls); -} - bool interceptor_ICJI::isSDArray( CORINFO_CLASS_HANDLE cls) { diff --git a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp index f3d9d062520b81..a3f7e0acae44c2 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp @@ -601,12 +601,6 @@ CorInfoType interceptor_ICJI::getChildType( return original_ICorJitInfo->getChildType(clsHnd, clsRet); } -bool interceptor_ICJI::satisfiesClassConstraints( - CORINFO_CLASS_HANDLE cls) -{ - return original_ICorJitInfo->satisfiesClassConstraints(cls); -} - bool interceptor_ICJI::isSDArray( CORINFO_CLASS_HANDLE cls) { diff --git a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp index cb82cd902b7286..b52d18799d0b69 100644 --- a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp @@ -244,7 +244,6 @@ bool MyICJI::pInvokeMarshalingRequired(CORINFO_METHOD_HANDLE method, CORINFO_SIG } // Check constraints on method type arguments (only). -// The parent class should be checked separately using satisfiesClassConstraints(parent). bool MyICJI::satisfiesMethodConstraints(CORINFO_CLASS_HANDLE parent, // the exact parent of the method CORINFO_METHOD_HANDLE method) { @@ -798,13 +797,6 @@ CorInfoType MyICJI::getChildType(CORINFO_CLASS_HANDLE clsHnd, CORINFO_CLASS_HAND return jitInstance->mc->repGetChildType(clsHnd, clsRet); } -// Check constraints on type arguments of this class and parent classes -bool MyICJI::satisfiesClassConstraints(CORINFO_CLASS_HANDLE cls) -{ - jitInstance->mc->cr->AddCall("satisfiesClassConstraints"); - return jitInstance->mc->repSatisfiesClassConstraints(cls); -} - // Check if this is a single dimensional array type bool MyICJI::isSDArray(CORINFO_CLASS_HANDLE cls) { diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index 169fee55848c57..494d3bf9120c85 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -4666,28 +4666,6 @@ CorInfoType CEEInfo::getChildType ( return ret; } -/*********************************************************************/ -// Check any constraints on class type arguments -bool CEEInfo::satisfiesClassConstraints(CORINFO_CLASS_HANDLE cls) -{ - CONTRACTL { - THROWS; - GC_TRIGGERS; - MODE_PREEMPTIVE; - } CONTRACTL_END; - - bool result = false; - - JIT_TO_EE_TRANSITION(); - - _ASSERTE(cls != NULL); - result = TypeHandle(cls).SatisfiesClassConstraints(); - - EE_TO_JIT_TRANSITION(); - - return result; -} - /*********************************************************************/ // Check if this is a single dimensional array type bool CEEInfo::isSDArray(CORINFO_CLASS_HANDLE cls) From 241f64e8e9b0e0691169a0064bd47b2f4586f310 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Thu, 15 Jun 2023 16:23:19 -0700 Subject: [PATCH 06/16] Remove findNameOfToken --- src/coreclr/inc/corinfo.h | 8 -- src/coreclr/inc/icorjitinfoimpl_generated.h | 6 - src/coreclr/jit/ICorJitInfo_names_generated.h | 1 - .../jit/ICorJitInfo_wrapper_generated.hpp | 12 -- .../tools/Common/JitInterface/CorInfoImpl.cs | 3 - .../JitInterface/CorInfoImpl_generated.cs | 130 ++++++++---------- .../ThunkGenerator/ThunkInput.txt | 1 - .../aot/jitinterface/jitinterface_generated.h | 13 -- .../tools/superpmi/superpmi-shared/lwmlist.h | 1 - .../superpmi-shared/methodcontext.cpp | 52 ------- .../superpmi/superpmi-shared/methodcontext.h | 7 +- .../superpmi-shim-collector/icorjitinfo.cpp | 13 -- .../icorjitinfo_generated.cpp | 10 -- .../icorjitinfo_generated.cpp | 9 -- .../tools/superpmi/superpmi/icorjitinfo.cpp | 11 -- src/coreclr/vm/jitinterface.cpp | 32 ----- 16 files changed, 58 insertions(+), 251 deletions(-) diff --git a/src/coreclr/inc/corinfo.h b/src/coreclr/inc/corinfo.h index f50c8f6ea66b70..594e331fd5ec40 100644 --- a/src/coreclr/inc/corinfo.h +++ b/src/coreclr/inc/corinfo.h @@ -2941,14 +2941,6 @@ class ICorStaticInfo CORINFO_METHOD_HANDLE ftn /* IN */ ) = 0; - // this function is for debugging only. - virtual size_t findNameOfToken ( - CORINFO_MODULE_HANDLE module, /* IN */ - mdToken metaTOK, /* IN */ - _Out_writes_ (FQNameCapacity) char * szFQName, /* OUT */ - size_t FQNameCapacity /* IN */ - ) = 0; - // returns whether the struct is enregisterable. Only valid on a System V VM. Returns true on success, false on failure. virtual bool getSystemVAmd64PassStructInRegisterDescriptor( /* IN */ CORINFO_CLASS_HANDLE structHnd, diff --git a/src/coreclr/inc/icorjitinfoimpl_generated.h b/src/coreclr/inc/icorjitinfoimpl_generated.h index d3237cc71b1d6f..25e0e500e6e262 100644 --- a/src/coreclr/inc/icorjitinfoimpl_generated.h +++ b/src/coreclr/inc/icorjitinfoimpl_generated.h @@ -495,12 +495,6 @@ const char* getMethodNameFromMetadata( unsigned getMethodHash( CORINFO_METHOD_HANDLE ftn) override; -size_t findNameOfToken( - CORINFO_MODULE_HANDLE moduleHandle, - mdToken token, - char* szFQName, - size_t FQNameCapacity) override; - bool getSystemVAmd64PassStructInRegisterDescriptor( CORINFO_CLASS_HANDLE structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr) override; diff --git a/src/coreclr/jit/ICorJitInfo_names_generated.h b/src/coreclr/jit/ICorJitInfo_names_generated.h index 7f22091bf8dfd0..a9479b90951a5f 100644 --- a/src/coreclr/jit/ICorJitInfo_names_generated.h +++ b/src/coreclr/jit/ICorJitInfo_names_generated.h @@ -123,7 +123,6 @@ DEF_CLR_API(getMethodDefFromMethod) DEF_CLR_API(printMethodName) DEF_CLR_API(getMethodNameFromMetadata) DEF_CLR_API(getMethodHash) -DEF_CLR_API(findNameOfToken) DEF_CLR_API(getSystemVAmd64PassStructInRegisterDescriptor) DEF_CLR_API(getLoongArch64PassStructInRegisterFlags) DEF_CLR_API(getRISCV64PassStructInRegisterFlags) diff --git a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp index 9da2a06ba146de..50dd27fdd978c9 100644 --- a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp +++ b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp @@ -1174,18 +1174,6 @@ unsigned WrapICorJitInfo::getMethodHash( return temp; } -size_t WrapICorJitInfo::findNameOfToken( - CORINFO_MODULE_HANDLE moduleHandle, - mdToken token, - char* szFQName, - size_t FQNameCapacity) -{ - API_ENTER(findNameOfToken); - size_t temp = wrapHnd->findNameOfToken(moduleHandle, token, szFQName, FQNameCapacity); - API_LEAVE(findNameOfToken); - return temp; -} - bool WrapICorJitInfo::getSystemVAmd64PassStructInRegisterDescriptor( CORINFO_CLASS_HANDLE structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr) diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs index 237233e6a07b60..ca74936376efe8 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs @@ -3171,9 +3171,6 @@ private uint getMethodHash(CORINFO_METHOD_STRUCT_* ftn) return (uint)HandleToObject(ftn).GetHashCode(); } - private UIntPtr findNameOfToken(CORINFO_MODULE_STRUCT_* moduleHandle, mdToken token, byte* szFQName, UIntPtr FQNameCapacity) - { throw new NotImplementedException("findNameOfToken"); } - private bool getSystemVAmd64PassStructInRegisterDescriptor(CORINFO_CLASS_STRUCT_* structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr) { TypeDesc typeDesc = HandleToObject(structHnd); diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs index 6e2bcadd0687dd..a77aebd6bccc4b 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs @@ -1771,21 +1771,6 @@ private static uint _getMethodHash(IntPtr thisHandle, IntPtr* ppException, CORIN } } - [UnmanagedCallersOnly] - private static UIntPtr _findNameOfToken(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* moduleHandle, mdToken token, byte* szFQName, UIntPtr FQNameCapacity) - { - var _this = GetThis(thisHandle); - try - { - return _this.findNameOfToken(moduleHandle, token, szFQName, FQNameCapacity); - } - catch (Exception ex) - { - *ppException = _this.AllocException(ex); - return default; - } - } - [UnmanagedCallersOnly] private static byte _getSystemVAmd64PassStructInRegisterDescriptor(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr) { @@ -2612,7 +2597,7 @@ private static uint _getJitFlags(IntPtr thisHandle, IntPtr* ppException, CORJIT_ private static IntPtr GetUnmanagedCallbacks() { - void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 176); + void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 175); callbacks[0] = (delegate* unmanaged)&_isIntrinsic; callbacks[1] = (delegate* unmanaged)&_getMethodAttribs; @@ -2733,63 +2718,62 @@ private static IntPtr GetUnmanagedCallbacks() callbacks[116] = (delegate* unmanaged)&_printMethodName; callbacks[117] = (delegate* unmanaged)&_getMethodNameFromMetadata; callbacks[118] = (delegate* unmanaged)&_getMethodHash; - callbacks[119] = (delegate* unmanaged)&_findNameOfToken; - callbacks[120] = (delegate* unmanaged)&_getSystemVAmd64PassStructInRegisterDescriptor; - callbacks[121] = (delegate* unmanaged)&_getLoongArch64PassStructInRegisterFlags; - callbacks[122] = (delegate* unmanaged)&_getRISCV64PassStructInRegisterFlags; - callbacks[123] = (delegate* unmanaged)&_getThreadTLSIndex; - callbacks[124] = (delegate* unmanaged)&_getInlinedCallFrameVptr; - callbacks[125] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; - callbacks[126] = (delegate* unmanaged)&_getHelperFtn; - callbacks[127] = (delegate* unmanaged)&_getFunctionEntryPoint; - callbacks[128] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; - callbacks[129] = (delegate* unmanaged)&_getMethodSync; - callbacks[130] = (delegate* unmanaged)&_getLazyStringLiteralHelper; - callbacks[131] = (delegate* unmanaged)&_embedModuleHandle; - callbacks[132] = (delegate* unmanaged)&_embedClassHandle; - callbacks[133] = (delegate* unmanaged)&_embedMethodHandle; - callbacks[134] = (delegate* unmanaged)&_embedFieldHandle; - callbacks[135] = (delegate* unmanaged)&_embedGenericHandle; - callbacks[136] = (delegate* unmanaged)&_getLocationOfThisType; - callbacks[137] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; - callbacks[138] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; - callbacks[139] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; - callbacks[140] = (delegate* unmanaged)&_getJustMyCodeHandle; - callbacks[141] = (delegate* unmanaged)&_GetProfilingHandle; - callbacks[142] = (delegate* unmanaged)&_getCallInfo; - callbacks[143] = (delegate* unmanaged)&_canAccessFamily; - callbacks[144] = (delegate* unmanaged)&_isRIDClassDomainID; - callbacks[145] = (delegate* unmanaged)&_getClassDomainID; - callbacks[146] = (delegate* unmanaged)&_getStaticFieldContent; - callbacks[147] = (delegate* unmanaged)&_getObjectContent; - callbacks[148] = (delegate* unmanaged)&_getStaticFieldCurrentClass; - callbacks[149] = (delegate* unmanaged)&_getVarArgsHandle; - callbacks[150] = (delegate* unmanaged)&_canGetVarArgsHandle; - callbacks[151] = (delegate* unmanaged)&_constructStringLiteral; - callbacks[152] = (delegate* unmanaged)&_emptyStringLiteral; - callbacks[153] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; - callbacks[154] = (delegate* unmanaged)&_GetDelegateCtor; - callbacks[155] = (delegate* unmanaged)&_MethodCompileComplete; - callbacks[156] = (delegate* unmanaged)&_getTailCallHelpers; - callbacks[157] = (delegate* unmanaged)&_convertPInvokeCalliToCall; - callbacks[158] = (delegate* unmanaged)&_notifyInstructionSetUsage; - callbacks[159] = (delegate* unmanaged)&_updateEntryPointForTailCall; - callbacks[160] = (delegate* unmanaged)&_allocMem; - callbacks[161] = (delegate* unmanaged)&_reserveUnwindInfo; - callbacks[162] = (delegate* unmanaged)&_allocUnwindInfo; - callbacks[163] = (delegate* unmanaged)&_allocGCInfo; - callbacks[164] = (delegate* unmanaged)&_setEHcount; - callbacks[165] = (delegate* unmanaged)&_setEHinfo; - callbacks[166] = (delegate* unmanaged)&_logMsg; - callbacks[167] = (delegate* unmanaged)&_doAssert; - callbacks[168] = (delegate* unmanaged)&_reportFatalError; - callbacks[169] = (delegate* unmanaged)&_getPgoInstrumentationResults; - callbacks[170] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; - callbacks[171] = (delegate* unmanaged)&_recordCallSite; - callbacks[172] = (delegate* unmanaged)&_recordRelocation; - callbacks[173] = (delegate* unmanaged)&_getRelocTypeHint; - callbacks[174] = (delegate* unmanaged)&_getExpectedTargetArchitecture; - callbacks[175] = (delegate* unmanaged)&_getJitFlags; + callbacks[119] = (delegate* unmanaged)&_getSystemVAmd64PassStructInRegisterDescriptor; + callbacks[120] = (delegate* unmanaged)&_getLoongArch64PassStructInRegisterFlags; + callbacks[121] = (delegate* unmanaged)&_getRISCV64PassStructInRegisterFlags; + callbacks[122] = (delegate* unmanaged)&_getThreadTLSIndex; + callbacks[123] = (delegate* unmanaged)&_getInlinedCallFrameVptr; + callbacks[124] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; + callbacks[125] = (delegate* unmanaged)&_getHelperFtn; + callbacks[126] = (delegate* unmanaged)&_getFunctionEntryPoint; + callbacks[127] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; + callbacks[128] = (delegate* unmanaged)&_getMethodSync; + callbacks[129] = (delegate* unmanaged)&_getLazyStringLiteralHelper; + callbacks[130] = (delegate* unmanaged)&_embedModuleHandle; + callbacks[131] = (delegate* unmanaged)&_embedClassHandle; + callbacks[132] = (delegate* unmanaged)&_embedMethodHandle; + callbacks[133] = (delegate* unmanaged)&_embedFieldHandle; + callbacks[134] = (delegate* unmanaged)&_embedGenericHandle; + callbacks[135] = (delegate* unmanaged)&_getLocationOfThisType; + callbacks[136] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; + callbacks[137] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; + callbacks[138] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; + callbacks[139] = (delegate* unmanaged)&_getJustMyCodeHandle; + callbacks[140] = (delegate* unmanaged)&_GetProfilingHandle; + callbacks[141] = (delegate* unmanaged)&_getCallInfo; + callbacks[142] = (delegate* unmanaged)&_canAccessFamily; + callbacks[143] = (delegate* unmanaged)&_isRIDClassDomainID; + callbacks[144] = (delegate* unmanaged)&_getClassDomainID; + callbacks[145] = (delegate* unmanaged)&_getStaticFieldContent; + callbacks[146] = (delegate* unmanaged)&_getObjectContent; + callbacks[147] = (delegate* unmanaged)&_getStaticFieldCurrentClass; + callbacks[148] = (delegate* unmanaged)&_getVarArgsHandle; + callbacks[149] = (delegate* unmanaged)&_canGetVarArgsHandle; + callbacks[150] = (delegate* unmanaged)&_constructStringLiteral; + callbacks[151] = (delegate* unmanaged)&_emptyStringLiteral; + callbacks[152] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; + callbacks[153] = (delegate* unmanaged)&_GetDelegateCtor; + callbacks[154] = (delegate* unmanaged)&_MethodCompileComplete; + callbacks[155] = (delegate* unmanaged)&_getTailCallHelpers; + callbacks[156] = (delegate* unmanaged)&_convertPInvokeCalliToCall; + callbacks[157] = (delegate* unmanaged)&_notifyInstructionSetUsage; + callbacks[158] = (delegate* unmanaged)&_updateEntryPointForTailCall; + callbacks[159] = (delegate* unmanaged)&_allocMem; + callbacks[160] = (delegate* unmanaged)&_reserveUnwindInfo; + callbacks[161] = (delegate* unmanaged)&_allocUnwindInfo; + callbacks[162] = (delegate* unmanaged)&_allocGCInfo; + callbacks[163] = (delegate* unmanaged)&_setEHcount; + callbacks[164] = (delegate* unmanaged)&_setEHinfo; + callbacks[165] = (delegate* unmanaged)&_logMsg; + callbacks[166] = (delegate* unmanaged)&_doAssert; + callbacks[167] = (delegate* unmanaged)&_reportFatalError; + callbacks[168] = (delegate* unmanaged)&_getPgoInstrumentationResults; + callbacks[169] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; + callbacks[170] = (delegate* unmanaged)&_recordCallSite; + callbacks[171] = (delegate* unmanaged)&_recordRelocation; + callbacks[172] = (delegate* unmanaged)&_getRelocTypeHint; + callbacks[173] = (delegate* unmanaged)&_getExpectedTargetArchitecture; + callbacks[174] = (delegate* unmanaged)&_getJitFlags; return (IntPtr)callbacks; } diff --git a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt index ba14b0dbdce974..ecf314904da631 100644 --- a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt +++ b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt @@ -278,7 +278,6 @@ FUNCTIONS size_t printMethodName(CORINFO_METHOD_HANDLE ftn, char* buffer, size_t bufferSize, size_t* pRequiredBufferSize) const char* getMethodNameFromMetadata(CORINFO_METHOD_HANDLE ftn, const char **className, const char **namespaceName, const char **enclosingClassName); unsigned getMethodHash(CORINFO_METHOD_HANDLE ftn); - size_t findNameOfToken(CORINFO_MODULE_HANDLE moduleHandle,mdToken token, char * szFQName,size_t FQNameCapacity); bool getSystemVAmd64PassStructInRegisterDescriptor(CORINFO_CLASS_HANDLE structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr); uint32_t getLoongArch64PassStructInRegisterFlags(CORINFO_CLASS_HANDLE structHnd); uint32_t getRISCV64PassStructInRegisterFlags(CORINFO_CLASS_HANDLE structHnd); diff --git a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h index a24c9126276ab7..52f7757cccd075 100644 --- a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h +++ b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h @@ -130,7 +130,6 @@ struct JitInterfaceCallbacks size_t (* printMethodName)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE ftn, char* buffer, size_t bufferSize, size_t* pRequiredBufferSize); const char* (* getMethodNameFromMetadata)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE ftn, const char** className, const char** namespaceName, const char** enclosingClassName); unsigned (* getMethodHash)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE ftn); - size_t (* findNameOfToken)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_MODULE_HANDLE moduleHandle, unsigned int token, char* szFQName, size_t FQNameCapacity); bool (* getSystemVAmd64PassStructInRegisterDescriptor)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr); uint32_t (* getLoongArch64PassStructInRegisterFlags)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE structHnd); uint32_t (* getRISCV64PassStructInRegisterFlags)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE structHnd); @@ -1352,18 +1351,6 @@ class JitInterfaceWrapper : public ICorJitInfo return temp; } - virtual size_t findNameOfToken( - CORINFO_MODULE_HANDLE moduleHandle, - unsigned int token, - char* szFQName, - size_t FQNameCapacity) -{ - CorInfoExceptionClass* pException = nullptr; - size_t temp = _callbacks->findNameOfToken(_thisHandle, &pException, moduleHandle, token, szFQName, FQNameCapacity); - if (pException != nullptr) throw pException; - return temp; -} - virtual bool getSystemVAmd64PassStructInRegisterDescriptor( CORINFO_CLASS_HANDLE structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h index c0bb36a349c119..62af74f3b874e9 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h @@ -43,7 +43,6 @@ LWM(GetThreadLocalStaticBlocksInfo, DWORD, Agnostic_GetThreadLocalStaticBlocksIn DENSELWM(EmptyStringLiteral, DLD) DENSELWM(ErrorList, DWORD) LWM(FindCallSiteSig, Agnostic_FindCallSiteSig, Agnostic_CORINFO_SIG_INFO) -LWM(FindNameOfToken, DLD, DLD) LWM(FindSig, Agnostic_FindSig, Agnostic_CORINFO_SIG_INFO) LWM(GetAddressOfPInvokeTarget, DWORDLONG, DLD) LWM(GetAddrOfCaptureThreadGlobal, DWORD, DLDL) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp index e2577367b50174..69473dd6a391c9 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp @@ -6104,58 +6104,6 @@ TypeCompareState MethodContext::repCompareTypesForEquality(CORINFO_CLASS_HANDLE return result; } -void MethodContext::recFindNameOfToken( - CORINFO_MODULE_HANDLE module, mdToken metaTOK, char* szFQName, size_t FQNameCapacity, size_t result) -{ - if (FindNameOfToken == nullptr) - FindNameOfToken = new LightWeightMap(); - - DLD key; - ZeroMemory(&key, sizeof(key)); // Zero key including any struct padding - key.A = CastHandle(module); - key.B = (DWORD)metaTOK; - - DLD value; - value.A = result; - value.B = FindNameOfToken->AddBuffer((unsigned char*)szFQName, (unsigned int)result); - - FindNameOfToken->Add(key, value); - DEBUG_REC(dmpFindNameOfToken(key, value)); -} -void MethodContext::dmpFindNameOfToken(DLD key, DLD value) -{ - // practically the name of a token wont be bigger than 4gb... - unsigned char* buff = new unsigned char[(unsigned int)value.A + 1]; - ZeroMemory(buff, (unsigned int)value.A + 1); - memcpy(buff, FindNameOfToken->GetBuffer(value.B), (unsigned int)value.A); - FindNameOfToken->Unlock(); - printf("FindNameOfToken key mod-%016" PRIX64 " tok-%08X, value '%s'", key.A, key.B, buff); - delete[] buff; -} -size_t MethodContext::repFindNameOfToken(CORINFO_MODULE_HANDLE module, - mdToken metaTOK, - char* szFQName, - size_t FQNameCapacity) -{ - DLD key; - ZeroMemory(&key, sizeof(key)); // Zero key including any struct padding - key.A = CastHandle(module); - key.B = (DWORD)metaTOK; - - DLD value = LookupByKeyOrMiss(FindNameOfToken, key, ": key %016" PRIX64 "", key.A); - - DEBUG_REP(dmpFindNameOfToken(key, value)); - - unsigned char* temp = nullptr; - if (value.B != (DWORD)-1) - { - temp = FindNameOfToken->GetBuffer(value.B); - memcpy(szFQName, temp, (size_t)value.A); - } - - return (size_t)value.A; -} - void MethodContext::recGetSystemVAmd64PassStructInRegisterDescriptor( CORINFO_CLASS_HANDLE structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr, diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h index 756469c1daca18..960ce62184b41d 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h @@ -749,11 +749,6 @@ class MethodContext void dmpCompareTypesForEquality(DLDL key, DWORD value); TypeCompareState repCompareTypesForEquality(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2); - void recFindNameOfToken( - CORINFO_MODULE_HANDLE module, mdToken metaTOK, char* szFQName, size_t FQNameCapacity, size_t result); - void dmpFindNameOfToken(DLD key, DLD value); - size_t repFindNameOfToken(CORINFO_MODULE_HANDLE module, mdToken metaTOK, char* szFQName, size_t FQNameCapacity); - void recGetSystemVAmd64PassStructInRegisterDescriptor( CORINFO_CLASS_HANDLE structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr, @@ -1086,7 +1081,7 @@ enum mcPackets Packet_CheckMethodModifier = 142, Packet_CompileMethod = 143, Packet_IsValidToken = 144, - Packet_FindNameOfToken = 145, + //Packet_FindNameOfToken = 145, //PacketCR_RecordCallSite = 146, Packet_GetLazyStringLiteralHelper = 147, Packet_IsIntrinsicType = 148, diff --git a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp index b94641179ff933..c2ec78985a9b1f 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp @@ -1364,19 +1364,6 @@ unsigned interceptor_ICJI::getMethodHash(CORINFO_METHOD_HANDLE ftn /* IN */ return temp; } -// this function is for debugging only. -size_t interceptor_ICJI::findNameOfToken(CORINFO_MODULE_HANDLE module, /* IN */ - mdToken metaTOK, /* IN */ - _Out_writes_(FQNameCapacity) char* szFQName, /* OUT */ - size_t FQNameCapacity /* IN */ - ) -{ - mc->cr->AddCall("findNameOfToken"); - size_t result = original_ICorJitInfo->findNameOfToken(module, metaTOK, szFQName, FQNameCapacity); - mc->recFindNameOfToken(module, metaTOK, szFQName, FQNameCapacity, result); - return result; -} - bool interceptor_ICJI::getSystemVAmd64PassStructInRegisterDescriptor( /* IN */ CORINFO_CLASS_HANDLE structHnd, /* OUT */ SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr) diff --git a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp index 42475319229d64..89817d9b645944 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp @@ -962,16 +962,6 @@ unsigned interceptor_ICJI::getMethodHash( return original_ICorJitInfo->getMethodHash(ftn); } -size_t interceptor_ICJI::findNameOfToken( - CORINFO_MODULE_HANDLE moduleHandle, - mdToken token, - char* szFQName, - size_t FQNameCapacity) -{ - mcs->AddCall("findNameOfToken"); - return original_ICorJitInfo->findNameOfToken(moduleHandle, token, szFQName, FQNameCapacity); -} - bool interceptor_ICJI::getSystemVAmd64PassStructInRegisterDescriptor( CORINFO_CLASS_HANDLE structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr) diff --git a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp index a3f7e0acae44c2..a886276bd17ea6 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp @@ -843,15 +843,6 @@ unsigned interceptor_ICJI::getMethodHash( return original_ICorJitInfo->getMethodHash(ftn); } -size_t interceptor_ICJI::findNameOfToken( - CORINFO_MODULE_HANDLE moduleHandle, - mdToken token, - char* szFQName, - size_t FQNameCapacity) -{ - return original_ICorJitInfo->findNameOfToken(moduleHandle, token, szFQName, FQNameCapacity); -} - bool interceptor_ICJI::getSystemVAmd64PassStructInRegisterDescriptor( CORINFO_CLASS_HANDLE structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr) diff --git a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp index b52d18799d0b69..eea9865fe8f24e 100644 --- a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp @@ -1185,17 +1185,6 @@ unsigned MyICJI::getMethodHash(CORINFO_METHOD_HANDLE ftn /* IN */ return jitInstance->mc->repGetMethodHash(ftn); } -// this function is for debugging only. -size_t MyICJI::findNameOfToken(CORINFO_MODULE_HANDLE module, /* IN */ - mdToken metaTOK, /* IN */ - _Out_writes_(FQNameCapacity) char* szFQName, /* OUT */ - size_t FQNameCapacity /* IN */ - ) -{ - jitInstance->mc->cr->AddCall("findNameOfToken"); - return jitInstance->mc->repFindNameOfToken(module, metaTOK, szFQName, FQNameCapacity); -} - bool MyICJI::getSystemVAmd64PassStructInRegisterDescriptor( /* IN */ CORINFO_CLASS_HANDLE structHnd, /* OUT */ SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr) diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index 494d3bf9120c85..58936f0b418ac0 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -611,38 +611,6 @@ CORINFO_CLASS_HANDLE CEEInfo::getTokenTypeAsHandle (CORINFO_RESOLVED_TOKEN * pRe return tokenType; } -/*********************************************************************/ -size_t CEEInfo::findNameOfToken ( - CORINFO_MODULE_HANDLE scopeHnd, - mdToken metaTOK, - _Out_writes_ (FQNameCapacity) char * szFQName, - size_t FQNameCapacity) -{ - CONTRACTL { - THROWS; - GC_TRIGGERS; - MODE_PREEMPTIVE; - } CONTRACTL_END; - - size_t NameLen = 0; - - JIT_TO_EE_TRANSITION(); - - if (IsDynamicScope(scopeHnd)) - { - strncpy_s (szFQName, FQNameCapacity, "DynamicToken", FQNameCapacity - 1); - NameLen = strlen (szFQName); - } - else - { - Module* module = (Module *)scopeHnd; - NameLen = findNameOfToken(module, metaTOK, szFQName, FQNameCapacity); - } - - EE_TO_JIT_TRANSITION(); - - return NameLen; -} /*********************************************************************/ // Checks if the given metadata token is valid From 5d9eb14771b6a46d0ed84ec745e4bf5e86b870fb Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Thu, 15 Jun 2023 16:28:31 -0700 Subject: [PATCH 07/16] Remove getInlinedCallFrameVptr --- src/coreclr/inc/corinfo.h | 4 - src/coreclr/inc/icorjitinfoimpl_generated.h | 3 - src/coreclr/jit/ICorJitInfo_names_generated.h | 1 - .../jit/ICorJitInfo_wrapper_generated.hpp | 9 -- .../tools/Common/JitInterface/CorInfoImpl.cs | 2 - .../JitInterface/CorInfoImpl_generated.cs | 120 ++++++++---------- .../ThunkGenerator/ThunkInput.txt | 1 - .../aot/jitinterface/jitinterface_generated.h | 10 -- .../tools/superpmi/superpmi-shared/lwmlist.h | 1 - .../superpmi-shared/methodcontext.cpp | 30 ----- .../superpmi/superpmi-shared/methodcontext.h | 6 +- .../superpmi-shim-collector/icorjitinfo.cpp | 8 -- .../icorjitinfo_generated.cpp | 7 - .../icorjitinfo_generated.cpp | 6 - .../tools/superpmi/superpmi/icorjitinfo.cpp | 6 - src/coreclr/vm/jitinterface.cpp | 21 --- 16 files changed, 53 insertions(+), 182 deletions(-) diff --git a/src/coreclr/inc/corinfo.h b/src/coreclr/inc/corinfo.h index 594e331fd5ec40..55b1ca44a20980 100644 --- a/src/coreclr/inc/corinfo.h +++ b/src/coreclr/inc/corinfo.h @@ -2987,10 +2987,6 @@ class ICorDynamicInfo : public ICorStaticInfo void **ppIndirection = NULL ) = 0; - virtual const void * getInlinedCallFrameVptr( - void **ppIndirection = NULL - ) = 0; - virtual int32_t * getAddrOfCaptureThreadGlobal( void **ppIndirection = NULL ) = 0; diff --git a/src/coreclr/inc/icorjitinfoimpl_generated.h b/src/coreclr/inc/icorjitinfoimpl_generated.h index 25e0e500e6e262..42f4271a38f691 100644 --- a/src/coreclr/inc/icorjitinfoimpl_generated.h +++ b/src/coreclr/inc/icorjitinfoimpl_generated.h @@ -508,9 +508,6 @@ uint32_t getRISCV64PassStructInRegisterFlags( uint32_t getThreadTLSIndex( void** ppIndirection) override; -const void* getInlinedCallFrameVptr( - void** ppIndirection) override; - int32_t* getAddrOfCaptureThreadGlobal( void** ppIndirection) override; diff --git a/src/coreclr/jit/ICorJitInfo_names_generated.h b/src/coreclr/jit/ICorJitInfo_names_generated.h index a9479b90951a5f..6be25450829210 100644 --- a/src/coreclr/jit/ICorJitInfo_names_generated.h +++ b/src/coreclr/jit/ICorJitInfo_names_generated.h @@ -127,7 +127,6 @@ DEF_CLR_API(getSystemVAmd64PassStructInRegisterDescriptor) DEF_CLR_API(getLoongArch64PassStructInRegisterFlags) DEF_CLR_API(getRISCV64PassStructInRegisterFlags) DEF_CLR_API(getThreadTLSIndex) -DEF_CLR_API(getInlinedCallFrameVptr) DEF_CLR_API(getAddrOfCaptureThreadGlobal) DEF_CLR_API(getHelperFtn) DEF_CLR_API(getFunctionEntryPoint) diff --git a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp index 50dd27fdd978c9..26d3cab0f4aae3 100644 --- a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp +++ b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp @@ -1211,15 +1211,6 @@ uint32_t WrapICorJitInfo::getThreadTLSIndex( return temp; } -const void* WrapICorJitInfo::getInlinedCallFrameVptr( - void** ppIndirection) -{ - API_ENTER(getInlinedCallFrameVptr); - const void* temp = wrapHnd->getInlinedCallFrameVptr(ppIndirection); - API_LEAVE(getInlinedCallFrameVptr); - return temp; -} - int32_t* WrapICorJitInfo::getAddrOfCaptureThreadGlobal( void** ppIndirection) { diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs index ca74936376efe8..41c2ae5eb7a14f 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs @@ -3193,8 +3193,6 @@ private uint getRISCV64PassStructInRegisterFlags(CORINFO_CLASS_STRUCT_* cls) private uint getThreadTLSIndex(ref void* ppIndirection) { throw new NotImplementedException("getThreadTLSIndex"); } - private void* getInlinedCallFrameVptr(ref void* ppIndirection) - { throw new NotImplementedException("getInlinedCallFrameVptr"); } private Dictionary _helperCache = new Dictionary(); private void* getHelperFtn(CorInfoHelpFunc ftnNum, ref void* ppIndirection) diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs index a77aebd6bccc4b..3f9f0f4ea9e479 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs @@ -1831,21 +1831,6 @@ private static uint _getThreadTLSIndex(IntPtr thisHandle, IntPtr* ppException, v } } - [UnmanagedCallersOnly] - private static void* _getInlinedCallFrameVptr(IntPtr thisHandle, IntPtr* ppException, void** ppIndirection) - { - var _this = GetThis(thisHandle); - try - { - return _this.getInlinedCallFrameVptr(ref *ppIndirection); - } - catch (Exception ex) - { - *ppException = _this.AllocException(ex); - return default; - } - } - [UnmanagedCallersOnly] private static int* _getAddrOfCaptureThreadGlobal(IntPtr thisHandle, IntPtr* ppException, void** ppIndirection) { @@ -2597,7 +2582,7 @@ private static uint _getJitFlags(IntPtr thisHandle, IntPtr* ppException, CORJIT_ private static IntPtr GetUnmanagedCallbacks() { - void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 175); + void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 174); callbacks[0] = (delegate* unmanaged)&_isIntrinsic; callbacks[1] = (delegate* unmanaged)&_getMethodAttribs; @@ -2722,58 +2707,57 @@ private static IntPtr GetUnmanagedCallbacks() callbacks[120] = (delegate* unmanaged)&_getLoongArch64PassStructInRegisterFlags; callbacks[121] = (delegate* unmanaged)&_getRISCV64PassStructInRegisterFlags; callbacks[122] = (delegate* unmanaged)&_getThreadTLSIndex; - callbacks[123] = (delegate* unmanaged)&_getInlinedCallFrameVptr; - callbacks[124] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; - callbacks[125] = (delegate* unmanaged)&_getHelperFtn; - callbacks[126] = (delegate* unmanaged)&_getFunctionEntryPoint; - callbacks[127] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; - callbacks[128] = (delegate* unmanaged)&_getMethodSync; - callbacks[129] = (delegate* unmanaged)&_getLazyStringLiteralHelper; - callbacks[130] = (delegate* unmanaged)&_embedModuleHandle; - callbacks[131] = (delegate* unmanaged)&_embedClassHandle; - callbacks[132] = (delegate* unmanaged)&_embedMethodHandle; - callbacks[133] = (delegate* unmanaged)&_embedFieldHandle; - callbacks[134] = (delegate* unmanaged)&_embedGenericHandle; - callbacks[135] = (delegate* unmanaged)&_getLocationOfThisType; - callbacks[136] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; - callbacks[137] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; - callbacks[138] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; - callbacks[139] = (delegate* unmanaged)&_getJustMyCodeHandle; - callbacks[140] = (delegate* unmanaged)&_GetProfilingHandle; - callbacks[141] = (delegate* unmanaged)&_getCallInfo; - callbacks[142] = (delegate* unmanaged)&_canAccessFamily; - callbacks[143] = (delegate* unmanaged)&_isRIDClassDomainID; - callbacks[144] = (delegate* unmanaged)&_getClassDomainID; - callbacks[145] = (delegate* unmanaged)&_getStaticFieldContent; - callbacks[146] = (delegate* unmanaged)&_getObjectContent; - callbacks[147] = (delegate* unmanaged)&_getStaticFieldCurrentClass; - callbacks[148] = (delegate* unmanaged)&_getVarArgsHandle; - callbacks[149] = (delegate* unmanaged)&_canGetVarArgsHandle; - callbacks[150] = (delegate* unmanaged)&_constructStringLiteral; - callbacks[151] = (delegate* unmanaged)&_emptyStringLiteral; - callbacks[152] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; - callbacks[153] = (delegate* unmanaged)&_GetDelegateCtor; - callbacks[154] = (delegate* unmanaged)&_MethodCompileComplete; - callbacks[155] = (delegate* unmanaged)&_getTailCallHelpers; - callbacks[156] = (delegate* unmanaged)&_convertPInvokeCalliToCall; - callbacks[157] = (delegate* unmanaged)&_notifyInstructionSetUsage; - callbacks[158] = (delegate* unmanaged)&_updateEntryPointForTailCall; - callbacks[159] = (delegate* unmanaged)&_allocMem; - callbacks[160] = (delegate* unmanaged)&_reserveUnwindInfo; - callbacks[161] = (delegate* unmanaged)&_allocUnwindInfo; - callbacks[162] = (delegate* unmanaged)&_allocGCInfo; - callbacks[163] = (delegate* unmanaged)&_setEHcount; - callbacks[164] = (delegate* unmanaged)&_setEHinfo; - callbacks[165] = (delegate* unmanaged)&_logMsg; - callbacks[166] = (delegate* unmanaged)&_doAssert; - callbacks[167] = (delegate* unmanaged)&_reportFatalError; - callbacks[168] = (delegate* unmanaged)&_getPgoInstrumentationResults; - callbacks[169] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; - callbacks[170] = (delegate* unmanaged)&_recordCallSite; - callbacks[171] = (delegate* unmanaged)&_recordRelocation; - callbacks[172] = (delegate* unmanaged)&_getRelocTypeHint; - callbacks[173] = (delegate* unmanaged)&_getExpectedTargetArchitecture; - callbacks[174] = (delegate* unmanaged)&_getJitFlags; + callbacks[123] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; + callbacks[124] = (delegate* unmanaged)&_getHelperFtn; + callbacks[125] = (delegate* unmanaged)&_getFunctionEntryPoint; + callbacks[126] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; + callbacks[127] = (delegate* unmanaged)&_getMethodSync; + callbacks[128] = (delegate* unmanaged)&_getLazyStringLiteralHelper; + callbacks[129] = (delegate* unmanaged)&_embedModuleHandle; + callbacks[130] = (delegate* unmanaged)&_embedClassHandle; + callbacks[131] = (delegate* unmanaged)&_embedMethodHandle; + callbacks[132] = (delegate* unmanaged)&_embedFieldHandle; + callbacks[133] = (delegate* unmanaged)&_embedGenericHandle; + callbacks[134] = (delegate* unmanaged)&_getLocationOfThisType; + callbacks[135] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; + callbacks[136] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; + callbacks[137] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; + callbacks[138] = (delegate* unmanaged)&_getJustMyCodeHandle; + callbacks[139] = (delegate* unmanaged)&_GetProfilingHandle; + callbacks[140] = (delegate* unmanaged)&_getCallInfo; + callbacks[141] = (delegate* unmanaged)&_canAccessFamily; + callbacks[142] = (delegate* unmanaged)&_isRIDClassDomainID; + callbacks[143] = (delegate* unmanaged)&_getClassDomainID; + callbacks[144] = (delegate* unmanaged)&_getStaticFieldContent; + callbacks[145] = (delegate* unmanaged)&_getObjectContent; + callbacks[146] = (delegate* unmanaged)&_getStaticFieldCurrentClass; + callbacks[147] = (delegate* unmanaged)&_getVarArgsHandle; + callbacks[148] = (delegate* unmanaged)&_canGetVarArgsHandle; + callbacks[149] = (delegate* unmanaged)&_constructStringLiteral; + callbacks[150] = (delegate* unmanaged)&_emptyStringLiteral; + callbacks[151] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; + callbacks[152] = (delegate* unmanaged)&_GetDelegateCtor; + callbacks[153] = (delegate* unmanaged)&_MethodCompileComplete; + callbacks[154] = (delegate* unmanaged)&_getTailCallHelpers; + callbacks[155] = (delegate* unmanaged)&_convertPInvokeCalliToCall; + callbacks[156] = (delegate* unmanaged)&_notifyInstructionSetUsage; + callbacks[157] = (delegate* unmanaged)&_updateEntryPointForTailCall; + callbacks[158] = (delegate* unmanaged)&_allocMem; + callbacks[159] = (delegate* unmanaged)&_reserveUnwindInfo; + callbacks[160] = (delegate* unmanaged)&_allocUnwindInfo; + callbacks[161] = (delegate* unmanaged)&_allocGCInfo; + callbacks[162] = (delegate* unmanaged)&_setEHcount; + callbacks[163] = (delegate* unmanaged)&_setEHinfo; + callbacks[164] = (delegate* unmanaged)&_logMsg; + callbacks[165] = (delegate* unmanaged)&_doAssert; + callbacks[166] = (delegate* unmanaged)&_reportFatalError; + callbacks[167] = (delegate* unmanaged)&_getPgoInstrumentationResults; + callbacks[168] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; + callbacks[169] = (delegate* unmanaged)&_recordCallSite; + callbacks[170] = (delegate* unmanaged)&_recordRelocation; + callbacks[171] = (delegate* unmanaged)&_getRelocTypeHint; + callbacks[172] = (delegate* unmanaged)&_getExpectedTargetArchitecture; + callbacks[173] = (delegate* unmanaged)&_getJitFlags; return (IntPtr)callbacks; } diff --git a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt index ecf314904da631..c410d7f15c75e2 100644 --- a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt +++ b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt @@ -282,7 +282,6 @@ FUNCTIONS uint32_t getLoongArch64PassStructInRegisterFlags(CORINFO_CLASS_HANDLE structHnd); uint32_t getRISCV64PassStructInRegisterFlags(CORINFO_CLASS_HANDLE structHnd); uint32_t getThreadTLSIndex(void **ppIndirection); - const void * getInlinedCallFrameVptr(void **ppIndirection); int32_t * getAddrOfCaptureThreadGlobal(void **ppIndirection); void* getHelperFtn (CorInfoHelpFunc ftnNum, void **ppIndirection); void getFunctionEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_CONST_LOOKUP * pResult, CORINFO_ACCESS_FLAGS accessFlags); diff --git a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h index 52f7757cccd075..a3ca67749a2b1a 100644 --- a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h +++ b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h @@ -134,7 +134,6 @@ struct JitInterfaceCallbacks uint32_t (* getLoongArch64PassStructInRegisterFlags)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE structHnd); uint32_t (* getRISCV64PassStructInRegisterFlags)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE structHnd); uint32_t (* getThreadTLSIndex)(void * thisHandle, CorInfoExceptionClass** ppException, void** ppIndirection); - const void* (* getInlinedCallFrameVptr)(void * thisHandle, CorInfoExceptionClass** ppException, void** ppIndirection); int32_t* (* getAddrOfCaptureThreadGlobal)(void * thisHandle, CorInfoExceptionClass** ppException, void** ppIndirection); void* (* getHelperFtn)(void * thisHandle, CorInfoExceptionClass** ppException, CorInfoHelpFunc ftnNum, void** ppIndirection); void (* getFunctionEntryPoint)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE ftn, CORINFO_CONST_LOOKUP* pResult, CORINFO_ACCESS_FLAGS accessFlags); @@ -1388,15 +1387,6 @@ class JitInterfaceWrapper : public ICorJitInfo return temp; } - virtual const void* getInlinedCallFrameVptr( - void** ppIndirection) -{ - CorInfoExceptionClass* pException = nullptr; - const void* temp = _callbacks->getInlinedCallFrameVptr(_thisHandle, &pException, ppIndirection); - if (pException != nullptr) throw pException; - return temp; -} - virtual int32_t* getAddrOfCaptureThreadGlobal( void** ppIndirection) { diff --git a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h index 62af74f3b874e9..93a42c707caacd 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h @@ -92,7 +92,6 @@ LWM(GetFunctionFixedEntryPoint, DWORDLONG, Agnostic_CORINFO_CONST_LOOKUP) LWM(GetGSCookie, DWORD, DLDL) LWM(GetHelperFtn, DWORD, DLDL) LWM(GetHFAType, DWORDLONG, DWORD) -LWM(GetInlinedCallFrameVptr, DWORD, DLDL) LWM(GetIntConfigValue, Agnostic_ConfigIntInfo, DWORD) LWM(GetJitFlags, DWORD, DD) LWM(GetJitTimeLogFilename, DWORD, DWORD) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp index 69473dd6a391c9..87a3470fdfd8ed 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp @@ -4583,36 +4583,6 @@ DWORD MethodContext::repGetThreadTLSIndex(void** ppIndirection) return (DWORD)value.B; } -void MethodContext::recGetInlinedCallFrameVptr(void** ppIndirection, const void* result) -{ - if (GetInlinedCallFrameVptr == nullptr) - GetInlinedCallFrameVptr = new LightWeightMap(); - - DLDL value; - - if (ppIndirection != nullptr) - value.A = CastPointer(*ppIndirection); - else - value.A = 0; - value.B = CastPointer(result); - - GetInlinedCallFrameVptr->Add(0, value); -} -void MethodContext::dmpGetInlinedCallFrameVptr(DWORD key, DLDL value) -{ - printf("GetInlinedCallFrameVptr key 0, value ppIndirection-%016" PRIX64 " result-%016" PRIX64 "", value.A, value.B); -} -const void* MethodContext::repGetInlinedCallFrameVptr(void** ppIndirection) -{ - DLDL value = LookupByKeyOrMissNoMessage(GetInlinedCallFrameVptr, 0); - - DEBUG_REP(dmpGetInlinedCallFrameVptr(0, value)); - - if (ppIndirection != nullptr) - *ppIndirection = (void*)value.A; - return (const void*)value.B; -} - void MethodContext::recGetAddrOfCaptureThreadGlobal(void** ppIndirection, int32_t* result) { if (GetAddrOfCaptureThreadGlobal == nullptr) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h index 960ce62184b41d..61ec6fa7d71f9b 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h @@ -578,10 +578,6 @@ class MethodContext void dmpGetThreadTLSIndex(DWORD key, DLD value); DWORD repGetThreadTLSIndex(void** ppIndirection); - void recGetInlinedCallFrameVptr(void** ppIndirection, const void* result); - void dmpGetInlinedCallFrameVptr(DWORD key, DLDL value); - const void* repGetInlinedCallFrameVptr(void** ppIndirection); - void recGetAddrOfCaptureThreadGlobal(void** ppIndirection, int32_t* result); void dmpGetAddrOfCaptureThreadGlobal(DWORD key, DLDL value); int32_t* repGetAddrOfCaptureThreadGlobal(void** ppIndirection); @@ -1003,7 +999,7 @@ enum mcPackets Packet_GetFunctionFixedEntryPoint = 61, Packet_GetGSCookie = 62, Packet_GetHelperFtn = 63, - Packet_GetInlinedCallFrameVptr = 65, + //Packet_GetInlinedCallFrameVptr = 65, Packet_GetArrayIntrinsicID = 66, Packet_GetJitTimeLogFilename = 67, Packet_GetJustMyCodeHandle = 68, diff --git a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp index c2ec78985a9b1f..a6ba034fbce2ff 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp @@ -1400,14 +1400,6 @@ uint32_t interceptor_ICJI::getThreadTLSIndex(void** ppIndirection) return temp; } -const void* interceptor_ICJI::getInlinedCallFrameVptr(void** ppIndirection) -{ - mc->cr->AddCall("getInlinedCallFrameVptr"); - const void* temp = original_ICorJitInfo->getInlinedCallFrameVptr(ppIndirection); - mc->recGetInlinedCallFrameVptr(ppIndirection, temp); - return temp; -} - int32_t* interceptor_ICJI::getAddrOfCaptureThreadGlobal(void** ppIndirection) { mc->cr->AddCall("getAddrOfCaptureThreadGlobal"); diff --git a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp index 89817d9b645944..d3d0ce6695333b 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp @@ -991,13 +991,6 @@ uint32_t interceptor_ICJI::getThreadTLSIndex( return original_ICorJitInfo->getThreadTLSIndex(ppIndirection); } -const void* interceptor_ICJI::getInlinedCallFrameVptr( - void** ppIndirection) -{ - mcs->AddCall("getInlinedCallFrameVptr"); - return original_ICorJitInfo->getInlinedCallFrameVptr(ppIndirection); -} - int32_t* interceptor_ICJI::getAddrOfCaptureThreadGlobal( void** ppIndirection) { diff --git a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp index a886276bd17ea6..0fd155fa62204b 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp @@ -868,12 +868,6 @@ uint32_t interceptor_ICJI::getThreadTLSIndex( return original_ICorJitInfo->getThreadTLSIndex(ppIndirection); } -const void* interceptor_ICJI::getInlinedCallFrameVptr( - void** ppIndirection) -{ - return original_ICorJitInfo->getInlinedCallFrameVptr(ppIndirection); -} - int32_t* interceptor_ICJI::getAddrOfCaptureThreadGlobal( void** ppIndirection) { diff --git a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp index eea9865fe8f24e..b3a2d7deed3806 100644 --- a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp @@ -1212,12 +1212,6 @@ uint32_t MyICJI::getThreadTLSIndex(void** ppIndirection) return jitInstance->mc->repGetThreadTLSIndex(ppIndirection); } -const void* MyICJI::getInlinedCallFrameVptr(void** ppIndirection) -{ - jitInstance->mc->cr->AddCall("getInlinedCallFrameVptr"); - return jitInstance->mc->repGetInlinedCallFrameVptr(ppIndirection); -} - int32_t* MyICJI::getAddrOfCaptureThreadGlobal(void** ppIndirection) { jitInstance->mc->cr->AddCall("getAddrOfCaptureThreadGlobal"); diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index 58936f0b418ac0..d148c0ce10bbd0 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -10188,27 +10188,6 @@ uint32_t CEEInfo::getThreadTLSIndex(void **ppIndirection) return result; } -const void * CEEInfo::getInlinedCallFrameVptr(void **ppIndirection) -{ - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - MODE_PREEMPTIVE; - } CONTRACTL_END; - - void * result = NULL; - - if (ppIndirection != NULL) - *ppIndirection = NULL; - - JIT_TO_EE_TRANSITION_LEAF(); - - result = (void*)InlinedCallFrame::GetMethodFrameVPtr(); - - EE_TO_JIT_TRANSITION_LEAF(); - - return result; -} int32_t * CEEInfo::getAddrOfCaptureThreadGlobal(void **ppIndirection) { From 474971035e556a7179f7103efc553cd9c130fa98 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Thu, 15 Jun 2023 16:37:25 -0700 Subject: [PATCH 08/16] Remove canAccessFamily --- src/coreclr/inc/corinfo.h | 3 - src/coreclr/inc/icorjitinfoimpl_generated.h | 4 - src/coreclr/jit/ICorJitInfo_names_generated.h | 1 - .../jit/ICorJitInfo_wrapper_generated.hpp | 10 -- .../tools/Common/JitInterface/CorInfoImpl.cs | 2 - .../JitInterface/CorInfoImpl_generated.cs | 82 ++++----- .../ThunkGenerator/ThunkInput.txt | 1 - .../aot/jitinterface/jitinterface_generated.h | 11 -- .../tools/superpmi/superpmi-shared/lwmlist.h | 1 - .../superpmi-shared/methodcontext.cpp | 31 ---- .../superpmi/superpmi-shared/methodcontext.h | 6 +- .../superpmi-shim-collector/icorjitinfo.cpp | 8 - .../icorjitinfo_generated.cpp | 8 - .../icorjitinfo_generated.cpp | 7 - .../tools/superpmi/superpmi/icorjitinfo.cpp | 6 - src/coreclr/vm/clsload.cpp | 162 ------------------ src/coreclr/vm/clsload.hpp | 4 - src/coreclr/vm/jitinterface.cpp | 46 ----- 18 files changed, 34 insertions(+), 359 deletions(-) diff --git a/src/coreclr/inc/corinfo.h b/src/coreclr/inc/corinfo.h index 55b1ca44a20980..5567f8eea4e140 100644 --- a/src/coreclr/inc/corinfo.h +++ b/src/coreclr/inc/corinfo.h @@ -3123,9 +3123,6 @@ class ICorDynamicInfo : public ICorStaticInfo CORINFO_CALL_INFO *pResult ) = 0; - virtual bool canAccessFamily(CORINFO_METHOD_HANDLE hCaller, - CORINFO_CLASS_HANDLE hInstanceType) = 0; - // Returns TRUE if the Class Domain ID is the RID of the class (currently true for every class // except reflection emitted classes and generics) virtual bool isRIDClassDomainID(CORINFO_CLASS_HANDLE cls) = 0; diff --git a/src/coreclr/inc/icorjitinfoimpl_generated.h b/src/coreclr/inc/icorjitinfoimpl_generated.h index 42f4271a38f691..e05db0e4d78835 100644 --- a/src/coreclr/inc/icorjitinfoimpl_generated.h +++ b/src/coreclr/inc/icorjitinfoimpl_generated.h @@ -584,10 +584,6 @@ void getCallInfo( CORINFO_CALLINFO_FLAGS flags, CORINFO_CALL_INFO* pResult) override; -bool canAccessFamily( - CORINFO_METHOD_HANDLE hCaller, - CORINFO_CLASS_HANDLE hInstanceType) override; - bool isRIDClassDomainID( CORINFO_CLASS_HANDLE cls) override; diff --git a/src/coreclr/jit/ICorJitInfo_names_generated.h b/src/coreclr/jit/ICorJitInfo_names_generated.h index 6be25450829210..a6c484eed596b8 100644 --- a/src/coreclr/jit/ICorJitInfo_names_generated.h +++ b/src/coreclr/jit/ICorJitInfo_names_generated.h @@ -145,7 +145,6 @@ DEF_CLR_API(canGetCookieForPInvokeCalliSig) DEF_CLR_API(getJustMyCodeHandle) DEF_CLR_API(GetProfilingHandle) DEF_CLR_API(getCallInfo) -DEF_CLR_API(canAccessFamily) DEF_CLR_API(isRIDClassDomainID) DEF_CLR_API(getClassDomainID) DEF_CLR_API(getStaticFieldContent) diff --git a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp index 26d3cab0f4aae3..7ad182c9201fe4 100644 --- a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp +++ b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp @@ -1388,16 +1388,6 @@ void WrapICorJitInfo::getCallInfo( API_LEAVE(getCallInfo); } -bool WrapICorJitInfo::canAccessFamily( - CORINFO_METHOD_HANDLE hCaller, - CORINFO_CLASS_HANDLE hInstanceType) -{ - API_ENTER(canAccessFamily); - bool temp = wrapHnd->canAccessFamily(hCaller, hInstanceType); - API_LEAVE(canAccessFamily); - return temp; -} - bool WrapICorJitInfo::isRIDClassDomainID( CORINFO_CLASS_HANDLE cls) { diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs index 41c2ae5eb7a14f..57589256c87d12 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs @@ -3307,8 +3307,6 @@ private CORINFO_CONST_LOOKUP CreateConstLookupToSymbol(ISymbolNode symbol) return constLookup; } - private bool canAccessFamily(CORINFO_METHOD_STRUCT_* hCaller, CORINFO_CLASS_STRUCT_* hInstanceType) - { throw new NotImplementedException("canAccessFamily"); } private bool isRIDClassDomainID(CORINFO_CLASS_STRUCT_* cls) { throw new NotImplementedException("isRIDClassDomainID"); } private uint getClassDomainID(CORINFO_CLASS_STRUCT_* cls, ref void* ppIndirection) diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs index 3f9f0f4ea9e479..2111e98f2a40c3 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs @@ -2094,21 +2094,6 @@ private static void _getCallInfo(IntPtr thisHandle, IntPtr* ppException, CORINFO } } - [UnmanagedCallersOnly] - private static byte _canAccessFamily(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* hCaller, CORINFO_CLASS_STRUCT_* hInstanceType) - { - var _this = GetThis(thisHandle); - try - { - return _this.canAccessFamily(hCaller, hInstanceType) ? (byte)1 : (byte)0; - } - catch (Exception ex) - { - *ppException = _this.AllocException(ex); - return default; - } - } - [UnmanagedCallersOnly] private static byte _isRIDClassDomainID(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { @@ -2582,7 +2567,7 @@ private static uint _getJitFlags(IntPtr thisHandle, IntPtr* ppException, CORJIT_ private static IntPtr GetUnmanagedCallbacks() { - void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 174); + void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 173); callbacks[0] = (delegate* unmanaged)&_isIntrinsic; callbacks[1] = (delegate* unmanaged)&_getMethodAttribs; @@ -2725,39 +2710,38 @@ private static IntPtr GetUnmanagedCallbacks() callbacks[138] = (delegate* unmanaged)&_getJustMyCodeHandle; callbacks[139] = (delegate* unmanaged)&_GetProfilingHandle; callbacks[140] = (delegate* unmanaged)&_getCallInfo; - callbacks[141] = (delegate* unmanaged)&_canAccessFamily; - callbacks[142] = (delegate* unmanaged)&_isRIDClassDomainID; - callbacks[143] = (delegate* unmanaged)&_getClassDomainID; - callbacks[144] = (delegate* unmanaged)&_getStaticFieldContent; - callbacks[145] = (delegate* unmanaged)&_getObjectContent; - callbacks[146] = (delegate* unmanaged)&_getStaticFieldCurrentClass; - callbacks[147] = (delegate* unmanaged)&_getVarArgsHandle; - callbacks[148] = (delegate* unmanaged)&_canGetVarArgsHandle; - callbacks[149] = (delegate* unmanaged)&_constructStringLiteral; - callbacks[150] = (delegate* unmanaged)&_emptyStringLiteral; - callbacks[151] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; - callbacks[152] = (delegate* unmanaged)&_GetDelegateCtor; - callbacks[153] = (delegate* unmanaged)&_MethodCompileComplete; - callbacks[154] = (delegate* unmanaged)&_getTailCallHelpers; - callbacks[155] = (delegate* unmanaged)&_convertPInvokeCalliToCall; - callbacks[156] = (delegate* unmanaged)&_notifyInstructionSetUsage; - callbacks[157] = (delegate* unmanaged)&_updateEntryPointForTailCall; - callbacks[158] = (delegate* unmanaged)&_allocMem; - callbacks[159] = (delegate* unmanaged)&_reserveUnwindInfo; - callbacks[160] = (delegate* unmanaged)&_allocUnwindInfo; - callbacks[161] = (delegate* unmanaged)&_allocGCInfo; - callbacks[162] = (delegate* unmanaged)&_setEHcount; - callbacks[163] = (delegate* unmanaged)&_setEHinfo; - callbacks[164] = (delegate* unmanaged)&_logMsg; - callbacks[165] = (delegate* unmanaged)&_doAssert; - callbacks[166] = (delegate* unmanaged)&_reportFatalError; - callbacks[167] = (delegate* unmanaged)&_getPgoInstrumentationResults; - callbacks[168] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; - callbacks[169] = (delegate* unmanaged)&_recordCallSite; - callbacks[170] = (delegate* unmanaged)&_recordRelocation; - callbacks[171] = (delegate* unmanaged)&_getRelocTypeHint; - callbacks[172] = (delegate* unmanaged)&_getExpectedTargetArchitecture; - callbacks[173] = (delegate* unmanaged)&_getJitFlags; + callbacks[141] = (delegate* unmanaged)&_isRIDClassDomainID; + callbacks[142] = (delegate* unmanaged)&_getClassDomainID; + callbacks[143] = (delegate* unmanaged)&_getStaticFieldContent; + callbacks[144] = (delegate* unmanaged)&_getObjectContent; + callbacks[145] = (delegate* unmanaged)&_getStaticFieldCurrentClass; + callbacks[146] = (delegate* unmanaged)&_getVarArgsHandle; + callbacks[147] = (delegate* unmanaged)&_canGetVarArgsHandle; + callbacks[148] = (delegate* unmanaged)&_constructStringLiteral; + callbacks[149] = (delegate* unmanaged)&_emptyStringLiteral; + callbacks[150] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; + callbacks[151] = (delegate* unmanaged)&_GetDelegateCtor; + callbacks[152] = (delegate* unmanaged)&_MethodCompileComplete; + callbacks[153] = (delegate* unmanaged)&_getTailCallHelpers; + callbacks[154] = (delegate* unmanaged)&_convertPInvokeCalliToCall; + callbacks[155] = (delegate* unmanaged)&_notifyInstructionSetUsage; + callbacks[156] = (delegate* unmanaged)&_updateEntryPointForTailCall; + callbacks[157] = (delegate* unmanaged)&_allocMem; + callbacks[158] = (delegate* unmanaged)&_reserveUnwindInfo; + callbacks[159] = (delegate* unmanaged)&_allocUnwindInfo; + callbacks[160] = (delegate* unmanaged)&_allocGCInfo; + callbacks[161] = (delegate* unmanaged)&_setEHcount; + callbacks[162] = (delegate* unmanaged)&_setEHinfo; + callbacks[163] = (delegate* unmanaged)&_logMsg; + callbacks[164] = (delegate* unmanaged)&_doAssert; + callbacks[165] = (delegate* unmanaged)&_reportFatalError; + callbacks[166] = (delegate* unmanaged)&_getPgoInstrumentationResults; + callbacks[167] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; + callbacks[168] = (delegate* unmanaged)&_recordCallSite; + callbacks[169] = (delegate* unmanaged)&_recordRelocation; + callbacks[170] = (delegate* unmanaged)&_getRelocTypeHint; + callbacks[171] = (delegate* unmanaged)&_getExpectedTargetArchitecture; + callbacks[172] = (delegate* unmanaged)&_getJitFlags; return (IntPtr)callbacks; } diff --git a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt index c410d7f15c75e2..28520361418efc 100644 --- a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt +++ b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt @@ -300,7 +300,6 @@ FUNCTIONS CORINFO_JUST_MY_CODE_HANDLE getJustMyCodeHandle(CORINFO_METHOD_HANDLE method, CORINFO_JUST_MY_CODE_HANDLE**ppIndirection); void GetProfilingHandle(bool* pbHookFunction, void **pProfilerHandle, bool* pbIndirectedHandles); void getCallInfo(CORINFO_RESOLVED_TOKEN * pResolvedToken, CORINFO_RESOLVED_TOKEN_PTR pConstrainedResolvedToken, CORINFO_METHOD_HANDLE callerHandle, CORINFO_CALLINFO_FLAGS flags, CORINFO_CALL_INFO *pResult); - bool canAccessFamily(CORINFO_METHOD_HANDLE hCaller, CORINFO_CLASS_HANDLE hInstanceType); bool isRIDClassDomainID(CORINFO_CLASS_HANDLE cls); unsigned getClassDomainID (CORINFO_CLASS_HANDLE cls, void **ppIndirection); bool getStaticFieldContent(CORINFO_FIELD_HANDLE field, uint8_t *buffer, int bufferSize, int valueOffset, bool ignoreMovableObjects); diff --git a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h index a3ca67749a2b1a..2facb114b800e0 100644 --- a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h +++ b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h @@ -152,7 +152,6 @@ struct JitInterfaceCallbacks CORINFO_JUST_MY_CODE_HANDLE (* getJustMyCodeHandle)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE method, CORINFO_JUST_MY_CODE_HANDLE** ppIndirection); void (* GetProfilingHandle)(void * thisHandle, CorInfoExceptionClass** ppException, bool* pbHookFunction, void** pProfilerHandle, bool* pbIndirectedHandles); void (* getCallInfo)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken, CORINFO_METHOD_HANDLE callerHandle, CORINFO_CALLINFO_FLAGS flags, CORINFO_CALL_INFO* pResult); - bool (* canAccessFamily)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE hCaller, CORINFO_CLASS_HANDLE hInstanceType); bool (* isRIDClassDomainID)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE cls); unsigned (* getClassDomainID)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE cls, void** ppIndirection); bool (* getStaticFieldContent)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_FIELD_HANDLE field, uint8_t* buffer, int bufferSize, int valueOffset, bool ignoreMovableObjects); @@ -1564,16 +1563,6 @@ class JitInterfaceWrapper : public ICorJitInfo if (pException != nullptr) throw pException; } - virtual bool canAccessFamily( - CORINFO_METHOD_HANDLE hCaller, - CORINFO_CLASS_HANDLE hInstanceType) -{ - CorInfoExceptionClass* pException = nullptr; - bool temp = _callbacks->canAccessFamily(_thisHandle, &pException, hCaller, hInstanceType); - if (pException != nullptr) throw pException; - return temp; -} - virtual bool isRIDClassDomainID( CORINFO_CLASS_HANDLE cls) { diff --git a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h index 93a42c707caacd..baa12af9dd6a37 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h @@ -20,7 +20,6 @@ LWM(AllocPgoInstrumentationBySchema, DWORDLONG, Agnostic_AllocPgoInstrumentation LWM(GetPgoInstrumentationResults, DWORDLONG, Agnostic_GetPgoInstrumentationResults) LWM(AsCorInfoType, DWORDLONG, DWORD) LWM(CanAccessClass, Agnostic_CanAccessClassIn, Agnostic_CanAccessClassOut) -LWM(CanAccessFamily, DLDL, DWORD) LWM(CanCast, DLDL, DWORD) LWM(CanGetCookieForPInvokeCalliSig, CanGetCookieForPInvokeCalliSigValue, DWORD) LWM(CanGetVarArgsHandle, CanGetVarArgsHandleValue, DWORD) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp index 87a3470fdfd8ed..e161046f6d9670 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp @@ -5897,37 +5897,6 @@ bool MethodContext::repCanGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSi return value != 0; } -void MethodContext::recCanAccessFamily(CORINFO_METHOD_HANDLE hCaller, CORINFO_CLASS_HANDLE hInstanceType, bool result) -{ - if (CanAccessFamily == nullptr) - CanAccessFamily = new LightWeightMap(); - - DLDL key; - ZeroMemory(&key, sizeof(key)); // Zero key including any struct padding - key.A = CastHandle(hCaller); - key.B = CastHandle(hInstanceType); - - DWORD value = result ? 1 : 0; - CanAccessFamily->Add(key, value); - DEBUG_REC(dmpCanAccessFamily(key, value)); -} -void MethodContext::dmpCanAccessFamily(DLDL key, DWORD value) -{ - printf("CanAccessFamily key cal-%016" PRIX64 " inst-%016" PRIX64 ", value %u", key.A, key.B, value); -} -bool MethodContext::repCanAccessFamily(CORINFO_METHOD_HANDLE hCaller, CORINFO_CLASS_HANDLE hInstanceType) -{ - DLDL key; - ZeroMemory(&key, sizeof(key)); // Zero key including any struct padding - key.A = CastHandle(hCaller); - key.B = CastHandle(hInstanceType); - - DWORD value = LookupByKeyOrMissNoMessage(CanAccessFamily, key); - - DEBUG_REP(dmpCanAccessFamily(key, value)); - return value != 0; -} - void MethodContext::recErrorList(const char* error) { if (ErrorList == nullptr) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h index 61ec6fa7d71f9b..7c92f5f1585e90 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h @@ -722,10 +722,6 @@ class MethodContext void dmpCanGetCookieForPInvokeCalliSig(const CanGetCookieForPInvokeCalliSigValue& key, DWORD value); bool repCanGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig); - void recCanAccessFamily(CORINFO_METHOD_HANDLE hCaller, CORINFO_CLASS_HANDLE hInstanceType, bool result); - void dmpCanAccessFamily(DLDL key, DWORD value); - bool repCanAccessFamily(CORINFO_METHOD_HANDLE hCaller, CORINFO_CLASS_HANDLE hInstanceType); - void recErrorList(const char* error); void dmpErrorList(DWORD key, DWORD value); @@ -940,7 +936,7 @@ enum mcPackets //Packet_AreTypesEquivalent = 1, Packet_AsCorInfoType = 2, Packet_CanAccessClass = 3, - Packet_CanAccessFamily = 4, + //Packet_CanAccessFamily = 4, Packet_CanCast = 5, Packet_PrintMethodName = 6, Packet_CanGetCookieForPInvokeCalliSig = 7, diff --git a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp index a6ba034fbce2ff..a39f89021584f4 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp @@ -1604,14 +1604,6 @@ void interceptor_ICJI::getCallInfo( }); } -bool interceptor_ICJI::canAccessFamily(CORINFO_METHOD_HANDLE hCaller, CORINFO_CLASS_HANDLE hInstanceType) -{ - mc->cr->AddCall("canAccessFamily"); - bool temp = original_ICorJitInfo->canAccessFamily(hCaller, hInstanceType); - mc->recCanAccessFamily(hCaller, hInstanceType, temp); - return temp; -} - // Returns TRUE if the Class Domain ID is the RID of the class (currently true for every class // except reflection emitted classes and generics) bool interceptor_ICJI::isRIDClassDomainID(CORINFO_CLASS_HANDLE cls) diff --git a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp index d3d0ce6695333b..1ea99c6d212db5 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp @@ -1139,14 +1139,6 @@ void interceptor_ICJI::getCallInfo( original_ICorJitInfo->getCallInfo(pResolvedToken, pConstrainedResolvedToken, callerHandle, flags, pResult); } -bool interceptor_ICJI::canAccessFamily( - CORINFO_METHOD_HANDLE hCaller, - CORINFO_CLASS_HANDLE hInstanceType) -{ - mcs->AddCall("canAccessFamily"); - return original_ICorJitInfo->canAccessFamily(hCaller, hInstanceType); -} - bool interceptor_ICJI::isRIDClassDomainID( CORINFO_CLASS_HANDLE cls) { diff --git a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp index 0fd155fa62204b..de7ee6b3b4dc6d 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp @@ -998,13 +998,6 @@ void interceptor_ICJI::getCallInfo( original_ICorJitInfo->getCallInfo(pResolvedToken, pConstrainedResolvedToken, callerHandle, flags, pResult); } -bool interceptor_ICJI::canAccessFamily( - CORINFO_METHOD_HANDLE hCaller, - CORINFO_CLASS_HANDLE hInstanceType) -{ - return original_ICorJitInfo->canAccessFamily(hCaller, hInstanceType); -} - bool interceptor_ICJI::isRIDClassDomainID( CORINFO_CLASS_HANDLE cls) { diff --git a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp index b3a2d7deed3806..92519cca3aae36 100644 --- a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp @@ -1385,12 +1385,6 @@ void MyICJI::getCallInfo( ThrowException(exceptionCode); } -bool MyICJI::canAccessFamily(CORINFO_METHOD_HANDLE hCaller, CORINFO_CLASS_HANDLE hInstanceType) - -{ - jitInstance->mc->cr->AddCall("canAccessFamily"); - return jitInstance->mc->repCanAccessFamily(hCaller, hInstanceType); -} // Returns TRUE if the Class Domain ID is the RID of the class (currently true for every class // except reflection emitted classes and generics) bool MyICJI::isRIDClassDomainID(CORINFO_CLASS_HANDLE cls) diff --git a/src/coreclr/vm/clsload.cpp b/src/coreclr/vm/clsload.cpp index 792e640accaf51..06775e004629d6 100644 --- a/src/coreclr/vm/clsload.cpp +++ b/src/coreclr/vm/clsload.cpp @@ -4971,168 +4971,6 @@ BOOL ClassLoader::CanAccessFamily( return FALSE; } -//If instance is an inner class, this also succeeds if the outer class conforms to 8.5.3.2. A nested class -//is enclosed inside of the enclosing class' open type. So we need to ignore generic variables. That also -//helps us with: -/* -class Base { - protected int m_family; -} -class Derived : Base { - class Inner { - public int function(Derived d) { - return d.m_family; - } - } -} -*/ - -//Since the inner T is not the same T as the enclosing T (since accessing generic variables is a CLS rule, -//not a CLI rule), we see that as a comparison between Derived and Derived. CanCastTo rejects that. -//Instead we just check against the typedef of the two types. This ignores all generic parameters (formal -//or not). - -BOOL CanAccessFamilyVerificationEnclosingHelper(MethodTable * pMTCurrentEnclosingClass, - TypeHandle thInstanceClass) -{ - CONTRACTL - { - THROWS; - GC_TRIGGERS; - MODE_ANY; - } - CONTRACTL_END - - _ASSERTE(pMTCurrentEnclosingClass); - - if (thInstanceClass.IsGenericVariable()) - { - //In this case it is a TypeVarTypeDesc (i.e. T). If this access would be legal due to a - //constraint: - // - /* - public class My - { - public class Inner where U : My - { - public int foo(U u) - { - return u.field; - } - } - protected int field; - } - */ - //We need to find the generic class constraint. (The above is legal because U must be a My which makes this - //legal by 8.5.3.2) - // There may only be 1 class constraint on a generic parameter - - // Get the constraints on this generic variable - // At most 1 of them is a class constraint. - // That class constraint methodtable can go through the normal search for matching typedef logic below - TypeVarTypeDesc *tyvar = thInstanceClass.AsGenericVariable(); - DWORD numConstraints; - TypeHandle *constraints = tyvar->GetConstraints(&numConstraints, CLASS_DEPENDENCIES_LOADED); - if (constraints == NULL) - { - // If we did not find a class constraint, we cannot generate a methodtable to search for - return FALSE; - } - else - { - for (DWORD i = 0; i < numConstraints; i++) - { - if (!constraints[i].IsInterface()) - { - // We have found the class constraint on this TypeVarTypeDesc - // Recurse on the found class constraint. It is possible that this constraint may also be a TypeVarTypeDesc -//class Outer4 -//{ -// protected int field; -// -// public class Inner where V:U where U : Outer4 -// { -// public int Method(V param) { return (++param.field); } -// } -//} - return CanAccessFamilyVerificationEnclosingHelper(pMTCurrentEnclosingClass, constraints[i]); - } - } - // If we did not find a class constraint, we cannot generate a methodtable to search for - return FALSE; - } - } - do - { - MethodTable * pAccessor = pMTCurrentEnclosingClass; - //If thInstanceClass is a MethodTable, we should only be doing the TypeDef comparison (see - //above). - if (!thInstanceClass.IsTypeDesc()) - { - MethodTable *pInstanceMT = thInstanceClass.AsMethodTable(); - - // This is a CanCastTo implementation for classes, assuming we should ignore generic instantiation parameters. - do - { - if (pAccessor->HasSameTypeDefAs(pInstanceMT)) - return TRUE; - pInstanceMT = pInstanceMT->GetParentMethodTable(); - }while(pInstanceMT); - } - else - { - // Leave this logic in place for now, as I'm not fully confident it can't happen, and we are very close to RTM - // This logic was originally written to handle TypeVarTypeDescs, but those are now handled above. - _ASSERTE(FALSE); - if (thInstanceClass.CanCastTo(TypeHandle(pAccessor))) - return TRUE; - } - - pMTCurrentEnclosingClass = GetEnclosingMethodTable(pMTCurrentEnclosingClass); - }while(pMTCurrentEnclosingClass); - return FALSE; -} - - -//This checks the verification only part of the rule above. -//From the example above: -// GrandChild::function2(Child * o) { -// o->protectedField; //This access is illegal. -// } -// pCurrentClass is GrandChild and pTargetClass is Child. This check is completely unnecessary for statics, -// but by legacy convention you can use GrandChild for pTargetClass in that case. - -BOOL ClassLoader::CanAccessFamilyVerification(TypeHandle thCurrentClass, - TypeHandle thInstanceClass) -{ - CONTRACTL - { - THROWS; - GC_TRIGGERS; - INJECT_FAULT(COMPlusThrowOM();); - MODE_ANY; - PRECONDITION(!thCurrentClass.IsNull()); - PRECONDITION(!thCurrentClass.IsTypeDesc()); - } - CONTRACTL_END - - //Check to see if Instance is equal to or derived from pCurrentClass. - // - //In some cases the type we have for the instance type is actually a TypeVarTypeDesc. In those cases we - //need to check against the constraints (You're accessing a member through a 'T' with a type constraint - //that makes this legal). For those cases, CanCastTo does what I want. - MethodTable * pAccessor = thCurrentClass.GetMethodTable(); - if (thInstanceClass.CanCastTo(TypeHandle(pAccessor))) - return TRUE; - - //TypeDescs don't have methods so only run this on MethodTables. - if (!thInstanceClass.IsNull()) - { - return CanAccessFamilyVerificationEnclosingHelper(pAccessor, thInstanceClass); - } - return FALSE; -} - #endif // #ifndef DACCESS_COMPILE #ifdef DACCESS_COMPILE diff --git a/src/coreclr/vm/clsload.hpp b/src/coreclr/vm/clsload.hpp index 6016e88d2cea73..fd2aabe3801ed1 100644 --- a/src/coreclr/vm/clsload.hpp +++ b/src/coreclr/vm/clsload.hpp @@ -847,10 +847,6 @@ class ClassLoader FieldDesc* pOptionalTargetField, const AccessCheckOptions & accessCheckOptions = *AccessCheckOptions::s_pNormalAccessChecks); - static BOOL CanAccessFamilyVerification( - TypeHandle thCurrentClass, - TypeHandle thInstanceClass); - private: // Access check helpers static BOOL CanAccessMethodInstantiation( diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index d148c0ce10bbd0..516e9400dbaab9 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -5573,52 +5573,6 @@ void CEEInfo::getCallInfo( EE_TO_JIT_TRANSITION(); } -bool CEEInfo::canAccessFamily(CORINFO_METHOD_HANDLE hCaller, - CORINFO_CLASS_HANDLE hInstanceType) -{ - WRAPPER_NO_CONTRACT; - - bool ret = false; - - //Since this is only for verification, I don't need to do the demand. - JIT_TO_EE_TRANSITION(); - - TypeHandle targetType = TypeHandle(hInstanceType); - TypeHandle accessingType = TypeHandle(GetMethod(hCaller)->GetMethodTable()); - AccessCheckOptions::AccessCheckType accessCheckOptions = AccessCheckOptions::kNormalAccessibilityChecks; - DynamicResolver* pIgnored; - BOOL doCheck = TRUE; - if (GetMethod(hCaller)->IsDynamicMethod()) - { - //If this is a DynamicMethod, perform the check from the type to which the DynamicMethod was - //attached. - // - //If this is a dynamic method, don't do this check. If they specified SkipVisibilityChecks - //(ModifyCheckForDynamicMethod returned false), we should obviously skip the check for the C++ - //protected rule (since we skipped all the other visibility checks). If they specified - //RestrictedSkipVisibilityChecks, then they're a "free" DynamicMethod. This check is meaningless - //(i.e. it would always fail). We've already done a demand for access to the member. Let that be - //enough. - doCheck = ModifyCheckForDynamicMethod(GetMethod(hCaller)->AsDynamicMethodDesc()->GetResolver(), - &accessingType, &accessCheckOptions, &pIgnored); - if (accessCheckOptions == AccessCheckOptions::kRestrictedMemberAccess - || accessCheckOptions == AccessCheckOptions::kRestrictedMemberAccessNoTransparency - ) - doCheck = FALSE; - } - - if (doCheck) - { - ret = !!ClassLoader::CanAccessFamilyVerification(accessingType, targetType); - } - else - { - ret = true; - } - - EE_TO_JIT_TRANSITION(); - return ret; -} bool CEEInfo::isRIDClassDomainID(CORINFO_CLASS_HANDLE cls) { From 84df56578f46a2ecf0765d5dcdeb8d58c0cbb64a Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Thu, 15 Jun 2023 16:43:30 -0700 Subject: [PATCH 09/16] Remove isRIDClassDomainID --- src/coreclr/inc/corinfo.h | 4 - src/coreclr/inc/icorjitinfoimpl_generated.h | 3 - src/coreclr/jit/ICorJitInfo_names_generated.h | 1 - .../jit/ICorJitInfo_wrapper_generated.hpp | 9 --- .../tools/Common/JitInterface/CorInfoImpl.cs | 2 - .../JitInterface/CorInfoImpl_generated.cs | 80 ++++++++----------- .../ThunkGenerator/ThunkInput.txt | 1 - .../aot/jitinterface/jitinterface_generated.h | 10 --- .../superpmi-shim-collector/icorjitinfo.cpp | 8 -- .../icorjitinfo_generated.cpp | 7 -- .../icorjitinfo_generated.cpp | 6 -- .../tools/superpmi/superpmi/icorjitinfo.cpp | 10 --- src/coreclr/vm/jitinterface.cpp | 22 ----- 13 files changed, 32 insertions(+), 131 deletions(-) diff --git a/src/coreclr/inc/corinfo.h b/src/coreclr/inc/corinfo.h index 5567f8eea4e140..266d9fe1d11b0b 100644 --- a/src/coreclr/inc/corinfo.h +++ b/src/coreclr/inc/corinfo.h @@ -3123,10 +3123,6 @@ class ICorDynamicInfo : public ICorStaticInfo CORINFO_CALL_INFO *pResult ) = 0; - // Returns TRUE if the Class Domain ID is the RID of the class (currently true for every class - // except reflection emitted classes and generics) - virtual bool isRIDClassDomainID(CORINFO_CLASS_HANDLE cls) = 0; - // returns the class's domain ID for accessing shared statics virtual unsigned getClassDomainID ( CORINFO_CLASS_HANDLE cls, diff --git a/src/coreclr/inc/icorjitinfoimpl_generated.h b/src/coreclr/inc/icorjitinfoimpl_generated.h index e05db0e4d78835..e48fc38e8f44da 100644 --- a/src/coreclr/inc/icorjitinfoimpl_generated.h +++ b/src/coreclr/inc/icorjitinfoimpl_generated.h @@ -584,9 +584,6 @@ void getCallInfo( CORINFO_CALLINFO_FLAGS flags, CORINFO_CALL_INFO* pResult) override; -bool isRIDClassDomainID( - CORINFO_CLASS_HANDLE cls) override; - unsigned getClassDomainID( CORINFO_CLASS_HANDLE cls, void** ppIndirection) override; diff --git a/src/coreclr/jit/ICorJitInfo_names_generated.h b/src/coreclr/jit/ICorJitInfo_names_generated.h index a6c484eed596b8..1fafc29e7f891f 100644 --- a/src/coreclr/jit/ICorJitInfo_names_generated.h +++ b/src/coreclr/jit/ICorJitInfo_names_generated.h @@ -145,7 +145,6 @@ DEF_CLR_API(canGetCookieForPInvokeCalliSig) DEF_CLR_API(getJustMyCodeHandle) DEF_CLR_API(GetProfilingHandle) DEF_CLR_API(getCallInfo) -DEF_CLR_API(isRIDClassDomainID) DEF_CLR_API(getClassDomainID) DEF_CLR_API(getStaticFieldContent) DEF_CLR_API(getObjectContent) diff --git a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp index 7ad182c9201fe4..4053a31acaad56 100644 --- a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp +++ b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp @@ -1388,15 +1388,6 @@ void WrapICorJitInfo::getCallInfo( API_LEAVE(getCallInfo); } -bool WrapICorJitInfo::isRIDClassDomainID( - CORINFO_CLASS_HANDLE cls) -{ - API_ENTER(isRIDClassDomainID); - bool temp = wrapHnd->isRIDClassDomainID(cls); - API_LEAVE(isRIDClassDomainID); - return temp; -} - unsigned WrapICorJitInfo::getClassDomainID( CORINFO_CLASS_HANDLE cls, void** ppIndirection) diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs index 57589256c87d12..1a874be369b5aa 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs @@ -3307,8 +3307,6 @@ private CORINFO_CONST_LOOKUP CreateConstLookupToSymbol(ISymbolNode symbol) return constLookup; } - private bool isRIDClassDomainID(CORINFO_CLASS_STRUCT_* cls) - { throw new NotImplementedException("isRIDClassDomainID"); } private uint getClassDomainID(CORINFO_CLASS_STRUCT_* cls, ref void* ppIndirection) { throw new NotImplementedException("getClassDomainID"); } diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs index 2111e98f2a40c3..191f52a38a2111 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs @@ -2094,21 +2094,6 @@ private static void _getCallInfo(IntPtr thisHandle, IntPtr* ppException, CORINFO } } - [UnmanagedCallersOnly] - private static byte _isRIDClassDomainID(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) - { - var _this = GetThis(thisHandle); - try - { - return _this.isRIDClassDomainID(cls) ? (byte)1 : (byte)0; - } - catch (Exception ex) - { - *ppException = _this.AllocException(ex); - return default; - } - } - [UnmanagedCallersOnly] private static uint _getClassDomainID(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, void** ppIndirection) { @@ -2567,7 +2552,7 @@ private static uint _getJitFlags(IntPtr thisHandle, IntPtr* ppException, CORJIT_ private static IntPtr GetUnmanagedCallbacks() { - void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 173); + void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 172); callbacks[0] = (delegate* unmanaged)&_isIntrinsic; callbacks[1] = (delegate* unmanaged)&_getMethodAttribs; @@ -2710,38 +2695,37 @@ private static IntPtr GetUnmanagedCallbacks() callbacks[138] = (delegate* unmanaged)&_getJustMyCodeHandle; callbacks[139] = (delegate* unmanaged)&_GetProfilingHandle; callbacks[140] = (delegate* unmanaged)&_getCallInfo; - callbacks[141] = (delegate* unmanaged)&_isRIDClassDomainID; - callbacks[142] = (delegate* unmanaged)&_getClassDomainID; - callbacks[143] = (delegate* unmanaged)&_getStaticFieldContent; - callbacks[144] = (delegate* unmanaged)&_getObjectContent; - callbacks[145] = (delegate* unmanaged)&_getStaticFieldCurrentClass; - callbacks[146] = (delegate* unmanaged)&_getVarArgsHandle; - callbacks[147] = (delegate* unmanaged)&_canGetVarArgsHandle; - callbacks[148] = (delegate* unmanaged)&_constructStringLiteral; - callbacks[149] = (delegate* unmanaged)&_emptyStringLiteral; - callbacks[150] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; - callbacks[151] = (delegate* unmanaged)&_GetDelegateCtor; - callbacks[152] = (delegate* unmanaged)&_MethodCompileComplete; - callbacks[153] = (delegate* unmanaged)&_getTailCallHelpers; - callbacks[154] = (delegate* unmanaged)&_convertPInvokeCalliToCall; - callbacks[155] = (delegate* unmanaged)&_notifyInstructionSetUsage; - callbacks[156] = (delegate* unmanaged)&_updateEntryPointForTailCall; - callbacks[157] = (delegate* unmanaged)&_allocMem; - callbacks[158] = (delegate* unmanaged)&_reserveUnwindInfo; - callbacks[159] = (delegate* unmanaged)&_allocUnwindInfo; - callbacks[160] = (delegate* unmanaged)&_allocGCInfo; - callbacks[161] = (delegate* unmanaged)&_setEHcount; - callbacks[162] = (delegate* unmanaged)&_setEHinfo; - callbacks[163] = (delegate* unmanaged)&_logMsg; - callbacks[164] = (delegate* unmanaged)&_doAssert; - callbacks[165] = (delegate* unmanaged)&_reportFatalError; - callbacks[166] = (delegate* unmanaged)&_getPgoInstrumentationResults; - callbacks[167] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; - callbacks[168] = (delegate* unmanaged)&_recordCallSite; - callbacks[169] = (delegate* unmanaged)&_recordRelocation; - callbacks[170] = (delegate* unmanaged)&_getRelocTypeHint; - callbacks[171] = (delegate* unmanaged)&_getExpectedTargetArchitecture; - callbacks[172] = (delegate* unmanaged)&_getJitFlags; + callbacks[141] = (delegate* unmanaged)&_getClassDomainID; + callbacks[142] = (delegate* unmanaged)&_getStaticFieldContent; + callbacks[143] = (delegate* unmanaged)&_getObjectContent; + callbacks[144] = (delegate* unmanaged)&_getStaticFieldCurrentClass; + callbacks[145] = (delegate* unmanaged)&_getVarArgsHandle; + callbacks[146] = (delegate* unmanaged)&_canGetVarArgsHandle; + callbacks[147] = (delegate* unmanaged)&_constructStringLiteral; + callbacks[148] = (delegate* unmanaged)&_emptyStringLiteral; + callbacks[149] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; + callbacks[150] = (delegate* unmanaged)&_GetDelegateCtor; + callbacks[151] = (delegate* unmanaged)&_MethodCompileComplete; + callbacks[152] = (delegate* unmanaged)&_getTailCallHelpers; + callbacks[153] = (delegate* unmanaged)&_convertPInvokeCalliToCall; + callbacks[154] = (delegate* unmanaged)&_notifyInstructionSetUsage; + callbacks[155] = (delegate* unmanaged)&_updateEntryPointForTailCall; + callbacks[156] = (delegate* unmanaged)&_allocMem; + callbacks[157] = (delegate* unmanaged)&_reserveUnwindInfo; + callbacks[158] = (delegate* unmanaged)&_allocUnwindInfo; + callbacks[159] = (delegate* unmanaged)&_allocGCInfo; + callbacks[160] = (delegate* unmanaged)&_setEHcount; + callbacks[161] = (delegate* unmanaged)&_setEHinfo; + callbacks[162] = (delegate* unmanaged)&_logMsg; + callbacks[163] = (delegate* unmanaged)&_doAssert; + callbacks[164] = (delegate* unmanaged)&_reportFatalError; + callbacks[165] = (delegate* unmanaged)&_getPgoInstrumentationResults; + callbacks[166] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; + callbacks[167] = (delegate* unmanaged)&_recordCallSite; + callbacks[168] = (delegate* unmanaged)&_recordRelocation; + callbacks[169] = (delegate* unmanaged)&_getRelocTypeHint; + callbacks[170] = (delegate* unmanaged)&_getExpectedTargetArchitecture; + callbacks[171] = (delegate* unmanaged)&_getJitFlags; return (IntPtr)callbacks; } diff --git a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt index 28520361418efc..5b00635a8fb633 100644 --- a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt +++ b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt @@ -300,7 +300,6 @@ FUNCTIONS CORINFO_JUST_MY_CODE_HANDLE getJustMyCodeHandle(CORINFO_METHOD_HANDLE method, CORINFO_JUST_MY_CODE_HANDLE**ppIndirection); void GetProfilingHandle(bool* pbHookFunction, void **pProfilerHandle, bool* pbIndirectedHandles); void getCallInfo(CORINFO_RESOLVED_TOKEN * pResolvedToken, CORINFO_RESOLVED_TOKEN_PTR pConstrainedResolvedToken, CORINFO_METHOD_HANDLE callerHandle, CORINFO_CALLINFO_FLAGS flags, CORINFO_CALL_INFO *pResult); - bool isRIDClassDomainID(CORINFO_CLASS_HANDLE cls); unsigned getClassDomainID (CORINFO_CLASS_HANDLE cls, void **ppIndirection); bool getStaticFieldContent(CORINFO_FIELD_HANDLE field, uint8_t *buffer, int bufferSize, int valueOffset, bool ignoreMovableObjects); bool getObjectContent(CORINFO_OBJECT_HANDLE obj, uint8_t *buffer, int bufferSize, int valueOffset); diff --git a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h index 2facb114b800e0..0f7af95ab6fe54 100644 --- a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h +++ b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h @@ -152,7 +152,6 @@ struct JitInterfaceCallbacks CORINFO_JUST_MY_CODE_HANDLE (* getJustMyCodeHandle)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE method, CORINFO_JUST_MY_CODE_HANDLE** ppIndirection); void (* GetProfilingHandle)(void * thisHandle, CorInfoExceptionClass** ppException, bool* pbHookFunction, void** pProfilerHandle, bool* pbIndirectedHandles); void (* getCallInfo)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken, CORINFO_METHOD_HANDLE callerHandle, CORINFO_CALLINFO_FLAGS flags, CORINFO_CALL_INFO* pResult); - bool (* isRIDClassDomainID)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE cls); unsigned (* getClassDomainID)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE cls, void** ppIndirection); bool (* getStaticFieldContent)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_FIELD_HANDLE field, uint8_t* buffer, int bufferSize, int valueOffset, bool ignoreMovableObjects); bool (* getObjectContent)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_OBJECT_HANDLE obj, uint8_t* buffer, int bufferSize, int valueOffset); @@ -1563,15 +1562,6 @@ class JitInterfaceWrapper : public ICorJitInfo if (pException != nullptr) throw pException; } - virtual bool isRIDClassDomainID( - CORINFO_CLASS_HANDLE cls) -{ - CorInfoExceptionClass* pException = nullptr; - bool temp = _callbacks->isRIDClassDomainID(_thisHandle, &pException, cls); - if (pException != nullptr) throw pException; - return temp; -} - virtual unsigned getClassDomainID( CORINFO_CLASS_HANDLE cls, void** ppIndirection) diff --git a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp index a39f89021584f4..59401af0c9909b 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp @@ -1604,14 +1604,6 @@ void interceptor_ICJI::getCallInfo( }); } -// Returns TRUE if the Class Domain ID is the RID of the class (currently true for every class -// except reflection emitted classes and generics) -bool interceptor_ICJI::isRIDClassDomainID(CORINFO_CLASS_HANDLE cls) -{ - mc->cr->AddCall("isRIDClassDomainID"); - return original_ICorJitInfo->isRIDClassDomainID(cls); -} - // returns the class's domain ID for accessing shared statics unsigned interceptor_ICJI::getClassDomainID(CORINFO_CLASS_HANDLE cls, void** ppIndirection) { diff --git a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp index 1ea99c6d212db5..8a1ee00a1bdfad 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp @@ -1139,13 +1139,6 @@ void interceptor_ICJI::getCallInfo( original_ICorJitInfo->getCallInfo(pResolvedToken, pConstrainedResolvedToken, callerHandle, flags, pResult); } -bool interceptor_ICJI::isRIDClassDomainID( - CORINFO_CLASS_HANDLE cls) -{ - mcs->AddCall("isRIDClassDomainID"); - return original_ICorJitInfo->isRIDClassDomainID(cls); -} - unsigned interceptor_ICJI::getClassDomainID( CORINFO_CLASS_HANDLE cls, void** ppIndirection) diff --git a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp index de7ee6b3b4dc6d..263513b027fe15 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp @@ -998,12 +998,6 @@ void interceptor_ICJI::getCallInfo( original_ICorJitInfo->getCallInfo(pResolvedToken, pConstrainedResolvedToken, callerHandle, flags, pResult); } -bool interceptor_ICJI::isRIDClassDomainID( - CORINFO_CLASS_HANDLE cls) -{ - return original_ICorJitInfo->isRIDClassDomainID(cls); -} - unsigned interceptor_ICJI::getClassDomainID( CORINFO_CLASS_HANDLE cls, void** ppIndirection) diff --git a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp index 92519cca3aae36..c82d930c21e23c 100644 --- a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp @@ -1385,16 +1385,6 @@ void MyICJI::getCallInfo( ThrowException(exceptionCode); } -// Returns TRUE if the Class Domain ID is the RID of the class (currently true for every class -// except reflection emitted classes and generics) -bool MyICJI::isRIDClassDomainID(CORINFO_CLASS_HANDLE cls) -{ - jitInstance->mc->cr->AddCall("isRIDClassDomainID"); - LogError("Hit unimplemented isRIDClassDomainID"); - DebugBreakorAV(107); - return false; -} - // returns the class's domain ID for accessing shared statics unsigned MyICJI::getClassDomainID(CORINFO_CLASS_HANDLE cls, void** ppIndirection) { diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index 516e9400dbaab9..3ddf67430d85f4 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -5574,28 +5574,6 @@ void CEEInfo::getCallInfo( } -bool CEEInfo::isRIDClassDomainID(CORINFO_CLASS_HANDLE cls) -{ - CONTRACTL { - THROWS; - GC_TRIGGERS; - MODE_PREEMPTIVE; - } CONTRACTL_END; - - bool result = FALSE; - - JIT_TO_EE_TRANSITION(); - - TypeHandle VMClsHnd(cls); - - result = !VMClsHnd.AsMethodTable()->IsDynamicStatics(); - - EE_TO_JIT_TRANSITION(); - - return result; -} - - /***********************************************************************/ unsigned CEEInfo::getClassDomainID (CORINFO_CLASS_HANDLE clsHnd, void **ppIndirection) From 1c198e5d0fb061d773c7b7c202af4ed81aef3f31 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Fri, 16 Jun 2023 10:14:43 -0700 Subject: [PATCH 10/16] Remove tryResolveToken --- src/coreclr/inc/corinfo.h | 6 - src/coreclr/inc/icorjitinfoimpl_generated.h | 3 - src/coreclr/jit/ICorJitInfo_names_generated.h | 1 - .../jit/ICorJitInfo_wrapper_generated.hpp | 9 - src/coreclr/jit/compiler.h | 4 +- src/coreclr/jit/ee_il_dll.cpp | 5 - .../tools/Common/JitInterface/CorInfoImpl.cs | 6 - .../JitInterface/CorInfoImpl_generated.cs | 302 +++++++++--------- .../ThunkGenerator/ThunkInput.txt | 1 - .../aot/jitinterface/jitinterface_generated.h | 10 - .../tools/superpmi/superpmi-shared/agnostic.h | 6 - .../tools/superpmi/superpmi-shared/lwmlist.h | 1 - .../superpmi-shared/methodcontext.cpp | 36 --- .../superpmi/superpmi-shared/methodcontext.h | 6 +- .../superpmi-shim-collector/icorjitinfo.cpp | 8 - .../icorjitinfo_generated.cpp | 7 - .../icorjitinfo_generated.cpp | 6 - .../tools/superpmi/superpmi/icorjitinfo.cpp | 7 - src/coreclr/vm/jitinterface.cpp | 111 ------- 19 files changed, 145 insertions(+), 390 deletions(-) diff --git a/src/coreclr/inc/corinfo.h b/src/coreclr/inc/corinfo.h index 266d9fe1d11b0b..c19cf3d48242da 100644 --- a/src/coreclr/inc/corinfo.h +++ b/src/coreclr/inc/corinfo.h @@ -2214,12 +2214,6 @@ class ICorStaticInfo // failures during token resolution. virtual void resolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN * pResolvedToken) = 0; - // Attempt to resolve a metadata token into a runtime method handle. Returns true - // if resolution succeeded and false otherwise (e.g. if it encounters invalid metadata - // during token reoslution). This method should be used instead of `resolveToken` in - // situations that need to be resilient to invalid metadata. - virtual bool tryResolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN * pResolvedToken) = 0; - // Signature information about the call sig virtual void findSig ( CORINFO_MODULE_HANDLE module, /* IN */ diff --git a/src/coreclr/inc/icorjitinfoimpl_generated.h b/src/coreclr/inc/icorjitinfoimpl_generated.h index e48fc38e8f44da..ee9b7832b28bed 100644 --- a/src/coreclr/inc/icorjitinfoimpl_generated.h +++ b/src/coreclr/inc/icorjitinfoimpl_generated.h @@ -136,9 +136,6 @@ PatchpointInfo* getOSRInfo( void resolveToken( CORINFO_RESOLVED_TOKEN* pResolvedToken) override; -bool tryResolveToken( - CORINFO_RESOLVED_TOKEN* pResolvedToken) override; - void findSig( CORINFO_MODULE_HANDLE module, unsigned sigTOK, diff --git a/src/coreclr/jit/ICorJitInfo_names_generated.h b/src/coreclr/jit/ICorJitInfo_names_generated.h index 1fafc29e7f891f..ba913eb6e3ed14 100644 --- a/src/coreclr/jit/ICorJitInfo_names_generated.h +++ b/src/coreclr/jit/ICorJitInfo_names_generated.h @@ -33,7 +33,6 @@ DEF_CLR_API(getGSCookie) DEF_CLR_API(setPatchpointInfo) DEF_CLR_API(getOSRInfo) DEF_CLR_API(resolveToken) -DEF_CLR_API(tryResolveToken) DEF_CLR_API(findSig) DEF_CLR_API(findCallSiteSig) DEF_CLR_API(getTokenTypeAsHandle) diff --git a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp index 4053a31acaad56..f2cddaf92593de 100644 --- a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp +++ b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp @@ -289,15 +289,6 @@ void WrapICorJitInfo::resolveToken( API_LEAVE(resolveToken); } -bool WrapICorJitInfo::tryResolveToken( - CORINFO_RESOLVED_TOKEN* pResolvedToken) -{ - API_ENTER(tryResolveToken); - bool temp = wrapHnd->tryResolveToken(pResolvedToken); - API_LEAVE(tryResolveToken); - return temp; -} - void WrapICorJitInfo::findSig( CORINFO_MODULE_HANDLE module, unsigned sigTOK, diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 1118668799cdc6..db2d4f06a12475 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -8072,9 +8072,7 @@ class Compiler WORD eeGetRelocTypeHint(void* target); - // ICorStaticInfo wrapper functions - - bool eeTryResolveToken(CORINFO_RESOLVED_TOKEN* resolvedToken); +// ICorStaticInfo wrapper functions #if defined(UNIX_AMD64_ABI) #ifdef DEBUG diff --git a/src/coreclr/jit/ee_il_dll.cpp b/src/coreclr/jit/ee_il_dll.cpp index 5d7c5b9b9c4eb9..bbec124b4b1aca 100644 --- a/src/coreclr/jit/ee_il_dll.cpp +++ b/src/coreclr/jit/ee_il_dll.cpp @@ -1361,11 +1361,6 @@ void Compiler::eeGetSystemVAmd64PassStructInRegisterDescriptor( #endif // UNIX_AMD64_ABI -bool Compiler::eeTryResolveToken(CORINFO_RESOLVED_TOKEN* resolvedToken) -{ - return info.compCompHnd->tryResolveToken(resolvedToken); -} - bool Compiler::eeRunWithErrorTrapImp(void (*function)(void*), void* param) { return info.compCompHnd->runWithErrorTrap(function, param); diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs index 1a874be369b5aa..da27d7b8bfd2c2 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs @@ -1811,12 +1811,6 @@ private void resolveToken(ref CORINFO_RESOLVED_TOKEN pResolvedToken) pResolvedToken.cbMethodSpec = 0; } - private bool tryResolveToken(ref CORINFO_RESOLVED_TOKEN pResolvedToken) - { - resolveToken(ref pResolvedToken); - return true; - } - private void findSig(CORINFO_MODULE_STRUCT_* module, uint sigTOK, CORINFO_CONTEXT_STRUCT* context, CORINFO_SIG_INFO* sig) { var methodIL = HandleToObject(module); diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs index 191f52a38a2111..cb1ee5c4db1357 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs @@ -435,21 +435,6 @@ private static void _resolveToken(IntPtr thisHandle, IntPtr* ppException, CORINF } } - [UnmanagedCallersOnly] - private static byte _tryResolveToken(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken) - { - var _this = GetThis(thisHandle); - try - { - return _this.tryResolveToken(ref *pResolvedToken) ? (byte)1 : (byte)0; - } - catch (Exception ex) - { - *ppException = _this.AllocException(ex); - return default; - } - } - [UnmanagedCallersOnly] private static void _findSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint sigTOK, CORINFO_CONTEXT_STRUCT* context, CORINFO_SIG_INFO* sig) { @@ -2552,7 +2537,7 @@ private static uint _getJitFlags(IntPtr thisHandle, IntPtr* ppException, CORJIT_ private static IntPtr GetUnmanagedCallbacks() { - void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 172); + void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 171); callbacks[0] = (delegate* unmanaged)&_isIntrinsic; callbacks[1] = (delegate* unmanaged)&_getMethodAttribs; @@ -2583,149 +2568,148 @@ private static IntPtr GetUnmanagedCallbacks() callbacks[26] = (delegate* unmanaged)&_setPatchpointInfo; callbacks[27] = (delegate* unmanaged)&_getOSRInfo; callbacks[28] = (delegate* unmanaged)&_resolveToken; - callbacks[29] = (delegate* unmanaged)&_tryResolveToken; - callbacks[30] = (delegate* unmanaged)&_findSig; - callbacks[31] = (delegate* unmanaged)&_findCallSiteSig; - callbacks[32] = (delegate* unmanaged)&_getTokenTypeAsHandle; - callbacks[33] = (delegate* unmanaged)&_isValidToken; - callbacks[34] = (delegate* unmanaged)&_isValidStringRef; - callbacks[35] = (delegate* unmanaged)&_getStringLiteral; - callbacks[36] = (delegate* unmanaged)&_printObjectDescription; - callbacks[37] = (delegate* unmanaged)&_asCorInfoType; - callbacks[38] = (delegate* unmanaged)&_getClassNameFromMetadata; - callbacks[39] = (delegate* unmanaged)&_getTypeInstantiationArgument; - callbacks[40] = (delegate* unmanaged)&_printClassName; - callbacks[41] = (delegate* unmanaged)&_isValueClass; - callbacks[42] = (delegate* unmanaged)&_canInlineTypeCheck; - callbacks[43] = (delegate* unmanaged)&_getClassAttribs; - callbacks[44] = (delegate* unmanaged)&_getClassModule; - callbacks[45] = (delegate* unmanaged)&_getModuleAssembly; - callbacks[46] = (delegate* unmanaged)&_getAssemblyName; - callbacks[47] = (delegate* unmanaged)&_LongLifetimeMalloc; - callbacks[48] = (delegate* unmanaged)&_LongLifetimeFree; - callbacks[49] = (delegate* unmanaged)&_getClassModuleIdForStatics; - callbacks[50] = (delegate* unmanaged)&_getIsClassInitedFlagAddress; - callbacks[51] = (delegate* unmanaged)&_getStaticBaseAddress; - callbacks[52] = (delegate* unmanaged)&_getClassSize; - callbacks[53] = (delegate* unmanaged)&_getHeapClassSize; - callbacks[54] = (delegate* unmanaged)&_canAllocateOnStack; - callbacks[55] = (delegate* unmanaged)&_getClassAlignmentRequirement; - callbacks[56] = (delegate* unmanaged)&_getClassGClayout; - callbacks[57] = (delegate* unmanaged)&_getClassNumInstanceFields; - callbacks[58] = (delegate* unmanaged)&_getFieldInClass; - callbacks[59] = (delegate* unmanaged)&_checkMethodModifier; - callbacks[60] = (delegate* unmanaged)&_getNewHelper; - callbacks[61] = (delegate* unmanaged)&_getNewArrHelper; - callbacks[62] = (delegate* unmanaged)&_getCastingHelper; - callbacks[63] = (delegate* unmanaged)&_getSharedCCtorHelper; - callbacks[64] = (delegate* unmanaged)&_getTypeForBox; - callbacks[65] = (delegate* unmanaged)&_getBoxHelper; - callbacks[66] = (delegate* unmanaged)&_getUnBoxHelper; - callbacks[67] = (delegate* unmanaged)&_getRuntimeTypePointer; - callbacks[68] = (delegate* unmanaged)&_isObjectImmutable; - callbacks[69] = (delegate* unmanaged)&_getStringChar; - callbacks[70] = (delegate* unmanaged)&_getObjectType; - callbacks[71] = (delegate* unmanaged)&_getReadyToRunHelper; - callbacks[72] = (delegate* unmanaged)&_getReadyToRunDelegateCtorHelper; - callbacks[73] = (delegate* unmanaged)&_initClass; - callbacks[74] = (delegate* unmanaged)&_classMustBeLoadedBeforeCodeIsRun; - callbacks[75] = (delegate* unmanaged)&_getBuiltinClass; - callbacks[76] = (delegate* unmanaged)&_getTypeForPrimitiveValueClass; - callbacks[77] = (delegate* unmanaged)&_getTypeForPrimitiveNumericClass; - callbacks[78] = (delegate* unmanaged)&_canCast; - callbacks[79] = (delegate* unmanaged)&_compareTypesForCast; - callbacks[80] = (delegate* unmanaged)&_compareTypesForEquality; - callbacks[81] = (delegate* unmanaged)&_isMoreSpecificType; - callbacks[82] = (delegate* unmanaged)&_isEnum; - callbacks[83] = (delegate* unmanaged)&_getParentType; - callbacks[84] = (delegate* unmanaged)&_getChildType; - callbacks[85] = (delegate* unmanaged)&_isSDArray; - callbacks[86] = (delegate* unmanaged)&_getArrayRank; - callbacks[87] = (delegate* unmanaged)&_getArrayIntrinsicID; - callbacks[88] = (delegate* unmanaged)&_getArrayInitializationData; - callbacks[89] = (delegate* unmanaged)&_canAccessClass; - callbacks[90] = (delegate* unmanaged)&_printFieldName; - callbacks[91] = (delegate* unmanaged)&_getFieldClass; - callbacks[92] = (delegate* unmanaged)&_getFieldType; - callbacks[93] = (delegate* unmanaged)&_getFieldOffset; - callbacks[94] = (delegate* unmanaged)&_getFieldInfo; - callbacks[95] = (delegate* unmanaged)&_getThreadLocalFieldInfo; - callbacks[96] = (delegate* unmanaged)&_getThreadLocalStaticBlocksInfo; - callbacks[97] = (delegate* unmanaged)&_isFieldStatic; - callbacks[98] = (delegate* unmanaged)&_getArrayOrStringLength; - callbacks[99] = (delegate* unmanaged)&_getBoundaries; - callbacks[100] = (delegate* unmanaged)&_setBoundaries; - callbacks[101] = (delegate* unmanaged)&_getVars; - callbacks[102] = (delegate* unmanaged)&_setVars; - callbacks[103] = (delegate* unmanaged)&_reportRichMappings; - callbacks[104] = (delegate* unmanaged)&_allocateArray; - callbacks[105] = (delegate* unmanaged)&_freeArray; - callbacks[106] = (delegate* unmanaged)&_getArgNext; - callbacks[107] = (delegate* unmanaged)&_getArgType; - callbacks[108] = (delegate* unmanaged)&_getExactClasses; - callbacks[109] = (delegate* unmanaged)&_getArgClass; - callbacks[110] = (delegate* unmanaged)&_getHFAType; - callbacks[111] = (delegate* unmanaged)&_runWithErrorTrap; - callbacks[112] = (delegate* unmanaged)&_runWithSPMIErrorTrap; - callbacks[113] = (delegate* unmanaged)&_getEEInfo; - callbacks[114] = (delegate* unmanaged)&_getJitTimeLogFilename; - callbacks[115] = (delegate* unmanaged)&_getMethodDefFromMethod; - callbacks[116] = (delegate* unmanaged)&_printMethodName; - callbacks[117] = (delegate* unmanaged)&_getMethodNameFromMetadata; - callbacks[118] = (delegate* unmanaged)&_getMethodHash; - callbacks[119] = (delegate* unmanaged)&_getSystemVAmd64PassStructInRegisterDescriptor; - callbacks[120] = (delegate* unmanaged)&_getLoongArch64PassStructInRegisterFlags; - callbacks[121] = (delegate* unmanaged)&_getRISCV64PassStructInRegisterFlags; - callbacks[122] = (delegate* unmanaged)&_getThreadTLSIndex; - callbacks[123] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; - callbacks[124] = (delegate* unmanaged)&_getHelperFtn; - callbacks[125] = (delegate* unmanaged)&_getFunctionEntryPoint; - callbacks[126] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; - callbacks[127] = (delegate* unmanaged)&_getMethodSync; - callbacks[128] = (delegate* unmanaged)&_getLazyStringLiteralHelper; - callbacks[129] = (delegate* unmanaged)&_embedModuleHandle; - callbacks[130] = (delegate* unmanaged)&_embedClassHandle; - callbacks[131] = (delegate* unmanaged)&_embedMethodHandle; - callbacks[132] = (delegate* unmanaged)&_embedFieldHandle; - callbacks[133] = (delegate* unmanaged)&_embedGenericHandle; - callbacks[134] = (delegate* unmanaged)&_getLocationOfThisType; - callbacks[135] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; - callbacks[136] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; - callbacks[137] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; - callbacks[138] = (delegate* unmanaged)&_getJustMyCodeHandle; - callbacks[139] = (delegate* unmanaged)&_GetProfilingHandle; - callbacks[140] = (delegate* unmanaged)&_getCallInfo; - callbacks[141] = (delegate* unmanaged)&_getClassDomainID; - callbacks[142] = (delegate* unmanaged)&_getStaticFieldContent; - callbacks[143] = (delegate* unmanaged)&_getObjectContent; - callbacks[144] = (delegate* unmanaged)&_getStaticFieldCurrentClass; - callbacks[145] = (delegate* unmanaged)&_getVarArgsHandle; - callbacks[146] = (delegate* unmanaged)&_canGetVarArgsHandle; - callbacks[147] = (delegate* unmanaged)&_constructStringLiteral; - callbacks[148] = (delegate* unmanaged)&_emptyStringLiteral; - callbacks[149] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; - callbacks[150] = (delegate* unmanaged)&_GetDelegateCtor; - callbacks[151] = (delegate* unmanaged)&_MethodCompileComplete; - callbacks[152] = (delegate* unmanaged)&_getTailCallHelpers; - callbacks[153] = (delegate* unmanaged)&_convertPInvokeCalliToCall; - callbacks[154] = (delegate* unmanaged)&_notifyInstructionSetUsage; - callbacks[155] = (delegate* unmanaged)&_updateEntryPointForTailCall; - callbacks[156] = (delegate* unmanaged)&_allocMem; - callbacks[157] = (delegate* unmanaged)&_reserveUnwindInfo; - callbacks[158] = (delegate* unmanaged)&_allocUnwindInfo; - callbacks[159] = (delegate* unmanaged)&_allocGCInfo; - callbacks[160] = (delegate* unmanaged)&_setEHcount; - callbacks[161] = (delegate* unmanaged)&_setEHinfo; - callbacks[162] = (delegate* unmanaged)&_logMsg; - callbacks[163] = (delegate* unmanaged)&_doAssert; - callbacks[164] = (delegate* unmanaged)&_reportFatalError; - callbacks[165] = (delegate* unmanaged)&_getPgoInstrumentationResults; - callbacks[166] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; - callbacks[167] = (delegate* unmanaged)&_recordCallSite; - callbacks[168] = (delegate* unmanaged)&_recordRelocation; - callbacks[169] = (delegate* unmanaged)&_getRelocTypeHint; - callbacks[170] = (delegate* unmanaged)&_getExpectedTargetArchitecture; - callbacks[171] = (delegate* unmanaged)&_getJitFlags; + callbacks[29] = (delegate* unmanaged)&_findSig; + callbacks[30] = (delegate* unmanaged)&_findCallSiteSig; + callbacks[31] = (delegate* unmanaged)&_getTokenTypeAsHandle; + callbacks[32] = (delegate* unmanaged)&_isValidToken; + callbacks[33] = (delegate* unmanaged)&_isValidStringRef; + callbacks[34] = (delegate* unmanaged)&_getStringLiteral; + callbacks[35] = (delegate* unmanaged)&_printObjectDescription; + callbacks[36] = (delegate* unmanaged)&_asCorInfoType; + callbacks[37] = (delegate* unmanaged)&_getClassNameFromMetadata; + callbacks[38] = (delegate* unmanaged)&_getTypeInstantiationArgument; + callbacks[39] = (delegate* unmanaged)&_printClassName; + callbacks[40] = (delegate* unmanaged)&_isValueClass; + callbacks[41] = (delegate* unmanaged)&_canInlineTypeCheck; + callbacks[42] = (delegate* unmanaged)&_getClassAttribs; + callbacks[43] = (delegate* unmanaged)&_getClassModule; + callbacks[44] = (delegate* unmanaged)&_getModuleAssembly; + callbacks[45] = (delegate* unmanaged)&_getAssemblyName; + callbacks[46] = (delegate* unmanaged)&_LongLifetimeMalloc; + callbacks[47] = (delegate* unmanaged)&_LongLifetimeFree; + callbacks[48] = (delegate* unmanaged)&_getClassModuleIdForStatics; + callbacks[49] = (delegate* unmanaged)&_getIsClassInitedFlagAddress; + callbacks[50] = (delegate* unmanaged)&_getStaticBaseAddress; + callbacks[51] = (delegate* unmanaged)&_getClassSize; + callbacks[52] = (delegate* unmanaged)&_getHeapClassSize; + callbacks[53] = (delegate* unmanaged)&_canAllocateOnStack; + callbacks[54] = (delegate* unmanaged)&_getClassAlignmentRequirement; + callbacks[55] = (delegate* unmanaged)&_getClassGClayout; + callbacks[56] = (delegate* unmanaged)&_getClassNumInstanceFields; + callbacks[57] = (delegate* unmanaged)&_getFieldInClass; + callbacks[58] = (delegate* unmanaged)&_checkMethodModifier; + callbacks[59] = (delegate* unmanaged)&_getNewHelper; + callbacks[60] = (delegate* unmanaged)&_getNewArrHelper; + callbacks[61] = (delegate* unmanaged)&_getCastingHelper; + callbacks[62] = (delegate* unmanaged)&_getSharedCCtorHelper; + callbacks[63] = (delegate* unmanaged)&_getTypeForBox; + callbacks[64] = (delegate* unmanaged)&_getBoxHelper; + callbacks[65] = (delegate* unmanaged)&_getUnBoxHelper; + callbacks[66] = (delegate* unmanaged)&_getRuntimeTypePointer; + callbacks[67] = (delegate* unmanaged)&_isObjectImmutable; + callbacks[68] = (delegate* unmanaged)&_getStringChar; + callbacks[69] = (delegate* unmanaged)&_getObjectType; + callbacks[70] = (delegate* unmanaged)&_getReadyToRunHelper; + callbacks[71] = (delegate* unmanaged)&_getReadyToRunDelegateCtorHelper; + callbacks[72] = (delegate* unmanaged)&_initClass; + callbacks[73] = (delegate* unmanaged)&_classMustBeLoadedBeforeCodeIsRun; + callbacks[74] = (delegate* unmanaged)&_getBuiltinClass; + callbacks[75] = (delegate* unmanaged)&_getTypeForPrimitiveValueClass; + callbacks[76] = (delegate* unmanaged)&_getTypeForPrimitiveNumericClass; + callbacks[77] = (delegate* unmanaged)&_canCast; + callbacks[78] = (delegate* unmanaged)&_compareTypesForCast; + callbacks[79] = (delegate* unmanaged)&_compareTypesForEquality; + callbacks[80] = (delegate* unmanaged)&_isMoreSpecificType; + callbacks[81] = (delegate* unmanaged)&_isEnum; + callbacks[82] = (delegate* unmanaged)&_getParentType; + callbacks[83] = (delegate* unmanaged)&_getChildType; + callbacks[84] = (delegate* unmanaged)&_isSDArray; + callbacks[85] = (delegate* unmanaged)&_getArrayRank; + callbacks[86] = (delegate* unmanaged)&_getArrayIntrinsicID; + callbacks[87] = (delegate* unmanaged)&_getArrayInitializationData; + callbacks[88] = (delegate* unmanaged)&_canAccessClass; + callbacks[89] = (delegate* unmanaged)&_printFieldName; + callbacks[90] = (delegate* unmanaged)&_getFieldClass; + callbacks[91] = (delegate* unmanaged)&_getFieldType; + callbacks[92] = (delegate* unmanaged)&_getFieldOffset; + callbacks[93] = (delegate* unmanaged)&_getFieldInfo; + callbacks[94] = (delegate* unmanaged)&_getThreadLocalFieldInfo; + callbacks[95] = (delegate* unmanaged)&_getThreadLocalStaticBlocksInfo; + callbacks[96] = (delegate* unmanaged)&_isFieldStatic; + callbacks[97] = (delegate* unmanaged)&_getArrayOrStringLength; + callbacks[98] = (delegate* unmanaged)&_getBoundaries; + callbacks[99] = (delegate* unmanaged)&_setBoundaries; + callbacks[100] = (delegate* unmanaged)&_getVars; + callbacks[101] = (delegate* unmanaged)&_setVars; + callbacks[102] = (delegate* unmanaged)&_reportRichMappings; + callbacks[103] = (delegate* unmanaged)&_allocateArray; + callbacks[104] = (delegate* unmanaged)&_freeArray; + callbacks[105] = (delegate* unmanaged)&_getArgNext; + callbacks[106] = (delegate* unmanaged)&_getArgType; + callbacks[107] = (delegate* unmanaged)&_getExactClasses; + callbacks[108] = (delegate* unmanaged)&_getArgClass; + callbacks[109] = (delegate* unmanaged)&_getHFAType; + callbacks[110] = (delegate* unmanaged)&_runWithErrorTrap; + callbacks[111] = (delegate* unmanaged)&_runWithSPMIErrorTrap; + callbacks[112] = (delegate* unmanaged)&_getEEInfo; + callbacks[113] = (delegate* unmanaged)&_getJitTimeLogFilename; + callbacks[114] = (delegate* unmanaged)&_getMethodDefFromMethod; + callbacks[115] = (delegate* unmanaged)&_printMethodName; + callbacks[116] = (delegate* unmanaged)&_getMethodNameFromMetadata; + callbacks[117] = (delegate* unmanaged)&_getMethodHash; + callbacks[118] = (delegate* unmanaged)&_getSystemVAmd64PassStructInRegisterDescriptor; + callbacks[119] = (delegate* unmanaged)&_getLoongArch64PassStructInRegisterFlags; + callbacks[120] = (delegate* unmanaged)&_getRISCV64PassStructInRegisterFlags; + callbacks[121] = (delegate* unmanaged)&_getThreadTLSIndex; + callbacks[122] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; + callbacks[123] = (delegate* unmanaged)&_getHelperFtn; + callbacks[124] = (delegate* unmanaged)&_getFunctionEntryPoint; + callbacks[125] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; + callbacks[126] = (delegate* unmanaged)&_getMethodSync; + callbacks[127] = (delegate* unmanaged)&_getLazyStringLiteralHelper; + callbacks[128] = (delegate* unmanaged)&_embedModuleHandle; + callbacks[129] = (delegate* unmanaged)&_embedClassHandle; + callbacks[130] = (delegate* unmanaged)&_embedMethodHandle; + callbacks[131] = (delegate* unmanaged)&_embedFieldHandle; + callbacks[132] = (delegate* unmanaged)&_embedGenericHandle; + callbacks[133] = (delegate* unmanaged)&_getLocationOfThisType; + callbacks[134] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; + callbacks[135] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; + callbacks[136] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; + callbacks[137] = (delegate* unmanaged)&_getJustMyCodeHandle; + callbacks[138] = (delegate* unmanaged)&_GetProfilingHandle; + callbacks[139] = (delegate* unmanaged)&_getCallInfo; + callbacks[140] = (delegate* unmanaged)&_getClassDomainID; + callbacks[141] = (delegate* unmanaged)&_getStaticFieldContent; + callbacks[142] = (delegate* unmanaged)&_getObjectContent; + callbacks[143] = (delegate* unmanaged)&_getStaticFieldCurrentClass; + callbacks[144] = (delegate* unmanaged)&_getVarArgsHandle; + callbacks[145] = (delegate* unmanaged)&_canGetVarArgsHandle; + callbacks[146] = (delegate* unmanaged)&_constructStringLiteral; + callbacks[147] = (delegate* unmanaged)&_emptyStringLiteral; + callbacks[148] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; + callbacks[149] = (delegate* unmanaged)&_GetDelegateCtor; + callbacks[150] = (delegate* unmanaged)&_MethodCompileComplete; + callbacks[151] = (delegate* unmanaged)&_getTailCallHelpers; + callbacks[152] = (delegate* unmanaged)&_convertPInvokeCalliToCall; + callbacks[153] = (delegate* unmanaged)&_notifyInstructionSetUsage; + callbacks[154] = (delegate* unmanaged)&_updateEntryPointForTailCall; + callbacks[155] = (delegate* unmanaged)&_allocMem; + callbacks[156] = (delegate* unmanaged)&_reserveUnwindInfo; + callbacks[157] = (delegate* unmanaged)&_allocUnwindInfo; + callbacks[158] = (delegate* unmanaged)&_allocGCInfo; + callbacks[159] = (delegate* unmanaged)&_setEHcount; + callbacks[160] = (delegate* unmanaged)&_setEHinfo; + callbacks[161] = (delegate* unmanaged)&_logMsg; + callbacks[162] = (delegate* unmanaged)&_doAssert; + callbacks[163] = (delegate* unmanaged)&_reportFatalError; + callbacks[164] = (delegate* unmanaged)&_getPgoInstrumentationResults; + callbacks[165] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; + callbacks[166] = (delegate* unmanaged)&_recordCallSite; + callbacks[167] = (delegate* unmanaged)&_recordRelocation; + callbacks[168] = (delegate* unmanaged)&_getRelocTypeHint; + callbacks[169] = (delegate* unmanaged)&_getExpectedTargetArchitecture; + callbacks[170] = (delegate* unmanaged)&_getJitFlags; return (IntPtr)callbacks; } diff --git a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt index 5b00635a8fb633..bce6b654c0fb8e 100644 --- a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt +++ b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt @@ -188,7 +188,6 @@ FUNCTIONS void setPatchpointInfo(PatchpointInfo* patchpointInfo); PatchpointInfo* getOSRInfo(unsigned * ilOffset); void resolveToken(CORINFO_RESOLVED_TOKEN * pResolvedToken); - bool tryResolveToken(CORINFO_RESOLVED_TOKEN * pResolvedToken); void findSig( CORINFO_MODULE_HANDLE module, unsigned sigTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO *sig ); void findCallSiteSig( CORINFO_MODULE_HANDLE module,unsigned methTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO *sig) CORINFO_CLASS_HANDLE getTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken) diff --git a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h index 0f7af95ab6fe54..65c7275336f307 100644 --- a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h +++ b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h @@ -40,7 +40,6 @@ struct JitInterfaceCallbacks void (* setPatchpointInfo)(void * thisHandle, CorInfoExceptionClass** ppException, PatchpointInfo* patchpointInfo); PatchpointInfo* (* getOSRInfo)(void * thisHandle, CorInfoExceptionClass** ppException, unsigned* ilOffset); void (* resolveToken)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken); - bool (* tryResolveToken)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken); void (* findSig)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_MODULE_HANDLE module, unsigned sigTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO* sig); void (* findCallSiteSig)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_MODULE_HANDLE module, unsigned methTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO* sig); CORINFO_CLASS_HANDLE (* getTokenTypeAsHandle)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken); @@ -475,15 +474,6 @@ class JitInterfaceWrapper : public ICorJitInfo if (pException != nullptr) throw pException; } - virtual bool tryResolveToken( - CORINFO_RESOLVED_TOKEN* pResolvedToken) -{ - CorInfoExceptionClass* pException = nullptr; - bool temp = _callbacks->tryResolveToken(_thisHandle, &pException, pResolvedToken); - if (pException != nullptr) throw pException; - return temp; -} - virtual void findSig( CORINFO_MODULE_HANDLE module, unsigned sigTOK, diff --git a/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h b/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h index dbbd6461feaea1..ef0ae0f9ed0fce 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h @@ -602,12 +602,6 @@ struct ResolveTokenValue DWORD exceptionCode; }; -struct TryResolveTokenValue -{ - Agnostic_CORINFO_RESOLVED_TOKENout tokenOut; - DWORD success; -}; - struct GetTokenTypeAsHandleValue { DWORDLONG hMethod; diff --git a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h index baa12af9dd6a37..15794630a7a1b1 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h @@ -160,7 +160,6 @@ LWM(IsEnum, DWORDLONG, DLD) LWM(PInvokeMarshalingRequired, MethodOrSigInfoValue, DWORD) LWM(ResolveToken, Agnostic_CORINFO_RESOLVED_TOKENin, ResolveTokenValue) LWM(ResolveVirtualMethod, Agnostic_ResolveVirtualMethodKey, Agnostic_ResolveVirtualMethodResult) -LWM(TryResolveToken, Agnostic_CORINFO_RESOLVED_TOKENin, TryResolveTokenValue) LWM(SatisfiesMethodConstraints, DLDL, DWORD) LWM(GetUnmanagedCallConv, MethodOrSigInfoValue, DD) LWM(DoesFieldBelongToClass, DLDL, DWORD) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp index e161046f6d9670..6f86567eb6ee19 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp @@ -1425,42 +1425,6 @@ void MethodContext::repResolveToken(CORINFO_RESOLVED_TOKEN* pResolvedToken, DWOR *exceptionCode = (DWORD)value.exceptionCode; } -void MethodContext::recTryResolveToken(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool success) -{ - if (TryResolveToken == nullptr) - TryResolveToken = new LightWeightMap(); - - Agnostic_CORINFO_RESOLVED_TOKENin key; - ZeroMemory(&key, sizeof(key)); // Zero key including any struct padding - key = SpmiRecordsHelper::CreateAgnostic_CORINFO_RESOLVED_TOKENin(pResolvedToken); - - TryResolveTokenValue value; - - value.tokenOut = SpmiRecordsHelper::StoreAgnostic_CORINFO_RESOLVED_TOKENout(pResolvedToken, ResolveToken); - value.success = success ? 0 : 1; - - TryResolveToken->Add(key, value); - DEBUG_REC(dmpTryResolveToken(key, value)); -} -void MethodContext::dmpTryResolveToken(const Agnostic_CORINFO_RESOLVED_TOKENin& key, const TryResolveTokenValue& value) -{ - printf("TryResolveToken key: %s\n", SpmiDumpHelper::DumpAgnostic_CORINFO_RESOLVED_TOKENin(key).c_str()); - printf(", value: %s failed-%u", SpmiDumpHelper::DumpAgnostic_CORINFO_RESOLVED_TOKENout(value.tokenOut).c_str(), - value.success); -} -bool MethodContext::repTryResolveToken(CORINFO_RESOLVED_TOKEN* pResolvedToken) -{ - Agnostic_CORINFO_RESOLVED_TOKENin key; - ZeroMemory(&key, sizeof(key)); // Zero key including any struct padding - key = SpmiRecordsHelper::CreateAgnostic_CORINFO_RESOLVED_TOKENin(pResolvedToken); - - TryResolveTokenValue value = LookupByKeyOrMiss(TryResolveToken, key, ": token %x", pResolvedToken->token); - DEBUG_REP(dmpTryResolveToken(key, value)); - - SpmiRecordsHelper::Restore_CORINFO_RESOLVED_TOKENout(pResolvedToken, value.tokenOut, ResolveToken); - return (DWORD)value.success == 0; // recTryResolveToken encodes success as 0 -} - void MethodContext::recGetCallInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken, CORINFO_METHOD_HANDLE callerHandle, diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h index 7c92f5f1585e90..3919536cc42a38 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h @@ -197,10 +197,6 @@ class MethodContext void dmpResolveToken(const Agnostic_CORINFO_RESOLVED_TOKENin& key, const ResolveTokenValue& value); void repResolveToken(CORINFO_RESOLVED_TOKEN* pResolvedToken, DWORD* exceptionCode); - void recTryResolveToken(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool success); - void dmpTryResolveToken(const Agnostic_CORINFO_RESOLVED_TOKENin& key, const TryResolveTokenValue& value); - bool repTryResolveToken(CORINFO_RESOLVED_TOKEN* pResolvedToken); - void recGetCallInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken, CORINFO_METHOD_HANDLE callerHandle, @@ -1086,7 +1082,7 @@ enum mcPackets Packet_IsDelegateCreationAllowed = 155, Packet_GetSystemVAmd64PassStructInRegisterDescriptor = 156, Packet_GetReadyToRunDelegateCtorHelper = 157, - Packet_TryResolveToken = 158, + //Packet_TryResolveToken = 158, Packet_GetHFAType = 159, Packet_ResolveVirtualMethod = 160, Packet_GetMethodNameFromMetadata = 161, diff --git a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp index 59401af0c9909b..d0a62218abd404 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp @@ -359,14 +359,6 @@ void interceptor_ICJI::resolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN* pResol }); } -bool interceptor_ICJI::tryResolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN* pResolvedToken) -{ - mc->cr->AddCall("tryResolveToken"); - bool success = original_ICorJitInfo->tryResolveToken(pResolvedToken); - mc->recResolveToken(pResolvedToken, success); - return success; -} - // Signature information about the call sig void interceptor_ICJI::findSig(CORINFO_MODULE_HANDLE module, /* IN */ unsigned sigTOK, /* IN */ diff --git a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp index 8a1ee00a1bdfad..0c63671910d4bf 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp @@ -243,13 +243,6 @@ void interceptor_ICJI::resolveToken( original_ICorJitInfo->resolveToken(pResolvedToken); } -bool interceptor_ICJI::tryResolveToken( - CORINFO_RESOLVED_TOKEN* pResolvedToken) -{ - mcs->AddCall("tryResolveToken"); - return original_ICorJitInfo->tryResolveToken(pResolvedToken); -} - void interceptor_ICJI::findSig( CORINFO_MODULE_HANDLE module, unsigned sigTOK, diff --git a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp index 263513b027fe15..54ec398035eba0 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp @@ -214,12 +214,6 @@ void interceptor_ICJI::resolveToken( original_ICorJitInfo->resolveToken(pResolvedToken); } -bool interceptor_ICJI::tryResolveToken( - CORINFO_RESOLVED_TOKEN* pResolvedToken) -{ - return original_ICorJitInfo->tryResolveToken(pResolvedToken); -} - void interceptor_ICJI::findSig( CORINFO_MODULE_HANDLE module, unsigned sigTOK, diff --git a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp index c82d930c21e23c..0b7a09bf058c41 100644 --- a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp @@ -307,13 +307,6 @@ void MyICJI::resolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN* pResolvedToken) ThrowException(exceptionCode); } -// Resolve metadata token into runtime method handles. -bool MyICJI::tryResolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN* pResolvedToken) -{ - jitInstance->mc->cr->AddCall("tryResolveToken"); - return jitInstance->mc->repTryResolveToken(pResolvedToken); -} - // Signature information about the call sig void MyICJI::findSig(CORINFO_MODULE_HANDLE module, /* IN */ unsigned sigTOK, /* IN */ diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index 3ddf67430d85f4..27d30b9b43849a 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -1198,117 +1198,6 @@ void CEEInfo::resolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN * pResolvedToken EE_TO_JIT_TRANSITION(); } -/*********************************************************************/ -struct TryResolveTokenFilterParam -{ - CEEInfo* m_this; - CORINFO_RESOLVED_TOKEN* m_resolvedToken; - EXCEPTION_POINTERS m_exceptionPointers; - bool m_success; -}; - -bool isValidTokenForTryResolveToken(CEEInfo* info, CORINFO_RESOLVED_TOKEN* resolvedToken) -{ - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - MODE_ANY; - } CONTRACTL_END; - - if (!info->isValidToken(resolvedToken->tokenScope, resolvedToken->token)) - { - return false; - } - - CorInfoTokenKind tokenType = resolvedToken->tokenType; - switch (TypeFromToken(resolvedToken->token)) - { - case mdtModuleRef: - case mdtTypeDef: - case mdtTypeRef: - case mdtTypeSpec: - if ((tokenType & CORINFO_TOKENKIND_Class) == 0) - return false; - break; - - case mdtMethodDef: - case mdtMethodSpec: - if ((tokenType & CORINFO_TOKENKIND_Method) == 0) - return false; - break; - - case mdtFieldDef: - if ((tokenType & CORINFO_TOKENKIND_Field) == 0) - return false; - break; - - case mdtMemberRef: - if ((tokenType & (CORINFO_TOKENKIND_Method | CORINFO_TOKENKIND_Field)) == 0) - return false; - break; - - default: - return false; - } - - return true; -} - -LONG EEFilterException(struct _EXCEPTION_POINTERS* exceptionPointers, void* unused); - -LONG TryResolveTokenFilter(struct _EXCEPTION_POINTERS* exceptionPointers, void* theParam) -{ - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - MODE_ANY; - } CONTRACTL_END; - - // Backward compatibility: Convert bad image format exceptions thrown while resolving tokens - // to simple true/false successes. This is done for backward compatibility only. Ideally, - // we would always treat bad tokens in the IL stream as fatal errors. - if (exceptionPointers->ExceptionRecord->ExceptionCode == EXCEPTION_COMPLUS) - { - auto* param = reinterpret_cast(theParam); - if (!isValidTokenForTryResolveToken(param->m_this, param->m_resolvedToken)) - { - param->m_exceptionPointers = *exceptionPointers; - return EEFilterException(exceptionPointers, nullptr); - } - } - - return EXCEPTION_CONTINUE_SEARCH; -} - -bool CEEInfo::tryResolveToken(CORINFO_RESOLVED_TOKEN* resolvedToken) -{ - // No dynamic contract here because SEH is used - STATIC_CONTRACT_THROWS; - STATIC_CONTRACT_GC_TRIGGERS; - STATIC_CONTRACT_MODE_PREEMPTIVE; - - TryResolveTokenFilterParam param; - param.m_this = this; - param.m_resolvedToken = resolvedToken; - param.m_success = true; - - PAL_TRY(TryResolveTokenFilterParam*, pParam, ¶m) - { - pParam->m_this->resolveToken(pParam->m_resolvedToken); - } - PAL_EXCEPT_FILTER(TryResolveTokenFilter) - { - if (param.m_exceptionPointers.ExceptionRecord->ExceptionCode == EXCEPTION_COMPLUS) - { - HandleException(¶m.m_exceptionPointers); - } - - param.m_success = false; - } - PAL_ENDTRY - - return param.m_success; -} /*********************************************************************/ // We have a few frequently used constants in CoreLib that are defined as From a28e626655d377da21d1d1f64882fdbcfb697e43 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Fri, 16 Jun 2023 10:21:25 -0700 Subject: [PATCH 11/16] Remove isValidToken --- src/coreclr/inc/corinfo.h | 6 - src/coreclr/inc/icorjitinfoimpl_generated.h | 4 - src/coreclr/jit/ICorJitInfo_names_generated.h | 1 - .../jit/ICorJitInfo_wrapper_generated.hpp | 10 - .../tools/Common/JitInterface/CorInfoImpl.cs | 2 - .../JitInterface/CorInfoImpl_generated.cs | 294 +++++++++--------- .../ThunkGenerator/ThunkInput.txt | 1 - .../aot/jitinterface/jitinterface_generated.h | 11 - .../tools/superpmi/superpmi-shared/lwmlist.h | 1 - .../superpmi-shared/methodcontext.cpp | 31 -- .../superpmi/superpmi-shared/methodcontext.h | 6 +- .../superpmi-shim-collector/icorjitinfo.cpp | 11 - .../icorjitinfo_generated.cpp | 8 - .../icorjitinfo_generated.cpp | 7 - .../tools/superpmi/superpmi/icorjitinfo.cpp | 9 - src/coreclr/vm/jitinterface.cpp | 32 -- 16 files changed, 140 insertions(+), 294 deletions(-) diff --git a/src/coreclr/inc/corinfo.h b/src/coreclr/inc/corinfo.h index c19cf3d48242da..a8c744364f7a40 100644 --- a/src/coreclr/inc/corinfo.h +++ b/src/coreclr/inc/corinfo.h @@ -2235,12 +2235,6 @@ class ICorStaticInfo virtual CORINFO_CLASS_HANDLE getTokenTypeAsHandle ( CORINFO_RESOLVED_TOKEN * pResolvedToken /* IN */) = 0; - // Checks if the given metadata token is valid - virtual bool isValidToken ( - CORINFO_MODULE_HANDLE module, /* IN */ - unsigned metaTOK /* IN */ - ) = 0; - // Checks if the given metadata token is valid StringRef virtual bool isValidStringRef ( CORINFO_MODULE_HANDLE module, /* IN */ diff --git a/src/coreclr/inc/icorjitinfoimpl_generated.h b/src/coreclr/inc/icorjitinfoimpl_generated.h index ee9b7832b28bed..82fe93315e3b1e 100644 --- a/src/coreclr/inc/icorjitinfoimpl_generated.h +++ b/src/coreclr/inc/icorjitinfoimpl_generated.h @@ -151,10 +151,6 @@ void findCallSiteSig( CORINFO_CLASS_HANDLE getTokenTypeAsHandle( CORINFO_RESOLVED_TOKEN* pResolvedToken) override; -bool isValidToken( - CORINFO_MODULE_HANDLE module, - unsigned metaTOK) override; - bool isValidStringRef( CORINFO_MODULE_HANDLE module, unsigned metaTOK) override; diff --git a/src/coreclr/jit/ICorJitInfo_names_generated.h b/src/coreclr/jit/ICorJitInfo_names_generated.h index ba913eb6e3ed14..1aeeda3bb5d4be 100644 --- a/src/coreclr/jit/ICorJitInfo_names_generated.h +++ b/src/coreclr/jit/ICorJitInfo_names_generated.h @@ -36,7 +36,6 @@ DEF_CLR_API(resolveToken) DEF_CLR_API(findSig) DEF_CLR_API(findCallSiteSig) DEF_CLR_API(getTokenTypeAsHandle) -DEF_CLR_API(isValidToken) DEF_CLR_API(isValidStringRef) DEF_CLR_API(getStringLiteral) DEF_CLR_API(printObjectDescription) diff --git a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp index f2cddaf92593de..e71bbf683c98f3 100644 --- a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp +++ b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp @@ -320,16 +320,6 @@ CORINFO_CLASS_HANDLE WrapICorJitInfo::getTokenTypeAsHandle( return temp; } -bool WrapICorJitInfo::isValidToken( - CORINFO_MODULE_HANDLE module, - unsigned metaTOK) -{ - API_ENTER(isValidToken); - bool temp = wrapHnd->isValidToken(module, metaTOK); - API_LEAVE(isValidToken); - return temp; -} - bool WrapICorJitInfo::isValidStringRef( CORINFO_MODULE_HANDLE module, unsigned metaTOK) diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs index da27d7b8bfd2c2..e4110f8ba99738 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs @@ -1857,8 +1857,6 @@ private static CorInfoCanSkipVerificationResult canSkipVerification(CORINFO_MODU return CorInfoCanSkipVerificationResult.CORINFO_VERIFICATION_CAN_SKIP; } - private bool isValidToken(CORINFO_MODULE_STRUCT_* module, uint metaTOK) - { throw new NotImplementedException("isValidToken"); } private bool isValidStringRef(CORINFO_MODULE_STRUCT_* module, uint metaTOK) { throw new NotImplementedException("isValidStringRef"); } diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs index cb1ee5c4db1357..419ed349b05faf 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs @@ -478,21 +478,6 @@ private static void _findCallSiteSig(IntPtr thisHandle, IntPtr* ppException, COR } } - [UnmanagedCallersOnly] - private static byte _isValidToken(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK) - { - var _this = GetThis(thisHandle); - try - { - return _this.isValidToken(module, metaTOK) ? (byte)1 : (byte)0; - } - catch (Exception ex) - { - *ppException = _this.AllocException(ex); - return default; - } - } - [UnmanagedCallersOnly] private static byte _isValidStringRef(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK) { @@ -2537,7 +2522,7 @@ private static uint _getJitFlags(IntPtr thisHandle, IntPtr* ppException, CORJIT_ private static IntPtr GetUnmanagedCallbacks() { - void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 171); + void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 170); callbacks[0] = (delegate* unmanaged)&_isIntrinsic; callbacks[1] = (delegate* unmanaged)&_getMethodAttribs; @@ -2571,145 +2556,144 @@ private static IntPtr GetUnmanagedCallbacks() callbacks[29] = (delegate* unmanaged)&_findSig; callbacks[30] = (delegate* unmanaged)&_findCallSiteSig; callbacks[31] = (delegate* unmanaged)&_getTokenTypeAsHandle; - callbacks[32] = (delegate* unmanaged)&_isValidToken; - callbacks[33] = (delegate* unmanaged)&_isValidStringRef; - callbacks[34] = (delegate* unmanaged)&_getStringLiteral; - callbacks[35] = (delegate* unmanaged)&_printObjectDescription; - callbacks[36] = (delegate* unmanaged)&_asCorInfoType; - callbacks[37] = (delegate* unmanaged)&_getClassNameFromMetadata; - callbacks[38] = (delegate* unmanaged)&_getTypeInstantiationArgument; - callbacks[39] = (delegate* unmanaged)&_printClassName; - callbacks[40] = (delegate* unmanaged)&_isValueClass; - callbacks[41] = (delegate* unmanaged)&_canInlineTypeCheck; - callbacks[42] = (delegate* unmanaged)&_getClassAttribs; - callbacks[43] = (delegate* unmanaged)&_getClassModule; - callbacks[44] = (delegate* unmanaged)&_getModuleAssembly; - callbacks[45] = (delegate* unmanaged)&_getAssemblyName; - callbacks[46] = (delegate* unmanaged)&_LongLifetimeMalloc; - callbacks[47] = (delegate* unmanaged)&_LongLifetimeFree; - callbacks[48] = (delegate* unmanaged)&_getClassModuleIdForStatics; - callbacks[49] = (delegate* unmanaged)&_getIsClassInitedFlagAddress; - callbacks[50] = (delegate* unmanaged)&_getStaticBaseAddress; - callbacks[51] = (delegate* unmanaged)&_getClassSize; - callbacks[52] = (delegate* unmanaged)&_getHeapClassSize; - callbacks[53] = (delegate* unmanaged)&_canAllocateOnStack; - callbacks[54] = (delegate* unmanaged)&_getClassAlignmentRequirement; - callbacks[55] = (delegate* unmanaged)&_getClassGClayout; - callbacks[56] = (delegate* unmanaged)&_getClassNumInstanceFields; - callbacks[57] = (delegate* unmanaged)&_getFieldInClass; - callbacks[58] = (delegate* unmanaged)&_checkMethodModifier; - callbacks[59] = (delegate* unmanaged)&_getNewHelper; - callbacks[60] = (delegate* unmanaged)&_getNewArrHelper; - callbacks[61] = (delegate* unmanaged)&_getCastingHelper; - callbacks[62] = (delegate* unmanaged)&_getSharedCCtorHelper; - callbacks[63] = (delegate* unmanaged)&_getTypeForBox; - callbacks[64] = (delegate* unmanaged)&_getBoxHelper; - callbacks[65] = (delegate* unmanaged)&_getUnBoxHelper; - callbacks[66] = (delegate* unmanaged)&_getRuntimeTypePointer; - callbacks[67] = (delegate* unmanaged)&_isObjectImmutable; - callbacks[68] = (delegate* unmanaged)&_getStringChar; - callbacks[69] = (delegate* unmanaged)&_getObjectType; - callbacks[70] = (delegate* unmanaged)&_getReadyToRunHelper; - callbacks[71] = (delegate* unmanaged)&_getReadyToRunDelegateCtorHelper; - callbacks[72] = (delegate* unmanaged)&_initClass; - callbacks[73] = (delegate* unmanaged)&_classMustBeLoadedBeforeCodeIsRun; - callbacks[74] = (delegate* unmanaged)&_getBuiltinClass; - callbacks[75] = (delegate* unmanaged)&_getTypeForPrimitiveValueClass; - callbacks[76] = (delegate* unmanaged)&_getTypeForPrimitiveNumericClass; - callbacks[77] = (delegate* unmanaged)&_canCast; - callbacks[78] = (delegate* unmanaged)&_compareTypesForCast; - callbacks[79] = (delegate* unmanaged)&_compareTypesForEquality; - callbacks[80] = (delegate* unmanaged)&_isMoreSpecificType; - callbacks[81] = (delegate* unmanaged)&_isEnum; - callbacks[82] = (delegate* unmanaged)&_getParentType; - callbacks[83] = (delegate* unmanaged)&_getChildType; - callbacks[84] = (delegate* unmanaged)&_isSDArray; - callbacks[85] = (delegate* unmanaged)&_getArrayRank; - callbacks[86] = (delegate* unmanaged)&_getArrayIntrinsicID; - callbacks[87] = (delegate* unmanaged)&_getArrayInitializationData; - callbacks[88] = (delegate* unmanaged)&_canAccessClass; - callbacks[89] = (delegate* unmanaged)&_printFieldName; - callbacks[90] = (delegate* unmanaged)&_getFieldClass; - callbacks[91] = (delegate* unmanaged)&_getFieldType; - callbacks[92] = (delegate* unmanaged)&_getFieldOffset; - callbacks[93] = (delegate* unmanaged)&_getFieldInfo; - callbacks[94] = (delegate* unmanaged)&_getThreadLocalFieldInfo; - callbacks[95] = (delegate* unmanaged)&_getThreadLocalStaticBlocksInfo; - callbacks[96] = (delegate* unmanaged)&_isFieldStatic; - callbacks[97] = (delegate* unmanaged)&_getArrayOrStringLength; - callbacks[98] = (delegate* unmanaged)&_getBoundaries; - callbacks[99] = (delegate* unmanaged)&_setBoundaries; - callbacks[100] = (delegate* unmanaged)&_getVars; - callbacks[101] = (delegate* unmanaged)&_setVars; - callbacks[102] = (delegate* unmanaged)&_reportRichMappings; - callbacks[103] = (delegate* unmanaged)&_allocateArray; - callbacks[104] = (delegate* unmanaged)&_freeArray; - callbacks[105] = (delegate* unmanaged)&_getArgNext; - callbacks[106] = (delegate* unmanaged)&_getArgType; - callbacks[107] = (delegate* unmanaged)&_getExactClasses; - callbacks[108] = (delegate* unmanaged)&_getArgClass; - callbacks[109] = (delegate* unmanaged)&_getHFAType; - callbacks[110] = (delegate* unmanaged)&_runWithErrorTrap; - callbacks[111] = (delegate* unmanaged)&_runWithSPMIErrorTrap; - callbacks[112] = (delegate* unmanaged)&_getEEInfo; - callbacks[113] = (delegate* unmanaged)&_getJitTimeLogFilename; - callbacks[114] = (delegate* unmanaged)&_getMethodDefFromMethod; - callbacks[115] = (delegate* unmanaged)&_printMethodName; - callbacks[116] = (delegate* unmanaged)&_getMethodNameFromMetadata; - callbacks[117] = (delegate* unmanaged)&_getMethodHash; - callbacks[118] = (delegate* unmanaged)&_getSystemVAmd64PassStructInRegisterDescriptor; - callbacks[119] = (delegate* unmanaged)&_getLoongArch64PassStructInRegisterFlags; - callbacks[120] = (delegate* unmanaged)&_getRISCV64PassStructInRegisterFlags; - callbacks[121] = (delegate* unmanaged)&_getThreadTLSIndex; - callbacks[122] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; - callbacks[123] = (delegate* unmanaged)&_getHelperFtn; - callbacks[124] = (delegate* unmanaged)&_getFunctionEntryPoint; - callbacks[125] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; - callbacks[126] = (delegate* unmanaged)&_getMethodSync; - callbacks[127] = (delegate* unmanaged)&_getLazyStringLiteralHelper; - callbacks[128] = (delegate* unmanaged)&_embedModuleHandle; - callbacks[129] = (delegate* unmanaged)&_embedClassHandle; - callbacks[130] = (delegate* unmanaged)&_embedMethodHandle; - callbacks[131] = (delegate* unmanaged)&_embedFieldHandle; - callbacks[132] = (delegate* unmanaged)&_embedGenericHandle; - callbacks[133] = (delegate* unmanaged)&_getLocationOfThisType; - callbacks[134] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; - callbacks[135] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; - callbacks[136] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; - callbacks[137] = (delegate* unmanaged)&_getJustMyCodeHandle; - callbacks[138] = (delegate* unmanaged)&_GetProfilingHandle; - callbacks[139] = (delegate* unmanaged)&_getCallInfo; - callbacks[140] = (delegate* unmanaged)&_getClassDomainID; - callbacks[141] = (delegate* unmanaged)&_getStaticFieldContent; - callbacks[142] = (delegate* unmanaged)&_getObjectContent; - callbacks[143] = (delegate* unmanaged)&_getStaticFieldCurrentClass; - callbacks[144] = (delegate* unmanaged)&_getVarArgsHandle; - callbacks[145] = (delegate* unmanaged)&_canGetVarArgsHandle; - callbacks[146] = (delegate* unmanaged)&_constructStringLiteral; - callbacks[147] = (delegate* unmanaged)&_emptyStringLiteral; - callbacks[148] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; - callbacks[149] = (delegate* unmanaged)&_GetDelegateCtor; - callbacks[150] = (delegate* unmanaged)&_MethodCompileComplete; - callbacks[151] = (delegate* unmanaged)&_getTailCallHelpers; - callbacks[152] = (delegate* unmanaged)&_convertPInvokeCalliToCall; - callbacks[153] = (delegate* unmanaged)&_notifyInstructionSetUsage; - callbacks[154] = (delegate* unmanaged)&_updateEntryPointForTailCall; - callbacks[155] = (delegate* unmanaged)&_allocMem; - callbacks[156] = (delegate* unmanaged)&_reserveUnwindInfo; - callbacks[157] = (delegate* unmanaged)&_allocUnwindInfo; - callbacks[158] = (delegate* unmanaged)&_allocGCInfo; - callbacks[159] = (delegate* unmanaged)&_setEHcount; - callbacks[160] = (delegate* unmanaged)&_setEHinfo; - callbacks[161] = (delegate* unmanaged)&_logMsg; - callbacks[162] = (delegate* unmanaged)&_doAssert; - callbacks[163] = (delegate* unmanaged)&_reportFatalError; - callbacks[164] = (delegate* unmanaged)&_getPgoInstrumentationResults; - callbacks[165] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; - callbacks[166] = (delegate* unmanaged)&_recordCallSite; - callbacks[167] = (delegate* unmanaged)&_recordRelocation; - callbacks[168] = (delegate* unmanaged)&_getRelocTypeHint; - callbacks[169] = (delegate* unmanaged)&_getExpectedTargetArchitecture; - callbacks[170] = (delegate* unmanaged)&_getJitFlags; + callbacks[32] = (delegate* unmanaged)&_isValidStringRef; + callbacks[33] = (delegate* unmanaged)&_getStringLiteral; + callbacks[34] = (delegate* unmanaged)&_printObjectDescription; + callbacks[35] = (delegate* unmanaged)&_asCorInfoType; + callbacks[36] = (delegate* unmanaged)&_getClassNameFromMetadata; + callbacks[37] = (delegate* unmanaged)&_getTypeInstantiationArgument; + callbacks[38] = (delegate* unmanaged)&_printClassName; + callbacks[39] = (delegate* unmanaged)&_isValueClass; + callbacks[40] = (delegate* unmanaged)&_canInlineTypeCheck; + callbacks[41] = (delegate* unmanaged)&_getClassAttribs; + callbacks[42] = (delegate* unmanaged)&_getClassModule; + callbacks[43] = (delegate* unmanaged)&_getModuleAssembly; + callbacks[44] = (delegate* unmanaged)&_getAssemblyName; + callbacks[45] = (delegate* unmanaged)&_LongLifetimeMalloc; + callbacks[46] = (delegate* unmanaged)&_LongLifetimeFree; + callbacks[47] = (delegate* unmanaged)&_getClassModuleIdForStatics; + callbacks[48] = (delegate* unmanaged)&_getIsClassInitedFlagAddress; + callbacks[49] = (delegate* unmanaged)&_getStaticBaseAddress; + callbacks[50] = (delegate* unmanaged)&_getClassSize; + callbacks[51] = (delegate* unmanaged)&_getHeapClassSize; + callbacks[52] = (delegate* unmanaged)&_canAllocateOnStack; + callbacks[53] = (delegate* unmanaged)&_getClassAlignmentRequirement; + callbacks[54] = (delegate* unmanaged)&_getClassGClayout; + callbacks[55] = (delegate* unmanaged)&_getClassNumInstanceFields; + callbacks[56] = (delegate* unmanaged)&_getFieldInClass; + callbacks[57] = (delegate* unmanaged)&_checkMethodModifier; + callbacks[58] = (delegate* unmanaged)&_getNewHelper; + callbacks[59] = (delegate* unmanaged)&_getNewArrHelper; + callbacks[60] = (delegate* unmanaged)&_getCastingHelper; + callbacks[61] = (delegate* unmanaged)&_getSharedCCtorHelper; + callbacks[62] = (delegate* unmanaged)&_getTypeForBox; + callbacks[63] = (delegate* unmanaged)&_getBoxHelper; + callbacks[64] = (delegate* unmanaged)&_getUnBoxHelper; + callbacks[65] = (delegate* unmanaged)&_getRuntimeTypePointer; + callbacks[66] = (delegate* unmanaged)&_isObjectImmutable; + callbacks[67] = (delegate* unmanaged)&_getStringChar; + callbacks[68] = (delegate* unmanaged)&_getObjectType; + callbacks[69] = (delegate* unmanaged)&_getReadyToRunHelper; + callbacks[70] = (delegate* unmanaged)&_getReadyToRunDelegateCtorHelper; + callbacks[71] = (delegate* unmanaged)&_initClass; + callbacks[72] = (delegate* unmanaged)&_classMustBeLoadedBeforeCodeIsRun; + callbacks[73] = (delegate* unmanaged)&_getBuiltinClass; + callbacks[74] = (delegate* unmanaged)&_getTypeForPrimitiveValueClass; + callbacks[75] = (delegate* unmanaged)&_getTypeForPrimitiveNumericClass; + callbacks[76] = (delegate* unmanaged)&_canCast; + callbacks[77] = (delegate* unmanaged)&_compareTypesForCast; + callbacks[78] = (delegate* unmanaged)&_compareTypesForEquality; + callbacks[79] = (delegate* unmanaged)&_isMoreSpecificType; + callbacks[80] = (delegate* unmanaged)&_isEnum; + callbacks[81] = (delegate* unmanaged)&_getParentType; + callbacks[82] = (delegate* unmanaged)&_getChildType; + callbacks[83] = (delegate* unmanaged)&_isSDArray; + callbacks[84] = (delegate* unmanaged)&_getArrayRank; + callbacks[85] = (delegate* unmanaged)&_getArrayIntrinsicID; + callbacks[86] = (delegate* unmanaged)&_getArrayInitializationData; + callbacks[87] = (delegate* unmanaged)&_canAccessClass; + callbacks[88] = (delegate* unmanaged)&_printFieldName; + callbacks[89] = (delegate* unmanaged)&_getFieldClass; + callbacks[90] = (delegate* unmanaged)&_getFieldType; + callbacks[91] = (delegate* unmanaged)&_getFieldOffset; + callbacks[92] = (delegate* unmanaged)&_getFieldInfo; + callbacks[93] = (delegate* unmanaged)&_getThreadLocalFieldInfo; + callbacks[94] = (delegate* unmanaged)&_getThreadLocalStaticBlocksInfo; + callbacks[95] = (delegate* unmanaged)&_isFieldStatic; + callbacks[96] = (delegate* unmanaged)&_getArrayOrStringLength; + callbacks[97] = (delegate* unmanaged)&_getBoundaries; + callbacks[98] = (delegate* unmanaged)&_setBoundaries; + callbacks[99] = (delegate* unmanaged)&_getVars; + callbacks[100] = (delegate* unmanaged)&_setVars; + callbacks[101] = (delegate* unmanaged)&_reportRichMappings; + callbacks[102] = (delegate* unmanaged)&_allocateArray; + callbacks[103] = (delegate* unmanaged)&_freeArray; + callbacks[104] = (delegate* unmanaged)&_getArgNext; + callbacks[105] = (delegate* unmanaged)&_getArgType; + callbacks[106] = (delegate* unmanaged)&_getExactClasses; + callbacks[107] = (delegate* unmanaged)&_getArgClass; + callbacks[108] = (delegate* unmanaged)&_getHFAType; + callbacks[109] = (delegate* unmanaged)&_runWithErrorTrap; + callbacks[110] = (delegate* unmanaged)&_runWithSPMIErrorTrap; + callbacks[111] = (delegate* unmanaged)&_getEEInfo; + callbacks[112] = (delegate* unmanaged)&_getJitTimeLogFilename; + callbacks[113] = (delegate* unmanaged)&_getMethodDefFromMethod; + callbacks[114] = (delegate* unmanaged)&_printMethodName; + callbacks[115] = (delegate* unmanaged)&_getMethodNameFromMetadata; + callbacks[116] = (delegate* unmanaged)&_getMethodHash; + callbacks[117] = (delegate* unmanaged)&_getSystemVAmd64PassStructInRegisterDescriptor; + callbacks[118] = (delegate* unmanaged)&_getLoongArch64PassStructInRegisterFlags; + callbacks[119] = (delegate* unmanaged)&_getRISCV64PassStructInRegisterFlags; + callbacks[120] = (delegate* unmanaged)&_getThreadTLSIndex; + callbacks[121] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; + callbacks[122] = (delegate* unmanaged)&_getHelperFtn; + callbacks[123] = (delegate* unmanaged)&_getFunctionEntryPoint; + callbacks[124] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; + callbacks[125] = (delegate* unmanaged)&_getMethodSync; + callbacks[126] = (delegate* unmanaged)&_getLazyStringLiteralHelper; + callbacks[127] = (delegate* unmanaged)&_embedModuleHandle; + callbacks[128] = (delegate* unmanaged)&_embedClassHandle; + callbacks[129] = (delegate* unmanaged)&_embedMethodHandle; + callbacks[130] = (delegate* unmanaged)&_embedFieldHandle; + callbacks[131] = (delegate* unmanaged)&_embedGenericHandle; + callbacks[132] = (delegate* unmanaged)&_getLocationOfThisType; + callbacks[133] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; + callbacks[134] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; + callbacks[135] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; + callbacks[136] = (delegate* unmanaged)&_getJustMyCodeHandle; + callbacks[137] = (delegate* unmanaged)&_GetProfilingHandle; + callbacks[138] = (delegate* unmanaged)&_getCallInfo; + callbacks[139] = (delegate* unmanaged)&_getClassDomainID; + callbacks[140] = (delegate* unmanaged)&_getStaticFieldContent; + callbacks[141] = (delegate* unmanaged)&_getObjectContent; + callbacks[142] = (delegate* unmanaged)&_getStaticFieldCurrentClass; + callbacks[143] = (delegate* unmanaged)&_getVarArgsHandle; + callbacks[144] = (delegate* unmanaged)&_canGetVarArgsHandle; + callbacks[145] = (delegate* unmanaged)&_constructStringLiteral; + callbacks[146] = (delegate* unmanaged)&_emptyStringLiteral; + callbacks[147] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; + callbacks[148] = (delegate* unmanaged)&_GetDelegateCtor; + callbacks[149] = (delegate* unmanaged)&_MethodCompileComplete; + callbacks[150] = (delegate* unmanaged)&_getTailCallHelpers; + callbacks[151] = (delegate* unmanaged)&_convertPInvokeCalliToCall; + callbacks[152] = (delegate* unmanaged)&_notifyInstructionSetUsage; + callbacks[153] = (delegate* unmanaged)&_updateEntryPointForTailCall; + callbacks[154] = (delegate* unmanaged)&_allocMem; + callbacks[155] = (delegate* unmanaged)&_reserveUnwindInfo; + callbacks[156] = (delegate* unmanaged)&_allocUnwindInfo; + callbacks[157] = (delegate* unmanaged)&_allocGCInfo; + callbacks[158] = (delegate* unmanaged)&_setEHcount; + callbacks[159] = (delegate* unmanaged)&_setEHinfo; + callbacks[160] = (delegate* unmanaged)&_logMsg; + callbacks[161] = (delegate* unmanaged)&_doAssert; + callbacks[162] = (delegate* unmanaged)&_reportFatalError; + callbacks[163] = (delegate* unmanaged)&_getPgoInstrumentationResults; + callbacks[164] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; + callbacks[165] = (delegate* unmanaged)&_recordCallSite; + callbacks[166] = (delegate* unmanaged)&_recordRelocation; + callbacks[167] = (delegate* unmanaged)&_getRelocTypeHint; + callbacks[168] = (delegate* unmanaged)&_getExpectedTargetArchitecture; + callbacks[169] = (delegate* unmanaged)&_getJitFlags; return (IntPtr)callbacks; } diff --git a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt index bce6b654c0fb8e..552bada196339d 100644 --- a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt +++ b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt @@ -191,7 +191,6 @@ FUNCTIONS void findSig( CORINFO_MODULE_HANDLE module, unsigned sigTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO *sig ); void findCallSiteSig( CORINFO_MODULE_HANDLE module,unsigned methTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO *sig) CORINFO_CLASS_HANDLE getTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken) - bool isValidToken(CORINFO_MODULE_HANDLE module, unsigned metaTOK) bool isValidStringRef(CORINFO_MODULE_HANDLE module, unsigned metaTOK) int getStringLiteral(CORINFO_MODULE_HANDLE module, unsigned metaTOK, char16_t* buffer, int bufferSize, int startIndex) size_t printObjectDescription(CORINFO_OBJECT_HANDLE handle, char* buffer, size_t bufferSize, size_t* pRequiredBufferSize) diff --git a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h index 65c7275336f307..fc9584537e09f2 100644 --- a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h +++ b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h @@ -43,7 +43,6 @@ struct JitInterfaceCallbacks void (* findSig)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_MODULE_HANDLE module, unsigned sigTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO* sig); void (* findCallSiteSig)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_MODULE_HANDLE module, unsigned methTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO* sig); CORINFO_CLASS_HANDLE (* getTokenTypeAsHandle)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken); - bool (* isValidToken)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_MODULE_HANDLE module, unsigned metaTOK); bool (* isValidStringRef)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_MODULE_HANDLE module, unsigned metaTOK); int (* getStringLiteral)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_MODULE_HANDLE module, unsigned metaTOK, char16_t* buffer, int bufferSize, int startIndex); size_t (* printObjectDescription)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_OBJECT_HANDLE handle, char* buffer, size_t bufferSize, size_t* pRequiredBufferSize); @@ -505,16 +504,6 @@ class JitInterfaceWrapper : public ICorJitInfo return temp; } - virtual bool isValidToken( - CORINFO_MODULE_HANDLE module, - unsigned metaTOK) -{ - CorInfoExceptionClass* pException = nullptr; - bool temp = _callbacks->isValidToken(_thisHandle, &pException, module, metaTOK); - if (pException != nullptr) throw pException; - return temp; -} - virtual bool isValidStringRef( CORINFO_MODULE_HANDLE module, unsigned metaTOK) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h index 15794630a7a1b1..57e50ac73c0dfc 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h @@ -153,7 +153,6 @@ LWM(PrintObjectDescription, DWORDLONG, Agnostic_PrintResult) LWM(PrintClassName, DWORDLONG, Agnostic_PrintResult) LWM(PrintFieldName, DWORDLONG, Agnostic_PrintResult) LWM(PrintMethodName, DWORDLONG, Agnostic_PrintResult) -LWM(IsValidToken, DLD, DWORD) LWM(IsValueClass, DWORDLONG, DWORD) LWM(IsMoreSpecificType, DLDL, DWORD) LWM(IsEnum, DWORDLONG, DLD) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp index 6f86567eb6ee19..7ef369ec944c5d 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp @@ -6243,37 +6243,6 @@ bool MethodContext::repDoesFieldBelongToClass(CORINFO_FIELD_HANDLE fld, CORINFO_ return value != 0; } -void MethodContext::recIsValidToken(CORINFO_MODULE_HANDLE module, unsigned metaTOK, bool result) -{ - if (IsValidToken == nullptr) - IsValidToken = new LightWeightMap(); - - DLD key; - ZeroMemory(&key, sizeof(key)); // Zero key including any struct padding - key.A = CastHandle(module); - key.B = (DWORD)metaTOK; - - DWORD value = result ? 1 : 0; - IsValidToken->Add(key, value); - DEBUG_REC(dmpIsValidToken(key, value)); -} -void MethodContext::dmpIsValidToken(DLD key, DWORD value) -{ - printf("IsValidToken key mod-%016" PRIX64 " tok-%08X, value res-%u", key.A, key.B, value); -} -bool MethodContext::repIsValidToken(CORINFO_MODULE_HANDLE module, unsigned metaTOK) -{ - DLD key; - ZeroMemory(&key, sizeof(key)); // Zero key including any struct padding - key.A = CastHandle(module); - key.B = (DWORD)metaTOK; - - DWORD value = LookupByKeyOrMiss(IsValidToken, key, ": key %016" PRIX64 "", key.A); - - DEBUG_REP(dmpIsValidToken(key, value)); - return value != 0; -} - void MethodContext::recGetClassNameFromMetadata(CORINFO_CLASS_HANDLE cls, char* className, const char** namespaceName) { if (GetClassNameFromMetadata == nullptr) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h index 3919536cc42a38..6466bbc2824f5f 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h @@ -766,10 +766,6 @@ class MethodContext void dmpDoesFieldBelongToClass(DLDL key, bool value); bool repDoesFieldBelongToClass(CORINFO_FIELD_HANDLE fld, CORINFO_CLASS_HANDLE cls); - void recIsValidToken(CORINFO_MODULE_HANDLE module, unsigned metaTOK, bool result); - void dmpIsValidToken(DLD key, DWORD value); - bool repIsValidToken(CORINFO_MODULE_HANDLE module, unsigned metaTOK); - void recGetClassNameFromMetadata(CORINFO_CLASS_HANDLE cls, char* className, const char** namespaceName); void dmpGetClassNameFromMetadata(DLD key, DD value); const char* repGetClassNameFromMetadata(CORINFO_CLASS_HANDLE cls, const char** namespaceName); @@ -1068,7 +1064,7 @@ enum mcPackets //Retired5 = 141, Packet_CheckMethodModifier = 142, Packet_CompileMethod = 143, - Packet_IsValidToken = 144, + //Packet_IsValidToken = 144, //Packet_FindNameOfToken = 145, //PacketCR_RecordCallSite = 146, Packet_GetLazyStringLiteralHelper = 147, diff --git a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp index d0a62218abd404..069f6f0babefaf 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp @@ -393,17 +393,6 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getTokenTypeAsHandle(CORINFO_RESOLVED_TOK return temp; } -// Checks if the given metadata token is valid -bool interceptor_ICJI::isValidToken(CORINFO_MODULE_HANDLE module, /* IN */ - unsigned metaTOK /* IN */ - ) -{ - mc->cr->AddCall("isValidToken"); - bool result = original_ICorJitInfo->isValidToken(module, metaTOK); - mc->recIsValidToken(module, metaTOK, result); - return result; -} - // Checks if the given metadata token is valid StringRef bool interceptor_ICJI::isValidStringRef(CORINFO_MODULE_HANDLE module, /* IN */ unsigned metaTOK /* IN */ diff --git a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp index 0c63671910d4bf..efe360c25f083b 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp @@ -270,14 +270,6 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getTokenTypeAsHandle( return original_ICorJitInfo->getTokenTypeAsHandle(pResolvedToken); } -bool interceptor_ICJI::isValidToken( - CORINFO_MODULE_HANDLE module, - unsigned metaTOK) -{ - mcs->AddCall("isValidToken"); - return original_ICorJitInfo->isValidToken(module, metaTOK); -} - bool interceptor_ICJI::isValidStringRef( CORINFO_MODULE_HANDLE module, unsigned metaTOK) diff --git a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp index 54ec398035eba0..71baeb11b353dd 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp @@ -238,13 +238,6 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getTokenTypeAsHandle( return original_ICorJitInfo->getTokenTypeAsHandle(pResolvedToken); } -bool interceptor_ICJI::isValidToken( - CORINFO_MODULE_HANDLE module, - unsigned metaTOK) -{ - return original_ICorJitInfo->isValidToken(module, metaTOK); -} - bool interceptor_ICJI::isValidStringRef( CORINFO_MODULE_HANDLE module, unsigned metaTOK) diff --git a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp index 0b7a09bf058c41..7bc3b40b3684f1 100644 --- a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp @@ -337,15 +337,6 @@ CORINFO_CLASS_HANDLE MyICJI::getTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN* pResol return jitInstance->mc->repGetTokenTypeAsHandle(pResolvedToken); } -// Checks if the given metadata token is valid -bool MyICJI::isValidToken(CORINFO_MODULE_HANDLE module, /* IN */ - unsigned metaTOK /* IN */ - ) -{ - jitInstance->mc->cr->AddCall("isValidToken"); - return jitInstance->mc->repIsValidToken(module, metaTOK); -} - // Checks if the given metadata token is valid StringRef bool MyICJI::isValidStringRef(CORINFO_MODULE_HANDLE module, /* IN */ unsigned metaTOK /* IN */ diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index 27d30b9b43849a..bb1891e4aca85d 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -612,38 +612,6 @@ CORINFO_CLASS_HANDLE CEEInfo::getTokenTypeAsHandle (CORINFO_RESOLVED_TOKEN * pRe } -/*********************************************************************/ -// Checks if the given metadata token is valid -bool CEEInfo::isValidToken ( - CORINFO_MODULE_HANDLE module, - mdToken metaTOK) -{ - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - MODE_ANY; - } CONTRACTL_END; - - bool result = false; - - JIT_TO_EE_TRANSITION_LEAF(); - - if (IsDynamicScope(module)) - { - // No explicit token validation for dynamic code. Validation is - // side-effect of token resolution. - result = true; - } - else - { - result = ((Module *)module)->GetMDImport()->IsValidToken(metaTOK); - } - - EE_TO_JIT_TRANSITION_LEAF(); - - return result; -} - /*********************************************************************/ // Checks if the given metadata token is valid StringRef bool CEEInfo::isValidStringRef ( From 2024846e4b55ada645a4d3d8a49280cf2afee536 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Fri, 16 Jun 2023 10:28:44 -0700 Subject: [PATCH 12/16] Remove isValidStringRef --- src/coreclr/inc/corinfo.h | 6 - src/coreclr/inc/icorjitinfoimpl_generated.h | 4 - src/coreclr/jit/ICorJitInfo_names_generated.h | 1 - .../jit/ICorJitInfo_wrapper_generated.hpp | 10 - .../tools/Common/JitInterface/CorInfoImpl.cs | 3 - .../JitInterface/CorInfoImpl_generated.cs | 292 +++++++++--------- .../ThunkGenerator/ThunkInput.txt | 1 - .../aot/jitinterface/jitinterface_generated.h | 11 - .../tools/superpmi/superpmi-shared/lwmlist.h | 1 - .../superpmi-shared/methodcontext.cpp | 31 -- .../superpmi-shim-collector/icorjitinfo.cpp | 11 - .../icorjitinfo_generated.cpp | 8 - .../icorjitinfo_generated.cpp | 7 - .../tools/superpmi/superpmi/icorjitinfo.cpp | 9 - src/coreclr/vm/ceeload.cpp | 12 - src/coreclr/vm/ceeload.h | 2 - src/coreclr/vm/jitinterface.cpp | 37 --- 17 files changed, 138 insertions(+), 308 deletions(-) diff --git a/src/coreclr/inc/corinfo.h b/src/coreclr/inc/corinfo.h index a8c744364f7a40..5c10c994367543 100644 --- a/src/coreclr/inc/corinfo.h +++ b/src/coreclr/inc/corinfo.h @@ -2235,12 +2235,6 @@ class ICorStaticInfo virtual CORINFO_CLASS_HANDLE getTokenTypeAsHandle ( CORINFO_RESOLVED_TOKEN * pResolvedToken /* IN */) = 0; - // Checks if the given metadata token is valid StringRef - virtual bool isValidStringRef ( - CORINFO_MODULE_HANDLE module, /* IN */ - unsigned metaTOK /* IN */ - ) = 0; - // Returns (sub)string length and content (can be null for dynamic context) // for given metaTOK and module, length `-1` means input is incorrect virtual int getStringLiteral ( diff --git a/src/coreclr/inc/icorjitinfoimpl_generated.h b/src/coreclr/inc/icorjitinfoimpl_generated.h index 82fe93315e3b1e..63f7fc8f72ace9 100644 --- a/src/coreclr/inc/icorjitinfoimpl_generated.h +++ b/src/coreclr/inc/icorjitinfoimpl_generated.h @@ -151,10 +151,6 @@ void findCallSiteSig( CORINFO_CLASS_HANDLE getTokenTypeAsHandle( CORINFO_RESOLVED_TOKEN* pResolvedToken) override; -bool isValidStringRef( - CORINFO_MODULE_HANDLE module, - unsigned metaTOK) override; - int getStringLiteral( CORINFO_MODULE_HANDLE module, unsigned metaTOK, diff --git a/src/coreclr/jit/ICorJitInfo_names_generated.h b/src/coreclr/jit/ICorJitInfo_names_generated.h index 1aeeda3bb5d4be..2136491fc023f0 100644 --- a/src/coreclr/jit/ICorJitInfo_names_generated.h +++ b/src/coreclr/jit/ICorJitInfo_names_generated.h @@ -36,7 +36,6 @@ DEF_CLR_API(resolveToken) DEF_CLR_API(findSig) DEF_CLR_API(findCallSiteSig) DEF_CLR_API(getTokenTypeAsHandle) -DEF_CLR_API(isValidStringRef) DEF_CLR_API(getStringLiteral) DEF_CLR_API(printObjectDescription) DEF_CLR_API(asCorInfoType) diff --git a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp index e71bbf683c98f3..2349b1b19f20fc 100644 --- a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp +++ b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp @@ -320,16 +320,6 @@ CORINFO_CLASS_HANDLE WrapICorJitInfo::getTokenTypeAsHandle( return temp; } -bool WrapICorJitInfo::isValidStringRef( - CORINFO_MODULE_HANDLE module, - unsigned metaTOK) -{ - API_ENTER(isValidStringRef); - bool temp = wrapHnd->isValidStringRef(module, metaTOK); - API_LEAVE(isValidStringRef); - return temp; -} - int WrapICorJitInfo::getStringLiteral( CORINFO_MODULE_HANDLE module, unsigned metaTOK, diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs index e4110f8ba99738..c36fd6eebe9edd 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs @@ -1857,9 +1857,6 @@ private static CorInfoCanSkipVerificationResult canSkipVerification(CORINFO_MODU return CorInfoCanSkipVerificationResult.CORINFO_VERIFICATION_CAN_SKIP; } - private bool isValidStringRef(CORINFO_MODULE_STRUCT_* module, uint metaTOK) - { throw new NotImplementedException("isValidStringRef"); } - private int getStringLiteral(CORINFO_MODULE_STRUCT_* module, uint metaTOK, char* buffer, int size, int startIndex) { Debug.Assert(size >= 0); diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs index 419ed349b05faf..9810c79c7635f6 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs @@ -478,21 +478,6 @@ private static void _findCallSiteSig(IntPtr thisHandle, IntPtr* ppException, COR } } - [UnmanagedCallersOnly] - private static byte _isValidStringRef(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK) - { - var _this = GetThis(thisHandle); - try - { - return _this.isValidStringRef(module, metaTOK) ? (byte)1 : (byte)0; - } - catch (Exception ex) - { - *ppException = _this.AllocException(ex); - return default; - } - } - [UnmanagedCallersOnly] private static int _getStringLiteral(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK, char* buffer, int bufferSize, int startIndex) { @@ -2522,7 +2507,7 @@ private static uint _getJitFlags(IntPtr thisHandle, IntPtr* ppException, CORJIT_ private static IntPtr GetUnmanagedCallbacks() { - void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 170); + void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 169); callbacks[0] = (delegate* unmanaged)&_isIntrinsic; callbacks[1] = (delegate* unmanaged)&_getMethodAttribs; @@ -2556,144 +2541,143 @@ private static IntPtr GetUnmanagedCallbacks() callbacks[29] = (delegate* unmanaged)&_findSig; callbacks[30] = (delegate* unmanaged)&_findCallSiteSig; callbacks[31] = (delegate* unmanaged)&_getTokenTypeAsHandle; - callbacks[32] = (delegate* unmanaged)&_isValidStringRef; - callbacks[33] = (delegate* unmanaged)&_getStringLiteral; - callbacks[34] = (delegate* unmanaged)&_printObjectDescription; - callbacks[35] = (delegate* unmanaged)&_asCorInfoType; - callbacks[36] = (delegate* unmanaged)&_getClassNameFromMetadata; - callbacks[37] = (delegate* unmanaged)&_getTypeInstantiationArgument; - callbacks[38] = (delegate* unmanaged)&_printClassName; - callbacks[39] = (delegate* unmanaged)&_isValueClass; - callbacks[40] = (delegate* unmanaged)&_canInlineTypeCheck; - callbacks[41] = (delegate* unmanaged)&_getClassAttribs; - callbacks[42] = (delegate* unmanaged)&_getClassModule; - callbacks[43] = (delegate* unmanaged)&_getModuleAssembly; - callbacks[44] = (delegate* unmanaged)&_getAssemblyName; - callbacks[45] = (delegate* unmanaged)&_LongLifetimeMalloc; - callbacks[46] = (delegate* unmanaged)&_LongLifetimeFree; - callbacks[47] = (delegate* unmanaged)&_getClassModuleIdForStatics; - callbacks[48] = (delegate* unmanaged)&_getIsClassInitedFlagAddress; - callbacks[49] = (delegate* unmanaged)&_getStaticBaseAddress; - callbacks[50] = (delegate* unmanaged)&_getClassSize; - callbacks[51] = (delegate* unmanaged)&_getHeapClassSize; - callbacks[52] = (delegate* unmanaged)&_canAllocateOnStack; - callbacks[53] = (delegate* unmanaged)&_getClassAlignmentRequirement; - callbacks[54] = (delegate* unmanaged)&_getClassGClayout; - callbacks[55] = (delegate* unmanaged)&_getClassNumInstanceFields; - callbacks[56] = (delegate* unmanaged)&_getFieldInClass; - callbacks[57] = (delegate* unmanaged)&_checkMethodModifier; - callbacks[58] = (delegate* unmanaged)&_getNewHelper; - callbacks[59] = (delegate* unmanaged)&_getNewArrHelper; - callbacks[60] = (delegate* unmanaged)&_getCastingHelper; - callbacks[61] = (delegate* unmanaged)&_getSharedCCtorHelper; - callbacks[62] = (delegate* unmanaged)&_getTypeForBox; - callbacks[63] = (delegate* unmanaged)&_getBoxHelper; - callbacks[64] = (delegate* unmanaged)&_getUnBoxHelper; - callbacks[65] = (delegate* unmanaged)&_getRuntimeTypePointer; - callbacks[66] = (delegate* unmanaged)&_isObjectImmutable; - callbacks[67] = (delegate* unmanaged)&_getStringChar; - callbacks[68] = (delegate* unmanaged)&_getObjectType; - callbacks[69] = (delegate* unmanaged)&_getReadyToRunHelper; - callbacks[70] = (delegate* unmanaged)&_getReadyToRunDelegateCtorHelper; - callbacks[71] = (delegate* unmanaged)&_initClass; - callbacks[72] = (delegate* unmanaged)&_classMustBeLoadedBeforeCodeIsRun; - callbacks[73] = (delegate* unmanaged)&_getBuiltinClass; - callbacks[74] = (delegate* unmanaged)&_getTypeForPrimitiveValueClass; - callbacks[75] = (delegate* unmanaged)&_getTypeForPrimitiveNumericClass; - callbacks[76] = (delegate* unmanaged)&_canCast; - callbacks[77] = (delegate* unmanaged)&_compareTypesForCast; - callbacks[78] = (delegate* unmanaged)&_compareTypesForEquality; - callbacks[79] = (delegate* unmanaged)&_isMoreSpecificType; - callbacks[80] = (delegate* unmanaged)&_isEnum; - callbacks[81] = (delegate* unmanaged)&_getParentType; - callbacks[82] = (delegate* unmanaged)&_getChildType; - callbacks[83] = (delegate* unmanaged)&_isSDArray; - callbacks[84] = (delegate* unmanaged)&_getArrayRank; - callbacks[85] = (delegate* unmanaged)&_getArrayIntrinsicID; - callbacks[86] = (delegate* unmanaged)&_getArrayInitializationData; - callbacks[87] = (delegate* unmanaged)&_canAccessClass; - callbacks[88] = (delegate* unmanaged)&_printFieldName; - callbacks[89] = (delegate* unmanaged)&_getFieldClass; - callbacks[90] = (delegate* unmanaged)&_getFieldType; - callbacks[91] = (delegate* unmanaged)&_getFieldOffset; - callbacks[92] = (delegate* unmanaged)&_getFieldInfo; - callbacks[93] = (delegate* unmanaged)&_getThreadLocalFieldInfo; - callbacks[94] = (delegate* unmanaged)&_getThreadLocalStaticBlocksInfo; - callbacks[95] = (delegate* unmanaged)&_isFieldStatic; - callbacks[96] = (delegate* unmanaged)&_getArrayOrStringLength; - callbacks[97] = (delegate* unmanaged)&_getBoundaries; - callbacks[98] = (delegate* unmanaged)&_setBoundaries; - callbacks[99] = (delegate* unmanaged)&_getVars; - callbacks[100] = (delegate* unmanaged)&_setVars; - callbacks[101] = (delegate* unmanaged)&_reportRichMappings; - callbacks[102] = (delegate* unmanaged)&_allocateArray; - callbacks[103] = (delegate* unmanaged)&_freeArray; - callbacks[104] = (delegate* unmanaged)&_getArgNext; - callbacks[105] = (delegate* unmanaged)&_getArgType; - callbacks[106] = (delegate* unmanaged)&_getExactClasses; - callbacks[107] = (delegate* unmanaged)&_getArgClass; - callbacks[108] = (delegate* unmanaged)&_getHFAType; - callbacks[109] = (delegate* unmanaged)&_runWithErrorTrap; - callbacks[110] = (delegate* unmanaged)&_runWithSPMIErrorTrap; - callbacks[111] = (delegate* unmanaged)&_getEEInfo; - callbacks[112] = (delegate* unmanaged)&_getJitTimeLogFilename; - callbacks[113] = (delegate* unmanaged)&_getMethodDefFromMethod; - callbacks[114] = (delegate* unmanaged)&_printMethodName; - callbacks[115] = (delegate* unmanaged)&_getMethodNameFromMetadata; - callbacks[116] = (delegate* unmanaged)&_getMethodHash; - callbacks[117] = (delegate* unmanaged)&_getSystemVAmd64PassStructInRegisterDescriptor; - callbacks[118] = (delegate* unmanaged)&_getLoongArch64PassStructInRegisterFlags; - callbacks[119] = (delegate* unmanaged)&_getRISCV64PassStructInRegisterFlags; - callbacks[120] = (delegate* unmanaged)&_getThreadTLSIndex; - callbacks[121] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; - callbacks[122] = (delegate* unmanaged)&_getHelperFtn; - callbacks[123] = (delegate* unmanaged)&_getFunctionEntryPoint; - callbacks[124] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; - callbacks[125] = (delegate* unmanaged)&_getMethodSync; - callbacks[126] = (delegate* unmanaged)&_getLazyStringLiteralHelper; - callbacks[127] = (delegate* unmanaged)&_embedModuleHandle; - callbacks[128] = (delegate* unmanaged)&_embedClassHandle; - callbacks[129] = (delegate* unmanaged)&_embedMethodHandle; - callbacks[130] = (delegate* unmanaged)&_embedFieldHandle; - callbacks[131] = (delegate* unmanaged)&_embedGenericHandle; - callbacks[132] = (delegate* unmanaged)&_getLocationOfThisType; - callbacks[133] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; - callbacks[134] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; - callbacks[135] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; - callbacks[136] = (delegate* unmanaged)&_getJustMyCodeHandle; - callbacks[137] = (delegate* unmanaged)&_GetProfilingHandle; - callbacks[138] = (delegate* unmanaged)&_getCallInfo; - callbacks[139] = (delegate* unmanaged)&_getClassDomainID; - callbacks[140] = (delegate* unmanaged)&_getStaticFieldContent; - callbacks[141] = (delegate* unmanaged)&_getObjectContent; - callbacks[142] = (delegate* unmanaged)&_getStaticFieldCurrentClass; - callbacks[143] = (delegate* unmanaged)&_getVarArgsHandle; - callbacks[144] = (delegate* unmanaged)&_canGetVarArgsHandle; - callbacks[145] = (delegate* unmanaged)&_constructStringLiteral; - callbacks[146] = (delegate* unmanaged)&_emptyStringLiteral; - callbacks[147] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; - callbacks[148] = (delegate* unmanaged)&_GetDelegateCtor; - callbacks[149] = (delegate* unmanaged)&_MethodCompileComplete; - callbacks[150] = (delegate* unmanaged)&_getTailCallHelpers; - callbacks[151] = (delegate* unmanaged)&_convertPInvokeCalliToCall; - callbacks[152] = (delegate* unmanaged)&_notifyInstructionSetUsage; - callbacks[153] = (delegate* unmanaged)&_updateEntryPointForTailCall; - callbacks[154] = (delegate* unmanaged)&_allocMem; - callbacks[155] = (delegate* unmanaged)&_reserveUnwindInfo; - callbacks[156] = (delegate* unmanaged)&_allocUnwindInfo; - callbacks[157] = (delegate* unmanaged)&_allocGCInfo; - callbacks[158] = (delegate* unmanaged)&_setEHcount; - callbacks[159] = (delegate* unmanaged)&_setEHinfo; - callbacks[160] = (delegate* unmanaged)&_logMsg; - callbacks[161] = (delegate* unmanaged)&_doAssert; - callbacks[162] = (delegate* unmanaged)&_reportFatalError; - callbacks[163] = (delegate* unmanaged)&_getPgoInstrumentationResults; - callbacks[164] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; - callbacks[165] = (delegate* unmanaged)&_recordCallSite; - callbacks[166] = (delegate* unmanaged)&_recordRelocation; - callbacks[167] = (delegate* unmanaged)&_getRelocTypeHint; - callbacks[168] = (delegate* unmanaged)&_getExpectedTargetArchitecture; - callbacks[169] = (delegate* unmanaged)&_getJitFlags; + callbacks[32] = (delegate* unmanaged)&_getStringLiteral; + callbacks[33] = (delegate* unmanaged)&_printObjectDescription; + callbacks[34] = (delegate* unmanaged)&_asCorInfoType; + callbacks[35] = (delegate* unmanaged)&_getClassNameFromMetadata; + callbacks[36] = (delegate* unmanaged)&_getTypeInstantiationArgument; + callbacks[37] = (delegate* unmanaged)&_printClassName; + callbacks[38] = (delegate* unmanaged)&_isValueClass; + callbacks[39] = (delegate* unmanaged)&_canInlineTypeCheck; + callbacks[40] = (delegate* unmanaged)&_getClassAttribs; + callbacks[41] = (delegate* unmanaged)&_getClassModule; + callbacks[42] = (delegate* unmanaged)&_getModuleAssembly; + callbacks[43] = (delegate* unmanaged)&_getAssemblyName; + callbacks[44] = (delegate* unmanaged)&_LongLifetimeMalloc; + callbacks[45] = (delegate* unmanaged)&_LongLifetimeFree; + callbacks[46] = (delegate* unmanaged)&_getClassModuleIdForStatics; + callbacks[47] = (delegate* unmanaged)&_getIsClassInitedFlagAddress; + callbacks[48] = (delegate* unmanaged)&_getStaticBaseAddress; + callbacks[49] = (delegate* unmanaged)&_getClassSize; + callbacks[50] = (delegate* unmanaged)&_getHeapClassSize; + callbacks[51] = (delegate* unmanaged)&_canAllocateOnStack; + callbacks[52] = (delegate* unmanaged)&_getClassAlignmentRequirement; + callbacks[53] = (delegate* unmanaged)&_getClassGClayout; + callbacks[54] = (delegate* unmanaged)&_getClassNumInstanceFields; + callbacks[55] = (delegate* unmanaged)&_getFieldInClass; + callbacks[56] = (delegate* unmanaged)&_checkMethodModifier; + callbacks[57] = (delegate* unmanaged)&_getNewHelper; + callbacks[58] = (delegate* unmanaged)&_getNewArrHelper; + callbacks[59] = (delegate* unmanaged)&_getCastingHelper; + callbacks[60] = (delegate* unmanaged)&_getSharedCCtorHelper; + callbacks[61] = (delegate* unmanaged)&_getTypeForBox; + callbacks[62] = (delegate* unmanaged)&_getBoxHelper; + callbacks[63] = (delegate* unmanaged)&_getUnBoxHelper; + callbacks[64] = (delegate* unmanaged)&_getRuntimeTypePointer; + callbacks[65] = (delegate* unmanaged)&_isObjectImmutable; + callbacks[66] = (delegate* unmanaged)&_getStringChar; + callbacks[67] = (delegate* unmanaged)&_getObjectType; + callbacks[68] = (delegate* unmanaged)&_getReadyToRunHelper; + callbacks[69] = (delegate* unmanaged)&_getReadyToRunDelegateCtorHelper; + callbacks[70] = (delegate* unmanaged)&_initClass; + callbacks[71] = (delegate* unmanaged)&_classMustBeLoadedBeforeCodeIsRun; + callbacks[72] = (delegate* unmanaged)&_getBuiltinClass; + callbacks[73] = (delegate* unmanaged)&_getTypeForPrimitiveValueClass; + callbacks[74] = (delegate* unmanaged)&_getTypeForPrimitiveNumericClass; + callbacks[75] = (delegate* unmanaged)&_canCast; + callbacks[76] = (delegate* unmanaged)&_compareTypesForCast; + callbacks[77] = (delegate* unmanaged)&_compareTypesForEquality; + callbacks[78] = (delegate* unmanaged)&_isMoreSpecificType; + callbacks[79] = (delegate* unmanaged)&_isEnum; + callbacks[80] = (delegate* unmanaged)&_getParentType; + callbacks[81] = (delegate* unmanaged)&_getChildType; + callbacks[82] = (delegate* unmanaged)&_isSDArray; + callbacks[83] = (delegate* unmanaged)&_getArrayRank; + callbacks[84] = (delegate* unmanaged)&_getArrayIntrinsicID; + callbacks[85] = (delegate* unmanaged)&_getArrayInitializationData; + callbacks[86] = (delegate* unmanaged)&_canAccessClass; + callbacks[87] = (delegate* unmanaged)&_printFieldName; + callbacks[88] = (delegate* unmanaged)&_getFieldClass; + callbacks[89] = (delegate* unmanaged)&_getFieldType; + callbacks[90] = (delegate* unmanaged)&_getFieldOffset; + callbacks[91] = (delegate* unmanaged)&_getFieldInfo; + callbacks[92] = (delegate* unmanaged)&_getThreadLocalFieldInfo; + callbacks[93] = (delegate* unmanaged)&_getThreadLocalStaticBlocksInfo; + callbacks[94] = (delegate* unmanaged)&_isFieldStatic; + callbacks[95] = (delegate* unmanaged)&_getArrayOrStringLength; + callbacks[96] = (delegate* unmanaged)&_getBoundaries; + callbacks[97] = (delegate* unmanaged)&_setBoundaries; + callbacks[98] = (delegate* unmanaged)&_getVars; + callbacks[99] = (delegate* unmanaged)&_setVars; + callbacks[100] = (delegate* unmanaged)&_reportRichMappings; + callbacks[101] = (delegate* unmanaged)&_allocateArray; + callbacks[102] = (delegate* unmanaged)&_freeArray; + callbacks[103] = (delegate* unmanaged)&_getArgNext; + callbacks[104] = (delegate* unmanaged)&_getArgType; + callbacks[105] = (delegate* unmanaged)&_getExactClasses; + callbacks[106] = (delegate* unmanaged)&_getArgClass; + callbacks[107] = (delegate* unmanaged)&_getHFAType; + callbacks[108] = (delegate* unmanaged)&_runWithErrorTrap; + callbacks[109] = (delegate* unmanaged)&_runWithSPMIErrorTrap; + callbacks[110] = (delegate* unmanaged)&_getEEInfo; + callbacks[111] = (delegate* unmanaged)&_getJitTimeLogFilename; + callbacks[112] = (delegate* unmanaged)&_getMethodDefFromMethod; + callbacks[113] = (delegate* unmanaged)&_printMethodName; + callbacks[114] = (delegate* unmanaged)&_getMethodNameFromMetadata; + callbacks[115] = (delegate* unmanaged)&_getMethodHash; + callbacks[116] = (delegate* unmanaged)&_getSystemVAmd64PassStructInRegisterDescriptor; + callbacks[117] = (delegate* unmanaged)&_getLoongArch64PassStructInRegisterFlags; + callbacks[118] = (delegate* unmanaged)&_getRISCV64PassStructInRegisterFlags; + callbacks[119] = (delegate* unmanaged)&_getThreadTLSIndex; + callbacks[120] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; + callbacks[121] = (delegate* unmanaged)&_getHelperFtn; + callbacks[122] = (delegate* unmanaged)&_getFunctionEntryPoint; + callbacks[123] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; + callbacks[124] = (delegate* unmanaged)&_getMethodSync; + callbacks[125] = (delegate* unmanaged)&_getLazyStringLiteralHelper; + callbacks[126] = (delegate* unmanaged)&_embedModuleHandle; + callbacks[127] = (delegate* unmanaged)&_embedClassHandle; + callbacks[128] = (delegate* unmanaged)&_embedMethodHandle; + callbacks[129] = (delegate* unmanaged)&_embedFieldHandle; + callbacks[130] = (delegate* unmanaged)&_embedGenericHandle; + callbacks[131] = (delegate* unmanaged)&_getLocationOfThisType; + callbacks[132] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; + callbacks[133] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; + callbacks[134] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; + callbacks[135] = (delegate* unmanaged)&_getJustMyCodeHandle; + callbacks[136] = (delegate* unmanaged)&_GetProfilingHandle; + callbacks[137] = (delegate* unmanaged)&_getCallInfo; + callbacks[138] = (delegate* unmanaged)&_getClassDomainID; + callbacks[139] = (delegate* unmanaged)&_getStaticFieldContent; + callbacks[140] = (delegate* unmanaged)&_getObjectContent; + callbacks[141] = (delegate* unmanaged)&_getStaticFieldCurrentClass; + callbacks[142] = (delegate* unmanaged)&_getVarArgsHandle; + callbacks[143] = (delegate* unmanaged)&_canGetVarArgsHandle; + callbacks[144] = (delegate* unmanaged)&_constructStringLiteral; + callbacks[145] = (delegate* unmanaged)&_emptyStringLiteral; + callbacks[146] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; + callbacks[147] = (delegate* unmanaged)&_GetDelegateCtor; + callbacks[148] = (delegate* unmanaged)&_MethodCompileComplete; + callbacks[149] = (delegate* unmanaged)&_getTailCallHelpers; + callbacks[150] = (delegate* unmanaged)&_convertPInvokeCalliToCall; + callbacks[151] = (delegate* unmanaged)&_notifyInstructionSetUsage; + callbacks[152] = (delegate* unmanaged)&_updateEntryPointForTailCall; + callbacks[153] = (delegate* unmanaged)&_allocMem; + callbacks[154] = (delegate* unmanaged)&_reserveUnwindInfo; + callbacks[155] = (delegate* unmanaged)&_allocUnwindInfo; + callbacks[156] = (delegate* unmanaged)&_allocGCInfo; + callbacks[157] = (delegate* unmanaged)&_setEHcount; + callbacks[158] = (delegate* unmanaged)&_setEHinfo; + callbacks[159] = (delegate* unmanaged)&_logMsg; + callbacks[160] = (delegate* unmanaged)&_doAssert; + callbacks[161] = (delegate* unmanaged)&_reportFatalError; + callbacks[162] = (delegate* unmanaged)&_getPgoInstrumentationResults; + callbacks[163] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; + callbacks[164] = (delegate* unmanaged)&_recordCallSite; + callbacks[165] = (delegate* unmanaged)&_recordRelocation; + callbacks[166] = (delegate* unmanaged)&_getRelocTypeHint; + callbacks[167] = (delegate* unmanaged)&_getExpectedTargetArchitecture; + callbacks[168] = (delegate* unmanaged)&_getJitFlags; return (IntPtr)callbacks; } diff --git a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt index 552bada196339d..1fb6bbd78a3ee6 100644 --- a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt +++ b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt @@ -191,7 +191,6 @@ FUNCTIONS void findSig( CORINFO_MODULE_HANDLE module, unsigned sigTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO *sig ); void findCallSiteSig( CORINFO_MODULE_HANDLE module,unsigned methTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO *sig) CORINFO_CLASS_HANDLE getTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken) - bool isValidStringRef(CORINFO_MODULE_HANDLE module, unsigned metaTOK) int getStringLiteral(CORINFO_MODULE_HANDLE module, unsigned metaTOK, char16_t* buffer, int bufferSize, int startIndex) size_t printObjectDescription(CORINFO_OBJECT_HANDLE handle, char* buffer, size_t bufferSize, size_t* pRequiredBufferSize) CorInfoType asCorInfoType(CORINFO_CLASS_HANDLE cls) diff --git a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h index fc9584537e09f2..8a6cf1e457acac 100644 --- a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h +++ b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h @@ -43,7 +43,6 @@ struct JitInterfaceCallbacks void (* findSig)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_MODULE_HANDLE module, unsigned sigTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO* sig); void (* findCallSiteSig)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_MODULE_HANDLE module, unsigned methTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO* sig); CORINFO_CLASS_HANDLE (* getTokenTypeAsHandle)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken); - bool (* isValidStringRef)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_MODULE_HANDLE module, unsigned metaTOK); int (* getStringLiteral)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_MODULE_HANDLE module, unsigned metaTOK, char16_t* buffer, int bufferSize, int startIndex); size_t (* printObjectDescription)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_OBJECT_HANDLE handle, char* buffer, size_t bufferSize, size_t* pRequiredBufferSize); CorInfoType (* asCorInfoType)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE cls); @@ -504,16 +503,6 @@ class JitInterfaceWrapper : public ICorJitInfo return temp; } - virtual bool isValidStringRef( - CORINFO_MODULE_HANDLE module, - unsigned metaTOK) -{ - CorInfoExceptionClass* pException = nullptr; - bool temp = _callbacks->isValidStringRef(_thisHandle, &pException, module, metaTOK); - if (pException != nullptr) throw pException; - return temp; -} - virtual int getStringLiteral( CORINFO_MODULE_HANDLE module, unsigned metaTOK, diff --git a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h index 57e50ac73c0dfc..d0be35c4689c82 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h @@ -147,7 +147,6 @@ LWM(GetArrayOrStringLength, DWORDLONG, DWORD) LWM(ExpandRawHandleIntrinsic, Agnostic_CORINFO_RESOLVED_TOKENin, Agnostic_CORINFO_GENERICHANDLE_RESULT) LWM(IsIntrinsicType, DWORDLONG, DWORD) LWM(IsSDArray, DWORDLONG, DWORD) -LWM(IsValidStringRef, DLD, DWORD) LWM(GetStringLiteral, DLDDD, DD) LWM(PrintObjectDescription, DWORDLONG, Agnostic_PrintResult) LWM(PrintClassName, DWORDLONG, Agnostic_PrintResult) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp index 7ef369ec944c5d..219c01facaad07 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp @@ -4886,37 +4886,6 @@ bool MethodContext::repSatisfiesMethodConstraints(CORINFO_CLASS_HANDLE parent, C return value != 0; } -void MethodContext::recIsValidStringRef(CORINFO_MODULE_HANDLE module, unsigned metaTOK, bool result) -{ - if (IsValidStringRef == nullptr) - IsValidStringRef = new LightWeightMap(); - - DLD key; - ZeroMemory(&key, sizeof(key)); // Zero key including any struct padding - key.A = CastHandle(module); - key.B = (DWORD)metaTOK; - - DWORD value = result ? 1 : 0; - IsValidStringRef->Add(key, value); - DEBUG_REC(dmpIsValidStringRef(key, value)); -} -void MethodContext::dmpIsValidStringRef(DLD key, DWORD value) -{ - printf("IsValidStringRef key mod-%016" PRIX64 " tok-%08X, value res-%u", key.A, key.B, value); -} -bool MethodContext::repIsValidStringRef(CORINFO_MODULE_HANDLE module, unsigned metaTOK) -{ - DLD key; - ZeroMemory(&key, sizeof(key)); // Zero key including any struct padding - key.A = CastHandle(module); - key.B = (DWORD)metaTOK; - - DWORD value = LookupByKeyOrMissNoMessage(IsValidStringRef, key); - - DEBUG_REP(dmpIsValidStringRef(key, value)); - return value != 0; -} - void MethodContext::recGetStringLiteral(CORINFO_MODULE_HANDLE module, unsigned metaTOK, char16_t* buffer, int bufferSize, int startIndex, int length) { if (GetStringLiteral == nullptr) diff --git a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp index 069f6f0babefaf..16006277f8ff14 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp @@ -393,17 +393,6 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getTokenTypeAsHandle(CORINFO_RESOLVED_TOK return temp; } -// Checks if the given metadata token is valid StringRef -bool interceptor_ICJI::isValidStringRef(CORINFO_MODULE_HANDLE module, /* IN */ - unsigned metaTOK /* IN */ - ) -{ - mc->cr->AddCall("isValidStringRef"); - bool temp = original_ICorJitInfo->isValidStringRef(module, metaTOK); - mc->recIsValidStringRef(module, metaTOK, temp); - return temp; -} - int interceptor_ICJI::getStringLiteral(CORINFO_MODULE_HANDLE module, /* IN */ unsigned metaTOK, /* IN */ char16_t* buffer, /* OUT */ diff --git a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp index efe360c25f083b..9f6dbf39dac493 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp @@ -270,14 +270,6 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getTokenTypeAsHandle( return original_ICorJitInfo->getTokenTypeAsHandle(pResolvedToken); } -bool interceptor_ICJI::isValidStringRef( - CORINFO_MODULE_HANDLE module, - unsigned metaTOK) -{ - mcs->AddCall("isValidStringRef"); - return original_ICorJitInfo->isValidStringRef(module, metaTOK); -} - int interceptor_ICJI::getStringLiteral( CORINFO_MODULE_HANDLE module, unsigned metaTOK, diff --git a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp index 71baeb11b353dd..679d088c68473d 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp @@ -238,13 +238,6 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getTokenTypeAsHandle( return original_ICorJitInfo->getTokenTypeAsHandle(pResolvedToken); } -bool interceptor_ICJI::isValidStringRef( - CORINFO_MODULE_HANDLE module, - unsigned metaTOK) -{ - return original_ICorJitInfo->isValidStringRef(module, metaTOK); -} - int interceptor_ICJI::getStringLiteral( CORINFO_MODULE_HANDLE module, unsigned metaTOK, diff --git a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp index 7bc3b40b3684f1..f8b2aea25749e2 100644 --- a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp @@ -337,15 +337,6 @@ CORINFO_CLASS_HANDLE MyICJI::getTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN* pResol return jitInstance->mc->repGetTokenTypeAsHandle(pResolvedToken); } -// Checks if the given metadata token is valid StringRef -bool MyICJI::isValidStringRef(CORINFO_MODULE_HANDLE module, /* IN */ - unsigned metaTOK /* IN */ - ) -{ - jitInstance->mc->cr->AddCall("isValidStringRef"); - return jitInstance->mc->repIsValidStringRef(module, metaTOK); -} - int MyICJI::getStringLiteral(CORINFO_MODULE_HANDLE module, /* IN */ unsigned metaTOK, /* IN */ char16_t* buffer, /* OUT */ diff --git a/src/coreclr/vm/ceeload.cpp b/src/coreclr/vm/ceeload.cpp index 46e596e29c49af..244ec5dc09adb2 100644 --- a/src/coreclr/vm/ceeload.cpp +++ b/src/coreclr/vm/ceeload.cpp @@ -2813,18 +2813,6 @@ OBJECTHANDLE ModuleBase::ResolveStringRef(DWORD token, void** ppPinnedString) return string; } -// -// Used by the verifier. Returns whether this stringref is valid. -// -CHECK Module::CheckStringRef(DWORD token) -{ - LIMITED_METHOD_CONTRACT; - CHECK(TypeFromToken(token)==mdtString); - CHECK(!IsNilToken(token)); - CHECK(GetMDImport()->IsValidToken(token)); - CHECK_OK; -} - mdToken Module::GetEntryPointToken() { WRAPPER_NO_CONTRACT; diff --git a/src/coreclr/vm/ceeload.h b/src/coreclr/vm/ceeload.h index 4eff6e66aab090..77ef721e7711d3 100644 --- a/src/coreclr/vm/ceeload.h +++ b/src/coreclr/vm/ceeload.h @@ -1179,8 +1179,6 @@ class Module : public ModuleBase // the class load, which avoids the need for a 'being loaded' list MethodTable* CreateArrayMethodTable(TypeHandle elemType, CorElementType kind, unsigned rank, class AllocMemTracker *pamTracker); - CHECK CheckStringRef(RVA rva); - // Module/Assembly traversal Assembly * GetAssemblyIfLoaded( mdAssemblyRef kAssemblyRef, diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index bb1891e4aca85d..6532ad04345ce0 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -612,43 +612,6 @@ CORINFO_CLASS_HANDLE CEEInfo::getTokenTypeAsHandle (CORINFO_RESOLVED_TOKEN * pRe } -/*********************************************************************/ -// Checks if the given metadata token is valid StringRef -bool CEEInfo::isValidStringRef ( - CORINFO_MODULE_HANDLE module, - mdToken metaTOK) -{ - CONTRACTL { - THROWS; - GC_TRIGGERS; - MODE_PREEMPTIVE; - } CONTRACTL_END; - - bool result = true; - - JIT_TO_EE_TRANSITION(); - - if (IsDynamicScope(module)) - { - result = GetDynamicResolver(module)->IsValidStringRef(metaTOK); - } - else - { - result = ((Module *)module)->CheckStringRef(metaTOK); - if (result) - { - DWORD dwCharCount; - LPCWSTR pString; - result = (!FAILED(((Module *)module)->GetMDImport()->GetUserString(metaTOK, &dwCharCount, NULL, &pString)) && - pString != NULL); - } - } - - EE_TO_JIT_TRANSITION(); - - return result; -} - int CEEInfo::getStringLiteral ( CORINFO_MODULE_HANDLE moduleHnd, mdToken metaTOK, From 27b0ef0dd10ede4cab99e22c5b03a40eabbb54f8 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Fri, 16 Jun 2023 10:34:40 -0700 Subject: [PATCH 13/16] Remove getMethodModule --- src/coreclr/inc/corinfo.h | 5 - src/coreclr/inc/icorjitinfoimpl_generated.h | 3 - src/coreclr/jit/ICorJitInfo_names_generated.h | 1 - .../jit/ICorJitInfo_wrapper_generated.hpp | 9 - .../tools/Common/JitInterface/CorInfoImpl.cs | 16 - .../JitInterface/CorInfoImpl_generated.cs | 330 +++++++++--------- .../ThunkGenerator/ThunkInput.txt | 1 - .../aot/jitinterface/jitinterface_generated.h | 10 - .../tools/superpmi/superpmi-shared/lwmlist.h | 1 - .../superpmi-shared/methodcontext.cpp | 23 -- .../superpmi/superpmi-shared/methodcontext.h | 6 +- .../superpmi-shim-collector/icorjitinfo.cpp | 9 - .../icorjitinfo_generated.cpp | 7 - .../icorjitinfo_generated.cpp | 6 - .../tools/superpmi/superpmi/icorjitinfo.cpp | 7 - src/coreclr/vm/jitinterface.cpp | 31 -- 16 files changed, 158 insertions(+), 307 deletions(-) diff --git a/src/coreclr/inc/corinfo.h b/src/coreclr/inc/corinfo.h index 5c10c994367543..10f0ceef459023 100644 --- a/src/coreclr/inc/corinfo.h +++ b/src/coreclr/inc/corinfo.h @@ -2099,11 +2099,6 @@ class ICorStaticInfo CORINFO_METHOD_HANDLE method ) = 0; - // return module it belongs to - virtual CORINFO_MODULE_HANDLE getMethodModule ( - CORINFO_METHOD_HANDLE method - ) = 0; - // This function returns the offset of the specified method in the // vtable of it's owning class or interface. virtual void getMethodVTableOffset ( diff --git a/src/coreclr/inc/icorjitinfoimpl_generated.h b/src/coreclr/inc/icorjitinfoimpl_generated.h index 63f7fc8f72ace9..c4260ca8d22b5b 100644 --- a/src/coreclr/inc/icorjitinfoimpl_generated.h +++ b/src/coreclr/inc/icorjitinfoimpl_generated.h @@ -75,9 +75,6 @@ void getEHinfo( CORINFO_CLASS_HANDLE getMethodClass( CORINFO_METHOD_HANDLE method) override; -CORINFO_MODULE_HANDLE getMethodModule( - CORINFO_METHOD_HANDLE method) override; - void getMethodVTableOffset( CORINFO_METHOD_HANDLE method, unsigned* offsetOfIndirection, diff --git a/src/coreclr/jit/ICorJitInfo_names_generated.h b/src/coreclr/jit/ICorJitInfo_names_generated.h index 2136491fc023f0..7a7f975e50f990 100644 --- a/src/coreclr/jit/ICorJitInfo_names_generated.h +++ b/src/coreclr/jit/ICorJitInfo_names_generated.h @@ -16,7 +16,6 @@ DEF_CLR_API(canTailCall) DEF_CLR_API(reportTailCallDecision) DEF_CLR_API(getEHinfo) DEF_CLR_API(getMethodClass) -DEF_CLR_API(getMethodModule) DEF_CLR_API(getMethodVTableOffset) DEF_CLR_API(resolveVirtualMethod) DEF_CLR_API(getUnboxedEntry) diff --git a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp index 2349b1b19f20fc..5a0d97c4d75997 100644 --- a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp +++ b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp @@ -132,15 +132,6 @@ CORINFO_CLASS_HANDLE WrapICorJitInfo::getMethodClass( return temp; } -CORINFO_MODULE_HANDLE WrapICorJitInfo::getMethodModule( - CORINFO_METHOD_HANDLE method) -{ - API_ENTER(getMethodModule); - CORINFO_MODULE_HANDLE temp = wrapHnd->getMethodModule(method); - API_LEAVE(getMethodModule); - return temp; -} - void WrapICorJitInfo::getMethodVTableOffset( CORINFO_METHOD_HANDLE method, unsigned* offsetOfIndirection, diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs index c36fd6eebe9edd..7b7aead6355a6c 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs @@ -1236,22 +1236,6 @@ private void getEHinfo(CORINFO_METHOD_STRUCT_* ftn, uint EHnumber, ref CORINFO_E return ObjectToHandle(m.OwningType); } - private CORINFO_MODULE_STRUCT_* getMethodModule(CORINFO_METHOD_STRUCT_* method) - { - MethodDesc m = HandleToObject(method); - if (m is UnboxingMethodDesc unboxingMethodDesc) - { - m = unboxingMethodDesc.Target; - } - - MethodIL methodIL = _compilation.GetMethodIL(m); - if (methodIL == null) - { - return null; - } - return ObjectToHandle(methodIL); - } - private bool resolveVirtualMethod(CORINFO_DEVIRTUALIZATION_INFO* info) { // Initialize OUT fields diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs index 9810c79c7635f6..90c18297660408 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs @@ -186,21 +186,6 @@ private static void _getEHinfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_M } } - [UnmanagedCallersOnly] - private static CORINFO_MODULE_STRUCT_* _getMethodModule(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method) - { - var _this = GetThis(thisHandle); - try - { - return _this.getMethodModule(method); - } - catch (Exception ex) - { - *ppException = _this.AllocException(ex); - return default; - } - } - [UnmanagedCallersOnly] private static void _getMethodVTableOffset(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, uint* offsetOfIndirection, uint* offsetAfterIndirection, bool* isRelative) { @@ -2507,7 +2492,7 @@ private static uint _getJitFlags(IntPtr thisHandle, IntPtr* ppException, CORJIT_ private static IntPtr GetUnmanagedCallbacks() { - void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 169); + void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 168); callbacks[0] = (delegate* unmanaged)&_isIntrinsic; callbacks[1] = (delegate* unmanaged)&_getMethodAttribs; @@ -2521,163 +2506,162 @@ private static IntPtr GetUnmanagedCallbacks() callbacks[9] = (delegate* unmanaged)&_reportTailCallDecision; callbacks[10] = (delegate* unmanaged)&_getEHinfo; callbacks[11] = (delegate* unmanaged)&_getMethodClass; - callbacks[12] = (delegate* unmanaged)&_getMethodModule; - callbacks[13] = (delegate* unmanaged)&_getMethodVTableOffset; - callbacks[14] = (delegate* unmanaged)&_resolveVirtualMethod; - callbacks[15] = (delegate* unmanaged)&_getUnboxedEntry; - callbacks[16] = (delegate* unmanaged)&_getDefaultComparerClass; - callbacks[17] = (delegate* unmanaged)&_getDefaultEqualityComparerClass; - callbacks[18] = (delegate* unmanaged)&_expandRawHandleIntrinsic; - callbacks[19] = (delegate* unmanaged)&_isIntrinsicType; - callbacks[20] = (delegate* unmanaged)&_getUnmanagedCallConv; - callbacks[21] = (delegate* unmanaged)&_pInvokeMarshalingRequired; - callbacks[22] = (delegate* unmanaged)&_satisfiesMethodConstraints; - callbacks[23] = (delegate* unmanaged)&_methodMustBeLoadedBeforeCodeIsRun; - callbacks[24] = (delegate* unmanaged)&_mapMethodDeclToMethodImpl; - callbacks[25] = (delegate* unmanaged)&_getGSCookie; - callbacks[26] = (delegate* unmanaged)&_setPatchpointInfo; - callbacks[27] = (delegate* unmanaged)&_getOSRInfo; - callbacks[28] = (delegate* unmanaged)&_resolveToken; - callbacks[29] = (delegate* unmanaged)&_findSig; - callbacks[30] = (delegate* unmanaged)&_findCallSiteSig; - callbacks[31] = (delegate* unmanaged)&_getTokenTypeAsHandle; - callbacks[32] = (delegate* unmanaged)&_getStringLiteral; - callbacks[33] = (delegate* unmanaged)&_printObjectDescription; - callbacks[34] = (delegate* unmanaged)&_asCorInfoType; - callbacks[35] = (delegate* unmanaged)&_getClassNameFromMetadata; - callbacks[36] = (delegate* unmanaged)&_getTypeInstantiationArgument; - callbacks[37] = (delegate* unmanaged)&_printClassName; - callbacks[38] = (delegate* unmanaged)&_isValueClass; - callbacks[39] = (delegate* unmanaged)&_canInlineTypeCheck; - callbacks[40] = (delegate* unmanaged)&_getClassAttribs; - callbacks[41] = (delegate* unmanaged)&_getClassModule; - callbacks[42] = (delegate* unmanaged)&_getModuleAssembly; - callbacks[43] = (delegate* unmanaged)&_getAssemblyName; - callbacks[44] = (delegate* unmanaged)&_LongLifetimeMalloc; - callbacks[45] = (delegate* unmanaged)&_LongLifetimeFree; - callbacks[46] = (delegate* unmanaged)&_getClassModuleIdForStatics; - callbacks[47] = (delegate* unmanaged)&_getIsClassInitedFlagAddress; - callbacks[48] = (delegate* unmanaged)&_getStaticBaseAddress; - callbacks[49] = (delegate* unmanaged)&_getClassSize; - callbacks[50] = (delegate* unmanaged)&_getHeapClassSize; - callbacks[51] = (delegate* unmanaged)&_canAllocateOnStack; - callbacks[52] = (delegate* unmanaged)&_getClassAlignmentRequirement; - callbacks[53] = (delegate* unmanaged)&_getClassGClayout; - callbacks[54] = (delegate* unmanaged)&_getClassNumInstanceFields; - callbacks[55] = (delegate* unmanaged)&_getFieldInClass; - callbacks[56] = (delegate* unmanaged)&_checkMethodModifier; - callbacks[57] = (delegate* unmanaged)&_getNewHelper; - callbacks[58] = (delegate* unmanaged)&_getNewArrHelper; - callbacks[59] = (delegate* unmanaged)&_getCastingHelper; - callbacks[60] = (delegate* unmanaged)&_getSharedCCtorHelper; - callbacks[61] = (delegate* unmanaged)&_getTypeForBox; - callbacks[62] = (delegate* unmanaged)&_getBoxHelper; - callbacks[63] = (delegate* unmanaged)&_getUnBoxHelper; - callbacks[64] = (delegate* unmanaged)&_getRuntimeTypePointer; - callbacks[65] = (delegate* unmanaged)&_isObjectImmutable; - callbacks[66] = (delegate* unmanaged)&_getStringChar; - callbacks[67] = (delegate* unmanaged)&_getObjectType; - callbacks[68] = (delegate* unmanaged)&_getReadyToRunHelper; - callbacks[69] = (delegate* unmanaged)&_getReadyToRunDelegateCtorHelper; - callbacks[70] = (delegate* unmanaged)&_initClass; - callbacks[71] = (delegate* unmanaged)&_classMustBeLoadedBeforeCodeIsRun; - callbacks[72] = (delegate* unmanaged)&_getBuiltinClass; - callbacks[73] = (delegate* unmanaged)&_getTypeForPrimitiveValueClass; - callbacks[74] = (delegate* unmanaged)&_getTypeForPrimitiveNumericClass; - callbacks[75] = (delegate* unmanaged)&_canCast; - callbacks[76] = (delegate* unmanaged)&_compareTypesForCast; - callbacks[77] = (delegate* unmanaged)&_compareTypesForEquality; - callbacks[78] = (delegate* unmanaged)&_isMoreSpecificType; - callbacks[79] = (delegate* unmanaged)&_isEnum; - callbacks[80] = (delegate* unmanaged)&_getParentType; - callbacks[81] = (delegate* unmanaged)&_getChildType; - callbacks[82] = (delegate* unmanaged)&_isSDArray; - callbacks[83] = (delegate* unmanaged)&_getArrayRank; - callbacks[84] = (delegate* unmanaged)&_getArrayIntrinsicID; - callbacks[85] = (delegate* unmanaged)&_getArrayInitializationData; - callbacks[86] = (delegate* unmanaged)&_canAccessClass; - callbacks[87] = (delegate* unmanaged)&_printFieldName; - callbacks[88] = (delegate* unmanaged)&_getFieldClass; - callbacks[89] = (delegate* unmanaged)&_getFieldType; - callbacks[90] = (delegate* unmanaged)&_getFieldOffset; - callbacks[91] = (delegate* unmanaged)&_getFieldInfo; - callbacks[92] = (delegate* unmanaged)&_getThreadLocalFieldInfo; - callbacks[93] = (delegate* unmanaged)&_getThreadLocalStaticBlocksInfo; - callbacks[94] = (delegate* unmanaged)&_isFieldStatic; - callbacks[95] = (delegate* unmanaged)&_getArrayOrStringLength; - callbacks[96] = (delegate* unmanaged)&_getBoundaries; - callbacks[97] = (delegate* unmanaged)&_setBoundaries; - callbacks[98] = (delegate* unmanaged)&_getVars; - callbacks[99] = (delegate* unmanaged)&_setVars; - callbacks[100] = (delegate* unmanaged)&_reportRichMappings; - callbacks[101] = (delegate* unmanaged)&_allocateArray; - callbacks[102] = (delegate* unmanaged)&_freeArray; - callbacks[103] = (delegate* unmanaged)&_getArgNext; - callbacks[104] = (delegate* unmanaged)&_getArgType; - callbacks[105] = (delegate* unmanaged)&_getExactClasses; - callbacks[106] = (delegate* unmanaged)&_getArgClass; - callbacks[107] = (delegate* unmanaged)&_getHFAType; - callbacks[108] = (delegate* unmanaged)&_runWithErrorTrap; - callbacks[109] = (delegate* unmanaged)&_runWithSPMIErrorTrap; - callbacks[110] = (delegate* unmanaged)&_getEEInfo; - callbacks[111] = (delegate* unmanaged)&_getJitTimeLogFilename; - callbacks[112] = (delegate* unmanaged)&_getMethodDefFromMethod; - callbacks[113] = (delegate* unmanaged)&_printMethodName; - callbacks[114] = (delegate* unmanaged)&_getMethodNameFromMetadata; - callbacks[115] = (delegate* unmanaged)&_getMethodHash; - callbacks[116] = (delegate* unmanaged)&_getSystemVAmd64PassStructInRegisterDescriptor; - callbacks[117] = (delegate* unmanaged)&_getLoongArch64PassStructInRegisterFlags; - callbacks[118] = (delegate* unmanaged)&_getRISCV64PassStructInRegisterFlags; - callbacks[119] = (delegate* unmanaged)&_getThreadTLSIndex; - callbacks[120] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; - callbacks[121] = (delegate* unmanaged)&_getHelperFtn; - callbacks[122] = (delegate* unmanaged)&_getFunctionEntryPoint; - callbacks[123] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; - callbacks[124] = (delegate* unmanaged)&_getMethodSync; - callbacks[125] = (delegate* unmanaged)&_getLazyStringLiteralHelper; - callbacks[126] = (delegate* unmanaged)&_embedModuleHandle; - callbacks[127] = (delegate* unmanaged)&_embedClassHandle; - callbacks[128] = (delegate* unmanaged)&_embedMethodHandle; - callbacks[129] = (delegate* unmanaged)&_embedFieldHandle; - callbacks[130] = (delegate* unmanaged)&_embedGenericHandle; - callbacks[131] = (delegate* unmanaged)&_getLocationOfThisType; - callbacks[132] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; - callbacks[133] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; - callbacks[134] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; - callbacks[135] = (delegate* unmanaged)&_getJustMyCodeHandle; - callbacks[136] = (delegate* unmanaged)&_GetProfilingHandle; - callbacks[137] = (delegate* unmanaged)&_getCallInfo; - callbacks[138] = (delegate* unmanaged)&_getClassDomainID; - callbacks[139] = (delegate* unmanaged)&_getStaticFieldContent; - callbacks[140] = (delegate* unmanaged)&_getObjectContent; - callbacks[141] = (delegate* unmanaged)&_getStaticFieldCurrentClass; - callbacks[142] = (delegate* unmanaged)&_getVarArgsHandle; - callbacks[143] = (delegate* unmanaged)&_canGetVarArgsHandle; - callbacks[144] = (delegate* unmanaged)&_constructStringLiteral; - callbacks[145] = (delegate* unmanaged)&_emptyStringLiteral; - callbacks[146] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; - callbacks[147] = (delegate* unmanaged)&_GetDelegateCtor; - callbacks[148] = (delegate* unmanaged)&_MethodCompileComplete; - callbacks[149] = (delegate* unmanaged)&_getTailCallHelpers; - callbacks[150] = (delegate* unmanaged)&_convertPInvokeCalliToCall; - callbacks[151] = (delegate* unmanaged)&_notifyInstructionSetUsage; - callbacks[152] = (delegate* unmanaged)&_updateEntryPointForTailCall; - callbacks[153] = (delegate* unmanaged)&_allocMem; - callbacks[154] = (delegate* unmanaged)&_reserveUnwindInfo; - callbacks[155] = (delegate* unmanaged)&_allocUnwindInfo; - callbacks[156] = (delegate* unmanaged)&_allocGCInfo; - callbacks[157] = (delegate* unmanaged)&_setEHcount; - callbacks[158] = (delegate* unmanaged)&_setEHinfo; - callbacks[159] = (delegate* unmanaged)&_logMsg; - callbacks[160] = (delegate* unmanaged)&_doAssert; - callbacks[161] = (delegate* unmanaged)&_reportFatalError; - callbacks[162] = (delegate* unmanaged)&_getPgoInstrumentationResults; - callbacks[163] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; - callbacks[164] = (delegate* unmanaged)&_recordCallSite; - callbacks[165] = (delegate* unmanaged)&_recordRelocation; - callbacks[166] = (delegate* unmanaged)&_getRelocTypeHint; - callbacks[167] = (delegate* unmanaged)&_getExpectedTargetArchitecture; - callbacks[168] = (delegate* unmanaged)&_getJitFlags; + callbacks[12] = (delegate* unmanaged)&_getMethodVTableOffset; + callbacks[13] = (delegate* unmanaged)&_resolveVirtualMethod; + callbacks[14] = (delegate* unmanaged)&_getUnboxedEntry; + callbacks[15] = (delegate* unmanaged)&_getDefaultComparerClass; + callbacks[16] = (delegate* unmanaged)&_getDefaultEqualityComparerClass; + callbacks[17] = (delegate* unmanaged)&_expandRawHandleIntrinsic; + callbacks[18] = (delegate* unmanaged)&_isIntrinsicType; + callbacks[19] = (delegate* unmanaged)&_getUnmanagedCallConv; + callbacks[20] = (delegate* unmanaged)&_pInvokeMarshalingRequired; + callbacks[21] = (delegate* unmanaged)&_satisfiesMethodConstraints; + callbacks[22] = (delegate* unmanaged)&_methodMustBeLoadedBeforeCodeIsRun; + callbacks[23] = (delegate* unmanaged)&_mapMethodDeclToMethodImpl; + callbacks[24] = (delegate* unmanaged)&_getGSCookie; + callbacks[25] = (delegate* unmanaged)&_setPatchpointInfo; + callbacks[26] = (delegate* unmanaged)&_getOSRInfo; + callbacks[27] = (delegate* unmanaged)&_resolveToken; + callbacks[28] = (delegate* unmanaged)&_findSig; + callbacks[29] = (delegate* unmanaged)&_findCallSiteSig; + callbacks[30] = (delegate* unmanaged)&_getTokenTypeAsHandle; + callbacks[31] = (delegate* unmanaged)&_getStringLiteral; + callbacks[32] = (delegate* unmanaged)&_printObjectDescription; + callbacks[33] = (delegate* unmanaged)&_asCorInfoType; + callbacks[34] = (delegate* unmanaged)&_getClassNameFromMetadata; + callbacks[35] = (delegate* unmanaged)&_getTypeInstantiationArgument; + callbacks[36] = (delegate* unmanaged)&_printClassName; + callbacks[37] = (delegate* unmanaged)&_isValueClass; + callbacks[38] = (delegate* unmanaged)&_canInlineTypeCheck; + callbacks[39] = (delegate* unmanaged)&_getClassAttribs; + callbacks[40] = (delegate* unmanaged)&_getClassModule; + callbacks[41] = (delegate* unmanaged)&_getModuleAssembly; + callbacks[42] = (delegate* unmanaged)&_getAssemblyName; + callbacks[43] = (delegate* unmanaged)&_LongLifetimeMalloc; + callbacks[44] = (delegate* unmanaged)&_LongLifetimeFree; + callbacks[45] = (delegate* unmanaged)&_getClassModuleIdForStatics; + callbacks[46] = (delegate* unmanaged)&_getIsClassInitedFlagAddress; + callbacks[47] = (delegate* unmanaged)&_getStaticBaseAddress; + callbacks[48] = (delegate* unmanaged)&_getClassSize; + callbacks[49] = (delegate* unmanaged)&_getHeapClassSize; + callbacks[50] = (delegate* unmanaged)&_canAllocateOnStack; + callbacks[51] = (delegate* unmanaged)&_getClassAlignmentRequirement; + callbacks[52] = (delegate* unmanaged)&_getClassGClayout; + callbacks[53] = (delegate* unmanaged)&_getClassNumInstanceFields; + callbacks[54] = (delegate* unmanaged)&_getFieldInClass; + callbacks[55] = (delegate* unmanaged)&_checkMethodModifier; + callbacks[56] = (delegate* unmanaged)&_getNewHelper; + callbacks[57] = (delegate* unmanaged)&_getNewArrHelper; + callbacks[58] = (delegate* unmanaged)&_getCastingHelper; + callbacks[59] = (delegate* unmanaged)&_getSharedCCtorHelper; + callbacks[60] = (delegate* unmanaged)&_getTypeForBox; + callbacks[61] = (delegate* unmanaged)&_getBoxHelper; + callbacks[62] = (delegate* unmanaged)&_getUnBoxHelper; + callbacks[63] = (delegate* unmanaged)&_getRuntimeTypePointer; + callbacks[64] = (delegate* unmanaged)&_isObjectImmutable; + callbacks[65] = (delegate* unmanaged)&_getStringChar; + callbacks[66] = (delegate* unmanaged)&_getObjectType; + callbacks[67] = (delegate* unmanaged)&_getReadyToRunHelper; + callbacks[68] = (delegate* unmanaged)&_getReadyToRunDelegateCtorHelper; + callbacks[69] = (delegate* unmanaged)&_initClass; + callbacks[70] = (delegate* unmanaged)&_classMustBeLoadedBeforeCodeIsRun; + callbacks[71] = (delegate* unmanaged)&_getBuiltinClass; + callbacks[72] = (delegate* unmanaged)&_getTypeForPrimitiveValueClass; + callbacks[73] = (delegate* unmanaged)&_getTypeForPrimitiveNumericClass; + callbacks[74] = (delegate* unmanaged)&_canCast; + callbacks[75] = (delegate* unmanaged)&_compareTypesForCast; + callbacks[76] = (delegate* unmanaged)&_compareTypesForEquality; + callbacks[77] = (delegate* unmanaged)&_isMoreSpecificType; + callbacks[78] = (delegate* unmanaged)&_isEnum; + callbacks[79] = (delegate* unmanaged)&_getParentType; + callbacks[80] = (delegate* unmanaged)&_getChildType; + callbacks[81] = (delegate* unmanaged)&_isSDArray; + callbacks[82] = (delegate* unmanaged)&_getArrayRank; + callbacks[83] = (delegate* unmanaged)&_getArrayIntrinsicID; + callbacks[84] = (delegate* unmanaged)&_getArrayInitializationData; + callbacks[85] = (delegate* unmanaged)&_canAccessClass; + callbacks[86] = (delegate* unmanaged)&_printFieldName; + callbacks[87] = (delegate* unmanaged)&_getFieldClass; + callbacks[88] = (delegate* unmanaged)&_getFieldType; + callbacks[89] = (delegate* unmanaged)&_getFieldOffset; + callbacks[90] = (delegate* unmanaged)&_getFieldInfo; + callbacks[91] = (delegate* unmanaged)&_getThreadLocalFieldInfo; + callbacks[92] = (delegate* unmanaged)&_getThreadLocalStaticBlocksInfo; + callbacks[93] = (delegate* unmanaged)&_isFieldStatic; + callbacks[94] = (delegate* unmanaged)&_getArrayOrStringLength; + callbacks[95] = (delegate* unmanaged)&_getBoundaries; + callbacks[96] = (delegate* unmanaged)&_setBoundaries; + callbacks[97] = (delegate* unmanaged)&_getVars; + callbacks[98] = (delegate* unmanaged)&_setVars; + callbacks[99] = (delegate* unmanaged)&_reportRichMappings; + callbacks[100] = (delegate* unmanaged)&_allocateArray; + callbacks[101] = (delegate* unmanaged)&_freeArray; + callbacks[102] = (delegate* unmanaged)&_getArgNext; + callbacks[103] = (delegate* unmanaged)&_getArgType; + callbacks[104] = (delegate* unmanaged)&_getExactClasses; + callbacks[105] = (delegate* unmanaged)&_getArgClass; + callbacks[106] = (delegate* unmanaged)&_getHFAType; + callbacks[107] = (delegate* unmanaged)&_runWithErrorTrap; + callbacks[108] = (delegate* unmanaged)&_runWithSPMIErrorTrap; + callbacks[109] = (delegate* unmanaged)&_getEEInfo; + callbacks[110] = (delegate* unmanaged)&_getJitTimeLogFilename; + callbacks[111] = (delegate* unmanaged)&_getMethodDefFromMethod; + callbacks[112] = (delegate* unmanaged)&_printMethodName; + callbacks[113] = (delegate* unmanaged)&_getMethodNameFromMetadata; + callbacks[114] = (delegate* unmanaged)&_getMethodHash; + callbacks[115] = (delegate* unmanaged)&_getSystemVAmd64PassStructInRegisterDescriptor; + callbacks[116] = (delegate* unmanaged)&_getLoongArch64PassStructInRegisterFlags; + callbacks[117] = (delegate* unmanaged)&_getRISCV64PassStructInRegisterFlags; + callbacks[118] = (delegate* unmanaged)&_getThreadTLSIndex; + callbacks[119] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; + callbacks[120] = (delegate* unmanaged)&_getHelperFtn; + callbacks[121] = (delegate* unmanaged)&_getFunctionEntryPoint; + callbacks[122] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; + callbacks[123] = (delegate* unmanaged)&_getMethodSync; + callbacks[124] = (delegate* unmanaged)&_getLazyStringLiteralHelper; + callbacks[125] = (delegate* unmanaged)&_embedModuleHandle; + callbacks[126] = (delegate* unmanaged)&_embedClassHandle; + callbacks[127] = (delegate* unmanaged)&_embedMethodHandle; + callbacks[128] = (delegate* unmanaged)&_embedFieldHandle; + callbacks[129] = (delegate* unmanaged)&_embedGenericHandle; + callbacks[130] = (delegate* unmanaged)&_getLocationOfThisType; + callbacks[131] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; + callbacks[132] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; + callbacks[133] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; + callbacks[134] = (delegate* unmanaged)&_getJustMyCodeHandle; + callbacks[135] = (delegate* unmanaged)&_GetProfilingHandle; + callbacks[136] = (delegate* unmanaged)&_getCallInfo; + callbacks[137] = (delegate* unmanaged)&_getClassDomainID; + callbacks[138] = (delegate* unmanaged)&_getStaticFieldContent; + callbacks[139] = (delegate* unmanaged)&_getObjectContent; + callbacks[140] = (delegate* unmanaged)&_getStaticFieldCurrentClass; + callbacks[141] = (delegate* unmanaged)&_getVarArgsHandle; + callbacks[142] = (delegate* unmanaged)&_canGetVarArgsHandle; + callbacks[143] = (delegate* unmanaged)&_constructStringLiteral; + callbacks[144] = (delegate* unmanaged)&_emptyStringLiteral; + callbacks[145] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; + callbacks[146] = (delegate* unmanaged)&_GetDelegateCtor; + callbacks[147] = (delegate* unmanaged)&_MethodCompileComplete; + callbacks[148] = (delegate* unmanaged)&_getTailCallHelpers; + callbacks[149] = (delegate* unmanaged)&_convertPInvokeCalliToCall; + callbacks[150] = (delegate* unmanaged)&_notifyInstructionSetUsage; + callbacks[151] = (delegate* unmanaged)&_updateEntryPointForTailCall; + callbacks[152] = (delegate* unmanaged)&_allocMem; + callbacks[153] = (delegate* unmanaged)&_reserveUnwindInfo; + callbacks[154] = (delegate* unmanaged)&_allocUnwindInfo; + callbacks[155] = (delegate* unmanaged)&_allocGCInfo; + callbacks[156] = (delegate* unmanaged)&_setEHcount; + callbacks[157] = (delegate* unmanaged)&_setEHinfo; + callbacks[158] = (delegate* unmanaged)&_logMsg; + callbacks[159] = (delegate* unmanaged)&_doAssert; + callbacks[160] = (delegate* unmanaged)&_reportFatalError; + callbacks[161] = (delegate* unmanaged)&_getPgoInstrumentationResults; + callbacks[162] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; + callbacks[163] = (delegate* unmanaged)&_recordCallSite; + callbacks[164] = (delegate* unmanaged)&_recordRelocation; + callbacks[165] = (delegate* unmanaged)&_getRelocTypeHint; + callbacks[166] = (delegate* unmanaged)&_getExpectedTargetArchitecture; + callbacks[167] = (delegate* unmanaged)&_getJitFlags; return (IntPtr)callbacks; } diff --git a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt index 1fb6bbd78a3ee6..d17317e9fb8514 100644 --- a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt +++ b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt @@ -171,7 +171,6 @@ FUNCTIONS void reportTailCallDecision(CORINFO_METHOD_HANDLE callerHnd, CORINFO_METHOD_HANDLE calleeHnd, bool fIsTailPrefix, CorInfoTailCall tailCallResult, const char * reason); void getEHinfo( CORINFO_METHOD_HANDLE ftn, unsigned EHnumber, CORINFO_EH_CLAUSE* clause ); CORINFO_CLASS_HANDLE getMethodClass( CORINFO_METHOD_HANDLE method ); - CORINFO_MODULE_HANDLE getMethodModule( CORINFO_METHOD_HANDLE method ); void getMethodVTableOffset( CORINFO_METHOD_HANDLE method, unsigned* offsetOfIndirection, unsigned* offsetAfterIndirection, bool* isRelative); bool resolveVirtualMethod(CORINFO_DEVIRTUALIZATION_INFO* info); CORINFO_METHOD_HANDLE getUnboxedEntry(CORINFO_METHOD_HANDLE ftn, bool* requiresInstMethodTableArg); diff --git a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h index 8a6cf1e457acac..fb2f980cc500f2 100644 --- a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h +++ b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h @@ -23,7 +23,6 @@ struct JitInterfaceCallbacks void (* reportTailCallDecision)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE callerHnd, CORINFO_METHOD_HANDLE calleeHnd, bool fIsTailPrefix, CorInfoTailCall tailCallResult, const char* reason); void (* getEHinfo)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE ftn, unsigned EHnumber, CORINFO_EH_CLAUSE* clause); CORINFO_CLASS_HANDLE (* getMethodClass)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE method); - CORINFO_MODULE_HANDLE (* getMethodModule)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE method); void (* getMethodVTableOffset)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE method, unsigned* offsetOfIndirection, unsigned* offsetAfterIndirection, bool* isRelative); bool (* resolveVirtualMethod)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_DEVIRTUALIZATION_INFO* info); CORINFO_METHOD_HANDLE (* getUnboxedEntry)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE ftn, bool* requiresInstMethodTableArg); @@ -315,15 +314,6 @@ class JitInterfaceWrapper : public ICorJitInfo return temp; } - virtual CORINFO_MODULE_HANDLE getMethodModule( - CORINFO_METHOD_HANDLE method) -{ - CorInfoExceptionClass* pException = nullptr; - CORINFO_MODULE_HANDLE temp = _callbacks->getMethodModule(_thisHandle, &pException, method); - if (pException != nullptr) throw pException; - return temp; -} - virtual void getMethodVTableOffset( CORINFO_METHOD_HANDLE method, unsigned* offsetOfIndirection, diff --git a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h index d0be35c4689c82..3eb6ddd698fd55 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h @@ -103,7 +103,6 @@ LWM(GetClassModule, DWORDLONG, DWORDLONG) LWM(GetModuleAssembly, DWORDLONG, DWORDLONG) LWM(GetAssemblyName, DWORDLONG, DWORD) LWM(GetMethodClass, DWORDLONG, DWORDLONG) -LWM(GetMethodModule, DWORDLONG, DWORDLONG) LWM(GetMethodDefFromMethod, DWORDLONG, DWORD) LWM(GetMethodHash, DWORDLONG, DWORD) LWM(GetMethodInfo, DWORDLONG, Agnostic_GetMethodInfo) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp index 219c01facaad07..f6872903791ad6 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp @@ -726,29 +726,6 @@ CORINFO_CLASS_HANDLE MethodContext::repGetMethodClass(CORINFO_METHOD_HANDLE meth return result; } -void MethodContext::recGetMethodModule(CORINFO_METHOD_HANDLE methodHandle, CORINFO_MODULE_HANDLE moduleHandle) -{ - if (GetMethodModule == nullptr) - GetMethodModule = new LightWeightMap(); - - DWORDLONG key = CastHandle(methodHandle); - DWORDLONG value = CastHandle(moduleHandle); - GetMethodModule->Add(key, value); - DEBUG_REC(dmpGetMethodModule(key, value)); -} -void MethodContext::dmpGetMethodModule(DWORDLONG key, DWORDLONG value) -{ - printf("GetMethodModule key %016" PRIX64 ", value %016" PRIX64 "", key, value); -} -CORINFO_MODULE_HANDLE MethodContext::repGetMethodModule(CORINFO_METHOD_HANDLE methodHandle) -{ - DWORDLONG key = CastHandle(methodHandle); - DWORDLONG value = LookupByKeyOrMiss(GetMethodModule, key, ": key %016" PRIX64 "", key); - DEBUG_REP(dmpGetMethodModule(key, value)); - CORINFO_MODULE_HANDLE result = (CORINFO_MODULE_HANDLE)value; - return result; -} - void MethodContext::recGetClassAttribs(CORINFO_CLASS_HANDLE classHandle, DWORD attribs) { if (GetClassAttribs == nullptr) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h index 6466bbc2824f5f..13004512680264 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h @@ -114,10 +114,6 @@ class MethodContext void dmpGetMethodClass(DWORDLONG key, DWORDLONG value); CORINFO_CLASS_HANDLE repGetMethodClass(CORINFO_METHOD_HANDLE methodHandle); - void recGetMethodModule(CORINFO_METHOD_HANDLE methodHandle, CORINFO_MODULE_HANDLE moduleHandle); - void dmpGetMethodModule(DWORDLONG key, DWORDLONG value); - CORINFO_MODULE_HANDLE repGetMethodModule(CORINFO_METHOD_HANDLE methodHandle); - void recGetClassAttribs(CORINFO_CLASS_HANDLE classHandle, DWORD attribs); void dmpGetClassAttribs(DWORDLONG key, DWORD value); DWORD repGetClassAttribs(CORINFO_CLASS_HANDLE classHandle); @@ -1101,7 +1097,7 @@ enum mcPackets Packet_GetTailCallHelpers = 178, PacketCR_RecordCallSiteWithSignature = 179, PacketCR_RecordCallSiteWithoutSignature = 180, - Packet_GetMethodModule = 181, + //Packet_GetMethodModule = 181, //Retired10 = 182, Packet_GetExpectedTargetArchitecture = 183, Packet_SigInstHandleMap = 184, diff --git a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp index 16006277f8ff14..70dc516d97ec1d 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp @@ -184,15 +184,6 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getMethodClass(CORINFO_METHOD_HANDLE meth return temp; } -// return module it belongs to -CORINFO_MODULE_HANDLE interceptor_ICJI::getMethodModule(CORINFO_METHOD_HANDLE method) -{ - mc->cr->AddCall("getMethodModule"); - CORINFO_MODULE_HANDLE temp = original_ICorJitInfo->getMethodModule(method); - mc->recGetMethodModule(method, temp); - return temp; -} - // This function returns the offset of the specified method in the // vtable of it's owning class or interface. void interceptor_ICJI::getMethodVTableOffset(CORINFO_METHOD_HANDLE method, /* IN */ diff --git a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp index 9f6dbf39dac493..f90c7a9eb7e50a 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp @@ -114,13 +114,6 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getMethodClass( return original_ICorJitInfo->getMethodClass(method); } -CORINFO_MODULE_HANDLE interceptor_ICJI::getMethodModule( - CORINFO_METHOD_HANDLE method) -{ - mcs->AddCall("getMethodModule"); - return original_ICorJitInfo->getMethodModule(method); -} - void interceptor_ICJI::getMethodVTableOffset( CORINFO_METHOD_HANDLE method, unsigned* offsetOfIndirection, diff --git a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp index 679d088c68473d..19ed77b15569df 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp @@ -102,12 +102,6 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getMethodClass( return original_ICorJitInfo->getMethodClass(method); } -CORINFO_MODULE_HANDLE interceptor_ICJI::getMethodModule( - CORINFO_METHOD_HANDLE method) -{ - return original_ICorJitInfo->getMethodModule(method); -} - void interceptor_ICJI::getMethodVTableOffset( CORINFO_METHOD_HANDLE method, unsigned* offsetOfIndirection, diff --git a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp index f8b2aea25749e2..b35aa0d10736a3 100644 --- a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp @@ -160,13 +160,6 @@ CORINFO_CLASS_HANDLE MyICJI::getMethodClass(CORINFO_METHOD_HANDLE method) return jitInstance->mc->repGetMethodClass(method); } -// return module it belongs to -CORINFO_MODULE_HANDLE MyICJI::getMethodModule(CORINFO_METHOD_HANDLE method) -{ - jitInstance->mc->cr->AddCall("getMethodModule"); - return jitInstance->mc->repGetMethodModule(method); -} - // This function returns the offset of the specified method in the // vtable of it's owning class or interface. void MyICJI::getMethodVTableOffset(CORINFO_METHOD_HANDLE method, /* IN */ diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index 6532ad04345ce0..c2732894e1938a 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -8333,37 +8333,6 @@ CEEInfo::getMethodClass( return result; } -/***********************************************************************/ -CORINFO_MODULE_HANDLE CEEInfo::getMethodModule (CORINFO_METHOD_HANDLE methodHnd) -{ - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - MODE_PREEMPTIVE; - } CONTRACTL_END; - - CORINFO_MODULE_HANDLE result = NULL; - - JIT_TO_EE_TRANSITION_LEAF(); - - MethodDesc* method = GetMethod(methodHnd); - - if (method->IsDynamicMethod()) - { - // this should never be called, thus the assert, I don't know if the (non existent) caller - // expects the Module or the scope - UNREACHABLE(); - } - else - { - result = (CORINFO_MODULE_HANDLE) method->GetModule(); - } - - EE_TO_JIT_TRANSITION_LEAF(); - - return result; -} - /*********************************************************************/ bool CEEInfo::isIntrinsicType(CORINFO_CLASS_HANDLE classHnd) { From d07d506bb18fc2197e7d3d686b4e8d33dbce527a Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Fri, 16 Jun 2023 10:41:23 -0700 Subject: [PATCH 14/16] Remove CORINFO_DESKTOP_ABI --- src/coreclr/inc/corinfo.h | 1 - src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs | 1 - src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/coreclr/inc/corinfo.h b/src/coreclr/inc/corinfo.h index 10f0ceef459023..c49c86675485b1 100644 --- a/src/coreclr/inc/corinfo.h +++ b/src/coreclr/inc/corinfo.h @@ -1761,7 +1761,6 @@ enum CORINFO_OS enum CORINFO_RUNTIME_ABI { - CORINFO_DESKTOP_ABI = 0x100, CORINFO_CORECLR_ABI = 0x200, CORINFO_NATIVEAOT_ABI = 0x300, }; diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs b/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs index c592be43407689..0f0d974e76c971 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs @@ -819,7 +819,6 @@ public enum CORINFO_OS public enum CORINFO_RUNTIME_ABI { - CORINFO_DESKTOP_ABI = 0x100, CORINFO_CORECLR_ABI = 0x200, CORINFO_NATIVEAOT_ABI = 0x300, } diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp index f6872903791ad6..8f11b2cb71c962 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp @@ -4283,7 +4283,7 @@ void MethodContext::repGetEEInfo(CORINFO_EE_INFO* pEEInfoOut) pEEInfoOut->sizeOfReversePInvokeFrame = (unsigned)0x8; pEEInfoOut->osPageSize = (size_t)0x1000; pEEInfoOut->maxUncheckedOffsetForNullObject = (size_t)((32 * 1024) - 1); - pEEInfoOut->targetAbi = CORINFO_DESKTOP_ABI; + pEEInfoOut->targetAbi = CORINFO_CORECLR_ABI; #ifdef TARGET_OSX pEEInfoOut->osType = CORINFO_MACOS; #elif defined(TARGET_UNIX) From 63065b1173195abf4d0668b33d1dc0f0a68a6fe2 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Fri, 16 Jun 2023 10:56:42 -0700 Subject: [PATCH 15/16] Remove slotNum argument from recordRelocation --- src/coreclr/inc/corjit.h | 11 +++++------ src/coreclr/inc/icorjitinfoimpl_generated.h | 1 - .../jit/ICorJitInfo_wrapper_generated.hpp | 3 +-- src/coreclr/jit/emit.cpp | 3 +-- src/coreclr/jit/emitarm64.cpp | 8 ++++---- .../tools/Common/JitInterface/CorInfoImpl.cs | 5 +---- .../JitInterface/CorInfoImpl_generated.cs | 6 +++--- .../JitInterface/ThunkGenerator/ThunkInput.txt | 2 +- .../aot/jitinterface/jitinterface_generated.h | 5 ++--- .../tools/superpmi/superpmi-shared/agnostic.h | 1 - .../superpmi/superpmi-shared/compileresult.cpp | 17 +++++++---------- .../superpmi/superpmi-shared/compileresult.h | 4 ++-- .../superpmi-shim-collector/icorjitinfo.cpp | 5 ++--- .../icorjitinfo_generated.cpp | 3 +-- .../icorjitinfo_generated.cpp | 3 +-- .../tools/superpmi/superpmi/icorjitinfo.cpp | 3 +-- src/coreclr/vm/jitinterface.cpp | 11 +++-------- src/coreclr/vm/jitinterface.h | 1 - 18 files changed, 35 insertions(+), 57 deletions(-) diff --git a/src/coreclr/inc/corjit.h b/src/coreclr/inc/corjit.h index 344ca9a82bdd44..2ad7e1ff034605 100644 --- a/src/coreclr/inc/corjit.h +++ b/src/coreclr/inc/corjit.h @@ -471,12 +471,11 @@ class ICorJitInfo : public ICorDynamicInfo // A relocation is recorded if we are pre-jitting. // A jump thunk may be inserted if we are jitting virtual void recordRelocation( - void * location, /* IN */ - void * locationRW, /* IN */ - void * target, /* IN */ - uint16_t fRelocType, /* IN */ - uint16_t slotNum = 0, /* IN */ - int32_t addlDelta = 0 /* IN */ + void * location, /* IN */ + void * locationRW, /* IN */ + void * target, /* IN */ + uint16_t fRelocType, /* IN */ + int32_t addlDelta = 0 /* IN */ ) = 0; virtual uint16_t getRelocTypeHint(void * target) = 0; diff --git a/src/coreclr/inc/icorjitinfoimpl_generated.h b/src/coreclr/inc/icorjitinfoimpl_generated.h index c4260ca8d22b5b..5a7b737b85168e 100644 --- a/src/coreclr/inc/icorjitinfoimpl_generated.h +++ b/src/coreclr/inc/icorjitinfoimpl_generated.h @@ -699,7 +699,6 @@ void recordRelocation( void* locationRW, void* target, uint16_t fRelocType, - uint16_t slotNum, int32_t addlDelta) override; uint16_t getRelocTypeHint( diff --git a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp index 5a0d97c4d75997..6d08b042596883 100644 --- a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp +++ b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp @@ -1632,11 +1632,10 @@ void WrapICorJitInfo::recordRelocation( void* locationRW, void* target, uint16_t fRelocType, - uint16_t slotNum, int32_t addlDelta) { API_ENTER(recordRelocation); - wrapHnd->recordRelocation(location, locationRW, target, fRelocType, slotNum, addlDelta); + wrapHnd->recordRelocation(location, locationRW, target, fRelocType, addlDelta); API_LEAVE(recordRelocation); } diff --git a/src/coreclr/jit/emit.cpp b/src/coreclr/jit/emit.cpp index 11407c9cabb1da..70a9e5ebb054fe 100644 --- a/src/coreclr/jit/emit.cpp +++ b/src/coreclr/jit/emit.cpp @@ -10084,8 +10084,7 @@ void emitter::emitRecordRelocation(void* location, /* IN */ // late disassembly; maybe we'll need it? if (emitComp->info.compMatchedVM) { - // slotNum is unused on all supported platforms. - emitCmpHandle->recordRelocation(location, locationRW, target, fRelocType, /* slotNum */ 0, addlDelta); + emitCmpHandle->recordRelocation(location, locationRW, target, fRelocType, addlDelta); } #if defined(LATE_DISASM) codeGen->getDisAssembler().disRecordRelocation((size_t)location, (size_t)target); diff --git a/src/coreclr/jit/emitarm64.cpp b/src/coreclr/jit/emitarm64.cpp index d113bd1a296ecf..259f05b143da9b 100644 --- a/src/coreclr/jit/emitarm64.cpp +++ b/src/coreclr/jit/emitarm64.cpp @@ -10222,10 +10222,10 @@ BYTE* emitter::emitOutputLJ(insGroup* ig, BYTE* dst, instrDesc* i) assert(fmt == IF_BI_0A); assert((distVal & 1) == 0); - code_t code = emitInsCode(ins, fmt); - const bool recordRelocation = emitComp->opts.compReloc && emitJumpCrossHotColdBoundary(srcOffs, dstOffs); + code_t code = emitInsCode(ins, fmt); + const bool doRecordRelocation = emitComp->opts.compReloc && emitJumpCrossHotColdBoundary(srcOffs, dstOffs); - if (recordRelocation) + if (doRecordRelocation) { // dst isn't an actual final target location, just some intermediate // location. Thus we cannot make any guarantees about distVal (not @@ -10246,7 +10246,7 @@ BYTE* emitter::emitOutputLJ(insGroup* ig, BYTE* dst, instrDesc* i) const unsigned instrSize = emitOutput_Instr(dst, code); - if (recordRelocation) + if (doRecordRelocation) { assert(id->idjKeepLong); if (emitComp->info.compMatchedVM) diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs index 7b7aead6355a6c..5c3eb76470fa34 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs @@ -3645,11 +3645,8 @@ private static RelocType GetRelocType(TargetArchitecture targetArchitecture, ush } } - private void recordRelocation(void* location, void* locationRW, void* target, ushort fRelocType, ushort slotNum, int addlDelta) + private void recordRelocation(void* location, void* locationRW, void* target, ushort fRelocType, int addlDelta) { - // slotNum is not used - Debug.Assert(slotNum == 0); - int relocOffset; BlockType locationBlock = findKnownBlock(location, out relocOffset); Debug.Assert(locationBlock != BlockType.Unknown, "BlockType.Unknown not expected"); diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs index 90c18297660408..b31a87daec7c72 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs @@ -2431,12 +2431,12 @@ private static void _recordCallSite(IntPtr thisHandle, IntPtr* ppException, uint } [UnmanagedCallersOnly] - private static void _recordRelocation(IntPtr thisHandle, IntPtr* ppException, void* location, void* locationRW, void* target, ushort fRelocType, ushort slotNum, int addlDelta) + private static void _recordRelocation(IntPtr thisHandle, IntPtr* ppException, void* location, void* locationRW, void* target, ushort fRelocType, int addlDelta) { var _this = GetThis(thisHandle); try { - _this.recordRelocation(location, locationRW, target, fRelocType, slotNum, addlDelta); + _this.recordRelocation(location, locationRW, target, fRelocType, addlDelta); } catch (Exception ex) { @@ -2658,7 +2658,7 @@ private static IntPtr GetUnmanagedCallbacks() callbacks[161] = (delegate* unmanaged)&_getPgoInstrumentationResults; callbacks[162] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; callbacks[163] = (delegate* unmanaged)&_recordCallSite; - callbacks[164] = (delegate* unmanaged)&_recordRelocation; + callbacks[164] = (delegate* unmanaged)&_recordRelocation; callbacks[165] = (delegate* unmanaged)&_getRelocTypeHint; callbacks[166] = (delegate* unmanaged)&_getExpectedTargetArchitecture; callbacks[167] = (delegate* unmanaged)&_getJitFlags; diff --git a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt index d17317e9fb8514..4bec715c809bd1 100644 --- a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt +++ b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt @@ -323,7 +323,7 @@ FUNCTIONS JITINTERFACE_HRESULT getPgoInstrumentationResults(CORINFO_METHOD_HANDLE ftnHnd, ICorJitInfo::PgoInstrumentationSchema** pSchema, uint32_t* pCountSchemaItems, uint8_t**pInstrumentationData, ICorJitInfo::PgoSource* pgoSource) JITINTERFACE_HRESULT allocPgoInstrumentationBySchema(CORINFO_METHOD_HANDLE ftnHnd, ICorJitInfo::PgoInstrumentationSchema* pSchema, uint32_t countSchemaItems, uint8_t** pInstrumentationData) void recordCallSite(uint32_t instrOffset, CORINFO_SIG_INFO* callSig, CORINFO_METHOD_HANDLE methodHandle) - void recordRelocation(void* location, void* locationRW, void* target, uint16_t fRelocType, uint16_t slotNum, int32_t addlDelta) + void recordRelocation(void* location, void* locationRW, void* target, uint16_t fRelocType, int32_t addlDelta) uint16_t getRelocTypeHint(void* target) uint32_t getExpectedTargetArchitecture() uint32_t getJitFlags(CORJIT_FLAGS* flags, uint32_t sizeInBytes) diff --git a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h index fb2f980cc500f2..24c21759692abb 100644 --- a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h +++ b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h @@ -175,7 +175,7 @@ struct JitInterfaceCallbacks JITINTERFACE_HRESULT (* getPgoInstrumentationResults)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE ftnHnd, ICorJitInfo::PgoInstrumentationSchema** pSchema, uint32_t* pCountSchemaItems, uint8_t** pInstrumentationData, ICorJitInfo::PgoSource* pgoSource); JITINTERFACE_HRESULT (* allocPgoInstrumentationBySchema)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE ftnHnd, ICorJitInfo::PgoInstrumentationSchema* pSchema, uint32_t countSchemaItems, uint8_t** pInstrumentationData); void (* recordCallSite)(void * thisHandle, CorInfoExceptionClass** ppException, uint32_t instrOffset, CORINFO_SIG_INFO* callSig, CORINFO_METHOD_HANDLE methodHandle); - void (* recordRelocation)(void * thisHandle, CorInfoExceptionClass** ppException, void* location, void* locationRW, void* target, uint16_t fRelocType, uint16_t slotNum, int32_t addlDelta); + void (* recordRelocation)(void * thisHandle, CorInfoExceptionClass** ppException, void* location, void* locationRW, void* target, uint16_t fRelocType, int32_t addlDelta); uint16_t (* getRelocTypeHint)(void * thisHandle, CorInfoExceptionClass** ppException, void* target); uint32_t (* getExpectedTargetArchitecture)(void * thisHandle, CorInfoExceptionClass** ppException); uint32_t (* getJitFlags)(void * thisHandle, CorInfoExceptionClass** ppException, CORJIT_FLAGS* flags, uint32_t sizeInBytes); @@ -1802,11 +1802,10 @@ class JitInterfaceWrapper : public ICorJitInfo void* locationRW, void* target, uint16_t fRelocType, - uint16_t slotNum, int32_t addlDelta) { CorInfoExceptionClass* pException = nullptr; - _callbacks->recordRelocation(_thisHandle, &pException, location, locationRW, target, fRelocType, slotNum, addlDelta); + _callbacks->recordRelocation(_thisHandle, &pException, location, locationRW, target, fRelocType, addlDelta); if (pException != nullptr) throw pException; } diff --git a/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h b/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h index ef0ae0f9ed0fce..6b1b578b36ee34 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h @@ -661,7 +661,6 @@ struct Agnostic_RecordRelocation DWORDLONG location; DWORDLONG target; DWORD fRelocType; - DWORD slotNum; DWORD addlDelta; }; diff --git a/src/coreclr/tools/superpmi/superpmi-shared/compileresult.cpp b/src/coreclr/tools/superpmi/superpmi-shared/compileresult.cpp index 6a2438c0f0b74c..c703b4665fa21d 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/compileresult.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/compileresult.cpp @@ -645,9 +645,9 @@ void CompileResult::dmpReportFatalError(DWORD key, DWORD value) printf("ReportFatalError key Count-%u, value result-%08X", key, value); } -void CompileResult::recRecordRelocation(void* location, void* target, uint16_t fRelocType, uint16_t slotNum, int32_t addlDelta) +void CompileResult::recRecordRelocation(void* location, void* target, uint16_t fRelocType, int32_t addlDelta) { - repRecordRelocation(location, target, fRelocType, slotNum, addlDelta); + repRecordRelocation(location, target, fRelocType, addlDelta); } const char* relocationTypeToString(uint16_t fRelocType) @@ -679,11 +679,11 @@ const char* relocationTypeToString(uint16_t fRelocType) } void CompileResult::dmpRecordRelocation(DWORD key, const Agnostic_RecordRelocation& value) { - printf("RecordRelocation key %u, value loc-%016" PRIX64 " tgt-%016" PRIX64 " fRelocType-%u(%s) slotNum-%u addlDelta:%d", key, + printf("RecordRelocation key %u, value loc-%016" PRIX64 " tgt-%016" PRIX64 " fRelocType-%u(%s) addlDelta:%d", key, value.location, value.target, value.fRelocType, relocationTypeToString((uint16_t)value.fRelocType), - value.slotNum, (int32_t)value.addlDelta); + (int32_t)value.addlDelta); } -void CompileResult::repRecordRelocation(void* location, void* target, uint16_t fRelocType, uint16_t slotNum, int32_t addlDelta) +void CompileResult::repRecordRelocation(void* location, void* target, uint16_t fRelocType, int32_t addlDelta) { if (RecordRelocation == nullptr) RecordRelocation = new DenseLightWeightMap(); @@ -693,11 +693,8 @@ void CompileResult::repRecordRelocation(void* location, void* target, uint16_t f value.location = CastPointer(location); value.target = CastPointer(target); value.fRelocType = (DWORD)fRelocType; - value.slotNum = (DWORD)slotNum; value.addlDelta = (DWORD)addlDelta; - Assert(value.slotNum == 0); - RecordRelocation->Append(value); } @@ -872,7 +869,7 @@ void CompileResult::applyRelocs(RelocContext* rc, unsigned char* block1, ULONG b { if (relocType == IMAGE_REL_BASED_DIR64) { - DWORDLONG fixupLocation = tmp.location + tmp.slotNum; + DWORDLONG fixupLocation = tmp.location; // Write 64-bits into location size_t address = section_begin + (size_t)fixupLocation - (size_t)originalAddr; @@ -893,7 +890,7 @@ void CompileResult::applyRelocs(RelocContext* rc, unsigned char* block1, ULONG b // Now do all-platform relocations. if (tmp.fRelocType == IMAGE_REL_BASED_REL32) { - DWORDLONG fixupLocation = tmp.location + tmp.slotNum; + DWORDLONG fixupLocation = tmp.location; size_t address = section_begin + (size_t)fixupLocation - (size_t)originalAddr; if ((section_begin <= address) && (address < section_end)) // A reloc for our section? diff --git a/src/coreclr/tools/superpmi/superpmi-shared/compileresult.h b/src/coreclr/tools/superpmi/superpmi-shared/compileresult.h index 97331720e79ba3..a4d129c3e0880a 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/compileresult.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/compileresult.h @@ -178,9 +178,9 @@ class CompileResult void recReportFatalError(CorJitResult result); void dmpReportFatalError(DWORD key, DWORD value); - void recRecordRelocation(void* location, void* target, uint16_t fRelocType, uint16_t slotNum, int32_t addlDelta); + void recRecordRelocation(void* location, void* target, uint16_t fRelocType, int32_t addlDelta); void dmpRecordRelocation(DWORD key, const Agnostic_RecordRelocation& value); - void repRecordRelocation(void* location, void* target, uint16_t fRelocType, uint16_t slotNum, int32_t addlDelta); + void repRecordRelocation(void* location, void* target, uint16_t fRelocType, int32_t addlDelta); void applyRelocs(RelocContext* rc, unsigned char* block1, ULONG blocksize1, void* originalAddr); void recProcessName(const char* name); diff --git a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp index 70dc516d97ec1d..145b7ee9fce3f8 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp @@ -1900,13 +1900,12 @@ void interceptor_ICJI::recordRelocation(void* location, /* IN */ void* locationRW, /* IN */ void* target, /* IN */ uint16_t fRelocType, /* IN */ - uint16_t slotNum, /* IN */ int32_t addlDelta /* IN */ ) { mc->cr->AddCall("recordRelocation"); - original_ICorJitInfo->recordRelocation(location, locationRW, target, fRelocType, slotNum, addlDelta); - mc->cr->recRecordRelocation(location, target, fRelocType, slotNum, addlDelta); + original_ICorJitInfo->recordRelocation(location, locationRW, target, fRelocType, addlDelta); + mc->cr->recRecordRelocation(location, target, fRelocType, addlDelta); } uint16_t interceptor_ICJI::getRelocTypeHint(void* target) diff --git a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp index f90c7a9eb7e50a..70f64123a47900 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp @@ -1346,11 +1346,10 @@ void interceptor_ICJI::recordRelocation( void* locationRW, void* target, uint16_t fRelocType, - uint16_t slotNum, int32_t addlDelta) { mcs->AddCall("recordRelocation"); - original_ICorJitInfo->recordRelocation(location, locationRW, target, fRelocType, slotNum, addlDelta); + original_ICorJitInfo->recordRelocation(location, locationRW, target, fRelocType, addlDelta); } uint16_t interceptor_ICJI::getRelocTypeHint( diff --git a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp index 19ed77b15569df..fb2d3246a96892 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp @@ -1182,10 +1182,9 @@ void interceptor_ICJI::recordRelocation( void* locationRW, void* target, uint16_t fRelocType, - uint16_t slotNum, int32_t addlDelta) { - original_ICorJitInfo->recordRelocation(location, locationRW, target, fRelocType, slotNum, addlDelta); + original_ICorJitInfo->recordRelocation(location, locationRW, target, fRelocType, addlDelta); } uint16_t interceptor_ICJI::getRelocTypeHint( diff --git a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp index b35aa0d10736a3..756443dce93998 100644 --- a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp @@ -1752,12 +1752,11 @@ void MyICJI::recordRelocation(void* location, /* IN */ void* locationRW, /* IN */ void* target, /* IN */ uint16_t fRelocType, /* IN */ - uint16_t slotNum, /* IN */ int32_t addlDelta /* IN */ ) { jitInstance->mc->cr->AddCall("recordRelocation"); - jitInstance->mc->cr->repRecordRelocation(location, target, fRelocType, slotNum, addlDelta); + jitInstance->mc->cr->repRecordRelocation(location, target, fRelocType, addlDelta); } uint16_t MyICJI::getRelocTypeHint(void* target) diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index c2732894e1938a..388b5156f4fbaf 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -11062,7 +11062,6 @@ void CEEJitInfo::recordRelocation(void * location, void * locationRW, void * target, WORD fRelocType, - WORD slot, INT32 addlDelta) { CONTRACTL { @@ -11080,7 +11079,7 @@ void CEEJitInfo::recordRelocation(void * location, { case IMAGE_REL_BASED_DIR64: // Write 64-bits into location - *((UINT64 *) ((BYTE *) locationRW + slot)) = (UINT64) target; + *((UINT64 *) locationRW) = (UINT64) target; break; #ifdef TARGET_AMD64 @@ -11088,8 +11087,8 @@ void CEEJitInfo::recordRelocation(void * location, { target = (BYTE *)target + addlDelta; - INT32 * fixupLocation = (INT32 *) ((BYTE *) location + slot); - INT32 * fixupLocationRW = (INT32 *) ((BYTE *) locationRW + slot); + INT32 * fixupLocation = (INT32 *) location; + INT32 * fixupLocationRW = (INT32 *) locationRW; BYTE * baseAddr = (BYTE *)fixupLocation + sizeof(INT32); delta = (INT64)((BYTE *)target - baseAddr); @@ -11143,7 +11142,6 @@ void CEEJitInfo::recordRelocation(void * location, #ifdef TARGET_ARM64 case IMAGE_REL_ARM64_BRANCH26: // 26 bit offset << 2 & sign ext, for B and BL { - _ASSERTE(slot == 0); _ASSERTE(addlDelta == 0); PCODE branchTarget = (PCODE) target; @@ -11220,7 +11218,6 @@ void CEEJitInfo::recordRelocation(void * location, case IMAGE_REL_ARM64_PAGEBASE_REL21: { - _ASSERTE(slot == 0); _ASSERTE(addlDelta == 0); // Write the 21 bits pc-relative page address into location. @@ -11234,7 +11231,6 @@ void CEEJitInfo::recordRelocation(void * location, case IMAGE_REL_ARM64_PAGEOFFSET_12A: { - _ASSERTE(slot == 0); _ASSERTE(addlDelta == 0); // Write the 12 bits page offset into location. @@ -14078,7 +14074,6 @@ void CEEInfo::recordRelocation( void * locationRW, /* IN */ void * target, /* IN */ WORD fRelocType, /* IN */ - WORD slotNum, /* IN */ INT32 addlDelta /* IN */ ) { diff --git a/src/coreclr/vm/jitinterface.h b/src/coreclr/vm/jitinterface.h index 862b363dbe772b..26837eb6622c3b 100644 --- a/src/coreclr/vm/jitinterface.h +++ b/src/coreclr/vm/jitinterface.h @@ -653,7 +653,6 @@ class CEEJitInfo : public CEEInfo void *locationRW, void *target, uint16_t fRelocType, - uint16_t slot, int32_t addlDelta) override final; uint16_t getRelocTypeHint(void * target) override final; From ea111e2e754f2c0089be8bdf641b991d57aeb288 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Fri, 16 Jun 2023 11:22:12 -0700 Subject: [PATCH 16/16] Make JIT-EE interface formatting a little more consistent --- src/coreclr/inc/corinfo.h | 419 +++++++++++++++++++------------------- src/coreclr/inc/corjit.h | 59 +++--- 2 files changed, 243 insertions(+), 235 deletions(-) diff --git a/src/coreclr/inc/corinfo.h b/src/coreclr/inc/corinfo.h index c49c86675485b1..83d007e5a436b8 100644 --- a/src/coreclr/inc/corinfo.h +++ b/src/coreclr/inc/corinfo.h @@ -2026,7 +2026,7 @@ class ICorStaticInfo virtual void getMethodSig ( CORINFO_METHOD_HANDLE ftn, /* IN */ CORINFO_SIG_INFO *sig, /* OUT */ - CORINFO_CLASS_HANDLE memberParent = NULL /* IN */ + CORINFO_CLASS_HANDLE memberParent = NULL /* IN */ ) = 0; /********************************************************************* @@ -2062,9 +2062,9 @@ class ICorStaticInfo // inlining results when it returns INLINE_FAIL and INLINE_NEVER. All other results are reported by the // JIT. virtual void reportInliningDecision (CORINFO_METHOD_HANDLE inlinerHnd, - CORINFO_METHOD_HANDLE inlineeHnd, - CorInfoInline inlineResult, - const char * reason) = 0; + CORINFO_METHOD_HANDLE inlineeHnd, + CorInfoInline inlineResult, + const char * reason) = 0; // Returns false if the call is across security boundaries thus we cannot tailcall @@ -2074,23 +2074,23 @@ class ICorStaticInfo CORINFO_METHOD_HANDLE callerHnd, /* IN */ CORINFO_METHOD_HANDLE declaredCalleeHnd, /* IN */ CORINFO_METHOD_HANDLE exactCalleeHnd, /* IN */ - bool fIsTailPrefix /* IN */ + bool fIsTailPrefix /* IN */ ) = 0; // Reports whether or not a method can be tail called, and why. // canTailCall is responsible for reporting all results when it returns // false. All other results are reported by the JIT. virtual void reportTailCallDecision (CORINFO_METHOD_HANDLE callerHnd, - CORINFO_METHOD_HANDLE calleeHnd, - bool fIsTailPrefix, - CorInfoTailCall tailCallResult, - const char * reason) = 0; + CORINFO_METHOD_HANDLE calleeHnd, + bool fIsTailPrefix, + CorInfoTailCall tailCallResult, + const char * reason) = 0; // get individual exception handler virtual void getEHinfo( CORINFO_METHOD_HANDLE ftn, /* IN */ - unsigned EHnumber, /* IN */ - CORINFO_EH_CLAUSE* clause /* OUT */ + unsigned EHnumber, /* IN */ + CORINFO_EH_CLAUSE* clause /* OUT */ ) = 0; // return class it belongs to @@ -2117,7 +2117,7 @@ class ICorStaticInfo // Get the unboxed entry point for a method, if possible. virtual CORINFO_METHOD_HANDLE getUnboxedEntry( CORINFO_METHOD_HANDLE ftn, - bool* requiresInstMethodTableArg + bool* requiresInstMethodTableArg ) = 0; // Given T, return the type of the default Comparer. @@ -2183,7 +2183,7 @@ class ICorStaticInfo // Returns the global cookie for the /GS unsafe buffer checks // The cookie might be a constant value (JIT), or a handle to memory location (Ngen) virtual void getGSCookie( - GSCookie * pCookieVal, // OUT + GSCookie * pCookieVal, // OUT GSCookie ** ppCookieVal // OUT ) = 0; @@ -2344,8 +2344,8 @@ class ICorStaticInfo virtual size_t getClassModuleIdForStatics ( CORINFO_CLASS_HANDLE cls, - CORINFO_MODULE_HANDLE *pModule, - void **ppIndirection + CORINFO_MODULE_HANDLE * pModule, + void ** ppIndirection ) = 0; virtual bool getIsClassInitedFlagAddress( @@ -2362,17 +2362,17 @@ class ICorStaticInfo // return the number of bytes needed by an instance of the class virtual unsigned getClassSize ( - CORINFO_CLASS_HANDLE cls + CORINFO_CLASS_HANDLE cls ) = 0; // return the number of bytes needed by an instance of the class allocated on the heap virtual unsigned getHeapClassSize( - CORINFO_CLASS_HANDLE cls - ) = 0; + CORINFO_CLASS_HANDLE cls + ) = 0; virtual bool canAllocateOnStack( - CORINFO_CLASS_HANDLE cls - ) = 0; + CORINFO_CLASS_HANDLE cls + ) = 0; virtual unsigned getClassAlignmentRequirement ( CORINFO_CLASS_HANDLE cls, @@ -2399,21 +2399,21 @@ class ICorStaticInfo ) = 0; virtual CORINFO_FIELD_HANDLE getFieldInClass( - CORINFO_CLASS_HANDLE clsHnd, - int32_t num + CORINFO_CLASS_HANDLE clsHnd, + int32_t num ) = 0; virtual bool checkMethodModifier( - CORINFO_METHOD_HANDLE hMethod, - const char * modifier, - bool fOptional + CORINFO_METHOD_HANDLE hMethod, + const char * modifier, + bool fOptional ) = 0; // returns the "NEW" helper optimized for "newCls." virtual CorInfoHelpFunc getNewHelper( - CORINFO_RESOLVED_TOKEN * pResolvedToken, - CORINFO_METHOD_HANDLE callerHandle, - bool * pHasSideEffects + CORINFO_RESOLVED_TOKEN * pResolvedToken, + CORINFO_METHOD_HANDLE callerHandle, + bool * pHasSideEffects ) = 0; // returns the newArr (1-Dim array) helper optimized for "arrayCls." @@ -2423,17 +2423,17 @@ class ICorStaticInfo // returns the optimized "IsInstanceOf" or "ChkCast" helper virtual CorInfoHelpFunc getCastingHelper( - CORINFO_RESOLVED_TOKEN * pResolvedToken, - bool fThrowing + CORINFO_RESOLVED_TOKEN * pResolvedToken, + bool fThrowing ) = 0; // returns helper to trigger static constructor virtual CorInfoHelpFunc getSharedCCtorHelper( - CORINFO_CLASS_HANDLE clsHnd + CORINFO_CLASS_HANDLE clsHnd ) = 0; // Boxing nullable actually returns a boxed not a boxed Nullable. - virtual CORINFO_CLASS_HANDLE getTypeForBox( + virtual CORINFO_CLASS_HANDLE getTypeForBox( CORINFO_CLASS_HANDLE cls ) = 0; @@ -2492,7 +2492,8 @@ class ICorStaticInfo virtual bool getStringChar( CORINFO_OBJECT_HANDLE strObj, int index, - uint16_t* value) = 0; + uint16_t* value + ) = 0; //------------------------------------------------------------------------------ // getObjectType: obtains type handle for given object @@ -2515,10 +2516,10 @@ class ICorStaticInfo ) = 0; virtual void getReadyToRunDelegateCtorHelper( - CORINFO_RESOLVED_TOKEN * pTargetMethod, - mdToken targetConstraint, - CORINFO_CLASS_HANDLE delegateType, - CORINFO_LOOKUP * pLookup + CORINFO_RESOLVED_TOKEN * pTargetMethod, + mdToken targetConstraint, + CORINFO_CLASS_HANDLE delegateType, + CORINFO_LOOKUP * pLookup ) = 0; // This function tries to initialize the class (run the class constructor). @@ -2564,7 +2565,7 @@ class ICorStaticInfo CORINFO_CLASS_HANDLE cls ) = 0; - // TRUE if child is a subtype of parent + // `true` if child is a subtype of parent // if parent is an interface, then does child implement / extend parent virtual bool canCast( CORINFO_CLASS_HANDLE child, // subtype (extends parent) @@ -2617,8 +2618,8 @@ class ICorStaticInfo // Given an Array of Type Foo, returns Foo. // Given BYREF Foo, returns Foo virtual CorInfoType getChildType ( - CORINFO_CLASS_HANDLE clsHnd, - CORINFO_CLASS_HANDLE *clsRet + CORINFO_CLASS_HANDLE clsHnd, + CORINFO_CLASS_HANDLE* clsRet ) = 0; // Check if this is a single dimensional array type @@ -2626,14 +2627,14 @@ class ICorStaticInfo CORINFO_CLASS_HANDLE cls ) = 0; - // Get the numbmer of dimensions in an array + // Get the number of dimensions in an array virtual unsigned getArrayRank( CORINFO_CLASS_HANDLE cls ) = 0; // Get the index of runtime provided array method virtual CorInfoArrayIntrinsic getArrayIntrinsicID( - CORINFO_METHOD_HANDLE ftn + CORINFO_METHOD_HANDLE ftn ) = 0; // Get static field data for an array @@ -2644,11 +2645,11 @@ class ICorStaticInfo // Check Visibility rules. virtual CorInfoIsAccessAllowedResult canAccessClass( - CORINFO_RESOLVED_TOKEN * pResolvedToken, - CORINFO_METHOD_HANDLE callerHandle, - CORINFO_HELPER_DESC *pAccessHelper /* If canAccessMethod returns something other - than ALLOWED, then this is filled in. */ - ) = 0; + CORINFO_RESOLVED_TOKEN * pResolvedToken, + CORINFO_METHOD_HANDLE callerHandle, + CORINFO_HELPER_DESC * pAccessHelper /* If canAccessMethod returns something other + than ALLOWED, then this is filled in. */ + ) = 0; /**********************************************************************************/ // @@ -2676,29 +2677,34 @@ class ICorStaticInfo // 'memberParent' is typically only set when verifying. It should be the // result of calling getMemberParent. virtual CorInfoType getFieldType( - CORINFO_FIELD_HANDLE field, - CORINFO_CLASS_HANDLE *structType = NULL, - CORINFO_CLASS_HANDLE memberParent = NULL /* IN */ - ) = 0; + CORINFO_FIELD_HANDLE field, + CORINFO_CLASS_HANDLE * structType = NULL, + CORINFO_CLASS_HANDLE memberParent = NULL /* IN */ + ) = 0; // return the data member's instance offset virtual unsigned getFieldOffset( - CORINFO_FIELD_HANDLE field - ) = 0; + CORINFO_FIELD_HANDLE field + ) = 0; - virtual void getFieldInfo (CORINFO_RESOLVED_TOKEN * pResolvedToken, - CORINFO_METHOD_HANDLE callerHandle, - CORINFO_ACCESS_FLAGS flags, - CORINFO_FIELD_INFO *pResult - ) = 0; + virtual void getFieldInfo( + CORINFO_RESOLVED_TOKEN * pResolvedToken, + CORINFO_METHOD_HANDLE callerHandle, + CORINFO_ACCESS_FLAGS flags, + CORINFO_FIELD_INFO * pResult + ) = 0; // Returns the index against which the field's thread static block in stored in TLS. virtual uint32_t getThreadLocalFieldInfo ( - CORINFO_FIELD_HANDLE field, bool isGCType) = 0; + CORINFO_FIELD_HANDLE field, + bool isGCType + ) = 0; // Returns the thread static block information like offsets, etc. from current TLS. virtual void getThreadLocalStaticBlocksInfo ( - CORINFO_THREAD_STATIC_BLOCKS_INFO* pInfo, bool isGCType) = 0; + CORINFO_THREAD_STATIC_BLOCKS_INFO* pInfo, + bool isGCType + ) = 0; // Returns true iff "fldHnd" represents a static field. virtual bool isFieldStatic(CORINFO_FIELD_HANDLE fldHnd) = 0; @@ -2721,12 +2727,12 @@ class ICorStaticInfo // be used only as a hint and the native compiler should not change its // code generation. virtual void getBoundaries( - CORINFO_METHOD_HANDLE ftn, // [IN] method of interest - unsigned int *cILOffsets, // [OUT] size of pILOffsets - uint32_t **pILOffsets, // [OUT] IL offsets of interest - // jit MUST free with freeArray! - ICorDebugInfo::BoundaryTypes *implicitBoundaries // [OUT] tell jit, all boundaries of this type - ) = 0; + CORINFO_METHOD_HANDLE ftn, // [IN] method of interest + unsigned int *cILOffsets, // [OUT] size of pILOffsets + uint32_t **pILOffsets, // [OUT] IL offsets of interest + // jit MUST free with freeArray! + ICorDebugInfo::BoundaryTypes *implicitBoundaries // [OUT] tell jit, all boundaries of this type + ) = 0; // Report back the mapping from IL to native code, // this map should include all boundaries that 'getBoundaries' @@ -2736,11 +2742,11 @@ class ICorStaticInfo // offsets form a contiguous block of memory, and that the // OffsetMapping is sorted in order of increasing native offset. virtual void setBoundaries( - CORINFO_METHOD_HANDLE ftn, // [IN] method of interest - uint32_t cMap, // [IN] size of pMap - ICorDebugInfo::OffsetMapping *pMap // [IN] map including all points of interest. - // jit allocated with allocateArray, EE frees - ) = 0; + CORINFO_METHOD_HANDLE ftn, // [IN] method of interest + uint32_t cMap, // [IN] size of pMap + ICorDebugInfo::OffsetMapping *pMap // [IN] map including all points of interest. + // jit allocated with allocateArray, EE frees + ) = 0; // Query the EE to find out the scope of local variables. // normally the JIT would trash variables after last use, but @@ -2753,16 +2759,15 @@ class ICorStaticInfo virtual void getVars( CORINFO_METHOD_HANDLE ftn, // [IN] method of interest uint32_t *cVars, // [OUT] size of 'vars' - ICorDebugInfo::ILVarInfo **vars, // [OUT] scopes of variables of interest + ICorDebugInfo::ILVarInfo **vars, // [OUT] scopes of variables of interest // jit MUST free with freeArray! - bool *extendOthers // [OUT] it TRUE, then assume the scope + bool *extendOthers // [OUT] if `true`, then assume the scope // of unmentioned vars is entire method ) = 0; // Report back to the EE the location of every variable. // note that the JIT might split lifetimes into different // locations etc. - virtual void setVars( CORINFO_METHOD_HANDLE ftn, // [IN] method of interest uint32_t cVars, // [IN] size of 'vars' @@ -2786,15 +2791,15 @@ class ICorStaticInfo // For eg, use this to allocated memory for reporting debug info, // which will be handed to the EE by setVars() and setBoundaries() virtual void * allocateArray( - size_t cBytes - ) = 0; + size_t cBytes + ) = 0; // JitCompiler will free arrays passed by the EE using this // For eg, The EE returns memory in getVars() and getBoundaries() // to the JitCompiler, which the JitCompiler should release using // freeArray() virtual void freeArray( - void *array + void * array ) = 0; /*********************************************************************************/ @@ -2821,17 +2826,17 @@ class ICorStaticInfo virtual CorInfoTypeWithMod getArgType ( CORINFO_SIG_INFO* sig, /* IN */ CORINFO_ARG_LIST_HANDLE args, /* IN */ - CORINFO_CLASS_HANDLE *vcTypeRet /* OUT */ + CORINFO_CLASS_HANDLE* vcTypeRet /* OUT */ ) = 0; // Obtains a list of exact classes for a given base type. Returns 0 if the number of // the exact classes is greater than maxExactClasses or if more types might be loaded // in future. virtual int getExactClasses( - CORINFO_CLASS_HANDLE baseType, /* IN */ - int maxExactClasses, /* IN */ - CORINFO_CLASS_HANDLE* exactClsRet /* OUT */ - ) = 0; + CORINFO_CLASS_HANDLE baseType, /* IN */ + int maxExactClasses, /* IN */ + CORINFO_CLASS_HANDLE* exactClsRet /* OUT */ + ) = 0; // If the Arg is a CORINFO_TYPE_CLASS fetch the class handle associated with it virtual CORINFO_CLASS_HANDLE getArgClass ( @@ -2841,7 +2846,7 @@ class ICorStaticInfo // Returns type of HFA for valuetype virtual CorInfoHFAElemType getHFAType ( - CORINFO_CLASS_HANDLE hClass + CORINFO_CLASS_HANDLE hClass ) = 0; // Runs the given function under an error trap. This allows the JIT to make calls @@ -2850,18 +2855,18 @@ class ICorStaticInfo // successfully and false otherwise. typedef void (*errorTrapFunction)(void*); virtual bool runWithErrorTrap( - errorTrapFunction function, // The function to run - void* parameter // The context parameter that will be passed to the function and the handler - ) = 0; + errorTrapFunction function, // The function to run + void* parameter // The context parameter that will be passed to the function and the handler + ) = 0; // Runs the given function under an error trap. This allows the JIT to make calls // to interface functions that may throw exceptions without needing to be aware of // the EH ABI, exception types, etc. Returns true if the given function completed // successfully and false otherwise. This error trap checks for SuperPMI exceptions virtual bool runWithSPMIErrorTrap( - errorTrapFunction function, // The function to run - void* parameter // The context parameter that will be passed to the function and the handler - ) = 0; + errorTrapFunction function, // The function to run + void* parameter // The context parameter that will be passed to the function and the handler + ) = 0; /***************************************************************************** * ICorStaticInfo contains EE interface methods which return values that are @@ -2872,8 +2877,8 @@ class ICorStaticInfo // Return details about EE internal data structures virtual void getEEInfo( - CORINFO_EE_INFO *pEEInfoOut - ) = 0; + CORINFO_EE_INFO *pEEInfoOut + ) = 0; // Returns name of the JIT timer log virtual const char16_t *getJitTimeLogFilename() = 0; @@ -2897,7 +2902,8 @@ class ICorStaticInfo CORINFO_METHOD_HANDLE ftn, char* buffer, size_t bufferSize, - size_t* pRequiredBufferSize = nullptr) = 0; + size_t* pRequiredBufferSize = nullptr + ) = 0; // Return method name as in metadata, or nullptr if there is none, // and optionally return the class, enclosing class, and namespace names @@ -2907,7 +2913,7 @@ class ICorStaticInfo CORINFO_METHOD_HANDLE ftn, /* IN */ const char **className, /* OUT */ const char **namespaceName, /* OUT */ - const char **enclosingClassName /* OUT */ + const char **enclosingClassName /* OUT */ ) = 0; // this function is for debugging only. It returns a value that @@ -2919,9 +2925,9 @@ class ICorStaticInfo // returns whether the struct is enregisterable. Only valid on a System V VM. Returns true on success, false on failure. virtual bool getSystemVAmd64PassStructInRegisterDescriptor( - /* IN */ CORINFO_CLASS_HANDLE structHnd, - /* OUT */ SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr - ) = 0; + CORINFO_CLASS_HANDLE structHnd, /* IN */ + SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr /* OUT */ + ) = 0; virtual uint32_t getLoongArch64PassStructInRegisterFlags(CORINFO_CLASS_HANDLE cls) = 0; virtual uint32_t getRISCV64PassStructInRegisterFlags(CORINFO_CLASS_HANDLE cls) = 0; @@ -2960,66 +2966,68 @@ class ICorDynamicInfo : public ICorStaticInfo // Return details about EE internal data structures virtual uint32_t getThreadTLSIndex( - void **ppIndirection = NULL - ) = 0; + void **ppIndirection = NULL + ) = 0; virtual int32_t * getAddrOfCaptureThreadGlobal( - void **ppIndirection = NULL - ) = 0; + void **ppIndirection = NULL + ) = 0; // return the native entry point to an EE helper (see CorInfoHelpFunc) virtual void* getHelperFtn ( - CorInfoHelpFunc ftnNum, - void **ppIndirection = NULL - ) = 0; + CorInfoHelpFunc ftnNum, + void **ppIndirection = NULL + ) = 0; // return a callable address of the function (native code). This function // may return a different value (depending on whether the method has // been JITed or not. virtual void getFunctionEntryPoint( - CORINFO_METHOD_HANDLE ftn, /* IN */ - CORINFO_CONST_LOOKUP * pResult, /* OUT */ - CORINFO_ACCESS_FLAGS accessFlags = CORINFO_ACCESS_ANY) = 0; + CORINFO_METHOD_HANDLE ftn, /* IN */ + CORINFO_CONST_LOOKUP * pResult, /* OUT */ + CORINFO_ACCESS_FLAGS accessFlags = CORINFO_ACCESS_ANY + ) = 0; // return a directly callable address. This can be used similarly to the // value returned by getFunctionEntryPoint() except that it is // guaranteed to be multi callable entrypoint. virtual void getFunctionFixedEntryPoint( - CORINFO_METHOD_HANDLE ftn, - bool isUnsafeFunctionPointer, - CORINFO_CONST_LOOKUP * pResult) = 0; + CORINFO_METHOD_HANDLE ftn, + bool isUnsafeFunctionPointer, + CORINFO_CONST_LOOKUP * pResult + ) = 0; // get the synchronization handle that is passed to monXstatic function virtual void* getMethodSync( - CORINFO_METHOD_HANDLE ftn, - void **ppIndirection = NULL - ) = 0; + CORINFO_METHOD_HANDLE ftn, + void** ppIndirection = NULL + ) = 0; // get slow lazy string literal helper to use (CORINFO_HELP_STRCNS*). // Returns CORINFO_HELP_UNDEF if lazy string literal helper cannot be used. virtual CorInfoHelpFunc getLazyStringLiteralHelper( - CORINFO_MODULE_HANDLE handle - ) = 0; + CORINFO_MODULE_HANDLE handle + ) = 0; virtual CORINFO_MODULE_HANDLE embedModuleHandle( - CORINFO_MODULE_HANDLE handle, - void **ppIndirection = NULL - ) = 0; + CORINFO_MODULE_HANDLE handle, + void **ppIndirection = NULL + ) = 0; virtual CORINFO_CLASS_HANDLE embedClassHandle( - CORINFO_CLASS_HANDLE handle, - void **ppIndirection = NULL - ) = 0; + CORINFO_CLASS_HANDLE handle, + void **ppIndirection = NULL + ) = 0; virtual CORINFO_METHOD_HANDLE embedMethodHandle( - CORINFO_METHOD_HANDLE handle, - void **ppIndirection = NULL - ) = 0; + CORINFO_METHOD_HANDLE handle, + void **ppIndirection = NULL + ) = 0; virtual CORINFO_FIELD_HANDLE embedFieldHandle( - CORINFO_FIELD_HANDLE handle, - void **ppIndirection = NULL - ) = 0; + CORINFO_FIELD_HANDLE handle, + void **ppIndirection = NULL + ) = 0; // Given a module scope (module), a method handle (context) and // a metadata token (metaTOK), fetch the handle @@ -3029,9 +3037,10 @@ class ICorDynamicInfo : public ICorStaticInfo // then indicate how the handle should be looked up at run-time. // virtual void embedGenericHandle( - CORINFO_RESOLVED_TOKEN * pResolvedToken, - bool fEmbedParent, // TRUE - embeds parent type handle of the field/method handle - CORINFO_GENERICHANDLE_RESULT * pResult) = 0; + CORINFO_RESOLVED_TOKEN * pResolvedToken, + bool fEmbedParent, // `true` - embeds parent type handle of the field/method handle + CORINFO_GENERICHANDLE_RESULT * pResult + ) = 0; // Return information used to locate the exact enclosing type of the current method. // Used only to invoke .cctor method from code shared across generic instantiations @@ -3041,69 +3050,69 @@ class ICorDynamicInfo : public ICorStaticInfo // CORINFO_LOOKUP_CLASSPARAM use vtable hidden param // CORINFO_LOOKUP_METHODPARAM use enclosing type of method-desc hidden param virtual void getLocationOfThisType( - CORINFO_METHOD_HANDLE context, - CORINFO_LOOKUP_KIND* pLookupKind - ) = 0; + CORINFO_METHOD_HANDLE context, + CORINFO_LOOKUP_KIND* pLookupKind + ) = 0; // return the address of the PInvoke target. May be a fixup area in the // case of late-bound PInvoke calls. virtual void getAddressOfPInvokeTarget( - CORINFO_METHOD_HANDLE method, - CORINFO_CONST_LOOKUP *pLookup - ) = 0; + CORINFO_METHOD_HANDLE method, + CORINFO_CONST_LOOKUP * pLookup + ) = 0; // Generate a cookie based on the signature that would needs to be passed // to CORINFO_HELP_PINVOKE_CALLI virtual void* GetCookieForPInvokeCalliSig( - CORINFO_SIG_INFO* szMetaSig, - void ** ppIndirection = NULL + CORINFO_SIG_INFO* szMetaSig, + void** ppIndirection = NULL ) = 0; // returns true if a VM cookie can be generated for it (might be false due to cross-module // inlining, in which case the inlining should be aborted) virtual bool canGetCookieForPInvokeCalliSig( - CORINFO_SIG_INFO* szMetaSig - ) = 0; + CORINFO_SIG_INFO* szMetaSig + ) = 0; // Gets a handle that is checked to see if the current method is // included in "JustMyCode" virtual CORINFO_JUST_MY_CODE_HANDLE getJustMyCodeHandle( - CORINFO_METHOD_HANDLE method, - CORINFO_JUST_MY_CODE_HANDLE**ppIndirection = NULL - ) = 0; + CORINFO_METHOD_HANDLE method, + CORINFO_JUST_MY_CODE_HANDLE** ppIndirection = NULL + ) = 0; // Gets a method handle that can be used to correlate profiling data. // This is the IP of a native method, or the address of the descriptor struct // for IL. Always guaranteed to be unique per process, and not to move. */ virtual void GetProfilingHandle( - bool *pbHookFunction, - void **pProfilerHandle, - bool *pbIndirectedHandles - ) = 0; + bool *pbHookFunction, + void **pProfilerHandle, + bool *pbIndirectedHandles + ) = 0; // Returns instructions on how to make the call. See code:CORINFO_CALL_INFO for possible return values. virtual void getCallInfo( - // Token info - CORINFO_RESOLVED_TOKEN * pResolvedToken, + // Token info + CORINFO_RESOLVED_TOKEN * pResolvedToken, - //Generics info - CORINFO_RESOLVED_TOKEN * pConstrainedResolvedToken, + // Generics info + CORINFO_RESOLVED_TOKEN * pConstrainedResolvedToken, - //Security info - CORINFO_METHOD_HANDLE callerHandle, + // Security info + CORINFO_METHOD_HANDLE callerHandle, - //Jit info - CORINFO_CALLINFO_FLAGS flags, + // Jit info + CORINFO_CALLINFO_FLAGS flags, - //out params - CORINFO_CALL_INFO *pResult - ) = 0; + // out params + CORINFO_CALL_INFO *pResult + ) = 0; - // returns the class's domain ID for accessing shared statics + // Returns the class's domain ID for accessing shared statics virtual unsigned getClassDomainID ( - CORINFO_CLASS_HANDLE cls, - void **ppIndirection = NULL - ) = 0; + CORINFO_CLASS_HANDLE cls, + void **ppIndirection = NULL + ) = 0; //------------------------------------------------------------------------------ // getStaticFieldContent: returns true and the actual field's value if the given @@ -3119,19 +3128,19 @@ class ICorDynamicInfo : public ICorStaticInfo // Returns true if field's constant value was available and successfully copied to buffer // virtual bool getStaticFieldContent( - CORINFO_FIELD_HANDLE field, - uint8_t *buffer, - int bufferSize, - int valueOffset = 0, - bool ignoreMovableObjects = true - ) = 0; + CORINFO_FIELD_HANDLE field, + uint8_t *buffer, + int bufferSize, + int valueOffset = 0, + bool ignoreMovableObjects = true + ) = 0; virtual bool getObjectContent( - CORINFO_OBJECT_HANDLE obj, - uint8_t* buffer, - int bufferSize, - int valueOffset - ) = 0; + CORINFO_OBJECT_HANDLE obj, + uint8_t* buffer, + int bufferSize, + int valueOffset + ) = 0; // If pIsSpeculative is NULL, return the class handle for the value of ref-class typed // static readonly fields, if there is a unique location for the static and the class @@ -3145,40 +3154,40 @@ class ICorDynamicInfo : public ICorStaticInfo // is readonly but class has not yet finished initialization). Set *pIsSpeculative false // if this type will not change. virtual CORINFO_CLASS_HANDLE getStaticFieldCurrentClass( - CORINFO_FIELD_HANDLE field, - bool *pIsSpeculative = NULL - ) = 0; + CORINFO_FIELD_HANDLE field, + bool *pIsSpeculative = NULL + ) = 0; // registers a vararg sig & returns a VM cookie for it (which can contain other stuff) virtual CORINFO_VARARGS_HANDLE getVarArgsHandle( - CORINFO_SIG_INFO *pSig, - void **ppIndirection = NULL - ) = 0; + CORINFO_SIG_INFO *pSig, + void **ppIndirection = NULL + ) = 0; // returns true if a VM cookie can be generated for it (might be false due to cross-module // inlining, in which case the inlining should be aborted) virtual bool canGetVarArgsHandle( - CORINFO_SIG_INFO *pSig - ) = 0; + CORINFO_SIG_INFO *pSig + ) = 0; // Allocate a string literal on the heap and return a handle to it virtual InfoAccessType constructStringLiteral( - CORINFO_MODULE_HANDLE module, - mdToken metaTok, - void **ppValue - ) = 0; + CORINFO_MODULE_HANDLE module, + mdToken metaTok, + void **ppValue + ) = 0; virtual InfoAccessType emptyStringLiteral( - void **ppValue - ) = 0; + void **ppValue + ) = 0; // (static fields only) given that 'field' refers to thread local store, // return the ID (TLS index), which is used to find the beginning of the // TLS data area for the particular DLL 'field' is associated with. virtual uint32_t getFieldThreadLocalStoreID ( - CORINFO_FIELD_HANDLE field, - void **ppIndirection = NULL - ) = 0; + CORINFO_FIELD_HANDLE field, + void **ppIndirection = NULL + ) = 0; virtual CORINFO_METHOD_HANDLE GetDelegateCtor( CORINFO_METHOD_HANDLE methHnd, @@ -3188,34 +3197,34 @@ class ICorDynamicInfo : public ICorStaticInfo ) = 0; virtual void MethodCompileComplete( - CORINFO_METHOD_HANDLE methHnd - ) = 0; + CORINFO_METHOD_HANDLE methHnd + ) = 0; // Obtain tailcall help for the specified call site. virtual bool getTailCallHelpers( + // The resolved token for the call. Can be null for calli. + CORINFO_RESOLVED_TOKEN* callToken, - // The resolved token for the call. Can be null for calli. - CORINFO_RESOLVED_TOKEN* callToken, - - // The signature at the callsite. - CORINFO_SIG_INFO* sig, + // The signature at the callsite. + CORINFO_SIG_INFO* sig, - // Flags for the tailcall site. - CORINFO_GET_TAILCALL_HELPERS_FLAGS flags, + // Flags for the tailcall site. + CORINFO_GET_TAILCALL_HELPERS_FLAGS flags, - // The resulting help. - CORINFO_TAILCALL_HELPERS* pResult) = 0; + // The resulting help. + CORINFO_TAILCALL_HELPERS* pResult + ) = 0; // Optionally, convert calli to regular method call. This is for PInvoke argument marshalling. virtual bool convertPInvokeCalliToCall( - CORINFO_RESOLVED_TOKEN * pResolvedToken, - bool fMustConvert - ) = 0; + CORINFO_RESOLVED_TOKEN * pResolvedToken, + bool fMustConvert + ) = 0; // Notify EE about intent to use or not to use instruction set in the method. Returns true if the instruction set is supported unconditionally. virtual bool notifyInstructionSetUsage( - CORINFO_InstructionSet instructionSet, - bool supportEnabled + CORINFO_InstructionSet instructionSet, + bool supportEnabled ) = 0; // Notify EE that JIT needs an entry-point that is tail-callable. diff --git a/src/coreclr/inc/corjit.h b/src/coreclr/inc/corjit.h index 2ad7e1ff034605..9cee9b17421255 100644 --- a/src/coreclr/inc/corjit.h +++ b/src/coreclr/inc/corjit.h @@ -191,11 +191,11 @@ class ICorJitCompiler // * For the 64 bit jit this is implemented by code:PreJit.compileMethod // Note: setTargetOS must be called before this api is used. virtual CorJitResult compileMethod ( - ICorJitInfo *comp, /* IN */ - struct CORINFO_METHOD_INFO *info, /* IN */ - unsigned /* code:CorJitFlag */ flags, /* IN */ - uint8_t **nativeEntry, /* OUT */ - uint32_t *nativeSizeOfCode /* OUT */ + ICorJitInfo* comp, /* IN */ + struct CORINFO_METHOD_INFO* info, /* IN */ + unsigned /* code:CorJitFlag */ flags, /* IN */ + uint8_t** nativeEntry, /* OUT */ + uint32_t* nativeSizeOfCode /* OUT */ ) = 0; // Do any appropriate work at process shutdown. Default impl is to do nothing. @@ -251,7 +251,7 @@ class ICorJitInfo : public ICorDynamicInfo virtual void reserveUnwindInfo ( bool isFunclet, /* IN */ bool isColdCode, /* IN */ - uint32_t unwindSize /* IN */ + uint32_t unwindSize /* IN */ ) = 0; // Allocate and initialize the .rdata and .pdata for this method or @@ -272,19 +272,18 @@ class ICorJitInfo : public ICorDynamicInfo // funcKind type of funclet (main method code, handler, filter) // virtual void allocUnwindInfo ( - uint8_t * pHotCode, /* IN */ - uint8_t * pColdCode, /* IN */ - uint32_t startOffset, /* IN */ - uint32_t endOffset, /* IN */ - uint32_t unwindSize, /* IN */ - uint8_t * pUnwindBlock, /* IN */ - CorJitFuncKind funcKind /* IN */ + uint8_t * pHotCode, /* IN */ + uint8_t * pColdCode, /* IN */ + uint32_t startOffset, /* IN */ + uint32_t endOffset, /* IN */ + uint32_t unwindSize, /* IN */ + uint8_t * pUnwindBlock, /* IN */ + CorJitFuncKind funcKind /* IN */ ) = 0; - // Get a block of memory needed for the code manager information, - // (the info for enumerating the GC pointers while crawling the - // stack frame). - // Note that allocMem must be called first + // Get a block of memory needed for the code manager information, + // (the info for enumerating the GC pointers while crawling the + // stack frame). Note that allocMem must be called first. virtual void * allocGCInfo ( size_t size /* IN */ ) = 0; @@ -293,7 +292,7 @@ class ICorJitInfo : public ICorDynamicInfo // This is guaranteed to be called before any 'setEHinfo' call. // Note that allocMem must be called before this method can be called. virtual void setEHcount ( - unsigned cEH /* IN */ + unsigned cEH /* IN */ ) = 0; // Set the values for one particular exception handler block. @@ -303,7 +302,7 @@ class ICorJitInfo : public ICorDynamicInfo // determine if a "finally" clause is executing. virtual void setEHinfo ( unsigned EHnumber, /* IN */ - const CORINFO_EH_CLAUSE *clause /* IN */ + const CORINFO_EH_CLAUSE* clause /* IN */ ) = 0; // Level -> fatalError, Level 2 -> Error, Level 3 -> Warning @@ -463,19 +462,19 @@ class ICorJitInfo : public ICorDynamicInfo // the call site has no signature information (e.g. a helper call) or has no method handle // (e.g. a CALLI P/Invoke), then null should be passed instead. virtual void recordCallSite( - uint32_t instrOffset, /* IN */ - CORINFO_SIG_INFO * callSig, /* IN */ - CORINFO_METHOD_HANDLE methodHandle /* IN */ + uint32_t instrOffset, /* IN */ + CORINFO_SIG_INFO * callSig, /* IN */ + CORINFO_METHOD_HANDLE methodHandle /* IN */ ) = 0; // A relocation is recorded if we are pre-jitting. // A jump thunk may be inserted if we are jitting virtual void recordRelocation( - void * location, /* IN */ - void * locationRW, /* IN */ - void * target, /* IN */ - uint16_t fRelocType, /* IN */ - int32_t addlDelta = 0 /* IN */ + void * location, /* IN */ + void * locationRW, /* IN */ + void * target, /* IN */ + uint16_t fRelocType, /* IN */ + int32_t addlDelta = 0 /* IN */ ) = 0; virtual uint16_t getRelocTypeHint(void * target) = 0; @@ -490,9 +489,9 @@ class ICorJitInfo : public ICorDynamicInfo // Fetches extended flags for a particular compilation instance. Returns // the number of bytes written to the provided buffer. virtual uint32_t getJitFlags( - CORJIT_FLAGS* flags, /* IN: Points to a buffer that will hold the extended flags. */ - uint32_t sizeInBytes /* IN: The size of the buffer. Note that this is effectively a - version number for the CORJIT_FLAGS value. */ + CORJIT_FLAGS* flags, /* IN: Points to a buffer that will hold the extended flags. */ + uint32_t sizeInBytes /* IN: The size of the buffer. Note that this is effectively a + version number for the CORJIT_FLAGS value. */ ) = 0; };