|
36 | 36 | #include "oops/markWord.hpp" |
37 | 37 | #include "oops/method.hpp" |
38 | 38 | #include "oops/methodData.hpp" |
| 39 | +#include "oops/resolvedFieldEntry.hpp" |
39 | 40 | #include "oops/resolvedIndyEntry.hpp" |
40 | 41 | #include "prims/jvmtiExport.hpp" |
41 | 42 | #include "prims/jvmtiThreadState.hpp" |
@@ -1881,8 +1882,24 @@ void InterpreterMacroAssembler::load_resolved_indy_entry(Register cache, Registe |
1881 | 1882 | get_cache_index_at_bcp(index, 1, sizeof(u4)); |
1882 | 1883 | // Get address of invokedynamic array |
1883 | 1884 | ldr(cache, Address(rcpool, in_bytes(ConstantPoolCache::invokedynamic_entries_offset()))); |
1884 | | - // Scale the index to be the entry index * sizeof(ResolvedInvokeDynamicInfo) |
| 1885 | + // Scale the index to be the entry index * sizeof(ResolvedIndyEntry) |
1885 | 1886 | lsl(index, index, log2i_exact(sizeof(ResolvedIndyEntry))); |
1886 | 1887 | add(cache, cache, Array<ResolvedIndyEntry>::base_offset_in_bytes()); |
1887 | 1888 | lea(cache, Address(cache, index)); |
1888 | 1889 | } |
| 1890 | + |
| 1891 | +void InterpreterMacroAssembler::load_field_entry(Register cache, Register index, int bcp_offset) { |
| 1892 | + // Get index out of bytecode pointer |
| 1893 | + get_cache_index_at_bcp(index, bcp_offset, sizeof(u2)); |
| 1894 | + // Take shortcut if the size is a power of 2 |
| 1895 | + if (is_power_of_2(sizeof(ResolvedFieldEntry))) { |
| 1896 | + lsl(index, index, log2i_exact(sizeof(ResolvedFieldEntry))); // Scale index by power of 2 |
| 1897 | + } else { |
| 1898 | + mov(cache, sizeof(ResolvedFieldEntry)); |
| 1899 | + mul(index, index, cache); // Scale the index to be the entry index * sizeof(ResolvedFieldEntry) |
| 1900 | + } |
| 1901 | + // Get address of field entries array |
| 1902 | + ldr(cache, Address(rcpool, ConstantPoolCache::field_entries_offset())); |
| 1903 | + add(cache, cache, Array<ResolvedFieldEntry>::base_offset_in_bytes()); |
| 1904 | + lea(cache, Address(cache, index)); |
| 1905 | +} |
0 commit comments