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

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

Issue 1170673002: Begin to compute constant expressions in resolution. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix BinaryConstantExpression.getKnownType Created 5 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 | « pkg/compiler/lib/src/constants/expressions.dart ('k') | pkg/compiler/lib/src/core_types.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 '../core_types.dart'; 7 import '../core_types.dart';
8 import '../dart_types.dart'; 8 import '../dart_types.dart';
9 import '../dart2jslib.dart' 9 import '../dart2jslib.dart'
10 show assertDebugMode; 10 show assertDebugMode;
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 class ConstructedConstantValue extends ObjectConstantValue { 632 class ConstructedConstantValue extends ObjectConstantValue {
633 final Map<FieldElement, ConstantValue> fields; 633 final Map<FieldElement, ConstantValue> fields;
634 final int hashCode; 634 final int hashCode;
635 635
636 ConstructedConstantValue(InterfaceType type, 636 ConstructedConstantValue(InterfaceType type,
637 Map<FieldElement, ConstantValue> fields) 637 Map<FieldElement, ConstantValue> fields)
638 : this.fields = fields, 638 : this.fields = fields,
639 hashCode = Hashing.mapHash(fields, Hashing.objectHash(type)), 639 hashCode = Hashing.mapHash(fields, Hashing.objectHash(type)),
640 super(type) { 640 super(type) {
641 assert(type != null); 641 assert(type != null);
642 assert(!fields.containsValue(null));
642 } 643 }
643 644
644 bool get isConstructedObject => true; 645 bool get isConstructedObject => true;
645 646
646 bool operator ==(var otherVar) { 647 bool operator ==(var otherVar) {
647 if (otherVar is !ConstructedConstantValue) return false; 648 if (otherVar is !ConstructedConstantValue) return false;
648 ConstructedConstantValue other = otherVar; 649 ConstructedConstantValue other = otherVar;
649 if (hashCode != other.hashCode) return false; 650 if (hashCode != other.hashCode) return false;
650 if (type != other.type) return false; 651 if (type != other.type) return false;
651 if (fields.length != other.fields.length) return false; 652 if (fields.length != other.fields.length) return false;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 742
742 @override 743 @override
743 DartType getType(CoreTypes types) => const DynamicType(); 744 DartType getType(CoreTypes types) => const DynamicType();
744 745
745 @override 746 @override
746 String toStructuredString() => 'NonConstant'; 747 String toStructuredString() => 'NonConstant';
747 748
748 @override 749 @override
749 String unparse() => '>>non-constant<<'; 750 String unparse() => '>>non-constant<<';
750 } 751 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/constants/expressions.dart ('k') | pkg/compiler/lib/src/core_types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698