Skip to content

Conversation

@graalvmbot
Copy link
Collaborator

@graalvmbot graalvmbot commented Sep 25, 2025

tl;dr: Introduce a new Node-based API for dealing with DynamicObject, as a more lightweight replacement for DynamicObjectLibrary.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 25, 2025
@graalvmbot graalvmbot force-pushed the bd/GR-36894-dynamicobjectnodes branch 7 times, most recently from 69cd581 to 47974e6 Compare October 8, 2025 14:30
@graalvmbot graalvmbot force-pushed the bd/GR-36894-dynamicobjectnodes branch 6 times, most recently from 7c6babc to d51a949 Compare October 31, 2025 04:00
eregon and others added 14 commits October 31, 2025 06:11
* Faster in interpreter and better footprint than DynamicObjectLibrary,
  because Truffle libraries do not support host inlining and have footprint overhead.
* Use a more optimized guard for set() with 2 Shapes.
* Only inline cache 1 Shape for GetShapeFlagsNode.
  * An extra read seems better than more control flow.
* Migrate SL to DynamicObject nodes.
* Check the old Shape Assumption in the @Specialization.assumptions
  * This avoids an extra call to putGeneric() for host inlining,
    and ensures the specialization gets removed if the oldShape becomes invalid.
* Use putFlags instead of cachedPutFlags to fold during host inlining.
  * This saves around 6 node cost for DynamicObject.PutFixedKeyNode.
  * It is only observable if multiple PutNode#put*() methods are used (= different put flags) in the native image.
* Remove calls to Location#isFinal(), it's always false.
* Link the replacement nodes in DynamicObjectLibrary.
* Remove {PutNode,PutFixedKeyNode}#putInt, it boxes anyway so there is no value
  * Also other variants like putDouble are missing.
* Use @fallback to avoid potential issues with a Shape becoming invalid concurrently.
* Remove KeyEqualsNode and just compare keys by identity
  * Reduces subTreeCost of SLReadPropertyNode.readSLObject from 307 to 245.
* Use the same Shape check both in guards and specialization body.
* Merge inline caches of PutNode and InlinedConstKey into one.
* Merge inline caches of {PutNode,PutFixedKeyNode} and PutCache into one.
* Handle invalid shapes without removing all cached specializations
  * Removing the specialization instance itself is fine, the problem is
    removing all cache specialization due to the `replaces` on doUncached.
* Add a property read micro benchmark for SL
* Port documentation from DynamicObjectLibrary to DynamicObject nodes
* Update docs, 16 bit are actually allowed for user Shape flags
* Migrate DynamicObjectBenchmark and DynamicObjectPartialEvaluationTest
* [EXPERIMENT] Manually inline ExtLocations.ObjectArrayLocation in GetNode
* [EXPERIMENT] Manually inline ExtLocations.IntArrayLocation in GetNode
* [EXPERIMENT] Manually inline ExtLocations.ObjectArrayLocation in PutNode
* Cache the Location instead of Property in DynamicObject nodes to avoid extra indirection in interpreter
* Add interpreter benchmarks for DynamicObject.{GetNode,PutNode}
* It is enough to check the new Shape Assumption in PutNode
  * If the old Shape Assumption is invalidated, it will also invalidate the new Shape Assumption.
  * Fix bug where doCached was used with an old obsolete shape
* [GR-69326] Avoid duplicate property lookup in DynamicObject.PutNode
* Extract reusePropertyLookup() and fix RemoveKeyNode
* Run all DynamicObject tests with the new DynamicObject nodes too.
* Ignore spotbugs warnings in generated code.

Co-authored-by: Andreas Woess <[email protected]>
Move index, field info, and final assumption to Location base class.
Merge array and field location classes.
Add non-virtual Location.canStoreValue().
Add non-virtual Location.get and set methods.
Make isAssumedFinal() and isConstant() non-virtual.
Add exact-type fast path for type.isInstance(value).
Ensure extension arrays are seen as non-null in host compilation.
Remove DynamicField annotation from the array fields to avoid marking them as unsafe-accessed.
@graalvmbot graalvmbot force-pushed the bd/GR-36894-dynamicobjectnodes branch from d51a949 to ea83644 Compare October 31, 2025 14:28
@graalvmbot graalvmbot changed the title [GR-36894] WIP: DynamicObject nodes [GR-36894] Add DynamicObject nodes Oct 31, 2025
@graalvmbot graalvmbot changed the title [GR-36894] Add DynamicObject nodes [GR-36894] Add DynamicObject nodes. Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants