forked from scala/scala
-
Notifications
You must be signed in to change notification settings - Fork 1
2.12.10 preview #60
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
Closed
Closed
2.12.10 preview #60
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jar writer can be customised ( to generate a specialsed jar writer) Allow plugins to augment a jar manifest Allow plugins to write additional outputs to jars or to the file system
Transparent boxing of value classes causes performance surprises, news at 11.
I noticed this was slowing down the REPL's use of the presentation compiler in some cases.
I noticed in profiles that filtering the the `before` set for hard links generated a lot of garbage in compilers configured with a large number of plugins. This commit filters on the fly instead.
First, collapse components from hard-linked nodes ("runsRightAfter") in a pre-processing step. Then, perform a topological ordering of the graph with a modified depth first search. Finally, find the longest path from each node to the initial node using the result of the topological search to pick the correct edge. The length the assigns the level. Existing code compiles the phase list ordering lexicographically by (level, phaseName).
This shows us the places where we're depending on phase name as a tie-breaker to decide phase order: fields/tailcalls and delambdafy/jvm. ``` [log <no phase>] Phase assembly levels: (1,parser) (2,namer:packageobjects:typer) (5,patmat) (6,superaccessors) (7,extmethods) (8,pickler) (9,refchecks) (10,uncurry) (11,fields tailcalls:specialize) (12,explicitouter:erasure:posterasure) (15,lambdalift) (16,constructors) (17,flatten) (18,mixin) (19,cleanup) (20,delambdafy jvm) (21,terminal) ```
Don't rely on the fact that the assembly algorithm uses the phase name as a sort key as a tie-breaker. Before: ``` [log <no phase>] Phase assembly levels: (1,parser) (2,namer:packageobjects:typer) (5,patmat) (6,superaccessors) (7,extmethods) (8,pickler) (9,refchecks) (10,uncurry) (11,fields tailcalls:specialize) (12,explicitouter:erasure:posterasure) (15,lambdalift) (16,constructors) (17,flatten) (18,mixin) (19,cleanup) (20,delambdafy jvm) (21,terminal) ``` After: ``` [log <no phase>] Phase assembly levels: (1,parser) (2,namer:packageobjects:typer) (5,patmat) (6,superaccessors) (7,extmethods) (8,pickler) (9,refchecks) (10,uncurry) (11,fields) (12,tailcalls:specialize) (14,explicitouter:erasure:posterasure) (17,lambdalift) (18,constructors) (19,flatten) (20,mixin) (21,cleanup) (22,delambdafy) (23,jvm) (24,terminal) ```
This reverts commit fcd99c5. While the shallowers ASTs are better for limiting stack usage of scalac in post-patmat phases, the subtle change this made to the bytecode control flow leads to drastically slower analysis of large patterns by ASM. We use this analysis to generate the stackmap frames during code generation and during optimization. Perhaps a better way forward would be to explicitly generate the stackmap frames during code generation, which AFAIK is not computationally expensive while when we still have the AST in hand. The challenge would be to use this as a basis for ASM to incrementally add missing stack map frames for code that is transformed by our optimizer phases. `MethodWriter` has a mode that sounds promising: ``` /** * Indicates that the stack map frames of type F_INSERT must be computed. The other frames are not * computed. They should all be of type F_NEW and should be sufficient to compute the content of * the F_INSERT frames, together with the bytecode instructions between a F_NEW and a F_INSERT * frame - and without any knowledge of the type hierarchy (by definition of F_INSERT). */ static final int COMPUTE_INSERTED_FRAMES = 3; ``` https://gitlab.ow2.org/asm/asm/blob/ASM_7_1/asm/src/main/java/org/objectweb/asm/MethodWriter.java#L58-64
All merged to 2.12.x save for #59 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.