Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
gluon-bot committed Sep 23, 2023
2 parents c866de6 + 4b127ef commit 4970f2f
Show file tree
Hide file tree
Showing 14 changed files with 428 additions and 108 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
GATE_TAGS: "style,fullbuild,test"
PRIMARY: "compiler"
- env:
JDK_VERSION: "21"
JDK_VERSION: "latest"
GATE_TAGS: "build,bootstraplite"
PRIMARY: "compiler"
# /espresso
Expand Down
125 changes: 73 additions & 52 deletions compiler/ci/ci_common/gate.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -190,41 +190,45 @@
capabilities+: ["ram16gb"],
},

jdk_latest:: "Latest",

# This map defines the builders that run as gates. Each key in this map
# must correspond to the name of a build created by `make_build`.
# Each value in this map is an object that overrides or extends the
# fields of the denoted build.
local gates = {
"gate-compiler-test-labsjdk-21-linux-amd64": t("1:00:00") + c.mach5_target,
"gate-compiler-test-labsjdk-21-linux-aarch64": t("1:50:00"),
"gate-compiler-test-labsjdk-21-darwin-amd64": t("1:00:00") + c.mach5_target + s.ram16gb,
"gate-compiler-test-labsjdk-21-darwin-aarch64": t("1:00:00"),
"gate-compiler-test-labsjdk-21-windows-amd64": t("1:30:00"),
"gate-compiler-test_zgc-labsjdk-21-linux-amd64": t("1:00:00") + c.mach5_target,
"gate-compiler-test_zgc-labsjdk-21-linux-aarch64": t("1:50:00"),
"gate-compiler-test_zgc-labsjdk-21-darwin-amd64": t("1:00:00") + c.mach5_target + s.ram16gb,
"gate-compiler-test_zgc-labsjdk-21-darwin-aarch64": t("1:00:00"),

"gate-compiler-test-labsjdk-latest-linux-amd64": t("1:00:00") + c.mach5_target,
"gate-compiler-test-labsjdk-latest-linux-aarch64": t("1:50:00"),
"gate-compiler-test-labsjdk-latest-darwin-amd64": t("1:00:00") + c.mach5_target + s.ram16gb,
"gate-compiler-test-labsjdk-latest-darwin-aarch64": t("1:00:00"),
"gate-compiler-test-labsjdk-latest-windows-amd64": t("1:30:00"),
"gate-compiler-test_zgc-labsjdk-latest-linux-amd64": t("1:00:00") + c.mach5_target,
"gate-compiler-test_zgc-labsjdk-latest-linux-aarch64": t("1:50:00"),
"gate-compiler-test_zgc-labsjdk-latest-darwin-amd64": t("1:00:00") + c.mach5_target + s.ram16gb,
"gate-compiler-test_zgc-labsjdk-latest-darwin-aarch64": t("1:00:00"),

# Style jobs need to stay on a JDK compatible with all the style
# checking tools (SpotBugs, Checkstyle, Eclipse formatter etc).
"gate-compiler-style-labsjdk-21-linux-amd64": t("45:00"),
"gate-compiler-build-labsjdk-latest-linux-amd64": t("25:00"),

"gate-compiler-ctw-labsjdk-21-linux-amd64": c.mach5_target,
"gate-compiler-ctw-labsjdk-21-windows-amd64": t("1:50:00"),
"gate-compiler-ctw_zgc-labsjdk-21-linux-amd64": c.mach5_target,
"gate-compiler-ctw-labsjdk-latest-linux-amd64": c.mach5_target,
"gate-compiler-ctw-labsjdk-latest-windows-amd64": t("1:50:00"),
"gate-compiler-ctw_zgc-labsjdk-latest-linux-amd64": c.mach5_target,

"gate-compiler-ctw_economy-labsjdk-21-linux-amd64": {},
"gate-compiler-ctw_economy-labsjdk-21-windows-amd64": t("1:50:00"),
"gate-compiler-ctw_economy-labsjdk-latest-linux-amd64": {},
"gate-compiler-ctw_economy-labsjdk-latest-windows-amd64": t("1:50:00"),

"gate-compiler-benchmarktest-labsjdk-21-linux-amd64": {},
"gate-compiler-benchmarktest_zgc-labsjdk-21-linux-amd64": {},
"gate-compiler-benchmarktest-labsjdk-latest-linux-amd64": {},
"gate-compiler-benchmarktest_zgc-labsjdk-latest-linux-amd64": {},

"gate-compiler-truffle_xcomp-labsjdk-21-linux-amd64": t("1:30:00"),
"gate-compiler-truffle_xcomp_zgc-labsjdk-21-linux-amd64": t("1:30:00"),
"gate-compiler-truffle_xcomp-labsjdk-latest-linux-amd64": t("1:30:00"),
"gate-compiler-truffle_xcomp_zgc-labsjdk-latest-linux-amd64": t("1:30:00"),

"gate-compiler-bootstrap_lite-labsjdk-21-darwin-amd64": t("1:00:00") + c.mach5_target,
"gate-compiler-bootstrap_lite-labsjdk-latest-darwin-amd64": t("1:00:00") + c.mach5_target,

"gate-compiler-bootstrap_full-labsjdk-21-linux-amd64": s.many_cores + c.mach5_target,
"gate-compiler-bootstrap_full_zgc-labsjdk-21-linux-amd64": s.many_cores + c.mach5_target
"gate-compiler-bootstrap_full-labsjdk-latest-linux-amd64": s.many_cores + c.mach5_target,
"gate-compiler-bootstrap_full_zgc-labsjdk-latest-linux-amd64": s.many_cores + c.mach5_target
},

