# HG changeset patch # User dcubed # Date 1210970527 25200 # Node ID 5bba3366a9a24eb952544a3d79f4f8bda331c1f7 # Parent 723be81c1212c17f516e06f2db0b04e3cc527db1# Parent 6ab92ec09f70364e47e8611a20cdb5bf0b9d4197 Merge diff -r 723be81c1212 -r 5bba3366a9a2 .hgtags --- a/.hgtags Thu May 15 22:43:11 2008 -0700 +++ b/.hgtags Fri May 16 13:42:07 2008 -0700 @@ -1,2 +1,3 @@ a61af66fc99eb5ec9d50c05b0c599757b1289ceb jdk7-b24 7836be3e92d0a4f9ee7566f602c91f5609534e66 jdk7-b25 +ad0b851458ff9d1d490ed2d79bb84f75a9fdb753 jdk7-b26 diff -r 723be81c1212 -r 5bba3366a9a2 agent/make/Makefile --- a/agent/make/Makefile Thu May 15 22:43:11 2008 -0700 +++ b/agent/make/Makefile Fri May 16 13:42:07 2008 -0700 @@ -246,16 +246,16 @@ all: filelist @mkdir -p $(OUTPUT_DIR) @echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES) - @javac -source 1.4 -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist - @rmic -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer + @${JDK_HOME}/bin/javac -source 1.4 -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist + @${JDK_HOME}/bin/rmic -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql allprof: filelist @mkdir -p $(OUTPUT_DIR) @echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES) - @javac -source 1.4 -J-Xprof -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist - @rmic -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer + @${JDK_HOME}/bin/javac -source 1.4 -J-Xprof -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist + @${JDK_HOME}/bin/rmic -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql diff -r 723be81c1212 -r 5bba3366a9a2 agent/src/share/classes/sun/jvm/hotspot/HSDB.java --- a/agent/src/share/classes/sun/jvm/hotspot/HSDB.java Thu May 15 22:43:11 2008 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/HSDB.java Fri May 16 13:42:07 2008 -0700 @@ -398,7 +398,7 @@ frame.getContentPane().add(desktop); GraphicsUtilities.reshapeToAspectRatio(frame, 4.0f/3.0f, 0.75f, Toolkit.getDefaultToolkit().getScreenSize()); GraphicsUtilities.centerInContainer(frame, Toolkit.getDefaultToolkit().getScreenSize()); - frame.show(); + frame.setVisible(true); Runtime.getRuntime().addShutdownHook(new java.lang.Thread() { public void run() { diff -r 723be81c1212 -r 5bba3366a9a2 agent/src/share/classes/sun/jvm/hotspot/SALauncherLoader.java --- a/agent/src/share/classes/sun/jvm/hotspot/SALauncherLoader.java Thu May 15 22:43:11 2008 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/SALauncherLoader.java Fri May 16 13:42:07 2008 -0700 @@ -148,7 +148,7 @@ } try { - return file.toURL(); + return file.toURI().toURL(); } catch (MalformedURLException mue) { throw new InternalError(mue.getMessage()); } diff -r 723be81c1212 -r 5bba3366a9a2 agent/src/share/classes/sun/jvm/hotspot/bugspot/Main.java --- a/agent/src/share/classes/sun/jvm/hotspot/bugspot/Main.java Thu May 15 22:43:11 2008 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/bugspot/Main.java Fri May 16 13:42:07 2008 -0700 @@ -47,6 +47,6 @@ 4.0f/3.0f, 0.85f, Toolkit.getDefaultToolkit().getScreenSize()); GraphicsUtilities.centerInContainer(frame, Toolkit.getDefaultToolkit().getScreenSize()); - frame.show(); + frame.setVisible(true); } } diff -r 723be81c1212 -r 5bba3366a9a2 agent/src/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java --- a/agent/src/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java Thu May 15 22:43:11 2008 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java Fri May 16 13:42:07 2008 -0700 @@ -78,7 +78,7 @@ this(parent); this.classPathSet = true; try { - addURL(new File(classPath).toURL()); + addURL(new File(classPath).toURI().toURL()); } catch(MalformedURLException mue) { throw new RuntimeException(mue); } diff -r 723be81c1212 -r 5bba3366a9a2 agent/src/share/classes/sun/jvm/hotspot/memory/BinaryTreeDictionary.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/agent/src/share/classes/sun/jvm/hotspot/memory/BinaryTreeDictionary.java Fri May 16 13:42:07 2008 -0700 @@ -0,0 +1,59 @@ +/* + * @(#)BinaryTreeDictionary.java + * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +package sun.jvm.hotspot.memory; + +import java.util.*; +import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.types.*; +import sun.jvm.hotspot.runtime.*; + +public class BinaryTreeDictionary extends VMObject { + static { + VM.registerVMInitializedObserver(new Observer() { + public void update(Observable o, Object data) { + initialize(VM.getVM().getTypeDataBase()); + } + }); + } + + private static synchronized void initialize(TypeDataBase db) { + Type type = db.lookupType("BinaryTreeDictionary"); + totalSizeField = type.getCIntegerField("_totalSize"); + } + + // Fields + private static CIntegerField totalSizeField; + + // Accessors + public long size() { + return totalSizeField.getValue(addr); + } + + // Constructor + public BinaryTreeDictionary(Address addr) { + super(addr); + } +} diff -r 723be81c1212 -r 5bba3366a9a2 agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java --- a/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java Thu May 15 22:43:11 2008 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java Fri May 16 13:42:07 2008 -0700 @@ -35,6 +35,20 @@ public class CompactibleFreeListSpace extends CompactibleSpace { private static AddressField collectorField; + // for free size, three fields + // FreeBlockDictionary* _dictionary; // ptr to dictionary for large size blocks + // FreeList _indexedFreeList[IndexSetSize]; // indexed array for small size blocks + // LinearAllocBlock _smallLinearAllocBlock; // small linear alloc in TLAB + private static AddressField indexedFreeListField; + private static AddressField dictionaryField; + private static long smallLinearAllocBlockFieldOffset; + private static long indexedFreeListSizeOf; + + private int heapWordSize; // 4 for 32bit, 8 for 64 bits + private int IndexSetStart; // for small indexed list + private int IndexSetSize; + private int IndexSetStride; + static { VM.registerVMInitializedObserver(new Observer() { public void update(Observable o, Object data) { @@ -51,10 +65,26 @@ Type type = db.lookupType("CompactibleFreeListSpace"); collectorField = type.getAddressField("_collector"); + collectorField = type.getAddressField("_collector"); + dictionaryField = type.getAddressField("_dictionary"); + indexedFreeListField = type.getAddressField("_indexedFreeList[0]"); + smallLinearAllocBlockFieldOffset = type.getField("_smallLinearAllocBlock").getOffset(); } public CompactibleFreeListSpace(Address addr) { super(addr); + if ( VM.getVM().isLP64() ) { + heapWordSize = 8; + IndexSetStart = 1; + IndexSetStride = 1; + } + else { + heapWordSize = 4; + IndexSetStart = 2; + IndexSetStride = 2; + } + + IndexSetSize = 257; } // Accessing block offset table @@ -62,9 +92,17 @@ return (CMSCollector) VMObjectFactory.newObject( CMSCollector.class, collectorField.getValue(addr)); - } + } + + public long free0() { + return capacity() - used0(); + } public long used() { + return capacity() - free(); + } + + public long used0() { List regions = getLiveRegions(); long usedSize = 0L; for (Iterator itr = regions.iterator(); itr.hasNext();) { @@ -75,11 +113,41 @@ } public long free() { - return capacity() - used(); - } + // small chunks + long size = 0; + Address cur = addr.addOffsetTo( indexedFreeListField.getOffset() ); + cur = cur.addOffsetTo(IndexSetStart*FreeList.sizeOf()); + for (int i=IndexSetStart; i