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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/optimize.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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (revision 16030)
+++ sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (working copy)
@@ -206,8 +206,7 @@
return node;
}
- HInstruction handleInterceptorCall(HInvokeDynamic node) {
- if (node is !HInvokeDynamicMethod) return null;
+ HInstruction handleInterceptorCall(HInvokeDynamicMethod node) {
HInstruction input = node.inputs[1];
if (input.isString(types)
&& node.selector.name == const SourceString('toString')) {
@@ -229,6 +228,11 @@
}
Selector selector = node.selector;
+
+ if (node.isIndexOperatorOnIndexablePrimitive(types)) {
+ return new HIndex(node.inputs[1], node.inputs[2]);
+ }
+
SourceString selectorName = selector.name;
Element target;
if (input.isExtendableArray(types)) {
@@ -277,7 +281,7 @@
return node;
}
- HInstruction visitInvokeDynamic(HInvokeDynamic node) {
+ HInstruction visitInvokeDynamicMethod(HInvokeDynamicMethod node) {
if (node.isInterceptorCall) return handleInterceptorCall(node);
HType receiverType = types[node.receiver];
if (receiverType.isExact()) {
@@ -304,7 +308,7 @@
* [HInvokeDynamic] because we know the receiver is not a JS
* primitive object.
*/
- HInstruction fromPrimitiveInstructionToDynamicInvocation(HInvokeStatic node,
+ HInstruction fromPrimitiveInstructionToDynamicInvocation(HInstruction node,
Selector selector) {
HBoundedType type = types[node.inputs[1]];
HInvokeDynamicMethod result = new HInvokeDynamicMethod(
@@ -331,15 +335,6 @@
return node;
}
-
- HInstruction visitIndex(HIndex node) {
- if (!node.receiver.canBePrimitive(types)) {
- Selector selector = new Selector.index();
- return fromPrimitiveInstructionToDynamicInvocation(node, selector);
- }
- return node;
- }
-
HInstruction visitIndexAssign(HIndexAssign node) {
if (!node.receiver.canBePrimitive(types)) {
Selector selector = new Selector.indexSet();
@@ -803,7 +798,6 @@
}
void visitIndex(HIndex node) {
- if (!node.receiver.isIndexablePrimitive(types)) return;
if (boundsChecked.contains(node)) return;
HInstruction index = node.index;
if (!node.index.isInteger(types)) {
@@ -811,7 +805,6 @@
}
index = insertBoundsCheck(node, node.receiver, index);
node.changeUse(node.index, index);
- assert(node.isBuiltin(types));
}
void visitIndexAssign(HIndexAssign node) {
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/nodes.dart ('k') | sdk/lib/_internal/compiler/implementation/ssa/tracer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698