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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/codegen-arm.cc ('k') | src/scopes.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3894 matching lines...) Expand 10 before | Expand all | Expand 10 after
3905 } else { 3905 } else {
3906 // ------------------------------------------- 3906 // -------------------------------------------
3907 // JavaScript example: 'array[index](1, 2, 3)' 3907 // JavaScript example: 'array[index](1, 2, 3)'
3908 // ------------------------------------------- 3908 // -------------------------------------------
3909 3909
3910 // Load the function to call from the property through a reference. 3910 // Load the function to call from the property through a reference.
3911 Reference ref(this, property); 3911 Reference ref(this, property);
3912 ref.GetValue(NOT_INSIDE_TYPEOF); 3912 ref.GetValue(NOT_INSIDE_TYPEOF);
3913 3913
3914 // Pass receiver to called function. 3914 // Pass receiver to called function.
3915 // The reference's size is non-negative. 3915 if (property->is_synthetic()) {
3916 frame_->SpillAll(); 3916 // Use global object as receiver.
3917 frame_->EmitPush(frame_->ElementAt(ref.size())); 3917 LoadGlobalReceiver();
3918 } else {
3919 // The reference's size is non-negative.
3920 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.
3921 frame_->EmitPush(frame_->ElementAt(ref.size()));
3922 }
3918 3923
3919 // Call the function. 3924 // Call the function.
3920 CallWithArguments(args, node->position()); 3925 CallWithArguments(args, node->position());
3921 } 3926 }
3922 3927
3923 } else { 3928 } else {
3924 // ---------------------------------- 3929 // ----------------------------------
3925 // JavaScript example: 'foo(1, 2, 3)' // foo is not global 3930 // JavaScript example: 'foo(1, 2, 3)' // foo is not global
3926 // ---------------------------------- 3931 // ----------------------------------
3927 3932
(...skipping 3008 matching lines...) Expand 10 before | Expand all | Expand 10 after
6936 6941
6937 // Slow-case: Go through the JavaScript implementation. 6942 // Slow-case: Go through the JavaScript implementation.
6938 __ bind(&slow); 6943 __ bind(&slow);
6939 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); 6944 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION);
6940 } 6945 }
6941 6946
6942 6947
6943 #undef __ 6948 #undef __
6944 6949
6945 } } // namespace v8::internal 6950 } } // namespace v8::internal
OLDNEW
« 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