aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonis <unknown>2019-11-07 17:56:14 -0500
committerbell-sw <liberica@bell-sw.com>2020-01-19 09:12:35 +0300
commit8237be7969cd881548e0eaede99a0676f556bba7 (patch)
tree30f64a0e369f0181a0a4b6072604497deba527cc
parent2c090ea66cc9072cce0753e2f71bae52da60a3d5 (diff)
downloadjdk8u_hotspot-8237be7969cd881548e0eaede99a0676f556bba7.tar.gz
8206173: MallocSiteTable::initialize() doesn't take function descriptors into account
Reviewed-by: stuefe, zgu
-rw-r--r--src/share/vm/services/mallocSiteTable.cpp12
-rw-r--r--src/share/vm/utilities/macros.hpp8
2 files changed, 17 insertions, 3 deletions
diff --git a/src/share/vm/services/mallocSiteTable.cpp b/src/share/vm/services/mallocSiteTable.cpp
index 6a948dca2..cb80b3e18 100644
--- a/src/share/vm/services/mallocSiteTable.cpp
+++ b/src/share/vm/services/mallocSiteTable.cpp
@@ -84,12 +84,18 @@ bool MallocSiteTable::initialize() {
// Create pseudo call stack for hashtable entry allocation
address pc[3];
if (NMT_TrackingStackDepth >= 3) {
- pc[2] = (address)MallocSiteTable::allocation_at;
+ uintx *fp = (uintx*)MallocSiteTable::allocation_at;
+ // On ppc64, 'fp' is a pointer to a function descriptor which is a struct of
+ // three native pointers where the first pointer is the real function address.
+ // See: http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html#FUNC-DES
+ pc[2] = (address)(fp PPC64_ONLY(BIG_ENDIAN_ONLY([0])));
}
if (NMT_TrackingStackDepth >= 2) {
- pc[1] = (address)MallocSiteTable::lookup_or_add;
+ uintx *fp = (uintx*)MallocSiteTable::lookup_or_add;
+ pc[1] = (address)(fp PPC64_ONLY(BIG_ENDIAN_ONLY([0])));
}
- pc[0] = (address)MallocSiteTable::new_entry;
+ uintx *fp = (uintx*)MallocSiteTable::new_entry;
+ pc[0] = (address)(fp PPC64_ONLY(BIG_ENDIAN_ONLY([0])));
// Instantiate NativeCallStack object, have to use placement new operator. (see comments above)
NativeCallStack* stack = ::new ((void*)_hash_entry_allocation_stack)
diff --git a/src/share/vm/utilities/macros.hpp b/src/share/vm/utilities/macros.hpp
index da206d398..1f1c4df2a 100644
--- a/src/share/vm/utilities/macros.hpp
+++ b/src/share/vm/utilities/macros.hpp
@@ -416,6 +416,14 @@
#define NOT_EMBEDDED(code) code
#endif
+#ifdef VM_LITTLE_ENDIAN
+#define LITTLE_ENDIAN_ONLY(code) code
+#define BIG_ENDIAN_ONLY(code)
+#else
+#define LITTLE_ENDIAN_ONLY(code)
+#define BIG_ENDIAN_ONLY(code) code
+#endif
+
#define define_pd_global(type, name, value) const type pd_##name = value;
#endif // SHARE_VM_UTILITIES_MACROS_HPP