@@ -490,7 +490,7 @@ BOOL ObjIsInstanceOf(Object* pObject, TypeHandle toTypeHnd, BOOL throwCastExcept
490
490
return ObjIsInstanceOfCore (pObject, toTypeHnd, throwCastException);
491
491
}
492
492
493
- extern " C" BOOL QCALLTYPE IsInstanceOf_NoCacheLookup (CORINFO_CLASS_HANDLE type, BOOL throwCastException, QCall::ObjectHandleOnStack objOnStack)
493
+ extern " C" BOOL QCALLTYPE IsInstanceOf_NoCacheLookup (EnregisteredTypeHandle type, BOOL throwCastException, QCall::ObjectHandleOnStack objOnStack)
494
494
{
495
495
QCALL_CONTRACT;
496
496
BOOL result = FALSE ;
@@ -499,55 +499,33 @@ extern "C" BOOL QCALLTYPE IsInstanceOf_NoCacheLookup(CORINFO_CLASS_HANDLE type,
499
499
500
500
GCX_COOP ();
501
501
502
- TypeHandle clsHnd (type);
503
- result = ObjIsInstanceOfCore (OBJECTREFToObject (objOnStack.Get ()), clsHnd, throwCastException);
502
+ result = ObjIsInstanceOfCore (OBJECTREFToObject (objOnStack.Get ()), TypeHandle::FromPtr (type), throwCastException);
504
503
505
504
END_QCALL;
506
505
507
506
return result;
508
507
}
509
508
510
- // ========================================================================
511
- //
512
- // STRING HELPERS
513
- //
514
- // ========================================================================
515
-
516
- /* ********************************************************************/
517
- STRINGREF* ConstructStringLiteral (CORINFO_MODULE_HANDLE scopeHnd, mdToken metaTok, void ** ppPinnedString)
518
- {
519
- STANDARD_VM_CONTRACT;
520
-
521
- _ASSERTE (TypeFromToken (metaTok) == mdtString);
522
- Module* module = GetModule (scopeHnd);
523
- return module ->ResolveStringRef (metaTok, ppPinnedString);
524
- }
525
-
526
-
527
509
// ========================================================================
528
510
//
529
511
// VALUETYPE/BYREF HELPERS
530
512
//
531
513
// ========================================================================
532
514
/* ************************************************************/
533
- HCIMPL2 (BOOL, JIT_IsInstanceOfException, CORINFO_CLASS_HANDLE type, Object* obj)
515
+ HCIMPL2 (BOOL, JIT_IsInstanceOfException, EnregisteredTypeHandle type, Object* obj)
534
516
{
535
517
FCALL_CONTRACT;
536
- TypeHandle clsHnd (type);
537
- return ExceptionIsOfRightType (clsHnd, obj->GetTypeHandle ());
518
+ return ExceptionIsOfRightType (TypeHandle::FromPtr (type), obj->GetTypeHandle ());
538
519
}
539
520
HCIMPLEND
540
521
541
- extern " C" void QCALLTYPE ThrowInvalidCastException (CORINFO_CLASS_HANDLE pSourceType, CORINFO_CLASS_HANDLE pTargetType)
522
+ extern " C" void QCALLTYPE ThrowInvalidCastException (EnregisteredTypeHandle pSourceType, EnregisteredTypeHandle pTargetType)
542
523
{
543
524
QCALL_CONTRACT;
544
525
545
526
BEGIN_QCALL;
546
527
547
- TypeHandle targetType (pTargetType);
548
- TypeHandle sourceType (pSourceType);
549
-
550
- COMPlusThrowInvalidCastException (sourceType, targetType);
528
+ COMPlusThrowInvalidCastException (TypeHandle::FromPtr (pSourceType), TypeHandle::FromPtr (pTargetType));
551
529
552
530
END_QCALL;
553
531
}
@@ -558,11 +536,11 @@ extern "C" void QCALLTYPE ThrowInvalidCastException(CORINFO_CLASS_HANDLE pSource
558
536
//
559
537
// ========================================================================
560
538
561
- CORINFO_GENERIC_HANDLE GenericHandleWorkerCore (MethodDesc * pMD, MethodTable * pMT, LPVOID signature, DWORD dictionaryIndexAndSlot, Module* pModule)
539
+ DictionaryEntry GenericHandleWorkerCore (MethodDesc * pMD, MethodTable * pMT, LPVOID signature, DWORD dictionaryIndexAndSlot, Module* pModule)
562
540
{
563
541
STANDARD_VM_CONTRACT;
564
542
565
- CORINFO_GENERIC_HANDLE result = NULL ;
543
+ DictionaryEntry result = NULL ;
566
544
567
545
_ASSERTE (pMT != NULL || pMD != NULL );
568
546
_ASSERTE (pMT == NULL || pMD == NULL );
@@ -610,7 +588,7 @@ CORINFO_GENERIC_HANDLE GenericHandleWorkerCore(MethodDesc * pMD, MethodTable * p
610
588
}
611
589
612
590
DictionaryEntry * pSlot;
613
- result = (CORINFO_GENERIC_HANDLE) Dictionary::PopulateEntry (pMD, pDeclaringMT, signature, FALSE , &pSlot, dictionaryIndexAndSlot, pModule);
591
+ result = Dictionary::PopulateEntry (pMD, pDeclaringMT, signature, FALSE , &pSlot, dictionaryIndexAndSlot, pModule);
614
592
615
593
if (pMT != NULL && pDeclaringMT != pMT)
616
594
{
@@ -629,11 +607,11 @@ CORINFO_GENERIC_HANDLE GenericHandleWorkerCore(MethodDesc * pMD, MethodTable * p
629
607
return result;
630
608
}
631
609
632
- extern " C" CORINFO_GENERIC_HANDLE QCALLTYPE GenericHandleWorker (MethodDesc * pMD, MethodTable * pMT, LPVOID signature, DWORD dictionaryIndexAndSlot, Module* pModule)
610
+ extern " C" void * QCALLTYPE GenericHandleWorker (MethodDesc * pMD, MethodTable * pMT, LPVOID signature, DWORD dictionaryIndexAndSlot, Module* pModule)
633
611
{
634
612
QCALL_CONTRACT;
635
613
636
- CORINFO_GENERIC_HANDLE result = NULL ;
614
+ void * result = NULL ;
637
615
638
616
BEGIN_QCALL;
639
617
@@ -702,14 +680,14 @@ void FlushVirtualFunctionPointerCaches()
702
680
// static method signature (i.e. might be for a superclass of classHnd)
703
681
704
682
// slow helper to call from the fast one
705
- extern " C" void * QCALLTYPE ResolveVirtualFunctionPointer (QCall::ObjectHandleOnStack obj,
706
- CORINFO_CLASS_HANDLE classHnd,
707
- CORINFO_METHOD_HANDLE methodHnd )
683
+ extern " C" PCODE QCALLTYPE ResolveVirtualFunctionPointer (QCall::ObjectHandleOnStack obj,
684
+ EnregisteredTypeHandle classHnd,
685
+ MethodDesc* pStaticMD )
708
686
{
709
687
QCALL_CONTRACT;
710
688
711
689
// The address of the method that's returned.
712
- CORINFO_MethodPtr addr = NULL ;
690
+ PCODE addr = (PCODE) NULL ;
713
691
714
692
BEGIN_QCALL;
715
693
@@ -736,8 +714,7 @@ extern "C" void* QCALLTYPE ResolveVirtualFunctionPointer(QCall::ObjectHandleOnSt
736
714
737
715
// This is the static method descriptor describing the call.
738
716
// It is not the destination of the call, which we must compute.
739
- MethodDesc* pStaticMD = (MethodDesc*) methodHnd;
740
- TypeHandle staticTH (classHnd);
717
+ TypeHandle staticTH = TypeHandle::FromPtr (classHnd);
741
718
742
719
if (staticTH.IsNull ())
743
720
{
@@ -759,14 +736,14 @@ extern "C" void* QCALLTYPE ResolveVirtualFunctionPointer(QCall::ObjectHandleOnSt
759
736
// as we have no good scheme for reporting an actionable error here.
760
737
if (!pStaticMD->IsVtableMethod ())
761
738
{
762
- addr = (CORINFO_MethodPtr) pStaticMD->GetMultiCallableAddrOfCode ();
739
+ addr = pStaticMD->GetMultiCallableAddrOfCode ();
763
740
_ASSERTE (addr);
764
741
}
765
742
else
766
743
{
767
744
// This is the new way of resolving a virtual call, including generic virtual methods.
768
745
// The code is now also used by reflection, remoting etc.
769
- addr = (CORINFO_MethodPtr) pStaticMD->GetMultiCallableAddrOfVirtualizedCode (&objRef, staticTH);
746
+ addr = pStaticMD->GetMultiCallableAddrOfVirtualizedCode (&objRef, staticTH);
770
747
_ASSERTE (addr);
771
748
}
772
749
@@ -786,18 +763,16 @@ HCIMPLEND
786
763
787
764
// Helper for synchronized static methods in shared generics code
788
765
#include < optsmallperfcritical.h>
789
- HCIMPL1 (CORINFO_CLASS_HANDLE , JIT_GetClassFromMethodParam, CORINFO_METHOD_HANDLE methHnd_ )
766
+ HCIMPL1 (EnregisteredTypeHandle , JIT_GetClassFromMethodParam, MethodDesc* pMD )
790
767
CONTRACTL {
791
768
FCALL_CHECK;
792
- PRECONDITION (methHnd_ != NULL );
769
+ PRECONDITION (pMD != NULL );
793
770
} CONTRACTL_END;
794
771
795
- MethodDesc * pMD = (MethodDesc*) methHnd_;
796
-
797
772
MethodTable * pMT = pMD->GetMethodTable ();
798
773
_ASSERTE (!pMT->IsSharedByGenericInstantiations ());
799
774
800
- return ((CORINFO_CLASS_HANDLE) pMT) ;
775
+ return pMT;
801
776
HCIMPLEND
802
777
#include < optdefault.h>
803
778
@@ -2161,7 +2136,7 @@ HCIMPL2(void, JIT_DelegateProfile64, Object *obj, ICorJitInfo::HandleHistogram64
2161
2136
}
2162
2137
HCIMPLEND
2163
2138
2164
- HCIMPL3 (void , JIT_VTableProfile32, Object* obj, CORINFO_METHOD_HANDLE baseMethod , ICorJitInfo::HandleHistogram32* methodProfile)
2139
+ HCIMPL3 (void , JIT_VTableProfile32, Object* obj, MethodDesc* pBaseMD , ICorJitInfo::HandleHistogram32* methodProfile)
2165
2140
{
2166
2141
FCALL_CONTRACT;
2167
2142
@@ -2174,8 +2149,6 @@ HCIMPL3(void, JIT_VTableProfile32, Object* obj, CORINFO_METHOD_HANDLE baseMethod
2174
2149
return ;
2175
2150
}
2176
2151
2177
- MethodDesc* pBaseMD = GetMethod (baseMethod);
2178
-
2179
2152
// Method better be virtual
2180
2153
_ASSERTE (pBaseMD->IsVirtual ());
2181
2154
@@ -2209,7 +2182,7 @@ HCIMPL3(void, JIT_VTableProfile32, Object* obj, CORINFO_METHOD_HANDLE baseMethod
2209
2182
}
2210
2183
HCIMPLEND
2211
2184
2212
- HCIMPL3 (void , JIT_VTableProfile64, Object* obj, CORINFO_METHOD_HANDLE baseMethod , ICorJitInfo::HandleHistogram64* methodProfile)
2185
+ HCIMPL3 (void , JIT_VTableProfile64, Object* obj, MethodDesc* pBaseMD , ICorJitInfo::HandleHistogram64* methodProfile)
2213
2186
{
2214
2187
FCALL_CONTRACT;
2215
2188
@@ -2222,8 +2195,6 @@ HCIMPL3(void, JIT_VTableProfile64, Object* obj, CORINFO_METHOD_HANDLE baseMethod
2222
2195
return ;
2223
2196
}
2224
2197
2225
- MethodDesc* pBaseMD = GetMethod (baseMethod);
2226
-
2227
2198
// Method better be virtual
2228
2199
_ASSERTE (pBaseMD->IsVirtual ());
2229
2200
@@ -2412,11 +2383,10 @@ NOINLINE static void JIT_ReversePInvokeEnterRare2(ReversePInvokeFrame* frame, vo
2412
2383
// We may not have a managed thread set up in JIT_ReversePInvokeEnter, and the GC mode may be incorrect.
2413
2384
// On x86, SEH handlers are set up and torn down explicitly, so we avoid using dynamic contracts.
2414
2385
// This method uses the correct calling convention and argument layout manually, without relying on standard macros or contracts.
2415
- HCIMPL3_RAW (void , JIT_ReversePInvokeEnterTrackTransitions, ReversePInvokeFrame* frame, CORINFO_METHOD_HANDLE handle , void * secretArg)
2386
+ HCIMPL3_RAW (void , JIT_ReversePInvokeEnterTrackTransitions, ReversePInvokeFrame* frame, MethodDesc* pMD , void * secretArg)
2416
2387
{
2417
- _ASSERTE (frame != NULL && handle != NULL );
2388
+ _ASSERTE (frame != NULL && pMD != NULL );
2418
2389
2419
- MethodDesc* pMD = GetMethod (handle);
2420
2390
if (pMD->IsILStub () && secretArg != NULL )
2421
2391
{
2422
2392
pMD = ((UMEntryThunkData*)secretArg)->m_pMD ;
@@ -2445,14 +2415,14 @@ HCIMPL3_RAW(void, JIT_ReversePInvokeEnterTrackTransitions, ReversePInvokeFrame*
2445
2415
{
2446
2416
// If we're in an IL stub, we want to trace the address of the target method,
2447
2417
// not the next instruction in the stub.
2448
- JIT_ReversePInvokeEnterRare2 (frame, _ReturnAddress (), GetMethod (handle) ->IsILStub () ? ((UMEntryThunkData*)secretArg)->m_pUMEntryThunk : (UMEntryThunk*)NULL );
2418
+ JIT_ReversePInvokeEnterRare2 (frame, _ReturnAddress (), pMD ->IsILStub () ? ((UMEntryThunkData*)secretArg)->m_pUMEntryThunk : (UMEntryThunk*)NULL );
2449
2419
}
2450
2420
}
2451
2421
else
2452
2422
{
2453
2423
// If we're in an IL stub, we want to trace the address of the target method,
2454
2424
// not the next instruction in the stub.
2455
- JIT_ReversePInvokeEnterRare (frame, _ReturnAddress (), GetMethod (handle) ->IsILStub () ? ((UMEntryThunkData*)secretArg)->m_pUMEntryThunk : (UMEntryThunk*)NULL );
2425
+ JIT_ReversePInvokeEnterRare (frame, _ReturnAddress (), pMD ->IsILStub () ? ((UMEntryThunkData*)secretArg)->m_pUMEntryThunk : (UMEntryThunk*)NULL );
2456
2426
}
2457
2427
2458
2428
#if defined(TARGET_X86) && defined(TARGET_WINDOWS)
0 commit comments