| 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 2150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2161 if (!succeeded) { | 2161 if (!succeeded) { |
| 2162 // TODO(ngeoffray): Match the VM behavior and throw an | 2162 // TODO(ngeoffray): Match the VM behavior and throw an |
| 2163 // exception at runtime. | 2163 // exception at runtime. |
| 2164 compiler.cancel('Unimplemented non-matching static call', node: node); | 2164 compiler.cancel('Unimplemented non-matching static call', node: node); |
| 2165 } | 2165 } |
| 2166 HType type = HType.UNKNOWN; | 2166 HType type = HType.UNKNOWN; |
| 2167 Element originalElement = elements[node]; | 2167 Element originalElement = elements[node]; |
| 2168 if (originalElement.isGenerativeConstructor() | 2168 if (originalElement.isGenerativeConstructor() |
| 2169 && originalElement.enclosingElement === compiler.listClass) { | 2169 && originalElement.enclosingElement === compiler.listClass) { |
| 2170 if (node.arguments.isEmpty()) { | 2170 if (node.arguments.isEmpty()) { |
| 2171 type = HType.EXTENDABLE_ARRAY; |
| 2172 } else { |
| 2171 type = HType.MUTABLE_ARRAY; | 2173 type = HType.MUTABLE_ARRAY; |
| 2172 } else { | |
| 2173 type = HType.READABLE_ARRAY; | |
| 2174 } | 2174 } |
| 2175 } else if (element.isGenerativeConstructor()) { | 2175 } else if (element.isGenerativeConstructor()) { |
| 2176 ClassElement cls = element.enclosingElement; | 2176 ClassElement cls = element.enclosingElement; |
| 2177 type = new HNonPrimitiveType(cls.type); | 2177 type = new HNonPrimitiveType(cls.type); |
| 2178 } | 2178 } |
| 2179 push(new HInvokeStatic(selector, inputs, type)); | 2179 push(new HInvokeStatic(selector, inputs, type)); |
| 2180 } else { | 2180 } else { |
| 2181 if (element.kind == ElementKind.GETTER) { | 2181 if (element.kind == ElementKind.GETTER) { |
| 2182 target = new HInvokeStatic(Selector.GETTER, inputs); | 2182 target = new HInvokeStatic(Selector.GETTER, inputs); |
| 2183 add(target); | 2183 add(target); |
| (...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3123 false, | 3123 false, |
| 3124 <HInstruction>[target, input])); | 3124 <HInstruction>[target, input])); |
| 3125 return builder.pop(); | 3125 return builder.pop(); |
| 3126 } | 3126 } |
| 3127 | 3127 |
| 3128 HInstruction result() { | 3128 HInstruction result() { |
| 3129 flushLiterals(); | 3129 flushLiterals(); |
| 3130 return prefix; | 3130 return prefix; |
| 3131 } | 3131 } |
| 3132 } | 3132 } |
| OLD | NEW |