changeset 3401:eac434b01c4c

7146442: assert(false) failed: bad AD file Summary: Take into account only stores captured by Initialize node. Added missing check for Top input in value() methods. Reviewed-by: never
author kvn
date Tue, 21 Feb 2012 11:55:05 -0800
parents 3322dd7f0a4d
children ad0b499ddb18
files src/share/vm/opto/connode.cpp src/share/vm/opto/escape.cpp
diffstat 2 files changed, 9 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/opto/connode.cpp	Wed Feb 29 15:59:05 2012 +0400
+++ b/src/share/vm/opto/connode.cpp	Tue Feb 21 11:55:05 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. 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
@@ -1051,6 +1051,7 @@
 //------------------------------Value------------------------------------------
 const Type *CastX2PNode::Value( PhaseTransform *phase ) const {
   const Type* t = phase->type(in(1));
+  if (t == Type::TOP) return Type::TOP;
   if (t->base() == Type_X && t->singleton()) {
     uintptr_t bits = (uintptr_t) t->is_intptr_t()->get_con();
     if (bits == 0)   return TypePtr::NULL_PTR;
@@ -1121,6 +1122,7 @@
 //------------------------------Value------------------------------------------
 const Type *CastP2XNode::Value( PhaseTransform *phase ) const {
   const Type* t = phase->type(in(1));
+  if (t == Type::TOP) return Type::TOP;
   if (t->base() == Type::RawPtr && t->singleton()) {
     uintptr_t bits = (uintptr_t) t->is_rawptr()->get_con();
     return TypeX::make(bits);
--- a/src/share/vm/opto/escape.cpp	Wed Feb 29 15:59:05 2012 +0400
+++ b/src/share/vm/opto/escape.cpp	Tue Feb 21 11:55:05 2012 -0800
@@ -2035,40 +2035,14 @@
           Node* store = ini->find_captured_store(offset, type2aelembytes(ft), phase);
           if (store != NULL && store->is_Store()) {
             value = store->in(MemNode::ValueIn);
-          } else if (ptn->edge_count() > 0) { // Are there oop stores?
-            // Check for a store which follows allocation without branches.
+          } else {
+            // There could be initializing stores which follow allocation.
             // For example, a volatile field store is not collected
-            // by Initialize node. TODO: it would be nice to use idom() here.
-            //
-            // Search all references to the same field which use different
-            // AddP nodes, for example, in the next case:
-            //
-            //    Point p[] = new Point[1];
-            //    if ( x ) { p[0] = new Point(); p[0].x = x; }
-            //    if ( p[0] != null ) { y = p[0].x; } // has CastPP
+            // by Initialize node.
             //
-            for (uint next = ei; (next < ae_cnt) && (value == NULL); next++) {
-              uint fpi = pta->edge_target(next); // Field (AddP)
-              PointsToNode *ptf = ptnode_adr(fpi);
-              if (ptf->offset() == offset) {
-                Node* nf = ptf->_node;
-                for (DUIterator_Fast imax, i = nf->fast_outs(imax); i < imax; i++) {
-                  store = nf->fast_out(i);
-                  if (store->is_Store() && store->in(0) != NULL) {
-                    Node* ctrl = store->in(0);
-                    while(!(ctrl == ini || ctrl == alloc || ctrl == NULL ||
-                            ctrl == C->root() || ctrl == C->top() || ctrl->is_Region() ||
-                            ctrl->is_IfTrue() || ctrl->is_IfFalse())) {
-                       ctrl = ctrl->in(0);
-                    }
-                    if (ctrl == ini || ctrl == alloc) {
-                      value = store->in(MemNode::ValueIn);
-                      break;
-                    }
-                  }
-                }
-              }
-            }
+            // Need to check for dependent loads to separate such stores from
+            // stores which follow loads. For now, add initial value NULL so
+            // that compare pointers optimization works correctly.
           }
         }
         if (value == NULL || value != ptnode_adr(value->_idx)->_node) {