Oracle GraalVM for JDK 22.0.2
(2024-07-16)
This is the July 2024 Oracle Critical Patch Update (CPU) for Oracle GraalVM for JDK 22. This release contains fixes to security vulnerabilities announced in the July 2024 Oracle Critical Patch Update Advisory. It includes security fixes released as part of that CPU, some noteworthy bug fixes, listed below, and platform updates.
- Updated the Oracle JDK release on which Oracle GraalVM is built to 22.0.2+9. See JDK 22 Release Notes.
- Version compatibility:
    - Truffle languages and other components version 24.0.2 are designed for use with GraalVM for JDK 22.0.2.
 
- Graal compiler:
    - Added epsilon to more floating-point probability comparisons.
- Fixed SIMD reinterpret stamp folding.
- Improved Strip mining optimization to not strip mine loops with CaptureStateBeginsuccessors.
- Improved Counted strip mining optimization to use correct inner-to-outer state.
- Unsigned loops that need an overflow to terminate must not be counted.
- Properly implemented isConstantStridefor masked negate strides.
 
- Native Image:
    - Fixed values reported in the GCHeapSummaryJFR event.
- Disabled failing tests for the FFM API (project Panama).
- Improved reference processing to be more robust, especially against OOME during tear-down.
- Removed OpaqueValueNodesat the end of low tier.
- Implemented skipping a G1 argument parsing if -H:-ParseRuntimeOptionsis specified.
- Added partial support for physical memory usage and JFR tests for periodic native events.
- Made recomputing Buffer.addressfield for array-based buffers in the image heap.
- Added tests to verify the conversion function.
- Added the runtime module layer tests.
- Removed getpwuidin favor ofgetpwuid_r.
- Fixed data limitation for breakdown charts in build reports.
- Added a few OutOfMemoryError-related fixes.
- Fixed a consistency issue in HeapImplMemoryMXBean.getHeapMemoryUsage().
- Made stack pointer aligned while in deoptStub.
- Changed CCharPointer from “char” to “signed char”.
 
- Fixed values reported in the 
- Truffle framework:
    - Improved the error message when a polyglot implementation is missing.
- Disabled LoggingTest#testDisableLoggersSingleContext.
- Improved the ContextPolicyTest#testOptionDescriptorContextReusemethod to be more robust.
- Fixed the issue when com.oracle.truffle.polyglot.InternalResourceRoots$Root.path()could not be invoked becausethis.owningRootwas null.
- Fixed the issue when SpeculationReasoncould not be re-used after the speculate call.
 
- Java on Truffle (Espresso):
    - Fixed the JDWP method invocation.
- Fixed type converter combination for foreign exceptions and custom type converters.
- Fixed stepping into intrinsified Java methods in JDWP.
- Added profiling to Espresso method resolution from interop.
- Added support for converting foreign object to a non-mapped interface.
 
- JavaScript:
    - Upgraded the underlying Node.js to version 18.20.2.
- Changed the esm-eval-returns-exportsoption be stable and usable in the sandbox mode.
 
- Tooling
    - Updated CPUSampler to not log interrupts if the sampler is already closed, and added various other CPUSampler fixes.
 
Oracle GraalVM for JDK 22.0.1
(2024-04-16)
This is the April 2024 Oracle Critical Patch Update (CPU) for Oracle GraalVM for JDK 22. This release contains fixes to security vulnerabilities announced in the April 2024 Oracle Critical Patch Update Advisory. It includes security fixes released as part of that CPU, some noteworthy bug fixes, listed below, and platform updates.
- Updated the Oracle JDK release on which Oracle GraalVM is built to 22.0.1+8. See JDK 22 Release Notes.
- Version compatibility:
    - Truffle languages and other components version 24.0.1 are designed for use with GraalVM for JDK 22.0.1.
 
- Graal compiler:
    - Removed SIMD vectorization.
- Ensure guards are attached to MoveGuardsUpwardsto respect a DOM tree.
- Run OptimisticGuardsas cleanup beforeOptimisticAliasingAnalysis.
- Fixed a simplification of always-deoptimize FixedGuard.
- Added a guard against deletion in PiNode.canonicalrecursion.
 
- Native Image:
    - Register the virtual thread group unconditionally.
- Updated -gto include all information for profiling. Fix the problem withobjcopystrip command.
- Fixed a deadlock in IsolateAwareTruffleCompiler.tearDownIsolateOnShutdown.
- Report an error if building a static executable without musl libc.
- Consider stack slot sizes when limiting number of parameters in SBOutlining.
- Documented -O,-march, and build artifacts.
 
- Truffle framework:
    - Added InsertGuardFencesPhaseinto runtime compilation phases.
 
- Added 
- Java on Truffle (Espresso):
    - Fixed NullPointerExceptionin JDWP when debugger asks for local variable table.
