aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/opto/graphKit.cpp
diff options
context:
space:
mode:
authortwisti <none@none>2012-07-24 10:51:00 -0700
committertwisti <none@none>2012-07-24 10:51:00 -0700
commitb6ab9f10c4d7691a6f0f420419d35c85451ad79d (patch)
treeb19bcb4e6aac412ad43f757955cb606750632f9d /src/share/vm/opto/graphKit.cpp
parent901adc9685720a807c0dc04e43b824049cb386fc (diff)
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>
Diffstat (limited to 'src/share/vm/opto/graphKit.cpp')
-rw-r--r--src/share/vm/opto/graphKit.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/share/vm/opto/graphKit.cpp b/src/share/vm/opto/graphKit.cpp
index b3dca9531..da24dc369 100644
--- a/src/share/vm/opto/graphKit.cpp
+++ b/src/share/vm/opto/graphKit.cpp
@@ -965,7 +965,7 @@ void GraphKit::add_safepoint_edges(SafePointNode* call, bool must_throw) {
assert(call->jvms()->debug_depth() == call->req() - non_debug_edges, "");
}
-bool GraphKit::compute_stack_effects(int& inputs, int& depth) {
+bool GraphKit::compute_stack_effects(int& inputs, int& depth, bool for_parse) {
Bytecodes::Code code = java_bc();
if (code == Bytecodes::_wide) {
code = method()->java_code_at_bci(bci() + 1);
@@ -1032,12 +1032,21 @@ bool GraphKit::compute_stack_effects(int& inputs, int& depth) {
ciBytecodeStream iter(method());
iter.reset_to_bci(bci());
iter.next();
- ciMethod* method = iter.get_method(ignore);
+ ciMethod* callee = iter.get_method(ignore);
// (Do not use ciMethod::arg_size(), because
// it might be an unloaded method, which doesn't
// know whether it is static or not.)
- inputs = method->invoke_arg_size(code);
- int size = method->return_type()->size();
+ if (for_parse) {
+ // Case 1: When called from parse we are *before* the invoke (in the
+ // caller) and need to to adjust the inputs by an appendix
+ // argument that will be pushed implicitly.
+ inputs = callee->invoke_arg_size(code) - (iter.has_appendix() ? 1 : 0);
+ } else {
+ // Case 2: Here we are *after* the invoke (in the callee) and need to
+ // remove any appendix arguments that were popped.
+ inputs = callee->invoke_arg_size(code) - (callee->has_member_arg() ? 1 : 0);
+ }
+ int size = callee->return_type()->size();
depth = size - inputs;
}
break;
@@ -1373,7 +1382,6 @@ void GraphKit::replace_in_map(Node* old, Node* neww) {
}
-
//=============================================================================
//--------------------------------memory---------------------------------------
Node* GraphKit::memory(uint alias_idx) {