Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions substratevm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Native Image Changelog

This changelog summarizes major changes to Native Image, developed under the codename **Substrate VM**.
This changelog summarizes major changes to GraalVM Native Image.

## Version 22.0.0
* (GR-33930) Decouple HostedOptionParser setup from classpath/modulepath scanning (use ServiceLoader for collecting options).
* (GR-33504) Implement --add-reads for native-image and fix --add-opens error handling.
* (GR-33983) Remove obsolete com.oracle.svm.thirdparty.jline.JLineFeature from substratevm:LIBRARY_SUPPORT.
* (GR-34577) Remove support for outdated JDK versions between 11 and 17. Since JDK versions 12, 13, 14, 15, 16 are no longer supported, there is no need to explicitly check for and allow these versions.

## Version 21.3.0

58 changes: 5 additions & 53 deletions substratevm/mx.substratevm/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,58 +230,13 @@
"workingSets": "SVM",
},

"com.oracle.svm.core.jdk14": {
"subDir": "src",
"sourceDirs": ["src"],
"dependencies": ["com.oracle.svm.core"],
"requiresConcealed" : {
"java.base" : [
"jdk.internal.access.foreign",
],
},
"javaCompliance": "14+",
"checkstyle": "com.oracle.svm.core",
"workingSets": "SVM",
},

"com.oracle.svm.core.jdk15": {
"subDir": "src",
"sourceDirs": ["src"],
"dependencies": ["com.oracle.svm.core.jdk11"],
"requiresConcealed" : {
"java.base" : [
"jdk.internal.loader",
"jdk.internal.misc",
"sun.invoke.util",
],
},
"javaCompliance": "15+",
"checkstyle": "com.oracle.svm.core",
"workingSets": "SVM",
},

"com.oracle.svm.core.jdk16": {
"subDir": "src",
"sourceDirs": ["src"],
"dependencies": ["com.oracle.svm.core"],
"requiresConcealed" : {
"java.base" : [
"jdk.internal.loader",
"jdk.internal.misc",
"sun.invoke.util",
],
},
"javaCompliance": "16+",
"checkstyle": "com.oracle.svm.core",
"workingSets": "SVM",
},

