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

Side by Side Diff: pkg/compiler/lib/src/elements/modelx.dart

Issue 2017903002: Improve equivalence testing of unnamed mixin applications. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rebased Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library elements.modelx; 5 library elements.modelx;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/resolution.dart' show Resolution, ParsingContext; 8 import '../common/resolution.dart' show Resolution, ParsingContext;
9 import '../compiler.dart' show Compiler; 9 import '../compiler.dart' show Compiler;
10 import '../constants/constant_constructors.dart'; 10 import '../constants/constant_constructors.dart';
(...skipping 2970 matching lines...) Expand 10 before | Expand all | Expand 10 after
2981 Link<ConstructorElement> constructors = new Link<ConstructorElement>(); 2981 Link<ConstructorElement> constructors = new Link<ConstructorElement>();
2982 2982
2983 InterfaceType mixinType; 2983 InterfaceType mixinType;
2984 2984
2985 MixinApplicationElementX(String name, Element enclosing, int id) 2985 MixinApplicationElementX(String name, Element enclosing, int id)
2986 : super(name, enclosing, id, STATE_NOT_STARTED); 2986 : super(name, enclosing, id, STATE_NOT_STARTED);
2987 2987
2988 ClassElement get mixin => mixinType != null ? mixinType.element : null; 2988 ClassElement get mixin => mixinType != null ? mixinType.element : null;
2989 2989
2990 bool get isMixinApplication => true; 2990 bool get isMixinApplication => true;
2991 bool get isUnnamedMixinApplication => node is! NamedMixinApplication;
2992 bool get hasConstructor => !constructors.isEmpty; 2991 bool get hasConstructor => !constructors.isEmpty;
2993 bool get hasLocalScopeMembers => !constructors.isEmpty; 2992 bool get hasLocalScopeMembers => !constructors.isEmpty;
2994 2993
2995 get patch => null; 2994 get patch => null;
2996 get origin => null; 2995 get origin => null;
2997 2996
2998 bool get hasNode => true; 2997 bool get hasNode => true;
2999 2998
3000 Token get position => node.getBeginToken(); 2999 Token get position => node.getBeginToken();
3001 3000
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
3039 implements DeclarationSite { 3038 implements DeclarationSite {
3040 final NamedMixinApplication node; 3039 final NamedMixinApplication node;
3041 3040
3042 NamedMixinApplicationElementX( 3041 NamedMixinApplicationElementX(
3043 String name, CompilationUnitElement enclosing, int id, this.node) 3042 String name, CompilationUnitElement enclosing, int id, this.node)
3044 : super(name, enclosing, id); 3043 : super(name, enclosing, id);
3045 3044
3046 Modifiers get modifiers => node.modifiers; 3045 Modifiers get modifiers => node.modifiers;
3047 3046
3048 DeclarationSite get declarationSite => this; 3047 DeclarationSite get declarationSite => this;
3048
3049 ClassElement get subclass => null;
3049 } 3050 }
3050 3051
3051 class UnnamedMixinApplicationElementX extends MixinApplicationElementX { 3052 class UnnamedMixinApplicationElementX extends MixinApplicationElementX {
3052 final Node node; 3053 final Node node;
3054 final ClassElement subclass;
3053 3055
3054 UnnamedMixinApplicationElementX( 3056 UnnamedMixinApplicationElementX(
3055 String name, CompilationUnitElement enclosing, int id, this.node) 3057 String name, ClassElement subclass, int id, this.node)
3056 : super(name, enclosing, id); 3058 : this.subclass = subclass,
3059 super(name, subclass.compilationUnit, id);
3060
3061 bool get isUnnamedMixinApplication => true;
3057 3062
3058 bool get isAbstract => true; 3063 bool get isAbstract => true;
3059 } 3064 }
3060 3065
3061 class LabelDefinitionX implements LabelDefinition { 3066 class LabelDefinitionX implements LabelDefinition {
3062 final Label label; 3067 final Label label;
3063 final String labelName; 3068 final String labelName;
3064 final JumpTarget target; 3069 final JumpTarget target;
3065 bool isBreakTarget = false; 3070 bool isBreakTarget = false;
3066 bool isContinueTarget = false; 3071 bool isContinueTarget = false;
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
3286 body = node.asFunctionExpression().body; 3291 body = node.asFunctionExpression().body;
3287 } 3292 }
3288 return new ParsedResolvedAst( 3293 return new ParsedResolvedAst(
3289 declaration, 3294 declaration,
3290 node, 3295 node,
3291 body, 3296 body,
3292 definingElement.treeElements, 3297 definingElement.treeElements,
3293 definingElement.compilationUnit.script.resourceUri); 3298 definingElement.compilationUnit.script.resourceUri);
3294 } 3299 }
3295 } 3300 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698