| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
| 6 import 'package:kernel/text/ast_to_text.dart' show debugNodeToString; | 6 import 'package:kernel/text/ast_to_text.dart' show debugNodeToString; |
| 7 | 7 |
| 8 import '../closure.dart'; | 8 import '../closure.dart'; |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; | 10 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 } | 476 } |
| 477 } | 477 } |
| 478 assert(!current.isClosed()); | 478 assert(!current.isClosed()); |
| 479 if (stack.isNotEmpty) { | 479 if (stack.isNotEmpty) { |
| 480 compiler.reporter | 480 compiler.reporter |
| 481 .internalError(NO_LOCATION_SPANNABLE, 'Non-empty instruction stack'); | 481 .internalError(NO_LOCATION_SPANNABLE, 'Non-empty instruction stack'); |
| 482 } | 482 } |
| 483 } | 483 } |
| 484 | 484 |
| 485 @override | 485 @override |
| 486 void visitEmptyStatement(ir.EmptyStatement statement) { |
| 487 // Empty statement adds no instructions to current block. |
| 488 } |
| 489 |
| 490 @override |
| 486 void visitExpressionStatement(ir.ExpressionStatement exprStatement) { | 491 void visitExpressionStatement(ir.ExpressionStatement exprStatement) { |
| 487 if (!isReachable) return; | 492 if (!isReachable) return; |
| 488 ir.Expression expression = exprStatement.expression; | 493 ir.Expression expression = exprStatement.expression; |
| 489 if (expression is ir.Throw) { | 494 if (expression is ir.Throw) { |
| 490 // TODO(sra): Prevent generating a statement when inlining. | 495 // TODO(sra): Prevent generating a statement when inlining. |
| 491 _visitThrowExpression(expression.expression); | 496 _visitThrowExpression(expression.expression); |
| 492 closeAndGotoExit(new HThrow(pop(), null)); | 497 closeAndGotoExit(new HThrow(pop(), null)); |
| 493 } else { | 498 } else { |
| 494 expression.accept(this); | 499 expression.accept(this); |
| 495 pop(); | 500 pop(); |
| (...skipping 1433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1929 push(new HNot(popBoolified(), backend.boolType)); | 1934 push(new HNot(popBoolified(), backend.boolType)); |
| 1930 } | 1935 } |
| 1931 | 1936 |
| 1932 @override | 1937 @override |
| 1933 void visitStringConcatenation(ir.StringConcatenation stringConcat) { | 1938 void visitStringConcatenation(ir.StringConcatenation stringConcat) { |
| 1934 KernelStringBuilder stringBuilder = new KernelStringBuilder(this); | 1939 KernelStringBuilder stringBuilder = new KernelStringBuilder(this); |
| 1935 stringConcat.accept(stringBuilder); | 1940 stringConcat.accept(stringBuilder); |
| 1936 stack.add(stringBuilder.result); | 1941 stack.add(stringBuilder.result); |
| 1937 } | 1942 } |
| 1938 } | 1943 } |
| OLD | NEW |