use of jdk.vm.ci.hotspot.HotSpotInstalledCode in project graal by oracle.
the class CompressedOopTest method test6.
@Test
public void test6() throws Exception {
HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("stringCopyTest", Object.class, Object.class);
String a = new String("Test ");
String b = new String("String");
String c = (String) installedBenchmarkCode.executeVarargs(a, b);
Assert.assertTrue(c.equals("Test String"));
}
use of jdk.vm.ci.hotspot.HotSpotInstalledCode in project graal by oracle.
the class CompressedOopTest method test1.
@Test
public void test1() throws Exception {
HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("arrayTest", Object.class, Object.class, Object.class);
ArrayContainer ac = new ArrayContainer();
Assert.assertEquals(ac.a[9], installedBenchmarkCode.executeVarargs(ac.a, 0, 9));
Assert.assertEquals(ac.a[8], installedBenchmarkCode.executeVarargs(ac.a, 1, 8));
Assert.assertEquals(ac.a[7], installedBenchmarkCode.executeVarargs(ac.a, 2, 7));
Assert.assertEquals(ac.a[6], installedBenchmarkCode.executeVarargs(ac.a, 3, 6));
Assert.assertEquals(ac.a[5], installedBenchmarkCode.executeVarargs(ac.a, 4, 5));
Assert.assertEquals(ac.a[4], installedBenchmarkCode.executeVarargs(ac.a, 5, 4));
Assert.assertEquals(ac.a[3], installedBenchmarkCode.executeVarargs(ac.a, 6, 3));
Assert.assertEquals(ac.a[2], installedBenchmarkCode.executeVarargs(ac.a, 7, 2));
Assert.assertEquals(ac.a[1], installedBenchmarkCode.executeVarargs(ac.a, 8, 1));
Assert.assertEquals(ac.a[0], installedBenchmarkCode.executeVarargs(ac.a, 9, 0));
}
use of jdk.vm.ci.hotspot.HotSpotInstalledCode in project graal by oracle.
the class InstalledCodeExecuteHelperTest method test1.
@Test
public void test1() throws InvalidInstalledCodeException {
final ResolvedJavaMethod fooMethod = getResolvedJavaMethod("foo");
final HotSpotInstalledCode fooCode = (HotSpotInstalledCode) getCode(fooMethod);
argsToBind = new Object[] { fooCode };
final ResolvedJavaMethod benchmarkMethod = getResolvedJavaMethod("benchmark");
final HotSpotInstalledCode installedBenchmarkCode = (HotSpotInstalledCode) getCode(benchmarkMethod);
Assert.assertEquals(Integer.valueOf(42), benchmark(fooCode));
Assert.assertEquals(Integer.valueOf(42), installedBenchmarkCode.executeVarargs(argsToBind[0]));
}
use of jdk.vm.ci.hotspot.HotSpotInstalledCode in project graal by oracle.
the class WriteBarrierAdditionTest method getInstalledCode.
private HotSpotInstalledCode getInstalledCode(String name, boolean withUnsafePrefix) throws Exception {
final ResolvedJavaMethod javaMethod = withUnsafePrefix ? getResolvedJavaMethod(WriteBarrierAdditionTest.class, name, Unsafe.class, Object.class, Object.class, Object.class) : getResolvedJavaMethod(WriteBarrierAdditionTest.class, name, Object.class, Object.class, Object.class);
final HotSpotInstalledCode installedCode = (HotSpotInstalledCode) getCode(javaMethod);
return installedCode;
}
Aggregations