| OLD | NEW |
| 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 Loading... |
| 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 Iterable<ClassElement> subclasses = compiler.world.strictSubclassesOf(cls); | 4843 return compiler.world.anyStrictSubclassOf(cls, (ClassElement subclass) { |
| 4844 return subclasses.any((ClassElement subclass) { | |
| 4845 return !rti.isTrivialSubstitution(subclass, cls); | 4844 return !rti.isTrivialSubstitution(subclass, cls); |
| 4846 }); | 4845 }); |
| 4847 } | 4846 } |
| 4848 | 4847 |
| 4849 /** | 4848 /** |
| 4850 * Generate code to extract the type arguments from the object, substitute | 4849 * Generate code to extract the type arguments from the object, substitute |
| 4851 * them as an instance of the type we are testing against (if necessary), and | 4850 * them as an instance of the type we are testing against (if necessary), and |
| 4852 * extract the type argument by the index of the variable in the list of type | 4851 * extract the type argument by the index of the variable in the list of type |
| 4853 * variables for that class. | 4852 * variables for that class. |
| 4854 */ | 4853 */ |
| (...skipping 4331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9186 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 9185 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
| 9187 unaliased.accept(this, builder); | 9186 unaliased.accept(this, builder); |
| 9188 } | 9187 } |
| 9189 | 9188 |
| 9190 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 9189 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
| 9191 JavaScriptBackend backend = builder.compiler.backend; | 9190 JavaScriptBackend backend = builder.compiler.backend; |
| 9192 ClassElement cls = backend.helpers.DynamicRuntimeType; | 9191 ClassElement cls = backend.helpers.DynamicRuntimeType; |
| 9193 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); | 9192 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); |
| 9194 } | 9193 } |
| 9195 } | 9194 } |
| OLD | NEW |