@@ -153,14 +153,15 @@ void CodeInstaller::pd_relocate_JavaMethod(CodeBuffer &, Handle hotspot_method,
153153 method = getMethodFromHotSpotMethod (hotspot_method ());
154154 }
155155#endif
156+ NativeCall* call = NULL ;
156157 switch (_next_call_type) {
157158 case INLINE_INVOKE:
158- break ;
159+ return ;
159160 case INVOKEVIRTUAL:
160161 case INVOKEINTERFACE: {
161162 assert (method == NULL || !method->is_static (), " cannot call static method with invokeinterface" );
162163
163- NativeCall* call = nativeCall_at (_instructions->start () + pc_offset);
164+ call = nativeCall_at (_instructions->start () + pc_offset);
164165 call->set_destination (SharedRuntime::get_resolve_virtual_call_stub ());
165166 _instructions->relocate (call->instruction_address (),
166167 virtual_call_Relocation::spec (_invoke_mark_pc),
@@ -170,23 +171,26 @@ void CodeInstaller::pd_relocate_JavaMethod(CodeBuffer &, Handle hotspot_method,
170171 case INVOKESTATIC: {
171172 assert (method == NULL || method->is_static (), " cannot call non-static method with invokestatic" );
172173
173- NativeCall* call = nativeCall_at (_instructions->start () + pc_offset);
174+ call = nativeCall_at (_instructions->start () + pc_offset);
174175 call->set_destination (SharedRuntime::get_resolve_static_call_stub ());
175176 _instructions->relocate (call->instruction_address (),
176177 relocInfo::static_call_type, Assembler::call32_operand);
177178 break ;
178179 }
179180 case INVOKESPECIAL: {
180181 assert (method == NULL || !method->is_static (), " cannot call static method with invokespecial" );
181- NativeCall* call = nativeCall_at (_instructions->start () + pc_offset);
182+ call = nativeCall_at (_instructions->start () + pc_offset);
182183 call->set_destination (SharedRuntime::get_resolve_opt_virtual_call_stub ());
183184 _instructions->relocate (call->instruction_address (),
184185 relocInfo::opt_virtual_call_type, Assembler::call32_operand);
185186 break ;
186187 }
187188 default :
188- JVMCI_ERROR (" invalid _next_call_type value" );
189- break ;
189+ JVMCI_ERROR (" invalid _next_call_type value: %d" , _next_call_type);
190+ return ;
191+ }
192+ if (!call->is_displacement_aligned ()) {
193+ JVMCI_ERROR (" unaligned displacement for call at offset %d" , pc_offset);
190194 }
191195}
192196
0 commit comments