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

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

Issue 2455073003: Compute NativeBehavior for foreign functions. (Closed)
Patch Set: Updated cf. comment. Created 4 years, 1 month 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
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 972 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 impact2.dynamicUses, areDynamicUsesEquivalent) && 983 impact2.dynamicUses, areDynamicUsesEquivalent) &&
984 strategy.testSets( 984 strategy.testSets(
985 impact1, impact2, 'features', impact1.features, impact2.features) && 985 impact1, impact2, 'features', impact1.features, impact2.features) &&
986 strategy.testSets(impact1, impact2, 'listLiterals', impact1.listLiterals, 986 strategy.testSets(impact1, impact2, 'listLiterals', impact1.listLiterals,
987 impact2.listLiterals, areListLiteralUsesEquivalent) && 987 impact2.listLiterals, areListLiteralUsesEquivalent) &&
988 strategy.testSets(impact1, impact2, 'mapLiterals', impact1.mapLiterals, 988 strategy.testSets(impact1, impact2, 'mapLiterals', impact1.mapLiterals,
989 impact2.mapLiterals, areMapLiteralUsesEquivalent) && 989 impact2.mapLiterals, areMapLiteralUsesEquivalent) &&
990 strategy.testSets(impact1, impact2, 'staticUses', impact1.staticUses, 990 strategy.testSets(impact1, impact2, 'staticUses', impact1.staticUses,
991 impact2.staticUses, areStaticUsesEquivalent) && 991 impact2.staticUses, areStaticUsesEquivalent) &&
992 strategy.testSets(impact1, impact2, 'typeUses', impact1.typeUses, 992 strategy.testSets(impact1, impact2, 'typeUses', impact1.typeUses,
993 impact2.typeUses, areTypeUsesEquivalent); 993 impact2.typeUses, areTypeUsesEquivalent) &&
994 strategy.testSets(impact1, impact2, 'nativeData', impact1.nativeData,
995 impact2.nativeData, testNativeBehavior);
994 } 996 }
995 997
996 /// Tests the equivalence of [resolvedAst1] and [resolvedAst2] using [strategy]. 998 /// Tests the equivalence of [resolvedAst1] and [resolvedAst2] using [strategy].
997 bool testResolvedAstEquivalence( 999 bool testResolvedAstEquivalence(
998 ResolvedAst resolvedAst1, ResolvedAst resolvedAst2, 1000 ResolvedAst resolvedAst1, ResolvedAst resolvedAst2,
999 [TestStrategy strategy = const TestStrategy()]) { 1001 [TestStrategy strategy = const TestStrategy()]) {
1000 if (!strategy.test(resolvedAst1, resolvedAst1, 'kind', resolvedAst1.kind, 1002 if (!strategy.test(resolvedAst1, resolvedAst1, 'kind', resolvedAst1.kind,
1001 resolvedAst2.kind)) { 1003 resolvedAst2.kind)) {
1002 return false; 1004 return false;
1003 } 1005 }
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
2031 } 2033 }
2032 2034
2033 bool areMetadataAnnotationsEquivalent( 2035 bool areMetadataAnnotationsEquivalent(
2034 MetadataAnnotation metadata1, MetadataAnnotation metadata2) { 2036 MetadataAnnotation metadata1, MetadataAnnotation metadata2) {
2035 if (metadata1 == metadata2) return true; 2037 if (metadata1 == metadata2) return true;
2036 if (metadata1 == null || metadata2 == null) return false; 2038 if (metadata1 == null || metadata2 == null) return false;
2037 return areElementsEquivalent( 2039 return areElementsEquivalent(
2038 metadata1.annotatedElement, metadata2.annotatedElement) && 2040 metadata1.annotatedElement, metadata2.annotatedElement) &&
2039 areConstantsEquivalent(metadata1.constant, metadata2.constant); 2041 areConstantsEquivalent(metadata1.constant, metadata2.constant);
2040 } 2042 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/native/enqueue.dart ('k') | pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698