< prev index next >

src/hotspot/share/c1/c1_LIRGenerator.cpp

Print this page




1287 }
1288 
1289 // Example: object.getClass ()
1290 void LIRGenerator::do_getClass(Intrinsic* x) {
1291   assert(x->number_of_arguments() == 1, "wrong type");
1292 
1293   LIRItem rcvr(x->argument_at(0), this);
1294   rcvr.load_item();
1295   LIR_Opr temp = new_register(T_METADATA);
1296   LIR_Opr result = rlock_result(x);
1297 
1298   // need to perform the null check on the rcvr
1299   CodeEmitInfo* info = NULL;
1300   if (x->needs_null_check()) {
1301     info = state_for(x);
1302   }
1303 
1304   // FIXME T_ADDRESS should actually be T_METADATA but it can't because the
1305   // meaning of these two is mixed up (see JDK-8026837).
1306   __ move(new LIR_Address(rcvr.result(), oopDesc::klass_offset_in_bytes(), T_ADDRESS), temp, info);
1307   __ move_wide(new LIR_Address(temp, in_bytes(Klass::java_mirror_offset()), T_OBJECT), result);


1308 }
1309 
1310 // java.lang.Class::isPrimitive()
1311 void LIRGenerator::do_isPrimitive(Intrinsic* x) {
1312   assert(x->number_of_arguments() == 1, "wrong type");
1313 
1314   LIRItem rcvr(x->argument_at(0), this);
1315   rcvr.load_item();
1316   LIR_Opr temp = new_register(T_METADATA);
1317   LIR_Opr result = rlock_result(x);
1318 
1319   CodeEmitInfo* info = NULL;
1320   if (x->needs_null_check()) {
1321     info = state_for(x);
1322   }
1323 
1324   __ move(new LIR_Address(rcvr.result(), java_lang_Class::klass_offset_in_bytes(), T_ADDRESS), temp, info);
1325   __ cmp(lir_cond_notEqual, temp, LIR_OprFact::intConst(0));
1326   __ cmove(lir_cond_notEqual, LIR_OprFact::intConst(0), LIR_OprFact::intConst(1), result, T_BOOLEAN);
1327 }




1287 }
1288 
1289 // Example: object.getClass ()
1290 void LIRGenerator::do_getClass(Intrinsic* x) {
1291   assert(x->number_of_arguments() == 1, "wrong type");
1292 
1293   LIRItem rcvr(x->argument_at(0), this);
1294   rcvr.load_item();
1295   LIR_Opr temp = new_register(T_METADATA);
1296   LIR_Opr result = rlock_result(x);
1297 
1298   // need to perform the null check on the rcvr
1299   CodeEmitInfo* info = NULL;
1300   if (x->needs_null_check()) {
1301     info = state_for(x);
1302   }
1303 
1304   // FIXME T_ADDRESS should actually be T_METADATA but it can't because the
1305   // meaning of these two is mixed up (see JDK-8026837).
1306   __ move(new LIR_Address(rcvr.result(), oopDesc::klass_offset_in_bytes(), T_ADDRESS), temp, info);
1307   __ move_wide(new LIR_Address(temp, in_bytes(Klass::java_mirror_offset()), T_ADDRESS), result);
1308   // mirror = ((OopHandle)mirror)->resolve();
1309   __ move_wide(new LIR_Address(result, T_OBJECT), result);
1310 }
1311 
1312 // java.lang.Class::isPrimitive()
1313 void LIRGenerator::do_isPrimitive(Intrinsic* x) {
1314   assert(x->number_of_arguments() == 1, "wrong type");
1315 
1316   LIRItem rcvr(x->argument_at(0), this);
1317   rcvr.load_item();
1318   LIR_Opr temp = new_register(T_METADATA);
1319   LIR_Opr result = rlock_result(x);
1320 
1321   CodeEmitInfo* info = NULL;
1322   if (x->needs_null_check()) {
1323     info = state_for(x);
1324   }
1325 
1326   __ move(new LIR_Address(rcvr.result(), java_lang_Class::klass_offset_in_bytes(), T_ADDRESS), temp, info);
1327   __ cmp(lir_cond_notEqual, temp, LIR_OprFact::intConst(0));
1328   __ cmove(lir_cond_notEqual, LIR_OprFact::intConst(0), LIR_OprFact::intConst(1), result, T_BOOLEAN);
1329 }


< prev index next >