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

Issue 63983005: Simplify the desugaring of catch clauses. (Closed)

Created:
7 years, 1 month ago by Kevin Millikin (Google)
Modified:
7 years, 1 month ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Simplify the desugaring of catch clauses. Rather than if/then/continue (where the continue does not match the semantics of Dart's continue), use if/then/else. This removes the unnecessary goto and label as a step toward streamlining support for jumping in the compiler backend. R=hausner@google.com Committed: https://code.google.com/p/dart/source/detail?r=30227

Patch Set 1 #

Patch Set 2 : Simple cleanups to indentation and comments. #

Total comments: 24

Patch Set 3 : Parse catch clauses with a loop instead of recursion. #

Total comments: 6

Patch Set 4 : Incorporated a round of review comments. #

Total comments: 15

Patch Set 5 : Incorporated final review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+283 lines, -222 lines) Patch
M runtime/vm/ast.h View 1 2 3 4 3 chunks +0 lines, -5 lines 0 comments Download
M runtime/vm/flow_graph_builder.cc View 1 2 1 chunk +4 lines, -3 lines 0 comments Download
M runtime/vm/parser.h View 1 2 3 4 2 chunks +20 lines, -10 lines 0 comments Download
M runtime/vm/parser.cc View 1 2 3 4 13 chunks +229 lines, -185 lines 0 comments Download
M runtime/vm/scopes.h View 1 2 3 4 1 chunk +0 lines, -3 lines 0 comments Download
M runtime/vm/scopes.cc View 1 2 3 4 1 chunk +0 lines, -15 lines 0 comments Download
M runtime/vm/symbols.h View 1 chunk +1 line, -1 line 0 comments Download
M tests/language/try_catch_test.dart View 1 2 3 2 chunks +29 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
Kevin Millikin (Google)
It seems like the dust has settled around try/catch for now so here's the change ...
7 years, 1 month ago (2013-11-07 13:43:23 UTC) #1
hausner
I am fine with eliminating the goto and replace the if-statements with if-else if. But ...
7 years, 1 month ago (2013-11-07 17:48:34 UTC) #2
Kevin Millikin (Google)
On 2013/11/07 17:48:34, hausner wrote: > I am fine with eliminating the goto and replace ...
7 years, 1 month ago (2013-11-07 21:07:56 UTC) #3
hausner
The parser is recursive in some cases where the grammar itself is recursive. It is ...
7 years, 1 month ago (2013-11-07 21:42:06 UTC) #4
Kevin Millikin (Google)
On 2013/11/07 21:42:06, hausner wrote: > The parser is recursive in some cases where the ...
7 years, 1 month ago (2013-11-07 21:58:31 UTC) #5
Kevin Millikin (Google)
> If you like CatchParamDesc much better I can just change it back, but that ...
7 years, 1 month ago (2013-11-07 22:08:17 UTC) #6
Kevin Millikin (Google)
(We should actually be asked in code reviews to justify leaving includes out, because that's ...
7 years, 1 month ago (2013-11-08 11:03:55 UTC) #7
Kevin Millikin (Google)
Please take another look.
7 years, 1 month ago (2013-11-08 13:11:58 UTC) #8
hausner
Nesting of the catch clause nodes is wrong. See comment below. https://codereview.chromium.org/63983005/diff/140001/runtime/vm/parser.cc File runtime/vm/parser.cc (right): ...
7 years, 1 month ago (2013-11-08 21:52:30 UTC) #9
Kevin Millikin (Google)
Thanks for the review. I think the scoping of the else blocks seems correct to ...
7 years, 1 month ago (2013-11-11 11:39:57 UTC) #10
Kevin Millikin (Google)
This is changed to add unreachable catch bodies to the AST for the debugger. Matthias, ...
7 years, 1 month ago (2013-11-11 15:22:27 UTC) #11
hausner
I am not done looking at this change, will continue tomorrow. Unfortunately, you insist in ...
7 years, 1 month ago (2013-11-12 01:12:09 UTC) #12
Kevin Millikin (Google)
On 2013/11/12 01:12:09, hausner wrote: > Unfortunately, you > insist in making completely unnecessary complications. ...
7 years, 1 month ago (2013-11-12 15:05:24 UTC) #13
hausner
I finally understand the nesting. LGTM with comments. A couple of rounds back, you asked ...
7 years, 1 month ago (2013-11-12 19:21:45 UTC) #14
Florian Schneider
dbc: https://codereview.chromium.org/63983005/diff/240002/runtime/vm/parser.cc File runtime/vm/parser.cc (right): https://codereview.chromium.org/63983005/diff/240002/runtime/vm/parser.cc#newcode6 runtime/vm/parser.cc:6: On 2013/11/12 19:21:45, hausner wrote: > Please keep ...
7 years, 1 month ago (2013-11-13 10:25:41 UTC) #15
Kevin Millikin (Google)
Matthias, thanks for the review. https://codereview.chromium.org/63983005/diff/240002/runtime/vm/parser.cc File runtime/vm/parser.cc (left): https://codereview.chromium.org/63983005/diff/240002/runtime/vm/parser.cc#oldcode7165 runtime/vm/parser.cc:7165: SourceLabel* label = current_block_->scope->LookupInnermostCatchLabel(); ...
7 years, 1 month ago (2013-11-13 13:47:02 UTC) #16
Kevin Millikin (Google)
7 years, 1 month ago (2013-11-13 14:08:23 UTC) #17
Message was sent while issue was closed.
Committed patchset #5 manually as r30227 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698