Skip to content

Update dependency org.graalvm.truffle:truffle-api to v24

RenovateBot requested to merge renovate/org.graalvm.truffle-truffle-api-24.x into main

This MR contains the following updates:

Package Type Update Change
org.graalvm.truffle:truffle-api (source) compile major 22.3.4 -> 24.1.1

Warning

Some dependencies could not be looked up. Check the warning logs for more information.


Release Notes

oracle/graal (org.graalvm.truffle:truffle-api)

v24.1.0

  • GR-43839 Added optional parameter to TruffleString.ByteIndexOfCodePointSetNode to choose whether the node may calculate the input string's precise code range.
  • GR-51253 Extend allowed DynamicObject shape flags from 8 to 16 bits.
  • GR-42882 Changed behavior: Java host interop no longer exposes bridge methods.
  • GR-51385 Added an instrumentation filter to include available source sections only: SourceSectionFilter.Builder#sourceSectionAvailableOnly(boolean)
  • GR-51385 Added a debugger filter to suspend in available source sections only: SuspensionFilter.Builder#sourceSectionAvailableOnly(boolean).
  • GR-52443 Removed many deprecated DynamicObject APIs, deprecated since 22.2 or earlier (Shape methods: addProperty, defineProperty, removeProperty, replaceProperty, newInstance, createFactory, getObjectType, changeType, getLayout, getMutex, getParent, allocator, and related interfaces; Property.set*, *Location methods: getInternal, setInternal, set*, getType, and ObjectLocation).
  • GR-51136 Uninitialized static slots of a Frame can now be read, and returns the default value for the access kind.
  • GR-38322 Added --engine.TraceMissingSafepointPollInterval=N to show Java stacktraces when there are missing TruffleSafepoint.poll() calls.
  • GR-52644 Deprecated TruffleLanguage.Registration.needsAllEncodings, no longer needs to be declared. It is sufficient for a language module to require org.graalvm.shadowed.jcodings to enable all string encodings.
  • GR-51172 Add CompilerDirectives.ensureAllocatedHere to mark an allocation as non-movable. This allows language developers to mark special allocations as non-optimizable to allow better control for allocations potentially throwing OutOfMemoryErrors.
  • GR-52799 DebuggerSession.suspend(Thread thread) now preserves ongoing stepping strategies.
  • GR-52799 Added SuspendedEvent.isStep(), SuspendedEvent.isUnwind() and SuspendedEvent.isBreakpointHit() to allow debugger backends or languages to query reasons for the suspension.
  • GR-28103 Deprecated com.oracle.truffle.api.utilities.JSONHelper as it is untested, and in its current state does not contain any special logic for dumping AST. JSON printing of AST nodes should be delegated to an external library if necessary. This class will be removed in a future version.
  • GR-54085 Added MathUtils API providing additional mathematical functions useful for language implementations, namely: asinh, acosh, and atanh.
  • GR-49484 Added TruffleStackFrameElement.getBytecodeIndex() to access bytecode indices of a stack frame. Bytecode based languages should consider implementing RootNode#findBytecodeIndex(Node, Frame) to resolve the bytecode index.
  • GR-49484 Deprecated RootNode.isCaptureFramesForTrace(). Implementers should use RootNode.isCaptureFramesForTrace(boolean) instead.
  • GR-28866 Added TruffleLanguage.Env.getScopePublic(LanguageInfo) and TruffleLanguage.Env.getScopeInternal(LanguageInfo) to allow languages direct access to other language scopes to implement new polyglot builtins.
  • GR-28866 Deprecated TruffleLanguage.Env.isPolyglotEvalAllowed(). Replace usages with TruffleLanguage.Env.isPolyglotEvalAllowed(LanguageInfo). Please see javadoc for the updated usage.
  • GR-52843 Deprecated Node.getCost() and the associated NodeCost class without replacement. Truffle DSL no longer generates implementations of this method automatically and will therefore always return NodeCost.MONOMORPHIC by default. This is intended to reduce the binary footprint.
  • GR-52843 Added the UnadoptableNode interface. This is interface should be preferred to overriding Node.isAdoptable() if the result is statically known.
  • GR-40931 Virtual threads with a polyglot context are now experimentally supported on HotSpot. Experimental because access to caller frames in write or materialize mode is not yet supported.
  • GR-40931 Using virtual threads in a native-image will now emulate virtual threads using platform threads until Loom support for Truffle languages in native-image is implemented.
  • GR-40931 Added TruffleThreadBuilder#virtual() for languages to create virtual threads.
  • GR-53454 Added warning in the annotation processor when @ReportPolymorphism is used incorrectly.
  • GR-54516 The Future returned by submitting ThreadLocalAction now throws CancellationException on Future#get() when the future is cancelled, as it should per Future interface semantics.
  • GR-54516 Synchronous ThreadLocalActions which wait longer than --engine.SynchronousThreadLocalActionMaxWait (default 60) seconds for all threads to start executing that action now show a warning and are automatically cancelled to prevent applications to hang.
  • GR-49484 Deprecated RootNode.isCaptureFramesForTrace(). Implementers should use RootNode.isCaptureFramesForTrace(Node) instead.
  • GR-52145 Added InstrumentableNode#findProbe and InstrumentableNode.createProbe to allow customization of probe storage, e.g. eager insertion of probes without wrappers.

