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