"com.oracle.svm.core.jdk17": {
"subDir": "src",
"sourceDirs": ["src"],
"dependencies": ["com.oracle.svm.core"],
"dependencies": ["com.oracle.svm.core.jdk11"],
"requiresConcealed" : {
"java.base" : [
"jdk.internal.access.foreign",
"jdk.internal.loader",
"jdk.internal.misc",
"jdk.internal.platform",
Expand Down Expand Up @@ -455,7 +410,7 @@
],
"workingSets": "SVM",
},
"com.oracle.svm.hosted.jdk14": {
"com.oracle.svm.hosted.jdk17": {
"subDir": "src",
"sourceDirs": ["src"],
"dependencies": [
Expand All @@ -467,7 +422,7 @@
"jdk.internal.vm.ci" :
["jdk.vm.ci.meta"],
},
"javaCompliance": "14+",
"javaCompliance": "17+",
"annotationProcessors": [
"compiler:GRAAL_PROCESSOR",
],
Expand Down Expand Up @@ -1079,13 +1034,10 @@
"com.oracle.svm.hosted",
"com.oracle.svm.hosted.jdk8",
"com.oracle.svm.hosted.jdk11",
"com.oracle.svm.hosted.jdk14",
"com.oracle.svm.hosted.jdk17",
"com.oracle.svm.core",
"com.oracle.svm.core.jdk8",
"com.oracle.svm.core.jdk11",
"com.oracle.svm.core.jdk14",
"com.oracle.svm.core.jdk15",
"com.oracle.svm.core.jdk16",
"com.oracle.svm.core.jdk17",
"com.oracle.svm.core.graal.amd64",
"com.oracle.svm.core.graal.aarch64",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
import static org.graalvm.compiler.debug.GraalError.shouldNotReachHere;
import static org.graalvm.compiler.debug.GraalError.unimplemented;

// Checkstyle: allow reflection
import java.lang.reflect.Field;
// Checkstyle: disallow reflection
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
Expand Down Expand Up @@ -131,6 +128,7 @@
import com.oracle.svm.shadowed.org.bytedeco.llvm.LLVM.LLVMBasicBlockRef;
import com.oracle.svm.shadowed.org.bytedeco.llvm.LLVM.LLVMTypeRef;
import com.oracle.svm.shadowed.org.bytedeco.llvm.LLVM.LLVMValueRef;
import com.oracle.svm.util.ReflectionUtil;

import jdk.vm.ci.code.CallingConvention;
import jdk.vm.ci.code.CodeCacheProvider;
Expand Down Expand Up @@ -2015,25 +2013,22 @@ public void emitCacheWritebackSync(boolean isPreSync) {

/**
* Gets the value of {@code jdk.internal.misc.UnsafeConstants.DATA_CACHE_LINE_FLUSH_SIZE} which
* was introduced in JDK 14 by JEP 352.
* was introduced after JDK 11 by JEP 352.
*
* This method uses reflection to be compatible with JDKs prior to 14.
* This method uses reflection to be compatible with JDK 11 and earlier.
*/
private static int initDataCacheLineFlushSize() {
if (JavaVersionUtil.JAVA_SPEC >= 14) {
Class<?> c;
try {
// Checkstyle: stop
c = Class.forName("jdk.internal.misc.UnsafeConstants");
// Checkstyle: resume
Field f = c.getDeclaredField("DATA_CACHE_LINE_FLUSH_SIZE");
f.setAccessible(true);
return (int) f.get(null);
} catch (Exception e) {
throw new GraalError(e, "Expected UnsafeConstants.DATA_CACHE_LINE_FLUSH_SIZE to exist and be readable");
}
if (JavaVersionUtil.JAVA_SPEC <= 11) {
return 0;
}
try {
// Checkstyle: stop
Class<?> c = Class.forName("jdk.internal.misc.UnsafeConstants");
// Checkstyle: resume
return ReflectionUtil.readStaticField(c, "DATA_CACHE_LINE_FLUSH_SIZE");
} catch (ClassNotFoundException e) {
throw new GraalError(e, "Expected UnsafeConstants.DATA_CACHE_LINE_FLUSH_SIZE to exist and be readable");
}
return 0;
}

private static int getDataCacheLineFlushSize() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@
*/
package com.oracle.svm.core.jdk11;

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Objects;

import com.oracle.svm.core.annotate.Alias;
import com.oracle.svm.core.annotate.RecomputeFieldValue;
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.JDK11OrEarlier;
import com.oracle.svm.core.jdk.JDK11OrLater;
import com.oracle.svm.core.jdk.JDK11To14;
import com.oracle.svm.core.jdk.Resources;
import com.oracle.svm.core.jdk.resources.ResourceStorageEntry;

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Objects;

@SuppressWarnings("unused")
@TargetClass(value = java.lang.Module.class, onlyWith = JDK11OrLater.class)
public final class Target_java_lang_Module_JDK11OrLater {
Expand All @@ -58,7 +58,7 @@ public InputStream getResourceAsStream(String name) {
}

@Substitute //
@TargetElement(onlyWith = JDK11To14.class)
@TargetElement(onlyWith = {JDK11OrLater.class, JDK11OrEarlier.class})
private static void defineModule0(Module module, boolean isOpen, String version, String location, String[] pns) {
ModuleUtil.defineModule(module, isOpen, Arrays.asList(pns));
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.core.jdk16;
package com.oracle.svm.core.jdk17;

// Checkstyle: allow reflection

Expand All @@ -39,7 +39,7 @@
import com.oracle.svm.core.jdk.RecordSupport;
import com.oracle.svm.core.util.VMError;

final class RecordSupportJDK16OrLater extends RecordSupport {
final class RecordSupportJDK17OrLater extends RecordSupport {
@Override
public boolean isRecord(Class<?> clazz) {
return clazz.isRecord();
Expand Down Expand Up @@ -73,14 +73,14 @@ public Constructor<?> getCanonicalRecordConstructor(Class<?> clazz) {
}

@AutomaticFeature
final class RecordFeatureJDK16OrLater implements Feature {
final class RecordFeatureJDK17OrLater implements Feature {
@Override
public boolean isInConfiguration(IsInConfigurationAccess access) {
return JavaVersionUtil.JAVA_SPEC >= 16;
return JavaVersionUtil.JAVA_SPEC >= 17;
}

@Override
public void afterRegistration(AfterRegistrationAccess access) {
ImageSingletons.add(RecordSupport.class, new RecordSupportJDK16OrLater());
ImageSingletons.add(RecordSupport.class, new RecordSupportJDK17OrLater());
}
}
Loading