1.1 --- a/src/share/vm/utilities/globalDefinitions.hpp Wed Nov 28 08:43:26 2012 -0800 1.2 +++ b/src/share/vm/utilities/globalDefinitions.hpp Wed Nov 28 17:50:21 2012 -0500 1.3 @@ -1280,4 +1280,12 @@ 1.4 1.5 #define ARRAY_SIZE(array) (sizeof(array)/sizeof((array)[0])) 1.6 1.7 +// Dereference vptr 1.8 +// All C++ compilers that we know of have the vtbl pointer in the first 1.9 +// word. If there are exceptions, this function needs to be made compiler 1.10 +// specific. 1.11 +static inline void* dereference_vptr(void* addr) { 1.12 + return *(void**)addr; 1.13 +} 1.14 + 1.15 #endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP