Reviewers: Mads Ager, Description: Experimental: fix a frame-height issue with eval on ARM.
Please review this at http://codereview.chromium.org/20533 SVN Base: http://v8.googlecode.com/svn/branches/experimental/toiger/ Affected files: M src/codegen-arm.cc Index: src/codegen-arm.cc =================================================================== --- src/codegen-arm.cc (revision 1325) +++ src/codegen-arm.cc (working copy) @@ -2832,35 +2832,36 @@ // Prepare stack for call to resolved function. LoadAndSpill(function); __ mov(r2, Operand(Factory::undefined_value())); - __ push(r2); // Slot for receiver - for (int i = 0; i < args->length(); i++) { + frame_->EmitPush(r2); // Slot for receiver + int arg_count = args->length(); + for (int i = 0; i < arg_count; i++) { LoadAndSpill(args->at(i)); } // Prepare stack for call to ResolvePossiblyDirectEval. - __ ldr(r1, MemOperand(sp, args->length() * kPointerSize + kPointerSize)); - __ push(r1); - if (args->length() > 0) { - __ ldr(r1, MemOperand(sp, args->length() * kPointerSize)); - __ push(r1); + __ ldr(r1, MemOperand(sp, arg_count * kPointerSize + kPointerSize)); + frame_->EmitPush(r1); + if (arg_count > 0) { + __ ldr(r1, MemOperand(sp, arg_count * kPointerSize)); + frame_->EmitPush(r1); } else { - __ push(r2); + frame_->EmitPush(r2); } // Resolve the call. - __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 2); + frame_->CallRuntime(Runtime::kResolvePossiblyDirectEval, 2); // Touch up stack with the right values for the function and the receiver. __ ldr(r1, FieldMemOperand(r0, FixedArray::kHeaderSize)); - __ str(r1, MemOperand(sp, (args->length() + 1) * kPointerSize)); + __ str(r1, MemOperand(sp, (arg_count + 1) * kPointerSize)); __ ldr(r1, FieldMemOperand(r0, FixedArray::kHeaderSize + kPointerSize)); - __ str(r1, MemOperand(sp, args->length() * kPointerSize)); + __ str(r1, MemOperand(sp, arg_count * kPointerSize)); // Call the function. CodeForSourcePosition(node->position()); - CallFunctionStub call_function(args->length()); - __ CallStub(&call_function); + CallFunctionStub call_function(arg_count); + frame_->CallStub(&call_function, arg_count + 1); __ ldr(cp, frame_->Context()); // Remove the function from the stack. --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
