| 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 2272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2283 self, | 2283 self, |
| 2284 graph.addConstantString(new DartString.literal(name), node), | 2284 graph.addConstantString(new DartString.literal(name), node), |
| 2285 pop()]; | 2285 pop()]; |
| 2286 push(new HInvokeSuper(Selector.INVOCATION_2, inputs)); | 2286 push(new HInvokeSuper(Selector.INVOCATION_2, inputs)); |
| 2287 return; | 2287 return; |
| 2288 } | 2288 } |
| 2289 HInstruction target = new HStatic(element); | 2289 HInstruction target = new HStatic(element); |
| 2290 HInstruction context = localsHandler.readThis(); | 2290 HInstruction context = localsHandler.readThis(); |
| 2291 add(target); | 2291 add(target); |
| 2292 var inputs = <HInstruction>[target, context]; | 2292 var inputs = <HInstruction>[target, context]; |
| 2293 if (element.kind == ElementKind.FUNCTION || | 2293 if (node.isPropertyAccess) { |
| 2294 element.kind == ElementKind.GENERATIVE_CONSTRUCTOR) { | 2294 push(new HInvokeSuper(selector, inputs)); |
| 2295 } else if (element.kind == ElementKind.FUNCTION || |
| 2296 element.kind == ElementKind.GENERATIVE_CONSTRUCTOR) { |
| 2295 bool succeeded = addStaticSendArgumentsToList(selector, node.arguments, | 2297 bool succeeded = addStaticSendArgumentsToList(selector, node.arguments, |
| 2296 element, inputs); | 2298 element, inputs); |
| 2297 if (!succeeded) { | 2299 if (!succeeded) { |
| 2298 // TODO(ngeoffray): Match the VM behavior and throw an | 2300 // TODO(ngeoffray): Match the VM behavior and throw an |
| 2299 // exception at runtime. | 2301 // exception at runtime. |
| 2300 compiler.cancel('Unimplemented non-matching static call', node); | 2302 compiler.cancel('Unimplemented non-matching static call', node); |
| 2301 } | 2303 } |
| 2302 push(new HInvokeSuper(selector, inputs)); | 2304 push(new HInvokeSuper(selector, inputs)); |
| 2303 } else { | 2305 } else { |
| 2304 target = new HInvokeSuper(Selector.GETTER, inputs); | 2306 target = new HInvokeSuper(Selector.GETTER, inputs); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2391 add(target); | 2393 add(target); |
| 2392 inputs = <HInstruction>[target]; | 2394 inputs = <HInstruction>[target]; |
| 2393 } | 2395 } |
| 2394 addDynamicSendArgumentsToList(node, inputs); | 2396 addDynamicSendArgumentsToList(node, inputs); |
| 2395 push(new HInvokeClosure(selector, inputs)); | 2397 push(new HInvokeClosure(selector, inputs)); |
| 2396 } | 2398 } |
| 2397 } | 2399 } |
| 2398 | 2400 |
| 2399 visitSend(Send node) { | 2401 visitSend(Send node) { |
| 2400 if (node.isSuperCall) { | 2402 if (node.isSuperCall) { |
| 2401 if (node.isPropertyAccess) { | |
| 2402 compiler.unimplemented('super property read', node: node); | |
| 2403 } | |
| 2404 visitSuperSend(node); | 2403 visitSuperSend(node); |
| 2405 } else if (node.isOperator && methodInterceptionEnabled) { | 2404 } else if (node.isOperator && methodInterceptionEnabled) { |
| 2406 visitOperatorSend(node); | 2405 visitOperatorSend(node); |
| 2407 } else if (node.isPropertyAccess) { | 2406 } else if (node.isPropertyAccess) { |
| 2408 generateGetter(node, elements[node]); | 2407 generateGetter(node, elements[node]); |
| 2409 } else if (Elements.isClosureSend(node, elements)) { | 2408 } else if (Elements.isClosureSend(node, elements)) { |
| 2410 visitClosureSend(node); | 2409 visitClosureSend(node); |
| 2411 } else { | 2410 } else { |
| 2412 Element element = elements[node]; | 2411 Element element = elements[node]; |
| 2413 if (element === null) { | 2412 if (element === null) { |
| (...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3403 <HInstruction>[target, input], | 3402 <HInstruction>[target, input], |
| 3404 HType.STRING)); | 3403 HType.STRING)); |
| 3405 return builder.pop(); | 3404 return builder.pop(); |
| 3406 } | 3405 } |
| 3407 | 3406 |
| 3408 HInstruction result(Node node) { | 3407 HInstruction result(Node node) { |
| 3409 flushLiterals(node); | 3408 flushLiterals(node); |
| 3410 return prefix; | 3409 return prefix; |
| 3411 } | 3410 } |
| 3412 } | 3411 } |
| OLD | NEW |