| 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 class Interceptors { | 5 class Interceptors { |
| 6 Compiler compiler; | 6 Compiler compiler; |
| 7 Interceptors(Compiler this.compiler); | 7 Interceptors(Compiler this.compiler); |
| 8 | 8 |
| 9 SourceString mapOperatorToMethodName(Operator op) { | 9 SourceString mapOperatorToMethodName(Operator op) { |
| 10 String name = op.source.stringValue; | 10 String name = op.source.stringValue; |
| (...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1580 HInstruction context = localsHandler.readThis(); | 1580 HInstruction context = localsHandler.readThis(); |
| 1581 add(target); | 1581 add(target); |
| 1582 var inputs = <HInstruction>[target, context]; | 1582 var inputs = <HInstruction>[target, context]; |
| 1583 addStaticSendArgumentsToList(node, element, inputs); | 1583 addStaticSendArgumentsToList(node, element, inputs); |
| 1584 push(new HInvokeSuper(selector, inputs)); | 1584 push(new HInvokeSuper(selector, inputs)); |
| 1585 } | 1585 } |
| 1586 | 1586 |
| 1587 visitStaticSend(Send node) { | 1587 visitStaticSend(Send node) { |
| 1588 Selector selector = elements.getSelector(node); | 1588 Selector selector = elements.getSelector(node); |
| 1589 Element element = elements[node]; | 1589 Element element = elements[node]; |
| 1590 if (element.kind != ElementKind.FUNCTION && | 1590 HInstruction target = new HStatic(element); |
| 1591 element.kind != ElementKind.GENERATIVE_CONSTRUCTOR) { | |
| 1592 compiler.unimplemented( | |
| 1593 "SsaBuilder.visitStaticSend static field invocation", | |
| 1594 node: node); | |
| 1595 } | |
| 1596 HStatic target = new HStatic(element); | |
| 1597 add(target); | 1591 add(target); |
| 1598 var inputs = <HInstruction>[]; | 1592 var inputs = <HInstruction>[]; |
| 1599 inputs.add(target); | 1593 inputs.add(target); |
| 1600 addStaticSendArgumentsToList(node, element, inputs); | 1594 if (element.kind == ElementKind.FUNCTION || |
| 1601 push(new HInvokeStatic(selector, inputs)); | 1595 element.kind == ElementKind.GENERATIVE_CONSTRUCTOR) { |
| 1596 addStaticSendArgumentsToList(node, element, inputs); |
| 1597 push(new HInvokeStatic(selector, inputs)); |
| 1598 } else { |
| 1599 if (element.kind == ElementKind.GETTER) { |
| 1600 target = new HInvokeStatic(Selector.GETTER, inputs); |
| 1601 add(target); |
| 1602 inputs = <HInstruction>[target]; |
| 1603 } |
| 1604 addDynamicSendArgumentsToList(node, inputs); |
| 1605 push(new HInvokeClosure(selector, inputs)); |
| 1606 } |
| 1602 } | 1607 } |
| 1603 | 1608 |
| 1604 visitSend(Send node) { | 1609 visitSend(Send node) { |
| 1605 if (node.selector is Operator && methodInterceptionEnabled) { | 1610 if (node.selector is Operator && methodInterceptionEnabled) { |
| 1606 visitOperatorSend(node); | 1611 visitOperatorSend(node); |
| 1607 } else if (node.isPropertyAccess) { | 1612 } else if (node.isPropertyAccess) { |
| 1608 generateGetter(node, elements[node]); | 1613 generateGetter(node, elements[node]); |
| 1609 } else if (Elements.isClosureSend(node, elements)) { | 1614 } else if (Elements.isClosureSend(node, elements)) { |
| 1610 visitClosureSend(node); | 1615 visitClosureSend(node); |
| 1611 } else if (node.isSuperCall) { | 1616 } else if (node.isSuperCall) { |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2070 } | 2075 } |
| 2071 | 2076 |
| 2072 visitCatchBlock(CatchBlock node) { | 2077 visitCatchBlock(CatchBlock node) { |
| 2073 visit(node.block); | 2078 visit(node.block); |
| 2074 } | 2079 } |
| 2075 | 2080 |
| 2076 visitTypedef(Typedef node) { | 2081 visitTypedef(Typedef node) { |
| 2077 compiler.unimplemented('SsaBuilder.visitTypedef', node: node); | 2082 compiler.unimplemented('SsaBuilder.visitTypedef', node: node); |
| 2078 } | 2083 } |
| 2079 } | 2084 } |
| OLD | NEW |