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

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

Issue 2954463002: Refactoring to prepare for kernel based jump targets (Closed)
Patch Set: Updated cf. comments Created 3 years, 5 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) 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 if (field.initializer != null) { 117 if (field.initializer != null) {
118 visitNode(field.initializer); 118 visitNode(field.initializer);
119 if (!field.isInstanceMember && 119 if (!field.isInstanceMember &&
120 !field.isConst && 120 !field.isConst &&
121 field.initializer is! ir.NullLiteral) { 121 field.initializer is! ir.NullLiteral) {
122 impactBuilder.registerFeature(Feature.LAZY_FIELD); 122 impactBuilder.registerFeature(Feature.LAZY_FIELD);
123 } 123 }
124 } 124 }
125 if (field.isInstanceMember && 125 if (field.isInstanceMember &&
126 elementAdapter.isNativeClass(field.enclosingClass)) { 126 elementAdapter.isNativeClass(field.enclosingClass)) {
127 // TODO(johnniwinther): Provide the correct value for [isJsInterop]. 127 // TODO(redemption): Provide the correct value for [isJsInterop].
128 impactBuilder.registerNativeData(elementAdapter 128 impactBuilder.registerNativeData(elementAdapter
129 .getNativeBehaviorForFieldLoad(field, isJsInterop: false)); 129 .getNativeBehaviorForFieldLoad(field, isJsInterop: false));
130 impactBuilder.registerNativeData( 130 impactBuilder.registerNativeData(
131 elementAdapter.getNativeBehaviorForFieldStore(field)); 131 elementAdapter.getNativeBehaviorForFieldStore(field));
132 } 132 }
133 return impactBuilder; 133 return impactBuilder;
134 } 134 }
135 135
136 ResolutionImpact buildConstructor(ir.Constructor constructor) { 136 ResolutionImpact buildConstructor(ir.Constructor constructor) {
137 handleSignature(constructor.function, checkReturnType: false); 137 handleSignature(constructor.function, checkReturnType: false);
(...skipping 20 matching lines...) Expand all
158 "Unexpected async marker: ${asyncMarker}"); 158 "Unexpected async marker: ${asyncMarker}");
159 } 159 }
160 } 160 }
161 161
162 ResolutionImpact buildProcedure(ir.Procedure procedure) { 162 ResolutionImpact buildProcedure(ir.Procedure procedure) {
163 handleSignature(procedure.function); 163 handleSignature(procedure.function);
164 visitNode(procedure.function.body); 164 visitNode(procedure.function.body);
165 handleAsyncMarker(procedure.function.asyncMarker); 165 handleAsyncMarker(procedure.function.asyncMarker);
166 if (procedure.isExternal && 166 if (procedure.isExternal &&
167 !elementAdapter.isForeignLibrary(procedure.enclosingLibrary)) { 167 !elementAdapter.isForeignLibrary(procedure.enclosingLibrary)) {
168 // TODO(johnniwinther): Provide the correct value for [isJsInterop]. 168 // TODO(redemption): Provide the correct value for [isJsInterop].
169 impactBuilder.registerNativeData(elementAdapter 169 impactBuilder.registerNativeData(elementAdapter
170 .getNativeBehaviorForMethod(procedure, isJsInterop: false)); 170 .getNativeBehaviorForMethod(procedure, isJsInterop: false));
171 } 171 }
172 return impactBuilder; 172 return impactBuilder;
173 } 173 }
174 174
175 void visitNode(ir.Node node) => node?.accept(this); 175 void visitNode(ir.Node node) => node?.accept(this);
176 176
177 void visitNodes(Iterable<ir.Node> nodes) { 177 void visitNodes(Iterable<ir.Node> nodes) {
178 nodes.forEach(visitNode); 178 nodes.forEach(visitNode);
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 ConstructorEntity target = elementAdapter.getConstructor(node.target); 612 ConstructorEntity target = elementAdapter.getConstructor(node.target);
613 impactBuilder.registerStaticUse(new StaticUse.superConstructorInvoke( 613 impactBuilder.registerStaticUse(new StaticUse.superConstructorInvoke(
614 target, elementAdapter.getCallStructure(node.arguments))); 614 target, elementAdapter.getCallStructure(node.arguments)));
615 } 615 }
616 616
617 // TODO(johnniwinther): Make this throw and visit child nodes explicitly 617 // TODO(johnniwinther): Make this throw and visit child nodes explicitly
618 // instead to ensure that we don't visit unwanted parts of the ir. 618 // instead to ensure that we don't visit unwanted parts of the ir.
619 @override 619 @override
620 void defaultNode(ir.Node node) => node.visitChildren(this); 620 void defaultNode(ir.Node node) => node.visitChildren(this);
621 } 621 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart ('k') | pkg/compiler/lib/src/ssa/loop_handler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698