summaryrefslogtreecommitdiff
path: root/src/vm/jitinterface.cpp
diff options
context:
space:
mode:
authorFadi Hanna <fadim@microsoft.com>2019-04-01 12:07:47 -0700
committerGitHub <noreply@github.com>2019-04-01 12:07:47 -0700
commitbc9248cad132fa01dd2b641b6b22849bc7a05457 (patch)
tree5d1ee71059353a66004fc7a4d2501a7452db849f /src/vm/jitinterface.cpp
parentff43a803a814eaaa5eba02cafa4a91def3e4c7be (diff)
downloadcoreclr-bc9248cad132fa01dd2b641b6b22849bc7a05457.tar.gz
coreclr-bc9248cad132fa01dd2b641b6b22849bc7a05457.tar.bz2
coreclr-bc9248cad132fa01dd2b641b6b22849bc7a05457.zip
Enable R2R compilation/inlining of PInvoke stubs where no marshalling is required (#22560)
* These changes enable the inlining of some PInvokes that do not require any marshalling. With inlined pinvokes, R2R performance should become slightly better, since we'll avoid jitting some of the pinvoke IL stubs that we jit today for S.P.CoreLib. Performance gains not yet measured. * Added JIT_PInvokeBegin/End helpers for all architectures. Linux stubs not yet implemented * Add INLINE_GETTHREAD for arm/arm64 * Set CORJIT_FLAG_USE_PINVOKE_HELPERS jit flag for ReadyToRun compilations * Updating R2RDump tool to handle pinvokes
Diffstat (limited to 'src/vm/jitinterface.cpp')
-rw-r--r--src/vm/jitinterface.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp
index 7c5a557e40..3a90262f5e 100644
--- a/src/vm/jitinterface.cpp
+++ b/src/vm/jitinterface.cpp
@@ -10181,11 +10181,27 @@ void CEEInfo::getEEInfo(CORINFO_EE_INFO *pEEInfoOut)
}
else
{
- // inlinedCallFrameInfo is not used for R2R compilation
+ // We'll declare a fixed size to use for the inlined call frame for R2R here. The size we declare
+ // is currently slightly larger that the actual size of the struct, just in case we decide to add
+ // more fields to the struct in the future, in an effort to not completely invalidate existing R2R images.
+ // The assert below ensures that this fixed size is at least large enough to hold the data structures
+ // used at runtime.
+ // ** IMPORTANT ** If you ever need to change the value of this fixed size, make sure to change the R2R
+ // version number, otherwise older R2R images will probably crash when used.
+
+ const int r2rInlinedCallFrameSize = TARGET_POINTER_SIZE * 11;
+
+#if defined(_DEBUG) && !defined(CROSSBITNESS_COMPILE)
+ InlinedCallFrame::GetEEInfo(&pEEInfoOut->inlinedCallFrameInfo);
+ _ASSERTE(pEEInfoOut->inlinedCallFrameInfo.size <= r2rInlinedCallFrameSize);
+#endif
+
+ // inlinedCallFrameInfo is mostly not used for R2R compilation (only the size field is used)
ZeroMemory(&pEEInfoOut->inlinedCallFrameInfo, sizeof(pEEInfoOut->inlinedCallFrameInfo));
- pEEInfoOut->offsetOfThreadFrame = (DWORD)-1;
- pEEInfoOut->offsetOfGCState = (DWORD)-1;
+ pEEInfoOut->offsetOfThreadFrame = (DWORD)-1;
+ pEEInfoOut->offsetOfGCState = (DWORD)-1;
+ pEEInfoOut->inlinedCallFrameInfo.size = r2rInlinedCallFrameSize;
}
#ifndef CROSSBITNESS_COMPILE