8067338: compiler/debug/TraceIterativeGVN.java segfaults
authorvlivanov
Fri, 19 Dec 2014 16:42:40 -0800
changeset 28202 3518158ff5d0
parent 28201 c4fe49894a22
child 28203 905c60857879
8067338: compiler/debug/TraceIterativeGVN.java segfaults Reviewed-by: kvn
hotspot/src/share/vm/opto/callnode.cpp
hotspot/src/share/vm/opto/loopnode.cpp
hotspot/src/share/vm/opto/machnode.cpp
hotspot/src/share/vm/opto/memnode.cpp
--- a/hotspot/src/share/vm/opto/callnode.cpp	Tue Dec 16 20:09:29 2014 +0100
+++ b/hotspot/src/share/vm/opto/callnode.cpp	Fri Dec 19 16:42:40 2014 -0800
@@ -658,7 +658,7 @@
 
 void CallNode::dump_spec(outputStream *st) const {
   st->print(" ");
-  tf()->dump_on(st);
+  if (tf() != NULL)  tf()->dump_on(st);
   if (_cnt != COUNT_UNKNOWN)  st->print(" C=%f",_cnt);
   if (jvms() != NULL)  jvms()->dump_spec(st);
 }
--- a/hotspot/src/share/vm/opto/loopnode.cpp	Tue Dec 16 20:09:29 2014 +0100
+++ b/hotspot/src/share/vm/opto/loopnode.cpp	Fri Dec 19 16:42:40 2014 -0800
@@ -1147,7 +1147,7 @@
 // Dump special per-node info
 #ifndef PRODUCT
 void CountedLoopEndNode::dump_spec(outputStream *st) const {
-  if( in(TestValue)->is_Bool() ) {
+  if( in(TestValue) != NULL && in(TestValue)->is_Bool() ) {
     BoolTest bt( test_trip()); // Added this for g++.
 
     st->print("[");
--- a/hotspot/src/share/vm/opto/machnode.cpp	Tue Dec 16 20:09:29 2014 +0100
+++ b/hotspot/src/share/vm/opto/machnode.cpp	Fri Dec 19 16:42:40 2014 -0800
@@ -473,8 +473,13 @@
 // Print any per-operand special info
 void MachNode::dump_spec(outputStream *st) const {
   uint cnt = num_opnds();
-  for( uint i=0; i<cnt; i++ )
-    _opnds[i]->dump_spec(st);
+  for( uint i=0; i<cnt; i++ ) {
+    if (_opnds[i] != NULL) {
+      _opnds[i]->dump_spec(st);
+    } else {
+      st->print(" _");
+    }
+  }
   const TypePtr *t = adr_type();
   if( t ) {
     Compile* C = Compile::current();
@@ -493,7 +498,11 @@
 //=============================================================================
 #ifndef PRODUCT
 void MachTypeNode::dump_spec(outputStream *st) const {
-  _bottom_type->dump_on(st);
+  if (_bottom_type != NULL) {
+    _bottom_type->dump_on(st);
+  } else {
+    st->print(" NULL");
+  }
 }
 #endif
 
@@ -635,7 +644,7 @@
 #ifndef PRODUCT
 void MachCallNode::dump_spec(outputStream *st) const {
   st->print("# ");
-  tf()->dump_on(st);
+  if (tf() != NULL)  tf()->dump_on(st);
   if (_cnt != COUNT_UNKNOWN)  st->print(" C=%f",_cnt);
   if (jvms() != NULL)  jvms()->dump_spec(st);
 }
--- a/hotspot/src/share/vm/opto/memnode.cpp	Tue Dec 16 20:09:29 2014 +0100
+++ b/hotspot/src/share/vm/opto/memnode.cpp	Fri Dec 19 16:42:40 2014 -0800
@@ -4370,7 +4370,7 @@
   st->print(" {");
   Node* base_mem = base_memory();
   for( uint i = Compile::AliasIdxRaw; i < req(); i++ ) {
-    Node* mem = memory_at(i);
+    Node* mem = (in(i) != NULL) ? memory_at(i) : base_mem;
     if (mem == base_mem) { st->print(" -"); continue; }
     st->print( " N%d:", mem->_idx );
     Compile::current()->get_adr_type(i)->dump_on(st);