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

Side by Side Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 1638863002: Revert "Optimize subclass/subtype queries" (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of ssa; 5 part of ssa;
6 6
7 class SsaFunctionCompiler implements FunctionCompiler { 7 class SsaFunctionCompiler implements FunctionCompiler {
8 final SsaCodeGeneratorTask generator; 8 final SsaCodeGeneratorTask generator;
9 final SsaBuilderTask builder; 9 final SsaBuilderTask builder;
10 final SsaOptimizerTask optimizer; 10 final SsaOptimizerTask optimizer;
(...skipping 4822 matching lines...) Expand 10 before | Expand all | Expand 10 after
4833 Selector selector = elements.getSelector(node); 4833 Selector selector = elements.getSelector(node);
4834 List<HInstruction> inputs = <HInstruction>[]; 4834 List<HInstruction> inputs = <HInstruction>[];
4835 addGenericSendArgumentsToList(arguments.nodes, inputs); 4835 addGenericSendArgumentsToList(arguments.nodes, inputs);
4836 generateSuperNoSuchMethodSend(node, selector, inputs); 4836 generateSuperNoSuchMethodSend(node, selector, inputs);
4837 } 4837 }
4838 4838
4839 bool needsSubstitutionForTypeVariableAccess(ClassElement cls) { 4839 bool needsSubstitutionForTypeVariableAccess(ClassElement cls) {
4840 ClassWorld classWorld = compiler.world; 4840 ClassWorld classWorld = compiler.world;
4841 if (classWorld.isUsedAsMixin(cls)) return true; 4841 if (classWorld.isUsedAsMixin(cls)) return true;
4842 4842
4843 return compiler.world.anyStrictSubclassOf(cls, (ClassElement subclass) { 4843 Iterable<ClassElement> subclasses = compiler.world.strictSubclassesOf(cls);
4844 return subclasses.any((ClassElement subclass) {
4844 return !rti.isTrivialSubstitution(subclass, cls); 4845 return !rti.isTrivialSubstitution(subclass, cls);
4845 }); 4846 });
4846 } 4847 }
4847 4848
4848 /** 4849 /**
4849 * Generate code to extract the type arguments from the object, substitute 4850 * Generate code to extract the type arguments from the object, substitute
4850 * them as an instance of the type we are testing against (if necessary), and 4851 * them as an instance of the type we are testing against (if necessary), and
4851 * extract the type argument by the index of the variable in the list of type 4852 * extract the type argument by the index of the variable in the list of type
4852 * variables for that class. 4853 * variables for that class.
4853 */ 4854 */
(...skipping 4374 matching lines...) Expand 10 before | Expand all | Expand 10 after
9228 if (unaliased is TypedefType) throw 'unable to unalias $type'; 9229 if (unaliased is TypedefType) throw 'unable to unalias $type';
9229 unaliased.accept(this, builder); 9230 unaliased.accept(this, builder);
9230 } 9231 }
9231 9232
9232 void visitDynamicType(DynamicType type, SsaBuilder builder) { 9233 void visitDynamicType(DynamicType type, SsaBuilder builder) {
9233 JavaScriptBackend backend = builder.compiler.backend; 9234 JavaScriptBackend backend = builder.compiler.backend;
9234 ClassElement cls = backend.helpers.DynamicRuntimeType; 9235 ClassElement cls = backend.helpers.DynamicRuntimeType;
9235 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); 9236 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld)));
9236 } 9237 }
9237 } 9238 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart ('k') | pkg/compiler/lib/src/types/union_type_mask.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698