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

Side by Side Diff: pkg/compiler/lib/src/js_backend/codegen/glue.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, 10 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 code_generator_dependencies; 5 library code_generator_dependencies;
6 6
7 import '../backend_helpers.dart' show 7 import '../backend_helpers.dart' show
8 BackendHelpers; 8 BackendHelpers;
9 import '../js_backend.dart'; 9 import '../js_backend.dart';
10 10
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } 221 }
222 222
223 int getTypeVariableIndex(TypeVariableType variable) { 223 int getTypeVariableIndex(TypeVariableType variable) {
224 return variable.element.index; 224 return variable.element.index;
225 } 225 }
226 226
227 bool needsSubstitutionForTypeVariableAccess(ClassElement cls) { 227 bool needsSubstitutionForTypeVariableAccess(ClassElement cls) {
228 ClassWorld classWorld = _compiler.world; 228 ClassWorld classWorld = _compiler.world;
229 if (classWorld.isUsedAsMixin(cls)) return true; 229 if (classWorld.isUsedAsMixin(cls)) return true;
230 230
231 Iterable<ClassElement> subclasses = _compiler.world.strictSubclassesOf(cls); 231 return _compiler.world.anyStrictSubclassOf(cls, (ClassElement subclass) {
232 return subclasses.any((ClassElement subclass) {
233 return !_backend.rti.isTrivialSubstitution(subclass, cls); 232 return !_backend.rti.isTrivialSubstitution(subclass, cls);
234 }); 233 });
235 } 234 }
236 235
237 js.Expression generateTypeRepresentation(DartType dartType, 236 js.Expression generateTypeRepresentation(DartType dartType,
238 List<js.Expression> arguments, 237 List<js.Expression> arguments,
239 CodegenRegistry registry) { 238 CodegenRegistry registry) {
240 int variableIndex = 0; 239 int variableIndex = 0;
241 js.Expression representation = _backend.rtiEncoder.getTypeRepresentation( 240 js.Expression representation = _backend.rtiEncoder.getTypeRepresentation(
242 dartType, 241 dartType,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 FunctionElement get closureFromTearOff => _backend.helpers.closureFromTearOff; 293 FunctionElement get closureFromTearOff => _backend.helpers.closureFromTearOff;
295 294
296 js.Name registerOneShotInterceptor(Selector selector) { 295 js.Name registerOneShotInterceptor(Selector selector) {
297 return _backend.registerOneShotInterceptor(selector); 296 return _backend.registerOneShotInterceptor(selector);
298 } 297 }
299 298
300 bool mayGenerateInstanceofCheck(DartType type) { 299 bool mayGenerateInstanceofCheck(DartType type) {
301 return _backend.mayGenerateInstanceofCheck(type); 300 return _backend.mayGenerateInstanceofCheck(type);
302 } 301 }
303 } 302 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698