Merge
This commit is contained in:
commit
cacfaec1d0
@ -200,7 +200,6 @@ class oopDesc {
|
||||
|
||||
// Access to fields in a instanceOop through these methods.
|
||||
oop obj_field(int offset) const;
|
||||
volatile oop obj_field_volatile(int offset) const;
|
||||
void obj_field_put(int offset, oop value);
|
||||
void obj_field_put_raw(int offset, oop value);
|
||||
void obj_field_put_volatile(int offset, oop value);
|
||||
|
@ -284,11 +284,7 @@ inline oop oopDesc::obj_field(int offset) const {
|
||||
load_decode_heap_oop(obj_field_addr<narrowOop>(offset)) :
|
||||
load_decode_heap_oop(obj_field_addr<oop>(offset));
|
||||
}
|
||||
inline volatile oop oopDesc::obj_field_volatile(int offset) const {
|
||||
volatile oop value = obj_field(offset);
|
||||
OrderAccess::acquire();
|
||||
return value;
|
||||
}
|
||||
|
||||
inline void oopDesc::obj_field_put(int offset, oop value) {
|
||||
UseCompressedOops ? oop_store(obj_field_addr<narrowOop>(offset), value) :
|
||||
oop_store(obj_field_addr<oop>(offset), value);
|
||||
|
@ -94,29 +94,47 @@ public class TestLargePageUseForAuxMemory {
|
||||
output.shouldHaveExitValue(0);
|
||||
}
|
||||
|
||||
private static long gcd(long x, long y) {
|
||||
while (x > 0) {
|
||||
long t = x;
|
||||
x = y % x;
|
||||
y = t;
|
||||
}
|
||||
return y;
|
||||
}
|
||||
|
||||
private static long lcm(long x, long y) {
|
||||
return x * (y / gcd(x, y));
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
if (!Platform.isDebugBuild()) {
|
||||
System.out.println("Skip tests on non-debug builds because the required option TracePageSizes is a debug-only option.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Size that a single card covers.
|
||||
final int cardSize = 512;
|
||||
WhiteBox wb = WhiteBox.getWhiteBox();
|
||||
smallPageSize = wb.getVMPageSize();
|
||||
largePageSize = wb.getVMLargePageSize();
|
||||
allocGranularity = wb.getVMAllocationGranularity();
|
||||
final long heapAlignment = lcm(cardSize * smallPageSize, largePageSize);
|
||||
|
||||
if (largePageSize == 0) {
|
||||
System.out.println("Skip tests because large page support does not seem to be available on this platform.");
|
||||
return;
|
||||
}
|
||||
if (largePageSize == smallPageSize) {
|
||||
System.out.println("Skip tests because large page support does not seem to be available on this platform." +
|
||||
"Small and large page size are the same.");
|
||||
return;
|
||||
}
|
||||
|
||||
// To get large pages for the card table etc. we need at least a 1G heap (with 4k page size).
|
||||
// 32 bit systems will have problems reserving such an amount of contiguous space, so skip the
|
||||
// test there.
|
||||
if (!Platform.is32bit()) {
|
||||
// Size that a single card covers.
|
||||
final int cardSize = 512;
|
||||
|
||||
final long heapSizeForCardTableUsingLargePages = largePageSize * cardSize;
|
||||
final long heapSizeDiffForCardTable = Math.max(Math.max(allocGranularity * cardSize, HEAP_REGION_SIZE), largePageSize);
|
||||
|
||||
@ -131,7 +149,8 @@ public class TestLargePageUseForAuxMemory {
|
||||
// everywhere.
|
||||
final int bitmapTranslationFactor = 8 * 8; // ObjectAlignmentInBytes * BitsPerByte
|
||||
final long heapSizeForBitmapUsingLargePages = largePageSize * bitmapTranslationFactor;
|
||||
final long heapSizeDiffForBitmap = Math.max(Math.max(allocGranularity * bitmapTranslationFactor, HEAP_REGION_SIZE), largePageSize);
|
||||
final long heapSizeDiffForBitmap = Math.max(Math.max(allocGranularity * bitmapTranslationFactor, HEAP_REGION_SIZE),
|
||||
Math.max(largePageSize, heapAlignment));
|
||||
|
||||
Asserts.assertGT(heapSizeForBitmapUsingLargePages, heapSizeDiffForBitmap,
|
||||
"To test we would require to use an invalid heap size");
|
||||
|
Loading…
x
Reference in New Issue
Block a user