- Fixed single stepping in Espresso JDWP when stepping within not yet loaded code.
 
- Fixed 
- JavaScript:
    - Upgraded the underlying Node.js to version 18.19.1.
- Added a check to the instanceofoperator whether the left side is a foreign object.
 
Oracle GraalVM for JDK 22
(2024-03-19)
- Platform and Distributions
- Availability of JDK 22 Features
- Java and Compiler
- Native Image
- Polyglot Runtime
- Polyglot Embedding
- JavaScript and Node.js
- Java on Truffle
- Truffle Language and Tool Implementations
Platform and Distributions
- Released Oracle GraalVM for JDK 22 based on Oracle JDK 22. See JDK 22 Release Notes.
- Version compatibility:
    - Oracle GraalVM for JDK 22 is compatible with Truffle languages and other components version 24.0.0.
 
Availability of JDK 22 Features
| JEP | Title | Graal JIT | Native Image | 
|---|---|---|---|
| 423 | Region Pinning for G1 | ✅ | ✅ Garbage collection already enabled during JNI critical regions | 
| 447 | Statements before super(…) (Preview) | ✅ | ✅ | 
| 454 | Foreign Function & Memory API | ✅ | 🧩 #8113 | 
| 456 | Unnamed Variables & Patterns | ✅ | ✅ | 
| 457 | Class-File API (Preview) | ✅ | ✅ | 
| 458 | Launch Multi-File Source-Code Programs | ✅ | ℹ️ | 
| 459 | String Templates (Second Preview) | ✅ | ✅ | 
| 460 | Vector API (Seventh Incubator) | ✅ full optimization in progress | 🏗️ | 
| 461 | Stream Gatherers (Preview) | ✅ | ✅ | 
| 462 | Structured Concurrency (Second Preview) | ✅ | ✅ | 
| 463 | Implicitly Declared Classes and Instance Main Methods (Second Preview) | ✅ | ✅ | 
| 464 | Scoped Values (Second Preview) | ✅ | ✅ | 
| 439 | Generational ZGC (from JDK 21) | 🏗️ #8117 | ℹ️ | 
✅ fully available 🧩 partially available 🏗️ not available yet, in progress ℹ️ not applicable
Java and Compiler
- The Graal module has been renamed from jdk.internal.vm.compilertojdk.graal.compiler. Likewise, the compiler packages moved into thejdk.graal.compilernamespace. This renaming was done in preparation for Project Galahad, and to establish the namespacejdk.graalfor Graal subprojects. See #7621.
- The Graal options now use the jdk.graal.prefix, for example,-Djdk.graal.PrintCompilation=true. The legacygraal.prefix is deprecated but still supported (for example,-Dgraal.PrintCompilation=true).
- Added -Djdk.graal.PrintIntrinsicsto log the intrinsics used by Graal in the current runtime.
Find more updates in the changelog.
Native Image
New Features
- Added experimental support for the Foreign Function & Memory API (part of “Project Panama”, JEP 454) on the x64 architecture. 
The API must be explicitly enabled with -H:+ForeignAPISupport(requires also-H:+UnlockExperimentalVMOptions). Currently, it includes support for foreign memory functionality and foreign functions downcalls. Modules that perform “restricted” native operations must be specified using the--enable-native-accessoption. Check Foreign Function and Memory API in Native Image for a more detailed overview of the FFM API support.
- The --strict-image-heapoption is now enabled by default, so it can be removed from the argument list. It allows all classes to be used at build time but also requires types of all objects in the heap to be explicitly marked for build-time initialization.
- Added support for the NATIVE_IMAGE_OPTIONSenvironment variable, which allows users and tools to pass additional arguments via the environment. Similar toJAVA_TOOL_OPTIONS, the value of the environment variable is prepended to the options supplied tonative-image. See GitHub issue #4650.
- Introduced a dedicated caller-saved branch target register to enable software Control Flow Integrity (CFI).
Improvements
- Improved the Native Image agent tracking calls mechanism: the agent now tracks calls to ClassLoader.findSystemClass,ObjectInputStream.resolveClass, andBundles.of, and registers resource bundles as bundle name-locale pairs.
- Updated the Lambda class name format in Native Image to CapturingClass$$Lambda/0xstableHashto be consistent with the JDK name format.
- Improved intrinsification of method handles. This especially improves the performance of equalsandhashCodemethods for Java records, which use now intrinsified method handles.
- Methods, fields, and constructors of the Java Object class, primitive classes, and array classes are now registered by default for reflection.
- Improved reporting missing metadata in Native Image by throwing special exceptions (experimental). The users can catch metadata exceptions early and debug related issues using the -H:ThrowMissingRegistrationErrors=<package-prefix>option (or-H:ThrowMissingRegistrationErrorsfor all packages).
- Improved Native Image to correctly rethrow build-time linkage errors at run time for registered reflection queries. This prevents the same queries return empty results without throwing an exception. See GitHub issue #6691.
- System#setSecurityManagernow throws a- java.lang.UnsupportedOperationExceptionby default, instead of a VM error in cases where it is expected to throw an exception. This prevents from halting program execution. If the property- java.security.manageris set to anything, but disallow at program startup, this function will throw- java.lang.SecurityExceptionaccording to the Java specification.
Debugging and Monitoring Improvements
- Added support for the following JFR events: AllocationRequiringGC,SystemGC, andThreadAllocationStatistics. See GitHub pull requests #7263 and #7294. (Together with Red Hat.)
- Provided the API option for creating thread dumps --enable-monitoring=threaddump. The option-H:±DumpThreadStacksOnSignalis now deprecated and marked for removal.
Deprecated and Removed Functionality
- The options ParseOnce,ParseOnceJIT, andInlineBeforeAnalysisare deprecated and no longer have any effect.
- The legacy buildoption was removed fromnative-image-agent.
Polyglot Runtime
- Removed support for legacy <language-id>.homesystem property. Onlyorg.graalvm.language.<language-id>.homewill be used.
Polyglot Embedding
- Added the ability to use Value#as(Collection.class)to map guest language arrays, (Value#hasArrayElements()), to the Java Collection interface in order to access the array elements without copying the guest language array. Set GitHub issue #260.
- Implemented mapping of interop buffers to byte[]in a host application, which included:- Added Value#readBuffer(long, byte[], int, int)to enable bulk reads of buffers into byte arrays.
- Custom implementations of ByteSequence, same as the values returned byByteSequence.create(byte[]), are now interpreted by guest languages as buffers.
- Added the ability to use Value#as(ByteSequence.class)to map guest language byte buffers(Value#hasBufferElements())to the read-only ByteSequence interface in order to access the bytes without copying the guest language buffer.
 
