< prev index next >

src/hotspot/share/c1/c1_LIRGenerator.cpp

Print this page

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

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 = nullptr;
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);

1225   LIRItem clazz(x->argument_at(0), this);
1226   LIRItem object(x->argument_at(1), this);
1227   clazz.load_item();
1228   object.load_item();
1229   LIR_Opr result = rlock_result(x);
1230 
1231   // need to perform null check on clazz
1232   if (x->needs_null_check()) {
1233     CodeEmitInfo* info = state_for(x);
1234     __ null_check(clazz.result(), info);
1235   }
1236 
1237   LIR_Opr call_result = call_runtime(clazz.value(), object.value(),
1238                                      CAST_FROM_FN_PTR(address, Runtime1::is_instance_of),
1239                                      x->type(),
1240                                      nullptr); // null CodeEmitInfo results in a leaf call
1241   __ move(call_result, result);
1242 }
1243 
1244 void LIRGenerator::load_klass(LIR_Opr obj, LIR_Opr klass, CodeEmitInfo* null_check_info) {
1245   CodeStub* slow_path = UseCompactObjectHeaders ? new LoadKlassStub(klass) : nullptr;
1246   __ load_klass(obj, klass, null_check_info, slow_path);
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);
< prev index next >