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

Side by Side Diff: tests/compiler/dart2js/serialization/equivalence_test.dart

Issue 2669703003: Refactor ConstantExpression/ConstantConstructor to use entities. (Closed)
Patch Set: Created 3 years, 10 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 | « tests/compiler/dart2js/semantic_visitor_test_send_data.dart ('k') | no next file » | 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) 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_test; 5 library dart2js.serialization_test;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 import '../memory_compiler.dart'; 8 import '../memory_compiler.dart';
9 import 'package:async_helper/async_helper.dart'; 9 import 'package:async_helper/async_helper.dart';
10 import 'package:compiler/src/commandline_options.dart'; 10 import 'package:compiler/src/commandline_options.dart';
11 import 'package:compiler/src/common.dart'; 11 import 'package:compiler/src/common.dart';
12 import 'package:compiler/src/common/resolution.dart'; 12 import 'package:compiler/src/common/resolution.dart';
13 import 'package:compiler/src/constants/constructors.dart'; 13 import 'package:compiler/src/constants/constructors.dart';
14 import 'package:compiler/src/compiler.dart'; 14 import 'package:compiler/src/compiler.dart';
15 import 'package:compiler/src/diagnostics/invariant.dart'; 15 import 'package:compiler/src/diagnostics/invariant.dart';
16 import 'package:compiler/src/elements/elements.dart'; 16 import 'package:compiler/src/elements/elements.dart';
17 import 'package:compiler/src/elements/resolution_types.dart';
17 import 'package:compiler/src/elements/visitor.dart'; 18 import 'package:compiler/src/elements/visitor.dart';
18 import 'package:compiler/src/filenames.dart'; 19 import 'package:compiler/src/filenames.dart';
19 import 'package:compiler/src/library_loader.dart'; 20 import 'package:compiler/src/library_loader.dart';
20 import 'package:compiler/src/ordered_typeset.dart'; 21 import 'package:compiler/src/ordered_typeset.dart';
21 import 'package:compiler/src/serialization/element_serialization.dart'; 22 import 'package:compiler/src/serialization/element_serialization.dart';
22 import 'package:compiler/src/serialization/equivalence.dart'; 23 import 'package:compiler/src/serialization/equivalence.dart';
23 import 'package:compiler/src/serialization/json_serializer.dart'; 24 import 'package:compiler/src/serialization/json_serializer.dart';
24 import 'package:compiler/src/serialization/serialization.dart'; 25 import 'package:compiler/src/serialization/serialization.dart';
25 import 'package:expect/expect.dart'; 26 import 'package:expect/expect.dart';
26 import 'test_helper.dart'; 27 import 'test_helper.dart';
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 ConstantConstructor constructor1, ConstantConstructor constructor2) { 199 ConstantConstructor constructor1, ConstantConstructor constructor2) {
199 if (identical(constructor1, constructor2)) return; 200 if (identical(constructor1, constructor2)) return;
200 check(constructor1, constructor2, 'kind', constructor1.kind, 201 check(constructor1, constructor2, 'kind', constructor1.kind,
201 constructor2.kind); 202 constructor2.kind);
202 constructor1.accept(this, constructor2); 203 constructor1.accept(this, constructor2);
203 } 204 }
204 205
205 @override 206 @override
206 visitGenerative(GenerativeConstantConstructor constructor1, 207 visitGenerative(GenerativeConstantConstructor constructor1,
207 GenerativeConstantConstructor constructor2) { 208 GenerativeConstantConstructor constructor2) {
208 checkTypes(constructor1, constructor2, 'type', constructor1.type, 209 ResolutionInterfaceType type1 = constructor1.type;
209 constructor2.type); 210 ResolutionInterfaceType type2 = constructor2.type;
211 checkTypes(constructor1, constructor2, 'type', type1, type2);
210 check(constructor1, constructor2, 'defaultValues.length', 212 check(constructor1, constructor2, 'defaultValues.length',
211 constructor1.defaultValues.length, constructor2.defaultValues.length); 213 constructor1.defaultValues.length, constructor2.defaultValues.length);
212 constructor1.defaultValues.forEach((k, v) { 214 constructor1.defaultValues.forEach((k, v) {
213 checkConstants(constructor1, constructor2, 'defaultValue[$k]', v, 215 checkConstants(constructor1, constructor2, 'defaultValue[$k]', v,
214 constructor2.defaultValues[k]); 216 constructor2.defaultValues[k]);
215 }); 217 });
216 check(constructor1, constructor2, 'fieldMap.length', 218 check(constructor1, constructor2, 'fieldMap.length',
217 constructor1.fieldMap.length, constructor2.fieldMap.length); 219 constructor1.fieldMap.length, constructor2.fieldMap.length);
218 constructor1.fieldMap.forEach((k1, v1) { 220 constructor1.fieldMap.forEach((k1, v1) {
219 bool matched = false; 221 bool matched = false;
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 }); 836 });
835 } 837 }
836 838
837 @override 839 @override
838 void visitErroneousElement( 840 void visitErroneousElement(
839 ErroneousElement element1, ErroneousElement element2) { 841 ErroneousElement element1, ErroneousElement element2) {
840 check(element1, element2, 'messageKind', element1.messageKind, 842 check(element1, element2, 'messageKind', element1.messageKind,
841 element2.messageKind); 843 element2.messageKind);
842 } 844 }
843 } 845 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/semantic_visitor_test_send_data.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698