src/share/vm/opto/parse2.cpp

Print this page
rev 3688 : 7054512: Compress class pointers after perm gen removal
Summary: support of compress class pointers in the compilers.
Reviewed-by:


1222       con  = val;
1223       tcon = tval;
1224       val  = c->in(2);
1225       tval = _gvn.type(val);
1226       btest = BoolTest(btest).commute();
1227       have_con = true;
1228     } else {
1229       // Do we have two constants?  Then leave well enough alone.
1230       have_con = false;
1231     }
1232   }
1233   if (!have_con)                        // remaining adjustments need a con
1234     return;
1235 
1236   sharpen_type_after_if(btest, con, tcon, val, tval);
1237 }
1238 
1239 
1240 static Node* extract_obj_from_klass_load(PhaseGVN* gvn, Node* n) {
1241   Node* ldk;
1242   if (n->is_DecodeN()) {
1243     if (n->in(1)->Opcode() != Op_LoadNKlass) {
1244       return NULL;
1245     } else {
1246       ldk = n->in(1);
1247     }
1248   } else if (n->Opcode() != Op_LoadKlass) {
1249     return NULL;
1250   } else {
1251     ldk = n;
1252   }
1253   assert(ldk != NULL && ldk->is_Load(), "should have found a LoadKlass or LoadNKlass node");
1254 
1255   Node* adr = ldk->in(MemNode::Address);
1256   intptr_t off = 0;
1257   Node* obj = AddPNode::Ideal_base_and_offset(adr, gvn, off);
1258   if (obj == NULL || off != oopDesc::klass_offset_in_bytes()) // loading oopDesc::_klass?
1259     return NULL;
1260   const TypePtr* tp = gvn->type(obj)->is_ptr();
1261   if (tp == NULL || !(tp->isa_instptr() || tp->isa_aryptr())) // is obj a Java object ptr?
1262     return NULL;




1222       con  = val;
1223       tcon = tval;
1224       val  = c->in(2);
1225       tval = _gvn.type(val);
1226       btest = BoolTest(btest).commute();
1227       have_con = true;
1228     } else {
1229       // Do we have two constants?  Then leave well enough alone.
1230       have_con = false;
1231     }
1232   }
1233   if (!have_con)                        // remaining adjustments need a con
1234     return;
1235 
1236   sharpen_type_after_if(btest, con, tcon, val, tval);
1237 }
1238 
1239 
1240 static Node* extract_obj_from_klass_load(PhaseGVN* gvn, Node* n) {
1241   Node* ldk;
1242   if (n->is_DecodeNKlass()) {
1243     if (n->in(1)->Opcode() != Op_LoadNKlass) {
1244       return NULL;
1245     } else {
1246       ldk = n->in(1);
1247     }
1248   } else if (n->Opcode() != Op_LoadKlass) {
1249     return NULL;
1250   } else {
1251     ldk = n;
1252   }
1253   assert(ldk != NULL && ldk->is_Load(), "should have found a LoadKlass or LoadNKlass node");
1254 
1255   Node* adr = ldk->in(MemNode::Address);
1256   intptr_t off = 0;
1257   Node* obj = AddPNode::Ideal_base_and_offset(adr, gvn, off);
1258   if (obj == NULL || off != oopDesc::klass_offset_in_bytes()) // loading oopDesc::_klass?
1259     return NULL;
1260   const TypePtr* tp = gvn->type(obj)->is_ptr();
1261   if (tp == NULL || !(tp->isa_instptr() || tp->isa_aryptr())) // is obj a Java object ptr?
1262     return NULL;