Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Issue 1251083002: dart2js cps: Avoid deep recursion using trampolines and basic blocks. (Closed)

Created:
5 years, 5 months ago by asgerf
Modified:
5 years, 5 months ago
Reviewers:
karlklose, floitsch
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

dart2js cps: Avoid deep recursion using trampolines and basic blocks. The CPS RecursiveVisitor now uses an explicit stack of things to do on the way out of a term. Every CPS pass has been hacked to fit the new visitor paradigm. The tree visitors now iterate over chains of ExpressionStatements. This seems to do the trick, mostly because direct-style rewriting significantly reduces the height of the tree. The IR tracers still use deep recursion, but they are disabled by default anyway so they are not critical. BUG= R=floitsch@google.com, karlklose@google.com Committed: https://github.com/dart-lang/sdk/commit/7d038fbc679fcbf17bccfc27562584d323c75de5

Patch Set 1 #

Patch Set 2 : Add another test #

Patch Set 3 : Fix a comment #

Total comments: 26

Patch Set 4 : Address comments #

Patch Set 5 : Change type propagation + minor fixes #

Total comments: 3

Patch Set 6 : Adjust test case #

Patch Set 7 : New test fails in SSA backend. Update status file. #

Patch Set 8 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11460 lines, -480 lines) Patch
M pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart View 3 chunks +58 lines, -55 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart View 1 2 3 4 5 6 7 6 chunks +130 lines, -14 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/let_sinking.dart View 1 chunk +15 lines, -12 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/mutable_ssa.dart View 1 chunk +5 lines, -4 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/redundant_join.dart View 2 chunks +9 lines, -10 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/type_propagation.dart View 1 2 3 4 5 6 7 23 chunks +156 lines, -113 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/codegen/unsugar.dart View 1 2 3 4 5 6 7 4 chunks +7 lines, -15 lines 0 comments Download
M pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart View 1 2 3 2 chunks +61 lines, -33 lines 0 comments Download
M pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart View 1 2 3 4 5 6 7 12 chunks +245 lines, -212 lines 0 comments Download
M pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart View 1 2 3 4 5 6 7 2 chunks +20 lines, -5 lines 0 comments Download
M pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart View 2 chunks +6 lines, -2 lines 0 comments Download
M tests/co19/co19-dart2js.status View 1 2 3 4 5 6 7 2 chunks +3 lines, -3 lines 0 comments Download
M tests/language/language_dart2js.status View 1 2 3 4 5 6 7 3 chunks +1 line, -2 lines 0 comments Download
A tests/language/larger_implicit_getter_test.dart View 1 2 3 4 5 1 chunk +4100 lines, -0 lines 0 comments Download
A tests/language/many_method_calls_test.dart View 1 1 chunk +6644 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (3 generated)
asgerf
Please start by reading the documentation for RecursiveVisitor in cps_ir_nodes.dart. Some of the code won't ...
5 years, 5 months ago (2015-07-22 12:46:45 UTC) #4
karlklose
LGTM. https://codereview.chromium.org/1251083002/diff/40001/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart File pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart (right): https://codereview.chromium.org/1251083002/diff/40001/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart#newcode1440 pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart:1440: typedef dynamic StackAction(); The return type should be ...
5 years, 5 months ago (2015-07-22 14:08:06 UTC) #5
floitsch
LGTM. https://codereview.chromium.org/1251083002/diff/40001/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart File pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart (right): https://codereview.chromium.org/1251083002/diff/40001/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart#newcode371 pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart:371: Statement visitExpressionStatement(ExpressionStatement inputNode) { Add comment, what this ...
5 years, 5 months ago (2015-07-22 14:21:43 UTC) #6
asgerf
https://codereview.chromium.org/1251083002/diff/40001/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart File pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart (right): https://codereview.chromium.org/1251083002/diff/40001/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart#newcode1440 pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart:1440: typedef dynamic StackAction(); On 2015/07/22 14:08:06, karlklose wrote: > ...
5 years, 5 months ago (2015-07-22 14:32:25 UTC) #7
karlklose
> BTW this file is an existing test I copied and just made the list ...
5 years, 5 months ago (2015-07-23 06:44:45 UTC) #8
karlklose
https://codereview.chromium.org/1251083002/diff/40001/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart File pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart (right): https://codereview.chromium.org/1251083002/diff/40001/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart#newcode279 pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart:279: for (NodeCallback fun in stack.reversed) { On 2015/07/22 14:32:25, ...
5 years, 5 months ago (2015-07-23 06:55:54 UTC) #9
asgerf
PTAL at type propagation in delta 5->4. There was a problem with how new expressions ...
5 years, 5 months ago (2015-07-23 09:32:47 UTC) #10
karlklose
Still LGTM. https://codereview.chromium.org/1251083002/diff/80001/tests/language/larger_implicit_getter_test.dart File tests/language/larger_implicit_getter_test.dart (right): https://codereview.chromium.org/1251083002/diff/80001/tests/language/larger_implicit_getter_test.dart#newcode4099 tests/language/larger_implicit_getter_test.dart:4099: confuse(panels); Maybe print the length of confuse(panels) ...
5 years, 5 months ago (2015-07-23 10:55:07 UTC) #11
asgerf
https://codereview.chromium.org/1251083002/diff/80001/tests/language/larger_implicit_getter_test.dart File tests/language/larger_implicit_getter_test.dart (right): https://codereview.chromium.org/1251083002/diff/80001/tests/language/larger_implicit_getter_test.dart#newcode4099 tests/language/larger_implicit_getter_test.dart:4099: confuse(panels); On 2015/07/23 10:55:07, karlklose wrote: > Maybe print ...
5 years, 5 months ago (2015-07-23 11:03:36 UTC) #12
asgerf
5 years, 5 months ago (2015-07-23 11:52:10 UTC) #13
Message was sent while issue was closed.
Committed patchset #8 (id:130001) manually as
7d038fbc679fcbf17bccfc27562584d323c75de5 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698