Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
4a780bd
svm: ignore unlikely-arg-type warnings related to CPU features
zapster Jun 30, 2022
f722fe1
svm: ignore Thread.getId deprecation for JDK 19
zapster Jun 30, 2022
9806235
svm: ignore serial warnings
zapster Jun 30, 2022
5f26f6b
svm: more deprecation for JDK 19
zapster Jun 30, 2022
605606a
svm: update graal_compiler_flags_map for JDK 19
zapster Jun 20, 2022
e2ef358
svm: SVM_STATIC_LIBRARIES_SUPPORT is jdk dependent
zapster Jun 27, 2022
beea0ab
svm: add JDK19OrLater and JDK17OrEarlier
zapster Jun 20, 2022
14c0073
svm: add SubstrateMethodAccessor#invoke with caller argument
zapster Jun 20, 2022
de10e6a
svm: Classloader JDK 19
zapster Jun 20, 2022
2fb55f9
svm: RecomputedFields JDK 19
zapster Jun 20, 2022
c980954
svm: ReferenceQueue$Lock gone in JDK 19
zapster Jun 20, 2022
3eeeb56
svm: Field JDK 19
zapster Jun 20, 2022
41d1d47
svm: PlainSocketImpl removed in JDK 19 [JDK-8253119]
zapster Jun 21, 2022
9a3d049
svm: remove AccessControlContext exceptions for removed fields in JDK 19
zapster Jun 21, 2022
f554a37
svm: sync with AMD64.CPUFeature in JDK 19
zapster Jun 21, 2022
fe8cf7b
svm: adopt JNI registration for JDK 19
zapster Jun 21, 2022
182791f
svm: ClassLoaderAccessors for Class.classLoader for JDK 19
zapster Jun 23, 2022
8748c31
svm: InetAddress.preferIPv6Address removed in JDK 19
zapster Jun 23, 2022
79cfb73
svm: mark jdk.internal.misc.VM.toThreadState as Uninterruptible
zapster Jun 23, 2022
b93e50e
svm: ignore permitted subclasses that have been deleted
zapster Jun 23, 2022
c08817d
svm: InnocuousThread in JDK 19
zapster Jun 27, 2022
e769c6b
svm: Thread related changes in JDK 19
zapster Jun 20, 2022
8f1f4d5
svm: initialize Continuation at runtime for now
zapster Jun 27, 2022
354cbaf
svm: adopt JFR EventHandler removal in JDK 19
zapster Jun 28, 2022
9b89ce2
svm: handle MemorySegmentProxy JDK 19
zapster Jun 28, 2022
d6580e3
svm: Perf support JDK 19
zapster Jun 28, 2022
8d24e09
svm: StaticProperty for JDK 19
zapster Jun 29, 2022
3cf9b71
svm: don't complain about Proxies that are run-time initialzed
zapster Jun 29, 2022
2eacc22
svm: temporary support for JDK 19 EA
zapster Jun 20, 2022
5204b1c
ci: temporarily add JDK 19 EA
zapster Jun 30, 2022
ca75ff4
ci: add libgraal quickbuild job for JDK 19
zapster Jun 30, 2022
6569245
ci: use closed jpg-jdk for both ce and ee
zapster Jun 28, 2022
3870705
ci: add JDK 19 svm build gate
zapster Jun 30, 2022
49aeb52
ci: disable JDK 19 libgraal gate for now
zapster Jun 30, 2022
03f0ba1
svm: update comment in SubstrateMethodAccessor
zapster Jul 1, 2022
d79c8b3
svm: update comment in Thread.currentCarrierThread substitution
zapster Jul 1, 2022
e46edfe
svm: rearrange comments in MultiThreadedMonitorSupport for JDK 19
zapster Jul 1, 2022
b7c879d
svm: remove outdated FIXME in Thread substitution
zapster Jul 1, 2022
cd5de05
svm: update comment in JNIRegistrationJavaNio to address MemorySegmen…
zapster Jul 1, 2022
e08b782
svm: remove user and mode from PerfDataSupport.attach()
zapster Jul 1, 2022
71ff0dc
svm: fix assertion in MultiThreadedMonitorSupport
zapster Jul 1, 2022
cbcdf26
Revert "svm: ignore Thread.getId deprecation for JDK 19"
zapster Jul 1, 2022
927a4c6
svm: introduce JavaThreads.getThreadId()
zapster Jul 1, 2022
e06f3e5
svm: use JDK17 suffix for DirectByteBuffer substitution
zapster Jul 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion common.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@
"labsjdk-ce-17-llvm": {"name": "labsjdk", "version": "ce-17.0.4+7-jvmci-22.2-b04-sulong", "platformspecific": true },
"labsjdk-ee-17": {"name": "labsjdk", "version": "ee-17.0.4+10-jvmci-22.2-b04", "platformspecific": true },
"labsjdk-ee-17Debug": {"name": "labsjdk", "version": "ee-17.0.4+10-jvmci-22.2-b04-debug", "platformspecific": true },
"labsjdk-ee-17-llvm": {"name": "labsjdk", "version": "ee-17.0.4+10-jvmci-22.2-b04-sulong", "platformspecific": true }
"labsjdk-ee-17-llvm": {"name": "labsjdk", "version": "ee-17.0.4+10-jvmci-22.2-b04-sulong", "platformspecific": true },

