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

Unified Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 1435853002: Register closures using StaticUse. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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: pkg/compiler/lib/src/js_backend/backend.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index 65b84697c4ca31e21d046597bdf2b4239b3d856a..0fed323ab40d412424e6dbe745c8ab04901a84c5 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -2848,10 +2848,11 @@ class JavaScriptImpactTransformer extends ImpactTransformer {
}
}
- if (worldImpact.closures.isNotEmpty) {
- registerBackendImpact(transformed, impacts.closure);
- for (LocalFunctionElement closure in worldImpact.closures) {
- if (closure.computeType(backend.resolution).containsTypeVariables) {
+ for (StaticUse staticUse in worldImpact.staticUses) {
+ if (staticUse.kind == StaticUseKind.CLOSURE) {
+ registerBackendImpact(transformed, impacts.closure);
+ LocalFunctionElement closure = staticUse.element;
+ if (closure.type.containsTypeVariables) {
backend.compiler.enqueuer.resolution.universe
.closuresWithFreeTypeVariables.add(closure);
registerBackendImpact(transformed, impacts.computeSignature);
@@ -3025,9 +3026,13 @@ class JavaScriptImpactTransformer extends ImpactTransformer {
backend.registerTypeVariableBoundsSubtypeCheck(check.a, check.b);
}
- for (LocalFunctionElement element in impact.closures) {
- if (backend.methodNeedsRti(element)) {
- registerBackendImpact(transformed, impacts.computeSignature);
+
+ for (StaticUse staticUse in impact.staticUses) {
+ if (staticUse.kind == StaticUseKind.CLOSURE) {
+ LocalFunctionElement closure = staticUse.element;
+ if (backend.methodNeedsRti(closure)) {
+ registerBackendImpact(transformed, impacts.computeSignature);
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698