v24.0.0

  • GR-45863 Yield and resume events added to the instrumentation:
    • ExecutionEventListener.onYield() and ExecutionEventNode.onYield() is invoked on a yield of the current thread
    • ExecutionEventListener.onResume() and ExecutionEventNode.onResume() is invoked on a resume of the execution on the current thread after a yield
    • ProbeNode.onYield() and ProbeNode.onResume()
    • GenerateWrapper has new yieldExceptions() and resumeMethodPrefix() parameters to automatically call the new onYield()/onResume() methods from wrapper nodes.
    • RootNode.isSameFrame() and TruffleInstrument.Env.isSameFrame() added to test if two frames are the same, to match the yielded and resumed execution.
  • GR-45863 Adopted onYield() and onResume() instrumentation events in the debugger stepping logic.
  • [GR-21361] Remove support for legacy <language-id>.home system property. Only org.graalvm.language.<language-id>.home will be used.
  • GR-41302 Added the --engine.AssertProbes option, which asserts that enter and return are always called in pairs on ProbeNode, verifies correct behavior of wrapper nodes. Java asserts need to be turned on for this option to have an effect.
  • GR-48816 Added new interpreted performance warning to Truffle DSL.
  • GR-44706 Relaxed InteropLibrary invariant assertions for side-effecting members (i.e. hasMemberReadSideEffects or hasMemberWriteSideEffects) for readMember, invokeMember, writeMember, and removeMember, allowing them to succeed even if isMemberReadable, isMemberInvocable, isMemberWritable, and isMemberRemovable, respectively, returned false for that member. This avoids spurious assertion failures for accessor and proxy members.
  • GR-49386 Added InteropLibrary#readBuffer(long, byte[], int, int) to enable bulk reads of buffers into byte arrays.
  • [GR-50262] Added the system property -Dtruffle.UseFallbackRuntime=true. This property is preferred over the usage of -Dtruffle.TruffleRuntime=com.oracle.truffle.api.impl.DefaultTruffleRuntime.

