| OLD | NEW |
| 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; | 5 library dart2js.ir_builder; |
| 6 | 6 |
| 7 import '../compile_time_constants.dart' show BackendConstantEnvironment; | 7 import '../compile_time_constants.dart' show |
| 8 BackendConstantEnvironment; |
| 8 import '../constants/constant_system.dart'; | 9 import '../constants/constant_system.dart'; |
| 9 import '../constants/values.dart' show ConstantValue, PrimitiveConstantValue; | 10 import '../constants/values.dart' show |
| 11 ConstantValue, |
| 12 PrimitiveConstantValue; |
| 10 import '../dart_types.dart'; | 13 import '../dart_types.dart'; |
| 11 import '../dart2jslib.dart'; | 14 import '../diagnostics/invariant.dart' show |
| 15 invariant; |
| 12 import '../elements/elements.dart'; | 16 import '../elements/elements.dart'; |
| 13 import '../io/source_information.dart'; | 17 import '../io/source_information.dart'; |
| 14 import '../tree/tree.dart' as ast; | 18 import '../tree/tree.dart' as ast; |
| 15 import '../types/types.dart' show TypeMask; | 19 import '../types/types.dart' show |
| 20 TypeMask; |
| 16 import '../closure.dart' hide ClosureScope; | 21 import '../closure.dart' hide ClosureScope; |
| 17 import '../universe/universe.dart' show | 22 import '../universe/universe.dart' show |
| 18 CallStructure, | 23 CallStructure, |
| 19 Selector, | 24 Selector, |
| 20 SelectorKind; | 25 SelectorKind; |
| 21 import 'cps_ir_nodes.dart' as ir; | 26 import 'cps_ir_nodes.dart' as ir; |
| 22 import 'cps_ir_builder_task.dart' show DartCapturedVariables, | 27 import 'cps_ir_builder_task.dart' show |
| 28 DartCapturedVariables, |
| 23 GlobalProgramInformation; | 29 GlobalProgramInformation; |
| 24 | 30 |
| 25 import '../common.dart' as types show TypeMask; | 31 import '../common.dart' as types show |
| 26 import '../js/js.dart' as js show Template; | 32 TypeMask; |
| 27 import '../native/native.dart' show NativeBehavior; | 33 import '../js/js.dart' as js show |
| 34 Template; |
| 35 import '../native/native.dart' show |
| 36 NativeBehavior; |
| 28 | 37 |
| 29 /// A mapping from variable elements to their compile-time values. | 38 /// A mapping from variable elements to their compile-time values. |
| 30 /// | 39 /// |
| 31 /// Map elements denoted by parameters and local variables to the | 40 /// Map elements denoted by parameters and local variables to the |
| 32 /// [ir.Primitive] that is their value. Parameters and locals are | 41 /// [ir.Primitive] that is their value. Parameters and locals are |
| 33 /// assigned indexes which can be used to refer to them. | 42 /// assigned indexes which can be used to refer to them. |
| 34 class Environment { | 43 class Environment { |
| 35 /// A map from locals to their environment index. | 44 /// A map from locals to their environment index. |
| 36 final Map<Local, int> variable2index; | 45 final Map<Local, int> variable2index; |
| 37 | 46 |
| (...skipping 2748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2786 } | 2795 } |
| 2787 | 2796 |
| 2788 class SwitchCaseInfo { | 2797 class SwitchCaseInfo { |
| 2789 final List<ir.Primitive> constants = <ir.Primitive>[]; | 2798 final List<ir.Primitive> constants = <ir.Primitive>[]; |
| 2790 final SubbuildFunction buildBody; | 2799 final SubbuildFunction buildBody; |
| 2791 | 2800 |
| 2792 SwitchCaseInfo(this.buildBody); | 2801 SwitchCaseInfo(this.buildBody); |
| 2793 | 2802 |
| 2794 void addConstant(ir.Primitive constant) => constants.add(constant); | 2803 void addConstant(ir.Primitive constant) => constants.add(constant); |
| 2795 } | 2804 } |
| OLD | NEW |