comparison src/share/vm/opto/doCall.cpp @ 2462:4124a5a27707

7009600: JSR 292 Server compiler crashes in Compile::find_intrinsic(ciMethod*, bool) Summary: catch errors during the compile-time processing of method handles; back out cleanly Reviewed-by: twisti
author jrose
date Thu, 07 Apr 2011 17:12:23 -0700
parents 3d58a4983660
children e2a92dd0d3d2
comparison
equal deleted inserted replaced
2461:758ba0bf7bcc 2462:4124a5a27707
61 61
62 CallGenerator* Compile::call_generator(ciMethod* call_method, int vtable_index, bool call_is_virtual, 62 CallGenerator* Compile::call_generator(ciMethod* call_method, int vtable_index, bool call_is_virtual,
63 JVMState* jvms, bool allow_inline, 63 JVMState* jvms, bool allow_inline,
64 float prof_factor) { 64 float prof_factor) {
65 CallGenerator* cg; 65 CallGenerator* cg;
66 guarantee(call_method != NULL, "failed method resolution");
66 67
67 // Dtrace currently doesn't work unless all calls are vanilla 68 // Dtrace currently doesn't work unless all calls are vanilla
68 if (env()->dtrace_method_probes()) { 69 if (env()->dtrace_method_probes()) {
69 allow_inline = false; 70 allow_inline = false;
70 } 71 }
128 // and signature in the MethodHandleCompiler. 129 // and signature in the MethodHandleCompiler.
129 method_handle->set_callee(call_method); 130 method_handle->set_callee(call_method);
130 131
131 // Get an adapter for the MethodHandle. 132 // Get an adapter for the MethodHandle.
132 ciMethod* target_method = method_handle->get_method_handle_adapter(); 133 ciMethod* target_method = method_handle->get_method_handle_adapter();
133 134 CallGenerator* hit_cg = NULL;
134 CallGenerator* hit_cg = this->call_generator(target_method, vtable_index, false, jvms, true, prof_factor); 135 if (target_method != NULL)
136 hit_cg = this->call_generator(target_method, vtable_index, false, jvms, true, prof_factor);
135 if (hit_cg != NULL && hit_cg->is_inline()) 137 if (hit_cg != NULL && hit_cg->is_inline())
136 return hit_cg; 138 return hit_cg;
137 } 139 }
138 140
139 return CallGenerator::for_direct_call(call_method); 141 return CallGenerator::for_direct_call(call_method);
150 // and signature in the MethodHandleCompiler. 152 // and signature in the MethodHandleCompiler.
151 method_handle->set_callee(call_method); 153 method_handle->set_callee(call_method);
152 154
153 // Get an adapter for the MethodHandle. 155 // Get an adapter for the MethodHandle.
154 ciMethod* target_method = method_handle->get_invokedynamic_adapter(); 156 ciMethod* target_method = method_handle->get_invokedynamic_adapter();
155 157 CallGenerator* hit_cg = NULL;
156 CallGenerator* hit_cg = this->call_generator(target_method, vtable_index, false, jvms, true, prof_factor); 158 if (target_method != NULL)
159 hit_cg = this->call_generator(target_method, vtable_index, false, jvms, true, prof_factor);
157 if (hit_cg != NULL && hit_cg->is_inline()) { 160 if (hit_cg != NULL && hit_cg->is_inline()) {
158 CallGenerator* miss_cg = CallGenerator::for_dynamic_call(call_method); 161 CallGenerator* miss_cg = CallGenerator::for_dynamic_call(call_method);
159 return CallGenerator::for_predicted_dynamic_call(method_handle, miss_cg, hit_cg, prof_factor); 162 return CallGenerator::for_predicted_dynamic_call(method_handle, miss_cg, hit_cg, prof_factor);
160 } 163 }
161 164