Release Notes
This page highlights changes to Oracle GraalVM Enterprise Edition 22 between releases. GraalVM Enterprise comprises several components, changes to which are listed individually. Release notes are grouped in descending date-version number order to aid readability.
Check the GraalVM Enterprise Version Roadmap for information on the updates cadence.
Oracle GraalVM Enterprise Edition 22.3.5
(2024-01-16)
This is the January 2024 Oracle Critical Patch Update (CPU) for Oracle GraalVM Enterprise Edition 22.3.x. This release contains fixes to security vulnerabilities announced in the January 2024 Oracle Critical Patch Update Advisory. It includes the security fixes released as part of that CPU, some noteworthy bug fixes, listed below, and platform updates.
- Updated the Oracle JDK release on which GraalVM Enterprise Edition is built to:
- 17.0.10+11 for Java 17-based GraalVM Enterprise. See Java SE 17 Release Notes.
- 11.0.22+9 for Java 11-based GraalVM Enterprise. See Java SE 11 Release Notes.
- Compiler fixes:
- Rearranged binary arithmetic operations that may be re-associated for loop invariants and constants.
- The compiler now checks stamps before casting in
IntegerLessThanNode
. - Improved the AArch64 architecture support: allowed
BranchOp
to emitFarBranch
; made AArch64 HotSpot null constant code generation more generic. - Refactored Native Image optimization levels: exposed the dead phi cycle detection as a feature that can be disabled.
- Improved the conditional move optimization cost calculation.
- Improved the loop unrolling optimization by handling stride overflow in the
int
range. - Removed explicit null check exceptions during generation of
checkcast
andinstanceof
.
- Native Image fixes:
- Enabled synchronized data structures for reachability handlers registration.
- Updated OS detection code to recognize Windows 11 and Windows Server 2022.
- Truffle tools and languages fixes:
- Improved instrumentation support in TRegex.
- Upgraded the JSON parser library, org.json, to version 20231013.
- Added a fix to prevent closing an engine on a VM shutdown.
- Changed global
PolyglotIsolate.Lazy#hostToGuestObjectReferences
to perHSContext
.
Oracle GraalVM Enterprise Edition 22.3.4
(2023-10-17)
This is the October 2023 Oracle Critical Patch Update (CPU) for Oracle GraalVM Enterprise Edition 22.3.x. This release contains fixes to security vulnerabilities announced in the October 2023 Oracle Critical Patch Update Advisory. It includes the security fixes released as part of that CPU, some noteworthy bug fixes, listed below, and platform updates.
- Updated the Oracle JDK release on which GraalVM Enterprise Edition is built to:
- 17.0.9+11 for Java 17-based GraalVM Enterprise. See Java SE 17 Release Notes.
- 11.0.21+9 for Java 11-based GraalVM Enterprise. See Java SE 11 Release Notes.
- Upgraded the underlying Node.js to version 16.20.2.
- Compiler fixes:
- Fixed alternating
Phi
wrongly detected as induction variable. - Fixed macOS AArch64 miscompilation.
- Fixed alternating
- Native Image fixes:
- Fix a bug in Java Flight Recorder periodic chunk event.
- Fix Java Flight Recorder constant pool IDs.
- Do not annotate non-final JDK methods as uninterruptible
- Initialize the physical memory size eagerly.
- Properly set
exceptionTemp
for foreign calls.
Oracle GraalVM Enterprise Edition 22.3.3
(2023-07-18)
This is the July 2023 Oracle Critical Patch Update (CPU) for Oracle GraalVM Enterprise Edition 22.3.x. This release contains fixes to security vulnerabilities announced in the July 2023 Oracle Critical Patch Update Advisory. It includes the security fixes released as part of that CPU, some noteworthy bug fixes, listed below, and platform updates.
- Updated the Oracle JDK release on which GraalVM Enterprise Edition is built to:
- 17.0.8+9 for Java 17-based GraalVM Enterprise. See Java SE 17 Release Notes.
- 11.0.20+9 for Java 11-based GraalVM Enterprise. See Java SE 11 Release Notes.
- Graal compiler: Updated counted strip mining optimization to do not strip mine overflowing loops.
- Native Image: Fixed reachability handlers.
- Native Image: Fixed generic array signature registration.
- Truffle framework: Fixed default time zone to always be passed with polyglot isolates.
Oracle GraalVM Enterprise Edition 22.3.2
(2023-04-18)
This is the April 2023 Oracle Critical Patch Update (CPU) for Oracle GraalVM Enterprise Edition 22.3.x. This release contains fixes to security vulnerabilities announced in the April 2023 Oracle Critical Patch Update Advisory. It includes the security fixes released as part of that CPU, and platform updates.
NOTE: JDK 19 is not supported in GraalVM Enterprise Edition 22.3.2. With the release of Java 20, JDK 19.0.2 (included in GraalVM 22.3.2) is below the security baseline and may contain unpatched vulnerabilities. Therefore, it should not be used. If you wish to continue using GraalVM 22.3.x, you should move to JDK 17. This may require application code changes.
- Updated the Oracle JDK release on which GraalVM Enterprise Edition is built to:
- 17.0.7+8 for Java 17-based GraalVM Enterprise. See Java SE 17 Release Notes.
- 11.0.19+8 for Java 11-based GraalVM Enterprise. See Java SE 11 Release Notes.
- Upgraded Node.js to version 16.19.1.
Oracle GraalVM Enterprise Edition 22.3.1
(2023-01-17)
This is the January 2023 Oracle Critical Patch Update (CPU) for GraalVM Enterprise 22.3.x. This release contains fixes to security vulnerabilities announced in the January 2023 Oracle Critical Patch Update Advisory. It includes the security fixes released as part of that CPU, and platform updates.
- Updated the Oracle JDK release on which GraalVM Enterprise Edition is built to:
- 11.0.18 for Java 11-based GraalVM Enterprise. See Java SE 11 Release Notes.
- 17.0.6 for Java 17-based GraalVM Enterprise. See Java SE 17 Release Notes.
- 19.0.2 for Java 19-based GraalVM Enterprise. See Java SE 19 Release Notes.
- Updated Node.js to version 16.18.1.
Oracle GraalVM Enterprise Edition 22.3.0
(2022-10-18)
- Platform Updates
- Java and Compiler Updates
- Native Image
- Polyglot Runtime
- JavaScript and Node.js
- Python
- Ruby
- R
- LLVM Runtime
- Java on Truffle
- WebAssembly
- Polyglot Embedding
- Truffle Language and Tool Implementations
Platform Updates
The 22.3.0 release is the final Feature release in the annual release train and will be supported for the next 18 months with bug and vulnerability fixes. See the Version Roadmap for the release schedule.
- Released experimental JDK 19 GraalVM builds including the Graal compiler, Native Image, and all GraalVM languages and tools except Espresso (Java on Truffle). These builds enable users to take advantage of the latest JDK 18 and JDK 19 features such as Virtual Threads, the Simple Web Server, Structured Concurrency, and more. Support for JDK 19 will be available in a future release. See #4957 and #5063.
-
Reduced the GraalVM Native Image installable file size by around 80MB: the LLVM backend is now shipped as a separate
native-image-llvm-backend
component (no longer shipped by default withnative-image
). - Updated the Oracle JDK release on which GraalVM Enterprise Edition is built to:
- 11.0.17 for Java 11-based GraalVM Enterprise. See Java SE 11 Release Notes
- 17.0.5 for Java 17-based GraalVM Enterprise. See Java SE 17 Release Notes
- 19.0.1 for Java 19-based GraalVM Community. See Java SE 19 Release Notes
Java and Compiler Updates
- Added support for JDK 18 and JDK 19 features such as Virtual Threads, the Simple Web Server, Structured Concurrency, and more in the GraalVM based on JDK 19 builds.
- Improved JIT compilation isolation by using one isolate per the
libgraal
compiler thread. This avoids all GC interference between the compiler threads which reduces GC pauses during compilation. This translates to improved compilation speed in general. On the DaCapo benchmarks, compilation as measured in bytecodes-per-second at least doubled, with individual benchmarks such asfop
andpmd
showing a 3x speed up. To enable the old mode, add-XX:JVMCINativeLibraryThreadFraction=0.66 -XX:JVMCIThreadsPerNativeLibraryRuntime=0
to the command line. - Added a dedicated Native Image GC policy for
libgraal
that will adjust the Eden space aggressively to minimize RSS memory usage. - Improved
jlink
behavior so that it produces images which use the Graal compiler (libgraal
) as the top-tier compiler. Ajlink
-ed image produced from GraalVM uses JVMCI by default, andjava -version
output is GraalVM-branded. - Enabled
StripMineCountedLoops
andEarlyGVN
compiler optimizations by default. These were first introduced in the 22.2 release with the-Dgraal.StripMineCountedLoops=true
and-Dgraal.EarlyGVN=true
options. - Implemented loop vectorization for integer min/max operations. This implementation handles all integer sizes, hand-written min/max patterns (for example,
x > y ? x : y
, not justMath.min
/Math.max
), unsigned min/max, and fold-shaped loops (for example, computing the minimum or maximum element of an array). - Removed the deprecated JMX
HotSpotGraalRuntime
management bean from bothlibgraal
andjargraal
.
Native Image
- Added support for JDK 19 and OpenJDK Project Loom Virtual Threads (JEP 425): virtual threads for high-throughput lightweight concurrency are supported with both the Serial GC and the G1 GC. Since virtual threads are a preview feature in JDK 19, they are also a preview feature for GraalVM Native Image. They can be enabled with the new option
--enable-preview
. Virtual threads are not available on GraalVM based on JDK 11 and JDK 17, and they are not available yet for native executables that contain a Truffle language (JavaScript, Python, etc.). See #4920 for more details. - Identified and added missing parts in the Native Image API: functionality where applications and frameworks reached into internals of the
native-image
generator. It includes a new public API for programmatic registration of JNI, Resource, Proxy, and Serialization classes from Feature interface classes, and moving annotations for method substitutions to the Graal SDK. Even though these annotations are not supported APIs, for practical reasons they can now be used without depending on thenative-image
generator. For this release, thenative-image
internals are still published to Maven Central, but this will be stopped in a future release. We therefore encourage all users to only rely on the Graal SDK starting with this release, and if this is not possible, report further missing API on GitHub. - Update the G1 GC version that is available in Native Image to JDK 19. This G1 version is also used for native executables based on JDK 11 and JDK 17. In addition, the G1 GC can now be used with native executables that are statically linked with the
musl
C library. - Added
RuntimeResourceAccess#addResource(Module module, String resourcePath, byte[] resource)
API method that enables resources to be injected into native executables.
Debugging and monitoring experience improvements:
- Improved the debugging experience to identify memory usage and memory leaks (contributed by Red Hat). For example,
perf report
is able to associate code addresses sampled during aperf
record session with Java methods and print the DWARF-derived method name for the method in its output histogram. Read more about special considerations for usingperf
andvalgrind
in the documentation. - Added the
--enable-monitoring=<all,heapdump,jfr,jvmstat>
option to enable fine-grained control over monitoring features included in native executables. The old option-H:±AllowVMInspection
should no longer be used. The new option is part of the supported API. - Added initial support for jvmstat to GraalVM Community Edition. Previously, this was available in GraalVM Enterprise Edition only.
- Added support for the JFR events
JavaMonitorEnter
,JavaMonitorWait
, andThreadSleep
(contributed by Red Hat). - Add the option
--enable-sbom
to the supported API. The old non-API option-H:IncludeSBOM
should no longer be used.
Build output enhancements:
- Introduced the experimental
-H:BuildOutputJSONFile=<file.json>
option to export build output information in JSON format. In addition, the old build output style and the-H:±BuildOutputUseNewStyle
option are removed. - Added the
--silent
option to silence the build output.
GraalVM Native Image ecosystem updates:
- Spring Boot 3.0.0-M5 comes with improved AOT processing and GraalVM Native Image support.
- JUnit framework 5.9.1 introduced the
@EnabledInNativeImage
and@DisabledInNativeImage
annotations to enable users to include/exclude testing GraalVM native executables. - Micronaut added a new Test Resources feature with support for GraalVM Native Image.
- IntelliJ IDEA 2022.2 has added experimental support for debugging GraalVM Native Image executables.
Known Issues with JDK 19 Support
Note that the java.io.Console
API does not work properly on JDK 19: The information whether or not a Console
is available is wrongly computed at build time. This means that, for example, when building a native executable on a CI system without a terminal, the executable will not have a Console
available even when running inside a terminal. This also affects the Truffle language launchers that are shipped with GraalVM.
The project changelog is available on GitHub.
Polyglot Runtime
- Introduced the
SnippetRun#getException()
method that provides anIllegalArgumentException
thrown during snippet execution.IllegalArgumentException
is converted to aPolyglotException
before it is returned.
A full list of updates can be found in the changelog.
JavaScript and Node.js
- Implemented the WebAssembly multi-value proposal to add support for returning multiple values to WebAssembly.
- Updated Node.js to version 16.16.0. Note that GraalVM Node.js support ends when Node 16.x reaches end-of-life (see Node.js release schedule).
- Enabled ECMA-402 Internationalization API by default. It can be disabled using the
--js.intl-402=false
option. - Added an experimental option
--js.unhandled-rejections=handler
that enables using a custom callback to track unhandled promise rejections. - Implemented the Decorators (stage 3) proposal.
The project changelog is available on GitHub.
Python
- Renamed the entire project from GraalPython to GraalPy, and the launcher from
graalpython
tograalpy
. This change also updates GraalVM’s launchers to include symlinks frompython
andpython3
tograalpy
for better integration with other tools.
Performance improvements:
- Switched to the new bytecode interpreter by default. This change brings better startup performance and memory footprint while retaining good JIT-compiled performance. For example, the development time actions such as
pip install <package>
or runningimport <package>
in the REPL are now 20-25% faster and use around 25% less memory on average.
Compatibility improvements:
- Switched to a new parser generated from CPython’s new PEG grammar definition. It brings better compatibility and enables us to implement the
ast
module. - Added support for Tracing API (
sys.settrace
), which makespdb
and related tools work on GraalPy. - Added support for Profiling API (
sys.setprofile
), which makes theprofile
package work. - Updated
pip
to automatically choose the best version for known packages. You can usepip install pandas
, andpip
will select the versions ofpandas
andnumpy
that is tested in the GraalPy continuous integration. - Added support for Flask.
- Implemented PEP 405 for full support of virtual environments. This fixes issues with the
virtualenv
package andtox
that are used in PyCharm or in many projects’ continuous integration (CI) jobs.
A full list of updates can be found in the changelog.
Ruby
New features:
- Foreign strings now have all methods of Ruby String. They are treated as
#frozen?
UTF-8 Ruby Strings. - Added the
Java.add_to_classpath
method to add JAR paths at runtime. It enables users to modify the JVM classpath when running in the JVM mode (--jvm
). For example, a Ruby gem, managed via Bundler, loads a Java library can update the classpath itself. See #2693 for more details. - Added support for Ruby 3.1’s Hash shorthand and punning syntax, and anonymous block forwarding syntax.
- Added the following keyword arguments to
Polyglot::InnerContext.new
:languages
,language_options
,inherit_all_access
,code_sharing
.
Performance-related improvements:
- Improved interpreter performance by optimizing for better host inlining.
- Used
poll
instead ofselect
for simple IO waiting to reduce overheads (#1584). - Improved interoperability with Java: no more conversion between Java Strings and Ruby Strings at the interop boundary.
Compatibility updates:
- Added support for
#dup
and#clone
on foreign strings. - Implemented
rb_ivar_foreach
to iterate over instance and class variables like in CRuby. See #2701 for more details.
Changes:
- Removed
Truffle::Interop.{import_without_conversion,export_without_conversion}
. UsePolyglot.{import,export}
instead. - Removed
Truffle::Interop.members_without_conversion
. UseTruffle::Interop.members
instead.
A full list of changes is available in the changelog.
R
- Implemented the global native variable API to improve R graphics isolation when using multiple R contexts. Users can now use a native package from two R contexts at the same time. The API consists of several upcalls, named with the
FASTR_GlobalVar
prefix, for example,FASTR_GlobalVarAlloc
. Currently, only grid and graphics built-in packages are refactored to use the global native variable API. - Added partial support for dplyr 1.0.3 to enable users to work with data frames such as objects, both in memory and out of memory. The
SET_PRCODE
,SET_PRENV
, andSET_PRVALUE
upcalls are now implemented.
The project changelog is available on GitHub.
LLVM Runtime
- Updated LLVM toolchain to version 14.0.6.
- Released the LLVM runtime for GraalVM Community Edition for Windows under experimental support.
- Improved support for the x86 extended precision for floating-point numbers. It is now possible to call native functions (for example,
libc
) withlong double
arguments on the x86 architecture. Thelong double
variants ofmath.h
functions now use full precision. Previously they were implemented usingdouble
arithmetic.
Java on Truffle (Espresso)
- Added the polyglot automatic interface type mapping for 1:1 mappings between a host and an embedded guest context.
- Improved interoperability: when an Espresso-to-Espresso conversion was seen, then an Espresso-to-primitive conversion happens. The latter would fail.
- Methods from Espresso objects can now be read to obtain a new interop executable object,
isExecutable
. - Fixed exit status on uncaught exceptions in the main thread.
- Added the
addPath
invokable member to Espresso bindings (polyglot.getBindings("espresso")
, the entry point where class loading happens) ifjava.UseBindingsLoader=true
. It enables adding a new path to the classloader associated with the bindings. It was a necessary addition to better control the behavior of Espresso when going through the Truffle TCK.
The project changelog is available on GitHub.
WebAssembly
- Implemented the Multi-Value proposal. It can be disabled with the option
--wasm.MultiValue=false
. - Enabled the Sign-Extension-Ops and Saturating-Float-To-Int conversions by default.
The project changelog is available on GitHub.
Polyglot Embedding
- Implemented the FieldValueTransformer API as a more generic mechanism to intercept and constant fold field values (replaces the existing
RecomputeFieldValue
for the kindCustom
). It allows modifying the value of a particular field if it is marked as a transformer withBeforeAnalysisAccess#registerFieldValueTransformer
. A transformer must be registered before the field is seen reachable by the static analysis, and only one transformer per field. At build time, the field value transformer provides the value of the field for the image heap. Without a transformer, the value of the field in the image heap is the same as the hosted. This API is necessary for compatibility with Spring. - Added
Context.Builder.allowInnerContextOptions(boolean)
which enables the context to spawn inner contexts and modify and override language options. Inner contexts no longer share code with the initial context. The default value for this privilege is determined according to whetherContext.Builder.allowAllPrivilages(boolean)
is set or not. Do not enable this privilege in security-sensitive scenarios. - Moved Native Image strictly-internal annotation classes from
com.oracle.svm.core.annotate
to (@Alias
,@TargetClass
,@Substitute
, etc.) toorg.graalvm.sdk module
.
A full list of changes is available in the changelog.
Truffle Language and Tool Implementations
- Tuned the host inlining heuristic for reduced code size. A new host inlining tuning guide is available in the documentation.
- Added new capabilities to
TruffleContext
, for example,TruffleContext.Builder.forceSharing(Boolean)
to force or deny code sharing for inner contexts, and many others. Check the Truffle project changelog to see a full list. - Removed several deprecated core APIs, for example,
FrameSlot
,CompilerOptions
, etc. Check the Truffle project changelog to see a full list. - Added
TruffleInstrument.Env#createSystemThread
andTruffleLanguage.Env#createSystemThread
to create a new thread designed to process instrument tasks in the background. - Added
copyStatic
,clearStatic
andswap...Static
additional methods to the Static Frame API. - Added a check if the static frame access is validated when assertions are enabled. Reading a slot with a different type than written to leads to an
AssertionError
. - Deprecated the
TruffleLanguage.Env.newContextBuilder()
method and replaced it with a new methodTruffleLanguage.Env.newInnerContextBuilder(String...)
. The new method no longer inherits all privileges from the parent context and no longer initializes the creator context by default. The new method also allows setting the permitted languages for the inner context similarly to the Polyglot Embedding API. - Changed the behavior of setting application arguments: inner contexts no longer inherit application arguments from their outer context. Now you can set application arguments explicitly for inner contexts using
TruffleContext.Builder.arguments(String, String[])
. - Modified behavior of inner contexts: an inner context no longer uses system exit on exit, even if the polyglot embedder specified it with
Context.Builder.useSystemExit(boolean)
for an outer context. - Introduced the RootNode.getParentFrameDescriptor method to support identifying lexical scope parents of hot methods and compiling them earlier.
A full list of updates can be found in the changelog.
Oracle GraalVM Enterprise Edition 22.2.0.1
(2022-09-20)
This is a patch release for the GraalVM Enterprise 22.2.0 branch which includes:
- Platform updates:
- 11.0.16.1 for Java 11-based GraalVM Enterprise
- 17.0.4.1 for Java 17-based GraalVM Enterprise
- Exception handling in
ClassLoaderSupportImpl#getResourceBundle
whenResourceBundles
are not located in the boot module-layer. - Improved Native Image support for the Java Platform Module System: added the
--list-module
option to thenative-image
generator to check where the resolved modules ended.
Oracle GraalVM Enterprise Edition 22.2.0
(2022-07-19)
- Platform Updates
- Java and Compiler Updates
- Native Image
- Polyglot Runtime
- JavaScript
- Ruby
- Python
- R
- LLVM Runtime
- Java on Truffle
- WebAssembly
- Polyglot Embedding
- Truffle Language and Tool Implementations
- Tools
Platform Updates
- Improved GraalVM packaging experience by reducing the size of the base binary almost ~2x. JavaScript, LLVM runtimes, and VisualVM are now decoupled from the main package and released as separate installable components. The package size of, for example, the GraalVM Enterprise macOS distribution dropped from ~490 MB to ~270 MB. This makes GraalVM more modular offering the same RPM-like experience when you add support for only what you need.
- The Native Image component size has increased because necessary runtime components (Substrate VM) and static libraries (used by Substrate VM) are now part of the Native Image installable.
- Released GraalVM Enterprise distribution for Apple Silicon (AArch64 architecture). The support is experimental. You can optionally install Native Image, the LLVM toolchain, Java on Truffle, and language runtimes for JavaScript, Ruby, Webassembly.
-
GraalVM Enterprise will no longer run on some older Linux AMD64 distributions. It is now built against
glibc
2.17 (instead of 2.12), and as a result it may not run on Oracle Linux 6 or other RHEL 6 derivatives. - Updated the Oracle JDK release on which GraalVM Enterprise Edition is built to:
- 11.0.16 for Java 11-based GraalVM Enterprise. See Java SE 11 release notes
- 17.0.4 for Java 17-based GraalVM Enterprise. See Java SE 17 release notes
Java and Compiler Updates
-
Enhanced the Novel Strip Mining optimization for counted loops. The optimization can be enabled with this option:
-Dgraal.StripMineCountedLoops=true
. Strip Mining optimization converts a single long running loop into a nested loop where the inner body runs for a bounded time. It allows you to put a safepoint in the outer loop to reduce the overhead of safepoint polling. By choosing the right value for the outer loop stride, you still ensure reasonable time-to-safepoint latency. The latter is particularly important for low pause time collectors such as ZGC and Shenandoah. For example, this loop:int checksum = 0; for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) { checksum += i; // safepoint_poll }
would become:
int checksum = 0; for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE - 1000; i += 1000) { for (int j = i; j < i + 1000; j++) { checksum += j; } // safepoint_poll } for (int i = Integer.MAX_VALUE - 1000; i < Integer.MAX_VALUE; i++) { checksum += i; // safepoint_poll }
This optimization adds to Truffle guest language safepoints latency. For example, Novel Strip Mining optimization eliminates HotSpot safepoints from a counted loop that does allocation (the HotSpot allocation slow path has a safepoint). However, this allocation related safepoint will not trigger a Truffle safepoint. As such, the Truffle safepoint latency can be very long. In this case, Novel Strip Mining optimization can decompose such a loop into strips and issue a Truffle safepoint poll once per strip.
-
Enabled floating and global value numbering of division nodes early on in the compilation pipeline if it is known they will not trap. This means division-by-constant operations can be commoned and moved out of loops if the constant divisor proves that they cannot throw div-by-zero exceptions. See #3866.
-
Introduced a global value numbering optimization for fixed nodes early in the compilation pipeline. Disabled by default, but can be enabled with
-Dgraal.EarlyGVN=true
. This optimization improve workloads that require complex partial escape analysis and unrolling optimizations in order to optimize away constant loops with complex object allocations. This optimization can also speed up Native Image build time (by reducing graph sizes earlier in the compilation pipeline) as well as speeding up the generated native executables themselves by folding more memory operations.
Native Image
- Enhanced the compatibility of GraalVM Native Image with the 3rd party libraries. The Oracle GraalVM team in conjunction with the Spring, Micronaut, and Quarkus teams have created a GitHub repository, GraalVM Reachability Metadata Repository, a centralized place that provides configuration (reachability metadata) for libraries which do not support GraalVM Native Image by default. The support needs to be enabled explicitly. For example, in Gradle you can enable this repository with:
graalvmNative { metadataRepository { enabled = true } }
The GraalVM Reachability Metadata Repository enables users to share and reuse reachability metadata for the most popular libraries in the Java ecosystem. Check the documentation for more information.
-
The
native-image
generator now runs on the module path by default. This is part of a longer-term effort to support module-based applications using a clean module-based generator. The module system prevents direct access to internals of thenative-image
generator by default. Applications and frameworks can still provide command-line arguments to open up the internals again using the usual module system command line options. For now, the old mode of running thenative-image
generator can be enabled by setting the environment variableUSE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM=false
(but note that this mode will be deleted without replacement in a future release). -
Improved many internal data structures of the
native-image
generator to reduce the memory footprint. This makes Native Image builds more robust when running on memory-constraint environments like cloud-based build services, GitHub Actions, or in Docker containers. Many larger application now build successfully with 2 GByte of Java heap size available for thenative-image
generator. -
Added support for Software Bill of Materials (SBOM). The
native-image
generator can optionally include a SBOM into a native executable to aid vulnerability scanners. Currently, the CycloneDX format is supported. Users may embed a CycloneDX SBOM into a native executable by using the-H:IncludeSBOM=cyclonedx
option during compilation. After embedding the compressed SBOM into the executable, you can use the Native Image Inspect tool to extract the compressed SBOM with this command:$JAVA_HOME/bin/native-image-inspect --sbom <path_to_binary>
. Check the documentation for more details. GraalVM Enterprise only -
Added a new optimization for String concatenation operations (including
StringBuilder
operations): it eliminates temporary memory buffers during concatenation. GraalVM Enterprise only -
Heap dumps at image run time are now supported in GraalVM Community Edition. Also, a new runtime option,
-XX:+DumpHeapAndExit
, has been introduced to dump the initial image heap of a native executable. Check the documentation how to dump the initial heap of a native executable. -
Improved debugging support on Linux: The Dwarf information now contains information about parameters and local variables (contributed by Red Hat).
-
Certain Native Image options can now only be provided on the command-line and no longer in native-image.properties files. These options also get processed before other options so that they properly pre-configure all other options coming from both the command line and native-image.properties files. The affected options are
--exclude-config
,--configurations-path
,--debug-attach
,--diagnostics-mode
, as well as all the options to print help messages. -
Added a new runtime option
-XX:+ExitOnOutOfMemoryError
that aborts the execution of a native executable on the first out-of-memory error. -
Added support for most methods of
OperatingSystemMXBean
at image run time. - Annotation classes are no longer force-initialized at image build time. Like any other class, annotation classes can now be initialized either at build time or at run time using the according command-line options (
--initialize-at-build-time
or--initialize-at-run-time
) or the Feature API. This fixes problems with transitive dependencies of annotations, including non-annotation classes that are used by annotations. See Class Initialization in Native Image.
Polyglot Runtime
- Introduced updates that improve interpreter-only performance for 20-30% and warmup for GraalVM supported languages.
- Added support in
libgraal
for caching encoded graphs across Truffle compilations to speedup partial evaluation. The cache is enabled by default and can be enabled/disabled with the--engine.EncodedGraphCache
option. This update contribute to faster compilation time improvements on HotSpot. - Implemented a new domain specific inlining phase for the Truffle interpreter host compilation, which improves the interpreter performance for GraalVM Native Image. See the Host Compilation for Interpreter Java code reference manual for details.
A full list of updates can be found in the changelog.
JavaScript
- JavaScript support is now decoupled from the base GraalVM installation and can be easily added with this command:
gu install js
. - Improved JavaScript interoperability with Java: now foreign objects get a JavaScript prototype assigned by default, unless explicitly turned off. This feature was available behind the experimental option
js.foreign-object-prototype
before and now made default. Previously, if you use any foreign object like a Java array in JavaScript code, you could access it by using the index operator[]
. The array did however lack theArray.prototype
, and thus methods likeindexOf
orsort
could not be easily called on it. With this change, foreign objects get a fitting JavaScript prototype assigned and can be “manipulated” with regular JavaScript functions. This adds more flexibility for regular Java or GraalVM Polyglot API users. - Extended the implementation of the Temporal specification in GraalVM JavaScript, which provides standard objects and functions for working with dates and times. Changes from the specification are adopted continuously. Temporal objects can now be converted to compatible Java objects when appropriate, using the Value API’s methods like
asDate()
. The opposite direction, providing Java Temporal objects and using them with JavaScript Temporal methods is planned for a future release.
See the project changelog.
Ruby
- Added support for AArch64 distribution for macOS (Apple Silicon).
- Added support for OpenSSL 3.0.0 by updating the
openssl
gem. - Updated to Ruby 3.0.3. The 3 CVEs did not affect TruffleRuby, this is to bring the
stdlib
and gem update. - Implemented several changes that improve Ruby performance on GraalVM:
- Reimplemented
Float#to_s
for better performance. - Updated reference processing by making C object free functions and other finalizers more lightweight.
- Improved performance of
RSTRING_PTR
for interned strings. - Enabled caching constant argument formats used with
rb_scan_args_kw
.
- Reimplemented
- Improved compatibility with CRuby 3.2:
-Werror=implicit-function-declaration
is now used for compiling C extensions to fail more clearly and earlier if a function is missing.
A full list of changes is available in the changelog.
Python
- Updated to HPy version 0.0.4, which adds support for the finished HPy port of Kiwi, and the in-progress ports of Matplotlib and NumPy.
- Added an experimental bytecode interpreter for faster startup and better interpreter performance. Using either the previous AST interpreter or the new bytecode interpreter can be switched using the
--python.EnableBytecodeInterpreter
option.
The project changelog is available on GitHub.
R
- Implemented
SET_GROWABLE_BIT
andIS_GROWABLE
C API functions. This fixes installation of the cpp11 0.2.6 package. - Added akima package to the list of “native packages”, so it is by default loaded by the native backend.
The project changelog is available on GitHub.
LLVM Runtime
- The LLVM runtime is now decoupled from the base GraalVM installation and can be easily added with this command:
gu install llvm
. - Updated LLVM toolchain to version 14.0.3.
- Added support for AArch64 distribution for macOS (Apple Silicon).
- Improved support for POSIX Threads,
pthreads
, managed execution mode. In mode does not allow to call native code and access native memory.
Java on Truffle
- Added support for AArch64 distribution for macOS (Apple Silicon).
- Improved class redefinition: added support appending enum constants. This makes HotSwap capabilites more powerful while changing classes at runtime during a debugging session. See the Enhanced HotSwap Capabilities with Java on Truffle guide.
- Enable the new Class Hierarchy Analysis by default. It provides information about class hierarchy in the guest code, evolving as new classes are loaded.
WebAssembly
- This release is marked by significant performance improvements in GraalVM WebAssembly implementation based on our benchmarks:
- Internal AST memory footprint improvements 3.18x
- Peak performance improvements 1.24xs
Polyglot Embedding
- Added the ability to spawn a
native-image
isolate for eachEngine
orContext
in a native launcher or library. This feature was previously supported only for the JVM deployment. GraalVM Enterprise only - Added
Value.hasMetaParents()
andValue.getMetaParents()
methods that allow lookup of the hierarchy of parents for meta objects (for example, a super class or implemented interface of Java classes). - Added
HostAccess.Builder.allowAccessInheritance
to inherit access to methods that have been explicitly exported in an interface or superclass versus only explicitly vetted method implementations (for example, via@HostAccess.Export
). - Added
List#add
support for polyglot values that are mapped tojava.util.List
.
A full list of changes is available in the changelog.
Truffle Language and Tool Implementations
- Added new static APIs to
com.oracle.truffle.api.frame.Frame
:- Implemented a new static option to
FrameSlotKind
for index-based slots. Frame slots using this kind cannot be changed to another kind later on. Static frame slots can simultaneously hold one primitive and one object value. Static frame slots are intended for situations where the type of a variable in frame slots is known ahead of time and does not need any type checks (for example, in statically typed languages). - Static frame slots are intended for situations where the type of a variable in a frame slots is known ahead-of-time and does not need any type checks (for example, in statically typed languages).
- Implemented a new static option to
- The Static Object Model offers preliminary support for field-based storage also for GraalVM Native Image.
- Truffle IGV dumping with log level 5 (
-Dgraal.Dump=Truffle:5
) now dumps the graph after each method that was fully partially evaluated. This enables debugging of problems only visible during partial evaluation.
A full list of updates can be found in the changelog.
Tools
- Improved building native images on Windows with our GraalVM for Java VS Code Extension. Now,
.\gradlew nativeBuild
on Windows 10 runs inside x64 Native Tools Command Prompt. - GraalVM Updater can now produce JSON output for the
available
,list
, andinfo
commands, which makes it easier for other tools such as the GraalVM for Java VS Code Extension to programmatically use it.
Oracle GraalVM Enterprise Edition 22.1.0
(2022-04-19)
- Platform Updates
- Java and Compiler Updates
- Native Image
- JavaScript
- Ruby
- Python
- R
- LLVM Runtime
- Java on Truffle
- Polyglot Embedding
- Truffle Language and Tool Implementations
- Tools
Platform Updates
- Updated the Oracle JDK release on which GraalVM Enterprise Edition is built to:
- 11.0.15 for Java 11-based GraalVM Enterprise. See Java SE 11 release notes
- 17.0.3 for Java 17-based GraalVM Enterprise. See Java SE 17 release notes
Java and Compiler Updates
- A counted loop is an abstraction the compiler uses to ensure a loop’s iteration limit is a bound integer.
Such loops are subject to major optimizations such as vectorization and partial unrolling.
The Truffle API provides the ability to profile and speculate on a loop counter value having a max value that can be treated as constant by the compiler. The Graal compiler now respects this speculation and will unroll such loops if the max value is small enough. For example, this Ruby loop will now be unrolled:
[1, 2].each { |e| print e }
- Impelemented all the intrinsics annotated by
@IntrinsicCandidate
as of JDK 17. - Removed the
DuplicateIrreducibleLoops
option. To disable irreducible loop handling, set-Dgraal.MaxDuplicationFactor
to a value less than or equal to 1. For ahead-of-time (AOT) compilations, the effort spent to handle irreducible loops is boosted to let Native Image support more programs with irreducible loops. In particular, this mitigates this issue.
Native Image
- The option
--allow-incomplete-classpath
is now enabled by default and deprecated as it is no longer needed. This means that, by default, linking errors are now thrown at executable runtime instead of at build time. The new option--link-at-build-time
enables linking at build time for a specified list of packages and classes. You can provide as many--link-at-build-time
options with specific arguments on command line as you want, for example,native-image --link-at-build-time=foo.bar,foobar.core.MyClass --link-at-build-time=my.other.RandomClass ...
. See #4305. - Added a new “quick build” mode to reduce the time taken to generate a native executable during development. Enable it using the existing option to select the optimization level:
-Ob
, whereb
means optimize for build time. Note that this mode can have a negative impact on peak performance and the size of the resulting executable, thus recommended for development purposes only. - Added a new experimental mode to generate conditional configuration using the Tracing agent. The agent can now generate conditional reflection configuration using a heuristic that operates on the call graph, that is, those reflection elements that are only registered when a predicate class is reachable. Two modes are supported:
- By passing
experimental-conditional-config-filter-file=<path>
to the agent. In this mode, the agent directly generates the configuration. The filter tells the agent which code belongs to the user’s application. Conditions are only generated on the classes belonging to the user’s application. - By passing
experimental-conditional-config-part
to the agent and usingnative-image-configure generate-conditional --user-code-filter=<path> --input-dir=<agent-ouput> --output-dir=<config-output>
to generate the configuration. Check the Native Image documentation for more information.
- By passing
-
Introduced code size improvements that help reduce the size of native executables. Performance improvements and memory footprint reductions for the
native-image
generator lead to faster build times (independent of the new “quick build” mode). The following table shows the image size and time taken to build an executable for Spring petclinic-jdbc, a well-known large application. The numbers are measured on a developer machine with Linux, AMD64, JDK 11, GraalVM Enterprise, spring-native 0.10.3.GraalVM Version Build Time Executable Size Build Time with -Ob GraalVM 21.1 2 min 50 sec 138 MB GraalVM 21.2 2 min 43 sec 133 MB GraalVM 21.3 2 min 13 sec 121 MB GraalVM 22.0 2 min 20 sec 119 MB GraalVM 22.1 2 min 5 sec 103 MB 1 min 17 sec - Added support for Apple Silicon, an ARM-based system on a chip. One of the missing features was, for example, support for Truffle just-in-time compilation.
- Improved the ahead-of-time compilation of Record classes. For example, annotations of Record classes can now be accessed at executable runtime.
- Added support for the following JFR events:
SafepointBegin
,SafepointEnd
,GarbageCollection
,GCPhasePause
, andGCPhasePauseLevel
(all contributed by Red Hat). All GC-related JFR events are currently limited to the Serial GC. - JFR can now be used to profile the
native-image
tool itself, for example, by adding-J-XX:StartFlightRecording=dumponexit=true
on the command line tonative-image
. - Improved handling of
static synchronized
methods: the lock is no longer stored in the secondary monitor map, but instead in the mutableDynamicHubCompanion
object. With this change, the synchronization ofstatic
methods is as fast as the synchronization of instance methods. - Added support for
AccessControlContext
that helps to control the context that can be modified using privileged operations. - References handling is now performed in a separate thread by default. It helps prevent occasional deadlocks when handling references and running garbage collection in the same thread.
- Added the possibility to include helper methods in the native executable that can be invoked from
gdb
and therefore help debugging native executables. Provide the option-H:+IncludeDebugHelperMethods
tonative-image
to enable this feature. - Deprecated the
JDK8OrEarlier
andJDK11OrLater
classes because JDK 8 is no longer supported. They will be removed in a future release. - Every annotated element (classes, methods, fields, etc.) will be included in the image regardless of reachability. It may require some configuration changes, especially for dynamically-generated proxies. For example, using following code:
@AccessedAnnotation @NonAccessedAnnotation class Example { boolean func(Object obj) { Proxy.getProxyClass(classLoader, Example.class.getDeclaredAnnotations()); obj.isAnnotationPresent(AccessedAnnotation.class); } }
Previously, you would only specify the
[AccessedAnnotation]
configuration. Now the proxy configuration would look like[AccessedAnnotation], [NonAccessedAnnotation]
. - Prevented class path entries in
META-INF/MANIFEST.MF
being processed in the wrong order. See #4374 - Now using
-H:CompilerBackend=llvm
also works if thenative-image
builder runs on the module-path (when building with the--module-path
flag). See #4336. - Improved building native executables inside a container if a resource path contains a forward slash,
/
, as a working directory. See #4002.
JavaScript
- Updated Node.js to version 16.14.2.
- Implemented a number of proposals:
- The Intl.NumberFormat v3 proposal.
- The Array Grouping proposal. It is available in the ECMAScript staging mode using the
--js.ecmascript-version=staging
option. - The Temporal proposal. It is available behind the experimental option
--js.temporal
. - The Array Find from Last proposal. It is available in ECMAScript staging mode using the
--js.ecmascript-version=staging
option.
- Added a new option
--js.string-lazy-substrings
, defaulting totrue
, to toggle the copying behavior of String slices. When enabled, String slices internally create String views instead of copying the given String region, which increases performance but may also increase memory utilization.
A full list of changes is in the changelog.
Ruby
- Implemented full Ruby 3 keyword arguments semantics (see #2453).
- Foreign exceptions are now fully integrated, have most methods of
Exception
and can be rescued withrescue Polyglot::ForeignException
orrescue foreign_meta_object
(see #2544). - Foreign exceptions are no longer translated to
RuntimeError
but instead remain as foreign exceptions, see the documentation for how to rescue them. - Added various fixes for the digest default gem, RubyGems and Bundler (#2577, #2605, #2586).
- Fixed
Module#const_get
to raise aNameError
when nested modules do not exist, needed for Rails 7 scaffolding. - Removed extra array allocations for method calls in the interpreter to improve warmup performance.
- Reduced memory footprint for C extensions (separate Init_ allocations from the rest, fewer handles, and others).
- Optimized
Dir[]
,String#<=>
,Regexp#match?
andFile.read
(see #2536).
A full list of changes is available in the changelog.
Python
- Added support for module freezing which makes the Python REPL start 30% faster and with 40% less memory usage.
- Added support for more private key formats (PKCS#1, password protected) in the
ssl
module. - Improved compatibility with the following PyPI packages:
lxml
,pytz
,Pillow
,urllib3
,setuptools
,pytest
,twine
,jinja2
, andsix
.
A full list of changes is in the changelog on GitHub.
R
- JavaGD is now the default graphical subsystem. The
--R.UseInternalGridGraphics
option is deprecated. Most functions fromgraphics
grid
, andgrDevices
base packages are supported. Supported devices are SVG, PNG, JPEG, BMP, AWT. Display lists are fully implemented. See the documentation for more information. - GraalVM’s R runtime now uses system
zlib
instead of its own copy of this library. This makeszlib
a requirement for GraalVM’s R runtime, however, most Linux distributions and all supported macOS versions havezlib
preinstalled. One conceivable situation, where this may not be the case, could be some optimized stripped down Docker images.
The project changelog is available on GitHub.
LLVM Runtime
- Added support for C/C++ thread local storage.
- Added support for new interop APIs:
Date
,Time
,TimeZone
andInstant
(seegraalvm/llvm/polyglot-time.h
)Buffers
(see graalvm/llvm/polyglot-buffer.h)
- Replaced custom logging options in the
--llvm.*
namespace (e.g.,--llvm.traceIR
) with Truffle Logger options (--log.llvm.*
, for example,--log.llvm.TraceIR.level=FINER
).
See a full list of changes and option replacements in the project changelog on GitHub.
Java on Truffle
- Enabled explicit reference processing in single threaded mode. This means the single threaded mode is usable in many more situations to prevent leaking resources. It is available as a command called
<ProcessReferences>
, which can be run withcontext.eval("java", "<ProcessReferences>")
. - Introduced new hotswap capabilities:
- Added support for changing the super class and implemented interfaces.
- Added support for ‘Move Field in Hierarchy’ refactoring where the state is preserved.
- Turned on by default changing fields and class access modifiers.
- Enabled responding to Truffle safepoints more promptly in many situations (including when using monitors).
- Adopted the AbstractTruffleException API to improve exception handling thrown during the execution of a guest language program.
- Added a new implementation for reading
jimages
(libs/modules
), which is enabled by default. This improves context startup time when using the LLVM backend. Use--java.JImage=native
to revert to the old implementation. - The Java on Truffle LLVM Java libraries are now provided for macOS (previously they were available for Linux distributions only) and can be installed using GraalVM Updater:
gu install espresso-llvm
.
Polyglot Embedding
- Changed the default Object target type mapping (Value.as(Object.class)) for values that have both array elements and members from
Map
toList
. Note that this is an incompatible change. Embedders relying on the dynamic typeMap
after aObject
target type coercion will have to migrate their code. The previous behavior can be restored using a custom target type mapping, for example:HostAccess access = HostAccess.newBuilder(HostAccess.EXPLICIT) .targetTypeMapping(Value.class, Object.class, v -> v.hasMembers() && v.hasArrayElements(), v -> v.as(Map.class)) .build(); try (Context c = Context.newBuilder().hostAccess(access).build()) { // run application }
The changelog is available on GitHub.
Truffle Language and Tool Implementations
- Added an API for Truffle languages, namely
Language#getWebsite()
, andInstrument#getWebsite()
for instruments to provide information for a website. Developers can specify a URL for a website with further information about their language/tool. - Added the TruffleStrings implementation, a primitive String type which can be shared between Truffle languages (languages implemented with the Truffle framework). Check Truffle Strings guide for more information.
- Added a
@GeneratePackagePrivate
annotation to change the visibility of generated nodes to package-private even if the template node is public. - Added
TruffleLanguage.Env#createHostAdapter
accepting host symbols and host classes as the types to extend, replacing and deprecating thejava.lang.Class
-based version. - Added the
usageSyntax
property toOption
enabling developers to specify the syntax that their option expects. See the Javadoc for more information. - Removed the deprecated
TruffleException
(deprecated since GraalVM 20.3.0). TheAbstractTruffleException
no longer implementsTruffleException
. TheAbstractTruffleException
methods inherited from theTruffleException
have been removed. As part of this removal, the recommendation for languages how to handle exceptions has been updated. - Added methods to
TruffleContext.Builder
that allow throwing custom guest exceptions when the new built context is cancelled, hard-exited, or closed, and the corresponding exception is about to reach the outer context. In case the customization is not used and the new context is cancelled, hard-exited, or closed, Truffle newly throws an internal error. - Deprecated
TruffleRuntime.getCurrentFrame()
andTruffleRuntime.getCallerFrame()
. They were encouraging unsafe use of theFrameInstance
class.
Other deprecations and updates in the release are listed in the project changelog.
Tools
GraalVM for Java VS Code Extension
-
Updated the workflow to download and install GraalVM Enterprise Edition and its accompanying components using the GraalVM built-in installation wizard in VS Code. As before, to install a GraalVM Enterprise core or additional components, a user has to provide a valid email address and accept the license aggreement. The installation wizard will now use a download token which is bound to the user’s email address and defines the set of accepted licenses. Email verification and licence acceptance takes place via the user’s email client. For more information, see the documentation.
-
Added the NATIVE IMAGE pane to automate the process of tracking and registering dynamic feature calls, making it even easier to build a native executable in VS Code. The pane becomes available when you install GraalVM and with Native Image:
-
Improved the VS Code intergation in VisualVM with the extension. Now you do not have to create a special launch configuration to open VisualVM and start monitoring a Java process. Click the play button in the VISUALVM pane:
-
Improved Groovy support including the ability to Run and Debug Groovy.
GraalVM Updater
- Enhanced the workflow to install components to GraalVM Enterprise Edition from the command line using GraalVM Updater,
gu
. GraalVM Updater will create and use a download token, which is bound to the user’s email address and defines the set of accepted licenses. As before, to install a component, the user has to provide a valid email address and accept the license agreement, but now the email verification and the licence acceptance will happen in the user’s email client. For more information, see the documentation.
Oracle GraalVM Enterprise Edition 22.0.0
(2022-01-18)
- Java and Compiler Updates
- Platform Updates
- Native Image
- JavaScript
- Ruby
- Python
- R
- LLVM Runtime
- WebAssembly
- Java on Truffle
- Polyglot Embedding
- Truffle Language and Tool Implementations
- Tools
Platform Updates
- Dropped support for Java 8. As of this release and later, GraalVM Enterprise distributions will be based on JDK 11 and 17 only.
-
Removed support for JDK versions 12, 13, 14, 15, and 16.
- The Oracle JDK release that GraalVM Enterprise Edition is built on was updated to:
- 11.0.14 for Java 11-based GraalVM Enterprise. See Java SE 11 release notes
- 17.0.2 for Java 17-based GraalVM Enterprise. See Java SE 17 release notes
Java and Compiler Updates
- Added a new loop rotation optimization that converts more non-counted loops to counted loops. A counted loop is an abstraction the compiler uses to ensure a loop’s iteration limit is a bound integer. When the loop is counted, it becomes amenable for partial unrolling, vectorization and other optimizations to improve performance. For example, the following code for
LinkedList.toArray()
in JDK 17:public Object[] toArray() { Object[] result = new Object[size]; int i = 0; for (Node<E> x = first; x != null; x = x.next) result[i++] = x.item; return result; }
will be optimized by the compiler to:
public Object[] toArray() { Object[] result = new Object[size]; int i = 0; Node<E> x = first; if (x == null) return result; // Loop condition 1 while (true) { if (i |>=| result.length) deoptimize(); // Loop condition 2 result[i++] = x.item; x = x.next; if (x == null) break; // Loop condition 1 } return result; }
For a microbenchmark centered on
LinkedList.toArray()
, loop rotation brings a gain in performance of just over 10%. For workloads containing a lot of non-counted loops with a similar shape, performance improvements of up to 30% have been measured. Loop rotation is disabled by default in 22.0 and can be enabled with-Dgraal.LoopRotation=true
. - Improved the Graal compiler treatment of execution profiles.
Graal was designed as an aggressive JIT compiler that heavily relies on profiles (see here and here) collected by the underlying runtime (HotSpot VM or Native Image).
The profiles are used by the compiler to determine which branches are important, how often loops are executed and which types are used in polymorphic code.
That is, the compiler relies on profiles to determine where to focus optimization effort.
As such, the quality of the profiles is critical to optimizations such as inlining, duplication, and vectorization.
The compiler now automatically switches to an “AOT” (ahead-of-time) mode where major optimizations can still do a reasonable job in the absence of profiles.
This helps in the following situations:
- Truffle languages that do not profile uncommon patterns that still can become hot.
- Native Image without PGO.
We observe performance improvements for GraalVM Enterprise of up to 25% for loop and type-check heavy benchmarks that lacked good profiles. This optimization is always enabled and cannot be disabled as it is in the core of the compiler. It is transparent to the user and should provide general better code in absence of precise branch and loop profiles.
- Added a new optimization to improve the performance in Native Image of a type switch (i.e., a series of cascading
instanceof
branches). For example:void foo(Object o) { if (o instanceof A) { ... } else if (o instanceof B) { ... } else if (o instanceof C) { ... } }
With the new optimization, the null check and load of
o
’s class are factored out:void foo(Object o) { if (o != null) { Object nonNullO = o; Class oClass = nonNullO.getClass(); if (A.class.isAssignableFrom(oClass)) { ... } else if (B.class.isAssignableFrom(oClass) { ... } else if (C.class.isAssignableFrom(oClass)) { ... } }
This optimization only pays off if there are subclasses of A, B and C that Native Image sees as allocated. Otherwise, the
instanceof
tests are reduced to==
comparisons on the class ofo
.
A full list of compiler changes in GraalVM Community Edition can be found in the compiler changelog.
Native Image
- Added updates to reduce image size: a more compressed encoding for stack frame metadata reduces image size for all images. In addition, an optimized implementation of
String.format()
makes localization classes unreachable for small images like “Hello World” and reduces their size significantly. Note: TheString.format
optimization is available with GraalVM Enterprise only. - GraalVM 22.0 will be the final release in which the
native-image
builder can be executed with JDK 8. Since JDK versions 12, 13, 14, 15, 16 are no longer supported, there is no need to explicitly check for and allow these versions. It is recommended to use Native Image with GraalVM JDK 11 or JDK 17. - Introduced a new user-friendly build output for
native-image
with progress bars and more summary information about a native image build process. The old output can be restored with-H:-BuildOutputUseNewStyle
. - Enabled a new garbage collection policy for the Serial GC by default. This reduces the time spent in GC and/or the RSS size of the application up to 30%. The Serial GC algorithm is a good choice for small heaps.
- Improved support for the Java Platform Module System: the options
--add-reads
and--add-modules
are now supported bynative-image
. Also, all module-related options like--add-reads
,--add-exports
, and--add-opens
are now applied before the classpath/module-path scanning. This ensures the modules are properly configured before class loading to prevent the class loading errors. More information about modules is added to the image heap, which allows more module introspection at run time. - Added support for reflective introspection of sealed classes on JDK 17:
Class.isSealed()
andClass.getPermittedSubclasses()
. - Removed support for JLine 2. Substitutions for JLine 2 were historically included in Native Image. Since JLine 2 is no longer maintained, the support was removed without replacement.
- Removed the option
-H:SubstitutionFiles=...
to register substitutions via a JSON file. - Updated the C to Java interoperability: custom prolog, epilogue, and exception handling methods for
@CEntryPoint
entry points from C to Java must be annotated with@Uninterruptible
. They were always treated as uninterruptible, but now they must be marked explicitly. - Improved the Native Image API: added
CEntryPoint#include
attribute which can be used to controll if the entry point should be automatically added to a shared library. The Native Image API is now also supported on the Windows AARCH64 platform.
JavaScript
- Enabled ECMAScript 2022 mode/features by default.
- Updated Node.js to version 14.18.1.
- Implemented several proposals: Intl.DisplayNames v2, Intl Locale Info, Intl.DateTimeFormat.prototype.formatRange, Extend TimeZoneName Option, Intl Enumeration API.
- Added a new option
js.esm-bare-specifier-relative-lookup
, defaulting tofalse
, to customize how bare specifiers for ES Modules are resolved. When disabled, bare specifiers are resolved with an absolute path lookup. When enabled, bare specifiers are resolved relative to the importing module’s path.
A full list of changes is available in the changelog.
Ruby
- Updated to Ruby 3.0.2, see #2453. Most of Ruby 3 changes are implemented in this release, with the exception of Ractor, parser changes and keyword arguments changes.
- TruffleRuby now requires Java 11 or later and no longer supports Java 8.
- Updated Regexp objects to be interned in a similar way to symbols. As a consequence, all Regexp instances are frozen.
- Added various optimizations to make the interpreter faster (before the code is JIT-compiled).
A full list of changes is available in the changelog.
Python
- Added support for
pyexpat
module, which is a Python module for fast non-validating XML parsing, also known asexpat
. - Implemented the
_csv accelerator
module to read and write tabular data in CSV format. - Improved compatibility with PyPI packages such as
wheel
,click
, andujson
.
The project changelog is available on GitHub.
R
- Improved the internal infrastructure, compatibility with the Truffle framework and popular R packages.
- Adopted the new NodeLibrary, as a replacement for the old API that was removed in this release. It provides access to guest language information associated with a particular Node location. This helps GraalVM tool developers to better support the R language.
NodeLibrary was introduced
The project changelog is available on GitHub.
LLVM Runtime
- Switched to the new Truffle Frame API.
- Optimized the loop count to report profiles also in first-tier compiled code. This improves the warmup by transitioning from first-tier to second-tier compilation sooner for loop-heavy methods.
- Added a fix to properly reuse library dependencies if some library with the same “soname” is already loaded. This allows users to depend on libraries that can not be found automatically on the library search path, by manually loading them first.
The project changelog is available on GitHub.
WebAssembly
- Improved the compatibility of GraalVM’s WebAssembly runtime with the Truffle framework by adopting the new Frame API.
- Implemented the Sign-Extension-Ops proposal. It is available behind the experimental option
--wasm.SignExtensionOps
.
Java on Truffle
- Improved compatibility with the Truffle framework by adopting the new Frame API.
- Added support for more class changes during a class redefinition, namely changes to fields and class access modifiers. Enable with the
--java.ArbitraryChangesSupport=true
flag.
Polyglot Embedding
- Introduced the first version of Polyglot Isolates. You can spawn a native image isolate for a each
Engine
orContext
by callingContext.Builder.option("engine.SpawnIsolate", "true")
. This enables heap isolation between the host and guest applications. Using isolates improves security, startup and warmup time of polyglot languages, and provides strong memory isolation for guest applications. In this mode, calls between host and guest are more costly as they need to cross a native boundary. It is recommended to use theHostAccess.SCOPED
policy with this mode to avoid strong cyclic references between host and guest. This mode is experimental in this release and only supported for JavaScript.
The project changelog is available on GitHub.
Truffle Language and Tool Implementations
- Added new APIs to
com.oracle.truffle.api.frame.Frame
andcom.oracle.truffle.api.frame.FrameDescriptor
:- Added a new “namespace” of index-based slots in
Frame
that is defined during construction of the frame descriptor and cannot be changed afterwards. - Added a second new “namespace” of slots (called auxiliary slots) in
Frame
that can be added to the frame descriptor dynamically (and which only supports “object” slots). - In addition to
get...
/set...
methods, the new API also supportscopy
andswap
of frame slots. FrameSlotTypeException
is now an unchecked exception, which simplifies many APIs and removes the need for theFrameUtil
class.
- Added a new “namespace” of index-based slots in
- Introduced sharing layers. A sharing layer is a set of language instances that share code within one or more polyglot contexts. In previous releases language instances were shared individually whenever a new language context was created. Instead language instances are now reused for a new context if and only if the entire layer can be shared. A layer can be shared if all initialized languages of a layer support the same context policy and their options are compatible. Note some changes on observable language behavior:
- For any executed Truffle node it can now be assumed that the current language instance will remain constant.
TruffleLanguage.initializeMultipleContexts()
is now guaranteed to be called prior to all created contexts of the same language instance.- Language initialization will now fail if new language context is initialized and the language is incompatible to the sharing layer of the current context.
- A complete list of behavioral changes can be found in the changelog. Read more on code sharing in the javadoc.
- Introduced a Truffle Exit API to support exit across multiple languages. It provides a unified way for languages to trigger the exit. When triggered, all initialized guest languages are first notified using
TruffleLanguage.exitContext(C,ExitMode,int)
, then all context threads are stopped, and finally, the context is closed. See the documentation for more details. - Imposed a new requirement in
TruffleLanguage.finalizeContext(Object)
for leaving all remaining unclosed inner contexts created by the language on all threads where the contexts are still active. No active inner context is allowed afterTruffleLanguage.finalizeContext(Object)
returns. Not complying with this requirement will result in an internal error. Note that inactive inner contexts are still closed implicitly by the parent context. - Improved the output format for
engine.TraceCompilation
andengine.TraceCompilationDetails
. See the documentation for details. - Added the
--engine.TraceCodeSharing
option that allows to log debug information on code sharing. - Added the
--engine.ForceCodeSharing
and--engine.DisableCodeSharing
option that allows to force enable and force disable code sharing. This option is useful for testing to enable or disable sharing across all contexts of a process.
A full list of updates can be found in the changelog.
Tools
VS Code Extensions
-
Added the Project Explorer which provides an overview of logical project structure, groups sources together and greatly simplifies Java package structure exploration. Project Explorer is an addition to the classical workspace explorer. Use it to build, test, execute and operate your Maven and Gradle Java projects:
-
Introduced a number of refactorings and improvements to GraalVM extensions for VS Code, which include:
-
Provided a graphical UI for the change method signature refactoring:
-
Ability to organize Imports for the source file accompanied with several other settings:
-
Ability to generate
equals()
andhashCode()
methods
-
- Added the Outline View that provides all details about the opened Java file
-
Added the ability to run separate NetBeans Language Server for each VS Code instance using its own classpath and JDK. Use a new option
userdir = global | local
: - Added the ability to manage GraalVM installation(s) with SDKMan
- Improved the Groovy language support by performance and reliability improvements, and ability to run a standalone Groovy script file (without Spock tests)
- Updated the Micronaut Gradle plugin to use the official GraalVM Native Image build plugin. As a consequence, the Micronaut: Build Native Image… action calles the
nativeCompile
job instead ofnativeImage
.
VisualVM
-
Added the exact thread state monitoring using the JFR events. See #363.
-
Added the preliminary support for JDK 18.