| 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 /** | 7 /** |
| 8 * A special element for the extra parameter taken by intercepted | 8 * A special element for the extra parameter taken by intercepted |
| 9 * methods. We need to override [Element.computeType] because our | 9 * methods. We need to override [Element.computeType] because our |
| 10 * optimizers may look at its declared type. | 10 * optimizers may look at its declared type. |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 } | 241 } |
| 242 | 242 |
| 243 HType cachedTypeOfThis; | 243 HType cachedTypeOfThis; |
| 244 | 244 |
| 245 HType getTypeOfThis() { | 245 HType getTypeOfThis() { |
| 246 HType result = cachedTypeOfThis; | 246 HType result = cachedTypeOfThis; |
| 247 if (result == null) { | 247 if (result == null) { |
| 248 Element element = closureData.thisElement; | 248 Element element = closureData.thisElement; |
| 249 ClassElement cls = element.enclosingElement.getEnclosingClass(); | 249 ClassElement cls = element.enclosingElement.getEnclosingClass(); |
| 250 Compiler compiler = builder.compiler; | 250 Compiler compiler = builder.compiler; |
| 251 DartType type = cls.computeType(compiler); | 251 // Use the raw type because we don't have the type context for the |
| 252 // type parameters. |
| 253 DartType type = cls.rawType; |
| 252 if (compiler.world.isUsedAsMixin(cls)) { | 254 if (compiler.world.isUsedAsMixin(cls)) { |
| 253 // If the enclosing class is used as a mixin, [:this:] can be | 255 // If the enclosing class is used as a mixin, [:this:] can be |
| 254 // of the class that mixins the enclosing class. These two | 256 // of the class that mixins the enclosing class. These two |
| 255 // classes do not have a subclass relationship, so, for | 257 // classes do not have a subclass relationship, so, for |
| 256 // simplicity, we mark the type as an interface type. | 258 // simplicity, we mark the type as an interface type. |
| 257 result = new HType.nonNullSubtype(type, compiler); | 259 result = new HType.nonNullSubtype(type, compiler); |
| 258 } else { | 260 } else { |
| 259 result = new HType.nonNullSubclass(type, compiler); | 261 result = new HType.nonNullSubclass(type, compiler); |
| 260 } | 262 } |
| 261 cachedTypeOfThis = result; | 263 cachedTypeOfThis = result; |
| (...skipping 4828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5090 new HSubGraphBlockInformation(elseBranch.graph)); | 5092 new HSubGraphBlockInformation(elseBranch.graph)); |
| 5091 | 5093 |
| 5092 HBasicBlock conditionStartBlock = conditionBranch.block; | 5094 HBasicBlock conditionStartBlock = conditionBranch.block; |
| 5093 conditionStartBlock.setBlockFlow(info, joinBlock); | 5095 conditionStartBlock.setBlockFlow(info, joinBlock); |
| 5094 SubGraph conditionGraph = conditionBranch.graph; | 5096 SubGraph conditionGraph = conditionBranch.graph; |
| 5095 HIf branch = conditionGraph.end.last; | 5097 HIf branch = conditionGraph.end.last; |
| 5096 assert(branch is HIf); | 5098 assert(branch is HIf); |
| 5097 branch.blockInformation = conditionStartBlock.blockFlow; | 5099 branch.blockInformation = conditionStartBlock.blockFlow; |
| 5098 } | 5100 } |
| 5099 } | 5101 } |
| OLD | NEW |