Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2015-11-20 06:44:41 +0300
committerJan Kotas <jkotas@microsoft.com>2015-11-20 06:44:41 +0300
commit468af59d2b0a2fa9db3299751afd77faa5eb6588 (patch)
treec54a31fa548a78e83df77a14f6e78ea58494f9d6 /src/JitInterface
parent8623f3f9216d4da6c4f599dfafd8f15bf6f1bef3 (diff)
parente5b1669cb50d34f681cc927a7549e87b2548b155 (diff)
Merge pull request #346 from MichalStrehovsky/jitInterface
Implement getBuiltinClass
Diffstat (limited to 'src/JitInterface')
-rw-r--r--src/JitInterface/src/CorInfoImpl.cs36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/JitInterface/src/CorInfoImpl.cs b/src/JitInterface/src/CorInfoImpl.cs
index 1de051b66..fd1152694 100644
--- a/src/JitInterface/src/CorInfoImpl.cs
+++ b/src/JitInterface/src/CorInfoImpl.cs
@@ -1018,7 +1018,40 @@ namespace Internal.JitInterface
}
private CORINFO_CLASS_STRUCT_* getBuiltinClass(IntPtr _this, CorInfoClassId classId)
- { throw new NotImplementedException("getBuiltinClass"); }
+ {
+ switch (classId)
+ {
+ case CorInfoClassId.CLASSID_SYSTEM_OBJECT:
+ return ObjectToHandle(_compilation.TypeSystemContext.GetWellKnownType(WellKnownType.Object));
+
+ case CorInfoClassId.CLASSID_TYPED_BYREF:
+ // TODO: better exception type: invalid input IL
+ throw new NotSupportedException("TypedReference not supported in .NET Core");
+
+ case CorInfoClassId.CLASSID_TYPE_HANDLE:
+ return ObjectToHandle(_compilation.TypeSystemContext.GetWellKnownType(WellKnownType.RuntimeTypeHandle));
+
+ case CorInfoClassId.CLASSID_FIELD_HANDLE:
+ return ObjectToHandle(_compilation.TypeSystemContext.GetWellKnownType(WellKnownType.RuntimeFieldHandle));
+
+ case CorInfoClassId.CLASSID_METHOD_HANDLE:
+ return ObjectToHandle(_compilation.TypeSystemContext.GetWellKnownType(WellKnownType.RuntimeMethodHandle));
+
+ case CorInfoClassId.CLASSID_ARGUMENT_HANDLE:
+ // TODO: better exception type: invalid input IL
+ throw new NotSupportedException("Vararg methods not supported in .NET Core");
+
+ case CorInfoClassId.CLASSID_STRING:
+ return ObjectToHandle(_compilation.TypeSystemContext.GetWellKnownType(WellKnownType.String));
+
+ case CorInfoClassId.CLASSID_RUNTIME_TYPE:
+ // This is used in a JIT optimization. It's not applicable due to the structure of CoreRT CoreLib.
+ return null;
+
+ default:
+ throw new NotImplementedException();
+ }
+ }
private CorInfoType getTypeForPrimitiveValueClass(IntPtr _this, CORINFO_CLASS_STRUCT_* cls)
{
@@ -1517,6 +1550,7 @@ namespace Internal.JitInterface
return (void*)ObjectToHandle(_compilation.GetJitHelper(id));
}
+
private void getFunctionEntryPoint(IntPtr _this, CORINFO_METHOD_STRUCT_* ftn, ref CORINFO_CONST_LOOKUP pResult, CORINFO_ACCESS_FLAGS accessFlags)
{ throw new NotImplementedException("getFunctionEntryPoint"); }
private void getFunctionFixedEntryPoint(IntPtr _this, CORINFO_METHOD_STRUCT_* ftn, ref CORINFO_CONST_LOOKUP pResult)