Mercurial > hg > truffle
changeset 157:a3e5744fafda
Merge
author | dcubed |
---|---|
date | Tue, 20 May 2008 09:47:05 -0700 |
parents | 5bba3366a9a2 (diff) 7a0a921a1a8c (current diff) |
children | a49545cab84a |
files | |
diffstat | 25 files changed, 329 insertions(+), 37 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Wed May 14 15:01:08 2008 -0700 +++ b/.hgtags Tue May 20 09:47:05 2008 -0700 @@ -1,2 +1,3 @@ a61af66fc99eb5ec9d50c05b0c599757b1289ceb jdk7-b24 7836be3e92d0a4f9ee7566f602c91f5609534e66 jdk7-b25 +ad0b851458ff9d1d490ed2d79bb84f75a9fdb753 jdk7-b26
--- a/agent/make/Makefile Wed May 14 15:01:08 2008 -0700 +++ b/agent/make/Makefile Tue May 20 09:47:05 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
--- a/agent/src/share/classes/sun/jvm/hotspot/HSDB.java Wed May 14 15:01:08 2008 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/HSDB.java Tue May 20 09:47:05 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() {
--- a/agent/src/share/classes/sun/jvm/hotspot/SALauncherLoader.java Wed May 14 15:01:08 2008 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/SALauncherLoader.java Tue May 20 09:47:05 2008 -0700 @@ -148,7 +148,7 @@ } try { - return file.toURL(); + return file.toURI().toURL(); } catch (MalformedURLException mue) { throw new InternalError(mue.getMessage()); }
--- a/agent/src/share/classes/sun/jvm/hotspot/bugspot/Main.java Wed May 14 15:01:08 2008 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/bugspot/Main.java Tue May 20 09:47:05 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); } }
--- a/agent/src/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java Wed May 14 15:01:08 2008 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java Tue May 20 09:47:05 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); }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/agent/src/share/classes/sun/jvm/hotspot/memory/BinaryTreeDictionary.java Tue May 20 09:47:05 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); + } +}
--- a/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java Wed May 14 15:01:08 2008 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java Tue May 20 09:47:05 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<IndexSetSize; i += IndexSetStride) { + FreeList freeList = (FreeList) VMObjectFactory.newObject(FreeList.class, cur); + size += i*freeList.count(); + cur= cur.addOffsetTo(IndexSetStride*FreeList.sizeOf()); + } + + // large block + BinaryTreeDictionary bfbd = (BinaryTreeDictionary) VMObjectFactory.newObject(BinaryTreeDictionary.class, + dictionaryField.getValue(addr)); + size += bfbd.size(); + + + // linear block in TLAB + LinearAllocBlock lab = (LinearAllocBlock) VMObjectFactory.newObject(LinearAllocBlock.class, + addr.addOffsetTo(smallLinearAllocBlockFieldOffset)); + size += lab.word_size(); + + return size*heapWordSize; + } public void printOn(PrintStream tty) { tty.print("free-list-space"); + tty.print("[ " + bottom() + " , " + end() + " ) "); + long cap = capacity(); + long used_size = used(); + long free_size = free(); + int used_perc = (int)((double)used_size/cap*100); + tty.print("space capacity = " + cap + " used(" + used_perc + "%)= " + used_size + " "); + tty.print("free= " + free_size ); + tty.print("\n"); + } public Address skipBlockSizeUsingPrintezisBits(Address pos) {
--- a/agent/src/share/classes/sun/jvm/hotspot/memory/DefNewGeneration.java Wed May 14 15:01:08 2008 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/memory/DefNewGeneration.java Tue May 20 09:47:05 2008 -0700 @@ -96,9 +96,9 @@ public void printOn(PrintStream tty) { tty.print(" eden"); eden().printOn(tty); - tty.print(" from"); + tty.print("\n from"); from().printOn(tty); - tty.print(" to "); + tty.print("\n to "); to().printOn(tty); } }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/agent/src/share/classes/sun/jvm/hotspot/memory/FreeList.java Tue May 20 09:47:05 2008 -0700 @@ -0,0 +1,72 @@ +/* + * @(#)FreeList.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 FreeList 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("FreeList"); + sizeField = type.getCIntegerField("_size"); + countField = type.getCIntegerField("_count"); + headerSize = type.getSize(); + } + + // Fields + private static CIntegerField sizeField; + private static CIntegerField countField; + private static long headerSize; + + //Constructor + public FreeList(Address address) { + super(address); + } + + // Accessors + public long size() { + return sizeField.getValue(addr); + } + + public long count() { + return countField.getValue(addr); + } + + public static long sizeOf() { + return headerSize; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/agent/src/share/classes/sun/jvm/hotspot/memory/LinearAllocBlock.java Tue May 20 09:47:05 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 LinearAllocBlock 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("LinearAllocBlock"); + word_sizeField= type.getCIntegerField("_word_size"); + } + + // Fields + private static CIntegerField word_sizeField; + + // Accessors + public long word_size() { + return word_sizeField.getValue(addr); + } + + // Constructor + public LinearAllocBlock(Address addr) { + super(addr); + } +}
--- a/agent/src/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java Wed May 14 15:01:08 2008 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java Tue May 20 09:47:05 2008 -0700 @@ -648,6 +648,6 @@ System.exit(0); } }); - frame.show(); + frame.setVisible(true); } }
--- a/agent/src/share/classes/sun/jvm/hotspot/ui/CommandProcessorPanel.java Wed May 14 15:01:08 2008 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/ui/CommandProcessorPanel.java Tue May 20 09:47:05 2008 -0700 @@ -220,7 +220,7 @@ } }); frame.setSize(500, 500); - frame.show(); + frame.setVisible(true); panel.requestFocus(); } }
--- a/agent/src/share/classes/sun/jvm/hotspot/ui/DebuggerConsolePanel.java Wed May 14 15:01:08 2008 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/ui/DebuggerConsolePanel.java Tue May 20 09:47:05 2008 -0700 @@ -226,7 +226,7 @@ } }); frame.setSize(500, 500); - frame.show(); + frame.setVisible(true); panel.requestFocus(); } }
--- a/agent/src/share/classes/sun/jvm/hotspot/ui/HighPrecisionJScrollBar.java Wed May 14 15:01:08 2008 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/ui/HighPrecisionJScrollBar.java Tue May 20 09:47:05 2008 -0700 @@ -424,7 +424,7 @@ } }); frame.getContentPane().add(hpsb); - frame.show(); + frame.setVisible(true); } }
--- a/agent/src/share/classes/sun/jvm/hotspot/ui/JFrameWrapper.java Wed May 14 15:01:08 2008 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/ui/JFrameWrapper.java Tue May 20 09:47:05 2008 -0700 @@ -43,7 +43,7 @@ public void setVisible(boolean visible) { frame.setVisible(visible); } public void setSize(int x, int y) { frame.setSize(x, y); } public void pack() { frame.pack(); } - public void show() { frame.show(); } + public void show() { frame.setVisible(true); } public void dispose() { frame.dispose(); } public void setBackground(Color color) { frame.setBackground(color); } public void setResizable(boolean resizable) { frame.setResizable(resizable); }
--- a/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/JTreeTable.java Wed May 14 15:01:08 2008 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/JTreeTable.java Tue May 20 09:47:05 2008 -0700 @@ -477,9 +477,9 @@ static class TreeTableTextField extends JTextField { public int offset; - public void reshape(int x, int y, int w, int h) { + public void setBounds(int x, int y, int w, int h) { int newX = Math.max(x, offset); - super.reshape(newX, y, w - (newX - x), h); + super.setBounds(newX, y, w - (newX - x), h); } }
--- a/src/share/vm/ci/bcEscapeAnalyzer.cpp Wed May 14 15:01:08 2008 -0700 +++ b/src/share/vm/ci/bcEscapeAnalyzer.cpp Tue May 20 09:47:05 2008 -0700 @@ -218,6 +218,13 @@ ciInstanceKlass* callee_holder = ciEnv::get_instance_klass_for_declared_method_holder(holder); ciInstanceKlass* actual_recv = callee_holder; + // some methods are obviously bindable without any type checks so + // convert them directly to an invokespecial. + if (target->is_loaded() && !target->is_abstract() && + target->can_be_statically_bound() && code == Bytecodes::_invokevirtual) { + code = Bytecodes::_invokespecial; + } + // compute size of arguments int arg_size = target->arg_size(); if (!target->is_loaded() && code == Bytecodes::_invokestatic) {
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp Wed May 14 15:01:08 2008 -0700 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp Tue May 20 09:47:05 2008 -0700 @@ -130,6 +130,7 @@ const size_t MIN_TREE_CHUNK_SIZE = sizeof(TreeChunk)/HeapWordSize; class BinaryTreeDictionary: public FreeBlockDictionary { + friend class VMStructs; bool _splay; size_t _totalSize; size_t _totalFreeBlocks;
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp Wed May 14 15:01:08 2008 -0700 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp Tue May 20 09:47:05 2008 -0700 @@ -38,6 +38,7 @@ class FreeList VALUE_OBJ_CLASS_SPEC { friend class CompactibleFreeListSpace; + friend class VMStructs; friend class printTreeCensusClosure; FreeChunk* _head; // List of free chunks FreeChunk* _tail; // Tail of list of free chunks
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp Wed May 14 15:01:08 2008 -0700 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp Tue May 20 09:47:05 2008 -0700 @@ -38,7 +38,15 @@ static_field(ConcurrentMarkSweepThread, _collector, CMSCollector*) \ nonstatic_field(FreeChunk, _next, FreeChunk*) \ nonstatic_field(FreeChunk, _prev, FreeChunk*) \ - nonstatic_field(FreeChunk, _size, size_t) + nonstatic_field(FreeChunk, _size, size_t) \ + nonstatic_field(LinearAllocBlock, _word_size, size_t) \ + nonstatic_field(FreeList, _size, size_t) \ + nonstatic_field(FreeList, _count, ssize_t) \ + nonstatic_field(BinaryTreeDictionary, _totalSize, size_t) \ + nonstatic_field(CompactibleFreeListSpace, _dictionary, FreeBlockDictionary*) \ + nonstatic_field(CompactibleFreeListSpace, _indexedFreeList[0], FreeList) \ + nonstatic_field(CompactibleFreeListSpace, _smallLinearAllocBlock, LinearAllocBlock) + #define VM_TYPES_CMS(declare_type, \ declare_toplevel_type) \ @@ -57,7 +65,14 @@ declare_toplevel_type(SurrogateLockerThread*) \ declare_toplevel_type(CompactibleFreeListSpace*) \ declare_toplevel_type(CMSCollector*) \ - declare_toplevel_type(FreeChunk*) + declare_toplevel_type(FreeChunk*) \ + declare_toplevel_type(BinaryTreeDictionary*) \ + declare_toplevel_type(FreeBlockDictionary*) \ + declare_toplevel_type(FreeList*) \ + declare_toplevel_type(FreeList) \ + declare_toplevel_type(LinearAllocBlock) \ + declare_toplevel_type(FreeBlockDictionary) \ + declare_type(BinaryTreeDictionary, FreeBlockDictionary) #define VM_INT_CONSTANTS_CMS(declare_constant) \ declare_constant(Generation::ConcurrentMarkSweep) \
--- a/src/share/vm/opto/c2_globals.hpp Wed May 14 15:01:08 2008 -0700 +++ b/src/share/vm/opto/c2_globals.hpp Tue May 20 09:47:05 2008 -0700 @@ -390,5 +390,8 @@ \ product(intx, MaxLabelRootDepth, 1100, \ "Maximum times call Label_Root to prevent stack overflow") \ + \ + diagnostic(intx, DominatorSearchLimit, 1000, \ + "Iterations limit in Node::dominates") \ C2_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_NOTPRODUCT_FLAG)
--- a/src/share/vm/opto/memnode.cpp Wed May 14 15:01:08 2008 -0700 +++ b/src/share/vm/opto/memnode.cpp Tue May 20 09:47:05 2008 -0700 @@ -256,7 +256,7 @@ if (dom == NULL || dom->is_top()) return false; // Conservative answer for dead code - if (dom->is_Start() || dom->is_Root() || dom == sub) + if (dom->is_Con() || dom->is_Start() || dom->is_Root() || dom == sub) return true; // 'dom' dominates 'sub' if its control edge and control edges @@ -298,7 +298,7 @@ return false; // Conservative answer for dead code assert(n->is_CFG(), "expecting control"); } - if (n->is_Start() || n->is_Root()) { + if (n->is_Con() || n->is_Start() || n->is_Root()) { only_dominating_controls = true; } else if (n->is_CFG()) { if (n->dominates(sub, nlist)) @@ -308,12 +308,11 @@ } else { // First, own control edge. Node* m = n->find_exact_control(n->in(0)); - if (m == NULL) - continue; - if (m->is_top()) - return false; // Conservative answer for dead code - dom_list.push(m); - + if (m != NULL) { + if (m->is_top()) + return false; // Conservative answer for dead code + dom_list.push(m); + } // Now, the rest of edges. uint cnt = n->req(); for (uint i = 1; i < cnt; i++) {
--- a/src/share/vm/opto/node.cpp Wed May 14 15:01:08 2008 -0700 +++ b/src/share/vm/opto/node.cpp Tue May 20 09:47:05 2008 -0700 @@ -1043,6 +1043,9 @@ assert(this->is_CFG(), "expecting control"); assert(sub != NULL && sub->is_CFG(), "expecting control"); + // detect dead cycle without regions + int iterations_without_region_limit = DominatorSearchLimit; + Node* orig_sub = sub; nlist.clear(); bool this_dominates = false; @@ -1057,6 +1060,7 @@ // Region nodes were visited. Continue walk up to Start or Root // to make sure that it did not walk in a cycle. this_dominates = true; // first time meet + iterations_without_region_limit = DominatorSearchLimit; // Reset } else { return false; // already met before: walk in a cycle } @@ -1069,19 +1073,20 @@ return false; // Conservative answer for dead code if (sub == up && sub->is_Loop()) { - up = sub->in(0); // in(LoopNode::EntryControl); - } else if (sub == up && sub->is_Region()) { + up = sub->in(1); // in(LoopNode::EntryControl); + } else if (sub == up && sub->is_Region() && sub->req() == 3) { + iterations_without_region_limit = DominatorSearchLimit; // Reset uint i = 1; - if (nlist.size() == 0) { + uint size = nlist.size(); + if (size == 0) { // No Region nodes (except Loops) were visited before. // Take first valid path on the way up to 'this'. - } else if (nlist.at(nlist.size() - 1) == sub) { + } else if (nlist.at(size - 1) == sub) { // This Region node was just visited. Take other path. i = region_input + 1; nlist.pop(); } else { // Was this Region node visited before? - uint size = nlist.size(); for (uint j = 0; j < size; j++) { if (nlist.at(j) == sub) { return false; // The Region node was visited before. Give up. @@ -1104,8 +1109,9 @@ } if (sub == up) return false; // some kind of tight cycle - if (orig_sub == up) - return false; // walk in a cycle + + if (--iterations_without_region_limit < 0) + return false; // dead cycle sub = up; }
--- a/src/share/vm/runtime/vmStructs.cpp Wed May 14 15:01:08 2008 -0700 +++ b/src/share/vm/runtime/vmStructs.cpp Tue May 20 09:47:05 2008 -0700 @@ -894,6 +894,7 @@ /*******************************************************************/ \ \ declare_unsigned_integer_type(size_t) \ + declare_integer_type(ssize_t) \ declare_unsigned_integer_type(const size_t) \ declare_integer_type(intx) \ declare_integer_type(intptr_t) \