comparison src/share/vm/ci/ciTypeFlow.cpp @ 6266:1d7922586cf6

7023639: JSR 292 method handle invocation needs a fast path for compiled code 6984705: JSR 292 method handle creation should not go through JNI Summary: remove assembly code for JDK 7 chained method handles Reviewed-by: jrose, twisti, kvn, mhaupt Contributed-by: John Rose <john.r.rose@oracle.com>, Christian Thalinger <christian.thalinger@oracle.com>, Michael Haupt <michael.haupt@oracle.com>
author twisti
date Tue, 24 Jul 2012 10:51:00 -0700
parents e9a5e0a812c8
children 7f813940ac35
comparison
equal deleted inserted replaced
6241:aba91a731143 6266:1d7922586cf6
641 } 641 }
642 642
643 // ------------------------------------------------------------------ 643 // ------------------------------------------------------------------
644 // ciTypeFlow::StateVector::do_invoke 644 // ciTypeFlow::StateVector::do_invoke
645 void ciTypeFlow::StateVector::do_invoke(ciBytecodeStream* str, 645 void ciTypeFlow::StateVector::do_invoke(ciBytecodeStream* str,
646 bool has_receiver) { 646 bool has_receiver_foo) {
647 bool will_link; 647 bool will_link;
648 ciMethod* method = str->get_method(will_link); 648 ciMethod* callee = str->get_method(will_link);
649 if (!will_link) { 649 if (!will_link) {
650 // We weren't able to find the method. 650 // We weren't able to find the method.
651 if (str->cur_bc() == Bytecodes::_invokedynamic) { 651 if (str->cur_bc() == Bytecodes::_invokedynamic) {
652 trap(str, NULL, 652 trap(str, NULL,
653 Deoptimization::make_trap_request 653 Deoptimization::make_trap_request
654 (Deoptimization::Reason_uninitialized, 654 (Deoptimization::Reason_uninitialized,
655 Deoptimization::Action_reinterpret)); 655 Deoptimization::Action_reinterpret));
656 } else { 656 } else {
657 ciKlass* unloaded_holder = method->holder(); 657 ciKlass* unloaded_holder = callee->holder();
658 trap(str, unloaded_holder, str->get_method_holder_index()); 658 trap(str, unloaded_holder, str->get_method_holder_index());
659 } 659 }
660 } else { 660 } else {
661 ciSignature* signature = method->signature(); 661 // TODO Use Bytecode_invoke after metadata changes.
662 //Bytecode_invoke inv(str->method(), str->cur_bci());
663 //const bool has_receiver = callee->is_loaded() ? !callee->is_static() : inv.has_receiver();
664 Bytecode inv(str);
665 Bytecodes::Code code = inv.invoke_code();
666 const bool has_receiver = callee->is_loaded() ? !callee->is_static() : code != Bytecodes::_invokestatic && code != Bytecodes::_invokedynamic;
667
668 ciSignature* signature = callee->signature();
662 ciSignatureStream sigstr(signature); 669 ciSignatureStream sigstr(signature);
670 // Push appendix argument, if one.
671 if (str->has_appendix()) {
672 ciObject* appendix = str->get_appendix();
673 push_object(appendix->klass());
674 }
663 int arg_size = signature->size(); 675 int arg_size = signature->size();
664 int stack_base = stack_size() - arg_size; 676 int stack_base = stack_size() - arg_size;
665 int i = 0; 677 int i = 0;
666 for( ; !sigstr.at_return_type(); sigstr.next()) { 678 for( ; !sigstr.at_return_type(); sigstr.next()) {
667 ciType* type = sigstr.type(); 679 ciType* type = sigstr.type();
675 } 687 }
676 assert(arg_size == i, "must match"); 688 assert(arg_size == i, "must match");
677 for (int j = 0; j < arg_size; j++) { 689 for (int j = 0; j < arg_size; j++) {
678 pop(); 690 pop();
679 } 691 }
692 assert(!callee->is_loaded() || has_receiver == !callee->is_static(), "mismatch");
680 if (has_receiver) { 693 if (has_receiver) {
681 // Check this? 694 // Check this?
682 pop_object(); 695 pop_object();
683 } 696 }
684 assert(!sigstr.is_done(), "must have return type"); 697 assert(!sigstr.is_done(), "must have return type");