| 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 3345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3356 * Invariant: [type] must not be malformed in checked mode. | 3356 * Invariant: [type] must not be malformed in checked mode. |
| 3357 */ | 3357 */ |
| 3358 handleNewSend(NewExpression node, InterfaceType type) { | 3358 handleNewSend(NewExpression node, InterfaceType type) { |
| 3359 Send send = node.send; | 3359 Send send = node.send; |
| 3360 assert(invariant(send, | 3360 assert(invariant(send, |
| 3361 !compiler.enableTypeAssertions || !type.isMalformed, | 3361 !compiler.enableTypeAssertions || !type.isMalformed, |
| 3362 message: '$type is malformed in checked mode')); | 3362 message: '$type is malformed in checked mode')); |
| 3363 bool isListConstructor = false; | 3363 bool isListConstructor = false; |
| 3364 computeType(element) { | 3364 computeType(element) { |
| 3365 Element originalElement = elements[send]; | 3365 Element originalElement = elements[send]; |
| 3366 if (Elements.isFixedListConstructorCall( | 3366 if (Elements.isFixedListConstructorCall(originalElement, send, compiler) |
| 3367 originalElement, send, compiler)) { | 3367 || Elements.isFilledListConstructorCall( |
| 3368 originalElement, send, compiler)) { |
| 3368 isListConstructor = true; | 3369 isListConstructor = true; |
| 3369 HType inferred = | 3370 HType inferred = |
| 3370 new HType.inferredForNode(currentElement, send, compiler); | 3371 new HType.inferredForNode(currentElement, send, compiler); |
| 3371 return inferred.isUnknown() ? backend.fixedArrayType : inferred; | 3372 return inferred.isUnknown() ? backend.fixedArrayType : inferred; |
| 3372 } else if (Elements.isGrowableListConstructorCall( | 3373 } else if (Elements.isGrowableListConstructorCall( |
| 3373 originalElement, send, compiler)) { | 3374 originalElement, send, compiler)) { |
| 3374 isListConstructor = true; | 3375 isListConstructor = true; |
| 3375 HType inferred = | 3376 HType inferred = |
| 3376 new HType.inferredForNode(currentElement, send, compiler); | 3377 new HType.inferredForNode(currentElement, send, compiler); |
| 3377 return inferred.isUnknown() ? backend.extendableArrayType : inferred; | 3378 return inferred.isUnknown() ? backend.extendableArrayType : inferred; |
| (...skipping 2035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5413 new HSubGraphBlockInformation(elseBranch.graph)); | 5414 new HSubGraphBlockInformation(elseBranch.graph)); |
| 5414 | 5415 |
| 5415 HBasicBlock conditionStartBlock = conditionBranch.block; | 5416 HBasicBlock conditionStartBlock = conditionBranch.block; |
| 5416 conditionStartBlock.setBlockFlow(info, joinBlock); | 5417 conditionStartBlock.setBlockFlow(info, joinBlock); |
| 5417 SubGraph conditionGraph = conditionBranch.graph; | 5418 SubGraph conditionGraph = conditionBranch.graph; |
| 5418 HIf branch = conditionGraph.end.last; | 5419 HIf branch = conditionGraph.end.last; |
| 5419 assert(branch is HIf); | 5420 assert(branch is HIf); |
| 5420 branch.blockInformation = conditionStartBlock.blockFlow; | 5421 branch.blockInformation = conditionStartBlock.blockFlow; |
| 5421 } | 5422 } |
| 5422 } | 5423 } |
| OLD | NEW |