Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index c08e38b50992bbc1a2fbae027654f08cda603c2c..63b1b8fcc86f2bd706972ab809aa9d65a89df0d7 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -922,35 +922,35 @@ void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { |
// rax = address of new object(s) (tagged) |
// rcx = argument count (untagged) |
- // Get the arguments boilerplate from the current native context into rdi. |
- Label has_mapped_parameters, copy; |
+ // Get the arguments map from the current native context into rdi. |
+ Label has_mapped_parameters, instantiate; |
__ movp(rdi, Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
__ movp(rdi, FieldOperand(rdi, GlobalObject::kNativeContextOffset)); |
__ testp(rbx, rbx); |
__ j(not_zero, &has_mapped_parameters, Label::kNear); |
- const int kIndex = Context::SLOPPY_ARGUMENTS_BOILERPLATE_INDEX; |
+ const int kIndex = Context::SLOPPY_ARGUMENTS_MAP_INDEX; |
__ movp(rdi, Operand(rdi, Context::SlotOffset(kIndex))); |
- __ jmp(©, Label::kNear); |
+ __ jmp(&instantiate, Label::kNear); |
- const int kAliasedIndex = Context::ALIASED_ARGUMENTS_BOILERPLATE_INDEX; |
+ const int kAliasedIndex = Context::ALIASED_ARGUMENTS_MAP_INDEX; |
__ bind(&has_mapped_parameters); |
__ movp(rdi, Operand(rdi, Context::SlotOffset(kAliasedIndex))); |
- __ bind(©); |
+ __ bind(&instantiate); |
// rax = address of new object (tagged) |
// rbx = mapped parameter count (untagged) |
// rcx = argument count (untagged) |
- // rdi = address of boilerplate object (tagged) |
- // Copy the JS object part. |
- for (int i = 0; i < JSObject::kHeaderSize; i += kPointerSize) { |
- __ movp(rdx, FieldOperand(rdi, i)); |
- __ movp(FieldOperand(rax, i), rdx); |
- } |
+ // rdi = address of arguments map (tagged) |
+ __ movp(FieldOperand(rax, JSObject::kMapOffset), rdi); |
+ __ LoadRoot(kScratchRegister, Heap::kEmptyFixedArrayRootIndex); |
+ __ movp(FieldOperand(rax, JSObject::kPropertiesOffset), kScratchRegister); |
+ __ movp(FieldOperand(rax, JSObject::kElementsOffset), kScratchRegister); |
// Set up the callee in-object property. |
STATIC_ASSERT(Heap::kArgumentsCalleeIndex == 1); |
__ movp(rdx, args.GetArgumentOperand(0)); |
+ __ AssertNotSmi(rdx); |
__ movp(FieldOperand(rax, JSObject::kHeaderSize + |
Heap::kArgumentsCalleeIndex * kPointerSize), |
rdx); |
@@ -1140,18 +1140,16 @@ void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) { |
// Do the allocation of both objects in one go. |
__ Allocate(rcx, rax, rdx, rbx, &runtime, TAG_OBJECT); |
- // Get the arguments boilerplate from the current native context. |
+ // Get the arguments map from the current native context. |
__ movp(rdi, Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
__ movp(rdi, FieldOperand(rdi, GlobalObject::kNativeContextOffset)); |
- const int offset = |
- Context::SlotOffset(Context::STRICT_ARGUMENTS_BOILERPLATE_INDEX); |
+ const int offset = Context::SlotOffset(Context::STRICT_ARGUMENTS_MAP_INDEX); |
__ movp(rdi, Operand(rdi, offset)); |
- // Copy the JS object part. |
- for (int i = 0; i < JSObject::kHeaderSize; i += kPointerSize) { |
- __ movp(rbx, FieldOperand(rdi, i)); |
- __ movp(FieldOperand(rax, i), rbx); |
- } |
+ __ movp(FieldOperand(rax, JSObject::kMapOffset), rdi); |
+ __ LoadRoot(kScratchRegister, Heap::kEmptyFixedArrayRootIndex); |
+ __ movp(FieldOperand(rax, JSObject::kPropertiesOffset), kScratchRegister); |
+ __ movp(FieldOperand(rax, JSObject::kElementsOffset), kScratchRegister); |
// Get the length (smi tagged) and set that as an in-object property too. |
STATIC_ASSERT(Heap::kArgumentsLengthIndex == 0); |