Chromium Code Reviews| Index: src/x64/code-stubs-x64.cc |
| =================================================================== |
| --- src/x64/code-stubs-x64.cc (revision 8207) |
| +++ src/x64/code-stubs-x64.cc (working copy) |
| @@ -2427,16 +2427,18 @@ |
| // Store last subject and last input. |
| __ movq(rax, Operand(rsp, kSubjectOffset)); |
| __ movq(FieldOperand(rbx, RegExpImpl::kLastSubjectOffset), rax); |
| - __ movq(rcx, rbx); |
| - __ RecordWrite(rcx, |
| - RegExpImpl::kLastSubjectOffset, |
| - rax, |
| - rdi, |
| - kDontSaveFPRegs); |
| + __ RecordWriteField(rbx, |
| + RegExpImpl::kLastSubjectOffset, |
| + rax, |
| + rdi, |
| + kDontSaveFPRegs); |
| __ movq(rax, Operand(rsp, kSubjectOffset)); |
| __ movq(FieldOperand(rbx, RegExpImpl::kLastInputOffset), rax); |
| - __ movq(rcx, rbx); |
| - __ RecordWrite(rcx, RegExpImpl::kLastInputOffset, rax, rdi, kDontSaveFPRegs); |
| + __ RecordWriteField(rbx, |
| + RegExpImpl::kLastInputOffset, |
| + rax, |
| + rdi, |
| + kDontSaveFPRegs); |
| // Get the static offsets vector filled by the native regexp code. |
| __ LoadAddress(rcx, |
| @@ -5178,6 +5180,30 @@ |
| } |
| +// Takes the input in 3 registers: address_ value_ and object_. A pointer to |
| +// the value has just been written into the object, now this stub makes sure |
| +// we keep the GC informed. The word in the object where the value has been |
| +// written is in the address register. |
| +void RecordWriteStub::Generate(MacroAssembler* masm) { |
| + Label skip_non_incremental_part; |
| + __ jmp(&skip_non_incremental_part, Label::kNear); |
|
Lasse Reichstein
2011/06/07 14:02:53
But why overwrite?
Why not just:
if (!HEAP->incr
Erik Corry
2011/06/08 10:38:55
We will be ovewriting the opcode every time we sta
|
| + if (!HEAP->incremental_marking()->IsMarking()) { |
|
Lasse Reichstein
2011/06/07 14:02:53
HEAP should be replaced by something faster. Maybe
Erik Corry
2011/06/08 10:38:55
Done.
|
| + ASSERT(masm->get_opcode(-2) == kSkipNonIncrementalPartInstruction); |
| + masm->set_opcode(-2, kTwoByteNopInstruction); |
| + } |
| + |
| + if (remembered_set_action_ == EMIT_REMEMBERED_SET) { |
| + __ RememberedSetHelper( |
| + address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd); |
| + } else { |
| + __ ret(0); |
| + } |
| + |
| + __ bind(&skip_non_incremental_part); |
| + __ int3(); |
| +} |
| + |
| + |
| #undef __ |
| } } // namespace v8::internal |