Merge revision 7879 to trunk.
Review URL: http://codereview.chromium.org/7015038

git-svn-id: http://v8.googlecode.com/svn/trunk@7881 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc
index e45ef3e..57cde65 100644
--- a/src/x64/builtins-x64.cc
+++ b/src/x64/builtins-x64.cc
@@ -660,12 +660,9 @@
 
     // Do not transform the receiver for natives.
     // SharedFunctionInfo is already loaded into rbx.
-    __ movq(rbx, FieldOperand(rbx, SharedFunctionInfo::kScriptOffset));
-    __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex);
-    __ j(equal, &shift_arguments);
-    __ SmiCompare(FieldOperand(rbx, Script::kTypeOffset),
-               Smi::FromInt(Script::TYPE_NATIVE));
-    __ j(equal, &shift_arguments);
+    __ testb(FieldOperand(rbx, SharedFunctionInfo::kES5NativeByteOffset),
+             Immediate(1 << SharedFunctionInfo::kES5NativeBitWithinByte));
+    __ j(not_zero, &shift_arguments);
 
     // Compute the receiver in non-strict mode.
     __ movq(rbx, Operand(rsp, rax, times_pointer_size, 0));
@@ -832,13 +829,9 @@
   __ j(not_equal, &push_receiver);
 
   // Do not transform the receiver for natives.
-  // SharedFunctionInfo is already loaded into rdx.
-  __ movq(rdx, FieldOperand(rdx, SharedFunctionInfo::kScriptOffset));
-  __ CompareRoot(rdx, Heap::kUndefinedValueRootIndex);
-  __ j(equal, &push_receiver);
-  __ SmiCompare(FieldOperand(rdx, Script::kTypeOffset),
-             Smi::FromInt(Script::TYPE_NATIVE));
-  __ j(equal, &push_receiver);
+  __ testb(FieldOperand(rdx, SharedFunctionInfo::kES5NativeByteOffset),
+           Immediate(1 << SharedFunctionInfo::kES5NativeBitWithinByte));
+  __ j(not_zero, &push_receiver);
 
   // Compute the receiver in non-strict mode.
   __ JumpIfSmi(rbx, &call_to_object);