__ b(&skip_to_incremental_compacting);
if (remembered_set_action_ == EMIT_REMEMBERED_SET) {
- __ RememberedSetHelper(
- address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd);
+ __ RememberedSetHelper(object_,
+ address_,
+ value_,
+ save_fp_regs_mode_,
+ MacroAssembler::kReturnAtEnd);
}
__ Ret();
Label dont_need_remembered_set;
__ ldr(regs_.scratch0(), MemOperand(regs_.address(), 0));
- __ JumpIfNotInNewSpace(regs_.scratch0(),
+ __ JumpIfNotInNewSpace(regs_.scratch0(), // Value.
regs_.scratch0(),
&dont_need_remembered_set);
masm, kUpdateRememberedSetOnNoNeedToInformIncrementalMarker, mode);
InformIncrementalMarker(masm, mode);
regs_.Restore(masm);
- __ RememberedSetHelper(
- address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd);
+ __ RememberedSetHelper(object_,
+ address_,
+ value_,
+ save_fp_regs_mode_,
+ MacroAssembler::kReturnAtEnd);
__ bind(&dont_need_remembered_set);
}
regs_.Restore(masm);
if (on_no_need == kUpdateRememberedSetOnNoNeedToInformIncrementalMarker) {
- __ RememberedSetHelper(
- address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd);
+ __ RememberedSetHelper(object_,
+ address_,
+ value_,
+ save_fp_regs_mode_,
+ MacroAssembler::kReturnAtEnd);
} else {
__ Ret();
}
regs_.Restore(masm);
if (on_no_need == kUpdateRememberedSetOnNoNeedToInformIncrementalMarker) {
- __ RememberedSetHelper(
- address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd);
+ __ RememberedSetHelper(object_,
+ address_,
+ value_,
+ save_fp_regs_mode_,
+ MacroAssembler::kReturnAtEnd);
} else {
__ Ret();
}
// pauses in the middle of scanning a single object. Therefore the
// incremental marker is not disturbed, so we don't need to call the
// RecordWrite stub that notifies the incremental marker.
- __ RememberedSetHelper(
- index1, scratch2, kDontSaveFPRegs, MacroAssembler::kFallThroughAtEnd);
- __ RememberedSetHelper(
- index2, scratch2, kDontSaveFPRegs, MacroAssembler::kFallThroughAtEnd);
+ __ RememberedSetHelper(elements,
+ index1,
+ scratch2,
+ kDontSaveFPRegs,
+ MacroAssembler::kFallThroughAtEnd);
+ __ RememberedSetHelper(elements,
+ index2,
+ scratch2,
+ kDontSaveFPRegs,
+ MacroAssembler::kFallThroughAtEnd);
__ bind(&no_remembered_set);
// We are done. Drop elements from the stack, and return undefined.
}
-void MacroAssembler::RememberedSetHelper(Register address,
+void MacroAssembler::RememberedSetHelper(Register object, // For debug tests.
+ Register address,
Register scratch,
SaveFPRegsMode fp_mode,
RememberedSetFinalAction and_then) {
Label done;
+ if (FLAG_debug_code) {
+ Label ok;
+ JumpIfNotInNewSpace(object, scratch, &ok);
+ stop("Remembered set pointer is in new space");
+ bind(&ok);
+ }
// Load store buffer top.
ExternalReference store_buffer =
ExternalReference::store_buffer_top(isolate());
// Record in the remembered set the fact that we have a pointer to new space
// at the address pointed to by the addr register. Only works if addr is not
// in new space.
- void RememberedSetHelper(Register addr,
+ void RememberedSetHelper(Register object, // Used for debug code.
+ Register addr,
Register scratch,
SaveFPRegsMode save_fp,
RememberedSetFinalAction and_then);
Label* condition_met);
// Check if object is in new space. Jumps if the object is not in new space.
- // The register scratch can be object itself, but it will be clobbered.
+ // The register scratch can be object itself, but scratch will be clobbered.
void JumpIfNotInNewSpace(Register object,
Register scratch,
Label* branch) {
__ jmp(&skip_to_incremental_compacting, Label::kFar);
if (remembered_set_action_ == EMIT_REMEMBERED_SET) {
- __ RememberedSetHelper(
- address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd);
+ __ RememberedSetHelper(object_,
+ address_,
+ value_,
+ save_fp_regs_mode_,
+ MacroAssembler::kReturnAtEnd);
} else {
__ ret(0);
}
Label dont_need_remembered_set;
__ mov(regs_.scratch0(), Operand(regs_.address(), 0));
- __ JumpIfNotInNewSpace(regs_.scratch0(),
+ __ JumpIfNotInNewSpace(regs_.scratch0(), // Value.
regs_.scratch0(),
&dont_need_remembered_set);
mode);
InformIncrementalMarker(masm, mode);
regs_.Restore(masm);
- __ RememberedSetHelper(
- address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd);
+ __ RememberedSetHelper(object_,
+ address_,
+ value_,
+ save_fp_regs_mode_,
+ MacroAssembler::kReturnAtEnd);
__ bind(&dont_need_remembered_set);
}
regs_.Restore(masm);
if (on_no_need == kUpdateRememberedSetOnNoNeedToInformIncrementalMarker) {
- __ RememberedSetHelper(
- address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd);
+ __ RememberedSetHelper(object_,
+ address_,
+ value_,
+ save_fp_regs_mode_,
+ MacroAssembler::kReturnAtEnd);
} else {
__ ret(0);
}
regs_.Restore(masm);
if (on_no_need == kUpdateRememberedSetOnNoNeedToInformIncrementalMarker) {
- __ RememberedSetHelper(
- address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd);
+ __ RememberedSetHelper(object_,
+ address_,
+ value_,
+ save_fp_regs_mode_,
+ MacroAssembler::kReturnAtEnd);
} else {
__ ret(0);
}
// pauses in the middle of scanning a single object. Therefore the
// incremental marker is not disturbed, so we don't need to call the
// RecordWrite stub that notifies the incremental marker.
- __ RememberedSetHelper(
- index_1, temp, kDontSaveFPRegs, MacroAssembler::kFallThroughAtEnd);
- __ RememberedSetHelper(
- index_2, temp, kDontSaveFPRegs, MacroAssembler::kFallThroughAtEnd);
+ __ RememberedSetHelper(elements,
+ index_1,
+ temp,
+ kDontSaveFPRegs,
+ MacroAssembler::kFallThroughAtEnd);
+ __ RememberedSetHelper(elements,
+ index_2,
+ temp,
+ kDontSaveFPRegs,
+ MacroAssembler::kFallThroughAtEnd);
__ bind(&no_remembered_set);
void MacroAssembler::RememberedSetHelper(
+ Register object, // Only used for debug checks.
Register addr,
Register scratch,
SaveFPRegsMode save_fp,
MacroAssembler::RememberedSetFinalAction and_then) {
Label done;
+ if (FLAG_debug_code) {
+ Label ok;
+ JumpIfNotInNewSpace(object, scratch, &ok, Label::kNear);
+ int3();
+ bind(&ok);
+ }
// Load store buffer top.
ExternalReference store_buffer =
ExternalReference::store_buffer_top(isolate());
// Record in the remembered set the fact that we have a pointer to new space
// at the address pointed to by the addr register. Only works if addr is not
// in new space.
- void RememberedSetHelper(Register addr,
+ void RememberedSetHelper(Register object, // Used for debug code.
+ Register addr,
Register scratch,
SaveFPRegsMode save_fp,
RememberedSetFinalAction and_then);
Label::Distance condition_met_distance = Label::kFar);
// Check if object is in new space. Jumps if the object is not in new space.
- // The register scratch can be object itself, but it will be clobbered.
+ // The register scratch can be object itself, but scratch will be clobbered.
void JumpIfNotInNewSpace(Register object,
Register scratch,
Label* branch,
// For page containing |object| mark region covering |address|
// dirty. |object| is the object being stored into, |value| is the
- // object being stored. All registers are clobbered by the
+ // object being stored. The address and value registers are clobbered by the
// operation. RecordWrite filters out smis so it does not update the
// write barrier if the value is a smi.
void RecordWrite(
__ jmp(&skip_to_incremental_compacting, Label::kFar);
if (remembered_set_action_ == EMIT_REMEMBERED_SET) {
- __ RememberedSetHelper(
- address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd);
+ __ RememberedSetHelper(object_,
+ address_,
+ value_,
+ save_fp_regs_mode_,
+ MacroAssembler::kReturnAtEnd);
} else {
__ ret(0);
}
masm, kUpdateRememberedSetOnNoNeedToInformIncrementalMarker, mode);
InformIncrementalMarker(masm, mode);
regs_.Restore(masm);
- __ RememberedSetHelper(
- address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd);
+ __ RememberedSetHelper(object_,
+ address_,
+ value_,
+ save_fp_regs_mode_,
+ MacroAssembler::kReturnAtEnd);
__ bind(&dont_need_remembered_set);
}
regs_.Restore(masm);
if (on_no_need == kUpdateRememberedSetOnNoNeedToInformIncrementalMarker) {
- __ RememberedSetHelper(
- address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd);
+ __ RememberedSetHelper(object_,
+ address_,
+ value_,
+ save_fp_regs_mode_,
+ MacroAssembler::kReturnAtEnd);
} else {
__ ret(0);
}
regs_.Restore(masm);
if (on_no_need == kUpdateRememberedSetOnNoNeedToInformIncrementalMarker) {
- __ RememberedSetHelper(
- address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd);
+ __ RememberedSetHelper(object_,
+ address_,
+ value_,
+ save_fp_regs_mode_,
+ MacroAssembler::kReturnAtEnd);
} else {
__ ret(0);
}
// pauses in the middle of scanning a single object. Therefore the
// incremental marker is not disturbed, so we don't need to call the
// RecordWrite stub that notifies the incremental marker.
- __ RememberedSetHelper(
- index_1, temp, kDontSaveFPRegs, MacroAssembler::kFallThroughAtEnd);
- __ RememberedSetHelper(
- index_2, temp, kDontSaveFPRegs, MacroAssembler::kFallThroughAtEnd);
+ __ RememberedSetHelper(elements,
+ index_1,
+ temp,
+ kDontSaveFPRegs,
+ MacroAssembler::kFallThroughAtEnd);
+ __ RememberedSetHelper(elements,
+ index_2,
+ temp,
+ kDontSaveFPRegs,
+ MacroAssembler::kFallThroughAtEnd);
__ bind(&no_remembered_set);
}
-void MacroAssembler::RememberedSetHelper(Register addr,
+void MacroAssembler::RememberedSetHelper(Register object, // For debug tests.
+ Register addr,
Register scratch,
SaveFPRegsMode save_fp,
RememberedSetFinalAction and_then) {
+ if (FLAG_debug_code) {
+ Label ok;
+ JumpIfNotInNewSpace(object, scratch, &ok, Label::kNear);
+ int3();
+ bind(&ok);
+ }
// Load store buffer top.
LoadRoot(scratch, Heap::kStoreBufferTopRootIndex);
// Store pointer to buffer.
// Record in the remembered set the fact that we have a pointer to new space
// at the address pointed to by the addr register. Only works if addr is not
// in new space.
- void RememberedSetHelper(Register addr,
+ void RememberedSetHelper(Register object, // Used for debug code.
+ Register addr,
Register scratch,
SaveFPRegsMode save_fp,
RememberedSetFinalAction and_then);
Label::Distance condition_met_distance = Label::kFar);
// Check if object is in new space. Jumps if the object is not in new space.
- // The register scratch can be object itself, but it will be clobbered.
+ // The register scratch can be object itself, but scratch will be clobbered.
void JumpIfNotInNewSpace(Register object,
Register scratch,
Label* branch,
RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
SmiCheck smi_check = INLINE_SMI_CHECK);
- // For page containing |object| mark region covering [address]
+ // For page containing |object| mark region covering |address|
// dirty. |object| is the object being stored into, |value| is the
- // object being stored. All registers are clobbered by the
+ // object being stored. The address and value registers are clobbered by the
// operation. RecordWrite filters out smis so it does not update
// the write barrier if the value is a smi.
void RecordWrite(