Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: pkg/compiler/lib/src/constants/values.dart

Issue 2072223002: Enforce use of the forEachInstanceField ordering for constructed constants. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Remove tab Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/constant_emitter.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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.constants.values; 5 library dart2js.constants.values;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../core_types.dart'; 8 import '../core_types.dart';
9 import '../dart_types.dart'; 9 import '../dart_types.dart';
10 import '../elements/elements.dart' 10 import '../elements/elements.dart'
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 } 651 }
652 652
653 DartType getType(CoreTypes types) => const DynamicType(); 653 DartType getType(CoreTypes types) => const DynamicType();
654 654
655 String toDartText() => 'synthetic($kind, $payload)'; 655 String toDartText() => 'synthetic($kind, $payload)';
656 656
657 String toStructuredText() => 'SyntheticConstant($kind, $payload)'; 657 String toStructuredText() => 'SyntheticConstant($kind, $payload)';
658 } 658 }
659 659
660 class ConstructedConstantValue extends ObjectConstantValue { 660 class ConstructedConstantValue extends ObjectConstantValue {
661 // TODO(johnniwinther): Make [fields] private to avoid misuse of the map
662 // ordering and mutability.
661 final Map<FieldElement, ConstantValue> fields; 663 final Map<FieldElement, ConstantValue> fields;
662 final int hashCode; 664 final int hashCode;
663 665
664 ConstructedConstantValue( 666 ConstructedConstantValue(
665 InterfaceType type, Map<FieldElement, ConstantValue> fields) 667 InterfaceType type, Map<FieldElement, ConstantValue> fields)
666 : this.fields = fields, 668 : this.fields = fields,
667 hashCode = Hashing.mapHash(fields, Hashing.objectHash(type)), 669 hashCode = Hashing.mapHash(fields, Hashing.objectHash(type)),
668 super(type) { 670 super(type) {
669 assert(type != null); 671 assert(type != null);
670 assert(!fields.containsValue(null)); 672 assert(!fields.containsValue(null));
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 775
774 @override 776 @override
775 DartType getType(CoreTypes types) => const DynamicType(); 777 DartType getType(CoreTypes types) => const DynamicType();
776 778
777 @override 779 @override
778 String toStructuredText() => 'NonConstant'; 780 String toStructuredText() => 'NonConstant';
779 781
780 @override 782 @override
781 String toDartText() => '>>non-constant<<'; 783 String toDartText() => '>>non-constant<<';
782 } 784 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/constant_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698