Mercurial > hg > graal-jvmci-8
diff jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java @ 23996:11f0412408cd
8173912: [JVMCI] fix memory overhead of JVMCI
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 03 Feb 2017 21:08:05 +0100 |
parents | 1b8892b4ce9c |
children | 9a740aa0d87b |
line wrap: on
line diff
--- a/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java Fri Feb 03 08:17:35 2017 +0100 +++ b/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java Fri Feb 03 21:08:05 2017 +0100 @@ -74,6 +74,11 @@ private HotSpotMethodData methodData; private byte[] code; private Executable toJavaCache; + + /** + * Only 30% of {@link HotSpotResolvedJavaMethodImpl}s have their name accessed so compute it + * lazily and cache it. + */ private String nameCache; /** @@ -144,7 +149,8 @@ public String getName() { if (nameCache == null) { - nameCache = compilerToVM().getMethodName(this); + final int nameIndex = UNSAFE.getChar(getConstMethod() + config().constMethodNameIndexOffset); + nameCache = constantPool.lookupUtf8(nameIndex); } return nameCache; }