summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPat Gavlin <pagavlin@microsoft.com>2016-01-23 17:17:47 -0800
committerPat Gavlin <pagavlin@microsoft.com>2016-01-23 17:17:47 -0800
commitcbb877984d56c48358859f3cb3ab8cdc536809c6 (patch)
tree740eee6ff8550b56108c9088a688479f855bcd1c
parent626e050f03bff854793798d7abc496621c05ce02 (diff)
downloadcoreclr-cbb877984d56c48358859f3cb3ab8cdc536809c6.tar.gz
coreclr-cbb877984d56c48358859f3cb3ab8cdc536809c6.tar.bz2
coreclr-cbb877984d56c48358859f3cb3ab8cdc536809c6.zip
Address code review feedback.
-rw-r--r--src/inc/corinfo.h17
-rw-r--r--src/inc/corjit.h3
-rw-r--r--src/jit/codegencommon.cpp14
-rw-r--r--src/jit/codegenlegacy.cpp14
-rw-r--r--src/jit/compiler.h4
-rw-r--r--src/jit/flowgraph.cpp10
-rw-r--r--src/jit/lclvars.cpp28
-rw-r--r--src/jit/liveness.cpp28
-rw-r--r--src/jit/lower.cpp36
-rw-r--r--src/jit/regalloc.cpp7
-rw-r--r--src/vm/jitinterface.cpp14
-rw-r--r--src/vm/jitinterface.h2
-rw-r--r--src/zap/zapinfo.cpp13
-rw-r--r--src/zap/zapinfo.h4
14 files changed, 84 insertions, 110 deletions
diff --git a/src/inc/corinfo.h b/src/inc/corinfo.h
index 3e7094e9a2..f6481a7e39 100644
--- a/src/inc/corinfo.h
+++ b/src/inc/corinfo.h
@@ -232,11 +232,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, 0x0, 0xcd, 0x66, 0x25, 0x49 }
};
#else
@@ -3647,10 +3647,9 @@ public:
) = 0;
// return address of fixup area for late-bound PInvoke calls.
- virtual void* getAddressOfPInvokeFixup(
- CORINFO_METHOD_HANDLE method,
- void **ppIndirection = NULL
- ) = 0;
+ virtual void getAddressOfPInvokeFixup(
+ 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
diff --git a/src/inc/corjit.h b/src/inc/corjit.h
index 7665fdf9f8..4313e2e38a 100644
--- a/src/inc/corjit.h
+++ b/src/inc/corjit.h
@@ -132,9 +132,6 @@ enum CorJitFlag
CORJIT_FLG_NO_MDIL = 0x00010000, // Generate an MDIL section but no code or CTL. Not used by the JIT, used internally by NGen only.
#else // MDIL
CORJIT_FLG_PINVOKE_USE_HELPERS = 0x00004000, // Use JIT_PINVOKE_{BEGIN,END} helpers instead of generating transitions inline.
-
- // TODO: this should probably not overlap with CORJIT_FLG_MAKEFINALCODE, but we've run out of bits.
- CORJIT_FLG_PINVOKE_DIRECT_CALLS= 0x00008000, // Direct calls to native methods do not require indirections
#endif
#if defined(FEATURE_INTERPRETER)
diff --git a/src/jit/codegencommon.cpp b/src/jit/codegencommon.cpp
index 7b14c8858c..71b324327e 100644
--- a/src/jit/codegencommon.cpp
+++ b/src/jit/codegencommon.cpp
@@ -7557,7 +7557,7 @@ void CodeGen::genPrologPadForReJit()
regMaskTP CodeGen::genPInvokeMethodProlog(regMaskTP initRegs)
{
assert(compiler->compGeneratingProlog);
- noway_assert((compiler->opts.eeFlags & CORJIT_FLG_PINVOKE_USE_HELPERS) == 0);
+ noway_assert(!compiler->opts.ShouldUsePInvokeHelpers());
noway_assert(compiler->info.compCallUnmanaged);
CORINFO_EE_INFO * pInfo = compiler->eeGetEEInfo();
@@ -7777,7 +7777,7 @@ regMaskTP CodeGen::genPInvokeMethodProlog(regMaskTP initRegs)
void CodeGen::genPInvokeMethodEpilog()
{
noway_assert(compiler->info.compCallUnmanaged);
- noway_assert((compiler->opts.eeFlags & CORJIT_FLG_PINVOKE_USE_HELPERS) == 0);
+ noway_assert(!compiler->opts.ShouldUsePInvokeHelpers());
noway_assert(compiler->compCurBB == compiler->genReturnBB ||
(compiler->compTailCallUsed && (compiler->compCurBB->bbJumpKind == BBJ_THROW)) ||
(compiler->compJmpOpUsed && (compiler->compCurBB->bbFlags & BBF_HAS_JMP)));
@@ -8520,11 +8520,9 @@ void CodeGen::genFnProlog()
if (compiler->info.compCallUnmanaged)
{
excludeMask |= RBM_PINVOKE_FRAME;
- if (compiler->opts.eeFlags & CORJIT_FLG_PINVOKE_USE_HELPERS)
- {
- noway_assert(compiler->info.compLvFrameListRoot == BAD_VAR_NUM);
- }
- else
+
+ assert(!compiler->opts.ShouldUsePInvokeHelpers() || compiler->info.compLvFrameListRoot == BAD_VAR_NUM);
+ if (!compiler->opts.ShouldUsePInvokeHelpers())
{
noway_assert(compiler->info.compLvFrameListRoot < compiler->lvaCount);
@@ -8534,7 +8532,9 @@ void CodeGen::genFnProlog()
//
LclVarDsc * varDsc = &compiler->lvaTable[compiler->info.compLvFrameListRoot];
if (varDsc->lvRegister)
+ {
excludeMask |= genRegMask(varDsc->lvRegNum);
+ }
}
}
#endif // INLINE_NDIRECT
diff --git a/src/jit/codegenlegacy.cpp b/src/jit/codegenlegacy.cpp
index 5d518a1e19..233c1631df 100644
--- a/src/jit/codegenlegacy.cpp
+++ b/src/jit/codegenlegacy.cpp
@@ -19684,15 +19684,15 @@ regMaskTP CodeGen::genCodeForCall(GenTreePtr call,
else
{
noway_assert(callType == CT_USER_FUNC);
-
- void* pAddr;
- addr = compiler->info.compCompHnd->getAddressOfPInvokeFixup(methHnd, (void**)&pAddr);
- if (addr != NULL)
+
+ CORINFO_CONST_LOOKUP lookup;
+ comp->info.compCompHnd->getAddressOfPInvokeFixup(methHnd, &lookup);
+ if (lookup.accessType == IAT_PVALUE)
{
#if CPU_LOAD_STORE_ARCH
// Load the address into a register, indirect it and call through a register
indCallReg = regSet.rsGrabReg(RBM_ALLINT); // Grab an available register to use for the CALL indirection
- instGen_Set_Reg_To_Imm(EA_HANDLE_CNS_RELOC, indCallReg, (ssize_t)addr);
+ instGen_Set_Reg_To_Imm(EA_HANDLE_CNS_RELOC, indCallReg, (ssize_t)lookup.addr);
getEmitter()->emitIns_R_R_I(INS_ldr, EA_PTRSIZE, indCallReg, indCallReg, 0);
regTracker.rsTrackRegTrash(indCallReg);
// Now make the call "call indCallReg"
@@ -19718,12 +19718,14 @@ regMaskTP CodeGen::genCodeForCall(GenTreePtr call,
}
else
{
+ assert(lookup.accessType == IAT_PPVALUE);
+
// Double-indirection. Load the address into a register
// and call indirectly through a register
indCallReg = regSet.rsGrabReg(RBM_ALLINT); // Grab an available register to use for the CALL indirection
#if CPU_LOAD_STORE_ARCH
- instGen_Set_Reg_To_Imm(EA_HANDLE_CNS_RELOC, indCallReg, (ssize_t)pAddr);
+ instGen_Set_Reg_To_Imm(EA_HANDLE_CNS_RELOC, indCallReg, (ssize_t)lookup.addr);
getEmitter()->emitIns_R_R_I(INS_ldr, EA_PTRSIZE, indCallReg, indCallReg, 0);
getEmitter()->emitIns_R_R_I(INS_ldr, EA_PTRSIZE, indCallReg, indCallReg, 0);
regTracker.rsTrackRegTrash(indCallReg);
diff --git a/src/jit/compiler.h b/src/jit/compiler.h
index 71cb1a30cd..b9babbddbc 100644
--- a/src/jit/compiler.h
+++ b/src/jit/compiler.h
@@ -7527,6 +7527,10 @@ public :
inline bool IsReadyToRun() { return false; }
#endif
+ // true if we should use the PINVOKE_{BEGIN,END} helpers instead of generating
+ // PInvoke transitions inline (e.g. when targeting CoreRT).
+ inline bool ShouldUsePInvokeHelpers() { return (eeFlags & CORJIT_FLG_PINVOKE_USE_HELPERS) != 0; }
+
// true if we must generate compatible code with Jit64 quirks
inline bool IsJit64Compat()
{
diff --git a/src/jit/flowgraph.cpp b/src/jit/flowgraph.cpp
index 7d5f2ebd36..8cdbd96c70 100644
--- a/src/jit/flowgraph.cpp
+++ b/src/jit/flowgraph.cpp
@@ -8237,8 +8237,9 @@ void Compiler::fgAddInternal()
#if INLINE_NDIRECT
if (info.compCallUnmanaged != 0)
{
- bool usePInvokeHelpers = (opts.eeFlags & CORJIT_FLG_PINVOKE_USE_HELPERS) != 0;
- if (!usePInvokeHelpers)
+ // The P/Invoke helpers only require a frame variable, so only allocate the
+ // TCB variable if we're not using them.
+ if (!opts.ShouldUsePInvokeHelpers())
{
info.compLvFrameListRoot = lvaGrabTemp(false DEBUGARG("Pinvoke FrameListRoot"));
}
@@ -8252,8 +8253,9 @@ void Compiler::fgAddInternal()
varDsc->lvExactSize = eeGetEEInfo()->inlinedCallFrameInfo.size;
#if FEATURE_FIXED_OUT_ARGS
// Grab and reserve space for TCB, Frame regs used in PInvoke epilog to pop the inlined frame.
- // See genPInvokeMethodEpilog() for use of the grabbed var.
- if (!usePInvokeHelpers && compJmpOpUsed)
+ // See genPInvokeMethodEpilog() for use of the grabbed var. This is only necessary if we are
+ // not using the P/Invoke helpers.
+ if (!opts.ShouldUsePInvokeHelpers() && compJmpOpUsed)
{
lvaPInvokeFrameRegSaveVar = lvaGrabTempWithImplicitUse(false DEBUGARG("PInvokeFrameRegSave Var"));
varDsc = &lvaTable[lvaPInvokeFrameRegSaveVar];
diff --git a/src/jit/lclvars.cpp b/src/jit/lclvars.cpp
index cd13b73d57..024fb41fa3 100644
--- a/src/jit/lclvars.cpp
+++ b/src/jit/lclvars.cpp
@@ -2159,11 +2159,8 @@ void Compiler::lvaDecRefCnts(GenTreePtr tree)
if ((tree->gtOper == GT_CALL) && (tree->gtFlags & GTF_CALL_UNMANAGED))
{
- if (opts.eeFlags & CORJIT_FLG_PINVOKE_USE_HELPERS)
- {
- noway_assert(info.compLvFrameListRoot == BAD_VAR_NUM);
- }
- else
+ assert(!opts.ShouldUsePInvokeHelpers() || info.compLvFrameListRoot == BAD_VAR_NUM);
+ if (!opts.ShouldUsePInvokeHelpers())
{
/* Get the special variable descriptor */
@@ -2221,11 +2218,8 @@ void Compiler::lvaIncRefCnts(GenTreePtr tree)
if ((tree->gtOper == GT_CALL) && (tree->gtFlags & GTF_CALL_UNMANAGED))
{
- if (opts.eeFlags & CORJIT_FLG_PINVOKE_USE_HELPERS)
- {
- noway_assert(info.compLvFrameListRoot == BAD_VAR_NUM);
- }
- else
+ assert(!opts.ShouldUsePInvokeHelpers() || info.compLvFrameListRoot == BAD_VAR_NUM);
+ if (!opts.ShouldUsePInvokeHelpers())
{
/* Get the special variable descriptor */
@@ -2814,11 +2808,8 @@ void Compiler::lvaMarkLclRefs(GenTreePtr tree)
/* Is this a call to unmanaged code ? */
if (tree->gtOper == GT_CALL && tree->gtFlags & GTF_CALL_UNMANAGED)
{
- if (opts.eeFlags & CORJIT_FLG_PINVOKE_USE_HELPERS)
- {
- noway_assert(info.compLvFrameListRoot == BAD_VAR_NUM);
- }
- else
+ assert(!opts.ShouldUsePInvokeHelpers() || info.compLvFrameListRoot == BAD_VAR_NUM);
+ if (!opts.ShouldUsePInvokeHelpers())
{
/* Get the special variable descriptor */
@@ -3187,11 +3178,8 @@ void Compiler::lvaMarkLocalVars()
if (info.compCallUnmanaged != 0)
{
- if (opts.eeFlags & CORJIT_FLG_PINVOKE_USE_HELPERS)
- {
- noway_assert(info.compLvFrameListRoot == BAD_VAR_NUM);
- }
- else
+ assert(!opts.ShouldUsePInvokeHelpers() || info.compLvFrameListRoot == BAD_VAR_NUM);
+ if (!opts.ShouldUsePInvokeHelpers())
{
noway_assert(info.compLvFrameListRoot >= info.compLocalsCount &&
info.compLvFrameListRoot < lvaCount);
diff --git a/src/jit/liveness.cpp b/src/jit/liveness.cpp
index a1bd10ac31..7de58587f4 100644
--- a/src/jit/liveness.cpp
+++ b/src/jit/liveness.cpp
@@ -439,11 +439,8 @@ void Compiler::fgPerStatementLocalVarLiveness(GenTreePtr startNode, GenTreePtr a
if ((tree->gtCall.IsUnmanaged() || (tree->gtCall.IsTailCall() && info.compCallUnmanaged)))
{
- if (opts.eeFlags & CORJIT_FLG_PINVOKE_USE_HELPERS)
- {
- noway_assert(info.compLvFrameListRoot == BAD_VAR_NUM);
- }
- else
+ assert(!opts.ShouldUsePInvokeHelpers() || info.compLvFrameListRoot == BAD_VAR_NUM);
+ if (!opts.ShouldUsePInvokeHelpers())
{
/* Get the TCB local and mark it as used */
@@ -638,11 +635,8 @@ void Compiler::fgPerBlockLocalVarLiveness()
if (block->bbJumpKind == BBJ_RETURN && info.compCallUnmanaged)
{
- if (opts.eeFlags & CORJIT_FLG_PINVOKE_USE_HELPERS)
- {
- noway_assert(info.compLvFrameListRoot == BAD_VAR_NUM);
- }
- else
+ assert(!opts.ShouldUsePInvokeHelpers() || info.compLvFrameListRoot == BAD_VAR_NUM);
+ if (!opts.ShouldUsePInvokeHelpers())
{
noway_assert(info.compLvFrameListRoot < lvaCount);
@@ -1756,11 +1750,8 @@ SKIP_QMARK:
if (tree->gtCall.IsTailCall() && info.compCallUnmanaged)
{
- if (opts.eeFlags & CORJIT_FLG_PINVOKE_USE_HELPERS)
- {
- noway_assert(info.compLvFrameListRoot == BAD_VAR_NUM);
- }
- else
+ assert(!opts.ShouldUsePInvokeHelpers() || info.compLvFrameListRoot == BAD_VAR_NUM);
+ if (!opts.ShouldUsePInvokeHelpers())
{
/* Get the TCB local and make it live */
@@ -1791,11 +1782,8 @@ SKIP_QMARK:
if (tree->gtCall.IsUnmanaged())
{
/* Get the TCB local and make it live */
- if (opts.eeFlags & CORJIT_FLG_PINVOKE_USE_HELPERS)
- {
- noway_assert(info.compLvFrameListRoot == BAD_VAR_NUM);
- }
- else
+ assert(!opts.ShouldUsePInvokeHelpers() || info.compLvFrameListRoot == BAD_VAR_NUM);
+ if (!opts.ShouldUsePInvokeHelpers())
{
noway_assert(info.compLvFrameListRoot < lvaCount);
diff --git a/src/jit/lower.cpp b/src/jit/lower.cpp
index c77c7ee5d0..ae02b1fc5e 100644
--- a/src/jit/lower.cpp
+++ b/src/jit/lower.cpp
@@ -2475,7 +2475,7 @@ void Lowering::InsertPInvokeMethodProlog()
noway_assert(comp->info.compCallUnmanaged);
noway_assert(comp->lvaInlinedPInvokeFrameVar != BAD_VAR_NUM);
- if (comp->opts.eeFlags & CORJIT_FLG_PINVOKE_USE_HELPERS)
+ if (comp->opts.ShouldUsePInvokeHelpers())
{
// Initialize the P/Invoke frame by calling CORINFO_HELP_INIT_PINVOKE_FRAME
@@ -2570,7 +2570,7 @@ void Lowering::InsertPInvokeMethodEpilog(BasicBlock *returnBB
assert(returnBB != nullptr);
assert(comp->info.compCallUnmanaged);
- if (comp->opts.eeFlags & CORJIT_FLG_PINVOKE_USE_HELPERS)
+ if (comp->opts.ShouldUsePInvokeHelpers())
{
return;
}
@@ -2645,7 +2645,7 @@ void Lowering::InsertPInvokeCallProlog(GenTreeCall* call)
noway_assert(comp->lvaInlinedPInvokeFrameVar != BAD_VAR_NUM);
- if (comp->opts.eeFlags & CORJIT_FLG_PINVOKE_USE_HELPERS)
+ if (comp->opts.ShouldUsePInvokeHelpers())
{
// First argument is the address of the frame variable.
GenTree* frameAddr = new(comp, GT_LCL_VAR_ADDR)
@@ -2789,7 +2789,7 @@ void Lowering::InsertPInvokeCallProlog(GenTreeCall* call)
// insert the code that goes after every inlined pinvoke call
void Lowering::InsertPInvokeCallEpilog(GenTreeCall* call)
{
- if (comp->opts.eeFlags & CORJIT_FLG_PINVOKE_USE_HELPERS)
+ if (comp->opts.ShouldUsePInvokeHelpers())
{
noway_assert(comp->lvaInlinedPInvokeFrameVar != BAD_VAR_NUM);
@@ -2860,26 +2860,28 @@ GenTree* Lowering::LowerNonvirtPinvokeCall(GenTreeCall* call)
InsertPInvokeCallProlog(call);
- if ((comp->opts.eeFlags & CORJIT_FLG_PINVOKE_DIRECT_CALLS) == 0 && call->gtCallType != CT_INDIRECT)
+ 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);
+ CORINFO_CONST_LOOKUP lookup;
+ comp->info.compCompHnd->getAddressOfPInvokeFixup(methHnd, &lookup);
- if (addr != nullptr)
- {
- indir = Ind(AddrGen(addr));
- }
- else
+ switch (lookup.accessType)
{
- // double indirection
- indir = Ind(Ind(AddrGen(pAddr)));
+ case IAT_VALUE:
+ // No need for any indirection. The target is already correct.
+ break;
+
+ case IAT_PVALUE:
+ result = Ind(AddrGen(lookup.addr));
+ break;
+
+ case IAT_PPVALUE:
+ result = Ind(Ind(AddrGen(lookup.addr)));
+ break;
}
- result = indir;
}
InsertPInvokeCallEpilog(call);
diff --git a/src/jit/regalloc.cpp b/src/jit/regalloc.cpp
index ff67ac635c..0059362e60 100644
--- a/src/jit/regalloc.cpp
+++ b/src/jit/regalloc.cpp
@@ -6439,11 +6439,8 @@ void Compiler::rpPredictRegUse()
// it must not be in a register trashed by the callee
if (info.compCallUnmanaged != 0)
{
- if (opts.eeFlags & CORJIT_FLG_PINVOKE_USE_HELPERS)
- {
- noway_assert(info.compLvFrameListRoot == BAD_VAR_NUM);
- }
- else
+ assert(!opts.ShouldUsePInvokeHelpers() || info.compLvFrameListRoot == BAD_VAR_NUM);
+ if (!opts.ShouldUsePInvokeHelpers())
{
noway_assert(info.compLvFrameListRoot < lvaCount);
diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp
index 519ccc266c..ab5c59a8f8 100644
--- a/src/vm/jitinterface.cpp
+++ b/src/vm/jitinterface.cpp
@@ -9953,8 +9953,8 @@ void* CEEInfo::getPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method,
/*********************************************************************/
// return address of fixup area for late-bound N/Direct calls.
-void* CEEInfo::getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method,
- void **ppIndirection)
+void CEEInfo::getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method,
+ CORINFO_CONST_LOOKUP *pLookup)
{
CONTRACTL {
SO_TOLERANT;
@@ -9963,22 +9963,16 @@ void* CEEInfo::getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method,
MODE_PREEMPTIVE;
} CONTRACTL_END;
- void * result = NULL;
-
- if (ppIndirection != NULL)
- *ppIndirection = NULL;
-
JIT_TO_EE_TRANSITION_LEAF();
MethodDesc* ftn = GetMethod(method);
_ASSERTE(ftn->IsNDirect());
NDirectMethodDesc *pMD = (NDirectMethodDesc*)ftn;
- result = (LPVOID)&(pMD->GetWriteableData()->m_pNDirectTarget);
+ pLookup->accessType = IAT_PVALUE;
+ pLookup->addr = (LPVOID)&(pMD->GetWriteableData()->m_pNDirectTarget);
EE_TO_JIT_TRANSITION_LEAF();
-
- return result;
}
diff --git a/src/vm/jitinterface.h b/src/vm/jitinterface.h
index 0035715e34..c2fa7a1744 100644
--- a/src/vm/jitinterface.h
+++ b/src/vm/jitinterface.h
@@ -911,7 +911,7 @@ public:
CORINFO_VARARGS_HANDLE getVarArgsHandle(CORINFO_SIG_INFO *sig, void **ppIndirection);
bool canGetVarArgsHandle(CORINFO_SIG_INFO *sig);
void* getPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void **ppIndirection);
- void* getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void **ppIndirection);
+ void getAddressOfPInvokeFixup(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(
diff --git a/src/zap/zapinfo.cpp b/src/zap/zapinfo.cpp
index e3c2759e82..5258dfef24 100644
--- a/src/zap/zapinfo.cpp
+++ b/src/zap/zapinfo.cpp
@@ -2731,9 +2731,9 @@ void * ZapInfo::getPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void **p
return NULL;
}
-void * ZapInfo::getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method,void **ppIndirection)
+void ZapInfo::getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP *pLookup)
{
- _ASSERTE(ppIndirection != NULL);
+ _ASSERTE(pLookup != NULL);
m_pImage->m_pPreloader->AddMethodToTransitiveClosureOfInstantiations(method);
@@ -2741,8 +2741,9 @@ void * ZapInfo::getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method,void **ppI
if (moduleHandle == m_pImage->m_hModule
&& m_pImage->m_pPreloader->CanEmbedMethodHandle(method, m_currentMethodHandle))
{
- *ppIndirection = NULL;
- return PVOID(m_pImage->GetWrappers()->GetAddrOfPInvokeFixup(method));
+ pLookup->accessType = IAT_PVALUE;
+ pLookup->addr = PVOID(m_pImage->GetWrappers()->GetAddrOfPInvokeFixup(method));
+ return;
}
//
@@ -2755,8 +2756,8 @@ void * ZapInfo::getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method,void **ppI
ZapImport * pImport = m_pImage->GetImportTable()->GetIndirectPInvokeTargetImport(method);
AppendConditionalImport(pImport);
- *ppIndirection = pImport;
- return NULL;
+ pLookup->accessType = IAT_PPVALUE;
+ pLookup->addr = pImport;
}
CORINFO_JUST_MY_CODE_HANDLE ZapInfo::getJustMyCodeHandle(
diff --git a/src/zap/zapinfo.h b/src/zap/zapinfo.h
index 1d16c9b760..e32d2068d5 100644
--- a/src/zap/zapinfo.h
+++ b/src/zap/zapinfo.h
@@ -430,8 +430,8 @@ public:
void **ppIndirection);
void * getPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method,
void **ppIndirection);
- void * getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method,
- void **ppIndirection);
+ void getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method,
+ CORINFO_CONST_LOOKUP *pLookup);
CORINFO_JUST_MY_CODE_HANDLE getJustMyCodeHandle(
CORINFO_METHOD_HANDLE method,
CORINFO_JUST_MY_CODE_HANDLE **ppIndirection);