8000 Compiler performance improvements around Symbols and Types by retronym · Pull Request #5823 · scala/scala · GitHub
[go: up one dir, main page]

Skip to content

Compiler performance improvements around Symbols and Types #5823

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

Merged
merged 16 commits into from
May 24, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a fast path to TreeGen to speedup synthesis of casts
Unfortunately, we've had to add a lot more casts into the code
to workaround corner cases in the Fields transform. This commit
avoids an inefficiency in synthesizing these trees, by avoid
a call to as-seen-from.
  • Loading branch information
retronym committed Apr 26, 2017
commit 8a53dd0cadfe34538a72fabc89e2ed393e96afae
5 changes: 4 additions & 1 deletion src/reflect/scala/reflect/internal/TreeGen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ abstract class TreeGen {

val tree = Select(pkgQualifier, sym)
if (pkgQualifier.tpe == null) tree
else tree setType (qual.tpe memberType sym)
else tree setType {
if (sym.rawowner == ObjectClass || sym.rawowner == AnyClass) sym.tpeHK.normalize // opt for asInstanceOf
else (qual.tpe memberType sym)
}
}
}

Expand Down
0