-
Notifications
You must be signed in to change notification settings - Fork 323
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
Introducing @BuiltinMethod.inlineable and InlineableNode #6442
Conversation
...e/interpreter-dsl-test/src/test/java/org/enso/interpreter/dsl/test/InliningBuiltinsTest.java
Show resolved
Hide resolved
* @param <E> extra data to keep in the node | ||
* @param <N> node to delegate to from {@link #call(java.lang.Object...)} method | ||
*/ | ||
protected abstract static class InlinedCallNode<E, N extends Node> extends DirectCallNode { |
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.
We've been warned (in addition to the javadoc warning), that subclassing DirectCallNode
creates unnecessary polymorphism when calling DirectCallNode.call
. Such a polymorphism isn't a problem for "PE mode" (the Node
being invoke is always a compilation constant, so it is clear what call
is going to be invoked), but before the JVM gets there, it slows things down (Node
isn't compilation constant for the regular JVM).
Replacing with a parallel InlineableNode
concept.
| | ||
|main = | ||
| x = "Hello World!" | ||
| Debug.eval <| $rawTQ |
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.
The combination of Debug.eval
and <|
was always broken. The <|
builtin was providing its own VirtualFrame
to the Debug
code. Now the <|
builtin specifies needsFrame = false
and gets the caller's frame instance. As such it provides the right frame to the Debug
subsystem.
engine/runtime/src/main/java/org/enso/interpreter/node/callable/ExecuteCallNode.java
Show resolved
Hide resolved
Running benchmarks to check the effect of the changes. Good, the
Let's perform one more benchmark run with the most recent state to verify the results. Alas, there seems to be a slowdown in
I am going to ignore this 164% decrease result. I am running benchmarks since the morning, both on
which is close to the best result I've ever seen. This result was achieved on 162048a - that's a signal this branch is doing fine, I think. |
build.sbt
Outdated
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.
When running sbt:interpreter-dsl-test/test
on a clean build, I get multiple warnings of type:
[warn] Could not determine source for class org.enso.interpreter.dsl.test.InliningBuiltinsInMethodGen
Moreover, In IntelliJ, I seem to be unable to locate generated sources, e.g., InliningBuiltinsInMethodGen
, which results in poor inspection of InliningBuiltinsTest.java
. @hubertp shouldn't there be an explicit setting for sourceManaged
directory for interpreter-dsl-test
project? I guess we should get rid of all the warnings even in tests.
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.
Some minor nitpicks. I would really like to see the needsFrame
renamed to forceInlining
- see my comments in the code. I find the needsFrame
name perplexing. Apart from that seems very impressive, I can't wait to see the benchmark results.
engine/runtime/src/main/java/org/enso/interpreter/node/InlineableNode.java
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/node/callable/ExecuteCallNode.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/node/callable/ExecuteCallNode.java
Outdated
Show resolved
Hide resolved
lib/scala/interpreter-dsl/src/main/java/org/enso/interpreter/dsl/BuiltinMethod.java
Show resolved
Hide resolved
...ava/org/enso/interpreter/node/expression/builtin/runtime/RuntimeWithDisabledContextNode.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/enso/interpreter/node/expression/builtin/function/ApplicationOperator.java
Outdated
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.
minor nits
...time/src/bench/java/org/enso/interpreter/bench/benchmarks/semantic/ArrayProxyBenchmarks.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin/bool/AndNode.java
Show resolved
Hide resolved
lib/scala/interpreter-dsl/src/main/java/org/enso/interpreter/dsl/Builtin.java
Show resolved
Hide resolved
* develop: (34 commits) Continued Execution Context work and some little fixes (#6506) IDE's logging to a file (#6478) Fix application config (#6513) Cloud/desktop mode switcher (#6448) Fix doubled named arguments bug (#6422) Reimplement `enso_project` as a proper builtin (#6352) Fix layer ordering between dropdown and breadcrumbs backgrounds. (#6483) Multiflavor layers (#6477) DataflowAnalysis preserves dependencies order (#6493) Implement `create_database_table` for Database Table (#6467) Limit Dead Letter logging (#6482) More reliable shutdown of the EnsoContext to save resources (#6468) Make execution mode `live` default for CLI (#6496) Finishing Vector Editor (#6470) Proper handling of multiple list views. (#6461) Fix disappearing cached shapes (#6458) Add Execution Context control to Text.write (#6459) Change defaults for `Connection.tables` and ensure that `Connection.query` recognizes all available tables (#6443) Introducing @BuiltinMethod.needsFrame and InlineableNode (#6442) Hide profile button behind a feature flag (#6430) ...
Pull Request Description
Fixes #6416 by introducing
InlineableNode
. It runs fast even on GraalVM CE, fixes (forever broken)Debug.eval
with<|
and removes discouraged subclassing ofDirectCallNode
. Introduces@BuiltinMethod.inlineable
- something that was requested by #6293. Just in this PR the attribute is optional - its implicit value continues to be derived fromVirtualFrame
presence/absence in the builtin method argument list. A lot of methods had to be modified to pass theVirtualFrame
parameter along to propagate it where needed.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Java,