Commit 6a5afd94 authored by erik.corry@gmail.com's avatar erik.corry@gmail.com

MIPS: Check that address given to __RecordWrite is correct.

ARM: Clean up equivalent functionality on ARM.
This subsumes http://codereview.chromium.org/8561001/
Review URL: http://codereview.chromium.org/9168006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10368 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent dc9910f4
......@@ -496,13 +496,10 @@ void MacroAssembler::RecordWrite(Register object,
// registers are cp.
ASSERT(!address.is(cp) && !value.is(cp));
if (FLAG_debug_code) {
Label ok;
if (emit_debug_code()) {
ldr(ip, MemOperand(address));
cmp(ip, value);
b(eq, &ok);
stop("Wrong address or value passed to RecordWrite");
bind(&ok);
Check(eq, "Wrong address or value passed to RecordWrite");
}
Label done;
......@@ -551,7 +548,7 @@ void MacroAssembler::RememberedSetHelper(Register object, // For debug tests.
SaveFPRegsMode fp_mode,
RememberedSetFinalAction and_then) {
Label done;
if (FLAG_debug_code) {
if (emit_debug_code()) {
Label ok;
JumpIfNotInNewSpace(object, scratch, &ok);
stop("Remembered set pointer is in new space");
......@@ -3504,7 +3501,7 @@ void MacroAssembler::EnsureNotWhite(
tst(mask_scratch, load_scratch);
b(ne, &done);
if (FLAG_debug_code) {
if (emit_debug_code()) {
// Check for impossible bit pattern.
Label ok;
// LSL may overflow, making the check conservative.
......
......@@ -252,6 +252,12 @@ void MacroAssembler::RecordWrite(Register object,
// registers are cp.
ASSERT(!address.is(cp) && !value.is(cp));
if (emit_debug_code()) {
lw(at, MemOperand(address));
Assert(
eq, "Wrong address or value passed to RecordWrite", at, Operand(value));
}
Label done;
if (smi_check == INLINE_SMI_CHECK) {
......@@ -297,7 +303,7 @@ void MacroAssembler::RememberedSetHelper(Register object, // For debug tests.
SaveFPRegsMode fp_mode,
RememberedSetFinalAction and_then) {
Label done;
if (FLAG_debug_code) {
if (emit_debug_code()) {
Label ok;
JumpIfNotInNewSpace(object, scratch, &ok);
stop("Remembered set pointer is in new space");
......@@ -4838,7 +4844,7 @@ void MacroAssembler::EnsureNotWhite(
And(t8, mask_scratch, load_scratch);
Branch(&done, ne, t8, Operand(zero_reg));
if (FLAG_debug_code) {
if (emit_debug_code()) {
// Check for impossible bit pattern.
Label ok;
// sll may overflow, making the check conservative.
......
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