use of jdk.vm.ci.hotspot.HotSpotInstalledCode in project graal by oracle.
the class CompressedOopTest method getInstalledCode.
private HotSpotInstalledCode getInstalledCode(String name, Class<?>... parameterTypes) throws Exception {
final ResolvedJavaMethod javaMethod = getResolvedJavaMethod(getClass(), name, parameterTypes);
final HotSpotInstalledCode installedBenchmarkCode = (HotSpotInstalledCode) getCode(javaMethod);
return installedBenchmarkCode;
}
use of jdk.vm.ci.hotspot.HotSpotInstalledCode in project graal by oracle.
the class CompressedOopTest method test9.
@Test
public void test9() throws Exception {
HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("unmodListTest", Object.class);
List<Object> list = new ArrayList<>();
Object[] array = (Object[]) installedBenchmarkCode.executeVarargs(list);
Assert.assertTrue(list.size() == array.length);
}
use of jdk.vm.ci.hotspot.HotSpotInstalledCode in project graal by oracle.
the class CompressedOopTest method test7.
@Test
public void test7() throws Exception {
HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("queueTest", Object.class, Object.class);
ArrayDeque<Object> q = new ArrayDeque<>();
Object[] objects = new Object[512];
for (int i = 0; i < objects.length; i++) {
objects[i] = new Object();
}
int j = 0;
while (j < objects.length) {
if (!installedBenchmarkCode.isValid()) {
// This can get invalidated due to lack of MDO update
installedBenchmarkCode = getInstalledCode("queueTest", Object.class, Object.class);
}
installedBenchmarkCode.executeVarargs(q, objects[j]);
j++;
}
System.gc();
Assert.assertTrue(q.size() == objects.length);
Assert.assertTrue(!q.isEmpty());
j = 0;
while (j < objects.length) {
Assert.assertTrue(objects[j] == q.remove());
j++;
}
Assert.assertTrue(q.size() == 0);
Assert.assertTrue(q.isEmpty());
}
use of jdk.vm.ci.hotspot.HotSpotInstalledCode in project graal by oracle.
the class CompressedOopTest method test16.
@Test
public void test16() throws Exception {
HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("stringBuilderArrayCopy");
installedBenchmarkCode.executeVarargs();
}
use of jdk.vm.ci.hotspot.HotSpotInstalledCode in project graal by oracle.
the class CompressedOopTest method test4.
@Test
public void test4() throws Exception {
HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("charArrayCopyTest", 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.value, source2.value, result);
Assert.assertArrayEquals(new char[] { 'T', 'e', 's', 't', ' ', 'S', 't', 'r', 'i', 'n', 'g' }, result);
}
Aggregations