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

Unified Diff: pkg/compiler/lib/src/cps_ir/share_final_fields.dart

Issue 1412493003: dart2js cps_ir: avoid world.fieldNeverChanges() (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/share_final_fields.dart
diff --git a/pkg/compiler/lib/src/cps_ir/share_final_fields.dart b/pkg/compiler/lib/src/cps_ir/share_final_fields.dart
index efcc413f29dc18f135d6c8fc6d693092232410f9..3308c00e2407724b41dfa8258a2de89a87eddbf8 100644
--- a/pkg/compiler/lib/src/cps_ir/share_final_fields.dart
+++ b/pkg/compiler/lib/src/cps_ir/share_final_fields.dart
@@ -147,7 +147,15 @@ class ShareFinalFields extends TrampolineRecursiveVisitor implements Pass {
}
bool shouldShareField(FieldElement field) {
- return backend.compiler.world.fieldNeverChanges(field);
+ // TODO(24781): This query is incorrect for fields assigned only via
+ //
+ // super.field = ...
+ //
+ // return backend.compiler.world.fieldNeverChanges(field);
+
+ // Native fields are getters with side effects (e.g. layout).
+ if (backend.isNative(field)) return false;
+ return field.isFinal || field.isConst;
}
/// Returns the the innermost loop that effectively encloses both
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698