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

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: Address comments. 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 2150 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
« no previous file with comments | « frog/tests/leg/src/TypeInference5Test.dart ('k') | lib/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698