< prev index next >

src/hotspot/share/utilities/globalDefinitions.hpp

Print this page


1244 JAVA_INTEGER_OP(-, java_subtract, jlong, julong)
1245 JAVA_INTEGER_OP(*, java_multiply, jlong, julong)
1246 
1247 #undef JAVA_INTEGER_OP
1248 
1249 // Dereference vptr
1250 // All C++ compilers that we know of have the vtbl pointer in the first
1251 // word.  If there are exceptions, this function needs to be made compiler
1252 // specific.
1253 static inline void* dereference_vptr(const void* addr) {
1254   return *(void**)addr;
1255 }
1256 
1257 //----------------------------------------------------------------------------------------------------
1258 // String type aliases used by command line flag declarations and
1259 // processing utilities.
1260 
1261 typedef const char* ccstr;
1262 typedef const char* ccstrlist;   // represents string arguments which accumulate
1263 













1264 #endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP


1244 JAVA_INTEGER_OP(-, java_subtract, jlong, julong)
1245 JAVA_INTEGER_OP(*, java_multiply, jlong, julong)
1246 
1247 #undef JAVA_INTEGER_OP
1248 
1249 // Dereference vptr
1250 // All C++ compilers that we know of have the vtbl pointer in the first
1251 // word.  If there are exceptions, this function needs to be made compiler
1252 // specific.
1253 static inline void* dereference_vptr(const void* addr) {
1254   return *(void**)addr;
1255 }
1256 
1257 //----------------------------------------------------------------------------------------------------
1258 // String type aliases used by command line flag declarations and
1259 // processing utilities.
1260 
1261 typedef const char* ccstr;
1262 typedef const char* ccstrlist;   // represents string arguments which accumulate
1263 
1264 //----------------------------------------------------------------------------------------------------
1265 // Default hash/equals functions used by ResourceHashtable and KVHashtable
1266 
1267 template<typename K> unsigned primitive_hash(const K& k) {
1268   unsigned hash = (unsigned)((uintptr_t)k);
1269   return hash ^ (hash >> 3); // just in case we're dealing with aligned ptrs
1270 }
1271 
1272 template<typename K> bool primitive_equals(const K& k0, const K& k1) {
1273   return k0 == k1;
1274 }
1275 
1276 
1277 #endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP
< prev index next >