< prev index next >

src/hotspot/share/c1/c1_LIRGenerator.cpp

Print this page

1223   LIRItem clazz(x->argument_at(0), this);
1224   LIRItem object(x->argument_at(1), this);
1225   clazz.load_item();
1226   object.load_item();
1227   LIR_Opr result = rlock_result(x);
1228 
1229   // need to perform null check on clazz
1230   if (x->needs_null_check()) {
1231     CodeEmitInfo* info = state_for(x);
1232     __ null_check(clazz.result(), info);
1233   }
1234 
1235   LIR_Opr call_result = call_runtime(clazz.value(), object.value(),
1236                                      CAST_FROM_FN_PTR(address, Runtime1::is_instance_of),
1237                                      x->type(),
1238                                      NULL); // NULL CodeEmitInfo results in a leaf call
1239   __ move(call_result, result);
1240 }
1241 
1242 void LIRGenerator::load_klass(LIR_Opr obj, LIR_Opr klass, CodeEmitInfo* null_check_info) {
1243   __ load_klass(obj, klass, null_check_info);

1244 }
1245 
1246 // Example: object.getClass ()
1247 void LIRGenerator::do_getClass(Intrinsic* x) {
1248   assert(x->number_of_arguments() == 1, "wrong type");
1249 
1250   LIRItem rcvr(x->argument_at(0), this);
1251   rcvr.load_item();
1252   LIR_Opr temp = new_register(T_ADDRESS);
1253   LIR_Opr result = rlock_result(x);
1254 
1255   // need to perform the null check on the rcvr
1256   CodeEmitInfo* info = NULL;
1257   if (x->needs_null_check()) {
1258     info = state_for(x);
1259   }
1260 
1261   LIR_Opr klass = new_register(T_METADATA);
1262   load_klass(rcvr.result(), klass, info);
1263   __ move_wide(new LIR_Address(klass, in_bytes(Klass::java_mirror_offset()), T_ADDRESS), temp);

1223   LIRItem clazz(x->argument_at(0), this);
1224   LIRItem object(x->argument_at(1), this);
1225   clazz.load_item();
1226   object.load_item();
1227   LIR_Opr result = rlock_result(x);
1228 
1229   // need to perform null check on clazz
1230   if (x->needs_null_check()) {
1231     CodeEmitInfo* info = state_for(x);
1232     __ null_check(clazz.result(), info);
1233   }
1234 
1235   LIR_Opr call_result = call_runtime(clazz.value(), object.value(),
1236                                      CAST_FROM_FN_PTR(address, Runtime1::is_instance_of),
1237                                      x->type(),
1238                                      NULL); // NULL CodeEmitInfo results in a leaf call
1239   __ move(call_result, result);
1240 }
1241 
1242 void LIRGenerator::load_klass(LIR_Opr obj, LIR_Opr klass, CodeEmitInfo* null_check_info) {
1243   CodeStub* slow_path = new LoadKlassStub(obj, klass);
1244   __ load_klass(obj, klass, null_check_info, slow_path);
1245 }
1246 
1247 // Example: object.getClass ()
1248 void LIRGenerator::do_getClass(Intrinsic* x) {
1249   assert(x->number_of_arguments() == 1, "wrong type");
1250 
1251   LIRItem rcvr(x->argument_at(0), this);
1252   rcvr.load_item();
1253   LIR_Opr temp = new_register(T_ADDRESS);
1254   LIR_Opr result = rlock_result(x);
1255 
1256   // need to perform the null check on the rcvr
1257   CodeEmitInfo* info = NULL;
1258   if (x->needs_null_check()) {
1259     info = state_for(x);
1260   }
1261 
1262   LIR_Opr klass = new_register(T_METADATA);
1263   load_klass(rcvr.result(), klass, info);
1264   __ move_wide(new LIR_Address(klass, in_bytes(Klass::java_mirror_offset()), T_ADDRESS), temp);
< prev index next >