< prev index next >

src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp

Print this page

 896 
 897   // arguments of lir_convert
 898   LIR_Opr conv_input = input;
 899   LIR_Opr conv_result = result;
 900 
 901   __ convert(x->op(), conv_input, conv_result);
 902 
 903   assert(result->is_virtual(), "result must be virtual register");
 904   set_result(x, result);
 905 }
 906 
 907 void LIRGenerator::do_NewInstance(NewInstance* x) {
 908 #ifndef PRODUCT
 909   if (PrintNotLoaded && !x->klass()->is_loaded()) {
 910     tty->print_cr("   ###class not loaded at new bci %d", x->printable_bci());
 911   }
 912 #endif
 913   CodeEmitInfo* info = state_for(x, x->state());
 914   LIR_Opr reg = result_register_for(x->type());
 915   new_instance(reg, x->klass(), x->is_unresolved(),

 916                FrameMap::r12_oop_opr,
 917                FrameMap::r15_oop_opr,
 918                FrameMap::r14_oop_opr,
 919                LIR_OprFact::illegalOpr,
 920                FrameMap::r13_metadata_opr,
 921                info);

 922   LIR_Opr result = rlock_result(x);
 923   __ move(reg, result);
 924 }
 925 
 926 void LIRGenerator::do_NewTypeArray(NewTypeArray* x) {
 927   CodeEmitInfo* info = nullptr;
 928   if (x->state_before() != nullptr && x->state_before()->force_reexecute()) {
 929     info = state_for(x, x->state_before());
 930     info->set_force_reexecute();
 931   } else {
 932     info = state_for(x, x->state());
 933   }
 934 
 935   LIRItem length(x->length(), this);
 936   length.load_item_force(FrameMap::r9_opr);
 937 
 938   LIR_Opr reg = result_register_for(x->type());
 939   LIR_Opr tmp1 = FrameMap::r12_oop_opr;
 940   LIR_Opr tmp2 = FrameMap::r14_oop_opr;
 941   LIR_Opr tmp3 = FrameMap::r15_oop_opr;

1060 
1061   CodeStub* stub = nullptr;
1062   if (x->is_incompatible_class_change_check()) {
1063     assert(patching_info == nullptr, "can't patch this");
1064     stub = new SimpleExceptionStub(StubId::c1_throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr,
1065                                    info_for_exception);
1066   } else if (x->is_invokespecial_receiver_check()) {
1067     assert(patching_info == nullptr, "can't patch this");
1068     stub = new DeoptimizeStub(info_for_exception,
1069                               Deoptimization::Reason_class_check,
1070                               Deoptimization::Action_none);
1071   } else {
1072     stub = new SimpleExceptionStub(StubId::c1_throw_class_cast_exception_id, obj.result(), info_for_exception);
1073   }
1074   LIR_Opr reg = rlock_result(x);
1075   LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
1076   tmp3 = new_register(objectType);
1077   __ checkcast(reg, obj.result(), x->klass(),
1078                new_register(objectType), new_register(objectType), tmp3,
1079                x->direct_compare(), info_for_exception, patching_info, stub,
1080                x->profiled_method(), x->profiled_bci());
1081 }
1082 
1083 void LIRGenerator::do_InstanceOf(InstanceOf* x) {
1084   LIRItem obj(x->obj(), this);
1085 
1086   // result and test object may not be in same register
1087   LIR_Opr reg = rlock_result(x);
1088   CodeEmitInfo* patching_info = nullptr;
1089   if ((!x->klass()->is_loaded() || PatchALot)) {
1090     // must do this before locking the destination register as an oop register
1091     patching_info = state_for(x, x->state_before());
1092   }
1093   obj.load_item();
1094   LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
1095   tmp3 = new_register(objectType);
1096   __ instanceof(reg, obj.result(), x->klass(),
1097                 new_register(objectType), new_register(objectType), tmp3,
1098                 x->direct_compare(), patching_info, x->profiled_method(), x->profiled_bci());
1099 }
1100 

 896 
 897   // arguments of lir_convert
 898   LIR_Opr conv_input = input;
 899   LIR_Opr conv_result = result;
 900 
 901   __ convert(x->op(), conv_input, conv_result);
 902 
 903   assert(result->is_virtual(), "result must be virtual register");
 904   set_result(x, result);
 905 }
 906 
 907 void LIRGenerator::do_NewInstance(NewInstance* x) {
 908 #ifndef PRODUCT
 909   if (PrintNotLoaded && !x->klass()->is_loaded()) {
 910     tty->print_cr("   ###class not loaded at new bci %d", x->printable_bci());
 911   }
 912 #endif
 913   CodeEmitInfo* info = state_for(x, x->state());
 914   LIR_Opr reg = result_register_for(x->type());
 915   new_instance(reg, x->klass(), x->is_unresolved(),
 916                /* allow_inline */ false,
 917                FrameMap::r12_oop_opr,
 918                FrameMap::r15_oop_opr,
 919                FrameMap::r14_oop_opr,
 920                LIR_OprFact::illegalOpr,
 921                FrameMap::r13_metadata_opr,
 922                info);
 923 
 924   LIR_Opr result = rlock_result(x);
 925   __ move(reg, result);
 926 }
 927 
 928 void LIRGenerator::do_NewTypeArray(NewTypeArray* x) {
 929   CodeEmitInfo* info = nullptr;
 930   if (x->state_before() != nullptr && x->state_before()->force_reexecute()) {
 931     info = state_for(x, x->state_before());
 932     info->set_force_reexecute();
 933   } else {
 934     info = state_for(x, x->state());
 935   }
 936 
 937   LIRItem length(x->length(), this);
 938   length.load_item_force(FrameMap::r9_opr);
 939 
 940   LIR_Opr reg = result_register_for(x->type());
 941   LIR_Opr tmp1 = FrameMap::r12_oop_opr;
 942   LIR_Opr tmp2 = FrameMap::r14_oop_opr;
 943   LIR_Opr tmp3 = FrameMap::r15_oop_opr;

1062 
1063   CodeStub* stub = nullptr;
1064   if (x->is_incompatible_class_change_check()) {
1065     assert(patching_info == nullptr, "can't patch this");
1066     stub = new SimpleExceptionStub(StubId::c1_throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr,
1067                                    info_for_exception);
1068   } else if (x->is_invokespecial_receiver_check()) {
1069     assert(patching_info == nullptr, "can't patch this");
1070     stub = new DeoptimizeStub(info_for_exception,
1071                               Deoptimization::Reason_class_check,
1072                               Deoptimization::Action_none);
1073   } else {
1074     stub = new SimpleExceptionStub(StubId::c1_throw_class_cast_exception_id, obj.result(), info_for_exception);
1075   }
1076   LIR_Opr reg = rlock_result(x);
1077   LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
1078   tmp3 = new_register(objectType);
1079   __ checkcast(reg, obj.result(), x->klass(),
1080                new_register(objectType), new_register(objectType), tmp3,
1081                x->direct_compare(), info_for_exception, patching_info, stub,
1082                x->profiled_method(), x->profiled_bci(), /*is_null_free*/ false);
1083 }
1084 
1085 void LIRGenerator::do_InstanceOf(InstanceOf* x) {
1086   LIRItem obj(x->obj(), this);
1087 
1088   // result and test object may not be in same register
1089   LIR_Opr reg = rlock_result(x);
1090   CodeEmitInfo* patching_info = nullptr;
1091   if ((!x->klass()->is_loaded() || PatchALot)) {
1092     // must do this before locking the destination register as an oop register
1093     patching_info = state_for(x, x->state_before());
1094   }
1095   obj.load_item();
1096   LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
1097   tmp3 = new_register(objectType);
1098   __ instanceof(reg, obj.result(), x->klass(),
1099                 new_register(objectType), new_register(objectType), tmp3,
1100                 x->direct_compare(), patching_info, x->profiled_method(), x->profiled_bci());
1101 }
1102 
< prev index next >