Make a few JIT interface changes to accommodate CoreRT:
authorPat Gavlin <pagavlin@microsoft.com>
Fri, 5 Feb 2016 01:57:33 +0000 (17:57 -0800)
committerPat Gavlin <pagavlin@microsoft.com>
Fri, 5 Feb 2016 01:57:33 +0000 (17:57 -0800)
- Add support for providing extended flags for a compile invocation. In order to preserve binary compatibility with older definitions of ICorJitCompiler, this involved adding a new method to ICJI to fetch the flags. This method is only called if no flags are provided to the compiler via compileMethod.
- Add helper definitions for CORINFO_HELP_PINVOKE_{BEGIN,END} for CoreRT
- Add a flag to CorJitFlag2 to indicate that the aforementioned heleprs should be used instead of generating inline transitions
- Add a new method, getAddressOfPInvokeTarget, to the JIT/EE interface. This method can return a direct target for a PInvoke call in addition to an indirect or double-indirect target.

[tfs-changeset: 1572442]

13 files changed:
src/inc/corinfo.h
src/inc/corjit.h
src/inc/jithelpers.h
src/jit/compiler.cpp
src/jit/compiler.h
src/jit/ee_il_dll.cpp
src/jit/flowgraph.cpp
src/jit/jit.h
src/jit/lower.cpp
src/vm/jitinterface.cpp
src/vm/jitinterface.h
src/zap/zapinfo.cpp
src/zap/zapinfo.h

index 81ac06dbc396b8efe43b2c1a3da6f44bb0f651cf..86f46a6092b8d9381c2baf070beb8835123734ee 100644 (file)
@@ -231,11 +231,11 @@ TODO: Talk about initializing strutures before use
 #if COR_JIT_EE_VERSION > 460
 
 // Update this one
-SELECTANY const GUID JITEEVersionIdentifier = { /* f7be09f3-9ca7-42fd-b0ca-f97c0499f5a3 */
-    0xf7be09f3,
-    0x9ca7,
-    0x42fd,
-    {0xb0, 0xca, 0xf9, 0x7c, 0x04, 0x99, 0xf5, 0xa3}
+SELECTANY const GUID JITEEVersionIdentifier = { /* b26841f8-74d6-4fc9-9d81-6500cd662549 */
+    0xb26841f8,
+    0x74d6,
+    0x4fc9,
+    { 0x9d, 0x81, 0x65, 0x00, 0xcd, 0x66, 0x25, 0x49 }
 };
 
 #else
@@ -740,6 +740,9 @@ enum CorInfoHelpFunc
 #if COR_JIT_EE_VERSION > 460
     CORINFO_HELP_THROW_ARGUMENTEXCEPTION,           // throw ArgumentException
     CORINFO_HELP_THROW_ARGUMENTOUTOFRANGEEXCEPTION, // throw ArgumentOutOfRangeException
+
+    CORINFO_HELP_JIT_PINVOKE_BEGIN, // Transition to preemptive mode before a P/Invoke, frame is the first argument
+    CORINFO_HELP_JIT_PINVOKE_END,   // Transition to cooperative mode after a P/Invoke, frame is the first argument
 #endif
 
     CORINFO_HELP_COUNT,
@@ -3362,6 +3365,11 @@ public:
                     CORINFO_METHOD_HANDLE context
                     ) = 0;
 
+    // NOTE: the two methods below--getPInvokeUnmanagedTarget and getAddressOfPInvokeFixup--are
+    //       deprecated. New code (i.e. anything that can depend on COR_JIT_EE_VERSION being
+    //       greater than 460) should instead use getAddressOfPInvokeTarget, which subsumes the
+    //       functionality of these methods.
+
     // return the unmanaged target *if method has already been prelinked.*
     virtual void* getPInvokeUnmanagedTarget(
                     CORINFO_METHOD_HANDLE   method,
@@ -3374,6 +3382,15 @@ public:
                     void                  **ppIndirection = NULL
                     ) = 0;
 
