代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/openjdk-21 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Subject: Backport of JDK-8333354 ubsan: frame.inline.hpp:91:25: and src/hotspot/share/runtime/frame.inline.hpp:88:29: runtime error: member call on null pointer of type 'const struct SmallRegisterMap'
---
.../smallRegisterMap_aarch64.inline.hpp | 20 +++++++----------
.../cpu/arm/smallRegisterMap_arm.inline.hpp | 15 +++++++------
.../cpu/ppc/smallRegisterMap_ppc.inline.hpp | 22 +++++++------------
.../riscv/smallRegisterMap_riscv.inline.hpp | 20 +++++++----------
.../cpu/s390/smallRegisterMap_s390.inline.hpp | 15 +++++++------
.../cpu/x86/smallRegisterMap_x86.inline.hpp | 19 ++++++----------
.../cpu/zero/smallRegisterMap_zero.inline.hpp | 15 +++++++------
src/hotspot/share/oops/stackChunkOop.cpp | 2 +-
.../share/oops/stackChunkOop.inline.hpp | 2 +-
.../share/runtime/continuationFreezeThaw.cpp | 14 ++++++------
10 files changed, 64 insertions(+), 80 deletions(-)
diff --git a/src/hotspot/cpu/aarch64/smallRegisterMap_aarch64.inline.hpp b/src/hotspot/cpu/aarch64/smallRegisterMap_aarch64.inline.hpp
index db38b9cf5..dcba233c9 100644
--- a/src/hotspot/cpu/aarch64/smallRegisterMap_aarch64.inline.hpp
+++ b/src/hotspot/cpu/aarch64/smallRegisterMap_aarch64.inline.hpp
@@ -30,8 +30,15 @@
// Java frames don't have callee saved registers (except for rfp), so we can use a smaller RegisterMap
class SmallRegisterMap {
+ constexpr SmallRegisterMap() = default;
+ ~SmallRegisterMap() = default;
+ NONCOPYABLE(SmallRegisterMap);
+
public:
- static constexpr SmallRegisterMap* instance = nullptr;
+ static const SmallRegisterMap* instance() {
+ static constexpr SmallRegisterMap the_instance{};
+ return &the_instance;
+ }
private:
static void assert_is_rfp(VMReg r) NOT_DEBUG_RETURN
DEBUG_ONLY({ assert (r == rfp->as_VMReg() || r == rfp->as_VMReg()->next(), "Reg: %s", r->name()); })
@@ -48,17 +55,6 @@ public:
return map;
}
- SmallRegisterMap() {}
-
- SmallRegisterMap(const RegisterMap* map) {
- #ifdef ASSERT
- for(int i = 0; i < RegisterMap::reg_count; i++) {
- VMReg r = VMRegImpl::as_VMReg(i);
- if (map->location(r, (intptr_t*)nullptr) != nullptr) assert_is_rfp(r);
- }
- #endif
- }
-
inline address location(VMReg reg, intptr_t* sp) const {
assert_is_rfp(reg);
return (address)(sp - frame::sender_sp_offset);
diff --git a/src/hotspot/cpu/arm/smallRegisterMap_arm.inline.hpp b/src/hotspot/cpu/arm/smallRegisterMap_arm.inline.hpp
index 4186eafd3..08adbbd89 100644
--- a/src/hotspot/cpu/arm/smallRegisterMap_arm.inline.hpp
+++ b/src/hotspot/cpu/arm/smallRegisterMap_arm.inline.hpp
@@ -30,8 +30,15 @@
// Java frames don't have callee saved registers (except for rfp), so we can use a smaller RegisterMap
class SmallRegisterMap {
+ constexpr SmallRegisterMap() = default;
+ ~SmallRegisterMap() = default;
+ NONCOPYABLE(SmallRegisterMap);
+
public:
- static constexpr SmallRegisterMap* instance = nullptr;
+ static const SmallRegisterMap* instance() {
+ static constexpr SmallRegisterMap the_instance{};
+ return &the_instance;
+ }
private:
static void assert_is_rfp(VMReg r) NOT_DEBUG_RETURN
DEBUG_ONLY({ Unimplemented(); })
@@ -46,12 +53,6 @@ public:
return map;
}
- SmallRegisterMap() {}
-
- SmallRegisterMap(const RegisterMap* map) {
- Unimplemented();
- }
-
inline address location(VMReg reg, intptr_t* sp) const {
Unimplemented();
return nullptr;
diff --git a/src/hotspot/cpu/ppc/smallRegisterMap_ppc.inline.hpp b/src/hotspot/cpu/ppc/smallRegisterMap_ppc.inline.hpp
index 8c96f51fd..3b143839c 100644
--- a/src/hotspot/cpu/ppc/smallRegisterMap_ppc.inline.hpp
+++ b/src/hotspot/cpu/ppc/smallRegisterMap_ppc.inline.hpp
@@ -30,8 +30,15 @@
// Java frames don't have callee saved registers, so we can use a smaller RegisterMap
class SmallRegisterMap {
+ constexpr SmallRegisterMap() = default;
+ ~SmallRegisterMap() = default;
+ NONCOPYABLE(SmallRegisterMap);
+
public:
- static constexpr SmallRegisterMap* instance = nullptr;
+ static const SmallRegisterMap* instance() {
+ static constexpr SmallRegisterMap the_instance{};
+ return &the_instance;
+ }
public:
// as_RegisterMap is used when we didn't want to templatize and abstract over RegisterMap type to support SmallRegisterMap
// Consider enhancing SmallRegisterMap to support those cases
@@ -44,19 +51,6 @@ public:
return map;
}
- SmallRegisterMap() {}
-
- SmallRegisterMap(const RegisterMap* map) {
-#ifdef ASSERT
- for(int i = 0; i < RegisterMap::reg_count; i++) {
- VMReg r = VMRegImpl::as_VMReg(i);
- if (map->location(r, (intptr_t*)nullptr) != nullptr) {
- assert(false, "Reg: %s", r->name()); // Should not reach here
- }
- }
-#endif
- }
-
inline address location(VMReg reg, intptr_t* sp) const {
assert(false, "Reg: %s", reg->name());
return nullptr;
diff --git a/src/hotspot/cpu/riscv/smallRegisterMap_riscv.inline.hpp b/src/hotspot/cpu/riscv/smallRegisterMap_riscv.inline.hpp
index 93adaadce..9fc4f1d7b 100644
--- a/src/hotspot/cpu/riscv/smallRegisterMap_riscv.inline.hpp
+++ b/src/hotspot/cpu/riscv/smallRegisterMap_riscv.inline.hpp
@@ -30,8 +30,15 @@
// Java frames don't have callee saved registers (except for fp), so we can use a smaller RegisterMap
class SmallRegisterMap {
+ constexpr SmallRegisterMap() = default;
+ ~SmallRegisterMap() = default;
+ NONCOPYABLE(SmallRegisterMap);
+
public:
- static constexpr SmallRegisterMap* instance = nullptr;
+ static const SmallRegisterMap* instance() {
+ static constexpr SmallRegisterMap the_instance{};
+ return &the_instance;
+ }
private:
static void assert_is_fp(VMReg r) NOT_DEBUG_RETURN
DEBUG_ONLY({ assert (r == fp->as_VMReg() || r == fp->as_VMReg()->next(), "Reg: %s", r->name()); })
@@ -48,17 +55,6 @@ public:
return map;
}
- SmallRegisterMap() {}
-
- SmallRegisterMap(const RegisterMap* map) {
- #ifdef ASSERT
- for(int i = 0; i < RegisterMap::reg_count; i++) {
- VMReg r = VMRegImpl::as_VMReg(i);
- if (map->location(r, (intptr_t*)nullptr) != nullptr) assert_is_fp(r);
- }
- #endif
- }
-
inline address location(VMReg reg, intptr_t* sp) const {
assert_is_fp(reg);
return (address)(sp - 2);
diff --git a/src/hotspot/cpu/s390/smallRegisterMap_s390.inline.hpp b/src/hotspot/cpu/s390/smallRegisterMap_s390.inline.hpp
index 8c74eb7dd..625d17cf9 100644
--- a/src/hotspot/cpu/s390/smallRegisterMap_s390.inline.hpp
+++ b/src/hotspot/cpu/s390/smallRegisterMap_s390.inline.hpp
@@ -30,8 +30,15 @@
// Java frames don't have callee saved registers (except for rfp), so we can use a smaller RegisterMap
class SmallRegisterMap {
+ constexpr SmallRegisterMap() = default;
+ ~SmallRegisterMap() = default;
+ NONCOPYABLE(SmallRegisterMap);
+
public:
- static constexpr SmallRegisterMap* instance = nullptr;
+ static const SmallRegisterMap* instance() {
+ static constexpr SmallRegisterMap the_instance{};
+ return &the_instance;
+ }
private:
static void assert_is_rfp(VMReg r) NOT_DEBUG_RETURN
DEBUG_ONLY({ Unimplemented(); })
@@ -46,12 +53,6 @@ public:
return map;
}
- SmallRegisterMap() {}
-
- SmallRegisterMap(const RegisterMap* map) {
- Unimplemented();
- }
-
inline address location(VMReg reg, intptr_t* sp) const {
Unimplemented();
return nullptr;
diff --git a/src/hotspot/cpu/x86/smallRegisterMap_x86.inline.hpp b/src/hotspot/cpu/x86/smallRegisterMap_x86.inline.hpp
index 5f21939a3..ca2f8ea1a 100644
--- a/src/hotspot/cpu/x86/smallRegisterMap_x86.inline.hpp
+++ b/src/hotspot/cpu/x86/smallRegisterMap_x86.inline.hpp
@@ -30,8 +30,14 @@
// Java frames don't have callee saved registers (except for rbp), so we can use a smaller RegisterMap
class SmallRegisterMap {
+ constexpr SmallRegisterMap() = default;
+ ~SmallRegisterMap() = default;
+ NONCOPYABLE(SmallRegisterMap);
public:
- static constexpr SmallRegisterMap* instance = nullptr;
+ static const SmallRegisterMap* instance() {
+ static constexpr SmallRegisterMap the_instance{};
+ return &the_instance;
+ }
private:
static void assert_is_rbp(VMReg r) NOT_DEBUG_RETURN
DEBUG_ONLY({ assert(r == rbp->as_VMReg() || r == rbp->as_VMReg()->next(), "Reg: %s", r->name()); })
@@ -48,17 +54,6 @@ public:
return map;
}
- SmallRegisterMap() {}
-
- SmallRegisterMap(const RegisterMap* map) {
- #ifdef ASSERT
- for(int i = 0; i < RegisterMap::reg_count; i++) {
- VMReg r = VMRegImpl::as_VMReg(i);
- if (map->location(r, (intptr_t*)nullptr) != nullptr) assert_is_rbp(r);
- }
- #endif
- }
-
inline address location(VMReg reg, intptr_t* sp) const {
assert_is_rbp(reg);
return (address)(sp - frame::sender_sp_offset);
diff --git a/src/hotspot/cpu/zero/smallRegisterMap_zero.inline.hpp b/src/hotspot/cpu/zero/smallRegisterMap_zero.inline.hpp
index b85ead32f..51fb114f5 100644
--- a/src/hotspot/cpu/zero/smallRegisterMap_zero.inline.hpp
+++ b/src/hotspot/cpu/zero/smallRegisterMap_zero.inline.hpp
@@ -30,8 +30,15 @@
// Java frames don't have callee saved registers (except for rfp), so we can use a smaller RegisterMap
class SmallRegisterMap {
+ constexpr SmallRegisterMap() = default;
+ ~SmallRegisterMap() = default;
+ NONCOPYABLE(SmallRegisterMap);
+
public:
- static constexpr SmallRegisterMap* instance = nullptr;
+ static const SmallRegisterMap* instance() {
+ static constexpr SmallRegisterMap the_instance{};
+ return &the_instance;
+ }
private:
static void assert_is_rfp(VMReg r) NOT_DEBUG_RETURN
DEBUG_ONLY({ Unimplemented(); })
@@ -46,12 +53,6 @@ public:
return map;
}
- SmallRegisterMap() {}
-
- SmallRegisterMap(const RegisterMap* map) {
- Unimplemented();
- }
-
inline address location(VMReg reg, intptr_t* sp) const {
Unimplemented();
return nullptr;
diff --git a/src/hotspot/share/oops/stackChunkOop.cpp b/src/hotspot/share/oops/stackChunkOop.cpp
index 4e771939d..c1fea1d44 100644
--- a/src/hotspot/share/oops/stackChunkOop.cpp
+++ b/src/hotspot/share/oops/stackChunkOop.cpp
@@ -125,7 +125,7 @@ static int num_java_frames(const StackChunkFrameStream<ChunkFrames::Mixed>& f) {
int stackChunkOopDesc::num_java_frames() const {
int n = 0;
for (StackChunkFrameStream<ChunkFrames::Mixed> f(const_cast<stackChunkOopDesc*>(this)); !f.is_done();
- f.next(SmallRegisterMap::instance)) {
+ f.next(SmallRegisterMap::instance())) {
if (!f.is_stub()) {
n += ::num_java_frames(f);
}
diff --git a/src/hotspot/share/oops/stackChunkOop.inline.hpp b/src/hotspot/share/oops/stackChunkOop.inline.hpp
index 9bde7e255..a7725f0b2 100644
--- a/src/hotspot/share/oops/stackChunkOop.inline.hpp
+++ b/src/hotspot/share/oops/stackChunkOop.inline.hpp
@@ -200,7 +200,7 @@ inline void stackChunkOopDesc::iterate_stack(StackChunkFrameClosureType* closure
template <ChunkFrames frame_kind, class StackChunkFrameClosureType>
inline void stackChunkOopDesc::iterate_stack(StackChunkFrameClosureType* closure) {
- const SmallRegisterMap* map = SmallRegisterMap::instance;
+ const SmallRegisterMap* map = SmallRegisterMap::instance();
assert(!map->in_cont(), "");
StackChunkFrameStream<frame_kind> f(this);
diff --git a/src/hotspot/share/runtime/continuationFreezeThaw.cpp b/src/hotspot/share/runtime/continuationFreezeThaw.cpp
index 0882bc933..832ff70fb 100644
--- a/src/hotspot/share/runtime/continuationFreezeThaw.cpp
+++ b/src/hotspot/share/runtime/continuationFreezeThaw.cpp
@@ -1834,7 +1834,7 @@ inline void ThawBase::clear_chunk(stackChunkOop chunk) {
const int frame_size = f.cb()->frame_size();
argsize = f.stack_argsize();
- f.next(SmallRegisterMap::instance, true /* stop */);
+ f.next(SmallRegisterMap::instance(), true /* stop */);
empty = f.is_done();
assert(!empty || argsize == chunk->argsize(), "");
@@ -2034,7 +2034,7 @@ bool ThawBase::recurse_thaw_java_frame(frame& caller, int num_frames) {
int argsize = _stream.stack_argsize();
- _stream.next(SmallRegisterMap::instance);
+ _stream.next(SmallRegisterMap::instance());
assert(_stream.to_frame().is_empty() == _stream.is_done(), "");
// we never leave a compiled caller of an interpreted frame as the top frame in the chunk
@@ -2143,7 +2143,7 @@ NOINLINE void ThawBase::recurse_thaw_interpreted_frame(const frame& hf, frame& c
assert(hf.is_interpreted_frame(), "");
if (UNLIKELY(seen_by_gc())) {
- _cont.tail()->do_barriers<stackChunkOopDesc::BarrierType::Store>(_stream, SmallRegisterMap::instance);
+ _cont.tail()->do_barriers<stackChunkOopDesc::BarrierType::Store>(_stream, SmallRegisterMap::instance());
}
const bool is_bottom_frame = recurse_thaw_java_frame<ContinuationHelper::InterpretedFrame>(caller, num_frames);
@@ -2186,7 +2186,7 @@ NOINLINE void ThawBase::recurse_thaw_interpreted_frame(const frame& hf, frame& c
if (!is_bottom_frame) {
// can only fix caller once this frame is thawed (due to callee saved regs)
- _cont.tail()->fix_thawed_frame(caller, SmallRegisterMap::instance);
+ _cont.tail()->fix_thawed_frame(caller, SmallRegisterMap::instance());
} else if (_cont.tail()->has_bitmap() && locals > 0) {
assert(hf.is_heap_frame(), "should be");
address start = (address)(heap_frame_bottom - locals);
@@ -2203,7 +2203,7 @@ void ThawBase::recurse_thaw_compiled_frame(const frame& hf, frame& caller, int n
assert(_cont.is_preempted() || !stub_caller, "stub caller not at preemption");
if (!stub_caller && UNLIKELY(seen_by_gc())) { // recurse_thaw_stub_frame already invoked our barriers with a full regmap
- _cont.tail()->do_barriers<stackChunkOopDesc::BarrierType::Store>(_stream, SmallRegisterMap::instance);
+ _cont.tail()->do_barriers<stackChunkOopDesc::BarrierType::Store>(_stream, SmallRegisterMap::instance());
}
const bool is_bottom_frame = recurse_thaw_java_frame<ContinuationHelper::CompiledFrame>(caller, num_frames);
@@ -2262,7 +2262,7 @@ void ThawBase::recurse_thaw_compiled_frame(const frame& hf, frame& caller, int n
if (!is_bottom_frame) {
// can only fix caller once this frame is thawed (due to callee saved regs); this happens on the stack
- _cont.tail()->fix_thawed_frame(caller, SmallRegisterMap::instance);
+ _cont.tail()->fix_thawed_frame(caller, SmallRegisterMap::instance());
} else if (_cont.tail()->has_bitmap() && added_argsize > 0) {
address start = (address)(heap_frame_top + ContinuationHelper::CompiledFrame::size(hf) + frame::metadata_words_at_top);
int stack_args_slots = f.cb()->as_compiled_method()->method()->num_stack_arg_slots(false /* rounded */);
@@ -2345,7 +2345,7 @@ void ThawBase::finish_thaw(frame& f) {
f.set_sp(align_down(f.sp(), frame::frame_alignment));
}
push_return_frame(f);
- chunk->fix_thawed_frame(f, SmallRegisterMap::instance); // can only fix caller after push_return_frame (due to callee saved regs)
+ chunk->fix_thawed_frame(f, SmallRegisterMap::instance()); // can only fix caller after push_return_frame (due to callee saved regs)
assert(_cont.is_empty() == _cont.last_frame().is_empty(), "");
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。