use of jdk.vm.ci.hotspot.HotSpotInstalledCode in project graal by oracle.
the class CompressedOopTest method test17.
@Test
public void test17() throws Exception {
HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("stringFormat");
installedBenchmarkCode.executeVarargs();
}
use of jdk.vm.ci.hotspot.HotSpotInstalledCode in project graal by oracle.
the class CompressedOopTest method test3.
@Test
public void test3() throws Exception {
HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("compareAndSwapTest", Object.class, Object.class, Object.class);
Object initial = new Object();
Object replacement = new Object();
AtomicReference<Object> cas = new AtomicReference<>();
Assert.assertEquals(cas.get(), null);
installedBenchmarkCode.executeVarargs(cas, null, initial);
Assert.assertEquals(cas.get(), initial);
installedBenchmarkCode.executeVarargs(cas, initial, replacement);
Assert.assertEquals(cas.get(), replacement);
}
use of jdk.vm.ci.hotspot.HotSpotInstalledCode in project graal by oracle.
the class CompressedOopTest method test.
@Test
public void test() throws Exception {
HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("fieldTest", Object.class);
Container c1 = new Container();
Assert.assertEquals(c1.b, installedBenchmarkCode.executeVarargs(c1));
}
use of jdk.vm.ci.hotspot.HotSpotInstalledCode in project graal by oracle.
the class CompressedOopTest method test13.
@Test
public void test13() throws Exception {
HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("unmodListTestByte", Object.class);
List<Byte> list = new ArrayList<>();
Byte[] array = (Byte[]) installedBenchmarkCode.executeVarargs(list);
Assert.assertTrue(list.size() == array.length);
}
use of jdk.vm.ci.hotspot.HotSpotInstalledCode in project graal by oracle.
the class CompileTheWorld method compileMethod.
/**
* Compiles a method and gathers some statistics.
*/
private void compileMethod(HotSpotResolvedJavaMethod method, int counter) {
try {
long start = System.currentTimeMillis();
long allocatedAtStart = getCurrentThreadAllocatedBytes();
int entryBCI = JVMCICompiler.INVOCATION_ENTRY_BCI;
HotSpotCompilationRequest request = new HotSpotCompilationRequest(method, entryBCI, 0L);
// For more stable CTW execution, disable use of profiling information
boolean useProfilingInfo = false;
boolean installAsDefault = false;
CompilationTask task = new CompilationTask(jvmciRuntime, compiler, request, useProfilingInfo, installAsDefault, currentOptions);
task.runCompilation();
// Invalidate the generated code so the code cache doesn't fill up
HotSpotInstalledCode installedCode = task.getInstalledCode();
if (installedCode != null) {
installedCode.invalidate();
}
memoryUsed.getAndAdd(getCurrentThreadAllocatedBytes() - allocatedAtStart);
compileTime.getAndAdd(System.currentTimeMillis() - start);
compiledMethodsCounter.incrementAndGet();
} catch (Throwable t) {
// Catch everything and print a message
println("CompileTheWorld (%d) : Error compiling method: %s", counter, method.format("%H.%n(%p):%r"));
printStackTrace(t);
}
}
Aggregations