Mercurial > hg > graal-compiler
comparison src/share/vm/opto/graphKit.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 | 8f972594effc |
children | 7f813940ac35 |
comparison
equal
deleted
inserted
replaced
6241:aba91a731143 | 6266:1d7922586cf6 |
---|---|
963 assert(call->jvms()->debug_start() == non_debug_edges, ""); | 963 assert(call->jvms()->debug_start() == non_debug_edges, ""); |
964 assert(call->jvms()->debug_end() == call->req(), ""); | 964 assert(call->jvms()->debug_end() == call->req(), ""); |
965 assert(call->jvms()->debug_depth() == call->req() - non_debug_edges, ""); | 965 assert(call->jvms()->debug_depth() == call->req() - non_debug_edges, ""); |
966 } | 966 } |
967 | 967 |
968 bool GraphKit::compute_stack_effects(int& inputs, int& depth) { | 968 bool GraphKit::compute_stack_effects(int& inputs, int& depth, bool for_parse) { |
969 Bytecodes::Code code = java_bc(); | 969 Bytecodes::Code code = java_bc(); |
970 if (code == Bytecodes::_wide) { | 970 if (code == Bytecodes::_wide) { |
971 code = method()->java_code_at_bci(bci() + 1); | 971 code = method()->java_code_at_bci(bci() + 1); |
972 } | 972 } |
973 | 973 |
1030 { | 1030 { |
1031 bool ignore; | 1031 bool ignore; |
1032 ciBytecodeStream iter(method()); | 1032 ciBytecodeStream iter(method()); |
1033 iter.reset_to_bci(bci()); | 1033 iter.reset_to_bci(bci()); |
1034 iter.next(); | 1034 iter.next(); |
1035 ciMethod* method = iter.get_method(ignore); | 1035 ciMethod* callee = iter.get_method(ignore); |
1036 // (Do not use ciMethod::arg_size(), because | 1036 // (Do not use ciMethod::arg_size(), because |
1037 // it might be an unloaded method, which doesn't | 1037 // it might be an unloaded method, which doesn't |
1038 // know whether it is static or not.) | 1038 // know whether it is static or not.) |
1039 inputs = method->invoke_arg_size(code); | 1039 if (for_parse) { |
1040 int size = method->return_type()->size(); | 1040 // Case 1: When called from parse we are *before* the invoke (in the |
1041 // caller) and need to to adjust the inputs by an appendix | |
1042 // argument that will be pushed implicitly. | |
1043 inputs = callee->invoke_arg_size(code) - (iter.has_appendix() ? 1 : 0); | |
1044 } else { | |
1045 // Case 2: Here we are *after* the invoke (in the callee) and need to | |
1046 // remove any appendix arguments that were popped. | |
1047 inputs = callee->invoke_arg_size(code) - (callee->has_member_arg() ? 1 : 0); | |
1048 } | |
1049 int size = callee->return_type()->size(); | |
1041 depth = size - inputs; | 1050 depth = size - inputs; |
1042 } | 1051 } |
1043 break; | 1052 break; |
1044 | 1053 |
1045 case Bytecodes::_multianewarray: | 1054 case Bytecodes::_multianewarray: |
1369 // The idea would be that an inlined function's null checks | 1378 // The idea would be that an inlined function's null checks |
1370 // can be shared with the entire inlining tree. | 1379 // can be shared with the entire inlining tree. |
1371 // The expense of doing this is that the PreserveJVMState class | 1380 // The expense of doing this is that the PreserveJVMState class |
1372 // would have to preserve caller states too, with a deep copy. | 1381 // would have to preserve caller states too, with a deep copy. |
1373 } | 1382 } |
1374 | |
1375 | 1383 |
1376 | 1384 |
1377 //============================================================================= | 1385 //============================================================================= |
1378 //--------------------------------memory--------------------------------------- | 1386 //--------------------------------memory--------------------------------------- |
1379 Node* GraphKit::memory(uint alias_idx) { | 1387 Node* GraphKit::memory(uint alias_idx) { |