src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTestBase.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTestBase.java Fri Jul 7 09:30:06 2017
--- new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTestBase.java Fri Jul 7 09:30:06 2017
*** 29,44 ****
--- 29,46 ----
import org.graalvm.compiler.bytecode.BytecodeDisassembler;
import org.graalvm.compiler.bytecode.BytecodeStream;
import org.graalvm.compiler.bytecode.ResolvedJavaMethodBytecode;
import org.graalvm.compiler.core.target.Backend;
import org.graalvm.compiler.core.test.GraalCompilerTest;
+ import org.graalvm.compiler.debug.DebugContext;
import org.graalvm.compiler.debug.GraalError;
import org.graalvm.compiler.debug.TTY;
import org.graalvm.compiler.hotspot.CompilationTask;
import org.graalvm.compiler.hotspot.HotSpotGraalCompiler;
import org.graalvm.compiler.java.BciBlockMapping;
import org.graalvm.compiler.java.BciBlockMapping.BciBlock;
+ import org.graalvm.compiler.nodes.StructuredGraph;
import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
import org.graalvm.compiler.options.OptionValues;
import org.junit.Assert;
import jdk.vm.ci.code.Architecture;
*** 66,95 ****
--- 68,98 ----
compileOSR(options, method);
Result result = executeExpected(method, receiver, args);
checkResult(result);
}
! protected static void compile(OptionValues options, ResolvedJavaMethod method, int bci) {
! protected static void compile(DebugContext debug, ResolvedJavaMethod method, int bci) {
HotSpotJVMCIRuntimeProvider runtime = HotSpotJVMCIRuntime.runtime();
long jvmciEnv = 0L;
HotSpotCompilationRequest request = new HotSpotCompilationRequest((HotSpotResolvedJavaMethod) method, bci, jvmciEnv);
HotSpotGraalCompiler compiler = (HotSpotGraalCompiler) runtime.getCompiler();
! CompilationTask task = new CompilationTask(runtime, compiler, request, true, true, options);
! HotSpotCompilationRequestResult result = task.runCompilation();
! CompilationTask task = new CompilationTask(runtime, compiler, request, true, true, debug.getOptions());
! HotSpotCompilationRequestResult result = task.runCompilation(debug);
if (result.getFailure() != null) {
throw new GraalError(result.getFailureMessage());
}
}
/**
* Returns the target BCI of the first bytecode backedge. This is where HotSpot triggers
* on-stack-replacement in case the backedge counter overflows.
*/
! private static int getBackedgeBCI(DebugContext debug, ResolvedJavaMethod method) {
Bytecode code = new ResolvedJavaMethodBytecode(method);
BytecodeStream stream = new BytecodeStream(code.getCode());
! BciBlockMapping bciBlockMapping = BciBlockMapping.create(stream, code, getInitialOptions());
! OptionValues options = debug.getOptions();
+ BciBlockMapping bciBlockMapping = BciBlockMapping.create(stream, code, options, debug);
for (BciBlock block : bciBlockMapping.getBlocks()) {
if (block.startBci != -1) {
int bci = block.startBci;
for (BciBlock succ : block.getSuccessors()) {
*** 115,130 ****
--- 118,132 ----
Assert.assertEquals(ReturnValue.SUCCESS, result.returnValue);
}
private void compileOSR(OptionValues options, ResolvedJavaMethod method) {
// ensure eager resolving
! StructuredGraph graph = parseEager(method, AllowAssumptions.YES, options);
! int bci = getBackedgeBCI(method);
! DebugContext debug = graph.getDebug();
+ int bci = getBackedgeBCI(debug, method);
assert bci != -1;
// ensure eager resolving
parseEager(method, AllowAssumptions.YES, options);
compile(options, method, bci);
+ compile(debug, method, bci);
}
protected enum ReturnValue {
SUCCESS,
FAILURE,
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTestBase.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File