Skip to content

Commit 390de5d

Browse files
committed
Merge branch 'master' into labsjdk/adopt-24+26-master
2 parents bba051d + d2dc49a commit 390de5d

File tree

114 files changed

+3788
-2855
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+3788
-2855
lines changed

common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"Jsonnet files should not include this file directly but use ci/common.jsonnet instead."
55
],
66

7-
"mx_version": "7.34.1",
7+
"mx_version": "7.35.2",
88

99
"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
1010
"jdks": {

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/CheckGraalInvariants.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext;
8585
import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins;
8686
import jdk.graal.compiler.nodes.java.LoadFieldNode;
87+
import jdk.graal.compiler.nodes.java.MethodCallTargetNode;
8788
import jdk.graal.compiler.nodes.memory.MemoryKill;
8889
import jdk.graal.compiler.nodes.memory.MultiMemoryKill;
8990
import jdk.graal.compiler.nodes.memory.SingleMemoryKill;
@@ -101,6 +102,7 @@
101102
import jdk.graal.compiler.phases.tiers.HighTierContext;
102103
import jdk.graal.compiler.phases.util.Providers;
103104
import jdk.graal.compiler.runtime.RuntimeProvider;
105+
import jdk.graal.compiler.serviceprovider.GraalServices;
104106
import jdk.graal.compiler.test.AddExports;
105107
import jdk.graal.compiler.test.SubprocessUtil;
106108
import jdk.internal.misc.Unsafe;
@@ -195,8 +197,11 @@ public boolean shouldVerifyFoldableMethods() {
195197
return true;
196198
}
197199

198-
public boolean shouldVerifyCurrentTimeMillis() {
199-
return true;
200+
public void verifyCurrentTimeMillis(MetaAccessProvider meta, MethodCallTargetNode t, ResolvedJavaType declaringClass) {
201+
final ResolvedJavaType services = meta.lookupJavaType(GraalServices.class);
202+
if (!declaringClass.equals(services)) {
203+
throw new VerificationError(t, "Should use System.nanoTime() for measuring elapsed time or GraalServices.milliTimeStamp() for the time since the epoch");
204+
}
200205
}
201206

202207
/**
@@ -366,9 +371,7 @@ public static void runTest(InvariantsTool tool) {
366371
verifiers.add(foldableMethodsVerifier);
367372
}
368373

369-
if (tool.shouldVerifyCurrentTimeMillis()) {
370-
verifiers.add(new VerifyCurrentTimeMillisUsage());
371-
}
374+
verifiers.add(new VerifyCurrentTimeMillisUsage(tool));
372375

373376
tool.updateVerifiers(verifiers);
374377

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/VerifyCurrentTimeMillisUsage.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
*/
2525
package jdk.graal.compiler.core.test;
2626

27+
import jdk.graal.compiler.core.test.CheckGraalInvariants.InvariantsTool;
2728
import jdk.graal.compiler.nodes.StructuredGraph;
2829
import jdk.graal.compiler.nodes.java.MethodCallTargetNode;
2930
import jdk.graal.compiler.nodes.spi.CoreProviders;
@@ -40,6 +41,12 @@
4041
public class VerifyCurrentTimeMillisUsage extends VerifyPhase<CoreProviders> {
4142
private static final String CURRENT_TIME_MILLIS_NAME = "currentTimeMillis";
4243

44+
private final InvariantsTool tool;
45+
46+
public VerifyCurrentTimeMillisUsage(InvariantsTool tool) {
47+
this.tool = tool;
48+
}
49+
4350
@Override
4451
protected void verify(StructuredGraph graph, CoreProviders context) {
4552
final ResolvedJavaType systemType = context.getMetaAccess().lookupJavaType(System.class);
@@ -48,11 +55,8 @@ protected void verify(StructuredGraph graph, CoreProviders context) {
4855
if (callee.getDeclaringClass().equals(systemType)) {
4956
String calleeName = callee.getName();
5057
if (calleeName.equals(CURRENT_TIME_MILLIS_NAME)) {
51-
final ResolvedJavaType services = context.getMetaAccess().lookupJavaType(GraalServices.class);
52-
if (graph.method().getDeclaringClass().equals(services)) {
53-
return;
54-
}
55-
throw new VerificationError(t, "Should use System.nanoTime for measuring elapsed time or GraalServices.milliTimeStamp for the time since the epoch");
58+
final ResolvedJavaType declaringClass = graph.method().getDeclaringClass();
59+
tool.verifyCurrentTimeMillis(context.getMetaAccess(), t, declaringClass);
5660
}
5761
}
5862
}

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/GraalOSRLockTest.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,4 +729,26 @@ public static ReturnValue testOuterLockOptimizeToDeopt() {
729729
}
730730
return ret;
731731
}
732+
733+
@Test
734+
@SuppressWarnings("try")
735+
public void testLocksAtOSREntry() {
736+
run(() -> {
737+
OptionValues options = new OptionValues(getInitialOptions(), osrLockDeopt());
738+
testOSR(options, "testLocksAtOSREntrySnippet", null, new Object(), false);
739+
});
740+
}
741+
742+
private static Object staticLock = new Object();
743+
744+
static synchronized Object testLocksAtOSREntrySnippet(Object object, boolean alwaysFalse) {
745+
synchronized (staticLock) {
746+
synchronized (object) {
747+
while (GraalDirectives.injectBranchProbability(0.001, alwaysFalse)) {
748+
GraalDirectives.sideEffect();
749+
}
750+
}
751+
}
752+
return ReturnValue.SUCCESS;
753+
}
732754
}

0 commit comments

Comments
 (0)