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

Side by Side Diff: pkg/compiler/lib/src/inferrer/ast_inferrer_engine.dart

Issue 3002313002: Use KernelTypeGraphBuilder in KernelInferrerEngine (Closed)
Patch Set: Created 3 years, 3 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 '../common.dart'; 5 import '../common.dart';
6 import '../common/names.dart'; 6 import '../common/names.dart';
7 import '../compiler.dart'; 7 import '../compiler.dart';
8 import '../constants/expressions.dart'; 8 import '../constants/expressions.dart';
9 import '../constants/values.dart'; 9 import '../constants/values.dart';
10 import '../elements/elements.dart'; 10 import '../elements/elements.dart';
11 import '../elements/entities.dart'; 11 import '../elements/entities.dart';
12 import '../resolution/tree_elements.dart'; 12 import '../resolution/tree_elements.dart';
13 import '../tree/nodes.dart' as ast; 13 import '../tree/nodes.dart' as ast;
14 import '../types/types.dart'; 14 import '../types/types.dart';
15 import '../world.dart'; 15 import '../world.dart';
16 import 'builder.dart'; 16 import 'builder.dart';
17 import 'builder_kernel.dart';
18 import 'inferrer_engine.dart'; 17 import 'inferrer_engine.dart';
19 import 'type_graph_nodes.dart'; 18 import 'type_graph_nodes.dart';
20 import 'type_system.dart'; 19 import 'type_system.dart';
21 20
22 class AstInferrerEngine extends InferrerEngineImpl<ast.Node> { 21 class AstInferrerEngine extends InferrerEngineImpl<ast.Node> {
23 AstInferrerEngine(Compiler compiler, ClosedWorld closedWorld, 22 AstInferrerEngine(Compiler compiler, ClosedWorld closedWorld,
24 ClosedWorldRefiner closedWorldRefiner, FunctionEntity mainElement) 23 ClosedWorldRefiner closedWorldRefiner, FunctionEntity mainElement)
25 : super(compiler, closedWorld, closedWorldRefiner, mainElement, 24 : super(compiler, closedWorld, closedWorldRefiner, mainElement,
26 const TypeSystemStrategyImpl()); 25 const TypeSystemStrategyImpl());
27 26
(...skipping 24 matching lines...) Expand all
52 FunctionEntity lookupCallMethod(covariant ClassElement cls) { 51 FunctionEntity lookupCallMethod(covariant ClassElement cls) {
53 MethodElement callMethod = cls.lookupMember(Identifiers.call); 52 MethodElement callMethod = cls.lookupMember(Identifiers.call);
54 if (callMethod == null) { 53 if (callMethod == null) {
55 callMethod = cls.lookupMember(Identifiers.noSuchMethod_); 54 callMethod = cls.lookupMember(Identifiers.noSuchMethod_);
56 } 55 }
57 return callMethod; 56 return callMethod;
58 } 57 }
59 58
60 TypeInformation computeMemberTypeInformation( 59 TypeInformation computeMemberTypeInformation(
61 MemberEntity member, ast.Node body) { 60 MemberEntity member, ast.Node body) {
62 dynamic visitor = compiler.options.kernelGlobalInference 61 ElementGraphBuilder visitor =
63 ? new KernelTypeGraphBuilder(member, compiler, this) 62 new ElementGraphBuilder(member, compiler, this);
64 : new ElementGraphBuilder(member, compiler, this);
65 // ignore: UNDEFINED_METHOD
66 return visitor.run(); 63 return visitor.run();
67 } 64 }
68 65
69 bool isFieldInitializerPotentiallyNull( 66 bool isFieldInitializerPotentiallyNull(
70 FieldEntity field, ast.Node initializer) { 67 FieldEntity field, ast.Node initializer) {
71 dynamic argument = initializer; 68 dynamic argument = initializer;
72 // TODO(13429): We could do better here by using the 69 // TODO(13429): We could do better here by using the
73 // constant handler to figure out if it's a lazy field or not. 70 // constant handler to figure out if it's a lazy field or not.
74 return argument.asSend() != null || 71 return argument.asSend() != null ||
75 (argument.asNewExpression() != null && !argument.isConst); 72 (argument.asNewExpression() != null && !argument.isConst);
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 @override 202 @override
206 bool checkPhiNode(ast.Node node) { 203 bool checkPhiNode(ast.Node node) {
207 return true; 204 return true;
208 } 205 }
209 206
210 @override 207 @override
211 bool checkClassEntity(covariant ClassElement cls) { 208 bool checkClassEntity(covariant ClassElement cls) {
212 return cls.isDeclaration; 209 return cls.isDeclaration;
213 } 210 }
214 } 211 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698