Index: src/arm/full-codegen-arm.cc |
=================================================================== |
--- src/arm/full-codegen-arm.cc (revision 5833) |
+++ src/arm/full-codegen-arm.cc (working copy) |
@@ -1710,6 +1710,15 @@ |
void FullCodeGenerator::EmitKeyedCallWithIC(Call* expr, |
Expression* key, |
RelocInfo::Mode mode) { |
+ // Load the key. |
+ VisitForAccumulatorValue(key); |
+ |
+ // Swap the name of the function and the receiver on the stack to follow |
+ // the calling convention for call ICs. |
+ __ pop(r1); |
+ __ push(r0); |
+ __ push(r1); |
+ |
// Code common for calls using the IC. |
ZoneList<Expression*>* args = expr->arguments(); |
int arg_count = args->length(); |
@@ -1717,18 +1726,17 @@ |
for (int i = 0; i < arg_count; i++) { |
VisitForStackValue(args->at(i)); |
} |
- VisitForAccumulatorValue(key); |
- __ mov(r2, r0); |
} |
// Record source position for debugger. |
SetSourcePosition(expr->position(), FORCED_POSITION); |
// Call the IC initialization code. |
InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP; |
Handle<Code> ic = StubCache::ComputeKeyedCallInitialize(arg_count, in_loop); |
+ __ ldr(r2, MemOperand(sp, (arg_count + 1) * kPointerSize)); // Key. |
EmitCallIC(ic, mode); |
// Restore context register. |
__ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
- context()->Plug(r0); |
+ context()->DropAndPlug(1, r0); // Drop the key still on the stack. |
} |