You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Motivation:
Package org.graalvm.collections is used throughout the Pkl codebase.
It is most heavily used in the Truffle interpreter,
which requires putting most collection methods behind @TruffleBoundary.
At the moment, this is done by wrapping collection methods
with static methods declared in classes EconomicMaps and EconomicSets.
However, static wrapper methods are inconvenient to use,
decrease code readability, add some overhead, and are easy to forget about.
Changes:
- vendor package org.graalvm.collections into org.pkl.core.collection
- org.graalvm.collections is licensed under:
The Universal Permissive License (UPL), Version 1.0
- vendored version:
https://github.com/oracle/graal/tree/graal-23.0.3/sdk/src/org.graalvm.collections/src/org/graalvm/collections
- add package-info.java with original license
- annotate most public methods with @TruffleBoundary
- add @nullable annotations
- switching to JSpecify will enable more accurate nullability checks
- remove prefix tree classes (not used in Pkl)
- make no other code changes to simplify review/updates
- inline and remove EconomicMaps/Sets wrapper methods
- replace usages of EconomicMaps.equals/hashCode with EconomicMapUtil.equals/hashCode
- fix ProjectDeps.hashCode()
Result:
Cleaner, safer, and more efficient code.
0 commit comments