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

Issue 1092023002: CPS implementation of throw and rethrow. (Closed)

Created:
5 years, 8 months ago by Kevin Millikin (Google)
Modified:
5 years, 8 months ago
Reviewers:
asgerf
CC:
reviews_dartlang.org
Target Ref:
refs/remotes/git-svn
Visibility:
Public.

Description

CPS implementation of throw and rethrow. Throw and rethrow are implemented as CPS expressions in tail position. The CPS translation assumes that all expressions translate to a primitive that is the value of the expression, and throw is an expression in Dart. For simplicity of the translation, a non-tail throw Primitive is sometimes used as a placeholder during the translation and removed immediately afterward. Both throw and rethrow are represented in the Tree IR. In the Dart backend, throw translates to throw and rethrow translates to rethrow. In the JS backend, throw translates to JS throw of a wrapped value. Rethrow is not currently implemented for the JS backend, it bails out of the compiler. R=asgerf@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=45235

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+368 lines, -91 lines) Patch
M pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart View 2 chunks +21 lines, -2 lines 3 comments Download
M pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart View 6 chunks +105 lines, -8 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart View 7 chunks +64 lines, -3 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart View 4 chunks +17 lines, -4 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart View 4 chunks +26 lines, -6 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/optimizers.dart View 1 chunk +0 lines, -2 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart View 1 chunk +4 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/type_propagation.dart View 1 chunk +10 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/dart_backend/backend_ast_emitter.dart View 4 chunks +15 lines, -11 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/codegen/codegen.dart View 1 chunk +10 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/codegen/glue.dart View 1 chunk +4 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/codegen/unsugar.dart View 1 chunk +8 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart View 1 chunk +9 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart View 1 chunk +13 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart View 5 chunks +46 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart View 2 chunks +16 lines, -0 lines 0 comments Download
M tests/co19/co19-dart2js.status View 4 chunks +0 lines, -7 lines 0 comments Download
M tests/corelib/corelib.status View 3 chunks +0 lines, -5 lines 0 comments Download
M tests/isolate/isolate.status View 4 chunks +0 lines, -8 lines 0 comments Download
M tests/language/language_dart2js.status View 12 chunks +0 lines, -15 lines 0 comments Download
M tests/lib/lib.status View 8 chunks +0 lines, -11 lines 0 comments Download
M tests/standalone/standalone.status View 7 chunks +0 lines, -9 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Kevin Millikin (Google)
5 years, 8 months ago (2015-04-17 09:48:30 UTC) #1
Kevin Millikin (Google)
https://codereview.chromium.org/1092023002/diff/1/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/1092023002/diff/1/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart#newcode1767 pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart:1767: catchBuilder.declareLocalVariable(exceptionVariable, It is necessary to 'declare' these parameters in ...
5 years, 8 months ago (2015-04-17 09:52:10 UTC) #2
asgerf
LGTM https://codereview.chromium.org/1092023002/diff/1/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/1092023002/diff/1/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart#newcode1899 pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart:1899: add(new ir.Rethrow()); I would imagine this needs a ...
5 years, 8 months ago (2015-04-17 10:33:01 UTC) #3
Kevin Millikin (Google)
Committed patchset #1 (id:1) manually as 45235 (presubmit successful).
5 years, 8 months ago (2015-04-17 11:16:16 UTC) #4
Kevin Millikin (Google)
5 years, 8 months ago (2015-04-17 11:17:07 UTC) #5
Message was sent while issue was closed.
https://codereview.chromium.org/1092023002/diff/1/pkg/compiler/lib/src/cps_ir...
File pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart (right):

https://codereview.chromium.org/1092023002/diff/1/pkg/compiler/lib/src/cps_ir...
pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart:1899: add(new ir.Rethrow());
On 2015/04/17 10:33:01, asgerf wrote:
> I would imagine this needs a reference to the exception variable in JS.

It will be translated by the unsugar pass to 'throw e' where e is that variable.

Powered by Google App Engine
This is Rietveld 408576698