Skip to content

Commit 2396e95

Browse files
author
duke
committed
Backport 72663695da9a51c8eefbd496f14a6d1625ad7b42
1 parent 38baaa9 commit 2396e95

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/hotspot/cpu/riscv/javaFrameAnchor_riscv.hpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,23 @@
3939
// 3 - restoring an old state (javaCalls)
4040

4141
void clear(void) {
42+
// No hardware barriers are necessary. All members are volatile and the profiler
43+
// is run from a signal handler and the only observer is the thread its running on.
44+
4245
// clearing _last_Java_sp must be first
4346
_last_Java_sp = nullptr;
44-
OrderAccess::release();
4547
_last_Java_fp = nullptr;
4648
_last_Java_pc = nullptr;
4749
}
4850

4951
void copy(JavaFrameAnchor* src) {
50-
// In order to make sure the transition state is valid for "this"
52+
// No hardware barriers are necessary. All members are volatile and the profiler
53+
// is run from a signal handler and the only observer is the thread its running on.
54+
5155
// We must clear _last_Java_sp before copying the rest of the new data
52-
//
53-
// Hack Alert: Temporary bugfix for 4717480/4721647
54-
// To act like previous version (pd_cache_state) don't null _last_Java_sp
55-
// unless the value is changing
56-
//
5756
assert(src != nullptr, "Src should not be null.");
5857
if (_last_Java_sp != src->_last_Java_sp) {
5958
_last_Java_sp = nullptr;
60-
OrderAccess::release();
6159
}
6260
_last_Java_fp = src->_last_Java_fp;
6361
_last_Java_pc = src->_last_Java_pc;

src/hotspot/cpu/riscv/macroAssembler_riscv.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,14 @@ void MacroAssembler::set_last_Java_frame(Register last_java_sp,
244244
last_java_sp = esp;
245245
}
246246

247-
sd(last_java_sp, Address(xthread, JavaThread::last_Java_sp_offset()));
248-
249247
// last_java_fp is optional
250248
if (last_java_fp->is_valid()) {
251249
sd(last_java_fp, Address(xthread, JavaThread::last_Java_fp_offset()));
252250
}
251+
252+
// We must set sp last.
253+
sd(last_java_sp, Address(xthread, JavaThread::last_Java_sp_offset()));
254+
253255
}
254256

255257
void MacroAssembler::set_last_Java_frame(Register last_java_sp,

0 commit comments

Comments
 (0)