37 static volatile ConditionalWeakTable<object, RuntimeJavaType> dict;
39 internal static void SetTag(
object obj, RuntimeTypeHandle typeHandle)
41#if FIRST_PASS || IMPORTER
42 throw new NotImplementedException();
48 internal static void SetTag(
object obj, RuntimeJavaType wrapper)
53 dict.Add(obj, wrapper);
56 internal static RuntimeJavaType GetTag(
object obj)
60 dict.TryGetValue(obj, out var tw);
68 internal static bool IsGhostArrayInstance(
object obj, RuntimeTypeHandle typeHandle,
int rank)
70#if FIRST_PASS || IMPORTER
71 throw new NotImplementedException();
76 var tw2 = tw1.Context.ClassLoaderFactory.GetJavaTypeFromType(
Type.GetTypeFromHandle(typeHandle)).MakeArrayType(rank);
77 return tw1.IsAssignableTo(tw2);
86 internal static void ThrowClassCastException(
object obj, RuntimeTypeHandle typeHandle,
int rank)
88#if FIRST_PASS || IMPORTER
89 throw new NotImplementedException();
91 var sb =
new ValueStringBuilder();
92 sb.Append(global::ikvm.runtime.Util.getClassFromObject(obj).getName());
93 sb.Append(
" cannot be cast to ");
96 sb.Append(global::ikvm.runtime.Util.getClassFromTypeHandle(typeHandle).getName());
98 throw new global::java.lang.ClassCastException(sb.ToString());
RuntimeClassLoaderFactory ClassLoaderFactory
Gets the RuntimeClassLoaderFactory associated with this instance of the runtime.