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

Side by Side Diff: pkg/compiler/lib/src/kernel/element_map.dart

Issue 2874973003: Add more equivalence tests for ElementEnvironment (Closed)
Patch Set: Created 3 years, 7 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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 import 'package:kernel/ast.dart' as ir; 5 import 'package:kernel/ast.dart' as ir;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/names.dart'; 8 import '../common/names.dart';
9 import '../constants/constructors.dart'; 9 import '../constants/constructors.dart';
10 import '../constants/expressions.dart'; 10 import '../constants/expressions.dart';
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 784
785 Map<FieldEntity, ConstantExpression> fieldMap = 785 Map<FieldEntity, ConstantExpression> fieldMap =
786 <FieldEntity, ConstantExpression>{}; 786 <FieldEntity, ConstantExpression>{};
787 787
788 void registerField(ir.Field field, ConstantExpression constant) { 788 void registerField(ir.Field field, ConstantExpression constant) {
789 fieldMap[elementAdapter.getField(field)] = constant; 789 fieldMap[elementAdapter.getField(field)] = constant;
790 } 790 }
791 791
792 if (!isRedirecting) { 792 if (!isRedirecting) {
793 for (ir.Field field in cls.fields) { 793 for (ir.Field field in cls.fields) {
794 if (field.isStatic) continue;
794 if (field.initializer != null) { 795 if (field.initializer != null) {
795 registerField(field, field.initializer.accept(this)); 796 registerField(field, field.initializer.accept(this));
796 } 797 }
797 } 798 }
798 } 799 }
799 800
800 ConstructedConstantExpression superConstructorInvocation; 801 ConstructedConstantExpression superConstructorInvocation;
801 for (ir.Initializer initializer in node.initializers) { 802 for (ir.Initializer initializer in node.initializers) {
802 if (initializer is ir.FieldInitializer) { 803 if (initializer is ir.FieldInitializer) {
803 registerField(initializer.field, initializer.value.accept(this)); 804 registerField(initializer.field, initializer.value.accept(this));
(...skipping 10 matching lines...) Expand all
814 } 815 }
815 if (isRedirecting) { 816 if (isRedirecting) {
816 return new RedirectingGenerativeConstantConstructor( 817 return new RedirectingGenerativeConstantConstructor(
817 defaultValues, superConstructorInvocation); 818 defaultValues, superConstructorInvocation);
818 } else { 819 } else {
819 return new GenerativeConstantConstructor( 820 return new GenerativeConstantConstructor(
820 type, defaultValues, fieldMap, superConstructorInvocation); 821 type, defaultValues, fieldMap, superConstructorInvocation);
821 } 822 }
822 } 823 }
823 } 824 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/kernel/kernel.dart » ('j') | pkg/compiler/lib/src/serialization/equivalence.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698