Skip to content

Commit 3468692

Browse files
committed
8372617: Save and restore stubgen stubs when using an AOT code cache
Reviewed-by: kvn, asmehra
1 parent 52a54da commit 3468692

65 files changed

Lines changed: 5572 additions & 1065 deletions

File tree

Some content is hidden

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

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3454,7 +3454,7 @@ void MacroAssembler::subw(Register Rd, Register Rn, RegisterOrConstant decrement
34543454
void MacroAssembler::reinit_heapbase()
34553455
{
34563456
if (UseCompressedOops) {
3457-
if (Universe::is_fully_initialized()) {
3457+
if (Universe::is_fully_initialized() && !AOTCodeCache::is_on_for_dump()) {
34583458
mov(rheapbase, CompressedOops::base());
34593459
} else {
34603460
lea(rheapbase, ExternalAddress(CompressedOops::base_addr()));
@@ -5128,7 +5128,8 @@ void MacroAssembler::cmp_klass(Register obj, Register klass, Register tmp) {
51285128
if (CompressedKlassPointers::base() == nullptr) {
51295129
cmp(klass, tmp, LSL, CompressedKlassPointers::shift());
51305130
return;
5131-
} else if (((uint64_t)CompressedKlassPointers::base() & 0xffffffff) == 0
5131+
} else if (!AOTCodeCache::is_on_for_dump() &&
5132+
((uint64_t)CompressedKlassPointers::base() & 0xffffffff) == 0
51325133
&& CompressedKlassPointers::shift() == 0) {
51335134
// Only the bottom 32 bits matter
51345135
cmpw(klass, tmp);
@@ -5371,7 +5372,7 @@ void MacroAssembler::encode_klass_not_null_for_aot(Register dst, Register src) {
53715372
}
53725373

53735374
void MacroAssembler::encode_klass_not_null(Register dst, Register src) {
5374-
if (AOTCodeCache::is_on_for_dump()) {
5375+
if (CompressedKlassPointers::base() != nullptr && AOTCodeCache::is_on_for_dump()) {
53755376
encode_klass_not_null_for_aot(dst, src);
53765377
return;
53775378
}

src/hotspot/cpu/aarch64/runtime_aarch64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ ExceptionBlob* OptoRuntime::generate_exception_blob() {
290290
assert(SimpleRuntimeFrame::framesize % 4 == 0, "sp not 16-byte aligned");
291291

292292
const char* name = OptoRuntime::stub_name(StubId::c2_exception_id);
293-
CodeBlob* blob = AOTCodeCache::load_code_blob(AOTCodeEntry::C2Blob, (uint)BlobId::c2_exception_id, name);
293+
CodeBlob* blob = AOTCodeCache::load_code_blob(AOTCodeEntry::C2Blob, BlobId::c2_exception_id);
294294
if (blob != nullptr) {
295295
return blob->as_exception_blob();
296296
}

src/hotspot/cpu/aarch64/stubDeclarations_aarch64.hpp

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@
8484
do_stub(compiler, count_positives) \
8585
do_arch_entry(aarch64, compiler, count_positives, count_positives, \
8686
count_positives) \
87-
do_stub(compiler, count_positives_long) \
88-
do_arch_entry(aarch64, compiler, count_positives_long, \
87+
do_arch_entry(aarch64, compiler, count_positives, \
8988
count_positives_long, count_positives_long) \
9089
do_stub(compiler, compare_long_string_LL) \
9190
do_arch_entry(aarch64, compiler, compare_long_string_LL, \
@@ -108,8 +107,9 @@
108107
do_stub(compiler, string_indexof_linear_ul) \
109108
do_arch_entry(aarch64, compiler, string_indexof_linear_ul, \
110109
string_indexof_linear_ul, string_indexof_linear_ul) \
111-
/* this uses the entry for ghash_processBlocks */ \
112-
do_stub(compiler, ghash_processBlocks_wide) \
110+
do_stub(compiler, ghash_processBlocks_small) \
111+
do_arch_entry(aarch64, compiler, ghash_processBlocks_small, \
112+
ghash_processBlocks_small, ghash_processBlocks_small) \
113113

114114

115115
#define STUBGEN_FINAL_BLOBS_ARCH_DO(do_stub, \
@@ -139,9 +139,49 @@
139139
do_stub(final, spin_wait) \
140140
do_arch_entry_init(aarch64, final, spin_wait, spin_wait, \
141141
spin_wait, empty_spin_wait) \
142-
/* stub only -- entries are not stored in StubRoutines::aarch64 */ \
143142
/* n.b. these are not the same as the generic atomic stubs */ \
144143
do_stub(final, atomic_entry_points) \
144+
do_arch_entry(aarch64, final, atomic_entry_points, \
145+
atomic_fetch_add_4_impl, atomic_fetch_add_4_impl) \
146+
do_arch_entry(aarch64, final, atomic_entry_points, \
147+
atomic_fetch_add_8_impl, atomic_fetch_add_8_impl) \
148+
do_arch_entry(aarch64, final, atomic_entry_points, \
149+
atomic_fetch_add_4_relaxed_impl, \
150+
atomic_fetch_add_4_relaxed_impl) \
151+
do_arch_entry(aarch64, final, atomic_entry_points, \
152+
atomic_fetch_add_8_relaxed_impl, \
153+
atomic_fetch_add_8_relaxed_impl) \
154+
do_arch_entry(aarch64, final, atomic_entry_points, \
155+
atomic_xchg_4_impl, atomic_xchg_4_impl) \
156+
do_arch_entry(aarch64, final, atomic_entry_points, \
157+
atomic_xchg_8_impl, atomic_xchg_8_impl) \
158+
do_arch_entry(aarch64, final, atomic_entry_points, \
159+
atomic_cmpxchg_1_impl, atomic_cmpxchg_1_impl) \
160+
do_arch_entry(aarch64, final, atomic_entry_points, \
161+
atomic_cmpxchg_4_impl, atomic_cmpxchg_4_impl) \
162+
do_arch_entry(aarch64, final, atomic_entry_points, \
163+
atomic_cmpxchg_8_impl, atomic_cmpxchg_8_impl) \
164+
do_arch_entry(aarch64, final, atomic_entry_points, \
165+
atomic_cmpxchg_1_relaxed_impl, \
166+
atomic_cmpxchg_1_relaxed_impl) \
167+
do_arch_entry(aarch64, final, atomic_entry_points, \
168+
atomic_cmpxchg_4_relaxed_impl, \
169+
atomic_cmpxchg_4_relaxed_impl) \
170+
do_arch_entry(aarch64, final, atomic_entry_points, \
171+
atomic_cmpxchg_8_relaxed_impl, \
172+
atomic_cmpxchg_8_relaxed_impl) \
173+
do_arch_entry(aarch64, final, atomic_entry_points, \
174+
atomic_cmpxchg_4_release_impl, \
175+
atomic_cmpxchg_4_release_impl) \
176+
do_arch_entry(aarch64, final, atomic_entry_points, \
177+
atomic_cmpxchg_8_release_impl, \
178+
atomic_cmpxchg_8_release_impl) \
179+
do_arch_entry(aarch64, final, atomic_entry_points, \
180+
atomic_cmpxchg_4_seq_cst_impl, \
181+
atomic_cmpxchg_4_seq_cst_impl) \
182+
do_arch_entry(aarch64, final, atomic_entry_points, \
183+
atomic_cmpxchg_8_seq_cst_impl, \
184+
atomic_cmpxchg_8_seq_cst_impl) \
145185

146186

147187
#endif // CPU_AARCH64_STUBDECLARATIONS_HPP

0 commit comments

Comments
 (0)