+#if COR_JIT_EE_VERSION > 460
+    // 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;
+#endif
+
     // Generate a cookie based on the signature that would needs to be passed
     // to CORINFO_HELP_PINVOKE_CALLI
     virtual LPVOID GetCookieForPInvokeCalliSig(
index a84887d1092a7b73513f847ff0171e38936b4048..86dd32ae54f310953e4ed1cc49fff40a9e4c803e 100644 (file)
@@ -159,16 +159,27 @@ enum CorJitFlag
     CORJIT_FLG_ALIGN_LOOPS         = 0x20000000, // add NOPs before loops to align them at 16 byte boundaries
     CORJIT_FLG_PUBLISH_SECRET_PARAM= 0x40000000, // JIT must place stub secret param into local 0.  (used by IL stubs)
     CORJIT_FLG_GCPOLL_INLINE       = 0x80000000, // JIT must inline calls to GCPoll when possible
+
+#if COR_JIT_EE_VERSION > 460
+    CORJIT_FLG_CALL_GETJITFLAGS    = 0xffffffff, // Indicates that the JIT should retrieve flags in the form of a
+                                                 // pointer to a CORJIT_FLAGS value via ICorJitInfo::getJitFlags().
+#endif
 };
 
 enum CorJitFlag2
 {
-#ifdef FEATURE_STACK_SAMPLING
-    CORJIT_FLG2_SAMPLING_JIT_BACKGROUND  
-                                   = 0x00000001, // JIT is being invoked as a result of stack sampling for hot methods in the background
+    CORJIT_FLG2_SAMPLING_JIT_BACKGROUND = 0x00000001, // JIT is being invoked as a result of stack sampling for hot methods in the background
+#if COR_JIT_EE_VERSION > 460
+    CORJIT_FLG2_USE_PINVOKE_HELPERS     = 0x00000002, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions
 #endif
 };
 
+struct CORJIT_FLAGS
+{
+    unsigned corJitFlags;  // Values are from CorJitFlag
+    unsigned corJitFlags2; // Values are from CorJitFlag2
+};
+
 /*****************************************************************************
 Here is how CORJIT_FLG_SKIP_VERIFICATION should be interepreted.
 Note that even if any method is inlined, it need not be verified.
@@ -566,6 +577,16 @@ public:
     // different value than if it was compiling for the host architecture.
     // 
     virtual DWORD getExpectedTargetArchitecture() = 0;
+
+#if COR_JIT_EE_VERSION > 460
+    // Fetches extended flags for a particular compilation instance. Returns
+    // the number of bytes written to the provided buffer.
+    virtual DWORD getJitFlags(
+        CORJIT_FLAGS* flags,       /* IN: Points to a buffer that will hold the extended flags. */
+        DWORD        sizeInBytes   /* IN: The size of the buffer. Note that this is effectively a
+                                          version number for the CORJIT_FLAGS value. */
+        ) = 0;
+#endif
 };
 
 /**********************************************************************************/
index 4da7889e21a4e2386791abe49e7cb7439c71f656..308ad54e97f2a7b4f68c9a8ab9cf9ce4991aa8fd 100644 (file)
     JITHELPER1(CORINFO_HELP_THROW_ARGUMENTEXCEPTION,           JIT_ThrowArgumentException,           CORINFO_HELP_SIG_REG_ONLY, MDIL_HELP_UNDEF)
     JITHELPER1(CORINFO_HELP_THROW_ARGUMENTOUTOFRANGEEXCEPTION, JIT_ThrowArgumentOutOfRangeException, CORINFO_HELP_SIG_REG_ONLY, MDIL_HELP_UNDEF)
 
+    JITHELPER1(CORINFO_HELP_JIT_PINVOKE_BEGIN, NULL, CORINFO_HELP_SIG_UNDEF, MDIL_HELP_UNDEF)
+    JITHELPER1(CORINFO_HELP_JIT_PINVOKE_END, NULL, CORINFO_HELP_SIG_UNDEF, MDIL_HELP_UNDEF)
+
 #endif // COR_JIT_EE_VERSION
 
 #undef JITHELPER1
index e8c9db3128fe68e29d9049fa83e08e59860339ae..604393a03991201a338b1feef857d219ec152e0a 100644 (file)
@@ -1883,19 +1883,22 @@ unsigned ReinterpretHexAsDecimal(unsigned in)
 }
 
 inline
