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

Side by Side Diff: lib/compiler/implementation/ssa/builder.dart

Issue 10905203: Allow catch part to be optional as in try {} on T [catch (x[,y])] {} (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class Interceptors { 5 class Interceptors {
6 Compiler compiler; 6 Compiler compiler;
7 Interceptors(Compiler this.compiler); 7 Interceptors(Compiler this.compiler);
8 8
9 SourceString mapOperatorToMethodName(Operator op) { 9 SourceString mapOperatorToMethodName(Operator op) {
10 String name = op.source.stringValue; 10 String name = op.source.stringValue;
(...skipping 3654 matching lines...) Expand 10 before | Expand all | Expand 10 after
3665 } 3665 }
3666 condition = new HIs(type, unwrappedException, nullOk: true); 3666 condition = new HIs(type, unwrappedException, nullOk: true);
3667 push(condition); 3667 push(condition);
3668 } 3668 }
3669 } 3669 }
3670 } 3670 }
3671 3671
3672 void visitThen() { 3672 void visitThen() {
3673 CatchBlock catchBlock = link.head; 3673 CatchBlock catchBlock = link.head;
3674 link = link.tail; 3674 link = link.tail;
3675 localsHandler.updateLocal(elements[catchBlock.exception], 3675 if (catchBlock.exception !== null) {
3676 unwrappedException); 3676 localsHandler.updateLocal(elements[catchBlock.exception],
3677 unwrappedException);
3678 }
3677 Node trace = catchBlock.trace; 3679 Node trace = catchBlock.trace;
3678 if (trace != null) { 3680 if (trace != null) {
3679 pushInvokeHelper1(interceptors.getTraceFromException(), exception); 3681 pushInvokeHelper1(interceptors.getTraceFromException(), exception);
3680 HInstruction traceInstruction = pop(); 3682 HInstruction traceInstruction = pop();
3681 localsHandler.updateLocal(elements[trace], traceInstruction); 3683 localsHandler.updateLocal(elements[trace], traceInstruction);
3682 } 3684 }
3683 visit(catchBlock); 3685 visit(catchBlock);
3684 } 3686 }
3685 3687
3686 void visitElse() { 3688 void visitElse() {
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
4138 new HSubGraphBlockInformation(elseBranch.graph)); 4140 new HSubGraphBlockInformation(elseBranch.graph));
4139 4141
4140 HBasicBlock conditionStartBlock = conditionBranch.block; 4142 HBasicBlock conditionStartBlock = conditionBranch.block;
4141 conditionStartBlock.setBlockFlow(info, joinBlock); 4143 conditionStartBlock.setBlockFlow(info, joinBlock);
4142 SubGraph conditionGraph = conditionBranch.graph; 4144 SubGraph conditionGraph = conditionBranch.graph;
4143 HIf branch = conditionGraph.end.last; 4145 HIf branch = conditionGraph.end.last;
4144 assert(branch is HIf); 4146 assert(branch is HIf);
4145 branch.blockInformation = conditionStartBlock.blockFlow; 4147 branch.blockInformation = conditionStartBlock.blockFlow;
4146 } 4148 }
4147 } 4149 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/scanner/listener.dart ('k') | lib/compiler/implementation/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698