Fix bug in top-level code generator with global receiver.

We did not correcty pass the global receiver object in some cases. 
This change fixes this bug on all three platforms.

Review URL: http://codereview.chromium.org/542053

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3596 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 19e49e17
......@@ -1129,6 +1129,7 @@ void FastCodeGenerator::VisitCall(Call* expr) {
// Load receiver object into r1.
if (prop->is_synthetic()) {
__ ldr(r1, CodeGenerator::GlobalObject());
__ ldr(r1, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset));
} else {
__ ldr(r1, MemOperand(sp, kPointerSize));
}
......
......@@ -1111,7 +1111,8 @@ void FastCodeGenerator::VisitCall(Call* expr) {
__ push(eax);
// Push receiver object on stack.
if (prop->is_synthetic()) {
__ push(CodeGenerator::GlobalObject());
__ mov(ecx, CodeGenerator::GlobalObject());
__ push(FieldOperand(ecx, GlobalObject::kGlobalReceiverOffset));
} else {
__ push(ebx);
}
......
......@@ -1128,7 +1128,8 @@ void FastCodeGenerator::VisitCall(Call* expr) {
__ push(rax);
// Push receiver object on stack.
if (prop->is_synthetic()) {
__ push(CodeGenerator::GlobalObject());
__ movq(rcx, CodeGenerator::GlobalObject());
__ push(FieldOperand(rcx, GlobalObject::kGlobalReceiverOffset));
} else {
__ push(rbx);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment