-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Implement Expr.{run|show} #3685
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
ce79e35 to
69efd50
Compare
69efd50 to
8889adf
Compare
31b54f4 to
73a6816
Compare
801b383 to
4a9e7c6
Compare
|
Rebased |
86c58ff to
6b5dda5
Compare
| "t493.scala", | ||
| "t8395.scala", | ||
| "t3613.scala", | ||
| "quote-no-splices.scala", |
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 will fix this issue in another PR, it is unrelated to theExpr.{run|show} implementation.
|
Some improvements on the format of the output of |
|
Test performance please |
|
test performance please |
|
performance test scheduled: 1 job(s) in queue, 0 running. |
|
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/3685/ to see the changes. Benchmarks is based on merging with master (39e466d) |
8b41170 to
8b93074
Compare
odersky
left a 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.
Otherwise LGTM. Nice work!
| /** Compiler that takes the contents of a quoted expression `expr` and produces | ||
| * a class file with `class ' { def apply: Object = expr }`. | ||
| */ | ||
| class ExprCompiler(directory: VirtualDirectory) extends Compiler { |
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.
Since these are all small files, should ExprRun and ExprFrontEnd be made part of ExprCompiler?
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.
Good idea. Done.
| withNoCheckNews(nu :: Nil)(super.transform(tree)) | ||
| case _ => | ||
| case meth => | ||
| if (meth.symbol.name.eq(nme.QUOTE) && meth.symbol.owner.eq(defn.OpsPackageClass)) |
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.
Just meth.symbol.isQuote should do. But I don't see why this is needed. Does handleMeta in the Select case earlier not catch this? Or maybe we need a handleMeta for Idents as well?
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.
This is half of the fix in #3777. I will explore the different solutions in that PR.
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.
handleMeta seems to be the simplest solution. I will merge #3777 into this PR.
|
Needs review for the last commits. |
|
test performance please |
1 similar comment
|
test performance please |
|
test performance please (The machine powered off for unknown reasons, maybe due to electricity problem) |
|
performance test scheduled: 6 job(s) in queue, 1 running. |
2065a38 to
7aeb306
Compare
|
Needs review for the last 4 commits. |
|
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/3685/ to see the changes. Benchmarks is based on merging with master (8817f4c) |
|
|
||
| /** Force the tree to be loaded */ | ||
| private object force extends TreeTraverser { | ||
| def traverse(tree: Tree)(implicit ctx: Context): Unit = traverseChildren(tree) |
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 don't understand why the change here is necessary. forceTrees is true only in the IDE,, right? But in the IDE we never get to ReifyQuotes.
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, force tree is also used when compiling from TASTY.
This covers the case when we recompile from TASTY a file with a quote and no splices.
7aeb306 to
610ad9c
Compare
Runnerforrunandshowrunshow-with-compilerflag fordotr/replto setup the compiler dependencies in the classpathBased on #3662