- Added 
- Deprecated the FileSystems#allowLanguageHomeAccess()method and introducedFileSystem#allowInternalResourceAccess()as a replacement. To ensure compatibility, both methods now provide support for language homes and internal resources.
Find a complete list of updates in the changelog.
JavaScript and Node.js
- Updated Node.js to version 18.18.2.
- Implemented the WebAssembly threads proposal.
Implemented the Promise.withResolvers proposal. It is available in the ECMAScript staging mode (enabled with --js.ecmascript-version=staging).
- Moved the implementation of Async Iterator Helpers proposal (that was split out from Iterator Helpers proposal) behind the experimental option --js.async-iterator-helpers.
- Implemented the Well-Formed Unicode Strings proposal. It is available in the ECMAScript staging mode (enabled with --js.ecmascript-version=staging).
- Implemented the JSON.parse source text access proposal. It is available in the ECMAScript staging mode (enabled with --js.ecmascript-version=staging).
- The WebAssembly support in Node.js was enabled by default. It can be disabled using the experimental option --js.webassembly=false.
- Replaced the --js.import-assertionsoption with--js.import-attributesbecause the corresponding Import Attributes proposal migrated from the usage of assertions to the usage of attributes.
Java on Truffle (Espresso)
- Added support for transparently converting common JDK exception types that flow from a host to an embedded Espresso context.
- Added support for transparently converting host primitive arrays to Espresso primitive arrays.
- Added support for foreign BigIntegerwhen calling Espresso via the Interop protocol. It included also the adoption offitsInBigIntegerandasBigIntegerTruffle interop messages.
- Added support for removeArrayElementinterop messages for Espresso List objects.
- Added bringing overload-selection to parity with what is supported for calling methods when using a constructor via Interop.
- Java on Truffle (Espresso) can now run on a JDK 22 host. Supported guest JDK versions are 8, 11, 17, and 21.
Truffle Language and Tool Implementations
- The Truffle languages and tools implementations are now loaded exclusively using the context class loader if it is set and Truffle is found there. If the context class loader is not set or Truffle is not found, then the system class loader is used instead. Context class loaders that do not delegate to the system class loader are commonly used to implement hot-reload functionality.
- Added the --engine.AssertProbesoption, which asserts that enter and return are always called in pairs onProbeNode, and verifies the correct behavior of wrapper nodes. Java asserts need to be turned on for this option to have an effect.
- Added a new performance warning to Truffle DSL when mixing shared and non-shared inline nodes/profiles triggers the slow path in inlining support code.
- Added the system property -Dtruffle.UseFallbackRuntime=true. This property is preferred over the usage of-Dtruffle.TruffleRuntime=com.oracle.truffle.api.impl.DefaultTruffleRuntime.
- Added InteropLibrary#readBuffer(long, byte[], int, int)to enable bulk reads of buffers into byte arrays.
- Implemented the onYield()andonResume()instrumentation events in the debugger stepping logic.
Find a complete list of updates in the Truffle changelog.