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

Side by Side Diff: pkg/compiler/lib/src/ssa/kernel_impact.dart

Issue 2366263004: Handle fields with initializers in kernel_impact (Closed)
Patch Set: Created 4 years, 2 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/ssa/builder.dart ('k') | tests/compiler/dart2js/kernel/impact_test.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 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 '../compiler.dart'; 9 import '../compiler.dart';
10 import '../constants/expressions.dart'; 10 import '../constants/expressions.dart';
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 void checkFunctionTypes(ir.FunctionNode node) { 76 void checkFunctionTypes(ir.FunctionNode node) {
77 checkType(node.returnType); 77 checkType(node.returnType);
78 node.positionalParameters.forEach((v) => checkType(v.type)); 78 node.positionalParameters.forEach((v) => checkType(v.type));
79 node.namedParameters.forEach((v) => checkType(v.type)); 79 node.namedParameters.forEach((v) => checkType(v.type));
80 } 80 }
81 81
82 ResolutionImpact buildField(ir.Field field) { 82 ResolutionImpact buildField(ir.Field field) {
83 checkType(field.type); 83 checkType(field.type);
84 if (field.initializer != null) { 84 if (field.initializer != null) {
85 visitNode(field.initializer); 85 visitNode(field.initializer);
86 if (!field.isConst) {
87 impactBuilder.registerFeature(Feature.LAZY_FIELD);
88 }
86 } else { 89 } else {
87 impactBuilder.registerFeature(Feature.FIELD_WITHOUT_INITIALIZER); 90 impactBuilder.registerFeature(Feature.FIELD_WITHOUT_INITIALIZER);
88 } 91 }
89 return impactBuilder; 92 return impactBuilder;
90 } 93 }
91 94
92 ResolutionImpact buildProcedure(ir.Procedure procedure) { 95 ResolutionImpact buildProcedure(ir.Procedure procedure) {
93 if (procedure.kind == ir.ProcedureKind.Method || 96 if (procedure.kind == ir.ProcedureKind.Method ||
94 procedure.kind == ir.ProcedureKind.Operator) { 97 procedure.kind == ir.ProcedureKind.Operator) {
95 checkFunctionTypes(procedure.function); 98 checkFunctionTypes(procedure.function);
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 } else { 322 } else {
320 impactBuilder.registerFeature(Feature.LOCAL_WITHOUT_INITIALIZER); 323 impactBuilder.registerFeature(Feature.LOCAL_WITHOUT_INITIALIZER);
321 } 324 }
322 } 325 }
323 326
324 // TODO(johnniwinther): Make this throw and visit child nodes explicitly 327 // TODO(johnniwinther): Make this throw and visit child nodes explicitly
325 // instead to ensure that we don't visit unwanted parts of the ir. 328 // instead to ensure that we don't visit unwanted parts of the ir.
326 @override 329 @override
327 void defaultNode(ir.Node node) => node.visitChildren(this); 330 void defaultNode(ir.Node node) => node.visitChildren(this);
328 } 331 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | tests/compiler/dart2js/kernel/impact_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698