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