|
39 | 39 | #include "oops/methodData.hpp" |
40 | 40 | #include "oops/resolvedFieldEntry.hpp" |
41 | 41 | #include "oops/resolvedIndyEntry.hpp" |
| 42 | +#include "oops/resolvedMethodEntry.hpp" |
42 | 43 | #include "prims/jvmtiExport.hpp" |
43 | 44 | #include "prims/jvmtiThreadState.hpp" |
44 | 45 | #include "runtime/basicLock.hpp" |
@@ -222,48 +223,6 @@ void InterpreterMacroAssembler::get_index_at_bcp(Register index, int bcp_offset, |
222 | 223 | } |
223 | 224 | } |
224 | 225 |
|
225 | | -// Sets cache, index. |
226 | | -void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Register index, int bcp_offset, size_t index_size) { |
227 | | - assert(bcp_offset > 0, "bcp is still pointing to start of bytecode"); |
228 | | - assert_different_registers(cache, index); |
229 | | - |
230 | | - get_index_at_bcp(index, bcp_offset, cache, index_size); |
231 | | - |
232 | | - // load constant pool cache pointer |
233 | | - ldr(cache, Address(FP, frame::interpreter_frame_cache_offset * wordSize)); |
234 | | - |
235 | | - // convert from field index to ConstantPoolCacheEntry index |
236 | | - assert(sizeof(ConstantPoolCacheEntry) == 4*wordSize, "adjust code below"); |
237 | | - logical_shift_left(index, index, 2); |
238 | | -} |
239 | | - |
240 | | -// Sets cache, index, bytecode. |
241 | | -void InterpreterMacroAssembler::get_cache_and_index_and_bytecode_at_bcp(Register cache, Register index, Register bytecode, int byte_no, int bcp_offset, size_t index_size) { |
242 | | - get_cache_and_index_at_bcp(cache, index, bcp_offset, index_size); |
243 | | - // caution index and bytecode can be the same |
244 | | - add(bytecode, cache, AsmOperand(index, lsl, LogBytesPerWord)); |
245 | | - ldrb(bytecode, Address(bytecode, (1 + byte_no) + in_bytes(ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::indices_offset()))); |
246 | | - TemplateTable::volatile_barrier(MacroAssembler::LoadLoad, noreg, true); |
247 | | -} |
248 | | - |
249 | | -// Sets cache. Blows reg_tmp. |
250 | | -void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register reg_tmp, int bcp_offset, size_t index_size) { |
251 | | - assert(bcp_offset > 0, "bcp is still pointing to start of bytecode"); |
252 | | - assert_different_registers(cache, reg_tmp); |
253 | | - |
254 | | - get_index_at_bcp(reg_tmp, bcp_offset, cache, index_size); |
255 | | - |
256 | | - // load constant pool cache pointer |
257 | | - ldr(cache, Address(FP, frame::interpreter_frame_cache_offset * wordSize)); |
258 | | - |
259 | | - // skip past the header |
260 | | - add(cache, cache, in_bytes(ConstantPoolCache::base_offset())); |
261 | | - // convert from field index to ConstantPoolCacheEntry index |
262 | | - // and from word offset to byte offset |
263 | | - assert(sizeof(ConstantPoolCacheEntry) == 4*wordSize, "adjust code below"); |
264 | | - add(cache, cache, AsmOperand(reg_tmp, lsl, 2 + LogBytesPerWord)); |
265 | | -} |
266 | | - |
267 | 226 | // Load object from cpool->resolved_references(index) |
268 | 227 | void InterpreterMacroAssembler::load_resolved_reference_at_index( |
269 | 228 | Register result, Register index) { |
@@ -343,6 +302,20 @@ void InterpreterMacroAssembler::load_field_entry(Register cache, Register index, |
343 | 302 | } |
344 | 303 | } |
345 | 304 |
|
| 305 | +void InterpreterMacroAssembler::load_method_entry(Register cache, Register index, int bcp_offset) { |
| 306 | + // Get index out of bytecode pointer |
| 307 | + get_index_at_bcp(index, bcp_offset, cache /* as tmp */, sizeof(u2)); |
| 308 | + mov(cache, sizeof(ResolvedMethodEntry)); |
| 309 | + mul(index, index, cache); // Scale the index to be the entry index * sizeof(ResolvedMethodEntry) |
| 310 | + |
| 311 | + // load constant pool cache pointer |
| 312 | + ldr(cache, Address(FP, frame::interpreter_frame_cache_offset * wordSize)); |
| 313 | + // Get address of method entries array |
| 314 | + ldr(cache, Address(cache, ConstantPoolCache::method_entries_offset())); |
| 315 | + add(cache, cache, Array<ResolvedMethodEntry>::base_offset_in_bytes()); |
| 316 | + add(cache, cache, index); |
| 317 | +} |
| 318 | + |
346 | 319 | // Generate a subtype check: branch to not_subtype if sub_klass is |
347 | 320 | // not a subtype of super_klass. |
348 | 321 | // Profiling code for the subtype check failure (profile_typecheck_failed) |
|
0 commit comments