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

Side by Side Diff: pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart

Issue 1580613002: dart2js: Remove rethrow from the CPS and Tree IRs. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Restore rethrow to the CPS IR. Created 4 years, 11 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library tree_ir_builder; 5 library tree_ir_builder;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../constants/values.dart'; 8 import '../constants/values.dart';
9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; 9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir;
10 import '../elements/elements.dart'; 10 import '../elements/elements.dart';
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 /************************** TAIL EXPRESSIONS **************************/ 403 /************************** TAIL EXPRESSIONS **************************/
404 // 404 //
405 // Visit methods for tail expressions must return a statement directly 405 // Visit methods for tail expressions must return a statement directly
406 // (not a function like interior and call expressions). 406 // (not a function like interior and call expressions).
407 407
408 Statement visitThrow(cps_ir.Throw node) { 408 Statement visitThrow(cps_ir.Throw node) {
409 Expression value = getVariableUse(node.value); 409 Expression value = getVariableUse(node.value);
410 return new Throw(value); 410 return new Throw(value);
411 } 411 }
412 412
413 Statement visitRethrow(cps_ir.Rethrow node) {
414 return new Rethrow();
415 }
416
417 Statement visitUnreachable(cps_ir.Unreachable node) { 413 Statement visitUnreachable(cps_ir.Unreachable node) {
418 return new Unreachable(); 414 return new Unreachable();
419 } 415 }
420 416
421 Statement visitInvokeContinuation(cps_ir.InvokeContinuation node) { 417 Statement visitInvokeContinuation(cps_ir.InvokeContinuation node) {
422 // Invocations of the return continuation are translated to returns. 418 // Invocations of the return continuation are translated to returns.
423 // Other continuation invocations are replaced with assignments of the 419 // Other continuation invocations are replaced with assignments of the
424 // arguments to formal parameter variables, followed by the body if 420 // arguments to formal parameter variables, followed by the body if
425 // the continuation is singly reference or a break if it is multiply 421 // the continuation is singly reference or a break if it is multiply
426 // referenced. 422 // referenced.
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 @override 733 @override
738 Expression visitAwait(cps_ir.Await node) { 734 Expression visitAwait(cps_ir.Await node) {
739 return new Await(getVariableUse(node.input)); 735 return new Await(getVariableUse(node.input));
740 } 736 }
741 737
742 @override 738 @override
743 visitRefinement(cps_ir.Refinement node) { 739 visitRefinement(cps_ir.Refinement node) {
744 return (Statement next) => next; // Compile to nothing. 740 return (Statement next) => next; // Compile to nothing.
745 } 741 }
746 742
747 @override
748 Expression visitBoundsCheck(cps_ir.BoundsCheck node) {
749 throw 'Unexpected BoundsCheck node in tree builder';
750 }
751
752 /********** UNUSED VISIT METHODS *************/ 743 /********** UNUSED VISIT METHODS *************/
753 744
754 unexpectedNode(cps_ir.Node node) { 745 unexpectedNode(cps_ir.Node node) {
755 internalError(CURRENT_ELEMENT_SPANNABLE, 'Unexpected IR node: $node'); 746 internalError(CURRENT_ELEMENT_SPANNABLE, 'Unexpected IR node: $node');
756 } 747 }
757 748
758 visitFunctionDefinition(cps_ir.FunctionDefinition node) { 749 visitFunctionDefinition(cps_ir.FunctionDefinition node) {
759 unexpectedNode(node); 750 unexpectedNode(node);
760 } 751 }
761 visitParameter(cps_ir.Parameter node) => unexpectedNode(node); 752 visitParameter(cps_ir.Parameter node) => unexpectedNode(node);
762 visitContinuation(cps_ir.Continuation node) => unexpectedNode(node); 753 visitContinuation(cps_ir.Continuation node) => unexpectedNode(node);
763 visitMutableVariable(cps_ir.MutableVariable node) => unexpectedNode(node); 754 visitMutableVariable(cps_ir.MutableVariable node) => unexpectedNode(node);
755 visitRethrow(cps_ir.Rethrow node) => unexpectedNode(node);
756 visitBoundsCheck(cps_ir.BoundsCheck node) => unexpectedNode(node);
764 } 757 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart ('k') | pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698