| 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 3333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3344 assert(invariant(send, | 3344 assert(invariant(send, |
| 3345 !compiler.enableTypeAssertions || !type.isMalformed, | 3345 !compiler.enableTypeAssertions || !type.isMalformed, |
| 3346 message: '$type is malformed in checked mode')); | 3346 message: '$type is malformed in checked mode')); |
| 3347 bool isListConstructor = false; | 3347 bool isListConstructor = false; |
| 3348 computeType(element) { | 3348 computeType(element) { |
| 3349 Element originalElement = elements[send]; | 3349 Element originalElement = elements[send]; |
| 3350 if (Elements.isFixedListConstructorCall( | 3350 if (Elements.isFixedListConstructorCall( |
| 3351 originalElement, send, compiler)) { | 3351 originalElement, send, compiler)) { |
| 3352 isListConstructor = true; | 3352 isListConstructor = true; |
| 3353 HType inferred = | 3353 HType inferred = |
| 3354 new HType.inferredForNode(currentElement, node, compiler); | 3354 new HType.inferredForNode(currentElement, send, compiler); |
| 3355 return inferred.isUnknown() ? backend.fixedArrayType : inferred; | 3355 return inferred.isUnknown() ? backend.fixedArrayType : inferred; |
| 3356 } else if (Elements.isGrowableListConstructorCall( | 3356 } else if (Elements.isGrowableListConstructorCall( |
| 3357 originalElement, send, compiler)) { | 3357 originalElement, send, compiler)) { |
| 3358 isListConstructor = true; | 3358 isListConstructor = true; |
| 3359 HType inferred = | 3359 HType inferred = |
| 3360 new HType.inferredForNode(currentElement, node, compiler); | 3360 new HType.inferredForNode(currentElement, send, compiler); |
| 3361 return inferred.isUnknown() ? backend.extendableArrayType : inferred; | 3361 return inferred.isUnknown() ? backend.extendableArrayType : inferred; |
| 3362 } else if (element.isGenerativeConstructor()) { | 3362 } else if (element.isGenerativeConstructor()) { |
| 3363 ClassElement cls = element.getEnclosingClass(); | 3363 ClassElement cls = element.getEnclosingClass(); |
| 3364 return new HType.nonNullExact(cls.thisType, compiler); | 3364 return new HType.nonNullExact(cls.thisType, compiler); |
| 3365 } else { | 3365 } else { |
| 3366 return new HType.inferredTypeForElement(originalElement, compiler); | 3366 return new HType.inferredTypeForElement(originalElement, compiler); |
| 3367 } | 3367 } |
| 3368 } | 3368 } |
| 3369 | 3369 |
| 3370 Element constructor = elements[send]; | 3370 Element constructor = elements[send]; |
| (...skipping 2026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5397 new HSubGraphBlockInformation(elseBranch.graph)); | 5397 new HSubGraphBlockInformation(elseBranch.graph)); |
| 5398 | 5398 |
| 5399 HBasicBlock conditionStartBlock = conditionBranch.block; | 5399 HBasicBlock conditionStartBlock = conditionBranch.block; |
| 5400 conditionStartBlock.setBlockFlow(info, joinBlock); | 5400 conditionStartBlock.setBlockFlow(info, joinBlock); |
| 5401 SubGraph conditionGraph = conditionBranch.graph; | 5401 SubGraph conditionGraph = conditionBranch.graph; |
| 5402 HIf branch = conditionGraph.end.last; | 5402 HIf branch = conditionGraph.end.last; |
| 5403 assert(branch is HIf); | 5403 assert(branch is HIf); |
| 5404 branch.blockInformation = conditionStartBlock.blockFlow; | 5404 branch.blockInformation = conditionStartBlock.blockFlow; |
| 5405 } | 5405 } |
| 5406 } | 5406 } |
| OLD | NEW |