"jdk-19-ea": {
"build_id": "jdk-19+28",
"name": "jpg-jdk",
"version": "19",
"extrabundles": [
"static_libs"
],
"platformspecific": true
}
},

"COMMENT.devkits" : "The devkits versions reflect those used to build the JVMCI JDKs (e.g., see devkit_platform_revisions in <jdk>/make/conf/jib-profiles.js)",
Expand Down
5 changes: 5 additions & 0 deletions common.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
# jdk_version is an hidden field that can be used to generate job names
local jdk11 = { jdk_version:: 11},
local jdk17 = { jdk_version:: 17},
local jdk19 = { jdk_version:: 19},

oraclejdk11:: jdk11 + { downloads+: { JAVA_HOME : jdks.oraclejdk11 }},
oraclejdk17:: jdk17 + { downloads+: { JAVA_HOME : jdks.oraclejdk17 }},
Expand All @@ -95,9 +96,13 @@
"labsjdk-ce-17-llvm":: jdk17 + { downloads+: { LLVM_JAVA_HOME : jdks["labsjdk-ce-17-llvm"] }},
"labsjdk-ee-17-llvm":: jdk17 + { downloads+: { LLVM_JAVA_HOME : jdks["labsjdk-ee-17-llvm"] }},

"labsjdk-ce-19":: jdk19 + { downloads+: { JAVA_HOME : jdks["jdk-19-ea"] + { open: false} }},
"labsjdk-ee-19":: jdk19 + { downloads+: { JAVA_HOME : jdks["jdk-19-ea"] + { open: false} }},

# Aliases to edition specific labsjdks
labsjdk11:: self["labsjdk-" + repo_config.graalvm_edition + "-11"],
labsjdk17:: self["labsjdk-" + repo_config.graalvm_edition + "-17"],
labsjdk19:: self["labsjdk-" + repo_config.graalvm_edition + "-19"],
labsjdk11Debug:: self["labsjdk-" + repo_config.graalvm_edition + "-11Debug"],
labsjdk17Debug:: self["labsjdk-" + repo_config.graalvm_edition + "-17Debug"],
labsjdk11LLVM:: self["labsjdk-" + repo_config.graalvm_edition + "-11-llvm"],
Expand Down
9 changes: 9 additions & 0 deletions substratevm/ci.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@

local linux_amd64_jdk11 = common.linux_amd64 + common.labsjdk11,
local linux_amd64_jdk17 = common.linux_amd64 + common.labsjdk17,
local linux_amd64_jdk19 = common.linux_amd64 + common.labsjdk19,
local darwin_jdk17 = common.darwin_amd64 + common.labsjdk17,
local windows_jdk17 = common.windows_amd64 + common.labsjdk17 + common.devkits["windows-jdk17"],

