diff options
author | jfrijters <jfrijters> | 2010-04-28 18:22:51 +0400 |
---|---|---|
committer | jfrijters <jfrijters> | 2010-04-28 18:22:51 +0400 |
commit | 68a8b9557a738ecb8fda886c83e934037df94ed7 (patch) | |
tree | 15b45aa5b850921e8629f687ee225ba5bed20486 | |
parent | 50b99df3bfc6d337c54ad926ae7cce23ba5803f8 (diff) |
Remove use of reflection for getting the slot of a java.lang.reflect.Field.
-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 } |