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

Unified Diff: src/ia32/builtins-ia32.cc

Issue 6902104: Don't exchange null and undefined with the global object in function.prototype.{call, apply} for ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 8 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/date.js ('k') | src/messages.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/builtins-ia32.cc
===================================================================
--- src/ia32/builtins-ia32.cc (revision 7676)
+++ src/ia32/builtins-ia32.cc (working copy)
@@ -599,6 +599,15 @@
1 << SharedFunctionInfo::kStrictModeBitWithinByte);
__ j(not_equal, &shift_arguments);
+ // Do not transform the receiver for natives (shared already in ebx).
+ __ mov(ebx, FieldOperand(ebx, SharedFunctionInfo::kScriptOffset));
+ __ cmp(ebx, factory->undefined_value());
+ __ j(equal, &shift_arguments);
+ __ mov(ebx, FieldOperand(ebx, Script::kTypeOffset));
+ __ SmiUntag(ebx);
+ __ cmp(ebx, Script::TYPE_NATIVE);
+ __ j(equal, &shift_arguments);
+
// Compute the receiver in non-strict mode.
__ mov(ebx, Operand(esp, eax, times_4, 0)); // First argument.
__ test(ebx, Immediate(kSmiTagMask));
@@ -755,10 +764,20 @@
1 << SharedFunctionInfo::kStrictModeBitWithinByte);
__ j(not_equal, &push_receiver);
+ Factory* factory = masm->isolate()->factory();
+
+ // Do not transform the receiver for natives (shared already in ecx).
+ __ mov(ecx, FieldOperand(ecx, SharedFunctionInfo::kScriptOffset));
+ __ cmp(ecx, factory->undefined_value());
+ __ j(equal, &push_receiver);
+ __ mov(ecx, FieldOperand(ecx, Script::kTypeOffset));
+ __ SmiUntag(ecx);
+ __ cmp(ecx, Script::TYPE_NATIVE);
+ __ j(equal, &push_receiver);
+
// Compute the receiver in non-strict mode.
__ test(ebx, Immediate(kSmiTagMask));
__ j(zero, &call_to_object);
- Factory* factory = masm->isolate()->factory();
__ cmp(ebx, factory->null_value());
__ j(equal, &use_global_receiver);
__ cmp(ebx, factory->undefined_value());
« no previous file with comments | « src/date.js ('k') | src/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698