| 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 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 this.backend = builder.backend, | 928 this.backend = builder.backend, |
| 929 this.work = work, | 929 this.work = work, |
| 930 graph = new HGraph(), | 930 graph = new HGraph(), |
| 931 stack = new List<HInstruction>(), | 931 stack = new List<HInstruction>(), |
| 932 activationVariables = new Map<Element, HLocalValue>(), | 932 activationVariables = new Map<Element, HLocalValue>(), |
| 933 jumpTargets = new Map<TargetElement, JumpHandler>(), | 933 jumpTargets = new Map<TargetElement, JumpHandler>(), |
| 934 parameters = new Map<Element, HInstruction>(), | 934 parameters = new Map<Element, HInstruction>(), |
| 935 sourceElementStack = <Element>[work.element], | 935 sourceElementStack = <Element>[work.element], |
| 936 inliningStack = <InliningState>[], | 936 inliningStack = <InliningState>[], |
| 937 rti = builder.backend.rti, | 937 rti = builder.backend.rti, |
| 938 super(work.resolutionTree, builder.compiler) { | 938 super(work.resolutionTree) { |
| 939 localsHandler = new LocalsHandler(this); | 939 localsHandler = new LocalsHandler(this); |
| 940 } | 940 } |
| 941 | 941 |
| 942 List<InliningState> inliningStack; | 942 List<InliningState> inliningStack; |
| 943 | 943 |
| 944 Element returnElement; | 944 Element returnElement; |
| 945 DartType returnType; | 945 DartType returnType; |
| 946 | 946 |
| 947 bool inTryStatement = false; | 947 bool inTryStatement = false; |
| 948 int loopNesting = 0; | 948 int loopNesting = 0; |
| (...skipping 2645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3594 // Finally, if we called a redirecting factory constructor, check the type. | 3594 // Finally, if we called a redirecting factory constructor, check the type. |
| 3595 if (isRedirected) { | 3595 if (isRedirected) { |
| 3596 HInstruction checked = potentiallyCheckType(newInstance, expectedType); | 3596 HInstruction checked = potentiallyCheckType(newInstance, expectedType); |
| 3597 if (checked != newInstance) { | 3597 if (checked != newInstance) { |
| 3598 pop(); | 3598 pop(); |
| 3599 stack.add(checked); | 3599 stack.add(checked); |
| 3600 } | 3600 } |
| 3601 } | 3601 } |
| 3602 } | 3602 } |
| 3603 | 3603 |
| 3604 visitAssert(node) { | |
| 3605 if (!compiler.enableUserAssertions) { | |
| 3606 stack.add(graph.addConstantNull(compiler)); | |
| 3607 return; | |
| 3608 } | |
| 3609 visitStaticSend(node); | |
| 3610 } | |
| 3611 | |
| 3612 visitStaticSend(Send node) { | 3604 visitStaticSend(Send node) { |
| 3613 Selector selector = elements.getSelector(node); | 3605 Selector selector = elements.getSelector(node); |
| 3614 Element element = elements[node]; | 3606 Element element = elements[node]; |
| 3615 if (element.isForeign(compiler)) { | 3607 if (element.isForeign(compiler)) { |
| 3616 visitForeignSend(node); | 3608 visitForeignSend(node); |
| 3617 return; | 3609 return; |
| 3618 } | 3610 } |
| 3619 if (element.isErroneous()) { | 3611 if (element.isErroneous()) { |
| 3620 generateThrowNoSuchMethod(node, | 3612 generateThrowNoSuchMethod(node, |
| 3621 getTargetName(element), | 3613 getTargetName(element), |
| 3622 argumentNodes: node.arguments); | 3614 argumentNodes: node.arguments); |
| 3623 return; | 3615 return; |
| 3624 } | 3616 } |
| 3617 if (identical(element, compiler.assertMethod) |
| 3618 && !compiler.enableUserAssertions) { |
| 3619 stack.add(graph.addConstantNull(compiler)); |
| 3620 return; |
| 3621 } |
| 3625 compiler.ensure(!element.isGenerativeConstructor()); | 3622 compiler.ensure(!element.isGenerativeConstructor()); |
| 3626 if (element.isFunction()) { | 3623 if (element.isFunction()) { |
| 3627 var inputs = <HInstruction>[]; | 3624 var inputs = <HInstruction>[]; |
| 3628 // TODO(5347): Try to avoid the need for calling [implementation] before | 3625 // TODO(5347): Try to avoid the need for calling [implementation] before |
| 3629 // calling [addStaticSendArgumentsToList]. | 3626 // calling [addStaticSendArgumentsToList]. |
| 3630 bool succeeded = addStaticSendArgumentsToList(selector, node.arguments, | 3627 bool succeeded = addStaticSendArgumentsToList(selector, node.arguments, |
| 3631 element.implementation, | 3628 element.implementation, |
| 3632 inputs); | 3629 inputs); |
| 3633 if (!succeeded) { | 3630 if (!succeeded) { |
| 3634 generateWrongArgumentCountError(node, element, node.arguments); | 3631 generateWrongArgumentCountError(node, element, node.arguments); |
| (...skipping 1906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5541 new HSubGraphBlockInformation(elseBranch.graph)); | 5538 new HSubGraphBlockInformation(elseBranch.graph)); |
| 5542 | 5539 |
| 5543 HBasicBlock conditionStartBlock = conditionBranch.block; | 5540 HBasicBlock conditionStartBlock = conditionBranch.block; |
| 5544 conditionStartBlock.setBlockFlow(info, joinBlock); | 5541 conditionStartBlock.setBlockFlow(info, joinBlock); |
| 5545 SubGraph conditionGraph = conditionBranch.graph; | 5542 SubGraph conditionGraph = conditionBranch.graph; |
| 5546 HIf branch = conditionGraph.end.last; | 5543 HIf branch = conditionGraph.end.last; |
| 5547 assert(branch is HIf); | 5544 assert(branch is HIf); |
| 5548 branch.blockInformation = conditionStartBlock.blockFlow; | 5545 branch.blockInformation = conditionStartBlock.blockFlow; |
| 5549 } | 5546 } |
| 5550 } | 5547 } |
| OLD | NEW |