|
37 | 37 | #include "oops/markWord.hpp"
|
38 | 38 | #include "oops/method.hpp"
|
39 | 39 | #include "oops/methodData.hpp"
|
| 40 | +#include "oops/resolvedFieldEntry.hpp" |
40 | 41 | #include "oops/resolvedIndyEntry.hpp"
|
41 | 42 | #include "prims/jvmtiExport.hpp"
|
42 | 43 | #include "prims/jvmtiThreadState.hpp"
|
@@ -312,6 +313,36 @@ void InterpreterMacroAssembler::load_resolved_indy_entry(Register cache, Registe
|
312 | 313 | add(cache, cache, index);
|
313 | 314 | }
|
314 | 315 |
|
| 316 | +void InterpreterMacroAssembler::load_field_entry(Register cache, Register index, int bcp_offset) { |
| 317 | + // Get index out of bytecode pointer |
| 318 | + assert_different_registers(cache, index); |
| 319 | + |
| 320 | + get_index_at_bcp(index, bcp_offset, cache /*as tmp*/, sizeof(u2)); |
| 321 | + |
| 322 | + // Scale the index to be the entry index * sizeof(ResolvedFieldEntry) |
| 323 | + // sizeof(ResolvedFieldEntry) is 16 on Arm, so using shift |
| 324 | + if (is_power_of_2(sizeof(ResolvedFieldEntry))) { |
| 325 | + // load constant pool cache pointer |
| 326 | + ldr(cache, Address(FP, frame::interpreter_frame_cache_offset * wordSize)); |
| 327 | + // Get address of field entries array |
| 328 | + ldr(cache, Address(cache, in_bytes(ConstantPoolCache::field_entries_offset()))); |
| 329 | + |
| 330 | + add(cache, cache, Array<ResolvedFieldEntry>::base_offset_in_bytes()); |
| 331 | + add(cache, cache, AsmOperand(index, lsl, log2i_exact(sizeof(ResolvedFieldEntry)))); |
| 332 | + } |
| 333 | + else { |
| 334 | + mov(cache, sizeof(ResolvedFieldEntry)); |
| 335 | + mul(index, index, cache); |
| 336 | + // load constant pool cache pointer |
| 337 | + ldr(cache, Address(FP, frame::interpreter_frame_cache_offset * wordSize)); |
| 338 | + |
| 339 | + // Get address of field entries array |
| 340 | + ldr(cache, Address(cache, in_bytes(ConstantPoolCache::field_entries_offset()))); |
| 341 | + add(cache, cache, Array<ResolvedFieldEntry>::base_offset_in_bytes()); |
| 342 | + add(cache, cache, index); |
| 343 | + } |
| 344 | +} |
| 345 | + |
315 | 346 | // Generate a subtype check: branch to not_subtype if sub_klass is
|
316 | 347 | // not a subtype of super_klass.
|
317 | 348 | // Profiling code for the subtype check failure (profile_typecheck_failed)
|
|
0 commit comments