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

Unified Diff: src/codegen-ia32.cc

Issue 42009: Fix issue 267: Functions now called with global object as receiver. (Closed)
Patch Set: Now with regression test Created 11 years, 9 months 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
« no previous file with comments | « src/codegen-arm.cc ('k') | src/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codegen-ia32.cc
diff --git a/src/codegen-ia32.cc b/src/codegen-ia32.cc
index b5e00eb2ff22399f5932457b3afa174be9bd17fa..5253d53023b91f1dafa9b64fa8ce703872a3d38a 100644
--- a/src/codegen-ia32.cc
+++ b/src/codegen-ia32.cc
@@ -3912,9 +3912,14 @@ void CodeGenerator::VisitCall(Call* node) {
ref.GetValue(NOT_INSIDE_TYPEOF);
// Pass receiver to called function.
- // The reference's size is non-negative.
- frame_->SpillAll();
- frame_->EmitPush(frame_->ElementAt(ref.size()));
+ if (property->is_synthetic()) {
+ // Use global object as receiver.
+ LoadGlobalReceiver();
+ } else {
+ // The reference's size is non-negative.
+ frame_->SpillAll();
Kevin Millikin (Chromium) 2009/03/10 12:10:10 I know it's not your code, but you could try getti
Lasse Reichstein 2009/03/10 12:21:08 Done.
+ frame_->EmitPush(frame_->ElementAt(ref.size()));
+ }
// Call the function.
CallWithArguments(args, node->position());
« no previous file with comments | « src/codegen-arm.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698