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 types.constants; | 5 library types.constants; |
6 | 6 |
| 7 import '../compiler.dart' show |
| 8 Compiler; |
7 import '../constants/values.dart'; | 9 import '../constants/values.dart'; |
8 import '../dart2jslib.dart'; | |
9 import 'types.dart'; | 10 import 'types.dart'; |
10 import '../js_backend/js_backend.dart' show SyntheticConstantKind; | 11 import '../js_backend/js_backend.dart' show SyntheticConstantKind; |
11 | 12 |
12 /// Computes the [TypeMask] for the constant [value]. | 13 /// Computes the [TypeMask] for the constant [value]. |
13 TypeMask computeTypeMask(Compiler compiler, ConstantValue value) { | 14 TypeMask computeTypeMask(Compiler compiler, ConstantValue value) { |
14 return value.accept(const ConstantValueTypeMasks(), compiler); | 15 return value.accept(const ConstantValueTypeMasks(), compiler); |
15 } | 16 } |
16 | 17 |
17 class ConstantValueTypeMasks extends ConstantValueVisitor<TypeMask, Compiler> { | 18 class ConstantValueTypeMasks extends ConstantValueVisitor<TypeMask, Compiler> { |
18 const ConstantValueTypeMasks(); | 19 const ConstantValueTypeMasks(); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 @override | 106 @override |
106 TypeMask visitString(StringConstantValue constant, Compiler compiler) { | 107 TypeMask visitString(StringConstantValue constant, Compiler compiler) { |
107 return compiler.typesTask.stringType; | 108 return compiler.typesTask.stringType; |
108 } | 109 } |
109 | 110 |
110 @override | 111 @override |
111 TypeMask visitType(TypeConstantValue constant, Compiler compiler) { | 112 TypeMask visitType(TypeConstantValue constant, Compiler compiler) { |
112 return compiler.typesTask.typeType; | 113 return compiler.typesTask.typeType; |
113 } | 114 } |
114 } | 115 } |
OLD | NEW |