--- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp Tue Feb 10 18:39:09 2009 +0300
+++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp Tue Feb 17 14:30:24 2009 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -74,6 +74,7 @@
extern int BitsPerHeapOop;
const int BitsPerJavaInteger = 32;
+const int BitsPerJavaLong = 64;
const int BitsPerSize_t = size_tSize * BitsPerByte;
// Size of a char[] needed to represent a jint as a string in decimal.
@@ -906,6 +907,14 @@
return log2_intptr(x);
}
+//* the argument must be exactly a power of 2
+inline int exact_log2_long(jlong x) {
+ #ifdef ASSERT
+ if (!is_power_of_2_long(x)) basic_fatal("x must be a power of 2");
+ #endif
+ return log2_long(x);
+}
+
// returns integer round-up to the nearest multiple of s (s must be a power of two)
inline intptr_t round_to(intptr_t x, uintx s) {