-void                Compiler::compInitOptions(unsigned compileFlags)
+void                Compiler::compInitOptions(CORJIT_FLAGS* jitFlags)
 {
 #ifdef UNIX_AMD64_ABI
     opts.compNeedToAlignFrame = false;
 #endif // UNIX_AMD64_ABI   
     memset(&opts, 0, sizeof(opts));
 
+    unsigned compileFlags = jitFlags->corJitFlags;
+
     if (compIsForInlining())
     {
         assert((compileFlags & CORJIT_FLG_LOST_WHEN_INLINING) == 0);
         assert(compileFlags & CORJIT_FLG_SKIP_VERIFICATION);
     }
-    
+
+    opts.jitFlags  = jitFlags;
     opts.eeFlags   = compileFlags;
     opts.compFlags = CLFLG_MAXOPT;      // Default value is for full optimization
 
@@ -3523,7 +3526,7 @@ bool  Compiler::compRsvdRegCheck(FrameLayoutState curState)
 //  
 void                 Compiler::compCompile(void * * methodCodePtr,
                                            ULONG  * methodCodeSize,
-                                           unsigned compileFlags)
+                                           CORJIT_FLAGS * compileFlags)
 {
     hashBv::Init(this);
 
@@ -3596,7 +3599,7 @@ void                 Compiler::compCompile(void * * methodCodePtr,
     fgRemoveEH();
 #endif // !FEATURE_EH
 
-    if (compileFlags & CORJIT_FLG_BBINSTR)
+    if (compileFlags->corJitFlags & CORJIT_FLG_BBINSTR)
     {
         fgInstrumentMethod();
     }
@@ -4143,7 +4146,7 @@ int           Compiler::compCompile(CORINFO_METHOD_HANDLE methodHnd,
                                     CORINFO_METHOD_INFO * methodInfo,
                                     void *              * methodCodePtr,
                                     ULONG               * methodCodeSize,
-                                    unsigned              compileFlags)
+                                    CORJIT_FLAGS        * compileFlags)
 {
 #ifdef FEATURE_JIT_METHOD_PERF
     static bool checkedForJitTimeLog = false;
@@ -4300,7 +4303,7 @@ int           Compiler::compCompile(CORINFO_METHOD_HANDLE methodHnd,
 
     // Set this before the first 'BADCODE'
     // Skip verification where possible
-    tiVerificationNeeded = ((compileFlags & CORJIT_FLG_SKIP_VERIFICATION) == 0);
+    tiVerificationNeeded = (compileFlags->corJitFlags & CORJIT_FLG_SKIP_VERIFICATION) == 0;
 
     assert(!compIsForInlining() || !tiVerificationNeeded); // Inlinees must have been verified.
 
@@ -4372,7 +4375,7 @@ int           Compiler::compCompile(CORINFO_METHOD_HANDLE methodHnd,
         CORINFO_METHOD_INFO * methodInfo;
         void *              * methodCodePtr;
         ULONG               * methodCodeSize;
-        unsigned              compileFlags;
+        CORJIT_FLAGS        * compileFlags;
 
         CorInfoInstantiationVerification instVerInfo;
         int result;
@@ -4680,7 +4683,7 @@ int           Compiler::compCompileHelper (CORINFO_MODULE_HANDLE            clas
                                            CORINFO_METHOD_INFO            * methodInfo,
                                            void *                         * methodCodePtr,
                                            ULONG                          * methodCodeSize,
-                                           unsigned                         compileFlags,
+                                           CORJIT_FLAGS                   * compileFlags,
                                            CorInfoInstantiationVerification instVerInfo)
     {
         CORINFO_METHOD_HANDLE methodHnd = info.compMethodHnd;
@@ -5518,7 +5521,7 @@ int           jitNativeCode ( CORINFO_METHOD_HANDLE     methodHnd,
                               CORINFO_METHOD_INFO*  methodInfo,
                               void *          * methodCodePtr,
                               ULONG           * methodCodeSize,
-                              unsigned          compileFlags,
+                              CORJIT_FLAGS    * compileFlags,
                               void *            inlineInfoPtr
                               )
 {
@@ -5573,7 +5576,7 @@ START:
         CORINFO_METHOD_INFO*  methodInfo;
         void *          * methodCodePtr;
         ULONG           * methodCodeSize;
-        unsigned          compileFlags;
+        CORJIT_FLAGS    * compileFlags;
         InlineInfo *      inlineInfo;
 
         int result;
@@ -5696,8 +5699,8 @@ START:
         jitFallbackCompile = true;
 
         // Update the flags for 'safer' code generation.
-        compileFlags |= CORJIT_FLG_MIN_OPT;
-        compileFlags &= ~(CORJIT_FLG_SIZE_OPT | CORJIT_FLG_SPEED_OPT);
+        compileFlags->corJitFlags |= CORJIT_FLG_MIN_OPT;
+        compileFlags->corJitFlags &= ~(CORJIT_FLG_SIZE_OPT | CORJIT_FLG_SPEED_OPT);
 
         goto START;
     }
index 24dee81925044e14a6fff62728f24005a04eaf28..0fee948b559f046844ba04f66cc4fdb80b20060e 100644 (file)
@@ -7648,7 +7648,8 @@ public :
 
     struct Options
     {
-        unsigned            eeFlags;        // flags passed from the EE
+        CORJIT_FLAGS*       jitFlags;       // all flags passed from the EE
+        unsigned            eeFlags;        // CorJitFlag flags passed from the EE
         unsigned            compFlags;      // method attributes
 
         codeOptimize        compCodeOpt;    // what type of code optimizations
@@ -8221,14 +8222,14 @@ public :
                                          CORINFO_METHOD_INFO * methodInfo,
                                          void *          * methodCodePtr,
                                          ULONG           * methodCodeSize,
-                                         unsigned          compileFlags);
+                                         CORJIT_FLAGS    * compileFlags);
     void                compCompileFinish();
     int                 compCompileHelper (CORINFO_MODULE_HANDLE            classPtr,
                                            COMP_HANDLE                      compHnd,
                                            CORINFO_METHOD_INFO            * methodInfo,
                                            void *                         * methodCodePtr,
                                            ULONG                          * methodCodeSize,
-                                           unsigned                         compileFlags,
+                                           CORJIT_FLAGS                   * compileFlags,
                                            CorInfoInstantiationVerification instVerInfo);
 
     norls_allocator *   compGetAllocator();
@@ -8455,7 +8456,7 @@ protected:
 
     unsigned            compMaxUncheckedOffsetForNullObject; 
 
-    void                compInitOptions (unsigned compileFlags);
+    void                compInitOptions (CORJIT_FLAGS* compileFlags);
 
     void                compSetProcessor();
     void                compInitDebuggingInfo();
@@ -8465,7 +8466,7 @@ protected:
 #endif
     void                compCompile  (void * * methodCodePtr,
                                       ULONG  * methodCodeSize,
-                                      unsigned compileFlags);
+                                      CORJIT_FLAGS * compileFlags);
 
     // Data required for generating profiler Enter/Leave/TailCall hooks
 #ifdef PROFILING_SUPPORTED
index 134d71962026477b3d5caa0e41f3bc97acc1bf66..f32f87557f90148b22f73b551a23f7b3ac5caf35 100644 (file)
@@ -163,6 +163,22 @@ CorJitResult CILJit::compileMethod (
         return g_realJitCompiler->compileMethod(compHnd, methodInfo, flags, entryAddress, nativeSizeOfCode);
     }
 
+    CORJIT_FLAGS jitFlags = { 0 };
+
+    DWORD jitFlagsSize = 0;
+#if COR_JIT_EE_VERSION > 460
+    if (flags == CORJIT_FLG_CALL_GETJITFLAGS)
+    {
+        jitFlagsSize = compHnd->getJitFlags(&jitFlags, sizeof(jitFlags));
+    }
+#endif
+
+    assert(jitFlagsSize <= sizeof(jitFlags));
+    if (jitFlagsSize == 0)
+    {
+        jitFlags.corJitFlags = flags;
+    }
+
     int                     result;
     void *                  methodCodePtr = NULL;
     CORINFO_METHOD_HANDLE   methodHandle  = methodInfo->ftn;
@@ -179,7 +195,7 @@ CorJitResult CILJit::compileMethod (
                            methodInfo,
                            &methodCodePtr,
                            nativeSizeOfCode,
-                           flags,
+                           &jitFlags,
                            NULL);
 
     if (result == CORJIT_OK)
index b321aa1771477a492c3593b9e3d4789545e42f8e..b95c429a77ed1d7379db070b52f27fc68a77f275 100644 (file)
@@ -21971,8 +21971,10 @@ void       Compiler::fgInvokeInlineeCompiler(GenTreeCall* call,
                          pParam->pThis->eeGetMethodFullName(pParam->fncHandle),
                          pParam->pThis->dspPtr(pParam->inlineInfo->tokenLookupContextHandle)));
 
-            unsigned   compileFlagsForInlinee = (pParam->pThis->opts.eeFlags & ~CORJIT_FLG_LOST_WHEN_INLINING)
-                                                         | CORJIT_FLG_SKIP_VERIFICATION;
+            CORJIT_FLAGS compileFlagsForInlinee;
+            memcpy(&compileFlagsForInlinee, pParam->pThis->opts.jitFlags, sizeof(compileFlagsForInlinee));
+            compileFlagsForInlinee.corJitFlags &= ~CORJIT_FLG_LOST_WHEN_INLINING;
+            compileFlagsForInlinee.corJitFlags |= CORJIT_FLG_SKIP_VERIFICATION;
 
 #ifdef DEBUG
             if (pParam->pThis->verbose)
@@ -21988,7 +21990,7 @@ void       Compiler::fgInvokeInlineeCompiler(GenTreeCall* call,
                           &pParam->inlineCandidateInfo->methInfo,
                           (void**)pParam->inlineInfo,
                           NULL,
-                          compileFlagsForInlinee,
+                          &compileFlagsForInlinee,
                           pParam->inlineInfo);
 
             if (result != CORJIT_OK)
index df336c32b6f1a9ddbffe5c2f800fdba2bd6d4793..af78504aa0fe895c71f3d03aed948aad7ac92c49 100644 (file)
@@ -774,7 +774,7 @@ extern  int                     jitNativeCode(CORINFO_METHOD_HANDLE methodHnd,
                                               CORINFO_METHOD_INFO * methodInfo,
                                               void *          * methodCodePtr,
                                               ULONG           * methodCodeSize,
-                                              unsigned          compileFlags,
+                                              CORJIT_FLAGS    * compileFlags,
                                               void *            inlineInfoPtr
                                               );
 
index 976d347516da5d756734121c44c55ac393beedd7..1dca46113e2ddd52ff49f6658b156324fc11dd80 100644 (file)
@@ -2811,25 +2811,40 @@ GenTree* Lowering::LowerNonvirtPinvokeCall(GenTreeCall* call)
 
     if (call->gtCallType != CT_INDIRECT)
     {
-        GenTree* indir = nullptr;
-
         noway_assert(call->gtCallType == CT_USER_FUNC);
         CORINFO_METHOD_HANDLE methHnd  = call->gtCallMethHnd;
 
-        void* pAddr;
-        addr = comp->info.compCompHnd->getAddressOfPInvokeFixup(methHnd, (void**)&pAddr);
-
-        if (addr != nullptr)
+        CORINFO_CONST_LOOKUP lookup;
+#if COR_JIT_EE_VERSION > 460
+        comp->info.compCompHnd->getAddressOfPInvokeTarget(methHnd, &lookup);
+#else
+        void* pIndirection;
+        lookup.accessType = IAT_PVALUE;
+        lookup.addr = comp->info.compCompHnd->getAddressOfPInvokeFixup(methHnd, &pIndirection);
+        if (lookup.addr == nullptr)
         {
-            indir = Ind(AddrGen(addr));
+            lookup.accessType = IAT_PPVALUE;
+            lookup.addr = pIndirection;
         }
-        else
+#endif
+
+        GenTree* address = AddrGen(lookup.addr);
+        switch (lookup.accessType)
         {
-            // double indirection
-            indir = Ind(Ind(AddrGen(pAddr)));
+            case IAT_VALUE:
+                result = address;
+                break;
+
+            case IAT_PVALUE:
+                result = Ind(address);
+                break;
+
+            case IAT_PPVALUE:
+                result = Ind(Ind(address));
+                break;
         }
-        result = indir;
     }
+
     InsertPInvokeCallEpilog(call);
 
     return result;
index d625bb904f610c35c693e39234e9adcac3ead5ea..fd8f1d5e2c4653f5e34bfe7c816748b9cd3c5f89 100644 (file)
@@ -9981,6 +9981,18 @@ void* CEEInfo::getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method,
     return result;
 }
 
+/*********************************************************************/
+    // return address of fixup area for late-bound N/Direct calls.
+void CEEInfo::getAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method,
+                                        CORINFO_CONST_LOOKUP *pLookup)
+{
+    WRAPPER_NO_CONTRACT;
+
+    void *pIndirection;
+    pLookup->accessType = IAT_PVALUE;
+    pLookup->addr = getAddressOfPInvokeFixup(method, &pIndirection);
+    _ASSERTE(pIndirection == NULL);
+}
 
 /*********************************************************************/
 CORINFO_JUST_MY_CODE_HANDLE CEEInfo::getJustMyCodeHandle(
@@ -10549,6 +10561,23 @@ CORINFO_METHOD_HANDLE CEEInfo::embedMethodHandle(CORINFO_METHOD_HANDLE handle,
     return handle;
 }
 
+/*********************************************************************/
+DWORD CEEInfo::getJitFlags(CORJIT_FLAGS* jitFlags, DWORD sizeInBytes)
+{
+    CONTRACTL {
+        SO_TOLERANT;
+        NOTHROW;
+        GC_NOTRIGGER;
+        MODE_PREEMPTIVE;
+    } CONTRACTL_END;
+
+    JIT_TO_EE_TRANSITION_LEAF();
+
+    EE_TO_JIT_TRANSITION_LEAF();
+
+    return 0;
+}
+
 /*********************************************************************/
 IEEMemoryManager* CEEInfo::getMemoryManager()
 {
index 72a4b175d2b0733bd2e30061d30b8e085693ab64..bb9fc061153c5517665955ed47071a909f938ba1 100644 (file)
@@ -911,6 +911,7 @@ public:
     bool canGetVarArgsHandle(CORINFO_SIG_INFO *sig);
     void* getPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void **ppIndirection);
     void* getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void **ppIndirection);
