| OLD | NEW |
| 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 analyzer2dart.cps_generator; | 5 library analyzer2dart.cps_generator; |
| 6 | 6 |
| 7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
| 8 | 8 |
| 9 import 'package:compiler/implementation/dart_types.dart' as dart2js; | 9 import 'package:compiler/implementation/dart_types.dart' as dart2js; |
| 10 import 'package:compiler/implementation/elements/elements.dart' as dart2js; | 10 import 'package:compiler/implementation/elements/elements.dart' as dart2js; |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 buildBody: subbuild(node.body), | 336 buildBody: subbuild(node.body), |
| 337 buildUpdate: subbuildSequence(node.updaters)); | 337 buildUpdate: subbuildSequence(node.updaters)); |
| 338 } | 338 } |
| 339 | 339 |
| 340 @override | 340 @override |
| 341 visitWhileStatement(WhileStatement node) { | 341 visitWhileStatement(WhileStatement node) { |
| 342 // TODO(johnniwinther): Support `while` as a jump target. | 342 // TODO(johnniwinther): Support `while` as a jump target. |
| 343 irBuilder.buildWhile(buildCondition: subbuild(node.condition), | 343 irBuilder.buildWhile(buildCondition: subbuild(node.condition), |
| 344 buildBody: subbuild(node.body)); | 344 buildBody: subbuild(node.body)); |
| 345 } | 345 } |
| 346 |
| 347 @override |
| 348 ir.Primitive visitIsExpression(IsExpression node) { |
| 349 return irBuilder.buildTypeOperator( |
| 350 visit(node.expression), |
| 351 converter.convertType(node.type.type), |
| 352 isTypeTest: true, |
| 353 isNotCheck: node.notOperator != null); |
| 354 } |
| 355 |
| 356 @override |
| 357 ir.Primitive visitAsExpression(AsExpression node) { |
| 358 return irBuilder.buildTypeOperator( |
| 359 visit(node.expression), |
| 360 converter.convertType(node.type.type), |
| 361 isTypeTest: false); |
| 362 } |
| 346 } | 363 } |
| OLD | NEW |