8231025: Incorrect method tag offset for big endian platform
authormgronlun
Sat, 14 Sep 2019 18:45:24 +0200
changeset 58133 515fc9f6b2d6
parent 58132 caa25ab47aca
child 58134 51cd29502ea9
8231025: Incorrect method tag offset for big endian platform Reviewed-by: egahlin
src/hotspot/share/jfr/support/jfrTraceIdExtension.hpp
--- a/src/hotspot/share/jfr/support/jfrTraceIdExtension.hpp	Sat Sep 14 14:40:09 2019 +0200
+++ b/src/hotspot/share/jfr/support/jfrTraceIdExtension.hpp	Sat Sep 14 18:45:24 2019 +0200
@@ -26,6 +26,7 @@
 #define SHARE_JFR_SUPPORT_JFRTRACEIDEXTENSION_HPP
 
 #include "jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp"
+#include "utilities/macros.hpp"
 
 #define DEFINE_TRACE_ID_FIELD mutable traceid _trace_id
 
@@ -59,10 +60,19 @@
   }
 
   jbyte* flags_addr() const {
+#ifdef VM_LITTLE_ENDIAN
     return (jbyte*)&_flags;
+#else
+    return ((jbyte*)&_flags) + 1;
+#endif
   }
+
   jbyte* meta_addr() const {
-    return ((jbyte*)&_flags) + 1;
+#ifdef VM_LITTLE_ENDIAN
+    return (jbyte*)(&_flags) + 1;
+#else
+    return (jbyte*)&_flags;
+#endif
   }
 };