-
Type:
Enhancement
-
Resolution: Unresolved
-
Priority:
P4
-
None
-
Affects Version/s: None
-
Component/s: hotspot
'pp' is currently not able to handle compressed oops. This should fix it:
diff --git a/src/hotspot/share/utilities/debug.cpp b/src/hotspot/share/utilities/debug.cpp
index de39fe32dc1..6bcde1d7d9e 100644
--- a/src/hotspot/share/utilities/debug.cpp
+++ b/src/hotspot/share/utilities/debug.cpp
@@ -426,6 +426,22 @@ extern "C" DEBUGEXPORT void pp(void* p) {
oop obj = cast_to_oop(p);
obj->print();
} else {
+
+ // Compressed oop needs to be decoded first.
+#ifdef _LP64
+ if (UseCompressedOops && ((uintptr_t)p &~ (uintptr_t)max_juint) == 0) {
+ narrowOop narrow_oop = CompressedOops::narrow_oop_cast((uintptr_t)p);
+ oop o = CompressedOops::decode_raw(narrow_oop);
+
+ if (Universe::heap()->is_in(o)) {
+ tty->print(UINT32_FORMAT " is a compressed pointer to object: ",
+ CompressedOops::narrow_oop_value(narrow_oop));
+ o->print();
+ return;
+ }
+ }
+#endif
diff --git a/src/hotspot/share/utilities/debug.cpp b/src/hotspot/share/utilities/debug.cpp
index de39fe32dc1..6bcde1d7d9e 100644
--- a/src/hotspot/share/utilities/debug.cpp
+++ b/src/hotspot/share/utilities/debug.cpp
@@ -426,6 +426,22 @@ extern "C" DEBUGEXPORT void pp(void* p) {
oop obj = cast_to_oop(p);
obj->print();
} else {
+
+ // Compressed oop needs to be decoded first.
+#ifdef _LP64
+ if (UseCompressedOops && ((uintptr_t)p &~ (uintptr_t)max_juint) == 0) {
+ narrowOop narrow_oop = CompressedOops::narrow_oop_cast((uintptr_t)p);
+ oop o = CompressedOops::decode_raw(narrow_oop);
+
+ if (Universe::heap()->is_in(o)) {
+ tty->print(UINT32_FORMAT " is a compressed pointer to object: ",
+ CompressedOops::narrow_oop_value(narrow_oop));
+ o->print();
+ return;
+ }
+ }
+#endif
- links to
-
Review(master)
openjdk/jdk/29280