Chromium Code Reviews| 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 1903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1914 native.handleSsaNative(this, node); | 1914 native.handleSsaNative(this, node); |
| 1915 } else { | 1915 } else { |
| 1916 throw "Unknown foreign: ${node.selector}"; | 1916 throw "Unknown foreign: ${node.selector}"; |
| 1917 } | 1917 } |
| 1918 } | 1918 } |
| 1919 | 1919 |
| 1920 visitSuperSend(Send node) { | 1920 visitSuperSend(Send node) { |
| 1921 Selector selector = elements.getSelector(node); | 1921 Selector selector = elements.getSelector(node); |
| 1922 Element element = elements[node]; | 1922 Element element = elements[node]; |
| 1923 if (element === null) { | 1923 if (element === null) { |
| 1924 // Example: co19/Language/10_Expressions/25_Unary_Expressions_A06_t01 | 1924 ClassElement cls = work.element.getEnclosingClass(); |
| 1925 compiler.unimplemented('unresolved super-send', node: node); | 1925 element = cls.lookupSuperMember(Compiler.NO_SUCH_METHOD); |
| 1926 HStatic target = new HStatic(element); | |
| 1927 HInstruction self = localsHandler.readThis(); | |
| 1928 Identifier identifier = node.selector.asIdentifier(); | |
| 1929 String name = identifier.source.slowToString(); | |
| 1930 // TODO(ahe): Add the arguments to this list. | |
|
ngeoffray
2012/03/21 12:45:41
this should not be too bad to implement:
List<HIn
ahe
2012/03/21 12:56:48
Nice. I'll take a look at that, but I think this m
| |
| 1931 push(new HLiteralList([], true)); | |
| 1932 var inputs = <HInstruction>[ | |
| 1933 target, | |
| 1934 self, | |
| 1935 graph.addConstantString(new DartString.literal(name)), | |
| 1936 pop()]; | |
| 1937 push(new HInvokeSuper(const Selector(SelectorKind.INVOCATION, 2), | |
| 1938 inputs)); | |
| 1939 return; | |
| 1926 } | 1940 } |
| 1927 HStatic target = new HStatic(element); | 1941 HStatic target = new HStatic(element); |
| 1928 HInstruction context = localsHandler.readThis(); | 1942 HInstruction context = localsHandler.readThis(); |
| 1929 add(target); | 1943 add(target); |
| 1930 var inputs = <HInstruction>[target, context]; | 1944 var inputs = <HInstruction>[target, context]; |
| 1931 if (element.kind == ElementKind.FUNCTION || | 1945 if (element.kind == ElementKind.FUNCTION || |
| 1932 element.kind == ElementKind.GENERATIVE_CONSTRUCTOR) { | 1946 element.kind == ElementKind.GENERATIVE_CONSTRUCTOR) { |
| 1933 addStaticSendArgumentsToList(node, element, inputs); | 1947 addStaticSendArgumentsToList(node, element, inputs); |
| 1934 push(new HInvokeSuper(selector, inputs)); | 1948 push(new HInvokeSuper(selector, inputs)); |
| 1935 } else { | 1949 } else { |
| (...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2808 HInstruction concat = new HAdd(target, left, right); | 2822 HInstruction concat = new HAdd(target, left, right); |
| 2809 builder.add(concat); | 2823 builder.add(concat); |
| 2810 return concat; | 2824 return concat; |
| 2811 } | 2825 } |
| 2812 | 2826 |
| 2813 HInstruction result() { | 2827 HInstruction result() { |
| 2814 flushAccumulator(); | 2828 flushAccumulator(); |
| 2815 return prefix; | 2829 return prefix; |
| 2816 } | 2830 } |
| 2817 } | 2831 } |
| OLD | NEW |