src/share/vm/opto/addnode.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
6953576 Cdiff src/share/vm/opto/addnode.cpp
src/share/vm/opto/addnode.cpp
Print this page
*** 712,786 ****
// Do we Match on this edge index or not? Do not match base pointer edge
uint AddPNode::match_edge(uint idx) const {
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 ) {
// x | x => x
if (phase->eqv(in(1), in(2))) {
--- 712,721 ----
src/share/vm/opto/addnode.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File