+    void getAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP *pLookup);
     CORINFO_JUST_MY_CODE_HANDLE getJustMyCodeHandle(CORINFO_METHOD_HANDLE method, CORINFO_JUST_MY_CODE_HANDLE **ppIndirection);
 
     void GetProfilingHandle(
@@ -1116,6 +1117,8 @@ public:
     // Performs any work JIT-related work that should be performed at process shutdown.
     void JitProcessShutdownWork();
 
+    DWORD getJitFlags(CORJIT_FLAGS* jitFlags, DWORD sizeInBytes);
+
 private:
     // Shrinking these buffers drastically reduces the amount of stack space
     // required for each instance of the interpreter, and thereby reduces SOs.
index 102bf43c20c3678f641e823ac8ffd6ff600ca665..e0306cd6fe685964844836b51e7aca7e39690493 100644 (file)
@@ -1460,6 +1460,13 @@ void ZapInfo::getGSCookie(GSCookie * pCookieVal, GSCookie ** ppCookieVal)
         offsetof(CORCOMPILE_EE_INFO_TABLE, gsCookie));
 }
 
+DWORD ZapInfo::getJitFlags(CORJIT_FLAGS* jitFlags, DWORD sizeInBytes)
+{
+    _ASSERTE(jitFlags != NULL);
+
+    return 0;
+}
+
 IEEMemoryManager* ZapInfo::getMemoryManager()
 {
     return GetEEMemoryManager();
@@ -2758,6 +2765,23 @@ void * ZapInfo::getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method,void **ppI
     return NULL;
 }
 
