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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart

Issue 11348316: Move the handling of operator[] into the new interceptors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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 part of ssa; 5 part of ssa;
6 6
7 class SsaCodeGeneratorTask extends CompilerTask { 7 class SsaCodeGeneratorTask extends CompilerTask {
8 8
9 final JavaScriptBackend backend; 9 final JavaScriptBackend backend;
10 10
(...skipping 2132 matching lines...) Expand 10 before | Expand all | Expand 10 after
2143 int len = node.inputs.length; 2143 int len = node.inputs.length;
2144 List<js.ArrayElement> elements = <js.ArrayElement>[]; 2144 List<js.ArrayElement> elements = <js.ArrayElement>[];
2145 for (int i = 0; i < len; i++) { 2145 for (int i = 0; i < len; i++) {
2146 use(node.inputs[i]); 2146 use(node.inputs[i]);
2147 elements.add(new js.ArrayElement(i, pop())); 2147 elements.add(new js.ArrayElement(i, pop()));
2148 } 2148 }
2149 push(new js.ArrayInitializer(len, elements), node); 2149 push(new js.ArrayInitializer(len, elements), node);
2150 } 2150 }
2151 2151
2152 void visitIndex(HIndex node) { 2152 void visitIndex(HIndex node) {
2153 if (node.isBuiltin(types)) { 2153 use(node.receiver);
2154 use(node.inputs[1]); 2154 js.Expression receiver = pop();
2155 js.Expression receiver = pop(); 2155 use(node.index);
2156 use(node.inputs[2]); 2156 push(new js.PropertyAccess(receiver, pop()), node);
2157 push(new js.PropertyAccess(receiver, pop()), node);
2158 } else {
2159 visitInvokeStatic(node);
2160 }
2161 } 2157 }
2162 2158
2163 void visitIndexAssign(HIndexAssign node) { 2159 void visitIndexAssign(HIndexAssign node) {
2164 if (node.isBuiltin(types)) { 2160 if (node.isBuiltin(types)) {
2165 use(node.inputs[1]); 2161 use(node.inputs[1]);
2166 js.Expression receiver = pop(); 2162 js.Expression receiver = pop();
2167 use(node.inputs[2]); 2163 use(node.inputs[2]);
2168 js.Expression index = pop(); 2164 js.Expression index = pop();
2169 use(node.inputs[3]); 2165 use(node.inputs[3]);
2170 push(new js.Assignment(new js.PropertyAccess(receiver, index), pop()), 2166 push(new js.Assignment(new js.PropertyAccess(receiver, index), pop()),
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after
3030 if (leftType.canBeNull() && rightType.canBeNull()) { 3026 if (leftType.canBeNull() && rightType.canBeNull()) {
3031 if (left.isConstantNull() || right.isConstantNull() || 3027 if (left.isConstantNull() || right.isConstantNull() ||
3032 (leftType.isPrimitive() && leftType == rightType)) { 3028 (leftType.isPrimitive() && leftType == rightType)) {
3033 return '=='; 3029 return '==';
3034 } 3030 }
3035 return null; 3031 return null;
3036 } else { 3032 } else {
3037 return '==='; 3033 return '===';
3038 } 3034 }
3039 } 3035 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698