OLD | NEW |
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.node_tracer; | 5 library compiler.src.inferrer.node_tracer; |
6 | 6 |
7 import '../common/names.dart' show Identifiers; | 7 import '../common/names.dart' show Identifiers; |
8 import '../compiler.dart' show Compiler; | 8 import '../compiler.dart' show Compiler; |
9 import '../elements/elements.dart'; | 9 import '../elements/elements.dart'; |
10 import '../types/types.dart' show ContainerTypeMask, MapTypeMask; | 10 import '../types/types.dart' show ContainerTypeMask, MapTypeMask; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // [keys] only allows key values to escape, which we do not track. | 70 // [keys] only allows key values to escape, which we do not track. |
71 'keys' | 71 'keys' |
72 ]); | 72 ]); |
73 | 73 |
74 /// Common logic to trace a value through the type inference graph nodes. | 74 /// Common logic to trace a value through the type inference graph nodes. |
75 abstract class TracerVisitor implements TypeInformationVisitor { | 75 abstract class TracerVisitor implements TypeInformationVisitor { |
76 final TypeInformation tracedType; | 76 final TypeInformation tracedType; |
77 final InferrerEngine inferrer; | 77 final InferrerEngine inferrer; |
78 final Compiler compiler; | 78 final Compiler compiler; |
79 | 79 |
80 static const int MAX_ANALYSIS_COUNT = 16; | 80 static const int MAX_ANALYSIS_COUNT = |
| 81 const int.fromEnvironment('dart2js.tracing.limit', defaultValue: 32); |
81 final Setlet<Element> analyzedElements = new Setlet<Element>(); | 82 final Setlet<Element> analyzedElements = new Setlet<Element>(); |
82 | 83 |
83 TracerVisitor(this.tracedType, InferrerEngine inferrer) | 84 TracerVisitor(this.tracedType, InferrerEngine inferrer) |
84 : this.inferrer = inferrer, | 85 : this.inferrer = inferrer, |
85 this.compiler = inferrer.compiler; | 86 this.compiler = inferrer.compiler; |
86 | 87 |
87 // Work list that gets populated with [TypeInformation] that could | 88 // Work list that gets populated with [TypeInformation] that could |
88 // contain the container. | 89 // contain the container. |
89 final List<TypeInformation> workList = <TypeInformation>[]; | 90 final List<TypeInformation> workList = <TypeInformation>[]; |
90 | 91 |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 } | 469 } |
469 if (isParameterOfListAddingMethod(element) || | 470 if (isParameterOfListAddingMethod(element) || |
470 isParameterOfMapAddingMethod(element)) { | 471 isParameterOfMapAddingMethod(element)) { |
471 // These elements are being handled in | 472 // These elements are being handled in |
472 // [visitDynamicCallSiteTypeInformation]. | 473 // [visitDynamicCallSiteTypeInformation]. |
473 return; | 474 return; |
474 } | 475 } |
475 addNewEscapeInformation(info); | 476 addNewEscapeInformation(info); |
476 } | 477 } |
477 } | 478 } |
OLD | NEW |