Expand All @@ -73,6 +74,14 @@
linux_amd64_jdk11 + gate("build-ce", "build,helloworld,test,nativeimagehelp,muslcbuild,debuginfotest") + maven + svm_unittest + t("35:00") + musl_toolchain + gdb("10.2"),
linux_amd64_jdk11 + gate("modules-basic", "build,hellomodule,test") + maven + svm_unittest + t("30:00"),
linux_amd64_jdk17 + gate("style-fullbuild", "style,fullbuild,helloworld,test,svmjunit,debuginfotest") + common.eclipse + common.jdt + maven + svm_unittest + t("50:00") + mx_build_exploded + gdb("10.2"),
linux_amd64_jdk19 + gate("build-ce", "build") + {
run: [
# cannot yet use mx gate --tag build due to compile errors in /compiler
["mx", "build"],
# cannot yet use mx gate --tag hello world due to missing JFR support in JDK 19
["mx", "helloworld"],
]
} + maven + svm_unittest + t("35:00"),
windows_jdk17 + gate("basics", "build,helloworld,test,svmjunit") + svm_unittest + t("1:30:00"),
windows_jdk17 + gate("basics-quickbuild", "build,helloworld_quickbuild,test_quickbuild,svmjunit_quickbuild") + svm_unittest + t("1:30:00"),
],
Expand Down
24 changes: 17 additions & 7 deletions substratevm/mx.substratevm/mx_substratevm.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def get_jdk():
def graal_compiler_flags():
version_tag = get_jdk().javaCompliance.value
compiler_flags = mx.dependency('substratevm:svm-compiler-flags-builder').compute_graal_compiler_flags_map()
if version_tag not in compiler_flags:
if str(version_tag) not in compiler_flags:
missing_flags_message = 'Missing graal-compiler-flags for {0}.\n Did you forget to run "mx build"?'
mx.abort(missing_flags_message.format(version_tag))
def adjusted_exports(line):
Expand All @@ -84,7 +84,8 @@ def adjusted_exports(line):
return before + sep + 'ALL-UNNAMED'
else:
return line
return [adjusted_exports(line) for line in compiler_flags[version_tag]]

return [adjusted_exports(line) for line in compiler_flags[str(version_tag)]]

