Mercurial > hg > truffle
comparison src/share/vm/opto/doCall.cpp @ 3752:f918d6096e23
7050554: JSR 292 - need optimization for selectAlternative
Reviewed-by: kvn, jrose
author | never |
---|---|
date | Thu, 02 Jun 2011 13:36:11 -0700 |
parents | fabcf26ee72f |
children | 393e144bb99b |
comparison
equal
deleted
inserted
replaced
3745:a93146d0e4be | 3752:f918d6096e23 |
---|---|
121 if (call_method->is_method_handle_invoke()) { | 121 if (call_method->is_method_handle_invoke()) { |
122 if (bytecode != Bytecodes::_invokedynamic) { | 122 if (bytecode != Bytecodes::_invokedynamic) { |
123 GraphKit kit(jvms); | 123 GraphKit kit(jvms); |
124 Node* n = kit.argument(0); | 124 Node* n = kit.argument(0); |
125 | 125 |
126 if (n->Opcode() == Op_ConP) { | 126 CallGenerator* cg = CallGenerator::for_method_handle_inline(n, jvms, caller, call_method, profile); |
127 const TypeOopPtr* oop_ptr = n->bottom_type()->is_oopptr(); | 127 if (cg != NULL) { |
128 ciObject* const_oop = oop_ptr->const_oop(); | 128 return cg; |
129 ciMethodHandle* method_handle = const_oop->as_method_handle(); | |
130 | |
131 // Set the callee to have access to the class and signature in | |
132 // the MethodHandleCompiler. | |
133 method_handle->set_callee(call_method); | |
134 method_handle->set_caller(caller); | |
135 method_handle->set_call_profile(&profile); | |
136 | |
137 // Get an adapter for the MethodHandle. | |
138 ciMethod* target_method = method_handle->get_method_handle_adapter(); | |
139 if (target_method != NULL) { | |
140 CallGenerator* hit_cg = this->call_generator(target_method, vtable_index, false, jvms, true, prof_factor); | |
141 if (hit_cg != NULL && hit_cg->is_inline()) | |
142 return hit_cg; | |
143 } | |
144 } | 129 } |
145 | 130 |
146 return CallGenerator::for_direct_call(call_method); | 131 return CallGenerator::for_direct_call(call_method); |
147 } | 132 } |
148 else { | 133 else { |
155 | 140 |
156 // Set the callee to have access to the class and signature in | 141 // Set the callee to have access to the class and signature in |
157 // the MethodHandleCompiler. | 142 // the MethodHandleCompiler. |
158 method_handle->set_callee(call_method); | 143 method_handle->set_callee(call_method); |
159 method_handle->set_caller(caller); | 144 method_handle->set_caller(caller); |
160 method_handle->set_call_profile(&profile); | 145 method_handle->set_call_profile(profile); |
161 | 146 |
162 // Get an adapter for the MethodHandle. | 147 // Get an adapter for the MethodHandle. |
163 ciMethod* target_method = method_handle->get_invokedynamic_adapter(); | 148 ciMethod* target_method = method_handle->get_invokedynamic_adapter(); |
164 if (target_method != NULL) { | 149 if (target_method != NULL) { |
165 CallGenerator* hit_cg = this->call_generator(target_method, vtable_index, false, jvms, true, prof_factor); | 150 CallGenerator* hit_cg = this->call_generator(target_method, vtable_index, false, jvms, true, prof_factor); |