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