# This map defines the builders that run daily. Each key in this map
Expand All @@ -233,13 +237,13 @@
# Each value in this map is an object that overrides or extends the
# fields of the denoted build.
local dailies = {
"daily-compiler-ctw-labsjdk-21-linux-aarch64": {},
"daily-compiler-ctw-labsjdk-21-darwin-amd64": {},
"daily-compiler-ctw-labsjdk-21-darwin-aarch64": {},
"daily-compiler-ctw-labsjdk-latest-linux-aarch64": {},
"daily-compiler-ctw-labsjdk-latest-darwin-amd64": {},
"daily-compiler-ctw-labsjdk-latest-darwin-aarch64": {},

"daily-compiler-ctw_economy-labsjdk-21-linux-aarch64": {},
"daily-compiler-ctw_economy-labsjdk-21-darwin-amd64": {},
"daily-compiler-ctw_economy-labsjdk-21-darwin-aarch64": {},
"daily-compiler-ctw_economy-labsjdk-latest-linux-aarch64": {},
"daily-compiler-ctw_economy-labsjdk-latest-darwin-amd64": {},
"daily-compiler-ctw_economy-labsjdk-latest-darwin-aarch64": {},
},

# This map defines the builders that run weekly. Each key in this map
Expand All @@ -248,31 +252,31 @@
# Each value in this map is an object that overrides or extends the
# fields of the denoted build.
local weeklies = {
"weekly-compiler-ctw_phaseplan_fuzzing-labsjdk-21-linux-amd64": {
"weekly-compiler-ctw_phaseplan_fuzzing-labsjdk-latest-linux-amd64": {
notify_groups: [],
notify_emails: ["[email protected]"],
},

"weekly-compiler-test_vec16-labsjdk-21-linux-amd64": {},
"weekly-compiler-test_avx0-labsjdk-21-linux-amd64": {},
"weekly-compiler-test_avx1-labsjdk-21-linux-amd64": {},
"weekly-compiler-test_vec16-labsjdk-latest-linux-amd64": {},
"weekly-compiler-test_avx0-labsjdk-latest-linux-amd64": {},
"weekly-compiler-test_avx1-labsjdk-latest-linux-amd64": {},

"weekly-compiler-test_jtt_phaseplan_fuzzing-labsjdk-21-linux-amd64": {
"weekly-compiler-test_jtt_phaseplan_fuzzing-labsjdk-latest-linux-amd64": {
notify_groups: [],
notify_emails: ["[email protected]"],
},

"weekly-compiler-benchmarktest-labsjdk-21Debug-linux-amd64": t("3:00:00"),
"weekly-compiler-benchmarktest-labsjdk-latestDebug-linux-amd64": t("3:00:00"),

"weekly-compiler-coverage*": {},

"weekly-compiler-test_serialgc-labsjdk-21-linux-amd64": t("1:30:00") + c.mach5_target,
"weekly-compiler-test_serialgc-labsjdk-21-linux-aarch64": t("1:50:00"),
"weekly-compiler-test_serialgc-labsjdk-21-darwin-amd64": t("1:30:00") + c.mach5_target,
"weekly-compiler-test_serialgc-labsjdk-21-darwin-aarch64": t("1:30:00"),
"weekly-compiler-test_serialgc-labsjdk-latest-linux-amd64": t("1:30:00") + c.mach5_target,
"weekly-compiler-test_serialgc-labsjdk-latest-linux-aarch64": t("1:50:00"),
"weekly-compiler-test_serialgc-labsjdk-latest-darwin-amd64": t("1:30:00") + c.mach5_target,
"weekly-compiler-test_serialgc-labsjdk-latest-darwin-aarch64": t("1:30:00"),

"weekly-compiler-truffle_xcomp_serialgc-labsjdk-21-linux-amd64": t("1:30:00"),
"weekly-compiler-truffle_xcomp_serialgc-labsjdk-21-linux-aarch64": t("1:30:00"),
"weekly-compiler-truffle_xcomp_serialgc-labsjdk-latest-linux-amd64": t("1:30:00"),
"weekly-compiler-truffle_xcomp_serialgc-labsjdk-latest-linux-aarch64": t("1:30:00"),
},

# This map defines overrides and field extensions for monthly builds.
Expand Down Expand Up @@ -376,23 +380,40 @@
"truffle_xcomp",
"ctw",
"ctw_economy",
"coverage",
"coverage_ctw",
"benchmarktest",
"bootstrap_lite",
"bootstrap_full"
]

# Run jobs on latest and last LTS (21)
for jdk in [
self.jdk_latest,
"21"
]
for os_arch in all_os_arches
],

