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

Side by Side Diff: pkg/compiler/lib/src/serialization/equivalence.dart

Issue 2610513005: Use Entity instead of Element in ConstantValue (Closed)
Patch Set: Created 3 years, 11 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/mirrors_used.dart ('k') | pkg/compiler/lib/src/ssa/builder_kernel.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 /// Functions for asserting equivalence across serialization. 5 /// Functions for asserting equivalence across serialization.
6 6
7 library dart2js.serialization.equivalence; 7 library dart2js.serialization.equivalence;
8 8
9 import '../closure.dart'; 9 import '../closure.dart';
10 import '../common/resolution.dart'; 10 import '../common/resolution.dart';
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 value1.fields, 867 value1.fields,
868 value2.fields, 868 value2.fields,
869 areElementsEquivalent, 869 areElementsEquivalent,
870 (a, b) => strategy.testConstantValues( 870 (a, b) => strategy.testConstantValues(
871 value1, value2, 'fields.values', a, b)); 871 value1, value2, 'fields.values', a, b));
872 } 872 }
873 873
874 @override 874 @override
875 bool visitFunction( 875 bool visitFunction(
876 FunctionConstantValue value1, FunctionConstantValue value2) { 876 FunctionConstantValue value1, FunctionConstantValue value2) {
877 return strategy.testElements( 877 MethodElement method1 = value1.element;
878 value1, value2, 'element', value1.element, value2.element); 878 MethodElement method2 = value2.element;
879 return strategy.testElements(value1, value2, 'element', method1, method2);
879 } 880 }
880 881
881 @override 882 @override
882 bool visitList(ListConstantValue value1, ListConstantValue value2) { 883 bool visitList(ListConstantValue value1, ListConstantValue value2) {
883 return strategy.testTypes( 884 return strategy.testTypes(
884 value1, value2, 'type', value1.type, value2.type) && 885 value1, value2, 'type', value1.type, value2.type) &&
885 strategy.testConstantValueLists( 886 strategy.testConstantValueLists(
886 value1, value2, 'entries', value1.entries, value2.entries); 887 value1, value2, 'entries', value1.entries, value2.entries);
887 } 888 }
888 889
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
2028 } 2029 }
2029 2030
2030 bool areMetadataAnnotationsEquivalent( 2031 bool areMetadataAnnotationsEquivalent(
2031 MetadataAnnotation metadata1, MetadataAnnotation metadata2) { 2032 MetadataAnnotation metadata1, MetadataAnnotation metadata2) {
2032 if (metadata1 == metadata2) return true; 2033 if (metadata1 == metadata2) return true;
2033 if (metadata1 == null || metadata2 == null) return false; 2034 if (metadata1 == null || metadata2 == null) return false;
2034 return areElementsEquivalent( 2035 return areElementsEquivalent(
2035 metadata1.annotatedElement, metadata2.annotatedElement) && 2036 metadata1.annotatedElement, metadata2.annotatedElement) &&
2036 areConstantsEquivalent(metadata1.constant, metadata2.constant); 2037 areConstantsEquivalent(metadata1.constant, metadata2.constant);
2037 } 2038 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/mirrors_used.dart ('k') | pkg/compiler/lib/src/ssa/builder_kernel.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698