< prev index next >

src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp

Print this page


1356   // nothing to do for now
1357 }
1358 
1359 
1360 void LIRGenerator::do_CheckCast(CheckCast* x) {
1361   LIRItem obj(x->obj(), this);
1362 
1363   CodeEmitInfo* patching_info = NULL;
1364   if (!x->klass()->is_loaded() || (PatchALot && !x->is_incompatible_class_change_check() && !x->is_invokespecial_receiver_check())) {
1365     // must do this before locking the destination register as an oop register,
1366     // and before the obj is loaded (the latter is for deoptimization)
1367     patching_info = state_for(x, x->state_before());
1368   }
1369   obj.load_item();
1370 
1371   // info for exceptions
1372   CodeEmitInfo* info_for_exception =
1373       (x->needs_exception_state() ? state_for(x) :
1374                                     state_for(x, x->state_before(), true /*ignore_xhandler*/));
1375 




1376   CodeStub* stub;
1377   if (x->is_incompatible_class_change_check()) {
1378     assert(patching_info == NULL, "can't patch this");
1379     stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception);
1380   } else if (x->is_invokespecial_receiver_check()) {
1381     assert(patching_info == NULL, "can't patch this");
1382     stub = new DeoptimizeStub(info_for_exception, Deoptimization::Reason_class_check, Deoptimization::Action_none);
1383   } else {
1384     stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception);
1385   }
1386   LIR_Opr reg = rlock_result(x);
1387   LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
1388   if (!x->klass()->is_loaded() || UseCompressedClassPointers) {
1389     tmp3 = new_register(objectType);
1390   }
1391   __ checkcast(reg, obj.result(), x->klass(),
1392                new_register(objectType), new_register(objectType), tmp3,
1393                x->direct_compare(), info_for_exception, patching_info, stub,
1394                x->profiled_method(), x->profiled_bci());
1395 }
1396 
1397 
1398 void LIRGenerator::do_InstanceOf(InstanceOf* x) {
1399   LIRItem obj(x->obj(), this);
1400 
1401   // result and test object may not be in same register
1402   LIR_Opr reg = rlock_result(x);
1403   CodeEmitInfo* patching_info = NULL;
1404   if ((!x->klass()->is_loaded() || PatchALot)) {
1405     // must do this before locking the destination register as an oop register
1406     patching_info = state_for(x, x->state_before());
1407   }
1408   obj.load_item();
1409   LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
1410   if (!x->klass()->is_loaded() || UseCompressedClassPointers) {
1411     tmp3 = new_register(objectType);
1412   }
1413   __ instanceof(reg, obj.result(), x->klass(),
1414                 new_register(objectType), new_register(objectType), tmp3,




1356   // nothing to do for now
1357 }
1358 
1359 
1360 void LIRGenerator::do_CheckCast(CheckCast* x) {
1361   LIRItem obj(x->obj(), this);
1362 
1363   CodeEmitInfo* patching_info = NULL;
1364   if (!x->klass()->is_loaded() || (PatchALot && !x->is_incompatible_class_change_check() && !x->is_invokespecial_receiver_check())) {
1365     // must do this before locking the destination register as an oop register,
1366     // and before the obj is loaded (the latter is for deoptimization)
1367     patching_info = state_for(x, x->state_before());
1368   }
1369   obj.load_item();
1370 
1371   // info for exceptions
1372   CodeEmitInfo* info_for_exception =
1373       (x->needs_exception_state() ? state_for(x) :
1374                                     state_for(x, x->state_before(), true /*ignore_xhandler*/));
1375 
1376   if (x->is_never_null()) {
1377     __ null_check(obj.result(), new CodeEmitInfo(info_for_exception), /* deoptimize */ false);
1378   }
1379 
1380   CodeStub* stub;
1381   if (x->is_incompatible_class_change_check()) {
1382     assert(patching_info == NULL, "can't patch this");
1383     stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception);
1384   } else if (x->is_invokespecial_receiver_check()) {
1385     assert(patching_info == NULL, "can't patch this");
1386     stub = new DeoptimizeStub(info_for_exception, Deoptimization::Reason_class_check, Deoptimization::Action_none);
1387   } else {
1388     stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception);
1389   }
1390   LIR_Opr reg = rlock_result(x);
1391   LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
1392   if (!x->klass()->is_loaded() || UseCompressedClassPointers) {
1393     tmp3 = new_register(objectType);
1394   }
1395   __ checkcast(reg, obj.result(), x->klass(),
1396                new_register(objectType), new_register(objectType), tmp3,
1397                x->direct_compare(), info_for_exception, patching_info, stub,
1398                x->profiled_method(), x->profiled_bci(), x->is_never_null());
1399 }
1400 
1401 
1402 void LIRGenerator::do_InstanceOf(InstanceOf* x) {
1403   LIRItem obj(x->obj(), this);
1404 
1405   // result and test object may not be in same register
1406   LIR_Opr reg = rlock_result(x);
1407   CodeEmitInfo* patching_info = NULL;
1408   if ((!x->klass()->is_loaded() || PatchALot)) {
1409     // must do this before locking the destination register as an oop register
1410     patching_info = state_for(x, x->state_before());
1411   }
1412   obj.load_item();
1413   LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
1414   if (!x->klass()->is_loaded() || UseCompressedClassPointers) {
1415     tmp3 = new_register(objectType);
1416   }
1417   __ instanceof(reg, obj.result(), x->klass(),
1418                 new_register(objectType), new_register(objectType), tmp3,


< prev index next >