437 switch(code()) {
438 case lir_move:
439 assert(in_opr()->is_valid() && result_opr()->is_valid(), "must be");
440 break;
441 case lir_null_check:
442 assert(in_opr()->is_register(), "must be");
443 break;
444 case lir_return:
445 assert(in_opr()->is_register() || in_opr()->is_illegal(), "must be");
446 break;
447 }
448 }
449
450 void LIR_OpRTCall::verify() const {
451 assert(strcmp(Runtime1::name_for_address(addr()), "<unknown function>") != 0, "unknown function");
452 }
453
454 //-------------------visits--------------------------
455
456 // complete rework of LIR instruction visitor.
457 // The virtual calls for each instruction type is replaced by a big
458 // switch that adds the operands for each instruction
459
460 void LIR_OpVisitState::visit(LIR_Op* op) {
461 // copy information from the LIR_Op
462 reset();
463 set_op(op);
464
465 switch (op->code()) {
466
467 // LIR_Op0
468 case lir_word_align: // result and info always invalid
469 case lir_backwardbranch_target: // result and info always invalid
470 case lir_build_frame: // result and info always invalid
471 case lir_fpop_raw: // result and info always invalid
472 case lir_24bit_FPU: // result and info always invalid
473 case lir_reset_FPU: // result and info always invalid
474 case lir_breakpoint: // result and info always invalid
475 case lir_membar: // result and info always invalid
476 case lir_membar_acquire: // result and info always invalid
477 case lir_membar_release: // result and info always invalid
806 // LIR_OpJavaCall
807 case lir_static_call:
808 case lir_optvirtual_call:
809 case lir_icvirtual_call:
810 case lir_virtual_call:
811 case lir_dynamic_call: {
812 LIR_OpJavaCall* opJavaCall = op->as_OpJavaCall();
813 assert(opJavaCall != NULL, "must be");
814
815 if (opJavaCall->_receiver->is_valid()) do_input(opJavaCall->_receiver);
816
817 // only visit register parameters
818 int n = opJavaCall->_arguments->length();
819 for (int i = opJavaCall->_receiver->is_valid() ? 1 : 0; i < n; i++) {
820 if (!opJavaCall->_arguments->at(i)->is_pointer()) {
821 do_input(*opJavaCall->_arguments->adr_at(i));
822 }
823 }
824
825 if (opJavaCall->_info) do_info(opJavaCall->_info);
826 if (opJavaCall->is_method_handle_invoke()) {
827 opJavaCall->_method_handle_invoke_SP_save_opr = FrameMap::method_handle_invoke_SP_save_opr();
828 do_temp(opJavaCall->_method_handle_invoke_SP_save_opr);
829 }
830 do_call();
831 if (opJavaCall->_result->is_valid()) do_output(opJavaCall->_result);
832
833 break;
834 }
835
836
837 // LIR_OpRTCall
838 case lir_rtcall: {
839 assert(op->as_OpRTCall() != NULL, "must be");
840 LIR_OpRTCall* opRTCall = (LIR_OpRTCall*)op;
841
842 // only visit register parameters
843 int n = opRTCall->_arguments->length();
844 for (int i = 0; i < n; i++) {
845 if (!opRTCall->_arguments->at(i)->is_pointer()) {
846 do_input(*opRTCall->_arguments->adr_at(i));
|
437 switch(code()) {
438 case lir_move:
439 assert(in_opr()->is_valid() && result_opr()->is_valid(), "must be");
440 break;
441 case lir_null_check:
442 assert(in_opr()->is_register(), "must be");
443 break;
444 case lir_return:
445 assert(in_opr()->is_register() || in_opr()->is_illegal(), "must be");
446 break;
447 }
448 }
449
450 void LIR_OpRTCall::verify() const {
451 assert(strcmp(Runtime1::name_for_address(addr()), "<unknown function>") != 0, "unknown function");
452 }
453
454 //-------------------visits--------------------------
455
456 // complete rework of LIR instruction visitor.
457 // The virtual call for each instruction type is replaced by a big
458 // switch that adds the operands for each instruction
459
460 void LIR_OpVisitState::visit(LIR_Op* op) {
461 // copy information from the LIR_Op
462 reset();
463 set_op(op);
464
465 switch (op->code()) {
466
467 // LIR_Op0
468 case lir_word_align: // result and info always invalid
469 case lir_backwardbranch_target: // result and info always invalid
470 case lir_build_frame: // result and info always invalid
471 case lir_fpop_raw: // result and info always invalid
472 case lir_24bit_FPU: // result and info always invalid
473 case lir_reset_FPU: // result and info always invalid
474 case lir_breakpoint: // result and info always invalid
475 case lir_membar: // result and info always invalid
476 case lir_membar_acquire: // result and info always invalid
477 case lir_membar_release: // result and info always invalid
806 // LIR_OpJavaCall
807 case lir_static_call:
808 case lir_optvirtual_call:
809 case lir_icvirtual_call:
810 case lir_virtual_call:
811 case lir_dynamic_call: {
812 LIR_OpJavaCall* opJavaCall = op->as_OpJavaCall();
813 assert(opJavaCall != NULL, "must be");
814
815 if (opJavaCall->_receiver->is_valid()) do_input(opJavaCall->_receiver);
816
817 // only visit register parameters
818 int n = opJavaCall->_arguments->length();
819 for (int i = opJavaCall->_receiver->is_valid() ? 1 : 0; i < n; i++) {
820 if (!opJavaCall->_arguments->at(i)->is_pointer()) {
821 do_input(*opJavaCall->_arguments->adr_at(i));
822 }
823 }
824
825 if (opJavaCall->_info) do_info(opJavaCall->_info);
826 if (FrameMap::method_handle_invoke_SP_save_opr() != LIR_OprFact::illegalOpr &&
827 opJavaCall->is_method_handle_invoke()) {
828 opJavaCall->_method_handle_invoke_SP_save_opr = FrameMap::method_handle_invoke_SP_save_opr();
829 do_temp(opJavaCall->_method_handle_invoke_SP_save_opr);
830 }
831 do_call();
832 if (opJavaCall->_result->is_valid()) do_output(opJavaCall->_result);
833
834 break;
835 }
836
837
838 // LIR_OpRTCall
839 case lir_rtcall: {
840 assert(op->as_OpRTCall() != NULL, "must be");
841 LIR_OpRTCall* opRTCall = (LIR_OpRTCall*)op;
842
843 // only visit register parameters
844 int n = opRTCall->_arguments->length();
845 for (int i = 0; i < n; i++) {
846 if (!opRTCall->_arguments->at(i)->is_pointer()) {
847 do_input(*opRTCall->_arguments->adr_at(i));
|