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 |