# HG changeset patch # User jmasa # Date 1343371416 25200 # Node ID 3080f4743cf27f382e55829d6a1c5689fd012659 # Parent 113f4c73df616fd1803d1d7f564e5cd71fd234bc# Parent bcd1b9d985586e98d2e1b60168f27520adcca39f Merge diff -r 113f4c73df61 -r 3080f4743cf2 make/solaris/makefiles/fastdebug.make --- a/make/solaris/makefiles/fastdebug.make Tue Jul 24 14:48:58 2012 -0700 +++ b/make/solaris/makefiles/fastdebug.make Thu Jul 26 23:43:36 2012 -0700 @@ -36,6 +36,11 @@ ifeq ("${Platform_compiler}", "sparcWorks") OPT_CFLAGS/SLOWER = -xO2 +ifeq ($(COMPILER_REV_NUMERIC), 510) +# CC 5.10 has bug XXXXX with -xO4 +OPT_CFLAGS/jvmtiClassFileReconstituter.o = $(OPT_CFLAGS/SLOWER) +endif # COMPILER_REV_NUMERIC == 510 + ifeq ($(COMPILER_REV_NUMERIC), 509) # To avoid jvm98 crash OPT_CFLAGS/instanceKlass.o = $(OPT_CFLAGS/SLOWER) diff -r 113f4c73df61 -r 3080f4743cf2 make/solaris/makefiles/optimized.make --- a/make/solaris/makefiles/optimized.make Tue Jul 24 14:48:58 2012 -0700 +++ b/make/solaris/makefiles/optimized.make Thu Jul 26 23:43:36 2012 -0700 @@ -32,6 +32,11 @@ # (OPT_CFLAGS/SLOWER is also available, to alter compilation of buggy files) ifeq ("${Platform_compiler}", "sparcWorks") +ifeq ($(COMPILER_REV_NUMERIC), 510) +# CC 5.10 has bug XXXXX with -xO4 +OPT_CFLAGS/jvmtiClassFileReconstituter.o = $(OPT_CFLAGS/O2) +endif # COMPILER_REV_NUMERIC == 510 + ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1) # dtrace cannot handle tail call optimization (6672627, 6693876) OPT_CFLAGS/jni.o = $(OPT_CFLAGS/DEFAULT) $(OPT_CCFLAGS/NO_TAIL_CALL_OPT) diff -r 113f4c73df61 -r 3080f4743cf2 make/solaris/makefiles/product.make --- a/make/solaris/makefiles/product.make Tue Jul 24 14:48:58 2012 -0700 +++ b/make/solaris/makefiles/product.make Thu Jul 26 23:43:36 2012 -0700 @@ -40,6 +40,11 @@ # (OPT_CFLAGS/SLOWER is also available, to alter compilation of buggy files) ifeq ("${Platform_compiler}", "sparcWorks") +ifeq ($(COMPILER_REV_NUMERIC), 510) +# CC 5.10 has bug XXXXX with -xO4 +OPT_CFLAGS/jvmtiClassFileReconstituter.o = $(OPT_CFLAGS/O2) +endif # COMPILER_REV_NUMERIC == 510 + ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1) # dtrace cannot handle tail call optimization (6672627, 6693876) OPT_CFLAGS/jni.o = $(OPT_CFLAGS/DEFAULT) $(OPT_CCFLAGS/NO_TAIL_CALL_OPT) diff -r 113f4c73df61 -r 3080f4743cf2 src/share/vm/opto/phaseX.cpp --- a/src/share/vm/opto/phaseX.cpp Tue Jul 24 14:48:58 2012 -0700 +++ b/src/share/vm/opto/phaseX.cpp Thu Jul 26 23:43:36 2012 -0700 @@ -757,6 +757,7 @@ //------------------------------PhaseIterGVN----------------------------------- // Initialize hash table to fresh and clean for +VerifyOpto PhaseIterGVN::PhaseIterGVN( PhaseIterGVN *igvn, const char *dummy ) : PhaseGVN(igvn,dummy), _worklist( ), + _stack(C->unique() >> 1), _delay_transform(false) { } @@ -764,6 +765,7 @@ // Initialize with previous PhaseIterGVN info; used by PhaseCCP PhaseIterGVN::PhaseIterGVN( PhaseIterGVN *igvn ) : PhaseGVN(igvn), _worklist( igvn->_worklist ), + _stack( igvn->_stack ), _delay_transform(igvn->_delay_transform) { } @@ -772,6 +774,7 @@ // Initialize with previous PhaseGVN info from Parser PhaseIterGVN::PhaseIterGVN( PhaseGVN *gvn ) : PhaseGVN(gvn), _worklist(*C->for_igvn()), + _stack(C->unique() >> 1), _delay_transform(false) { uint max; @@ -1138,51 +1141,77 @@ // Kill a globally dead Node. All uses are also globally dead and are // aggressively trimmed. void PhaseIterGVN::remove_globally_dead_node( Node *dead ) { - assert(dead != C->root(), "killing root, eh?"); - if (dead->is_top()) return; - NOT_PRODUCT( set_progress(); ) - // Remove from iterative worklist - _worklist.remove(dead); - if (!dead->is_Con()) { // Don't kill cons but uses - // Remove from hash table - _table.hash_delete( dead ); - // Smash all inputs to 'dead', isolating him completely - for( uint i = 0; i < dead->req(); i++ ) { - Node *in = dead->in(i); - if( in ) { // Points to something? - dead->set_req(i,NULL); // Kill the edge - if (in->outcnt() == 0 && in != C->top()) {// Made input go dead? - remove_dead_node(in); // Recursively remove - } else if (in->outcnt() == 1 && - in->has_special_unique_user()) { - _worklist.push(in->unique_out()); - } else if (in->outcnt() <= 2 && dead->is_Phi()) { - if( in->Opcode() == Op_Region ) - _worklist.push(in); - else if( in->is_Store() ) { - DUIterator_Fast imax, i = in->fast_outs(imax); - _worklist.push(in->fast_out(i)); - i++; - if(in->outcnt() == 2) { - _worklist.push(in->fast_out(i)); - i++; + enum DeleteProgress { + PROCESS_INPUTS, + PROCESS_OUTPUTS + }; + assert(_stack.is_empty(), "not empty"); + _stack.push(dead, PROCESS_INPUTS); + + while (_stack.is_nonempty()) { + dead = _stack.node(); + uint progress_state = _stack.index(); + assert(dead != C->root(), "killing root, eh?"); + assert(!dead->is_top(), "add check for top when pushing"); + NOT_PRODUCT( set_progress(); ) + if (progress_state == PROCESS_INPUTS) { + // After following inputs, continue to outputs + _stack.set_index(PROCESS_OUTPUTS); + // Remove from iterative worklist + _worklist.remove(dead); + if (!dead->is_Con()) { // Don't kill cons but uses + bool recurse = false; + // Remove from hash table + _table.hash_delete( dead ); + // Smash all inputs to 'dead', isolating him completely + for( uint i = 0; i < dead->req(); i++ ) { + Node *in = dead->in(i); + if( in ) { // Points to something? + dead->set_req(i,NULL); // Kill the edge + if (in->outcnt() == 0 && in != C->top()) {// Made input go dead? + _stack.push(in, PROCESS_INPUTS); // Recursively remove + recurse = true; + } else if (in->outcnt() == 1 && + in->has_special_unique_user()) { + _worklist.push(in->unique_out()); + } else if (in->outcnt() <= 2 && dead->is_Phi()) { + if( in->Opcode() == Op_Region ) + _worklist.push(in); + else if( in->is_Store() ) { + DUIterator_Fast imax, i = in->fast_outs(imax); + _worklist.push(in->fast_out(i)); + i++; + if(in->outcnt() == 2) { + _worklist.push(in->fast_out(i)); + i++; + } + assert(!(i < imax), "sanity"); + } } - assert(!(i < imax), "sanity"); } } + + if (dead->is_macro()) { + C->remove_macro_node(dead); + } + + if (recurse) { + continue; + } } } - if (dead->is_macro()) { - C->remove_macro_node(dead); + // Aggressively kill globally dead uses + // (Rather than pushing all the outs at once, we push one at a time, + // plus the parent to resume later, because of the indefinite number + // of edge deletions per loop trip.) + if (dead->outcnt() > 0) { + // Recursively remove + _stack.push(dead->raw_out(0), PROCESS_INPUTS); + } else { + _stack.pop(); } } - // Aggressively kill globally dead uses - // (Cannot use DUIterator_Last because of the indefinite number - // of edge deletions per loop trip.) - while (dead->outcnt() > 0) { - remove_globally_dead_node(dead->raw_out(0)); - } } //------------------------------subsume_node----------------------------------- diff -r 113f4c73df61 -r 3080f4743cf2 src/share/vm/opto/phaseX.hpp --- a/src/share/vm/opto/phaseX.hpp Tue Jul 24 14:48:58 2012 -0700 +++ b/src/share/vm/opto/phaseX.hpp Thu Jul 26 23:43:36 2012 -0700 @@ -403,6 +403,8 @@ // Subsume users of node 'old' into node 'nn' void subsume_node( Node *old, Node *nn ); + Node_Stack _stack; // Stack used to avoid recursion + protected: // Idealize new Node 'n' with respect to its inputs and its value @@ -438,8 +440,8 @@ // It is significant only for debugging and profiling. Node* register_new_node_with_optimizer(Node* n, Node* orig = NULL); - // Kill a globally dead Node. It is allowed to have uses which are - // assumed dead and left 'in limbo'. + // Kill a globally dead Node. All uses are also globally dead and are + // aggressively trimmed. void remove_globally_dead_node( Node *dead ); // Kill all inputs to a dead node, recursively making more dead nodes. diff -r 113f4c73df61 -r 3080f4743cf2 test/runtime/7020373/Test7020373.sh --- a/test/runtime/7020373/Test7020373.sh Tue Jul 24 14:48:58 2012 -0700 +++ b/test/runtime/7020373/Test7020373.sh Thu Jul 26 23:43:36 2012 -0700 @@ -2,9 +2,10 @@ ## ## @test -## @bug 7020373 7055247 7053586 +## @bug 7020373 7055247 7053586 7185550 ## @key cte_test ## @summary JSR rewriting can overflow memory address size variables +## @ignore Ignore it as 7053586 test uses lots of memory. See bug report for detail. ## @run shell Test7020373.sh ## diff -r 113f4c73df61 -r 3080f4743cf2 test/runtime/7020373/testcase.jar Binary file test/runtime/7020373/testcase.jar has changed