Index: src/x87/macro-assembler-x87.cc |
diff --git a/src/x87/macro-assembler-x87.cc b/src/x87/macro-assembler-x87.cc |
index 30dd02d1c9b72039d3d6c95ecdf240e8cd4aeee9..06bd774a552c991ea53b0360c162e24e85c82199 100644 |
--- a/src/x87/macro-assembler-x87.cc |
+++ b/src/x87/macro-assembler-x87.cc |
@@ -315,11 +315,13 @@ void MacroAssembler::LoadUint32NoSSE2(Register src) { |
} |
-void MacroAssembler::RecordWriteArray(Register object, |
- Register value, |
- Register index, |
- RememberedSetAction remembered_set_action, |
- SmiCheck smi_check) { |
+void MacroAssembler::RecordWriteArray( |
+ Register object, |
+ Register value, |
+ Register index, |
+ RememberedSetAction remembered_set_action, |
+ SmiCheck smi_check, |
+ PointersToHereCheck pointers_to_here_check_for_value) { |
// First, check if a write barrier is even needed. The tests below |
// catch stores of Smis. |
Label done; |
@@ -338,8 +340,8 @@ void MacroAssembler::RecordWriteArray(Register object, |
lea(dst, Operand(object, index, times_half_pointer_size, |
FixedArray::kHeaderSize - kHeapObjectTag)); |
- RecordWrite( |
- object, dst, value, remembered_set_action, OMIT_SMI_CHECK); |
+ RecordWrite(object, dst, value, remembered_set_action, OMIT_SMI_CHECK, |
+ pointers_to_here_check_for_value); |
bind(&done); |
@@ -358,7 +360,8 @@ void MacroAssembler::RecordWriteField( |
Register value, |
Register dst, |
RememberedSetAction remembered_set_action, |
- SmiCheck smi_check) { |
+ SmiCheck smi_check, |
+ PointersToHereCheck pointers_to_here_check_for_value) { |
// First, check if a write barrier is even needed. The tests below |
// catch stores of Smis. |
Label done; |
@@ -381,8 +384,8 @@ void MacroAssembler::RecordWriteField( |
bind(&ok); |
} |
- RecordWrite( |
- object, dst, value, remembered_set_action, OMIT_SMI_CHECK); |
+ RecordWrite(object, dst, value, remembered_set_action, OMIT_SMI_CHECK, |
+ pointers_to_here_check_for_value); |
bind(&done); |
@@ -422,6 +425,9 @@ void MacroAssembler::RecordWriteForMap( |
return; |
} |
+ // Compute the address. |
+ lea(address, FieldOperand(object, HeapObject::kMapOffset)); |
+ |
// Count number of write barriers in generated code. |
isolate()->counters()->write_barriers_static()->Increment(); |
IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1); |
@@ -437,12 +443,6 @@ void MacroAssembler::RecordWriteForMap( |
&done, |
Label::kNear); |
- // Delay the initialization of |address| and |value| for the stub until it's |
- // known that the will be needed. Up until this point their values are not |
- // needed since they are embedded in the operands of instructions that need |
- // them. |
- lea(address, FieldOperand(object, HeapObject::kMapOffset)); |
- mov(value, Immediate(map)); |
RecordWriteStub stub(isolate(), object, value, address, OMIT_REMEMBERED_SET); |
CallStub(&stub); |
@@ -458,11 +458,13 @@ void MacroAssembler::RecordWriteForMap( |
} |
-void MacroAssembler::RecordWrite(Register object, |
- Register address, |
- Register value, |
- RememberedSetAction remembered_set_action, |
- SmiCheck smi_check) { |
+void MacroAssembler::RecordWrite( |
+ Register object, |
+ Register address, |
+ Register value, |
+ RememberedSetAction remembered_set_action, |
+ SmiCheck smi_check, |
+ PointersToHereCheck pointers_to_here_check_for_value) { |
ASSERT(!object.is(value)); |
ASSERT(!object.is(address)); |
ASSERT(!value.is(address)); |
@@ -494,12 +496,14 @@ void MacroAssembler::RecordWrite(Register object, |
JumpIfSmi(value, &done, Label::kNear); |
} |
- CheckPageFlag(value, |
- value, // Used as scratch. |
- MemoryChunk::kPointersToHereAreInterestingMask, |
- zero, |
- &done, |
- Label::kNear); |
+ if (pointers_to_here_check_for_value != kPointersToHereAreAlwaysInteresting) { |
+ CheckPageFlag(value, |
+ value, // Used as scratch. |
+ MemoryChunk::kPointersToHereAreInterestingMask, |
+ zero, |
+ &done, |
+ Label::kNear); |
+ } |
CheckPageFlag(object, |
value, // Used as scratch. |
MemoryChunk::kPointersFromHereAreInterestingMask, |