| 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 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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.GENERATIVE_CONSTRUCTOR) { | 1590 if (element.kind === ElementKind.GENERATIVE_CONSTRUCTOR) { |
| 1591 compiler.resolver.resolveMethodElement(element); | 1591 compiler.resolver.resolveMethodElement(element); |
| 1592 element = element.defaultImplementation; | 1592 element = element.defaultImplementation; |
| 1593 } else if (element.kind != ElementKind.FUNCTION) { | |
| 1594 compiler.unimplemented( | |
| 1595 "SsaBuilder.visitStaticSend static field invocation", | |
| 1596 node: node); | |
| 1597 } | 1593 } |
| 1598 HStatic target = new HStatic(element); | 1594 HInstruction target = new HStatic(element); |
| 1599 add(target); | 1595 add(target); |
| 1600 var inputs = <HInstruction>[]; | 1596 var inputs = <HInstruction>[]; |
| 1601 inputs.add(target); | 1597 inputs.add(target); |
| 1602 addStaticSendArgumentsToList(node, element, inputs); | 1598 if (element.kind == ElementKind.FUNCTION || |
| 1603 push(new HInvokeStatic(selector, inputs)); | 1599 element.kind == ElementKind.GENERATIVE_CONSTRUCTOR) { |
| 1600 addStaticSendArgumentsToList(node, element, inputs); |
| 1601 push(new HInvokeStatic(selector, inputs)); |
| 1602 } else { |
| 1603 if (element.kind == ElementKind.GETTER) { |
| 1604 target = new HInvokeStatic(Selector.GETTER, inputs); |
| 1605 add(target); |
| 1606 inputs = <HInstruction>[target]; |
| 1607 } |
| 1608 addDynamicSendArgumentsToList(node, inputs); |
| 1609 push(new HInvokeClosure(selector, inputs)); |
| 1610 } |
| 1604 } | 1611 } |
| 1605 | 1612 |
| 1606 visitSend(Send node) { | 1613 visitSend(Send node) { |
| 1607 if (node.selector is Operator && methodInterceptionEnabled) { | 1614 if (node.selector is Operator && methodInterceptionEnabled) { |
| 1608 visitOperatorSend(node); | 1615 visitOperatorSend(node); |
| 1609 } else if (node.isPropertyAccess) { | 1616 } else if (node.isPropertyAccess) { |
| 1610 generateGetter(node, elements[node]); | 1617 generateGetter(node, elements[node]); |
| 1611 } else if (Elements.isClosureSend(node, elements)) { | 1618 } else if (Elements.isClosureSend(node, elements)) { |
| 1612 visitClosureSend(node); | 1619 visitClosureSend(node); |
| 1613 } else if (node.isSuperCall) { | 1620 } else if (node.isSuperCall) { |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2072 } | 2079 } |
| 2073 | 2080 |
| 2074 visitCatchBlock(CatchBlock node) { | 2081 visitCatchBlock(CatchBlock node) { |
| 2075 visit(node.block); | 2082 visit(node.block); |
| 2076 } | 2083 } |
| 2077 | 2084 |
| 2078 visitTypedef(Typedef node) { | 2085 visitTypedef(Typedef node) { |
| 2079 compiler.unimplemented('SsaBuilder.visitTypedef', node: node); | 2086 compiler.unimplemented('SsaBuilder.visitTypedef', node: node); |
| 2080 } | 2087 } |
| 2081 } | 2088 } |
| OLD | NEW |