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

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

Issue 6960009: Version 3.3.5 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 9 years, 7 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/hydrogen-instructions.cc ('k') | src/ia32/code-stubs-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/builtins-ia32.cc
diff --git a/src/ia32/builtins-ia32.cc b/src/ia32/builtins-ia32.cc
index 29c67b598464fab3c903ff477446ce3c73381d7f..0906897464cda6a4cfd3eaf81cafd56ab93c5489 100644
--- a/src/ia32/builtins-ia32.cc
+++ b/src/ia32/builtins-ia32.cc
@@ -599,6 +599,15 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
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 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
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/hydrogen-instructions.cc ('k') | src/ia32/code-stubs-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698