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 SsaCodeGeneratorTask generator; | 8 SsaCodeGeneratorTask generator; |
9 SsaBuilderTask builder; | 9 SsaBuilderTask builder; |
10 SsaOptimizerTask optimizer; | 10 SsaOptimizerTask optimizer; |
(...skipping 4070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4081 | 4081 |
4082 HInstruction target = localsHandler.readThis(); | 4082 HInstruction target = localsHandler.readThis(); |
4083 HConstant index = graph.addConstantInt( | 4083 HConstant index = graph.addConstantInt( |
4084 RuntimeTypes.getTypeVariableIndex(variable), | 4084 RuntimeTypes.getTypeVariableIndex(variable), |
4085 compiler); | 4085 compiler); |
4086 | 4086 |
4087 if (needsSubstitutionForTypeVariableAccess(cls)) { | 4087 if (needsSubstitutionForTypeVariableAccess(cls)) { |
4088 // TODO(ahe): Creating a string here is unfortunate. It is slow (due to | 4088 // TODO(ahe): Creating a string here is unfortunate. It is slow (due to |
4089 // string concatenation in the implementation), and may prevent | 4089 // string concatenation in the implementation), and may prevent |
4090 // segmentation of '$'. | 4090 // segmentation of '$'. |
4091 String substitutionNameString = backend.namer.getNameForRti(cls); | 4091 String substitutionNameString = backend.namer.getRuntimeTypeName(cls); |
4092 HInstruction substitutionName = graph.addConstantString( | 4092 HInstruction substitutionName = graph.addConstantString( |
4093 new ast.LiteralDartString(substitutionNameString), compiler); | 4093 new ast.LiteralDartString(substitutionNameString), compiler); |
4094 pushInvokeStatic(null, | 4094 pushInvokeStatic(null, |
4095 backend.getGetRuntimeTypeArgument(), | 4095 backend.getGetRuntimeTypeArgument(), |
4096 [target, substitutionName, index], | 4096 [target, substitutionName, index], |
4097 backend.dynamicType); | 4097 backend.dynamicType); |
4098 } else { | 4098 } else { |
4099 pushInvokeStatic(null, backend.getGetTypeArgumentByIndex(), | 4099 pushInvokeStatic(null, backend.getGetTypeArgumentByIndex(), |
4100 [target, index], | 4100 [target, index], |
4101 backend.dynamicType); | 4101 backend.dynamicType); |
(...skipping 2569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6671 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 6671 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
6672 unaliased.accept(this, builder); | 6672 unaliased.accept(this, builder); |
6673 } | 6673 } |
6674 | 6674 |
6675 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 6675 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
6676 JavaScriptBackend backend = builder.compiler.backend; | 6676 JavaScriptBackend backend = builder.compiler.backend; |
6677 ClassElement cls = backend.findHelper('DynamicRuntimeType'); | 6677 ClassElement cls = backend.findHelper('DynamicRuntimeType'); |
6678 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); | 6678 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); |
6679 } | 6679 } |
6680 } | 6680 } |
OLD | NEW |