use of jdk.vm.ci.hotspot.HotSpotInstalledCode in project graal by oracle.
the class WriteBarrierAdditionTest method test2.
private void test2(final String snippet, Object... args) throws Exception {
HotSpotInstalledCode code = getInstalledCode(snippet, args[0] instanceof Unsafe);
code.executeVarargs(args);
}
use of jdk.vm.ci.hotspot.HotSpotInstalledCode in project graal by oracle.
the class CompressedOopTest method test18.
@Test
public void test18() throws Exception {
HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("stringBuilder");
StringBuilder b = (StringBuilder) installedBenchmarkCode.executeVarargs();
Assert.assertTrue(b.capacity() == 16);
Assert.assertTrue(b.length() == 0);
}
use of jdk.vm.ci.hotspot.HotSpotInstalledCode in project graal by oracle.
the class CompressedOopTest method test14.
@Test
public void test14() throws Exception {
HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("stringBuilderTest", Object.class, Object.class);
StringBuilder buffer = new StringBuilder("TestTestTestTestTestTestTest");
Assert.assertTrue(buffer.length() == 28);
String a = new String("TestTestTestTestTestTestTest");
installedBenchmarkCode.executeVarargs(buffer, a.toCharArray());
Assert.assertTrue(buffer.length() == 56);
Assert.assertTrue(buffer.toString().equals("TestTestTestTestTestTestTestTestTestTestTestTestTestTest"));
}
use of jdk.vm.ci.hotspot.HotSpotInstalledCode in project graal by oracle.
the class CompressedOopTest method test5.
@Test
public void test5() throws Exception {
HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("charContainerArrayCopyTest", Object.class, Object.class, Object.class);
StringContainer1 source1 = new StringContainer1();
StringContainer2 source2 = new StringContainer2();
char[] result = new char[source1.value.length + source2.value.length];
installedBenchmarkCode.executeVarargs(source1, source2, result);
Assert.assertArrayEquals(new char[] { 'T', 'e', 's', 't', ' ', 'S', 't', 'r', 'i', 'n', 'g' }, result);
}
use of jdk.vm.ci.hotspot.HotSpotInstalledCode in project graal by oracle.
the class CompressedOopTest method test8.
@Test
public void test8() throws Exception {
HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("unmodListTest", Object.class);
List<Object> list = new ArrayList<>();
for (int i = 0; i < 512; i++) {
list.add(new Object());
}
Object[] array = (Object[]) installedBenchmarkCode.executeVarargs(list);
Assert.assertTrue(list.size() == array.length);
int i = 0;
for (Object obj : list) {
Assert.assertTrue(obj == array[i]);
i++;
}
}
Aggregations