diff src/share/vm/opto/addnode.cpp @ 1541:b5fdf39b9749

6953576: bottom_type for matched AddPNodes doesn't always agree with ideal Reviewed-by: kvn
author never
date Tue, 18 May 2010 23:58:32 -0700
parents bd02caa94611
children c18cbe5936b8
line wrap: on
line diff
--- a/src/share/vm/opto/addnode.cpp	Tue May 18 13:45:03 2010 -0700
+++ b/src/share/vm/opto/addnode.cpp	Tue May 18 23:58:32 2010 -0700
@@ -714,71 +714,6 @@
   return idx > Base;
 }
 
-//---------------------------mach_bottom_type----------------------------------
-// Utility function for use by ADLC.  Implements bottom_type for matched AddP.
-const Type *AddPNode::mach_bottom_type( const MachNode* n) {
-  Node* base = n->in(Base);
-  const Type *t = base->bottom_type();
-  if ( t == Type::TOP ) {
-    // an untyped pointer
-    return TypeRawPtr::BOTTOM;
-  }
-  const TypePtr* tp = t->isa_oopptr();
-  if ( tp == NULL )  return t;
-  if ( tp->_offset == TypePtr::OffsetBot )  return tp;
-
-  // We must carefully add up the various offsets...
-  intptr_t offset = 0;
-  const TypePtr* tptr = NULL;
-
-  uint numopnds = n->num_opnds();
-  uint index = n->oper_input_base();
-  for ( uint i = 1; i < numopnds; i++ ) {
-    MachOper *opnd = n->_opnds[i];
-    // Check for any interesting operand info.
-    // In particular, check for both memory and non-memory operands.
-    // %%%%% Clean this up: use xadd_offset
-    intptr_t con = opnd->constant();
-    if ( con == TypePtr::OffsetBot )  goto bottom_out;
-    offset += con;
-    con = opnd->constant_disp();
-    if ( con == TypePtr::OffsetBot )  goto bottom_out;
-    offset += con;
-    if( opnd->scale() != 0 ) goto bottom_out;
-
-    // Check each operand input edge.  Find the 1 allowed pointer
-    // edge.  Other edges must be index edges; track exact constant
-    // inputs and otherwise assume the worst.
-    for ( uint j = opnd->num_edges(); j > 0; j-- ) {
-      Node* edge = n->in(index++);
-      const Type*    et  = edge->bottom_type();
-      const TypeX*   eti = et->isa_intptr_t();
-      if ( eti == NULL ) {
-        // there must be one pointer among the operands
-        guarantee(tptr == NULL, "must be only one pointer operand");
-        if (UseCompressedOops && Universe::narrow_oop_shift() == 0) {
-          // 32-bits narrow oop can be the base of address expressions
-          tptr = et->make_ptr()->isa_oopptr();
-        } else {
-          // only regular oops are expected here
-          tptr = et->isa_oopptr();
-        }
-        guarantee(tptr != NULL, "non-int operand must be pointer");
-        if (tptr->higher_equal(tp->add_offset(tptr->offset())))
-          tp = tptr; // Set more precise type for bailout
-        continue;
-      }
-      if ( eti->_hi != eti->_lo )  goto bottom_out;
-      offset += eti->_lo;
-    }
-  }
-  guarantee(tptr != NULL, "must be exactly one pointer operand");
-  return tptr->add_offset(offset);
-
- bottom_out:
-  return tp->add_offset(TypePtr::OffsetBot);
-}
-
 //=============================================================================
 //------------------------------Identity---------------------------------------
 Node *OrINode::Identity( PhaseTransform *phase ) {