| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.serialization.constants; | 5 library dart2js.serialization.constants; |
| 6 | 6 |
| 7 import '../constants/constructors.dart'; | 7 import '../constants/constructors.dart'; |
| 8 import '../constants/expressions.dart'; | 8 import '../constants/expressions.dart'; |
| 9 import '../dart_types.dart'; | 9 import '../dart_types.dart'; |
| 10 import '../elements/elements.dart' show FieldElement; | 10 import '../elements/elements.dart' show FieldElement; |
| 11 import '../resolution/operators.dart'; | 11 import '../resolution/operators.dart'; |
| 12 import '../universe/call_structure.dart' show CallStructure; | 12 import '../universe/call_structure.dart' show CallStructure; |
| 13 import 'keys.dart'; |
| 13 import 'serialization.dart'; | 14 import 'serialization.dart'; |
| 14 import 'keys.dart'; | |
| 15 | 15 |
| 16 /// Visitor that serializes a [ConstantExpression] by encoding it into an | 16 /// Visitor that serializes a [ConstantExpression] by encoding it into an |
| 17 /// [ObjectEncoder]. | 17 /// [ObjectEncoder]. |
| 18 /// | 18 /// |
| 19 /// This class is called from the [Serializer] when a [ConstantExpression] needs | 19 /// This class is called from the [Serializer] when a [ConstantExpression] needs |
| 20 /// serialization. The [ObjectEncoder] ensures that any [Element], [DartType], | 20 /// serialization. The [ObjectEncoder] ensures that any [Element], [DartType], |
| 21 /// and other [ConstantExpression] that the serialized [ConstantExpression] | 21 /// and other [ConstantExpression] that the serialized [ConstantExpression] |
| 22 /// depends upon are also serialized. | 22 /// depends upon are also serialized. |
| 23 class ConstantSerializer | 23 class ConstantSerializer |
| 24 extends ConstantExpressionVisitor<dynamic, ObjectEncoder> { | 24 extends ConstantExpressionVisitor<dynamic, ObjectEncoder> { |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 readFields(), readConstructorInvocation()); | 393 readFields(), readConstructorInvocation()); |
| 394 case ConstantConstructorKind.REDIRECTING_GENERATIVE: | 394 case ConstantConstructorKind.REDIRECTING_GENERATIVE: |
| 395 return new RedirectingGenerativeConstantConstructor( | 395 return new RedirectingGenerativeConstantConstructor( |
| 396 readDefaults(), readConstructorInvocation()); | 396 readDefaults(), readConstructorInvocation()); |
| 397 case ConstantConstructorKind.REDIRECTING_FACTORY: | 397 case ConstantConstructorKind.REDIRECTING_FACTORY: |
| 398 return new RedirectingFactoryConstantConstructor( | 398 return new RedirectingFactoryConstantConstructor( |
| 399 readConstructorInvocation()); | 399 readConstructorInvocation()); |
| 400 } | 400 } |
| 401 } | 401 } |
| 402 } | 402 } |
| OLD | NEW |