use of org.mmtk.harness.scheduler.MMTkThread in project JikesRVM by JikesRVM.
the class AbstractSpaceDescriptorTest method testCreateDescriptorAddressAddress.
@Test
public void testCreateDescriptorAddressAddress() throws Throwable {
Thread t = new MMTkThread() {
public void run() {
Extent chunkSize = Extent.fromLong(1L << VMLayoutConstants.LOG_BYTES_IN_CHUNK);
Extent increment = chunkSize.toWord().rshl(2).toExtent();
Extent size = chunkSize;
Address base = Address.zero().plus(chunkSize);
while (size.LE(VMLayoutConstants.MAX_SPACE_EXTENT)) {
int d = SpaceDescriptor.createDescriptor(base, base.plus(size));
for (Address addr = base; addr.LT(base.plus(size)); addr = addr.plus(increment)) {
if (VERBOSE)
System.out.printf("Testing address %s in space (%s,%s)%n", addr, base, base.plus(size));
Assert.assertTrue("addr " + addr + ", bounds(" + base + "," + base.plus(size) + ")", Space.isInSpace(d, addr));
}
Assert.assertFalse(Space.isInSpace(d, base.minus(4)));
Assert.assertFalse(Space.isInSpace(d, base.plus(size)));
size = size.plus(size);
}
}
};
runMMTkThread(t);
}
use of org.mmtk.harness.scheduler.MMTkThread in project JikesRVM by JikesRVM.
the class AbstractFragmentedMmapperTest method testEnsureMapped4.
@Test
public void testEnsureMapped4() throws Throwable {
Thread t = new MMTkThread() {
public void run() {
Mmapper m = new FragmentedMmapper();
Address base = Address.fromIntZeroExtend(0x68cfb000);
m.ensureMapped(base, 23);
for (int i = 0; i < 23; i++) {
Address page = base.plus(4096 * i);
page.loadWord();
page.plus(4095).loadWord();
}
}
};
runMMTkThread(t);
}
use of org.mmtk.harness.scheduler.MMTkThread in project JikesRVM by JikesRVM.
the class AbstractFragmentedMmapperTest method testEnsureMapped1.
@Test
public void testEnsureMapped1() throws Throwable {
Thread t = new MMTkThread() {
public void run() {
Mmapper m = new FragmentedMmapper();
Address base = Address.fromIntZeroExtend(0x40000000);
m.ensureMapped(base, 1);
base.loadWord();
}
};
runMMTkThread(t);
}
use of org.mmtk.harness.scheduler.MMTkThread in project JikesRVM by JikesRVM.
the class FreeListTests method testAlloc3.
/**
* Allocate and free units, ensuring that the allocator correctly reallocates them.
*/
@Test
public void testAlloc3() throws Throwable {
Thread t = new MMTkThread() {
public void run() {
GenericFreeList fl = createFreeList(4, 2, 32);
assertEquals(0, fl.alloc(1));
assertEquals(1, fl.alloc(1));
assertEquals(2, fl.alloc(1));
assertEquals(3, fl.alloc(1));
assertEquals(-1, fl.alloc(1));
fl.free(1);
assertEquals(1, fl.alloc(1));
fl.free(2);
assertEquals(2, fl.alloc(1));
assertEquals(-1, fl.alloc(1));
fl.free(3);
fl.free(0);
assertEquals(0, fl.alloc(1));
assertEquals(3, fl.alloc(1));
assertEquals(-1, fl.alloc(1));
}
};
runMMTkThread(t);
}
use of org.mmtk.harness.scheduler.MMTkThread in project JikesRVM by JikesRVM.
the class FreeListTests method testAlloc2.
/**
* Sequentially alloc pairs of units until the list is free.
*/
@Test
public void testAlloc2() throws Throwable {
Thread t = new MMTkThread() {
public void run() {
GenericFreeList fl = createFreeList(6, 2, 32);
assertEquals(0, fl.alloc(2));
assertEquals(2, fl.alloc(2));
assertEquals(4, fl.alloc(2));
assertEquals(-1, fl.alloc(2));
}
};
runMMTkThread(t);
}
Aggregations