提交 9eec0389 编写于 作者: K kvn

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
上级 429480d9
/* /*
* 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -1051,6 +1051,7 @@ Node *ConvL2INode::Ideal(PhaseGVN *phase, bool can_reshape) { ...@@ -1051,6 +1051,7 @@ Node *ConvL2INode::Ideal(PhaseGVN *phase, bool can_reshape) {
//------------------------------Value------------------------------------------ //------------------------------Value------------------------------------------
const Type *CastX2PNode::Value( PhaseTransform *phase ) const { const Type *CastX2PNode::Value( PhaseTransform *phase ) const {
const Type* t = phase->type(in(1)); const Type* t = phase->type(in(1));
if (t == Type::TOP) return Type::TOP;
if (t->base() == Type_X && t->singleton()) { if (t->base() == Type_X && t->singleton()) {
uintptr_t bits = (uintptr_t) t->is_intptr_t()->get_con(); uintptr_t bits = (uintptr_t) t->is_intptr_t()->get_con();
if (bits == 0) return TypePtr::NULL_PTR; if (bits == 0) return TypePtr::NULL_PTR;
...@@ -1121,6 +1122,7 @@ Node *CastX2PNode::Identity( PhaseTransform *phase ) { ...@@ -1121,6 +1122,7 @@ Node *CastX2PNode::Identity( PhaseTransform *phase ) {
//------------------------------Value------------------------------------------ //------------------------------Value------------------------------------------
const Type *CastP2XNode::Value( PhaseTransform *phase ) const { const Type *CastP2XNode::Value( PhaseTransform *phase ) const {
const Type* t = phase->type(in(1)); const Type* t = phase->type(in(1));
if (t == Type::TOP) return Type::TOP;
if (t->base() == Type::RawPtr && t->singleton()) { if (t->base() == Type::RawPtr && t->singleton()) {
uintptr_t bits = (uintptr_t) t->is_rawptr()->get_con(); uintptr_t bits = (uintptr_t) t->is_rawptr()->get_con();
return TypeX::make(bits); return TypeX::make(bits);
......
...@@ -2035,40 +2035,14 @@ void ConnectionGraph::find_init_values(Node* alloc, VectorSet* visited, PhaseTra ...@@ -2035,40 +2035,14 @@ void ConnectionGraph::find_init_values(Node* alloc, VectorSet* visited, PhaseTra
Node* store = ini->find_captured_store(offset, type2aelembytes(ft), phase); Node* store = ini->find_captured_store(offset, type2aelembytes(ft), phase);
if (store != NULL && store->is_Store()) { if (store != NULL && store->is_Store()) {
value = store->in(MemNode::ValueIn); value = store->in(MemNode::ValueIn);
} else if (ptn->edge_count() > 0) { // Are there oop stores? } else {
// Check for a store which follows allocation without branches. // There could be initializing stores which follow allocation.
// For example, a volatile field store is not collected // For example, a volatile field store is not collected
// by Initialize node. TODO: it would be nice to use idom() here. // by Initialize node.
//
// 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
// //
for (uint next = ei; (next < ae_cnt) && (value == NULL); next++) { // Need to check for dependent loads to separate such stores from
uint fpi = pta->edge_target(next); // Field (AddP) // stores which follow loads. For now, add initial value NULL so
PointsToNode *ptf = ptnode_adr(fpi); // that compare pointers optimization works correctly.
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;
}
}
}
}
}
} }
} }
if (value == NULL || value != ptnode_adr(value->_idx)->_node) { if (value == NULL || value != ptnode_adr(value->_idx)->_node) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册