summaryrefslogtreecommitdiff
path: root/src/inc/corjit.h
diff options
context:
space:
mode:
authorPat Gavlin <pagavlin@microsoft.com>2016-01-20 13:44:43 -0800
committerPat Gavlin <pagavlin@microsoft.com>2016-01-22 16:24:23 -0800
commit626e050f03bff854793798d7abc496621c05ce02 (patch)
treed670dbd840822dfc36cf69a3e7f6ec21ad6ebf64 /src/inc/corjit.h
parent0f14640db10489f70f522436a764c4788db904ae (diff)
downloadcoreclr-626e050f03bff854793798d7abc496621c05ce02.tar.gz
coreclr-626e050f03bff854793798d7abc496621c05ce02.tar.bz2
coreclr-626e050f03bff854793798d7abc496621c05ce02.zip
Generate P/Invoke transitions for CoreRT.
This change adds support for CoreRT-style P/Invoke transitions to RyuJIT. Instead of the usual inlined transition code, these transitions are made up of calls to two new JIT helpers: PInvokeTransitionFrame frame; // opaque local CORINFO_HELP_INIT_PINVOKE_FRAME(&frame); ... CORINFO_HELP_JIT_PINVOKE_BEGIN(&frame); target(...); CORINFO_HELP_JIT_PINVOKE_END(&frame); ... The preemptive mode constraints apply between calls to JIT_PINVOKE_BEGIN and JIT_PINVOKE_END: no managed references may be live only in registers and managed references may not be manipulated.
Diffstat (limited to 'src/inc/corjit.h')
-rw-r--r--src/inc/corjit.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/inc/corjit.h b/src/inc/corjit.h
index 8612d954df..7665fdf9f8 100644
--- a/src/inc/corjit.h
+++ b/src/inc/corjit.h
@@ -124,17 +124,18 @@ enum CorJitFlag
#ifdef MDIL
CORJIT_FLG_MDIL = 0x00004000, // Generate MDIL code instead of machine code
-#else // MDIL
- CORJIT_FLG_UNUSED7 = 0x00004000,
-#endif // MDIL
-#ifdef MDIL
// Safe to overlap with CORJIT_FLG_MAKEFINALCODE below. Not used by the JIT, used internally by NGen only.
CORJIT_FLG_MINIMAL_MDIL = 0x00008000, // Generate MDIL code suitable for use to bind other assemblies.
// Safe to overlap with CORJIT_FLG_READYTORUN below. Not used by the JIT, used internally by NGen only.
CORJIT_FLG_NO_MDIL = 0x00010000, // Generate an MDIL section but no code or CTL. Not used by the JIT, used internally by NGen only.
-#endif // MDIL
+#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)
CORJIT_FLG_MAKEFINALCODE = 0x00008000, // Use the final code generator, i.e., not the interpreter.