aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/utilities/globalDefinitions.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/share/vm/utilities/globalDefinitions.hpp')
-rw-r--r--src/share/vm/utilities/globalDefinitions.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/share/vm/utilities/globalDefinitions.hpp b/src/share/vm/utilities/globalDefinitions.hpp
index 9c51c1d58..e00be9032 100644
--- a/src/share/vm/utilities/globalDefinitions.hpp
+++ b/src/share/vm/utilities/globalDefinitions.hpp
@@ -1280,4 +1280,12 @@ inline int build_int_from_shorts( jushort low, jushort high ) {
#define ARRAY_SIZE(array) (sizeof(array)/sizeof((array)[0]))
+// Dereference vptr
+// All C++ compilers that we know of have the vtbl pointer in the first
+// word. If there are exceptions, this function needs to be made compiler
+// specific.
+static inline void* dereference_vptr(void* addr) {
+ return *(void**)addr;
+}
+
#endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP