< prev index next >

src/hotspot/share/c1/c1_LIRGenerator.cpp

Print this page

1239   LIRItem clazz(x->argument_at(0), this);
1240   LIRItem object(x->argument_at(1), this);
1241   clazz.load_item();
1242   object.load_item();
1243   LIR_Opr result = rlock_result(x);
1244 
1245   // need to perform null check on clazz
1246   if (x->needs_null_check()) {
1247     CodeEmitInfo* info = state_for(x);
1248     __ null_check(clazz.result(), info);
1249   }
1250 
1251   LIR_Opr call_result = call_runtime(clazz.value(), object.value(),
1252                                      CAST_FROM_FN_PTR(address, Runtime1::is_instance_of),
1253                                      x->type(),
1254                                      nullptr); // null CodeEmitInfo results in a leaf call
1255   __ move(call_result, result);
1256 }
1257 
1258 void LIRGenerator::load_klass(LIR_Opr obj, LIR_Opr klass, CodeEmitInfo* null_check_info) {
1259   __ load_klass(obj, klass, null_check_info);

1260 }
1261 
1262 // Example: object.getClass ()
1263 void LIRGenerator::do_getClass(Intrinsic* x) {
1264   assert(x->number_of_arguments() == 1, "wrong type");
1265 
1266   LIRItem rcvr(x->argument_at(0), this);
1267   rcvr.load_item();
1268   LIR_Opr temp = new_register(T_ADDRESS);
1269   LIR_Opr result = rlock_result(x);
1270 
1271   // need to perform the null check on the rcvr
1272   CodeEmitInfo* info = nullptr;
1273   if (x->needs_null_check()) {
1274     info = state_for(x);
1275   }
1276 
1277   LIR_Opr klass = new_register(T_METADATA);
1278   load_klass(rcvr.result(), klass, info);
1279   __ move_wide(new LIR_Address(klass, in_bytes(Klass::java_mirror_offset()), T_ADDRESS), temp);

1239   LIRItem clazz(x->argument_at(0), this);
1240   LIRItem object(x->argument_at(1), this);
1241   clazz.load_item();
1242   object.load_item();
1243   LIR_Opr result = rlock_result(x);
1244 
1245   // need to perform null check on clazz
1246   if (x->needs_null_check()) {
1247     CodeEmitInfo* info = state_for(x);
1248     __ null_check(clazz.result(), info);
1249   }
1250 
1251   LIR_Opr call_result = call_runtime(clazz.value(), object.value(),
1252                                      CAST_FROM_FN_PTR(address, Runtime1::is_instance_of),
1253                                      x->type(),
1254                                      nullptr); // null CodeEmitInfo results in a leaf call
1255   __ move(call_result, result);
1256 }
1257 
1258 void LIRGenerator::load_klass(LIR_Opr obj, LIR_Opr klass, CodeEmitInfo* null_check_info) {
1259   CodeStub* slow_path = UseCompactObjectHeaders ? new LoadKlassStub(klass) : nullptr;
1260   __ load_klass(obj, klass, null_check_info, slow_path);
1261 }
1262 
1263 // Example: object.getClass ()
1264 void LIRGenerator::do_getClass(Intrinsic* x) {
1265   assert(x->number_of_arguments() == 1, "wrong type");
1266 
1267   LIRItem rcvr(x->argument_at(0), this);
1268   rcvr.load_item();
1269   LIR_Opr temp = new_register(T_ADDRESS);
1270   LIR_Opr result = rlock_result(x);
1271 
1272   // need to perform the null check on the rcvr
1273   CodeEmitInfo* info = nullptr;
1274   if (x->needs_null_check()) {
1275     info = state_for(x);
1276   }
1277 
1278   LIR_Opr klass = new_register(T_METADATA);
1279   load_klass(rcvr.result(), klass, info);
1280   __ move_wide(new LIR_Address(klass, in_bytes(Klass::java_mirror_offset()), T_ADDRESS), temp);
< prev index next >