Skip to content

Commit 86783b9

Browse files
Matias Saavedra SilvazifeihanDingliZhangTheRealMDoerr
committed
8301996: Move field resolution information out of the cpCache
Co-authored-by: Gui Cao <gcao@openjdk.org> Co-authored-by: Dingli Zhang <dzhang@openjdk.org> Co-authored-by: Martin Doerr <mdoerr@openjdk.org> Reviewed-by: coleenp, fparain
1 parent 5362ec9 commit 86783b9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1283
-546
lines changed

src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "oops/markWord.hpp"
3737
#include "oops/method.hpp"
3838
#include "oops/methodData.hpp"
39+
#include "oops/resolvedFieldEntry.hpp"
3940
#include "oops/resolvedIndyEntry.hpp"
4041
#include "prims/jvmtiExport.hpp"
4142
#include "prims/jvmtiThreadState.hpp"
@@ -1881,8 +1882,24 @@ void InterpreterMacroAssembler::load_resolved_indy_entry(Register cache, Registe
18811882
get_cache_index_at_bcp(index, 1, sizeof(u4));
18821883
// Get address of invokedynamic array
18831884
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)
18851886
lsl(index, index, log2i_exact(sizeof(ResolvedIndyEntry)));
18861887
add(cache, cache, Array<ResolvedIndyEntry>::base_offset_in_bytes());
18871888
lea(cache, Address(cache, index));
18881889
}
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+
}

src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ class InterpreterMacroAssembler: public MacroAssembler {
321321
}
322322

323323
void load_resolved_indy_entry(Register cache, Register index);
324+
void load_field_entry(Register cache, Register index, int bcp_offset = 1);
324325
};
325326

326327
#endif // CPU_AARCH64_INTERP_MASM_AARCH64_HPP

0 commit comments

Comments
 (0)