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 7 times, most recently 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
@graalvmbot graalvmbot force-pushed the bd/GR-36894-dynamicobjectnodes branch from ea83644 to f52c85e Compare November 3, 2025 17:48
* 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.
* Add separate PutConstantNode.

Co-authored-by: Andreas Woess <andreas.woess@oracle.com>
@graalvmbot graalvmbot force-pushed the bd/GR-36894-dynamicobjectnodes branch 2 times, most recently from 6fcd97c to b2fc2bd Compare November 7, 2025 04:26
@graalvmbot graalvmbot force-pushed the bd/GR-36894-dynamicobjectnodes branch from b2fc2bd to 1df9498 Compare November 7, 2025 12:53
woess added 3 commits November 7, 2025 13:55
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).
Remove internal location interfaces.
@graalvmbot graalvmbot force-pushed the bd/GR-36894-dynamicobjectnodes branch from 1df9498 to 92e3e10 Compare November 7, 2025 13:04
@graalvmbot graalvmbot force-pushed the bd/GR-36894-dynamicobjectnodes branch from 92e3e10 to c2b78f9 Compare November 7, 2025 13:24
@graalvmbot graalvmbot force-pushed the bd/GR-36894-dynamicobjectnodes branch from c2b78f9 to 6bb2dee Compare November 7, 2025 15:14
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