v23.1.0

  • GR-45123 Added GenerateInline#inlineByDefault to force usage of inlined node variant even when the node has also a cached variant (@GenerateCached(true)).
  • GR-45036 Improved IGV IR dumping. Dump folders for Truffle now include the compilation tier to differentiate compilations better. Inlined IR graphs are now additionally dumped in separate folders if dump level is >= 2.
  • GR-45036 Improved IGV AST dumping. The Truffle AST is now dumped as part of the IR dump folder. The dumped AST tree now shows all inlined ASTS in a single tree. Individual functions can be grouped using the "Cluster nodes" function in IGV (top status bar). Root nodes now display their name e.g. SLFunctionBody (root add). Every AST node now has a property graalIRNode that allows to find the corresponding Graal IR constant if there is one.
  • GR-45284 Added Graal debug options TruffleTrustedNonNullCast and TruffleTrustedTypeCast that allow disabling trusted non-null and type casts in Truffle, respectively. Note that disabling trusted type casts effectively disables non-null casts, too.
  • GR-44211 Added TruffleLanguage.Env#newTruffleThreadBuilder(Runnable) to create a builder for threads that have access to the appropriate TruffleContext. All existing TruffleLanguage.Env#createThread methods have been deprecated. On top of what the deprecated methods provided, the builder now allows to specify beforeEnter and afterLeave callbacks for the created threads.
  • GR-44211 Added TruffleContext#leaveAndEnter(Node, Interrupter, InterruptibleFunction, Object) to be able to interrupt the function run when the context is not entered. The exisiting API TruffleContext#leaveAndEnter(Node, Supplier) is deprecated.
  • GR-44211 Removed the deprecated method TruffleSafepoint#setBlocked(Node, Interrupter, Interruptible, Object, Runnable, Runnable).
  • GR-44211 Added TruffleSafepoint#setBlocked(Node, Interrupter, Interruptible, Object, Runnable, Consumer). It replaces the method TruffleSafepoint#setBlockedWithException(Node, Interrupter, Interruptible, Object, Runnable, Consumer) that is now deprecated.
  • GR-44211 Added TruffleSafepoint#setBlockedFunction(Node, Interrupter, InterruptibleFunction, Object, Runnable, Consumer) to be able to return an object from the interruptible functional method.
  • GR-44211 Added TruffleSafepoint#setBlockedThreadInterruptibleFunction(Node, InterruptibleFunction, Object) as a short-cut method to allow setting the blocked status for methods that throw InterruptedException and support interrupting using Thread#interrupt().
  • GR-44829 TruffleStrings: added specialized TruffleStringBuilder types for better performance on UTF encodings.
  • GR-46146 Added TruffleLanguage#ContextLocalProvider and TruffleInstrument#ContextLocalProvider, and deprecated TruffleLanguage.createContextLocal, TruffleLanguage.createContextThreadLocal, TruffleInstrument.createContextLocal and TruffleInstrument.createContextThreadLocal. Starting with JDK 21, the deprecated methods trigger the new this-escape warning. The replacement API avoids the warning.
  • GR-44217 In the past, on a GraalVM JDK, languages or instruments could be provided using -Dtruffle.class.path.append, but are now loaded from the application module path. The truffle class path is deprecated and should no longer be used, but remains functional. Languages are not picked up from the application class path, so the language first needs to be migrated. Truffle languages or instruments installed as a GraalVM component in the GraalVM JDK are still loaded in an unnamed module. However, GraalVM components will be deprecated, so languages and instruments should be migrated to the module path.
  • GR-46181 truffle-tck.jar is not included in GraalVM artifacts anymore. It is still available via Maven.
  • GR-46181 truffle-dsl-processor.jar is not included in GraalVM artifacts anymore. It is still available via Maven.
  • GR-44222 Deprecated several experimental engine options and moved them to use the compiler prefix instead of the engine prefix. You can search for these options with this regexp: git grep -P '\bengine\.(EncodedGraphCache|ExcludeAssertions|FirstTierInliningPolicy|FirstTierUseEconomy|InlineAcrossTruffleBoundary|InlineOnly|Inlining|InliningExpansionBudget|InliningInliningBudget|InliningPolicy|InliningRecursionDepth|InliningUseSize|InstrumentBoundaries|InstrumentBoundariesPerInlineSite|InstrumentBranches|InstrumentBranchesPerInlineSite|InstrumentFilter|InstrumentationTableSize|IterativePartialEscape|MaximumGraalGraphSize|MethodExpansionStatistics|NodeExpansionStatistics|NodeSourcePositions|ParsePEGraphsWithAssumptions|TraceInlining|TraceInliningDetails|TraceMethodExpansion|TraceNodeExpansion|TracePerformanceWarnings|TraceStackTraceLimit|TreatPerformanceWarningsAsErrors)\b'.
  • GR-44222 The following deprecated debugging options were removed in this release:
    • engine.InvalidationReprofileCount: The option no longer has any effect. Remove the usage to migrate.
    • engine.ReplaceReprofileCount: The option no longer has any effect. Remove the usage to migrate.
    • engine.PerformanceWarningsAreFatal: Use engine.CompilationFailureAction=ExitVM and compiler.TreatPerformanceWarningsAsErrors=<PerformanceWarningKinds> instead.
    • engine.PrintExpansionHistogram: Superseded by engine.TraceMethodExpansion.
    • engine.ForceFrameLivenessAnalysis: The option no longer has any effect. Remove the usage to migrate.
    • engine.CompilationExceptionsArePrinted: Use engine.CompilationFailureAction=Print instead.
    • engine.CompilationExceptionsAreThrown: Use engine.CompilationFailureAction=Throw instead.
    • engine.CompilationExceptionsAreFatal: Use engine.CompilationFailureAction=ExitVM instead.
  • GR-44420 Added TruffleLanguage.finalizeThread(Object, Thread) to allow languages run finalization hooks for initialized threads before the context is disposed.
  • GR-45923 Added EventBinding.tryAttach() to try to attach a binding, if not disposed or attached already.
  • GR-20628 Added atomic byte-array operations to ByteArraySupport and subclasses.
  • GR-39571 Added TranscodingErrorHandler to TruffleString.SwitchEncodingNode.
  • GR-46345 Added a support for the lazy unpacking of language and instrument resources necessary for execution. This support replaces the concept of language homes for Maven language and tool deployment. For a language or instrument that requires additional files to execute, it needs to follow these steps:
    • Bundle the necessary files into a jar distribution.
    • Implement the InternalResource interface for handling the resource file unpacking.
    • Call the Env#getInternalResource when the language or instrument needs the bundled resource files. This method ensures that the requested InternalResource is unpacked and provides a directory containing the unpacked files. Since unpacking internal resources can be an expensive operation, the implementation ensures that internal resources are cached.
  • GR-44464 Added TruffleString.ToValidStringNode for encoding-level string sanitization.

