Commit 119a23e1 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[turbofan] Pick remembered set action for write barrier.

This picks the record-write stub depending on the correct remembered set
action parameter. For values known to be maps we can guarantee that they
never reside in new-space, hence store buffer recording can be skipped.

R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/1716163003

Cr-Commit-Position: refs/heads/master@{#34191}
parent e032a98d
...@@ -231,6 +231,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode { ...@@ -231,6 +231,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
__ CheckPageFlag(value_, scratch0_, __ CheckPageFlag(value_, scratch0_,
MemoryChunk::kPointersToHereAreInterestingMask, eq, MemoryChunk::kPointersToHereAreInterestingMask, eq,
exit()); exit());
RememberedSetAction const remembered_set_action =
mode_ > RecordWriteMode::kValueIsMap ? EMIT_REMEMBERED_SET
: OMIT_REMEMBERED_SET;
SaveFPRegsMode const save_fp_mode = SaveFPRegsMode const save_fp_mode =
frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs; frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
if (!frame()->needs_frame()) { if (!frame()->needs_frame()) {
...@@ -238,7 +241,7 @@ class OutOfLineRecordWrite final : public OutOfLineCode { ...@@ -238,7 +241,7 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
__ Push(lr); __ Push(lr);
} }
RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_, RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_,
EMIT_REMEMBERED_SET, save_fp_mode); remembered_set_action, save_fp_mode);
if (index_.is(no_reg)) { if (index_.is(no_reg)) {
__ add(scratch1_, object_, Operand(index_immediate_)); __ add(scratch1_, object_, Operand(index_immediate_));
} else { } else {
......
...@@ -288,6 +288,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode { ...@@ -288,6 +288,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
__ CheckPageFlagClear(value_, scratch0_, __ CheckPageFlagClear(value_, scratch0_,
MemoryChunk::kPointersToHereAreInterestingMask, MemoryChunk::kPointersToHereAreInterestingMask,
exit()); exit());
RememberedSetAction const remembered_set_action =
mode_ > RecordWriteMode::kValueIsMap ? EMIT_REMEMBERED_SET
: OMIT_REMEMBERED_SET;
SaveFPRegsMode const save_fp_mode = SaveFPRegsMode const save_fp_mode =
frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs; frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
if (!frame()->needs_frame()) { if (!frame()->needs_frame()) {
...@@ -295,7 +298,7 @@ class OutOfLineRecordWrite final : public OutOfLineCode { ...@@ -295,7 +298,7 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
__ Push(lr); __ Push(lr);
} }
RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_, RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_,
EMIT_REMEMBERED_SET, save_fp_mode); remembered_set_action, save_fp_mode);
__ Add(scratch1_, object_, index_); __ Add(scratch1_, object_, index_);
__ CallStub(&stub); __ CallStub(&stub);
if (!frame()->needs_frame()) { if (!frame()->needs_frame()) {
......
...@@ -245,10 +245,13 @@ class OutOfLineRecordWrite final : public OutOfLineCode { ...@@ -245,10 +245,13 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
__ CheckPageFlag(value_, scratch0_, __ CheckPageFlag(value_, scratch0_,
MemoryChunk::kPointersToHereAreInterestingMask, zero, MemoryChunk::kPointersToHereAreInterestingMask, zero,
exit()); exit());
RememberedSetAction const remembered_set_action =
mode_ > RecordWriteMode::kValueIsMap ? EMIT_REMEMBERED_SET
: OMIT_REMEMBERED_SET;
SaveFPRegsMode const save_fp_mode = SaveFPRegsMode const save_fp_mode =
frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs; frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_, RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_,
EMIT_REMEMBERED_SET, save_fp_mode); remembered_set_action, save_fp_mode);
__ lea(scratch1_, operand_); __ lea(scratch1_, operand_);
__ CallStub(&stub); __ CallStub(&stub);
} }
......
...@@ -230,6 +230,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode { ...@@ -230,6 +230,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
__ CheckPageFlag(value_, scratch0_, __ CheckPageFlag(value_, scratch0_,
MemoryChunk::kPointersToHereAreInterestingMask, eq, MemoryChunk::kPointersToHereAreInterestingMask, eq,
exit()); exit());
RememberedSetAction const remembered_set_action =
mode_ > RecordWriteMode::kValueIsMap ? EMIT_REMEMBERED_SET
: OMIT_REMEMBERED_SET;
SaveFPRegsMode const save_fp_mode = SaveFPRegsMode const save_fp_mode =
frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs; frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
if (!frame()->needs_frame()) { if (!frame()->needs_frame()) {
...@@ -237,7 +240,7 @@ class OutOfLineRecordWrite final : public OutOfLineCode { ...@@ -237,7 +240,7 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
__ Push(ra); __ Push(ra);
} }
RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_, RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_,
EMIT_REMEMBERED_SET, save_fp_mode); remembered_set_action, save_fp_mode);
__ Addu(scratch1_, object_, index_); __ Addu(scratch1_, object_, index_);
__ CallStub(&stub); __ CallStub(&stub);
if (!frame()->needs_frame()) { if (!frame()->needs_frame()) {
......
...@@ -230,6 +230,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode { ...@@ -230,6 +230,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
__ CheckPageFlag(value_, scratch0_, __ CheckPageFlag(value_, scratch0_,
MemoryChunk::kPointersToHereAreInterestingMask, eq, MemoryChunk::kPointersToHereAreInterestingMask, eq,
exit()); exit());
RememberedSetAction const remembered_set_action =
mode_ > RecordWriteMode::kValueIsMap ? EMIT_REMEMBERED_SET
: OMIT_REMEMBERED_SET;
SaveFPRegsMode const save_fp_mode = SaveFPRegsMode const save_fp_mode =
frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs; frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
if (!frame()->needs_frame()) { if (!frame()->needs_frame()) {
...@@ -237,7 +240,7 @@ class OutOfLineRecordWrite final : public OutOfLineCode { ...@@ -237,7 +240,7 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
__ Push(ra); __ Push(ra);
} }
RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_, RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_,
EMIT_REMEMBERED_SET, save_fp_mode); remembered_set_action, save_fp_mode);
__ Daddu(scratch1_, object_, index_); __ Daddu(scratch1_, object_, index_);
__ CallStub(&stub); __ CallStub(&stub);
if (!frame()->needs_frame()) { if (!frame()->needs_frame()) {
......
...@@ -192,6 +192,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode { ...@@ -192,6 +192,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
__ CheckPageFlag(value_, scratch0_, __ CheckPageFlag(value_, scratch0_,
MemoryChunk::kPointersToHereAreInterestingMask, eq, MemoryChunk::kPointersToHereAreInterestingMask, eq,
exit()); exit());
RememberedSetAction const remembered_set_action =
mode_ > RecordWriteMode::kValueIsMap ? EMIT_REMEMBERED_SET
: OMIT_REMEMBERED_SET;
SaveFPRegsMode const save_fp_mode = SaveFPRegsMode const save_fp_mode =
frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs; frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
if (!frame()->needs_frame()) { if (!frame()->needs_frame()) {
...@@ -200,7 +203,7 @@ class OutOfLineRecordWrite final : public OutOfLineCode { ...@@ -200,7 +203,7 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
__ Push(scratch1_); __ Push(scratch1_);
} }
RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_, RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_,
EMIT_REMEMBERED_SET, save_fp_mode); remembered_set_action, save_fp_mode);
if (offset_.is(no_reg)) { if (offset_.is(no_reg)) {
__ addi(scratch1_, object_, Operand(offset_immediate_)); __ addi(scratch1_, object_, Operand(offset_immediate_));
} else { } else {
......
...@@ -212,10 +212,13 @@ class OutOfLineRecordWrite final : public OutOfLineCode { ...@@ -212,10 +212,13 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
__ CheckPageFlag(value_, scratch0_, __ CheckPageFlag(value_, scratch0_,
MemoryChunk::kPointersToHereAreInterestingMask, zero, MemoryChunk::kPointersToHereAreInterestingMask, zero,
exit()); exit());
RememberedSetAction const remembered_set_action =
mode_ > RecordWriteMode::kValueIsMap ? EMIT_REMEMBERED_SET
: OMIT_REMEMBERED_SET;
SaveFPRegsMode const save_fp_mode = SaveFPRegsMode const save_fp_mode =
frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs; frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_, RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_,
EMIT_REMEMBERED_SET, save_fp_mode); remembered_set_action, save_fp_mode);
__ leap(scratch1_, operand_); __ leap(scratch1_, operand_);
__ CallStub(&stub); __ CallStub(&stub);
} }
......
...@@ -249,10 +249,13 @@ class OutOfLineRecordWrite final : public OutOfLineCode { ...@@ -249,10 +249,13 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
__ CheckPageFlag(value_, scratch0_, __ CheckPageFlag(value_, scratch0_,
MemoryChunk::kPointersToHereAreInterestingMask, zero, MemoryChunk::kPointersToHereAreInterestingMask, zero,
exit()); exit());
RememberedSetAction const remembered_set_action =
mode_ > RecordWriteMode::kValueIsMap ? EMIT_REMEMBERED_SET
: OMIT_REMEMBERED_SET;
SaveFPRegsMode const save_fp_mode = SaveFPRegsMode const save_fp_mode =
frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs; frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_, RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_,
EMIT_REMEMBERED_SET, save_fp_mode); remembered_set_action, save_fp_mode);
__ lea(scratch1_, operand_); __ lea(scratch1_, operand_);
__ CallStub(&stub); __ CallStub(&stub);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment