summaryrefslogtreecommitdiff
path: root/src/jit/compiler.h
diff options
context:
space:
mode:
authorAndy Ayers <andya@microsoft.com>2017-03-01 19:47:18 -0800
committerAndy Ayers <andya@microsoft.com>2017-03-02 07:49:33 -0800
commite0637eaa3eecb62e8df2a1fbb50b0130d2ad40a5 (patch)
treef721e91fcf550aa4623cd673e51a30a7b81af3b7 /src/jit/compiler.h
parent35c23eccfdeaddbd07cd39473fe7544603e67857 (diff)
downloadcoreclr-e0637eaa3eecb62e8df2a1fbb50b0130d2ad40a5.tar.gz
coreclr-e0637eaa3eecb62e8df2a1fbb50b0130d2ad40a5.tar.bz2
coreclr-e0637eaa3eecb62e8df2a1fbb50b0130d2ad40a5.zip
Devirtualize calls in some simple cases
Devirtualize calls where the this object type at a call site is a subtype of the type described at the call site. Currently learns types from local and arg references and a subset of other operators. Will devirtualize if either the class or method is final (sealed in C#), or if the type is known exactly (eg from a newobj). Devirtualization is run twice, once during importation, and again in a limited way after inlinining. Calls devirtualized during importation are are subsequently eligible for inlining. Calls devirtualized during inlining currently cannot be inlined.
Diffstat (limited to 'src/jit/compiler.h')
-rw-r--r--src/jit/compiler.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/jit/compiler.h b/src/jit/compiler.h
index cc1caecf33..651aac3a25 100644
--- a/src/jit/compiler.h
+++ b/src/jit/compiler.h
@@ -322,6 +322,8 @@ public:
#endif // FEATURE_SIMD
unsigned char lvRegStruct : 1; // This is a reg-sized non-field-addressed struct.
+ unsigned char lvClassIsExact : 1; // lvClassHandle is the exact type
+
union {
unsigned lvFieldLclStart; // The index of the local var representing the first field in the promoted struct
// local.
@@ -704,6 +706,8 @@ public:
typeInfo lvVerTypeInfo; // type info needed for verification
+ CORINFO_CLASS_HANDLE lvClassHnd; // class handle for the local, or null if not known
+
BYTE* lvGcLayout; // GC layout info for structs
#if ASSERTION_PROP
@@ -2875,6 +2879,11 @@ protected:
CORINFO_CALL_INFO* callInfo,
IL_OFFSET rawILOffset);
+ void impDevirtualizeCall(GenTreeCall* call,
+ GenTreePtr obj,
+ CORINFO_CALL_INFO* callInfo,
+ CORINFO_CONTEXT_HANDLE* exactContextHnd);
+
bool impMethodInfo_hasRetBuffArg(CORINFO_METHOD_INFO* methInfo);
GenTreePtr impFixupCallStructReturn(GenTreePtr call, CORINFO_CLASS_HANDLE retClsHnd);