v23.0.0

  • GR-38526 Added TruffleLanguage.Env#isSocketIOAllowed(). The method returns true if access to network sockets is allowed.

  • GR-41634 Added TruffleLanguage.Env#isFileIOAllowed(). The method returns true if access to files is allowed.

  • Deprecated TruffleLanguage.Env#isIOAllowed(). To migrate, use TruffleLanguage.Env#isFileIOAllowed().

  • GR-41408 Added Version.format(String), to support formatting the version using a custom format string, e.g. for use in URLs.

  • GR-41408 Added ${graalvm-version} and ${graalvm-website-version} substitutions for the website property of language and instrument registrations.

  • GR-41034 Added TruffleInstrument.Env.getTruffleFile(TruffleContext, ...) methods to allow reading a truffle file from a specific context without being entered. Deprecated TruffleInstrument.Env.getTruffleFile(...) methods that do not take the TruffleContext.

  • GR-42271 Native image build verifies that the context pre-initialization does not introduce absolute TruffleFiles into the image heap. The check can be disabled using the -H:-TruffleCheckPreinitializedFiles native image option.

  • GR-41369 The icu4j language initializes charsets while building the native image. Languages depending on the icu4j language can no longer use --initialize-at-run-time=com.ibm.icu.

  • GR-40274 TruffleStrings: added AsNativeNode and GetStringCompactionLevelNode.

  • GR-39189 Added attach methods on the Instrumenter class, that take NearestSectionFilter as a parameter. The new NearestSectionFilter class can be used to instrument or detect nearest locations to a given source line and column. For example, this can be used to implement breakpoints, where the exact line or column is not always precise and the location needs to be updated when new code is loaded.

  • GR-39189 Added InstrumentableNode.findNearestNodeAt(int line, int column, ...) to find the nearest node to the given source line and column. This is an alternative to the existing method that takes character offset.

  • GR-42674 It has been documented that methods TruffleLanguage.Env#getPublicTruffleFile, TruffleLanguage.Env#getInternalTruffleFile, TruffleLanguage.Env#getTruffleFileInternal and TruffleInstrument.Env#getPublicTruffleFile can throw IllegalArgumentException when the path string cannot be converted to a Path or uri preconditions required by the FileSystem do not hold.

  • GR-31342 Implemented several new features for Truffle DSL and improved its performance:

    • Added an @GenerateInline annotation that allows Truffle nodes to be object-inlined automatically. Object-inlined Truffle nodes become singletons and therefore reduce memory footprint. Please see the tutorial for further details.
    • Added an @GenerateCached annotation that allows users to control the generation of cached nodes. Use @GenerateCached(false) to disable cached node generation when all usages of nodes are object-inlined to save code footprint.
    • Updated Truffle DSL nodes no longer require the node lock during specialization, resulting in improved first execution performance. CAS-style inline cache updates are now used to avoid deadlocks when calling CallTarget.call(...) in guards. Inline caches continue to guarantee no duplicate values and are not affected by race conditions. Language implementations should be aware that the reduced contention may reveal other thread-safety issues in the language.
    • Improved Truffle DSL node memory footprint by merging generated fields for state and exclude bit sets and improving specialization data class generation to consider activation probability. Specializations should be ordered by activation probability for optimal results.
    • Improved memory footprint by automatically inlining cached parameter values of enum types into the state bitset
    • Added @Cached(neverDefault=true|false) option to indicate whether the cache initializer will ever return a null or primitive default value. Truffle DSL now emits a warning if it is beneficial to set this property. Alternatively, the new @NeverDefault annotation may be used on the bound method or variable. The generated code layout can benefit from this information and reduce memory overhead. If never default is set to true, then the DSL will now use the default value instead internally as a marker for uninitialized values.
    • @Shared cached values may now use primitive values. Also, @Shared can now be used for caches contained in specializations with multiple instances. This means that the shared cache will be used across all instances of a specialization.
    • Truffle DSL now generates many more Javadoc comments in the generated code that try to explain the decisions of the code generator.
    • Added inlined variants for all Truffle profiles in com.oracle.truffle.api.profiles. The DSL now emits recommendation warnings when inlined profiles should be used instead of the allocated ones.
    • Truffle DSL now emits many more warnings for recommendations. For example, it emits warnings for inlining opportunities, cached sharing or when a cache initializer should be designated as @NeverDefault. To ease migration work, we added several new ways to suppress the warnings temporarily for a Java package. For a list of possible warnings and further usage instructions, see the new warnings page in the docs.
    • The DSL now produces warnings for specializations with multiple instances but an unspecified limit. The new warning can be resolved by specifying the desired limit (previously, default "3" was assumed)
    • Added the capability to unroll specializations with multiple instances. Unrolling in combination with node object inlining may further reduce the memory footprint of a Truffle node. In particular, if all cached states can be encoded into the state bit set of the generated node. See @Specialization(...unroll=2) for further details
  • GR-31342 Deprecated ConditionProfile.createBinaryProfile() and ConditionProfile.createCountingProfile(). Use ConditionProfile.create() and CountingConditionProfile.create() instead.

  • GR-31342 Added ValueProfile.create() that automatically creates an exact class value profile. This allows its usage in @Cached without specifying a cached initializer.

  • GR-31342 The node insert method is now public instead of protected. This avoids the need to create cumbersome accessor methods when needed in corner-cases.

  • GR-43599 Specifying the sharing group in @Shared is now optional for cached values. If not specified, the parameter name will be used as sharing group. For example, @Shared @&#8203;Cached MyNode sharedNode will get the sharing group sharedNode assigned. It is recommended to use the explicit sharing group still if it improves readability or if the parameter name cannot be changed.

  • GR-43492 LanguageReference#get() is now always supported inside of InstrumentableNode#materializeInstrumentableNodes().

  • GR-43944 Added HostCompilerDirectives.inInterpreterFastPath() which allows to mark branches that should only be executed in the interpreter, but also optimized like fast-path code in the host compiler.

  • GR-25539 Added InteropLibrary#fitsInBigInteger() and InteropLibrary#asBigInteger() to access interop values that fit into java.math.BigInteger without loss of precision. A warning is produced for objects that export the isNumber interop message and don't export the new big integer messages.

  • GR-25539 Added DebugValue#fitsInBigInteger() and DebugValue#asBigInteger().

  • GR-25539 Added GenerateLibrary.Abstract#ifExportedAsWarning() to specify a library message to be abstract only if another message is exported. A warning is produced that prompts the user to export the message.

  • GR-43903 Usages of @Specialization(assumptions=...) that reach a @Fallback specialization now produce a suppressable warning. In most situations, such specializations should be migrated to use a regular guard instead. For example, instead of using @Specialization(assumptions = "assumption") you might need to be using @Specialization(guards = "assumption.isValid()").

  • GR-43903 Added @Idempotent and @NonIdempotent DSL annotations useful for DSL guard optimizations. Guards that only bind idempotent methods and no dynamic values can always be assumed true after they were true once on the slow-path. The generated code leverages this information and asserts instead of executes the guard on the fast-path. The DSL now emits warnings with for all guards where specifying the annotations may be beneficial. Note that all guards that do not bind dynamic values are assumed idempotent by default for compatibility reasons.

  • GR-43663 Added RootNode#computeSize as a way for languages to specify an approximate size of a RootNode when number of AST nodes cannot be used (e.g. for bytecode interpreters).

  • GR-42539 (change of behavior) Unclosed polyglot engines are no longer closed automatically on VM shutdown. They just die with the VM. As a result, TruffleInstrument#onDispose is not called for active instruments on unclosed engines in the event of VM shutdown. In case an instrument is supposed to do some specific action before its disposal, e.g. print some kind of summary, it should be done in TruffleInstrument#onFinalize.

  • GR-42961 Added TruffleString.ByteIndexOfCodePointSetNode, which allows fast searching for a given set of codepoints.

  • GR-42961 Added TruffleString.GetCodeRangeImpreciseNode, which allows querying the currently known code range without triggering a string scan.

  • GR-42961 TruffleString.FromJavaStringNode no longer eagerly scans strings for their code range. To still get eager scanning of constant strings, use fromConstant(String).

  • GR-30473 Added support for sandbox policies. By default, languages and instruments support just the TRUSTED sandbox policy.

    • If a language wants to target a more restrictive sandbox policy, it must:
      1. Specify the most strict sandbox policy it satisfies using TruffleLanguage.Registration#sandbox().
      2. For each option, the language must specify the most restrictive sandbox policy in which the option can be used via Option#sandbox(). By default, options have a TRUSTED sandbox policy.
      3. If a language needs additional validation, it can use TruffleLanguage.Env#getSandboxPolicy() to obtain the current context sandbox policy.
    • If an instrument wants to target a more restrictive sandbox policy, it must:
      1. Specify the most strict sandbox policy it satisfies using TruffleInstrument.Registration#sandbox().
      2. For each option, the instrument must specify the most restrictive sandbox policy in which the option can be used via Option#sandbox(). By default, options have a TRUSTED sandbox policy.
      3. If an instrument needs additional validation, it can use TruffleInstrument.Env#getSandboxPolicy() to obtain the engine's sandbox policy.
    • Added TruffleOptionDescriptors extending OptionDescriptors by the ability to provide the option's SandboxPolicy.
  • GR-43818 Library messages annotated with @Deprecated now emit a warning when they are exported. It is now possible to overload a message method by adding, removing a parameter or making the parameter type more generic. Also added Message.isDeprecated() to find out whether a message was deprecated at runtime.

  • GR-44053 (change of behavior) The default implementation of InteropLibrary.getExceptionStackTrace() will now include host stack trace elements if public host access is allowed.

  • GR-44053 (change of behavior) Truffle stack trace information is now attached to host and internal exceptions via suppressed exceptions. The cause of an exception is never modified anymore.

  • GR-44053 (change of behavior) A StackOverflowError or OutOfMemoryError crossing a Truffle call boundary will not be injected guest stack trace information anymore.

  • GR-44723 Truffle.getRuntime().getName() and consequently Engine.getImplementationName() have been adjusted to return "Oracle GraalVM" instead of "GraalVM EE".

  • GR-44211 Added TruffleLanguage.Env#newTruffleThreadBuilder(Runnable) to create a builder for threads that have access to the appropriate TruffleContext. All existing TruffleLanguage.Env#createThread methods have been deprecated. On top of what the deprecated methods provide, the builder allows specifying beforeEnter and afterLeave callbacks for the created threads.

  • GR-44211 Added TruffleLanguage.Env#newTruffleThreadBuilder(Runnable) to create a builder for threads that have access to the appropriate TruffleContext. All existing TruffleLanguage.Env#createThread methods have been deprecated. On top of what the deprecated methods provided, the builder now allows to specify beforeEnter and afterLeave callbacks for the created threads.


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this MR and you won't be reminded about this update again.


  • If you want to rebase/retry this MR, check this box

This MR has been generated by Renovate Bot.

Edited by RenovateBot

Merge request reports