| Index: src/x64/code-stubs-x64.cc
|
| diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
|
| index bc2e59a41bdf4580170b6397d9f2f483be0cf990..8868c7a88adc6c9136d66e29ddce79e837a05ac7 100644
|
| --- a/src/x64/code-stubs-x64.cc
|
| +++ b/src/x64/code-stubs-x64.cc
|
| @@ -3727,7 +3727,7 @@ static void GenerateRecordCallTargetNoArray(MacroAssembler* masm) {
|
| Label initialize, done;
|
|
|
| // Load the cache state into rcx.
|
| - __ movq(rcx, FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset));
|
| + __ movq(rcx, FieldOperand(rbx, Cell::kValueOffset));
|
|
|
| // A monomorphic cache hit or an already megamorphic state: invoke the
|
| // function without changing the state.
|
| @@ -3742,13 +3742,13 @@ static void GenerateRecordCallTargetNoArray(MacroAssembler* masm) {
|
| __ j(equal, &initialize, Label::kNear);
|
| // MegamorphicSentinel is an immortal immovable object (undefined) so no
|
| // write-barrier is needed.
|
| - __ Move(FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset),
|
| + __ Move(FieldOperand(rbx, Cell::kValueOffset),
|
| TypeFeedbackCells::MegamorphicSentinel(isolate));
|
| __ jmp(&done, Label::kNear);
|
|
|
| // An uninitialized cache is patched with the function.
|
| __ bind(&initialize);
|
| - __ movq(FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset), rdi);
|
| + __ movq(FieldOperand(rbx, Cell::kValueOffset), rdi);
|
| // No need for a write barrier here - cells are rescanned.
|
|
|
| __ bind(&done);
|
| @@ -3766,7 +3766,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
| Label initialize, done, miss, megamorphic, not_array_function;
|
|
|
| // Load the cache state into rcx.
|
| - __ movq(rcx, FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset));
|
| + __ movq(rcx, FieldOperand(rbx, Cell::kValueOffset));
|
|
|
| // A monomorphic cache hit or an already megamorphic state: invoke the
|
| // function without changing the state.
|
| @@ -3799,7 +3799,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
| // MegamorphicSentinel is an immortal immovable object (undefined) so no
|
| // write-barrier is needed.
|
| __ bind(&megamorphic);
|
| - __ Move(FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset),
|
| + __ Move(FieldOperand(rbx, Cell::kValueOffset),
|
| TypeFeedbackCells::MegamorphicSentinel(isolate));
|
| __ jmp(&done, Label::kNear);
|
|
|
| @@ -3817,12 +3817,12 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
| Handle<Object> initial_kind_sentinel =
|
| TypeFeedbackCells::MonomorphicArraySentinel(isolate,
|
| GetInitialFastElementsKind());
|
| - __ Move(FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset),
|
| + __ Move(FieldOperand(rbx, Cell::kValueOffset),
|
| initial_kind_sentinel);
|
| __ jmp(&done);
|
|
|
| __ bind(¬_array_function);
|
| - __ movq(FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset), rdi);
|
| + __ movq(FieldOperand(rbx, Cell::kValueOffset), rdi);
|
| // No need for a write barrier here - cells are rescanned.
|
|
|
| __ bind(&done);
|
| @@ -3893,7 +3893,7 @@ void CallFunctionStub::Generate(MacroAssembler* masm) {
|
| // If there is a call target cache, mark it megamorphic in the
|
| // non-function case. MegamorphicSentinel is an immortal immovable
|
| // object (undefined) so no write barrier is needed.
|
| - __ Move(FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset),
|
| + __ Move(FieldOperand(rbx, Cell::kValueOffset),
|
| TypeFeedbackCells::MegamorphicSentinel(isolate));
|
| }
|
| // Check for function proxy.
|
| @@ -6636,11 +6636,11 @@ void RecordWriteStub::CheckNeedsToInformIncrementalMarker(
|
| void StoreArrayLiteralElementStub::Generate(MacroAssembler* masm) {
|
| // ----------- S t a t e -------------
|
| // -- rax : element value to store
|
| - // -- rbx : array literal
|
| - // -- rdi : map of array literal
|
| // -- rcx : element index as smi
|
| - // -- rdx : array literal index in function
|
| // -- rsp[0] : return address
|
| + // -- rsp[8] : array literal index in function
|
| + // -- rsp[16]: array literal
|
| + // clobbers rbx, rdx, rdi
|
| // -----------------------------------
|
|
|
| Label element_done;
|
| @@ -6649,6 +6649,11 @@ void StoreArrayLiteralElementStub::Generate(MacroAssembler* masm) {
|
| Label slow_elements;
|
| Label fast_elements;
|
|
|
| + // Get array literal index, array literal and its map.
|
| + __ movq(rdx, Operand(rsp, 1 * kPointerSize));
|
| + __ movq(rbx, Operand(rsp, 2 * kPointerSize));
|
| + __ movq(rdi, FieldOperand(rbx, JSObject::kMapOffset));
|
| +
|
| __ CheckFastElements(rdi, &double_elements);
|
|
|
| // FAST_*_SMI_ELEMENTS or FAST_*_ELEMENTS
|
| @@ -6934,13 +6939,12 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) {
|
| __ CmpObjectType(rcx, MAP_TYPE, rcx);
|
| __ Check(equal, "Unexpected initial map for Array function");
|
|
|
| - // We should either have undefined in ebx or a valid jsglobalpropertycell
|
| + // We should either have undefined in ebx or a valid cell
|
| Label okay_here;
|
| - Handle<Map> global_property_cell_map(
|
| - masm->isolate()->heap()->global_property_cell_map());
|
| + Handle<Map> cell_map = masm->isolate()->factory()->cell_map();
|
| __ Cmp(rbx, undefined_sentinel);
|
| __ j(equal, &okay_here);
|
| - __ Cmp(FieldOperand(rbx, 0), global_property_cell_map);
|
| + __ Cmp(FieldOperand(rbx, 0), cell_map);
|
| __ Assert(equal, "Expected property cell in register rbx");
|
| __ bind(&okay_here);
|
| }
|
| @@ -6950,7 +6954,7 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) {
|
| // Get the elements kind and case on that.
|
| __ Cmp(rbx, undefined_sentinel);
|
| __ j(equal, &no_info);
|
| - __ movq(rdx, FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset));
|
| + __ movq(rdx, FieldOperand(rbx, Cell::kValueOffset));
|
| __ JumpIfNotSmi(rdx, &no_info);
|
| __ SmiToInteger32(rdx, rdx);
|
| __ jmp(&switch_ready);
|
|
|