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

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

Issue 11497009: Revive throw as an expression but not for rethrow. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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 part of ssa; 5 part of ssa;
6 6
7 /** 7 /**
8 * A special element for the extra parameter taken by intercepted 8 * A special element for the extra parameter taken by intercepted
9 * methods. We need to override [Element.computeType] because our 9 * methods. We need to override [Element.computeType] because our
10 * optimizers may look at its declared type. 10 * optimizers may look at its declared type.
(...skipping 3746 matching lines...) Expand 10 before | Expand all | Expand 10 after
3757 handleInTryStatement(); 3757 handleInTryStatement();
3758 3758
3759 if (!inliningStack.isEmpty) { 3759 if (!inliningStack.isEmpty) {
3760 localsHandler.updateLocal(returnElement, value); 3760 localsHandler.updateLocal(returnElement, value);
3761 } else { 3761 } else {
3762 close(attachPosition(new HReturn(value), node)).addSuccessor(graph.exit); 3762 close(attachPosition(new HReturn(value), node)).addSuccessor(graph.exit);
3763 } 3763 }
3764 } 3764 }
3765 3765
3766 visitThrow(Throw node) { 3766 visitThrow(Throw node) {
3767 HBasicBlock block;
3767 if (node.expression == null) { 3768 if (node.expression == null) {
3768 HInstruction exception = rethrowableException; 3769 HInstruction exception = rethrowableException;
3769 if (exception == null) { 3770 if (exception == null) {
3770 exception = graph.addConstantNull(constantSystem); 3771 exception = graph.addConstantNull(constantSystem);
3771 compiler.internalError( 3772 compiler.internalError(
3772 'rethrowableException should not be null', node: node); 3773 'rethrowableException should not be null', node: node);
3773 } 3774 }
3774 close(new HThrow(exception, isRethrow: true)); 3775 block = close(new HThrow(exception, isRethrow: true));
3775 } else { 3776 } else {
3776 visit(node.expression); 3777 visit(node.expression);
3777 close(new HThrow(pop())); 3778 block = close(new HThrow(pop()));
3778 } 3779 }
3780 HBasicBlock newBlock = addNewBlock();
3781 block.addSuccessor(newBlock);
3782 open(newBlock);
3783 stack.add(graph.addConstantNull(constantSystem));
3779 } 3784 }
3780 3785
3781 visitTypeAnnotation(TypeAnnotation node) { 3786 visitTypeAnnotation(TypeAnnotation node) {
3782 compiler.internalError('visiting type annotation in SSA builder', 3787 compiler.internalError('visiting type annotation in SSA builder',
3783 node: node); 3788 node: node);
3784 } 3789 }
3785 3790
3786 visitVariableDefinitions(VariableDefinitions node) { 3791 visitVariableDefinitions(VariableDefinitions node) {
3787 for (Link<Node> link = node.definitions.nodes; 3792 for (Link<Node> link = node.definitions.nodes;
3788 !link.isEmpty; 3793 !link.isEmpty;
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after
4991 new HSubGraphBlockInformation(elseBranch.graph)); 4996 new HSubGraphBlockInformation(elseBranch.graph));
4992 4997
4993 HBasicBlock conditionStartBlock = conditionBranch.block; 4998 HBasicBlock conditionStartBlock = conditionBranch.block;
4994 conditionStartBlock.setBlockFlow(info, joinBlock); 4999 conditionStartBlock.setBlockFlow(info, joinBlock);
4995 SubGraph conditionGraph = conditionBranch.graph; 5000 SubGraph conditionGraph = conditionBranch.graph;
4996 HIf branch = conditionGraph.end.last; 5001 HIf branch = conditionGraph.end.last;
4997 assert(branch is HIf); 5002 assert(branch is HIf);
4998 branch.blockInformation = conditionStartBlock.blockFlow; 5003 branch.blockInformation = conditionStartBlock.blockFlow;
4999 } 5004 }
5000 } 5005 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698