654 |
654 |
655 // Do a null check on the receiver as it would happen before the call to |
655 // Do a null check on the receiver as it would happen before the call to |
656 // callee (with all arguments still on the stack). |
656 // callee (with all arguments still on the stack). |
657 Node* null_check_receiver_before_call(ciMethod* callee) { |
657 Node* null_check_receiver_before_call(ciMethod* callee) { |
658 assert(!callee->is_static(), "must be a virtual method"); |
658 assert(!callee->is_static(), "must be a virtual method"); |
659 const int nargs = callee->arg_size(); |
659 // Callsite signature can be different from actual method being called (i.e _linkTo* sites). |
|
660 // Use callsite signature always. |
|
661 ciMethod* declared_method = method()->get_method_at_bci(bci()); |
|
662 const int nargs = declared_method->arg_size(); |
660 inc_sp(nargs); |
663 inc_sp(nargs); |
661 Node* n = null_check_receiver(); |
664 Node* n = null_check_receiver(); |
662 dec_sp(nargs); |
665 dec_sp(nargs); |
663 return n; |
666 return n; |
664 } |
667 } |