| 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 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2148 element, inputs); | 2148 element, inputs); |
| 2149 if (!succeeded) { | 2149 if (!succeeded) { |
| 2150 // TODO(ngeoffray): Match the VM behavior and throw an | 2150 // TODO(ngeoffray): Match the VM behavior and throw an |
| 2151 // exception at runtime. | 2151 // exception at runtime. |
| 2152 compiler.cancel('Unimplemented non-matching static call', node: node); | 2152 compiler.cancel('Unimplemented non-matching static call', node: node); |
| 2153 } | 2153 } |
| 2154 HType type = HType.UNKNOWN; | 2154 HType type = HType.UNKNOWN; |
| 2155 Element originalElement = elements[node]; | 2155 Element originalElement = elements[node]; |
| 2156 if (originalElement.isGenerativeConstructor() | 2156 if (originalElement.isGenerativeConstructor() |
| 2157 && originalElement.enclosingElement === compiler.listClass) { | 2157 && originalElement.enclosingElement === compiler.listClass) { |
| 2158 type = HType.MUTABLE_ARRAY; | 2158 if (node.arguments.isEmpty()) { |
| 2159 type = HType.MUTABLE_ARRAY; |
| 2160 } else { |
| 2161 type = HType.READABLE_ARRAY; |
| 2162 } |
| 2159 } else if (element.isGenerativeConstructor()) { | 2163 } else if (element.isGenerativeConstructor()) { |
| 2160 ClassElement cls = element.enclosingElement; | 2164 ClassElement cls = element.enclosingElement; |
| 2161 type = new HNonPrimitiveType(cls.type); | 2165 type = new HNonPrimitiveType(cls.type); |
| 2162 } | 2166 } |
| 2163 push(new HInvokeStatic(selector, inputs, type)); | 2167 push(new HInvokeStatic(selector, inputs, type)); |
| 2164 } else { | 2168 } else { |
| 2165 if (element.kind == ElementKind.GETTER) { | 2169 if (element.kind == ElementKind.GETTER) { |
| 2166 target = new HInvokeStatic(Selector.GETTER, inputs); | 2170 target = new HInvokeStatic(Selector.GETTER, inputs); |
| 2167 add(target); | 2171 add(target); |
| 2168 inputs = <HInstruction>[target]; | 2172 inputs = <HInstruction>[target]; |
| (...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3108 false, | 3112 false, |
| 3109 <HInstruction>[target, input])); | 3113 <HInstruction>[target, input])); |
| 3110 return builder.pop(); | 3114 return builder.pop(); |
| 3111 } | 3115 } |
| 3112 | 3116 |
| 3113 HInstruction result() { | 3117 HInstruction result() { |
| 3114 flushLiterals(); | 3118 flushLiterals(); |
| 3115 return prefix; | 3119 return prefix; |
| 3116 } | 3120 } |
| 3117 } | 3121 } |
| OLD | NEW |