Mercurial > hg > graal-jvmci-8
diff jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java @ 23667:f60746f36f3f
Properly track HotSpotConstantPool as metadata and fix bug that cause metadata to be lost during unloading
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Mon, 06 Jun 2016 12:22:14 -0700 |
parents | 1d4ce2d19e52 |
children | d995c88d9cd9 |
line wrap: on
line diff
--- a/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java Thu Jun 02 15:25:22 2016 +0200 +++ b/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java Mon Jun 06 12:22:14 2016 -0700 @@ -135,6 +135,7 @@ */ metadataRoots = list.getHead(); } + assert isRegistered(metaspaceObject); } protected ResolvedJavaType createClass(Class<?> javaClass) { @@ -208,7 +209,7 @@ ChunkIterator() { currentChunk = head; currentIndex = -1; - findNext(); + next = findNext(); } Object[] currentChunk; @@ -245,4 +246,13 @@ } } + + synchronized boolean isRegistered(MetaspaceWrapperObject wrapper) { + for (WeakReference<MetaspaceWrapperObject> m : list) { + if (m != null && m.get() == wrapper) { + return true; + } + } + return false; + } }