-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Revert inliner to work on typed trees #5138
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
Conversation
|
test performance please |
|
performance test scheduled: 1 job(s) in queue, 1 running. |
|
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/5138/ to see the changes. Benchmarks is based on merging with master (20ad4a0) |
7a6a5c7 to
4cc3e32
Compare
|
test performance please. |
|
performance test scheduled: 1 job(s) in queue, 0 running. |
|
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/5138/ to see the changes. Benchmarks is based on merging with master (a0b429b) |
1832dc2 to
167c945
Compare
f0e49b8 to
a5d1802
Compare
Rename `tree`, `trees` and associated methods in `ClassSymbol` to `rootTree`, `rootTrees`. We want to add another tree field to symbols that points directly to the symbol's definition tree. So we should be more specific about `rootTree`.
Previous scheme did not work if fixed completer was subsequently overridden by another completer. The new scheme goes directly to the places where parents are computed in various completers.
Normalizing via simplification is not enough since sometimes we need to "reach into" a pre-simplified type via the `isMatchedBy` method of a SelectionProto.
Match-pattern bound variables should not assume to match all other types, even if TypeVarsMissContext is true.
While we transition from rewrite matches to staging, we should not be dependent on rewrite methods for tuples. So for now, all tuple operations are dynamic.
- Fix isUptoDate conditon - Include TypeVars in footprint
Since we don't support rewrite matches and implicit matches in their current form, some tests need to be reclassified. They are moved to invalid. Maybe we can bring them back later as staging tests.
XmlQuote broke since proxies work now differently.
Analyzing tuples2 has shown that there's a quadratic blowup due to the occursIn check in ConstraintHandling#approximate. This change avoids traversing types for occursIn as long as they are ground.
Track proxies of inline arguments with a flag. Note: Some of the optimizations of the inliner don't update the defTree of the argument symbol even if they change the definition. But most of these optimizations will go away anyway. We should review once the inliner stabilizes.
a5d1802 to
c553b8d
Compare
- Remove unnecessary inline implicit conversion to `SCOps` - Use Symbol::fullName instead of tree extractors
c553b8d to
b2cc163
Compare
The optimization was to disregard a prefix of a named type if its symbol is static and none of the mapped symbols in `from` is static. This is incorrect, since the prefix might be a non-static reference to a static object. In that case the prefix still has to be considered. i2895a.scala contains code that failed when running with the cbn implementation of `assert` in the next commit.
This generates more efficient code by inlining the argument expression into the if-then-else.
Align position of binding and position of its defined symbol. This avoids some test-pickler errors observed with the new inliner.
|
test performance please. |
|
performance test scheduled: 1 job(s) in queue, 0 running. |
|
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/5138/ to see the changes. Benchmarks is based on merging with master (a4b60c4) |
0742f28 to
f6c440f
Compare
f321394 to
8ae9d6a
Compare
Needs a revised Inlined pickling format
The change accidentally part of a previous commit
|
So far it looks good. Are there more things that will go into this PR? I would suggest merging as is as would unblock a couple of other PRs (the retaining tree part). |
| def TermDeco(term: Term): TermAPI = new TermAPI { | ||
| def pos(implicit ctx: Context): Position = term.pos | ||
| def tpe(implicit ctx: Context): Types.Type = term.tpe | ||
| def underlyingArgument(implicit ctx: Context): Term = { |
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.
Maybe make this part of the scala.quoted.Expr API as suggested by @nicolasstucki initially
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.
No, this is the correct way to do it. If you do not inspect the tree, you should not know about the implementation details. I mean when using purely generative macros.
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.
Sorry, I meant as an extension method like toTasty:
https://github.com/lampepfl/dotty/blob/06738295d54f1e945becf89dc809b3ff923dc57a/compiler/src/dotty/tools/dotc/tastyreflect/QuotedOpsImpl.scala#L11
So not visible when doing only purely generative macros
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.
Oh yes. This way is more flexible as it does not only work for the parameters but for any term you might have inside the tree.
This PR removes functionality to inline typed trees, and also provides better help to tracking arguments for staging.