Chromium Code Reviews| Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart |
| diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart |
| index a0fb612a58386c835b435fd0df6fdb595739bdaa..9985c94238817fc53740c5e4128d485febf25762 100644 |
| --- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart |
| +++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart |
| @@ -1764,13 +1764,15 @@ abstract class IrBuilder { |
| LocalVariableElement exceptionVariable = |
| catchClauseInfo.exceptionVariable; |
| ir.Parameter exceptionParameter = new ir.Parameter(exceptionVariable); |
| - catchBuilder.environment.extend(exceptionVariable, exceptionParameter); |
| + catchBuilder.declareLocalVariable(exceptionVariable, |
|
Kevin Millikin (Google)
2015/04/17 09:52:10
It is necessary to 'declare' these parameters in c
|
| + initialValue: exceptionParameter); |
| ir.Parameter traceParameter; |
| LocalVariableElement stackTraceVariable = |
| catchClauseInfo.stackTraceVariable; |
| if (stackTraceVariable != null) { |
| traceParameter = new ir.Parameter(stackTraceVariable); |
| - catchBuilder.environment.extend(stackTraceVariable, traceParameter); |
| + catchBuilder.declareLocalVariable(stackTraceVariable, |
| + initialValue: traceParameter); |
| } else { |
| // Use a dummy continuation parameter for the stack trace parameter. |
| // This will ensure that all handlers have two parameters and so they |
| @@ -1881,6 +1883,23 @@ abstract class IrBuilder { |
| return false; |
| } |
| + void buildThrow(ir.Primitive value) { |
| + assert(isOpen); |
| + add(new ir.Throw(value)); |
| + _current = null; |
| + } |
| + |
| + ir.Primitive buildNonTailThrow(ir.Primitive value) { |
| + assert(isOpen); |
| + return addPrimitive(new ir.NonTailThrow(value)); |
| + } |
| + |
| + void buildRethrow() { |
| + assert(isOpen); |
| + add(new ir.Rethrow()); |
|
asgerf
2015/04/17 10:33:01
I would imagine this needs a reference to the exce
Kevin Millikin (Google)
2015/04/17 11:17:07
It will be translated by the unsugar pass to 'thro
|
| + _current = null; |
| + } |
| + |
| /// Create a negation of [condition]. |
| ir.Primitive buildNegation(ir.Primitive condition) { |
| // ! e is translated as e ? false : true |