src/share/vm/opto/chaitin.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/opto/chaitin.cpp Mon Apr 20 12:36:11 2009
--- new/src/share/vm/opto/chaitin.cpp Mon Apr 20 12:36:11 2009
*** 1421,1441 ****
--- 1421,1454 ----
// See if this happens to be a base.
// NOTE: we use TypePtr instead of TypeOopPtr because we can have
// pointers derived from NULL! These are always along paths that
// can't happen at run-time but the optimizer cannot deduce it so
// we have to handle it gracefully.
+ assert(!derived->bottom_type()->isa_narrowoop() ||
+ derived->bottom_type()->make_ptr()->is_ptr()->_offset == 0, "sanity");
const TypePtr *tj = derived->bottom_type()->isa_ptr();
// If its an OOP with a non-zero offset, then it is derived.
! if( tj == NULL || tj->_offset == 0 ) {
derived_base_map[derived->_idx] = derived;
return derived;
}
+ Block *b = _cfg._bbs[derived->_idx];
// Derived is NULL+offset? Base is NULL!
if( derived->is_Con() ) {
- Node *base = new (C, 1) ConPNode( TypePtr::NULL_PTR );
uint no_lidx = 0; // an unmatched constant in debug info has no LRG
! _names.extend(base->_idx, no_lidx);
+ base = _matcher.machConP0();
! assert(base != NULL, "sanity");
+ if (base->in(0) == NULL) {
+ // Initialize it once and make it shared:
+ // set control to _root and place it into Start block
+ // (where top() node is placed).
+ base->init_req(0, _cfg._root);
+ Block *startb = _cfg._bbs[C->top()->_idx];
+ startb->_nodes.insert(startb->find_node(C->top()), base );
+ _cfg._bbs.map( base->_idx, startb );
+ }
+ new_lrg(base, maxlrg++);
derived_base_map[derived->_idx] = base;
return base;
}
// Check for AddP-related opcodes
*** 1458,1473 ****
--- 1471,1489 ----
derived_base_map[derived->_idx] = base;
return base;
}
// Now we see we need a base-Phi here to merge the bases
! base = new (C, derived->req()) PhiNode( derived->in(0), base->bottom_type() );
for( i = 1; i < derived->req(); i++ )
! const Type *t = base->bottom_type();
+ base = new (C, derived->req()) PhiNode( derived->in(0), t );
+ for( i = 1; i < derived->req(); i++ ) {
base->init_req(i, find_base_for_derived(derived_base_map, derived->in(i), maxlrg));
+ t = t->meet(base->in(i)->bottom_type());
+ }
+ base->as_Phi()->set_type(t);
// Search the current block for an existing base-Phi
Block *b = _cfg._bbs[derived->_idx];
for( i = 1; i <= b->end_idx(); i++ ) {// Search for matching Phi
Node *phi = b->_nodes[i];
if( !phi->is_Phi() ) { // Found end of Phis with no match?
b->_nodes.insert( i, base ); // Must insert created Phi here as base
_cfg._bbs.map( base->_idx, b );
*** 1558,1567 ****
--- 1574,1585 ----
while ((neighbor = elements.next()) != 0) {
// Find reaching DEF for base and derived values
// This works because we are still in SSA during this call.
Node *derived = lrgs(neighbor)._def;
const TypePtr *tj = derived->bottom_type()->isa_ptr();
+ assert(!derived->bottom_type()->isa_narrowoop() ||
+ derived->bottom_type()->make_ptr()->is_ptr()->_offset == 0, "sanity");
// If its an OOP with a non-zero offset, then it is derived.
if( tj && tj->_offset != 0 && tj->isa_oop_ptr() ) {
Node *base = find_base_for_derived( derived_base_map, derived, maxlrg );
assert( base->_idx < _names.Size(), "" );
// Add reaching DEFs of derived pointer and base pointer as a
src/share/vm/opto/chaitin.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File