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

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

Issue 7012012: Only send null or undefined as receiver for es5 natives, not generally (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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/heap.cc ('k') | src/objects.h » ('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 7878)
+++ src/ia32/builtins-ia32.cc (working copy)
@@ -600,13 +600,9 @@
__ 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);
+ __ test_b(FieldOperand(ebx, SharedFunctionInfo::kES5NativeByteOffset),
+ 1 << SharedFunctionInfo::kES5NativeBitWithinByte);
+ __ j(not_equal, &shift_arguments);
// Compute the receiver in non-strict mode.
__ mov(ebx, Operand(esp, eax, times_4, 0)); // First argument.
@@ -767,13 +763,9 @@
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);
+ __ test_b(FieldOperand(ecx, SharedFunctionInfo::kES5NativeByteOffset),
+ 1 << SharedFunctionInfo::kES5NativeBitWithinByte);
+ __ j(not_equal, &push_receiver);
// Compute the receiver in non-strict mode.
__ test(ebx, Immediate(kSmiTagMask));
« no previous file with comments | « src/heap.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698