-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Single (+patchable) LiteralNode #3536
Conversation
engine/runtime/src/main/java/org/enso/interpreter/runtime/PatchedModuleValues.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/PatchedModuleValues.java
Outdated
Show resolved
Hide resolved
8a032aa
to
029b027
Compare
Results of running benchmarks seem to be fine:
The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits
...runtime/src/main/java/org/enso/interpreter/node/expression/literal/PatchableLiteralNode.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
This PR merges existing variants of `LiteralNode` (`Integer`, `BigInteger`, `Decimal`, `Text`) into a single `LiteralNode`. It adds `PatchableLiteralNode` variant (with non `final` `value` field) and uses `Node.replace` to modify the AST to be patchable. With such change one can remove the `UnwindHelper` workaround as `IdExecutionInstrument` now sees _patched_ return values without any tricks.
[ci no changelog needed]
Pull Request Description
This PR merges existing variants of
LiteralNode
(Integer
,BigInteger
,Decimal
,Text
) into a singleLiteralNode
. It addsPatchableLiteralNode
variant (with nonfinal
value
field) and usesNode.replace
to modify the AST to be patchable. With such change one can remove theUnwindHelper
workaround asIdExecutionInstrument
now sees patched return values without any tricks.Checklist
Please include the following checklist in your PR:
Scala,
Java,