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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart

Issue 1087483003: cps-ir: Don't bail on assert in unchecked mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comment Created 5 years, 8 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
« no previous file with comments | « no previous file | tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 dart2js.ir_builder_task; 5 library dart2js.ir_builder_task;
6 6
7 import '../closure.dart' as closurelib; 7 import '../closure.dart' as closurelib;
8 import '../closure.dart' hide ClosureScope; 8 import '../closure.dart' hide ClosureScope;
9 import '../constants/expressions.dart'; 9 import '../constants/expressions.dart';
10 import '../dart_types.dart'; 10 import '../dart_types.dart';
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 // Throw away the result of visiting the expression. 629 // Throw away the result of visiting the expression.
630 // Instead we return the result of visiting the CascadeReceiver. 630 // Instead we return the result of visiting the CascadeReceiver.
631 this.visit(node.expression); 631 this.visit(node.expression);
632 ir.Primitive receiver = _currentCascadeReceiver; 632 ir.Primitive receiver = _currentCascadeReceiver;
633 _currentCascadeReceiver = oldCascadeReceiver; 633 _currentCascadeReceiver = oldCascadeReceiver;
634 return receiver; 634 return receiver;
635 } 635 }
636 636
637 // ## Sends ## 637 // ## Sends ##
638 @override 638 @override
639 ir.Primitive visitAssert( 639 ir.Primitive visitAssert(ast.Send node, ast.Node condition, _) {
640 ast.Send node,
641 ast.Node condition,
642 _) {
643 assert(irBuilder.isOpen); 640 assert(irBuilder.isOpen);
644 return giveup(node, 'Assert'); 641 if (compiler.enableUserAssertions) {
642 return giveup(node, 'assert in checked mode not implemented');
643 } else {
644 // The call to assert and its argument expression must be ignored
645 // in production mode.
646 // Assertions can only occur in expression statements, so no value needs
647 // to be returned.
648 return null;
649 }
645 } 650 }
646 651
647 ir.Primitive visitNamedArgument(ast.NamedArgument node) { 652 ir.Primitive visitNamedArgument(ast.NamedArgument node) {
648 assert(irBuilder.isOpen); 653 assert(irBuilder.isOpen);
649 return visit(node.expression); 654 return visit(node.expression);
650 } 655 }
651 656
652 @override 657 @override
653 ir.Primitive visitExpressionInvoke(ast.Send node, 658 ir.Primitive visitExpressionInvoke(ast.Send node,
654 ast.Node expression, 659 ast.Node expression,
(...skipping 2082 matching lines...) Expand 10 before | Expand all | Expand 10 after
2737 SourceInformation buildCall(ast.Node node) { 2742 SourceInformation buildCall(ast.Node node) {
2738 return new PositionSourceInformation( 2743 return new PositionSourceInformation(
2739 new TokenSourceLocation(sourceFile, node.getBeginToken(), name)); 2744 new TokenSourceLocation(sourceFile, node.getBeginToken(), name));
2740 } 2745 }
2741 2746
2742 @override 2747 @override
2743 SourceInformationBuilder forContext(AstElement element) { 2748 SourceInformationBuilder forContext(AstElement element) {
2744 return new PositionSourceInformationBuilder(element); 2749 return new PositionSourceInformationBuilder(element);
2745 } 2750 }
2746 } 2751 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698