| 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 | 6 |
| 7 import '../closure.dart'; | 7 import '../closure.dart'; |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../compiler.dart'; | 9 import '../compiler.dart'; |
| 10 import '../constants/expressions.dart'; | 10 import '../constants/expressions.dart'; |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 : super(builder, target) { | 614 : super(builder, target) { |
| 615 // The switch case indices must match those computed in | 615 // The switch case indices must match those computed in |
| 616 // [KernelSsaBuilder.buildSwitchCaseConstants]. | 616 // [KernelSsaBuilder.buildSwitchCaseConstants]. |
| 617 // Switch indices are 1-based so we can bypass the synthetic loop when no | 617 // Switch indices are 1-based so we can bypass the synthetic loop when no |
| 618 // cases match simply by branching on the index (which defaults to null). | 618 // cases match simply by branching on the index (which defaults to null). |
| 619 // TODO | 619 // TODO |
| 620 int switchIndex = 1; | 620 int switchIndex = 1; |
| 621 for (ir.SwitchCase switchCase in switchStatement.cases) { | 621 for (ir.SwitchCase switchCase in switchStatement.cases) { |
| 622 JumpTarget continueTarget = | 622 JumpTarget continueTarget = |
| 623 localsMap.getJumpTargetForSwitchCase(switchCase); | 623 localsMap.getJumpTargetForSwitchCase(switchCase); |
| 624 assert(continueTarget is KernelJumpTarget); | 624 if (continueTarget != null) { |
| 625 targetIndexMap[continueTarget] = switchIndex; | 625 targetIndexMap[continueTarget] = switchIndex; |
| 626 assert(builder.jumpTargets[continueTarget] == null); | 626 assert(builder.jumpTargets[continueTarget] == null); |
| 627 builder.jumpTargets[continueTarget] = this; | 627 builder.jumpTargets[continueTarget] = this; |
| 628 } |
| 628 switchIndex++; | 629 switchIndex++; |
| 629 } | 630 } |
| 630 } | 631 } |
| 631 } | 632 } |
| 632 | 633 |
| 633 class KernelAstTypeInferenceMap implements KernelToTypeInferenceMap { | 634 class KernelAstTypeInferenceMap implements KernelToTypeInferenceMap { |
| 634 final KernelAstAdapter _astAdapter; | 635 final KernelAstAdapter _astAdapter; |
| 635 | 636 |
| 636 KernelAstTypeInferenceMap(this._astAdapter); | 637 KernelAstTypeInferenceMap(this._astAdapter); |
| 637 | 638 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 TypeMask selectorTypeOf(Selector selector, TypeMask mask) { | 745 TypeMask selectorTypeOf(Selector selector, TypeMask mask) { |
| 745 return TypeMaskFactory.inferredTypeForSelector( | 746 return TypeMaskFactory.inferredTypeForSelector( |
| 746 selector, mask, _globalInferenceResults); | 747 selector, mask, _globalInferenceResults); |
| 747 } | 748 } |
| 748 | 749 |
| 749 TypeMask typeFromNativeBehavior( | 750 TypeMask typeFromNativeBehavior( |
| 750 native.NativeBehavior nativeBehavior, ClosedWorld closedWorld) { | 751 native.NativeBehavior nativeBehavior, ClosedWorld closedWorld) { |
| 751 return TypeMaskFactory.fromNativeBehavior(nativeBehavior, closedWorld); | 752 return TypeMaskFactory.fromNativeBehavior(nativeBehavior, closedWorld); |
| 752 } | 753 } |
| 753 } | 754 } |
| OLD | NEW |