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

Unified Diff: sdk/lib/_internal/compiler/implementation/inferrer/node_tracer.dart

Issue 223403003: Use closure tracer to identify closures that are not passed to Function.apply (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fixed issue with failing test Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/inferrer/node_tracer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/node_tracer.dart b/sdk/lib/_internal/compiler/implementation/inferrer/node_tracer.dart
index b1ba510d50e0f7f1e3d443896b592548184b31fd..930db4f1d8e21a41c00416cb531759df72a4b74a 100644
--- a/sdk/lib/_internal/compiler/implementation/inferrer/node_tracer.dart
+++ b/sdk/lib/_internal/compiler/implementation/inferrer/node_tracer.dart
@@ -66,8 +66,9 @@ Set<String> doesNotEscapeMapSet = new Set<String>.from(
'keys'
]);
-abstract class TracerVisitor implements TypeInformationVisitor {
- final TypeInformation tracedType;
+abstract class TracerVisitor<T extends TypeInformation>
+ implements TypeInformationVisitor {
+ final T tracedType;
final TypeGraphInferrerEngine inferrer;
final Compiler compiler;
@@ -343,7 +344,7 @@ abstract class TracerVisitor implements TypeInformationVisitor {
&& inferrer.isNativeElement(element.enclosingElement)) {
bailout('Passed to a native method');
}
- if (info.isClosurized()) {
+ if (info.isClosurized) {
bailout('Returned from a closurized method');
}
if (isClosure(info.element)) {
@@ -352,6 +353,10 @@ abstract class TracerVisitor implements TypeInformationVisitor {
if (compiler.backend.isNeededForReflection(info.element)) {
bailout('Escape in reflection');
}
+ if (!inferrer.compiler.backend
+ .canBeUsedForGlobalOptimizations(info.element)) {
+ bailout('Escape to code that has special backend treatment');
+ }
if (isParameterOfListAddingMethod(info.element) ||
isParameterOfMapAddingMethod(info.element)) {
// These elements are being handled in

Powered by Google App Engine
This is Rietveld 408576698