| 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) {
|
|
|