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

Unified Diff: pkg/compiler/lib/src/resolution/class_members.dart

Issue 2015903002: Compute and check members for serialization (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix invariant Created 4 years, 7 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: pkg/compiler/lib/src/resolution/class_members.dart
diff --git a/pkg/compiler/lib/src/resolution/class_members.dart b/pkg/compiler/lib/src/resolution/class_members.dart
index 6cbbf70d45816eb103e181e3ba843ac089af9307..b385717b06ef1af660df421e4362fe36b87735f9 100644
--- a/pkg/compiler/lib/src/resolution/class_members.dart
+++ b/pkg/compiler/lib/src/resolution/class_members.dart
@@ -824,8 +824,30 @@ abstract class ClassMemberMixin implements ClassElement {
/// includes `call`.
Iterable<String> computedMemberNames;
+ bool _interfaceMembersAreClassMembers;
+
+ /// Compute value of the [_interfaceMembersAreClassMembers] for this class
+ /// and its superclasses.
+ void _ensureInterfaceMembersAreClassMembers(Resolution resolution) {
Siggi Cherem (dart-lang) 2016/05/31 16:28:31 rename: change `ensure` to `compute`? the current
Johnni Winther 2016/06/02 09:02:51 Done.
+ if (_interfaceMembersAreClassMembers == null) {
+ ensureResolved(resolution);
+ ClassMemberMixin superclass = this.superclass;
+ if (superclass != null) {
+ superclass._ensureInterfaceMembersAreClassMembers(resolution);
+ }
+ if ((superclass != null &&
+ (!superclass.interfaceMembersAreClassMembers ||
+ superclass.isMixinApplication)) ||
+ !interfaces.isEmpty) {
+ _interfaceMembersAreClassMembers = false;
+ } else {
+ _interfaceMembersAreClassMembers = true;
+ }
+ }
+ }
+
/// If `true` interface members are the non-static class member.
- bool interfaceMembersAreClassMembers = true;
+ bool get interfaceMembersAreClassMembers => _interfaceMembersAreClassMembers;
Map<Name, Member> classMembers;
Map<Name, MemberSignature> interfaceMembers;
@@ -834,18 +856,8 @@ abstract class ClassMemberMixin implements ClassElement {
/// this class.
MembersCreator _prepareCreator(Resolution resolution) {
if (classMembers == null) {
- ensureResolved(resolution);
+ _ensureInterfaceMembersAreClassMembers(resolution);
classMembers = new Map<Name, Member>();
-
- if (interfaceMembersAreClassMembers) {
- ClassMemberMixin superclass = this.superclass;
- if ((superclass != null &&
- (!superclass.interfaceMembersAreClassMembers ||
- superclass.isMixinApplication)) ||
- !interfaces.isEmpty) {
- interfaceMembersAreClassMembers = false;
- }
- }
if (!interfaceMembersAreClassMembers) {
interfaceMembers = new Map<Name, MemberSignature>();
}
« no previous file with comments | « pkg/compiler/lib/src/resolution/class_hierarchy.dart ('k') | pkg/compiler/lib/src/resolution/resolution.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698