Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: lib/compiler/implementation/ssa/builder.dart

Issue 10139012: Refactor types in ssa nodes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More fixes. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 2149 matching lines...) Expand 10 before | Expand all | Expand 10 after
2160 if (!succeeded) { 2160 if (!succeeded) {
2161 // TODO(ngeoffray): Match the VM behavior and throw an 2161 // TODO(ngeoffray): Match the VM behavior and throw an
2162 // exception at runtime. 2162 // exception at runtime.
2163 compiler.cancel('Unimplemented non-matching static call', node: node); 2163 compiler.cancel('Unimplemented non-matching static call', node: node);
2164 } 2164 }
2165 HType type = HType.UNKNOWN; 2165 HType type = HType.UNKNOWN;
2166 Element originalElement = elements[node]; 2166 Element originalElement = elements[node];
2167 if (originalElement.isGenerativeConstructor() 2167 if (originalElement.isGenerativeConstructor()
2168 && originalElement.enclosingElement === compiler.listClass) { 2168 && originalElement.enclosingElement === compiler.listClass) {
2169 if (node.arguments.isEmpty()) { 2169 if (node.arguments.isEmpty()) {
2170 type = HType.EXTENDABLE_ARRAY;
2171 } else {
2170 type = HType.MUTABLE_ARRAY; 2172 type = HType.MUTABLE_ARRAY;
2171 } else {
2172 type = HType.READABLE_ARRAY;
2173 } 2173 }
2174 } else if (element.isGenerativeConstructor()) { 2174 } else if (element.isGenerativeConstructor()) {
2175 ClassElement cls = element.enclosingElement; 2175 ClassElement cls = element.enclosingElement;
2176 type = new HNonPrimitiveType(cls.type); 2176 type = new HNonPrimitiveType(cls.type);
2177 } 2177 }
2178 push(new HInvokeStatic(selector, inputs, type)); 2178 push(new HInvokeStatic(selector, inputs, type));
2179 } else { 2179 } else {
2180 if (element.kind == ElementKind.GETTER) { 2180 if (element.kind == ElementKind.GETTER) {
2181 target = new HInvokeStatic(Selector.GETTER, inputs); 2181 target = new HInvokeStatic(Selector.GETTER, inputs);
2182 add(target); 2182 add(target);
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698