# Coverage builds run on all platforms (platform = JDK + OS + ARCH)
# that support JaCoCo (GR-46676)
local all_coverage_builds = [self.make_build(jdk, os_arch, task).build
for task in [
"coverage",
"coverage_ctw",
]
for jdk in [
"21"
]
for os_arch in all_os_arches
] + [
# Run AVX3 tests only on linux-amd64
self.make_build("21", "linux-amd64", "coverage_avx3").build
],

# Test ZGC on support platforms. Windows requires version 1083 or later which will
# probably require adding some capabilities.
local all_zgc_builds = [self.make_build(jdk, os_arch, task).build
for jdk in [
"21"
self.jdk_latest
]
for os_arch in [
"linux-amd64",
Expand All @@ -410,7 +431,7 @@
],

# Run unittests with SerialGC.
local all_serialgc_builds = [self.make_build("21", os_arch, task).build
local all_serialgc_builds = [self.make_build(self.jdk_latest, os_arch, task).build
for os_arch in [
"linux-amd64",
"linux-aarch64",
Expand All @@ -423,11 +444,10 @@
]
],

# Builds run on only on linux-amd64-jdk21
local linux_amd64_jdk21_builds = [self.make_build("21", "linux-amd64", task).build
# Builds run on only on linux-amd64-jdk-latest
local linux_amd64_jdk_latest_builds = [self.make_build(self.jdk_latest, "linux-amd64", task).build
for task in [
"ctw_phaseplan_fuzzing",
"coverage_avx3",
"test_vec16",
"test_avx0",
"test_avx1",
Expand All @@ -442,15 +462,15 @@
JVMCI_VERSION_CHECK: "strict",
},
}],
local jdk_latest_version_check_builds = [self.make_build("Latest", "linux-amd64", "build", extra_tasks={build:: s.base("build"),}).build + {
local jdk_latest_version_check_builds = [self.make_build(self.jdk_latest, "linux-amd64", "build", extra_tasks={build:: s.base("build"),}).build + {
environment+: {
# Run the strict JVMCI version check, i.e., that JVMCIVersionCheck.JVMCI_MIN_VERSION matches the versions in common.json.
JVMCI_VERSION_CHECK: "strict",
},
}],

# Builds run on only on linux-amd64-jdk21Debug
local linux_amd64_jdk21Debug_builds = [self.make_build("21Debug", "linux-amd64", task).build
# Builds run on only on linux-amd64-jdk-latestDebug
local linux_amd64_jdk_latestDebug_builds = [self.make_build("LatestDebug", "linux-amd64", task).build
for task in [
"benchmarktest",
]
Expand All @@ -459,12 +479,13 @@
# Complete set of builds defined in this file
local all_builds =
all_platforms_builds +
all_coverage_builds +
all_zgc_builds +
all_serialgc_builds +
style_builds +
jdk_latest_version_check_builds +
linux_amd64_jdk21_builds +
linux_amd64_jdk21Debug_builds,
linux_amd64_jdk_latest_builds +
linux_amd64_jdk_latestDebug_builds,

builds: if
self.check_manifest(gates, all_builds, std.thisFile, "gates").result &&
Expand Down
6 changes: 3 additions & 3 deletions compiler/ci/ci_includes/bootstrap_extra.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

# See definition of `gates` local variable in ../ci_common/gate.jsonnet
local gates = {
"gate-compiler-bootstrap-labsjdk-21-linux-amd64": g.many_cores + c.mach5_target,
"gate-compiler-bootstrap_economy-labsjdk-21-linux-amd64": g.many_cores + c.mach5_target,
"gate-compiler-bootstrap-labsjdk-latest-linux-amd64": g.many_cores + c.mach5_target,
"gate-compiler-bootstrap_economy-labsjdk-latest-linux-amd64": g.many_cores + c.mach5_target,
},

# Builds run on only on linux-amd64-jdk21
local linux_amd64_builds = [g.make_build(jdk, "linux-amd64", task, gates_manifest=gates).build
for jdk in ["21"]
for jdk in [g.jdk_latest]
for task in ["bootstrap", "bootstrap_economy"]
],

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/*
* Copyright (c) 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package org.graalvm.compiler.core.test;

import java.io.IOException;
import java.net.URI;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

import org.graalvm.compiler.bytecode.BytecodeDisassembler;
import org.junit.Assert;
import org.junit.Test;

import jdk.vm.ci.meta.ResolvedJavaMethod;
import jdk.vm.ci.meta.ResolvedJavaType;

public class BytecodeDisassemblerTest extends GraalCompilerTest {

/**
* Tests the disassembler by processing all the classes in {@code java.base} with the possible
* set of disassembler configurations being cycled through randomly.
*/
@Test
public void test() throws Exception {
disassembleClasses(gatherClasses());
}

private static List<Class<?>> gatherClasses() throws IOException {
List<Class<?>> classes = new ArrayList<>();
FileSystem fs = FileSystems.newFileSystem(URI.create("jrt:/"), Collections.emptyMap());
Path top = fs.getPath("/modules/");
Files.find(top, Integer.MAX_VALUE,
(path, attrs) -> attrs.isRegularFile()).forEach(p -> {
int nameCount = p.getNameCount();
if (nameCount > 2) {
String base = p.getName(nameCount - 1).toString();
if (base.endsWith(".class") && !base.equals("module-info.class")) {
String module = p.getName(1).toString();
if (module.equals("java.base")) {
String className = p.subpath(2, nameCount).toString().replace('/', '.');
className = className.replace('/', '.').substring(0, className.length() - ".class".length());
Class<?> cl = loadClass(className);
if (cl != null) {
classes.add(cl);
}
}
}
}
});
return classes;
}

private void disassembleClasses(List<Class<?>> classes) {
Random random = getRandomInstance();
String[] newLines = {null, "\n", "\r\n"};
for (Class<?> c : classes) {
String newLine = newLines[random.nextInt(3)];
boolean multiline = newLine != null && random.nextBoolean();
boolean format = random.nextBoolean();
BytecodeDisassembler.CPIFunction f = random.nextBoolean() ? BytecodeDisassembler.CPIFunction.normalizer() : BytecodeDisassembler.CPIFunction.Identity;
BytecodeDisassembler disassembler = new BytecodeDisassembler(multiline, newLine, format, f);

ResolvedJavaType type = getMetaAccess().lookupJavaType(c);
ResolvedJavaMethod[] methods = type.getDeclaredMethods();
for (ResolvedJavaMethod m : methods) {
int codeSize = m.getCodeSize();
String dis = disassembler.disassemble(m);
if (codeSize <= 0) {
Assert.assertNull(m.toString(), dis);
} else {
Assert.assertNotEquals(m.toString(), 0, dis.length());
}
}
}
}

private static Class<?> loadClass(String className) {
try {
return Class.forName(className, false, ClassLoader.getPlatformClassLoader());
} catch (ClassNotFoundException e) {
throw new AssertionError(e);
}
}
}
Loading

0 comments on commit 4970f2f

Please sign in to comment.