+void ZapInfo::getAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP *pLookup)
+{
+    _ASSERTE(pLookup != NULL);
+
+    void * pIndirection;
+    void * pResult = getAddressOfPInvokeFixup(method, &pIndirection);
+    if (pResult != NULL)
+    {
+        pLookup->accessType = IAT_PVALUE;
+        pLookup->addr = pResult;
+        return;
+    }
+
+    pLookup->accessType = IAT_PPVALUE;
+    pLookup->addr = pIndirection;
+}
+
 CORINFO_JUST_MY_CODE_HANDLE ZapInfo::getJustMyCodeHandle(
     CORINFO_METHOD_HANDLE method,
     CORINFO_JUST_MY_CODE_HANDLE **ppIndirection)
index 43e0cd85ed043fe7d4d59ca3f8f5ba9d1143c222..3d7d231e1d0f0730b8a2ccc8efb7b18912f0dfc4 100644 (file)
@@ -375,6 +375,8 @@ public:
             ICorJitInfo::ProfileBuffer ** profileBuffer,
             ULONG * numRuns);
 
+    DWORD getJitFlags(CORJIT_FLAGS* jitFlags, DWORD sizeInBytes);
+
     // ICorDynamicInfo
 
     DWORD getThreadTLSIndex(void **ppIndirection);
@@ -431,6 +433,8 @@ public:
                                      void **ppIndirection);
     void * getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method,
                                     void **ppIndirection);
+    void getAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method,
+                                   CORINFO_CONST_LOOKUP *pLookup);
     CORINFO_JUST_MY_CODE_HANDLE getJustMyCodeHandle(
                         CORINFO_METHOD_HANDLE method,
                         CORINFO_JUST_MY_CODE_HANDLE **ppIndirection);