Reviewers: Kevin Millikin,
Description:
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.
Please review this at http://codereview.chromium.org/542053
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/
Affected files:
M src/arm/fast-codegen-arm.cc
M src/ia32/fast-codegen-ia32.cc
M src/x64/fast-codegen-x64.cc
Index: src/ia32/fast-codegen-ia32.cc
===================================================================
--- src/ia32/fast-codegen-ia32.cc (revision 3594)
+++ src/ia32/fast-codegen-ia32.cc (working copy)
@@ -1111,7 +1111,8 @@
__ 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);
}
Index: src/x64/fast-codegen-x64.cc
===================================================================
--- src/x64/fast-codegen-x64.cc (revision 3594)
+++ src/x64/fast-codegen-x64.cc (working copy)
@@ -1128,7 +1128,8 @@
__ 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);
}
Index: src/arm/fast-codegen-arm.cc
===================================================================
--- src/arm/fast-codegen-arm.cc (revision 3594)
+++ src/arm/fast-codegen-arm.cc (working copy)
@@ -1129,6 +1129,7 @@
// 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));
}
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev