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

Issue 1201983002: Implement try/finally by inlining the finally code. (Closed)

Created:
5 years, 6 months ago by Kevin Millikin (Google)
Modified:
5 years, 6 months ago
Reviewers:
asgerf
CC:
reviews_dartlang.org
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Implement try/finally by inlining the finally code. Try/finally is implemented by inlining. There is a try/catch to catch exceptions in the try block. The catch body contains the finally code followed by a rethrow. The code for finally is translated again after the normal exit of the try block. Break, continue, and return exits in the try block have the finally code inlined just before the exit is taken. Try/catch/finally is not yet supported, it requires some changes to the assigned variables analysis. R=asgerf@google.com Committed: https://github.com/dart-lang/sdk/commit/089ed2965bb7d6ae6a5e8134a67f8a3889b0c6e4

Patch Set 1 #

Patch Set 2 : Run all the finally blocks. #

Total comments: 2

Patch Set 3 : Do not translate any more finally blocks after one exits. #

Total comments: 4

Patch Set 4 : Move inlined finally code outside the try handler. #

Patch Set 5 : Merge, rebase test expectations. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1182 lines, -2086 lines) Patch
M pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart View 1 2 3 4 18 chunks +307 lines, -174 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart View 1 2 3 4 2 chunks +6 lines, -3 lines 0 comments Download
M pkg/pkg.status View 1 2 3 4 1 chunk +42 lines, -41 lines 0 comments Download
M samples/samples.status View 1 chunk +1 line, -1 line 0 comments Download
M tests/benchmark_smoke/benchmark_smoke.status View 1 chunk +1 line, -1 line 0 comments Download
M tests/co19/co19-dart2js.status View 1 2 3 6 chunks +403 lines, -1338 lines 0 comments Download
M tests/compiler/dart2js_extra/dart2js_extra.status View 1 2 3 4 3 chunks +17 lines, -17 lines 0 comments Download
M tests/compiler/dart2js_native/dart2js_native.status View 1 chunk +3 lines, -4 lines 0 comments Download
M tests/corelib/corelib.status View 1 chunk +1 line, -1 line 0 comments Download
M tests/html/html.status View 1 2 3 4 2 chunks +78 lines, -78 lines 0 comments Download
M tests/isolate/isolate.status View 1 chunk +54 lines, -59 lines 0 comments Download
M tests/language/language_dart2js.status View 1 2 3 4 8 chunks +53 lines, -76 lines 0 comments Download
M tests/lib/lib.status View 12 chunks +164 lines, -168 lines 0 comments Download
M tests/standalone/standalone.status View 3 chunks +51 lines, -124 lines 0 comments Download
M tests/utils/utils.status View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 7 (1 generated)
Kevin Millikin (Google)
https://codereview.chromium.org/1201983002/diff/20001/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart File pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart (right): https://codereview.chromium.org/1201983002/diff/20001/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart#newcode1782 pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart:1782: JumpCollector join = new ForwardJumpCollector(environment); This is the code ...
5 years, 6 months ago (2015-06-22 15:36:42 UTC) #2
asgerf
l-g-t-m if the bug is fixed. https://codereview.chromium.org/1201983002/diff/40001/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart File pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart (right): https://codereview.chromium.org/1201983002/diff/40001/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart#newcode187 pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart:187: if (!builder.isOpen) return; ...
5 years, 6 months ago (2015-06-23 08:43:40 UTC) #3
Kevin Millikin (Google)
https://codereview.chromium.org/1201983002/diff/40001/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart File pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart (right): https://codereview.chromium.org/1201983002/diff/40001/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart#newcode187 pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart:187: if (!builder.isOpen) return; On 2015/06/23 08:43:40, asgerf wrote: > ...
5 years, 6 months ago (2015-06-23 09:26:59 UTC) #4
Kevin Millikin (Google)
Fixed. Please take another look. I've moved the code for finally outside the scope of ...
5 years, 6 months ago (2015-06-23 14:13:04 UTC) #5
asgerf
LGTM
5 years, 6 months ago (2015-06-23 14:23:45 UTC) #6
Kevin Millikin (Google)
5 years, 6 months ago (2015-06-24 08:12:57 UTC) #7
Message was sent while issue was closed.
Committed patchset #5 (id:80001) manually as
089ed2965bb7d6ae6a5e8134a67f8a3889b0c6e4 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698