Skip to content

Commit

Permalink
Merge branch 'master' into chaeubl/GR-45112-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhaeubl committed Mar 29, 2023
2 parents 485d969 + 40d8273 commit 8e823aa
Show file tree
Hide file tree
Showing 227 changed files with 3,122 additions and 1,995 deletions.
2 changes: 1 addition & 1 deletion ci/ci_common/common.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local repo_config = import '../repo-configuration.libsonnet';
common + common.frequencies + {
build_base:: {
// holds location of CI resources that can easily be overwritten in an overlay
ci_resources:: (import "ci/ci_common/ci-resources.libsonnet"),
ci_resources:: (import "ci-resources.libsonnet"),
},

# Add a guard to `build` that prevents it from running in the gate
Expand Down
File renamed without changes.
26 changes: 13 additions & 13 deletions common.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
"Jsonnet files should not include this file directly but use ci/common.jsonnet instead."
],

"mx_version": "6.17.0",
"mx_version": "6.18.0",

"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
"jdks": {
"oraclejdk11": {"name": "jpg-jdk", "version": "11.0.11", "build_id": "9", "release": true, "platformspecific": true, "extrabundles": ["static-libs"] },

"oraclejdk17": {"name": "jpg-jdk", "version": "17.0.1", "build_id": "12", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-17": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.0-b09", "platformspecific": true },
"labsjdk-ce-17Debug": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.0-b09-debug", "platformspecific": true },
"labsjdk-ce-17-llvm": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.0-b09-sulong", "platformspecific": true },
"labsjdk-ee-17": {"name": "labsjdk", "version": "ee-17.0.7+8-jvmci-23.0-b09", "platformspecific": true },
"labsjdk-ee-17Debug": {"name": "labsjdk", "version": "ee-17.0.7+8-jvmci-23.0-b09-debug", "platformspecific": true },
"labsjdk-ee-17-llvm": {"name": "labsjdk", "version": "ee-17.0.7+8-jvmci-23.0-b09-sulong", "platformspecific": true },
"labsjdk-ce-17": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.0-b10", "platformspecific": true },
"labsjdk-ce-17Debug": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.0-b10-debug", "platformspecific": true },
"labsjdk-ce-17-llvm": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.0-b10-sulong", "platformspecific": true },
"labsjdk-ee-17": {"name": "labsjdk", "version": "ee-17.0.7+8-jvmci-23.0-b10", "platformspecific": true },
"labsjdk-ee-17Debug": {"name": "labsjdk", "version": "ee-17.0.7+8-jvmci-23.0-b10-debug", "platformspecific": true },
"labsjdk-ee-17-llvm": {"name": "labsjdk", "version": "ee-17.0.7+8-jvmci-23.0-b10-sulong", "platformspecific": true },

"oraclejdk19": {"name": "jpg-jdk", "version": "19", "build_id": "26", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-19": {"name": "labsjdk", "version": "ce-19.0.1+10-jvmci-23.0-b04", "platformspecific": true },
Expand All @@ -27,12 +27,12 @@
"labsjdk-ee-19-llvm": {"name": "labsjdk", "version": "ee-19.0.2+7-jvmci-23.0-b05-sulong", "platformspecific": true },

"oraclejdk20": {"name": "jpg-jdk", "version": "20", "build_id": "24", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-20": {"name": "labsjdk", "version": "ce-20+34-jvmci-23.0-b09", "platformspecific": true },
"labsjdk-ce-20Debug": {"name": "labsjdk", "version": "ce-20+34-jvmci-23.0-b09-debug", "platformspecific": true },
"labsjdk-ce-20-llvm": {"name": "labsjdk", "version": "ce-20+34-jvmci-23.0-b09-sulong", "platformspecific": true },
"labsjdk-ee-20": {"name": "labsjdk", "version": "ee-20.0.1+8-jvmci-23.0-b09", "platformspecific": true },
"labsjdk-ee-20Debug": {"name": "labsjdk", "version": "ee-20.0.1+8-jvmci-23.0-b09-debug", "platformspecific": true },
"labsjdk-ee-20-llvm": {"name": "labsjdk", "version": "ee-20.0.1+8-jvmci-23.0-b09-sulong", "platformspecific": true }
"labsjdk-ce-20": {"name": "labsjdk", "version": "ce-20+34-jvmci-23.0-b10", "platformspecific": true },
"labsjdk-ce-20Debug": {"name": "labsjdk", "version": "ce-20+34-jvmci-23.0-b10-debug", "platformspecific": true },
"labsjdk-ce-20-llvm": {"name": "labsjdk", "version": "ce-20+34-jvmci-23.0-b10-sulong", "platformspecific": true },
"labsjdk-ee-20": {"name": "labsjdk", "version": "ee-20.0.1+9-jvmci-23.0-b10", "platformspecific": true },
"labsjdk-ee-20Debug": {"name": "labsjdk", "version": "ee-20.0.1+9-jvmci-23.0-b10-debug", "platformspecific": true },
"labsjdk-ee-20-llvm": {"name": "labsjdk", "version": "ee-20.0.1+9-jvmci-23.0-b10-sulong", "platformspecific": true }
},

"eclipse": {
Expand Down
4 changes: 4 additions & 0 deletions compiler/mx.compiler/mx_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,10 @@ def compiler_gate_benchmark_runner(tasks, extraVMarguments=None, prefix='', task
with Task(prefix + 'DaCapo_pmd:PreserveFramePointer', tasks, tags=GraalTags.test, report=task_report_component) as t:
if t: _gate_dacapo('pmd', default_iterations, benchVmArgs + ['-Xmx256M', '-XX:+PreserveFramePointer'], threads=4, force_serial_gc=False, set_start_heap_size=False)

# stress entry barrier deopt
with Task(prefix + 'DaCapo_pmd:DeoptimizeNMethodBarriersALot', tasks, tags=GraalTags.test, report=task_report_component) as t:
if t: _gate_dacapo('pmd', default_iterations, benchVmArgs + ['-Xmx256M', '-XX:+UnlockDiagnosticVMOptions', '-XX:+DeoptimizeNMethodBarriersALot'], threads=4, force_serial_gc=False, set_start_heap_size=False)

graal_unit_test_runs = [
UnitTestRun('UnitTests', [], tags=GraalTags.unittest + GraalTags.coverage),
]
Expand Down
5 changes: 1 addition & 4 deletions compiler/mx.compiler/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"sourceinprojectwhitelist" : [],

"groupId" : "org.graalvm.compiler",
"version" : "23.0.0",
"version" : "23.1.0",
"release" : False,
"url" : "http://www.graalvm.org/",
"developer" : {
Expand All @@ -24,9 +24,6 @@
{
"name" : "truffle",
"subdir": True,
"urls" : [
{"url" : "https://curio.ssw.jku.at/nexus/content/repositories/snapshots", "kind" : "binary"},
]
},
{
"name" : "regex",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -195,11 +195,6 @@ protected void hlt(int uimm16) {
super.hlt(uimm16);
}

@Override
protected void brk(int uimm16) {
super.brk(uimm16);
}

@Override
protected void hint(SystemHint hint) {
super.hint(hint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3864,7 +3864,7 @@ protected void hlt(int uimm16) {
*
* @param uimm16 Arbitrary 16-bit unsigned payload.
*/
protected void brk(int uimm16) {
public void brk(int uimm16) {
exceptionInstruction(BRK, uimm16);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,6 @@ public final class GraalOptions {
@Option(help = "", type = OptionType.Expert)
public static final OptionKey<Boolean> AlwaysInlineVTableStubs = new OptionKey<>(false);

@Option(help = "", type = OptionType.Debug)
public static final OptionKey<Boolean> CanOmitFrame = new OptionKey<>(true);

// Runtime settings
@Option(help = "", type = OptionType.Expert)
public static final OptionKey<Boolean> SupportJsrBytecodes = new OptionKey<>(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import static org.graalvm.compiler.core.CompilationWrapper.ExceptionAction.ExitVM;
import static org.graalvm.compiler.core.GraalCompilerOptions.CompilationBailoutAsFailure;
import static org.graalvm.compiler.core.GraalCompilerOptions.CompilationFailureAction;
import static org.graalvm.compiler.core.GraalCompilerOptions.ExitVMOnException;
import static org.graalvm.compiler.core.GraalCompilerOptions.ExitVMCompilationFailureRate;
import static org.graalvm.compiler.core.GraalCompilerOptions.MaxCompilationProblemsPerAction;
import static org.graalvm.compiler.core.common.GraalOptions.TrackNodeSourcePosition;
import static org.graalvm.compiler.debug.DebugOptions.Dump;
Expand All @@ -48,6 +48,7 @@
import org.graalvm.compiler.debug.PathUtilities;
import org.graalvm.compiler.debug.TTY;
import org.graalvm.compiler.options.OptionValues;
import org.graalvm.compiler.serviceprovider.GlobalAtomicLong;
import org.graalvm.compiler.serviceprovider.GraalServices;

import jdk.vm.ci.code.BailoutException;
Expand Down Expand Up @@ -128,31 +129,24 @@ public CompilationWrapper(DiagnosticsOutputDirectory outputDirectory, Map<Except

/**
* Gets the action to take based on the value of
* {@link GraalCompilerOptions#CompilationBailoutAsFailure},
* {@link GraalCompilerOptions#CompilationFailureAction} and
* {@link GraalCompilerOptions#ExitVMOnException} in {@code options}.
* {@link GraalCompilerOptions#CompilationBailoutAsFailure} and
* {@link GraalCompilerOptions#CompilationFailureAction} in {@code options}.
*
* Subclasses can override this to choose a different action.
*
* @param cause the cause of the bailout or failure
*/
protected ExceptionAction lookupAction(OptionValues options, Throwable cause) {
if (cause instanceof BailoutException && !CompilationBailoutAsFailure.getValue(options)) {
if (isNonFailureBailout(options, cause)) {
return ExceptionAction.Silent;
}
if (ExitVMOnException.getValue(options)) {
assert CompilationFailureAction.getDefaultValue() != ExceptionAction.ExitVM;
assert ExitVMOnException.getDefaultValue() != true;
if (CompilationFailureAction.hasBeenSet(options) && CompilationFailureAction.getValue(options) != ExceptionAction.ExitVM) {
TTY.printf("WARNING: Ignoring %s=%s since %s=true has been explicitly specified.%n",
CompilationFailureAction.getName(), CompilationFailureAction.getValue(options),
ExitVMOnException.getName());
}
return ExceptionAction.ExitVM;
}
return CompilationFailureAction.getValue(options);
}

private static boolean isNonFailureBailout(OptionValues options, Throwable cause) {
return cause instanceof BailoutException && !CompilationBailoutAsFailure.getValue(options);
}

/**
* Perform the compilation wrapped by this object.
*
Expand Down Expand Up @@ -221,6 +215,7 @@ public T handle(boolean silent) {
@SuppressWarnings("try")
public final T run(DebugContext initialDebug) {
try {
totalCompilations.incrementAndGet();
return performCompilation(initialDebug);
} catch (Throwable cause) {
return onCompilationFailure(new Failure(cause, initialDebug));
Expand Down Expand Up @@ -272,7 +267,7 @@ protected T handleFailure(DebugContext initialDebug, Throwable cause) {

ExceptionAction action = lookupAction(initialOptions, cause);

action = adjustAction(initialOptions, action);
action = adjustAction(initialOptions, action, cause);

if (action == ExceptionAction.Silent) {
return handleException(cause);
Expand Down Expand Up @@ -383,14 +378,90 @@ private void maybeExitVM(ExceptionAction action) {
}
}

// Global counters used to measure compilation failure rate over a
// period of COMPILATION_FAILURE_DETECTION_PERIOD_MS
private static final GlobalAtomicLong totalCompilations = new GlobalAtomicLong(0L);
private static final GlobalAtomicLong failedCompilations = new GlobalAtomicLong(0L);
private static final GlobalAtomicLong compilationPeriodStart = new GlobalAtomicLong(0L);
private static final int COMPILATION_FAILURE_DETECTION_PERIOD_MS = 2000;
private static final int MIN_COMPILATIONS_FOR_FAILURE_DETECTION = 100;

/**
* Gets the start of the current compilation period, initializing it to {@code initialValue} if
* this is the first period.
*/
private static long getCompilationPeriodStart(long initialValue) {
long start = compilationPeriodStart.get();
if (start == 0) {
// Lazy initialization of compilationPeriodStart
if (compilationPeriodStart.compareAndSet(start, initialValue)) {
start = initialValue;
} else {
start = compilationPeriodStart.get();
}
}
return start;
}

/**
* Does the current compilation failure rate exceed the limit specified by
* {@link GraalCompilerOptions#ExitVMCompilationFailureRate}?
*/
private static boolean isCompilationFailureRateTooHigh(OptionValues options, Throwable cause) {
if (isNonFailureBailout(options, cause)) {
return false;
}

long failed = failedCompilations.incrementAndGet();
long total = totalCompilations.get();
if (total == 0) {
return false;
}

int rate = (int) (failed * 100 / total);
int maxRate = ExitVMCompilationFailureRate.getValue(options);
if (maxRate == 0) {
// Systemic compilation failure detection is disabled.
return false;
}

long now = System.currentTimeMillis();
long start = getCompilationPeriodStart(now);

long period = now - start;
boolean periodExpired = period > COMPILATION_FAILURE_DETECTION_PERIOD_MS;

// Wait for period to expire or some minimum amount of compilations
// before detecting systemic failure.
if (rate > maxRate && (periodExpired || total > MIN_COMPILATIONS_FOR_FAILURE_DETECTION)) {
TTY.printf("Warning: Systemic Graal compilation failure detected: %d of %d (%d%%) of compilations failed during last %d ms [max rate set by %s is %d%%]%n",
failed, total, rate, period, ExitVMCompilationFailureRate.getName(), maxRate);
return true;
}

if (periodExpired) {

if (compilationPeriodStart.compareAndSet(start, now)) {
// Reset compilation counters for new period
failedCompilations.set(0);
totalCompilations.set(0);
}
}

return false;
}

/**
* Adjusts {@code initialAction} if necessary based on
* {@link GraalCompilerOptions#MaxCompilationProblemsPerAction}.
*/
private ExceptionAction adjustAction(OptionValues initialOptions, ExceptionAction initialAction) {
private ExceptionAction adjustAction(OptionValues initialOptions, ExceptionAction initialAction, Throwable cause) {
ExceptionAction action = initialAction;
int maxProblems = MaxCompilationProblemsPerAction.getValue(initialOptions);
if (action != ExceptionAction.ExitVM) {
if (isCompilationFailureRateTooHigh(initialOptions, cause)) {
return ExceptionAction.ExitVM;
}
synchronized (problemsHandledPerAction) {
while (action != ExceptionAction.Silent) {
int problems = problemsHandledPerAction.getOrDefault(action, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ public class GraalCompilerOptions {
"by CompilationFailureAction before changing to a less verbose action. " +
"This does not apply to the ExitVM action.", type = OptionType.User)
public static final OptionKey<Integer> MaxCompilationProblemsPerAction = new OptionKey<>(2);
@Option(help = "Alias for CompilationFailureAction=ExitVM.", type = OptionType.User)
public static final OptionKey<Boolean> ExitVMOnException = new OptionKey<>(false);
@Option(help = "Compilation failure rate indicating a systemic compilation problem and causing the VM to exit. " +
"The value is the percent of compilations that failed during a sliding time window. " +
"Set to 0 to disable systemic compilation problem detection.", type = OptionType.User)
public static final OptionKey<Integer> ExitVMCompilationFailureRate = new OptionKey<>(1);
@Option(help = "The number of seconds by which to slow down each compilation. The compilations slowed down " +
"can be restricted with MethodFilter. This option exists to test the compilation watchdog.", type = OptionType.Debug)
public static final OptionKey<Integer> InjectedCompilationDelay = new OptionKey<>(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public enum CEOptimization {
* This phase is enabled by default and can be disabled with
* {@link GraalOptions#PartialEscapeAnalysis}.
*/
PartialEscapeAnanylsis(GraalOptions.PartialEscapeAnalysis, PartialEscapePhase.class),
PartialEscapeAnalysis(GraalOptions.PartialEscapeAnalysis, PartialEscapePhase.class),

/**
* {@link LockEliminationPhase} tries to reduce Java monitor enter/exit overhead of an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,13 +484,14 @@ public void testGraphVerify() {
graph.add(new TestVerifyNode(b));

graph.verify();
Object booleanTrue = Boolean.TRUE;

for (Position p : a.successorPositions()) {
Assert.assertEquals(p.hashCode(), p.hashCode());
Assert.assertTrue(p.equals(p));

Assert.assertFalse(p.equals(null));
Assert.assertFalse(p.equals(Boolean.TRUE));
Assert.assertFalse(p.equals(booleanTrue));

Assert.assertFalse(p.equals(new Position(null, p.getIndex(), p.getSubIndex())));
Assert.assertFalse(p.equals(new Position(null, p.getIndex() + 1, p.getSubIndex())));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,6 @@ public void returned(CompilationResultBuilder crb) {
// nothing to do
}

@Override
public boolean hasFrame() {
return true;
}

}

@Override
Expand Down
Loading

0 comments on commit 8e823aa

Please sign in to comment.