def svm_unittest_config_participant(config):
vmArgs, mainClass, mainClassArgs = config
Expand Down Expand Up @@ -1577,7 +1578,13 @@ def mx_register_dynamic_suite_constituents(register_project, register_distributi
layout = {
'./': ['file:' + join(base_jdk_home, 'lib', lib_prefix + '*' + lib_suffix)]
}
register_distribution(mx.LayoutTARDistribution(suite, 'SVM_STATIC_LIBRARIES_SUPPORT', [], layout, None, True, None))
register_distribution(JDKLayoutTARDistribution(suite, 'SVM_STATIC_LIBRARIES_SUPPORT', [], layout, None, True, None))


class JDKLayoutTARDistribution(mx.LayoutTARDistribution):
def isJDKDependent(self):
return True


class SubstrateCompilerFlagsBuilder(mx.ArchivableProject):

Expand Down Expand Up @@ -1648,12 +1655,12 @@ def config_file_update(self, file_path, lines, file_paths):
# com.oracle.svm.driver.NativeImage.BuildConfiguration.getBuilderJavaArgs().
def compute_graal_compiler_flags_map(self):
graal_compiler_flags_map = dict()
graal_compiler_flags_map[8] = [
graal_compiler_flags_map['8'] = [
'-d64',
'-XX:-UseJVMCIClassLoader'
]

graal_compiler_flags_map[11] = [
graal_compiler_flags_map['11'] = [
# Disable the check for JDK-8 graal version.
'-Dsubstratevm.IgnoreGraalVersionCheck=true',
]
Expand All @@ -1662,9 +1669,12 @@ def compute_graal_compiler_flags_map(self):
distributions_transitive = mx.classpath_entries(self.buildDependencies)
required_exports = mx_javamodules.requiredExports(distributions_transitive, get_jdk())
exports_flags = mx_sdk_vm.AbstractNativeImageConfig.get_add_exports_list(required_exports)
graal_compiler_flags_map[11].extend(exports_flags)
graal_compiler_flags_map['11'].extend(exports_flags)
# Currently JDK 17 and JDK 11 have the same flags
graal_compiler_flags_map[17] = graal_compiler_flags_map[11]
graal_compiler_flags_map['17'] = graal_compiler_flags_map['11']
# Currently JDK 19 and JDK 17 have the same flags
graal_compiler_flags_map['19'] = graal_compiler_flags_map['17']
graal_compiler_flags_map['19-ea'] = graal_compiler_flags_map['19']
# DO NOT ADD ANY NEW ADD-OPENS OR ADD-EXPORTS HERE!
#
# Instead provide the correct requiresConcealed entries in the moduleInfo
Expand Down
2 changes: 2 additions & 0 deletions substratevm/mx.substratevm/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@
"jdk.jfr.events",
"jdk.jfr.internal",
"jdk.jfr.internal.jfc",
],
"[email protected]": [
"jdk.jfr.internal.handlers",
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import jdk.vm.ci.meta.ResolvedJavaType;

@Platforms(Platform.HOSTED_ONLY.class)
@SuppressWarnings("serial")
public class AnalysisError extends Error {

private static final long serialVersionUID = -4489048906003856416L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
/**
* Bundles all exceptions from on parallel execution so they can be reported properly.
*/
@SuppressWarnings("serial")
public class ParallelExecutionException extends RuntimeException {
private static final long serialVersionUID = -8477198165297173951L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
/**
* A build dependency is a pair of LayoutDecisions (a, b), such that a depends on b.
*/
@SuppressWarnings("serial")
public final class BuildDependency implements Comparable<Object> {

private static class DuplicateDependencyException extends Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ private final class XMMSaverRestorer {
this.hostedCPUFeatures = ImageSingletons.lookup(CPUFeatureAccess.class).buildtimeCPUFeatures();
}

@SuppressWarnings("unlikely-arg-type")
public void emit() {
assert isRuntimeCompilationEnabled == DeoptimizationSupport.enabled() : "JIT compilation enabled after registering singleton?";
if (isRuntimeCompilationEnabled && AMD64CPUFeatureAccess.canUpdateCPUFeatures()) {
Expand Down Expand Up @@ -326,6 +327,7 @@ public void emit() {
* Emits a {@linkplain #emitRuntimeFeatureTest runtime feature check} if the {@code feature}
* is not statically available.
*/
@SuppressWarnings("unlikely-arg-type")
private void testFeature(CPUFeature feature, Label falseLabel) {
if (!hostedCPUFeatures.contains(feature)) {
emitRuntimeFeatureTest(feature, falseLabel);
Expand All @@ -338,6 +340,7 @@ private void testFeature(CPUFeature feature, Label falseLabel) {
* was {@linkplain #enterAvxRegion(CPUFeature) entered}, it must be
* {@linkplain #leaveAvxRegion(CPUFeature) left} before calling this method.
*/
@SuppressWarnings("unlikely-arg-type")
private void jumpToEndOrReturn(CPUFeature feature, Label end) throws StaticFeatureException {
if (hostedCPUFeatures.contains(feature)) {
throw new StaticFeatureException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ public SubstrateAMD64Backend(Providers providers) {
* Returns {@code true} if a call from run-time compiled code to AOT compiled code is an AVX-SSE
* transition. For AOT compilations, this always returns {@code false}.
*/
@SuppressWarnings("unlikely-arg-type")
public static boolean runtimeToAOTIsAvxSseTransition(TargetDescription target) {
if (SubstrateUtil.HOSTED) {
// hosted does not need to care about this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
import com.oracle.svm.core.annotate.Delete;
import com.oracle.svm.core.annotate.Substitute;
import com.oracle.svm.core.annotate.TargetClass;
import com.oracle.svm.core.annotate.TargetElement;
import com.oracle.svm.core.jdk.JDK17OrEarlier;
import com.oracle.svm.core.jdk.JDK17OrLater;
import com.oracle.svm.core.jdk.JDK19OrLater;
import com.oracle.svm.core.jdk.NativeLibrarySupport;

import jdk.internal.loader.NativeLibraries;
Expand Down Expand Up @@ -65,11 +68,18 @@ final class Target_jdk_internal_loader_NativeLibraries_JDK17OrLater {
* not need an instance for now.
*/
@SuppressWarnings("unused")
@Substitute
@Substitute//
@TargetElement(onlyWith = JDK17OrEarlier.class)
public static NativeLibraries jniNativeLibraries(ClassLoader loader) {
return null;
}

@SuppressWarnings("unused")
@Substitute//
@TargetElement(onlyWith = JDK19OrLater.class)
public static NativeLibraries newInstance(ClassLoader loader) {
return null;
}
/*
* Fields capturing state from the image generator that must not leak into the image heap.
*/
Expand All @@ -79,6 +89,7 @@ public static NativeLibraries jniNativeLibraries(ClassLoader loader) {
@Delete //
private static Set<String> loadedLibraryNames;
@Delete //
@TargetElement(onlyWith = JDK17OrEarlier.class)//
private static Deque<?> nativeLibraryContext;

/*
Expand All @@ -93,16 +104,33 @@ public static NativeLibraries jniNativeLibraries(ClassLoader loader) {
private static native boolean load(Target_jdk_internal_loader_NativeLibraries_NativeLibraryImpl_JDK17OrLater impl, String name, boolean isBuiltin, boolean isJNI, boolean throwExceptionIfFail);
*/

@Delete
@Delete//
@TargetElement(onlyWith = JDK17OrEarlier.class)
private static native void unload(String name, boolean isBuiltin, boolean isJNI, long handle);

@Delete//
@TargetElement(onlyWith = JDK19OrLater.class)
private static native void unload(String name, boolean isBuiltin, long handle);

@Delete
private static native String findBuiltinLib(String name);

@Delete
@Delete//
@TargetElement(onlyWith = JDK17OrEarlier.class)
private static native long findEntry0(Target_jdk_internal_loader_NativeLibraries_NativeLibraryImpl_JDK17OrLater lib, String name);
}

@TargetClass(value = jdk.internal.loader.NativeLibrary.class, onlyWith = JDK19OrLater.class)
final class Target_jdk_internal_loader_NativeLibrary_JDK19OrLater {
@Delete
private static native long findEntry0(long handle, String name);
}

@TargetClass(value = jdk.internal.loader.NativeLibraries.class, innerClass = "NativeLibraryImpl", onlyWith = JDK17OrLater.class)
final class Target_jdk_internal_loader_NativeLibraries_NativeLibraryImpl_JDK17OrLater {
}

@Delete//
@TargetClass(value = jdk.internal.loader.NativeLibraries.class, innerClass = "NativeLibraryContext", onlyWith = JDK19OrLater.class)
final class Target_jdk_internal_loader_NativeLibraries_NativeLibraryContext_JDK19OrLater {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* Copyright (c) 2019, 2019, 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 com.oracle.svm.core.jdk17;

import java.io.FileDescriptor;

import com.oracle.svm.core.annotate.Alias;
import com.oracle.svm.core.annotate.Substitute;
import com.oracle.svm.core.annotate.TargetClass;
import com.oracle.svm.core.jdk.JDK17OrEarlier;
import com.oracle.svm.core.jdk.JDK17OrLater;

@TargetClass(className = "jdk.internal.access.foreign.MemorySegmentProxy", onlyWith = {JDK17OrLater.class, JDK17OrEarlier.class})
@SuppressWarnings("unused")
final class Target_jdk_internal_access_foreign_MemorySegmentProxy_JDK17 {
}

@TargetClass(className = "java.nio.DirectByteBuffer", onlyWith = {JDK17OrLater.class, JDK17OrEarlier.class})
@SuppressWarnings("unused")
final class Target_java_nio_DirectByteBuffer_JDK17 {

@Alias
protected Target_java_nio_DirectByteBuffer_JDK17(int cap, long addr, FileDescriptor fd, Runnable unmapper, boolean isSync,
Target_jdk_internal_access_foreign_MemorySegmentProxy_JDK17 segment) {
}

}

@TargetClass(className = "java.nio.DirectByteBufferR", onlyWith = {JDK17OrLater.class, JDK17OrEarlier.class})
@SuppressWarnings("unused")
final class Target_java_nio_DirectByteBufferR_JDK17 {

@Alias
protected Target_java_nio_DirectByteBufferR_JDK17(int cap, long addr, FileDescriptor fd, Runnable unmapper, boolean isSync,
Target_jdk_internal_access_foreign_MemorySegmentProxy_JDK17 segment) {
}

}

@TargetClass(className = "sun.nio.ch.Util", onlyWith = {JDK17OrLater.class, JDK17OrEarlier.class})
final class Target_sun_nio_ch_Util_JDK17 {

@Substitute
private static Target_java_nio_DirectByteBuffer_JDK17 newMappedByteBuffer(int size, long addr, FileDescriptor fd, Runnable unmapper, boolean isSync) {
return new Target_java_nio_DirectByteBuffer_JDK17(size, addr, fd, unmapper, isSync, null);
}

@Substitute
static Target_java_nio_DirectByteBufferR_JDK17 newMappedByteBufferR(int size, long addr, FileDescriptor fd, Runnable unmapper, boolean isSync) {
return new Target_java_nio_DirectByteBufferR_JDK17(size, addr, fd, unmapper, isSync, null);
}

}
Loading