changeset 55394:b5bb6ac3b2d2 cont

Update graal support.
author dmacgregor
date Thu, 30 May 2019 14:48:13 +0100
parents a7d5ec8be61e
children 4bd50207fe00 6200f15b422f 15afdb07c926
files src/hotspot/share/jvmci/jvmciRuntime.cpp src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ContinuationSubstitutions.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64CCall.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Call.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ForeignCallPlugin.java test/jdk/java/lang/Continuation/Basic.java
diffstat 7 files changed, 28 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/jvmci/jvmciRuntime.cpp	Wed May 29 18:21:46 2019 +0100
+++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp	Thu May 30 14:48:13 2019 +0100
@@ -1515,6 +1515,7 @@
       } else {
         nm->set_has_unsafe_access(has_unsafe_access);
         nm->set_has_wide_vectors(has_wide_vector);
+        nm->set_has_monitors(has_monitors);
 
         // Record successful registration.
         // (Put nm into the task handle *before* publishing to the Java heap.)
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java	Wed May 29 18:21:46 2019 +0100
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java	Thu May 30 14:48:13 2019 +0100
@@ -431,10 +431,9 @@
 
     private static void registerContinuationPlugins(InvocationPlugins plugins,  ForeignCallsProvider foreignCalls, BytecodeProvider bytecodeProvider) {
         Registration r1 = new Registration(plugins, Continuation.class, bytecodeProvider);
-        Registration r2 = new Registration(plugins, Continuation.class);
         r1.registerMethodSubstitution(ContinuationSubstitutions.class, "getSP");
-        r2.register1("doContinue", Receiver.class, new ForeignCallPlugin(foreignCalls, ContinuationSubstitutions.CONTINUATION_DO_CONTINUE));
-        r2.register1("doYield", int.class, new ForeignCallPlugin(foreignCalls, ContinuationSubstitutions.CONTINUATION_YIELD));
+        r1.register1("doContinue", Receiver.class, new ForeignCallPlugin(foreignCalls, ContinuationSubstitutions.CONTINUATION_DO_CONTINUE));
+        r1.register1("doYield", int.class, new ForeignCallPlugin(foreignCalls, ContinuationSubstitutions.CONTINUATION_YIELD));
         r1.registerMethodSubstitution(ContinuationSubstitutions.class, "runLevel");
     }
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ContinuationSubstitutions.java	Wed May 29 18:21:46 2019 +0100
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ContinuationSubstitutions.java	Thu May 30 14:48:13 2019 +0100
@@ -47,6 +47,6 @@
         return 3;
     }
 
-    public static final ForeignCallDescriptor CONTINUATION_DO_CONTINUE = new ForeignCallDescriptor("contomiaton_do_continue", int.class, Continuation.class);
-    public static final ForeignCallDescriptor CONTINUATION_YIELD = new ForeignCallDescriptor("continuation_do_flibble", int.class, int.class);
+    public static final ForeignCallDescriptor CONTINUATION_DO_CONTINUE = new ForeignCallDescriptor("contomiaton_do_continue", void.class, Continuation.class);
+    public static final ForeignCallDescriptor CONTINUATION_YIELD = new ForeignCallDescriptor("continuation_do_yield", int.class, int.class);
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64CCall.java	Wed May 29 18:21:46 2019 +0100
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64CCall.java	Thu May 30 14:48:13 2019 +0100
@@ -60,7 +60,7 @@
     private void directCall(AMD64MacroAssembler masm) {
         Register reg = ValueUtil.asRegister(functionPtr);
         masm.call(reg);
-        masm.ensureUniquePC();
+        masm.nop(8);
     }
 
     @Override
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Call.java	Wed May 29 18:21:46 2019 +0100
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Call.java	Thu May 30 14:48:13 2019 +0100
@@ -209,7 +209,7 @@
         int after = masm.position();
         crb.recordDirectCall(before, after, callTarget, info);
         crb.recordExceptionHandlers(after, info);
-        masm.ensureUniquePC();
+        masm.nop(8);
         return callPCOffset;
     }
 
@@ -260,7 +260,7 @@
         int after = masm.position();
         crb.recordIndirectCall(before, after, callTarget, info);
         crb.recordExceptionHandlers(after, info);
-        masm.ensureUniquePC();
+        masm.nop(8);
         return before;
     }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ForeignCallPlugin.java	Wed May 29 18:21:46 2019 +0100
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ForeignCallPlugin.java	Thu May 30 14:48:13 2019 +0100
@@ -29,6 +29,7 @@
 import org.graalvm.compiler.nodes.ValueNode;
 import org.graalvm.compiler.nodes.extended.ForeignCallNode;
 
+import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 
 /**
@@ -47,7 +48,11 @@
     public boolean execute(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode[] args) {
         ForeignCallNode foreignCall = new ForeignCallNode(foreignCalls, descriptor, args);
         foreignCall.setBci(b.bci());
-        b.addPush(targetMethod.getSignature().getReturnKind(), foreignCall);
+        if (targetMethod.getSignature().getReturnKind() == JavaKind.Void) {
+            b.add(foreignCall);
+        } else {
+            b.addPush(targetMethod.getSignature().getReturnKind(), foreignCall);
+        }
         return true;
     }
 }
--- a/test/jdk/java/lang/Continuation/Basic.java	Wed May 29 18:21:46 2019 +0100
+++ b/test/jdk/java/lang/Continuation/Basic.java	Thu May 30 14:48:13 2019 +0100
@@ -40,6 +40,20 @@
 * @run testng/othervm -XX:+UnlockDiagnosticVMOptions -XX:TieredStopAtLevel=3 -Xcomp -XX:CompileOnly=java/lang/Continuation,Basic -XX:+UseNewCode Basic
 */
 
+/*
+Graal tests currently disabled until we can find the problem with monitor pinned tests.
+
+* @run testng/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler -Xcomp -XX:CompileOnly=java/lang/Continuation,Basic Basic
+* @run testng/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler -XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -Xcomp -XX:CompileOnly=java/lang/Continuation,Basic -XX:CompileCommand=exclude,Basic.manyArgsDriver Basic
+* @run testng/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler -XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -Xcomp -XX:CompileOnly=java/lang/Continuation,Basic -XX:CompileCommand=exclude,java/lang/Continuation.enter Basic
+* @run testng/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler -XX:-TieredCompilation -Xcomp -XX:CompileOnly=java/lang/Continuation,Basic -XX:CompileCommand=inline,java/lang/Continuation.run Basic
+* @run testng/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler -XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -Xcomp -XX:CompileOnly=java/lang/Continuation,Basic -XX:+UseNewCode Basic
+* @run testng/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler -XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -Xcomp -XX:CompileOnly=java/lang/Continuation,Basic -XX:+UseNewCode -XX:CompileCommand=exclude,Basic.manyArgsDriver Basic
+* @run testng/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler -XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -Xcomp -XX:CompileOnly=java/lang/Continuation,Basic -XX:+UseNewCode -XX:CompileCommand=exclude,java/lang/Continuation.enter Basic
+* @run testng/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler -XX:TieredStopAtLevel=3 -Xcomp -XX:CompileOnly=java/lang/Continuation,Basic Basic
+* @run testng/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler -XX:+UnlockDiagnosticVMOptions -XX:TieredStopAtLevel=3 -Xcomp -XX:CompileOnly=java/lang/Continuation,Basic -XX:+UseNewCode Basic
+*/
+
 // Anything excluded or not compileonly is not compiled; see CompilerOracle::should_exclude
 
 // * @library /test/lib /