comparison agent/src/share/classes/sun/jvm/hotspot/utilities/ReversePtrsAnalysis.java @ 6725:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents 63997f575155
children
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
110 doJNIHandleBlock(handles.globalHandles(), 110 doJNIHandleBlock(handles.globalHandles(),
111 new RootVisitor("Global JNI handle root")); 111 new RootVisitor("Global JNI handle root"));
112 doJNIHandleBlock(handles.weakGlobalHandles(), 112 doJNIHandleBlock(handles.weakGlobalHandles(),
113 new RootVisitor("Weak global JNI handle root")); 113 new RootVisitor("Weak global JNI handle root"));
114 114
115 // Do Java-level static fields in perm gen 115 // Do Java-level static fields
116 heap.iteratePerm(new DefaultHeapVisitor() { 116 SystemDictionary sysDict = VM.getVM().getSystemDictionary();
117 public boolean doObj(Oop obj) { 117 sysDict.allClassesDo(new SystemDictionary.ClassVisitor() {
118 if (obj instanceof InstanceKlass) { 118
119 final InstanceKlass ik = (InstanceKlass) obj; 119 public void visit(Klass k) {
120 if (k instanceof InstanceKlass) {
121 final InstanceKlass ik = (InstanceKlass)k;
120 ik.iterateStaticFields( 122 ik.iterateStaticFields(
121 new DefaultOopVisitor() { 123 new DefaultOopVisitor() {
122 public void doOop(OopField field, boolean isVMField) { 124 public void doOop(OopField field, boolean isVMField) {
123 Oop next = field.getValue(getObj()); 125 Oop next = field.getValue(getObj());
124 LivenessPathElement lp = new LivenessPathElement(null, 126 NamedFieldIdentifier nfi = new NamedFieldIdentifier("Static field \"" +
125 new NamedFieldIdentifier("Static field \"" +
126 field.getID().getName() + 127 field.getID().getName() +
127 "\" in class \"" + 128 "\" in class \"" +
128 ik.getName().asString() + "\"")); 129 ik.getName().asString() + "\"");
130 LivenessPathElement lp = new LivenessPathElement(null, nfi);
129 rp.put(lp, next); 131 rp.put(lp, next);
130 try { 132 try {
131 markAndTraverse(next); 133 markAndTraverse(next);
132 } catch (AddressException e) { 134 } catch (AddressException e) {
133 System.err.print("RevPtrs analysis: WARNING: AddressException at 0x" + 135 System.err.print("RevPtrs analysis: WARNING: AddressException at 0x" +
142 System.err.println(); 144 System.err.println();
143 } 145 }
144 } 146 }
145 }); 147 });
146 } 148 }
147 return false;
148 } 149 }
149 }); 150 });
150 151
151 if (progressThunk != null) { 152 if (progressThunk != null) {
152 progressThunk.heapIterationComplete(); 153 progressThunk.heapIterationComplete();