< prev index next >

src/share/vm/opto/compile.cpp

Print this page




2853 
2854   case Op_AddP: {               // Assert sane base pointers
2855     Node *addp = n->in(AddPNode::Address);
2856     assert( !addp->is_AddP() ||
2857             addp->in(AddPNode::Base)->is_top() || // Top OK for allocation
2858             addp->in(AddPNode::Base) == n->in(AddPNode::Base),
2859             "Base pointers must match (addp %u)", addp->_idx );
2860 #ifdef _LP64
2861     if ((UseCompressedOops || UseCompressedClassPointers) &&
2862         addp->Opcode() == Op_ConP &&
2863         addp == n->in(AddPNode::Base) &&
2864         n->in(AddPNode::Offset)->is_Con()) {
2865       // Use addressing with narrow klass to load with offset on x86.
2866       // On sparc loading 32-bits constant and decoding it have less
2867       // instructions (4) then load 64-bits constant (7).
2868       // Do this transformation here since IGVN will convert ConN back to ConP.
2869       const Type* t = addp->bottom_type();
2870       if (t->isa_oopptr() || t->isa_klassptr()) {
2871         Node* nn = NULL;
2872 
2873         int op = t->isa_oopptr() ? Op_ConN : Op_ConNKlass;
2874 
2875         // Look for existing ConN node of the same exact type.
2876         Node* r  = root();
2877         uint cnt = r->outcnt();
2878         for (uint i = 0; i < cnt; i++) {
2879           Node* m = r->raw_out(i);
2880           if (m!= NULL && m->Opcode() == op &&
2881               m->bottom_type()->make_ptr() == t) {
2882             nn = m;
2883             break;
2884           }
2885         }
2886         if (nn != NULL) {
2887           // Decode a narrow oop to match address
2888           // [R12 + narrow_oop_reg<<3 + offset]
2889           if (t->isa_oopptr()) {
2890             nn = new DecodeNNode(nn, t);
2891           } else {
2892             nn = new DecodeNKlassNode(nn, t);
2893           }




2853 
2854   case Op_AddP: {               // Assert sane base pointers
2855     Node *addp = n->in(AddPNode::Address);
2856     assert( !addp->is_AddP() ||
2857             addp->in(AddPNode::Base)->is_top() || // Top OK for allocation
2858             addp->in(AddPNode::Base) == n->in(AddPNode::Base),
2859             "Base pointers must match (addp %u)", addp->_idx );
2860 #ifdef _LP64
2861     if ((UseCompressedOops || UseCompressedClassPointers) &&
2862         addp->Opcode() == Op_ConP &&
2863         addp == n->in(AddPNode::Base) &&
2864         n->in(AddPNode::Offset)->is_Con()) {
2865       // Use addressing with narrow klass to load with offset on x86.
2866       // On sparc loading 32-bits constant and decoding it have less
2867       // instructions (4) then load 64-bits constant (7).
2868       // Do this transformation here since IGVN will convert ConN back to ConP.
2869       const Type* t = addp->bottom_type();
2870       if (t->isa_oopptr() || t->isa_klassptr()) {
2871         Node* nn = NULL;
2872 
2873         uint op = t->isa_oopptr() ? Op_ConN : Op_ConNKlass;
2874 
2875         // Look for existing ConN node of the same exact type.
2876         Node* r  = root();
2877         uint cnt = r->outcnt();
2878         for (uint i = 0; i < cnt; i++) {
2879           Node* m = r->raw_out(i);
2880           if (m!= NULL && m->Opcode() == op &&
2881               m->bottom_type()->make_ptr() == t) {
2882             nn = m;
2883             break;
2884           }
2885         }
2886         if (nn != NULL) {
2887           // Decode a narrow oop to match address
2888           // [R12 + narrow_oop_reg<<3 + offset]
2889           if (t->isa_oopptr()) {
2890             nn = new DecodeNNode(nn, t);
2891           } else {
2892             nn = new DecodeNKlassNode(nn, t);
2893           }


< prev index next >