diff options
-rw-r--r-- | openjdk/map.xml | 9 | ||||
-rw-r--r-- | runtime/MemberWrapper.cs | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/openjdk/map.xml b/openjdk/map.xml index f71253b5..3b0c6b8d 100644 --- a/openjdk/map.xml +++ b/openjdk/map.xml @@ -1427,6 +1427,15 @@ </body> </method> </class> + <class name="java.lang.reflect.Field"> + <method name="_slot" sig="()I"> + <body> + <ldarg_0 /> + <ldfld class="java.lang.reflect.Field" name="slot" sig="I" /> + <ret /> + </body> + </method> + </class> <class name="java.lang.reflect.Method"> <method name="_slot" sig="()I"> <body> diff --git a/runtime/MemberWrapper.cs b/runtime/MemberWrapper.cs index d3a35c8a..104d3a6c 100644 --- a/runtime/MemberWrapper.cs +++ b/runtime/MemberWrapper.cs @@ -1171,7 +1171,6 @@ namespace IKVM.Internal abstract class FieldWrapper : MemberWrapper { #if !STATIC_COMPILER && !FIRST_PASS && !STUB_GENERATOR - private static readonly FieldInfo slotField = typeof(java.lang.reflect.Field).GetField("slot", BindingFlags.Instance | BindingFlags.NonPublic); private volatile java.lang.reflect.Field reflectionField; private sun.reflect.FieldAccessor jniAccessor; #endif @@ -1252,7 +1251,7 @@ namespace IKVM.Internal return null; #else java.lang.reflect.Field f = (java.lang.reflect.Field)field; - return TypeWrapper.FromClass(f.getDeclaringClass()).GetFields()[(int)slotField.GetValue(f)]; + return TypeWrapper.FromClass(f.getDeclaringClass()).GetFields()[f._slot()]; #endif } |