| Index: src/x64/code-stubs-x64.cc
|
| diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
|
| index 731cb04d640d4eb6e4f294210939ed3b3b88e685..5519b3ceb795d00f1d91eb7678db0f34b029e576 100644
|
| --- a/src/x64/code-stubs-x64.cc
|
| +++ b/src/x64/code-stubs-x64.cc
|
| @@ -663,8 +663,7 @@ void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) {
|
| // r11 = argument count (untagged)
|
| // Get the arguments map from the current native context into r9.
|
| Label has_mapped_parameters, instantiate;
|
| - __ movp(r9, Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
|
| - __ movp(r9, FieldOperand(r9, JSGlobalObject::kNativeContextOffset));
|
| + __ movp(r9, NativeContextOperand());
|
| __ testp(rbx, rbx);
|
| __ j(not_zero, &has_mapped_parameters, Label::kNear);
|
|
|
| @@ -945,10 +944,8 @@ void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) {
|
| __ Allocate(rax, rax, rbx, no_reg, &runtime, TAG_OBJECT);
|
|
|
| // Get the arguments map from the current native context.
|
| - __ movp(rdi, Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
|
| - __ movp(rdi, FieldOperand(rdi, JSGlobalObject::kNativeContextOffset));
|
| - const int offset = Context::SlotOffset(Context::STRICT_ARGUMENTS_MAP_INDEX);
|
| - __ movp(rdi, Operand(rdi, offset));
|
| + __ movp(rdi, NativeContextOperand());
|
| + __ movp(rdi, ContextOperand(rdi, Context::STRICT_ARGUMENTS_MAP_INDEX));
|
|
|
| __ movp(FieldOperand(rax, JSObject::kMapOffset), rdi);
|
| __ LoadRoot(kScratchRegister, Heap::kEmptyFixedArrayRootIndex);
|
| @@ -1823,7 +1820,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
| __ j(not_equal, &miss);
|
|
|
| // Make sure the function is the Array() function
|
| - __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, r11);
|
| + __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r11);
|
| __ cmpp(rdi, r11);
|
| __ j(not_equal, &megamorphic);
|
| __ jmp(&done);
|
| @@ -1846,7 +1843,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
| __ bind(&initialize);
|
|
|
| // Make sure the function is the Array() function
|
| - __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, r11);
|
| + __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r11);
|
| __ cmpp(rdi, r11);
|
| __ j(not_equal, ¬_array_function);
|
|
|
| @@ -1914,7 +1911,7 @@ void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
|
| // rdx - slot id
|
| // rbx - vector
|
| // rcx - allocation site (loaded from vector[slot]).
|
| - __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, r8);
|
| + __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r8);
|
| __ cmpp(rdi, r8);
|
| __ j(not_equal, miss);
|
|
|
| @@ -2036,15 +2033,14 @@ void CallICStub::Generate(MacroAssembler* masm) {
|
|
|
| // Make sure the function is not the Array() function, which requires special
|
| // behavior on MISS.
|
| - __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, rcx);
|
| + __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, rcx);
|
| __ cmpp(rdi, rcx);
|
| __ j(equal, &miss);
|
|
|
| - // Make sure the function belongs to the same native context (which implies
|
| - // the same global object).
|
| + // Make sure the function belongs to the same native context.
|
| __ movp(rcx, FieldOperand(rdi, JSFunction::kContextOffset));
|
| - __ movp(rcx, ContextOperand(rcx, Context::GLOBAL_OBJECT_INDEX));
|
| - __ cmpp(rcx, GlobalObjectOperand());
|
| + __ movp(rcx, ContextOperand(rcx, Context::NATIVE_CONTEXT_INDEX));
|
| + __ cmpp(rcx, NativeContextOperand());
|
| __ j(not_equal, &miss);
|
|
|
| // Update stats.
|
|
|