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
Cleanup phase assembly #7622
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7622?orig=1 |
@adriaanm said: |
@som-snytt said: Plugin can opt out when it processes options; phase can opt out via enabled property; phase can declare that it "requires" other phases to be installed; phase can declare that it wishes to replace or delete another phase (where replace means delete and inherit its ordering constraints). Also, -Xshow-phases shows the configuration with opt-outs. Using -Xshow-phases -Ydebug will include the phases that opted-out (e.g., no -P:continuations:enabled) with a helper footnote. I deleted my deletion of Phases since soc has it covered. |
@gkossakowski said: It's not clear to me how plugin improvements are related to this ticket. The ticket talks about very specific issue we have in Global.scala with phase assembly logic that does not respect |
@som-snytt said (edited on Jul 23, 2013 6:18:24 AM UTC): I'll start a discussion on the ML for consensus before requesting a review, but I think it's straightforward for a phase (specifically, the SubComponent) to declare if it is enabled (sometimes that is just a setting). Currently, I have: apm@mara:~/tmp$ skalac -Xshow-phases
phase name id description
---------- -- -----------
parser 1 parse source into ASTs, perform simple desugaring
namer 2 resolve names, attach symbols to named trees
packageobjects 3 load package objects
typer 4 the meat and potatoes: type the trees
patmat 5 translate match expressions
superaccessors 6 add super accessors in traits and nested classes
extmethods 7 add extension methods for inline classes
pickler 8 serialize symbol tables
refchecks 9 reference/override checking, translate nested objects
uncurry 10 uncurry, translate function values to anonymous classes
tailcalls 11 replace tail calls by jumps
specialize 12 @specialized-driven class and method specialization
explicitouter 13 this refs to outer pointers, translate patterns
erasure 14 erase types, add interfaces for traits
posterasure 15 clean up erased inline classes
lazyvals 16 allocate bitmaps, translate lazy vals into lazified defs
lambdalift 17 move nested functions to top level
constructors 18 move field definitions into constructors
flatten 19 eliminate inner classes
mixin 20 mixin composition
cleanup 21 platform-specific cleanups, generate reflective calls
icode 22 generate portable intermediate code
jvm 23 generate JVM bytecode
terminal 24 the last phase during a compilation run
apm@mara:~/tmp$ skalac -Xshow-phases -Yinline
phase name id description
---------- -- -----------
parser 1 parse source into ASTs, perform simple desugaring
namer 2 resolve names, attach symbols to named trees
packageobjects 3 load package objects
typer 4 the meat and potatoes: type the trees
patmat 5 translate match expressions
superaccessors 6 add super accessors in traits and nested classes
extmethods 7 add extension methods for inline classes
pickler 8 serialize symbol tables
refchecks 9 reference/override checking, translate nested objects
uncurry 10 uncurry, translate function values to anonymous classes
tailcalls 11 replace tail calls by jumps
specialize 12 @specialized-driven class and method specialization
explicitouter 13 this refs to outer pointers, translate patterns
erasure 14 erase types, add interfaces for traits
posterasure 15 clean up erased inline classes
lazyvals 16 allocate bitmaps, translate lazy vals into lazified defs
lambdalift 17 move nested functions to top level
constructors 18 move field definitions into constructors
flatten 19 eliminate inner classes
mixin 20 mixin composition
cleanup 21 platform-specific cleanups, generate reflective calls
icode 22 generate portable intermediate code
inliner 23 optimization: do inlining
jvm 24 generate JVM bytecode
terminal 25 the last phase during a compilation run
apm@mara:~/tmp$ skalac -Xshow-phases -P:continuations:enable -optimise
phase name id description
---------- -- -----------
parser 1 parse source into ASTs, perform simple desugaring
namer 2 resolve names, attach symbols to named trees
packageobjects 3 load package objects
typer 4 the meat and potatoes: type the trees
patmat 5 translate match expressions
superaccessors 6 add super accessors in traits and nested classes
extmethods 7 add extension methods for inline classes
pickler 8 serialize symbol tables
refchecks 9 reference/override checking, translate nested objects
selectiveanf 10 ANF pre-transform for @cps
selectivecps 11 @cps-driven transform of selectiveanf assignments
uncurry 12 uncurry, translate function values to anonymous classes
tailcalls 13 replace tail calls by jumps
specialize 14 @specialized-driven class and method specialization
explicitouter 15 this refs to outer pointers, translate patterns
erasure 16 erase types, add interfaces for traits
posterasure 17 clean up erased inline classes
lazyvals 18 allocate bitmaps, translate lazy vals into lazified defs
lambdalift 19 move nested functions to top level
constructors 20 move field definitions into constructors
flatten 21 eliminate inner classes
mixin 22 mixin composition
cleanup 23 platform-specific cleanups, generate reflective calls
icode 24 generate portable intermediate code
inliner 25 optimization: do inlining
inlinehandlers 26 optimization: inline exception handlers
closelim 27 optimization: eliminate uncalled closures
constopt 28 optimization: optimize null and other constants
dce 29 optimization: eliminate dead code
jvm 30 generate JVM bytecode
terminal 31 the last phase during a compilation run Under -Ydebug, you see all available components, with symbols for xx disabled and oo skipped. apm@mara:~/tmp$ skalac -Xshow-phases -Yskip:jvm -Ydebug
phase name id description
---------- -- -----------
parser 1 parse source into ASTs, perform simple desugaring
namer 2 resolve names, attach symbols to named trees
packageobjects 3 load package objects
typer 4 the meat and potatoes: type the trees
patmat 5 translate match expressions
superaccessors 6 add super accessors in traits and nested classes
extmethods 7 add extension methods for inline classes
pickler 8 serialize symbol tables
refchecks 9 reference/override checking, translate nested objects
selectiveanf xx ANF pre-transform for @cps
selectivecps xx @cps-driven transform of selectiveanf assignments
uncurry 10 uncurry, translate function values to anonymous classes
tailcalls 11 replace tail calls by jumps
specialize 12 @specialized-driven class and method specialization
explicitouter 13 this refs to outer pointers, translate patterns
erasure 14 erase types, add interfaces for traits
posterasure 15 clean up erased inline classes
lazyvals 16 allocate bitmaps, translate lazy vals into lazified defs
lambdalift 17 move nested functions to top level
constructors 18 move field definitions into constructors
flatten 19 eliminate inner classes
mixin 20 mixin composition
cleanup 21 platform-specific cleanups, generate reflective calls
icode 22 generate portable intermediate code
inliner xx optimization: do inlining
inlinehandlers xx optimization: inline exception handlers
closelim xx optimization: eliminate uncalled closures
constopt xx optimization: optimize null and other constants
dce xx optimization: eliminate dead code
jvm oo generate JVM bytecode
terminal 23 the last phase during a compilation run |
@gkossakowski said (edited on Jul 24, 2013 5:29:22 PM UTC): It seems like scala/scala#2768 confirms my worries. |
@som-snytt said: |
@som-snytt said: |
@gkossakowski said: |
Our phase assembly code is not in the greatest shape. For example, if you run
scalac -Xshow-phases
you get:Note that optimizer phases are there even if optimizer is not turned on. What happens is that each phase checks
optimize
flag and if it's disabled then it skips execution of that phase. What we should do instead is to have a proper phase assembly logic that includes phases that are going to be used in given compiler run.The text was updated successfully, but these errors were encountered: