< prev index next >

src/hotspot/share/c1/c1_LIRGenerator.cpp

Print this page

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


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

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