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

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

Issue 2616103002: Flatten inferrer implementation (Closed)
Patch Set: Cleanup imports/prefixes Created 3 years, 11 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 compiler.src.inferrer.closure_tracer; 5 library compiler.src.inferrer.closure_tracer;
6 6
7 import '../common/names.dart' show Names; 7 import '../common/names.dart' show Names;
8 import '../elements/elements.dart'; 8 import '../elements/elements.dart';
9 import '../js_backend/backend_helpers.dart'; 9 import '../js_backend/backend_helpers.dart';
10 import '../types/types.dart' show TypeMask; 10 import '../types/types.dart' show TypeMask;
11 import '../universe/selector.dart' show Selector; 11 import '../universe/selector.dart' show Selector;
12 import 'debug.dart' as debug; 12 import 'debug.dart' as debug;
13 import 'inferrer_engine.dart';
13 import 'node_tracer.dart'; 14 import 'node_tracer.dart';
14 import 'type_graph_nodes.dart'; 15 import 'type_graph_nodes.dart';
15 16
16 class ClosureTracerVisitor extends TracerVisitor<ApplyableTypeInformation> { 17 class ClosureTracerVisitor extends TracerVisitor {
17 final Iterable<FunctionElement> tracedElements; 18 final Iterable<FunctionElement> tracedElements;
18 final List<CallSiteTypeInformation> _callsToAnalyze = 19 final List<CallSiteTypeInformation> _callsToAnalyze =
19 new List<CallSiteTypeInformation>(); 20 new List<CallSiteTypeInformation>();
20 21
21 ClosureTracerVisitor(this.tracedElements, tracedType, inferrer) 22 ClosureTracerVisitor(this.tracedElements, ApplyableTypeInformation tracedType,
23 InferrerEngine inferrer)
22 : super(tracedType, inferrer); 24 : super(tracedType, inferrer);
23 25
26 ApplyableTypeInformation get tracedType => super.tracedType;
27
24 void run() { 28 void run() {
25 analyze(); 29 analyze();
26 if (!continueAnalyzing) return; 30 if (!continueAnalyzing) return;
27 _callsToAnalyze.forEach(_analyzeCall); 31 _callsToAnalyze.forEach(_analyzeCall);
28 for (FunctionElement e in tracedElements) { 32 for (FunctionElement e in tracedElements) {
29 e.functionSignature.forEachParameter((Element parameter) { 33 e.functionSignature.forEachParameter((Element parameter) {
30 ElementTypeInformation info = 34 ElementTypeInformation info =
31 inferrer.types.getInferredTypeOf(parameter); 35 inferrer.types.getInferredTypeOf(parameter);
32 info.disableInferenceForClosures = false; 36 info.disableInferenceForClosures = false;
33 }); 37 });
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 @override 130 @override
127 visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) { 131 visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) {
128 super.visitStaticCallSiteTypeInformation(info); 132 super.visitStaticCallSiteTypeInformation(info);
129 if (info.calledElement == tracedElements.first && 133 if (info.calledElement == tracedElements.first &&
130 info.selector != null && 134 info.selector != null &&
131 info.selector.isGetter) { 135 info.selector.isGetter) {
132 addNewEscapeInformation(info); 136 addNewEscapeInformation(info);
133 } 137 }
134 } 138 }
135 } 139 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/inferrer/inferrer_engine.dart » ('j') | pkg/compiler/lib/src/inferrer/inferrer_engine.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698