Tue, 21 Feb 2012 11:55:05 -0800
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
src/share/vm/opto/connode.cpp | file | annotate | diff | comparison | revisions | |
src/share/vm/opto/escape.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/opto/connode.cpp Mon Feb 20 13:11:08 2012 -0800 1.2 +++ b/src/share/vm/opto/connode.cpp Tue Feb 21 11:55:05 2012 -0800 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -1051,6 +1051,7 @@ 1.11 //------------------------------Value------------------------------------------ 1.12 const Type *CastX2PNode::Value( PhaseTransform *phase ) const { 1.13 const Type* t = phase->type(in(1)); 1.14 + if (t == Type::TOP) return Type::TOP; 1.15 if (t->base() == Type_X && t->singleton()) { 1.16 uintptr_t bits = (uintptr_t) t->is_intptr_t()->get_con(); 1.17 if (bits == 0) return TypePtr::NULL_PTR; 1.18 @@ -1121,6 +1122,7 @@ 1.19 //------------------------------Value------------------------------------------ 1.20 const Type *CastP2XNode::Value( PhaseTransform *phase ) const { 1.21 const Type* t = phase->type(in(1)); 1.22 + if (t == Type::TOP) return Type::TOP; 1.23 if (t->base() == Type::RawPtr && t->singleton()) { 1.24 uintptr_t bits = (uintptr_t) t->is_rawptr()->get_con(); 1.25 return TypeX::make(bits);
2.1 --- a/src/share/vm/opto/escape.cpp Mon Feb 20 13:11:08 2012 -0800 2.2 +++ b/src/share/vm/opto/escape.cpp Tue Feb 21 11:55:05 2012 -0800 2.3 @@ -2035,40 +2035,14 @@ 2.4 Node* store = ini->find_captured_store(offset, type2aelembytes(ft), phase); 2.5 if (store != NULL && store->is_Store()) { 2.6 value = store->in(MemNode::ValueIn); 2.7 - } else if (ptn->edge_count() > 0) { // Are there oop stores? 2.8 - // Check for a store which follows allocation without branches. 2.9 + } else { 2.10 + // There could be initializing stores which follow allocation. 2.11 // For example, a volatile field store is not collected 2.12 - // by Initialize node. TODO: it would be nice to use idom() here. 2.13 + // by Initialize node. 2.14 // 2.15 - // Search all references to the same field which use different 2.16 - // AddP nodes, for example, in the next case: 2.17 - // 2.18 - // Point p[] = new Point[1]; 2.19 - // if ( x ) { p[0] = new Point(); p[0].x = x; } 2.20 - // if ( p[0] != null ) { y = p[0].x; } // has CastPP 2.21 - // 2.22 - for (uint next = ei; (next < ae_cnt) && (value == NULL); next++) { 2.23 - uint fpi = pta->edge_target(next); // Field (AddP) 2.24 - PointsToNode *ptf = ptnode_adr(fpi); 2.25 - if (ptf->offset() == offset) { 2.26 - Node* nf = ptf->_node; 2.27 - for (DUIterator_Fast imax, i = nf->fast_outs(imax); i < imax; i++) { 2.28 - store = nf->fast_out(i); 2.29 - if (store->is_Store() && store->in(0) != NULL) { 2.30 - Node* ctrl = store->in(0); 2.31 - while(!(ctrl == ini || ctrl == alloc || ctrl == NULL || 2.32 - ctrl == C->root() || ctrl == C->top() || ctrl->is_Region() || 2.33 - ctrl->is_IfTrue() || ctrl->is_IfFalse())) { 2.34 - ctrl = ctrl->in(0); 2.35 - } 2.36 - if (ctrl == ini || ctrl == alloc) { 2.37 - value = store->in(MemNode::ValueIn); 2.38 - break; 2.39 - } 2.40 - } 2.41 - } 2.42 - } 2.43 - } 2.44 + // Need to check for dependent loads to separate such stores from 2.45 + // stores which follow loads. For now, add initial value NULL so 2.46 + // that compare pointers optimization works correctly. 2.47 } 2.48 } 2.49 if (value == NULL || value != ptnode_adr(value->_idx)->_node) {