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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/builder.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/builder.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/builder.dart (revision 16030)
+++ sdk/lib/_internal/compiler/implementation/ssa/builder.dart (working copy)
@@ -2702,13 +2702,7 @@
Operator op = node.selector;
if (const SourceString("[]") == op.source) {
- HStatic target = new HStatic(interceptors.getIndexInterceptor());
- add(target);
- visit(node.receiver);
- HInstruction receiver = pop();
- visit(node.argumentsNode);
- HInstruction index = pop();
- push(new HIndex(target, receiver, index));
+ visitDynamicSend(node);
} else if (const SourceString("&&") == op.source ||
const SourceString("||") == op.source) {
visitLogicalAndOr(node, op);
@@ -3592,6 +3586,19 @@
}
}
+ HInvokeDynamicMethod buildInvokeDynamicWithOneArgument(
+ Node node, Selector selector, HInstruction receiver, HInstruction arg0) {
+ Set<ClassElement> interceptedClasses =
+ getInterceptedClassesOn(node, selector);
+ List<HInstruction> inputs = <HInstruction>[];
+ if (interceptedClasses != null) {
+ inputs.add(invokeInterceptor(interceptedClasses, receiver, node));
+ }
+ inputs.add(receiver);
+ inputs.add(arg0);
+ return new HInvokeDynamicMethod(selector, inputs);
+ }
+
visitSendSet(SendSet node) {
Element element = elements[node];
if (!Elements.isUnresolved(element) && element.impliesType()) {
@@ -3643,9 +3650,9 @@
index = pop();
value = graph.addConstantInt(1, constantSystem);
}
- HStatic indexMethod = new HStatic(interceptors.getIndexInterceptor());
- add(indexMethod);
- HInstruction left = new HIndex(indexMethod, receiver, index);
+
+ HInvokeDynamicMethod left = buildInvokeDynamicWithOneArgument(
+ node, new Selector.index(), receiver, index);
add(left);
Element opElement = elements[op];
visitBinary(left, op, value);
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/bailout.dart ('k') | sdk/lib/_internal/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698