summaryrefslogtreecommitdiff
path: root/src/tools
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/tools
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/tools')
-rw-r--r--src/tools/r2rdump/R2RConstants.cs6
-rw-r--r--src/tools/r2rdump/R2RSignature.cs13
2 files changed, 19 insertions, 0 deletions
diff --git a/src/tools/r2rdump/R2RConstants.cs b/src/tools/r2rdump/R2RConstants.cs
index 7e1c5e388f..7f2b2e3035 100644
--- a/src/tools/r2rdump/R2RConstants.cs
+++ b/src/tools/r2rdump/R2RConstants.cs
@@ -120,6 +120,8 @@ namespace R2RDump
READYTORUN_FIXUP_DelegateCtor = 0x2C, /* optimized delegate ctor */
READYTORUN_FIXUP_DeclaringTypeHandle = 0x2D,
+
+ READYTORUN_FIXUP_IndirectPInvokeTarget = 0x2E, /* Target of an inlined pinvoke */
}
//
@@ -171,6 +173,10 @@ namespace R2RDump
READYTORUN_HELPER_MemSet = 0x40,
READYTORUN_HELPER_MemCpy = 0x41,
+ // PInvoke helpers
+ READYTORUN_HELPER_PInvokeBegin = 0x42,
+ READYTORUN_HELPER_PInvokeEnd = 0x43,
+
// Get string handle lazily
READYTORUN_HELPER_GetString = 0x50,
diff --git a/src/tools/r2rdump/R2RSignature.cs b/src/tools/r2rdump/R2RSignature.cs
index 60e4c0fd0a..9bf44122b0 100644
--- a/src/tools/r2rdump/R2RSignature.cs
+++ b/src/tools/r2rdump/R2RSignature.cs
@@ -679,6 +679,10 @@ namespace R2RDump
builder.Append(" (DECLARING_TYPE_HANDLE)");
break;
+ case ReadyToRunFixupKind.READYTORUN_FIXUP_IndirectPInvokeTarget:
+ ParseMethod(builder);
+ builder.Append(" (INDIRECT_PINVOKE_TARGET)");
+ break;
default:
builder.Append(string.Format("Unknown fixup type: {0:X2}", fixupType));
@@ -1126,6 +1130,15 @@ namespace R2RDump
builder.Append("MEM_CPY");
break;
+ // PInvoke helpers
+ case ReadyToRunHelper.READYTORUN_HELPER_PInvokeBegin:
+ builder.Append("PINVOKE_BEGIN");
+ break;
+
+ case ReadyToRunHelper.READYTORUN_HELPER_PInvokeEnd:
+ builder.Append("PINVOKE_END");
+ break;
+
// Get string handle lazily
case ReadyToRunHelper.READYTORUN_HELPER_GetString:
builder.Append("GET_STRING");