| 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 4121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4132 // never built standalone, so [isBuildingFor] will | 4132 // never built standalone, so [isBuildingFor] will |
| 4133 // always return true when seeing one. | 4133 // always return true when seeing one. |
| 4134 (member.isField && !isBuildingFor(member))) { | 4134 (member.isField && !isBuildingFor(member))) { |
| 4135 // The type variable is stored in a parameter of the method. | 4135 // The type variable is stored in a parameter of the method. |
| 4136 return localsHandler.readLocal(typeVariableLocal); | 4136 return localsHandler.readLocal(typeVariableLocal); |
| 4137 } else if (member.isInstanceMember) { | 4137 } else if (member.isInstanceMember) { |
| 4138 // The type variable is stored on the object. | 4138 // The type variable is stored on the object. |
| 4139 return readTypeVariable(member.enclosingClass, | 4139 return readTypeVariable(member.enclosingClass, |
| 4140 type.element); | 4140 type.element); |
| 4141 } else { | 4141 } else { |
| 4142 // TODO(ngeoffray): Match the VM behavior and throw an | |
| 4143 // exception at runtime. | |
| 4144 compiler.internalError(type.element, | 4142 compiler.internalError(type.element, |
| 4145 'Unimplemented unresolved type variable.'); | 4143 'Unexpected type variable in static context.'); |
| 4146 return null; | 4144 return null; |
| 4147 } | 4145 } |
| 4148 } | 4146 } |
| 4149 | 4147 |
| 4150 HInstruction analyzeTypeArgument(DartType argument) { | 4148 HInstruction analyzeTypeArgument(DartType argument) { |
| 4151 assert(assertTypeInContext(argument)); | 4149 assert(assertTypeInContext(argument)); |
| 4152 if (argument.treatAsDynamic) { | 4150 if (argument.treatAsDynamic) { |
| 4153 // Represent [dynamic] as [null]. | 4151 // Represent [dynamic] as [null]. |
| 4154 return graph.addConstantNull(compiler); | 4152 return graph.addConstantNull(compiler); |
| 4155 } | 4153 } |
| (...skipping 2491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6647 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 6645 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
| 6648 unaliased.accept(this, builder); | 6646 unaliased.accept(this, builder); |
| 6649 } | 6647 } |
| 6650 | 6648 |
| 6651 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 6649 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
| 6652 JavaScriptBackend backend = builder.compiler.backend; | 6650 JavaScriptBackend backend = builder.compiler.backend; |
| 6653 ClassElement cls = backend.findHelper('DynamicRuntimeType'); | 6651 ClassElement cls = backend.findHelper('DynamicRuntimeType'); |
| 6654 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); | 6652 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); |
| 6655 } | 6653 } |
| 6656 } | 6654 } |
| OLD | NEW |