This commit is contained in:
Vladimir Kozlov 2009-02-17 14:30:24 -08:00
commit 681eb89b31
44 changed files with 948 additions and 188 deletions

View file

@ -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 BytesPerHeapOop;
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 @@ inline int exact_log2(intptr_t x) {
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) {