-
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
More IR mini passes #11501
More IR mini passes #11501
Conversation
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.
I would rather not increase the amount of projects that depend on Scala.
engine/runtime-compiler/src/main/java/org/enso/compiler/pass/analyse/ImportSymbolAnalysis.java
Outdated
Show resolved
Hide resolved
engine/runtime-compiler/src/main/java/org/enso/compiler/pass/analyse/ImportSymbolAnalysis.java
Show resolved
Hide resolved
Problem was in MetadataStorage.get(MethodDefinitions.INSTANCE) that returned null if MethodDefinitions is not final.
}); | ||
|
||
java.util.List<Definition> withStaticAliases = new ArrayList<>(); | ||
for (var def : CollectionConverters.asJava(newDefs)) { |
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.
I guess the above .map
body and the for
loop body could easily be merged together into one big for
loop.
* @param method Non-static method from which a static alias method is generated. | ||
* @return Static alias method for the given {@code method} or null. | ||
*/ | ||
private Method.Explicit generateStaticAliasMethod(Method.Explicit method) { |
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.
Unrelated to this PR.
What would it take to register only static methods in each type? What's an invocation of (x:Integer).to_text
anyway? It should be convertible to Integer.to_text x
- e.g. an instance invocation just resolves the right method based on the type of the instances, but then it invokes the static Function
.
Benefit:
- reduce the amount of
Function
instances in the system by half
Prior art:
- Graal compiler sees all JVM methods as static (instances methods of a class being static and having
this
as first argument) - the compiler only has special
InvokeNode
that deals with finding the right method to invoke when virtual dispatch is necessary
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.
Created an issue #11686 from your comment.
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.
Thanks for moving the shared Scala utilities to scala-libs-wrapper
and keeping engine-common
as lightweight as it was. That was the biggest architectural flaw.
From a code point of view, I believe there is a mistake in ChainedMiniPass
- it can never unregister completely from the traversal.
Otherwise it all looks good and thanks for increasing the test coverage.
engine/runtime-compiler/src/main/java/org/enso/compiler/pass/ChainedMiniPass.java
Show resolved
Hide resolved
engine/runtime-compiler/src/main/java/org/enso/compiler/pass/ChainedMiniPass.java
Outdated
Show resolved
Hide resolved
engine/runtime-compiler/src/main/java/org/enso/compiler/pass/ChainedMiniPass.java
Outdated
Show resolved
Hide resolved
engine/runtime-compiler/src/main/java/org/enso/compiler/pass/MiniIRPass.java
Outdated
Show resolved
Hide resolved
engine/runtime-compiler/src/main/java/org/enso/compiler/pass/analyse/ImportSymbolAnalysis.java
Outdated
Show resolved
Hide resolved
engine/runtime-compiler/src/main/scala/org/enso/compiler/pass/PassManager.scala
Show resolved
Hide resolved
engine/runtime-compiler/src/main/scala/org/enso/compiler/pass/PassManager.scala
Outdated
Show resolved
Hide resolved
engine/runtime-compiler/src/test/java/org/enso/compiler/test/pass/MiniPassTraverserTest.java
Show resolved
Hide resolved
(package private)
Closes #11326
Pull Request Description
Mega passes converted to minipasses in
Passes.globalTypingPasses
group:enso/engine/runtime-compiler/src/main/scala/org/enso/compiler/Passes.scala
Lines 41 to 63 in 4e6837f
Are:
All of these mini passes are ordered after each other. So now, in
Passes.globalTypingPasses
group, there are 8 consecutive minipasses.Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.