@@ -155,14 +155,15 @@ void CodeInstaller::pd_relocate_JavaMethod(CodeBuffer &, JVMCIObject hotspot_met
155
155
method = JVMCIENV->asMethod (hotspot_method);
156
156
}
157
157
#endif
158
+ NativeCall* call = NULL ;
158
159
switch (_next_call_type) {
159
160
case INLINE_INVOKE:
160
- break ;
161
+ return ;
161
162
case INVOKEVIRTUAL:
162
163
case INVOKEINTERFACE: {
163
164
assert (method == NULL || !method->is_static (), " cannot call static method with invokeinterface" );
164
165
165
- NativeCall* call = nativeCall_at (_instructions->start () + pc_offset);
166
+ call = nativeCall_at (_instructions->start () + pc_offset);
166
167
call->set_destination (SharedRuntime::get_resolve_virtual_call_stub ());
167
168
_instructions->relocate (call->instruction_address (),
168
169
virtual_call_Relocation::spec (_invoke_mark_pc),
@@ -172,23 +173,26 @@ void CodeInstaller::pd_relocate_JavaMethod(CodeBuffer &, JVMCIObject hotspot_met
172
173
case INVOKESTATIC: {
173
174
assert (method == NULL || method->is_static (), " cannot call non-static method with invokestatic" );
174
175
175
- NativeCall* call = nativeCall_at (_instructions->start () + pc_offset);
176
+ call = nativeCall_at (_instructions->start () + pc_offset);
176
177
call->set_destination (SharedRuntime::get_resolve_static_call_stub ());
177
178
_instructions->relocate (call->instruction_address (),
178
179
relocInfo::static_call_type, Assembler::call32_operand);
179
180
break ;
180
181
}
181
182
case INVOKESPECIAL: {
182
183
assert (method == NULL || !method->is_static (), " cannot call static method with invokespecial" );
183
- NativeCall* call = nativeCall_at (_instructions->start () + pc_offset);
184
+ call = nativeCall_at (_instructions->start () + pc_offset);
184
185
call->set_destination (SharedRuntime::get_resolve_opt_virtual_call_stub ());
185
186
_instructions->relocate (call->instruction_address (),
186
187
relocInfo::opt_virtual_call_type, Assembler::call32_operand);
187
188
break ;
188
189
}
189
190
default :
190
- JVMCI_ERROR (" invalid _next_call_type value" );
191
- break ;
191
+ JVMCI_ERROR (" invalid _next_call_type value: %d" , _next_call_type);
192
+ return ;
193
+ }
194
+ if (!call->is_displacement_aligned ()) {
195
+ JVMCI_ERROR (" unaligned displacement for call at offset %d" , pc_offset);
192
196
}
193
197
}
194
198
0 commit comments