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

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

Issue 1627333002: Optimize subclass/subtype queries (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Use strictSubtypeCount Created 4 years, 11 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 8 import '../common/resolution.dart' show
9 Resolution, 9 Resolution,
10 Parsing; 10 Parsing;
11 import '../compiler.dart' show 11 import '../compiler.dart' show
12 Compiler; 12 Compiler;
13 import '../constants/constant_constructors.dart'; 13 import '../constants/constant_constructors.dart';
14 import '../constants/constructors.dart'; 14 import '../constants/constructors.dart';
15 import '../constants/expressions.dart'; 15 import '../constants/expressions.dart';
16 import '../core_types.dart' show
17 CoreClasses;
16 import '../dart_types.dart'; 18 import '../dart_types.dart';
17 import '../diagnostics/messages.dart' show 19 import '../diagnostics/messages.dart' show
18 MessageTemplate; 20 MessageTemplate;
19 import '../ordered_typeset.dart' show 21 import '../ordered_typeset.dart' show
20 OrderedTypeSet; 22 OrderedTypeSet;
21 import '../resolution/class_members.dart' show 23 import '../resolution/class_members.dart' show
22 ClassMemberMixin; 24 ClassMemberMixin;
23 import '../resolution/scope.dart' show 25 import '../resolution/scope.dart' show
24 ClassScope, 26 ClassScope,
25 LibraryScope, 27 LibraryScope,
(...skipping 2673 matching lines...) Expand 10 before | Expand all | Expand 10 after
2699 ClassElement get superclass { 2701 ClassElement get superclass {
2700 assert(invariant(this, supertypeLoadState == STATE_DONE, 2702 assert(invariant(this, supertypeLoadState == STATE_DONE,
2701 message: "Superclass has not been computed for $this.")); 2703 message: "Superclass has not been computed for $this."));
2702 return supertype == null ? null : supertype.element; 2704 return supertype == null ? null : supertype.element;
2703 } 2705 }
2704 2706
2705 void forEachBackendMember(void f(Element member)) { 2707 void forEachBackendMember(void f(Element member)) {
2706 backendMembers.forEach(f); 2708 backendMembers.forEach(f);
2707 } 2709 }
2708 2710
2709 bool implementsFunction(Compiler compiler) { 2711 bool implementsFunction(CoreClasses coreClasses) {
2710 return asInstanceOf(compiler.coreClasses.functionClass) != null || 2712 return asInstanceOf(coreClasses.functionClass) != null ||
2711 callType != null; 2713 callType != null;
2712 } 2714 }
2713 2715
2714 // TODO(johnniwinther): Remove these when issue 18630 is fixed. 2716 // TODO(johnniwinther): Remove these when issue 18630 is fixed.
2715 ClassElement get patch => super.patch; 2717 ClassElement get patch => super.patch;
2716 ClassElement get origin => super.origin; 2718 ClassElement get origin => super.origin;
2717 2719
2718 // A class declaration is defined by the declaration element. 2720 // A class declaration is defined by the declaration element.
2719 AstElement get definingElement => declaration; 2721 AstElement get definingElement => declaration;
2720 } 2722 }
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
3226 AstElement get definingElement; 3228 AstElement get definingElement;
3227 3229
3228 bool get hasResolvedAst => definingElement.hasTreeElements; 3230 bool get hasResolvedAst => definingElement.hasTreeElements;
3229 3231
3230 ResolvedAst get resolvedAst { 3232 ResolvedAst get resolvedAst {
3231 return new ResolvedAst(declaration, 3233 return new ResolvedAst(declaration,
3232 definingElement.node, definingElement.treeElements); 3234 definingElement.node, definingElement.treeElements);
3233 } 3235 }
3234 3236
3235 } 3237 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698