# HG changeset patch # User Christian Wimmer # Date 1428555526 25200 # Node ID 1bfa14fd1275d37c0eec56e9873752bdf11b4716 # Parent ca57c045b1e873393f754805eee5173408a96143 Cache the reflection Field in HotSpotResolvedFieldImpl, since it is accessed repeatedly when accessing the annotations of the field diff -r ca57c045b1e8 -r 1bfa14fd1275 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaFieldImpl.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaFieldImpl.java Thu Apr 09 02:15:16 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaFieldImpl.java Wed Apr 08 21:58:46 2015 -0700 @@ -198,12 +198,18 @@ return null; } + private Field toJavaCache; + private Field toJava() { + if (toJavaCache != null) { + return toJavaCache; + } + if (isInternal()) { return null; } try { - return holder.mirror().getDeclaredField(name); + return toJavaCache = holder.mirror().getDeclaredField(name); } catch (NoSuchFieldException | NoClassDefFoundError e) { return null; }