summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKyungwoo Lee <kyulee@microsoft.com>2016-05-19 09:51:56 -0700
committerKyungwoo Lee <kyulee@microsoft.com>2016-05-19 10:12:05 -0700
commitb71ba43f66481c00a229f81149c6a95f17cb47c0 (patch)
tree671dbeaf8c10d894896e8c35dfffcd50ae767692 /src
parent819eadd96c7cc3f2bbfe4115c056b6cef7f34495 (diff)
downloadcoreclr-b71ba43f66481c00a229f81149c6a95f17cb47c0.tar.gz
coreclr-b71ba43f66481c00a229f81149c6a95f17cb47c0.tar.bz2
coreclr-b71ba43f66481c00a229f81149c6a95f17cb47c0.zip
ARM64: Fix R2R EntryPoint for Intrinsic
This is fix for missing case that we should handle call that needs to pass indirect cell address. The call appears in rationalizer, which is originally an intrinsic when we import it. I also refactor the code so that when we set entryPoint we ensure tagging such information on the tree.
Diffstat (limited to 'src')
-rw-r--r--src/jit/flowgraph.cpp8
-rw-r--r--src/jit/gentree.cpp2
-rw-r--r--src/jit/gentree.h3
-rwxr-xr-xsrc/jit/importer.cpp19
-rw-r--r--src/jit/rationalize.cpp2
5 files changed, 12 insertions, 22 deletions
diff --git a/src/jit/flowgraph.cpp b/src/jit/flowgraph.cpp
index 7ea818ed31..aec04b4ba0 100644
--- a/src/jit/flowgraph.cpp
+++ b/src/jit/flowgraph.cpp
@@ -7036,19 +7036,19 @@ GenTreePtr Compiler::fgOptimizeDelegateConstructor(GenTreePtr call, CORINFO_C
{
// The first argument of the helper is delegate this pointer
GenTreeArgList* helperArgs = gtNewArgList(call->gtCall.gtCallObjp);
+ CORINFO_CONST_LOOKUP entryPoint;
// The second argument of the helper is the target object pointers
helperArgs->gtOp.gtOp2 = gtNewArgList(call->gtCall.gtCallArgs->gtOp.gtOp1);
call = gtNewHelperCallNode(CORINFO_HELP_READYTORUN_DELEGATE_CTOR, TYP_VOID, GTF_EXCEPT, helperArgs);
#if COR_JIT_EE_VERSION > 460
- info.compCompHnd->getReadyToRunDelegateCtorHelper(targetMethod->gtFptrVal.gtLdftnResolvedToken, clsHnd, &call->gtCall.gtEntryPoint);
+ info.compCompHnd->getReadyToRunDelegateCtorHelper(targetMethod->gtFptrVal.gtLdftnResolvedToken, clsHnd, &entryPoint);
#else
info.compCompHnd->getReadyToRunHelper(targetMethod->gtFptrVal.gtLdftnResolvedToken,
- CORINFO_HELP_READYTORUN_DELEGATE_CTOR, &call->gtCall.gtEntryPoint);
+ CORINFO_HELP_READYTORUN_DELEGATE_CTOR, &entryPoint);
#endif
- // This is the case from GetDynamicHelperCell.
- call->gtCall.setR2RRelativeIndir();
+ call->gtCall.setEntryPoint(entryPoint);
}
}
else
diff --git a/src/jit/gentree.cpp b/src/jit/gentree.cpp
index 103760528c..f9328a50fd 100644
--- a/src/jit/gentree.cpp
+++ b/src/jit/gentree.cpp
@@ -6537,7 +6537,7 @@ GenTreePtr Compiler::gtCloneExpr(GenTree * tree,
#endif
#ifdef FEATURE_READYTORUN_COMPILER
- copy->gtCall.gtEntryPoint = tree->gtCall.gtEntryPoint;
+ copy->gtCall.setEntryPoint(tree->gtCall.gtEntryPoint);
#endif
#ifdef DEBUG
diff --git a/src/jit/gentree.h b/src/jit/gentree.h
index d4035b445e..e72d728346 100644
--- a/src/jit/gentree.h
+++ b/src/jit/gentree.h
@@ -2874,7 +2874,8 @@ struct GenTreeCall final : public GenTree
bool IsVirtualStubRelativeIndir() { return (gtCallMoreFlags & GTF_CALL_M_VIRTSTUB_REL_INDIRECT) != 0; }
#ifdef FEATURE_READYTORUN_COMPILER
bool IsR2RRelativeIndir() { return (gtCallMoreFlags & GTF_CALL_M_R2R_REL_INDIRECT) != 0; }
- void setR2RRelativeIndir() {
+ void setEntryPoint(CORINFO_CONST_LOOKUP entryPoint) {
+ gtEntryPoint = entryPoint;
if (gtEntryPoint.accessType == IAT_PVALUE)
{
gtCallMoreFlags |= GTF_CALL_M_R2R_REL_INDIRECT;
diff --git a/src/jit/importer.cpp b/src/jit/importer.cpp
index 703f604a29..effa20db95 100755
--- a/src/jit/importer.cpp
+++ b/src/jit/importer.cpp
@@ -1645,10 +1645,7 @@ GenTreePtr Compiler::impReadyToRunHelperToTree(
GenTreePtr op1 = gtNewHelperCallNode(helper, type, GTF_EXCEPT, args);
- op1->gtCall.gtEntryPoint = lookup;
-
- // This is the case from GetDynamicHelperCell.
- op1->gtCall.setR2RRelativeIndir();
+ op1->gtCall.setEntryPoint(lookup);
return op1;
}
@@ -4520,10 +4517,8 @@ GenTreePtr Compiler::impImportLdvirtftn (GenTreePtr thisPtr,
GenTreeCall* call = gtNewHelperCallNode(CORINFO_HELP_READYTORUN_VIRTUAL_FUNC_PTR,
TYP_I_IMPL, GTF_EXCEPT, gtNewArgList(thisPtr));
- call->gtEntryPoint = pCallInfo->codePointerLookup.constLookup;
+ call->setEntryPoint(pCallInfo->codePointerLookup.constLookup);
- // This is the case from GetDynamicHelperCell.
- call->setR2RRelativeIndir();
return call;
}
#endif
@@ -5196,10 +5191,7 @@ GenTreePtr Compiler::impImportStaticFieldAccess(CORINFO_RESOLVED_TOKEN * pResolv
op1 = gtNewHelperCallNode(CORINFO_HELP_READYTORUN_STATIC_BASE, TYP_BYREF, callFlags);
- op1->gtCall.gtEntryPoint = pFieldInfo->fieldLookup;
-
- // This is the case from GetDynamicHelperCell.
- op1->gtCall.setR2RRelativeIndir();
+ op1->gtCall.setEntryPoint(pFieldInfo->fieldLookup);
}
else
#endif
@@ -6035,10 +6027,7 @@ var_types Compiler::impImportCall (OPCODE opcode,
#ifdef FEATURE_READYTORUN_COMPILER
if (opts.IsReadyToRun())
{
- call->gtCall.gtEntryPoint = callInfo->codePointerLookup.constLookup;
-
- // This is the case from GetExternalMethodCell.
- call->gtCall.setR2RRelativeIndir();
+ call->gtCall.setEntryPoint(callInfo->codePointerLookup.constLookup);
}
#endif
break;
diff --git a/src/jit/rationalize.cpp b/src/jit/rationalize.cpp
index 68c072d653..4a669d4237 100644
--- a/src/jit/rationalize.cpp
+++ b/src/jit/rationalize.cpp
@@ -1643,7 +1643,7 @@ void Rationalizer::RewriteNodeAsCall(GenTreePtr* ppTree, Compiler::fgWalkData* d
call = comp->fgMorphArgs(call);
call->CopyCosts(tree);
#ifdef FEATURE_READYTORUN_COMPILER
- call->gtCall.gtEntryPoint = entryPoint;
+ call->gtCall.setEntryPoint(entryPoint);
#endif
// Replace "tree" with "call"