equal
deleted
inserted
replaced
1644 return compilation()->dependency_recorder(); |
1644 return compilation()->dependency_recorder(); |
1645 } |
1645 } |
1646 |
1646 |
1647 |
1647 |
1648 void GraphBuilder::invoke(Bytecodes::Code code) { |
1648 void GraphBuilder::invoke(Bytecodes::Code code) { |
1649 const bool has_receiver = |
|
1650 code == Bytecodes::_invokespecial || |
|
1651 code == Bytecodes::_invokevirtual || |
|
1652 code == Bytecodes::_invokeinterface; |
|
1653 const bool is_invokedynamic = (code == Bytecodes::_invokedynamic); |
1649 const bool is_invokedynamic = (code == Bytecodes::_invokedynamic); |
1654 |
1650 |
1655 bool will_link; |
1651 bool will_link; |
1656 ciMethod* target = stream()->get_method(will_link); |
1652 ciMethod* target = stream()->get_method(will_link); |
1657 ciKlass* holder = stream()->get_declared_method_holder(); |
1653 ciKlass* holder = stream()->get_declared_method_holder(); |
1688 |
1684 |
1689 // Some methods are obviously bindable without any type checks so |
1685 // Some methods are obviously bindable without any type checks so |
1690 // convert them directly to an invokespecial or invokestatic. |
1686 // convert them directly to an invokespecial or invokestatic. |
1691 if (target->is_loaded() && !target->is_abstract() && target->can_be_statically_bound()) { |
1687 if (target->is_loaded() && !target->is_abstract() && target->can_be_statically_bound()) { |
1692 switch (bc_raw) { |
1688 switch (bc_raw) { |
1693 case Bytecodes::_invokevirtual: code = Bytecodes::_invokespecial; break; |
1689 case Bytecodes::_invokevirtual: |
1694 case Bytecodes::_invokehandle: code = Bytecodes::_invokestatic; break; |
1690 code = Bytecodes::_invokespecial; |
|
1691 break; |
|
1692 case Bytecodes::_invokehandle: |
|
1693 code = target->is_static() ? Bytecodes::_invokestatic : Bytecodes::_invokespecial; |
|
1694 break; |
1695 } |
1695 } |
1696 } |
1696 } |
1697 |
1697 |
1698 // Push appendix argument (MethodType, CallSite, etc.), if one. |
1698 // Push appendix argument (MethodType, CallSite, etc.), if one. |
1699 if (stream()->has_appendix()) { |
1699 if (stream()->has_appendix()) { |
1876 CHECK_BAILOUT(); |
1876 CHECK_BAILOUT(); |
1877 |
1877 |
1878 // inlining not successful => standard invoke |
1878 // inlining not successful => standard invoke |
1879 bool is_loaded = target->is_loaded(); |
1879 bool is_loaded = target->is_loaded(); |
1880 ValueType* result_type = as_ValueType(target->return_type()); |
1880 ValueType* result_type = as_ValueType(target->return_type()); |
1881 |
1881 ValueStack* state_before = copy_state_exhandling(); |
1882 // We require the debug info to be the "state before" because |
1882 |
1883 // invokedynamics may deoptimize. |
1883 // The bytecode (code) might change in this method so we are checking this very late. |
1884 ValueStack* state_before = is_invokedynamic ? copy_state_before() : copy_state_exhandling(); |
1884 const bool has_receiver = |
1885 |
1885 code == Bytecodes::_invokespecial || |
|
1886 code == Bytecodes::_invokevirtual || |
|
1887 code == Bytecodes::_invokeinterface; |
1886 Values* args = state()->pop_arguments(target->arg_size_no_receiver()); |
1888 Values* args = state()->pop_arguments(target->arg_size_no_receiver()); |
1887 Value recv = has_receiver ? apop() : NULL; |
1889 Value recv = has_receiver ? apop() : NULL; |
1888 int vtable_index = methodOopDesc::invalid_vtable_index; |
1890 int vtable_index = methodOopDesc::invalid_vtable_index; |
1889 |
1891 |
1890 #ifdef SPARC |
1892 #ifdef SPARC |