Index: src/heap/heap-inl.h |
diff --git a/src/heap/heap-inl.h b/src/heap/heap-inl.h |
index e31d3d6859b4630677794d4062c0053b67eb4bb5..bcc82beb6aeb5347f85624456a2021bbbbed8ddd 100644 |
--- a/src/heap/heap-inl.h |
+++ b/src/heap/heap-inl.h |
@@ -405,9 +405,20 @@ void Heap::RecordWrite(Object* object, int offset, Object* o) { |
if (!InNewSpace(o) || !object->IsHeapObject() || InNewSpace(object)) { |
return; |
} |
- Page* page = Page::FromAddress(reinterpret_cast<Address>(object)); |
- Address slot = HeapObject::cast(object)->address() + offset; |
- RememberedSet<OLD_TO_NEW>::Insert(page, slot); |
+ RememberedSet<OLD_TO_NEW>::Insert( |
+ Page::FromAddress(reinterpret_cast<Address>(object)), |
+ HeapObject::cast(object)->address() + offset); |
+} |
+ |
+void Heap::RecordFixedArrayElements(FixedArray* array, int offset, int length) { |
+ if (InNewSpace(array)) return; |
+ Page* page = Page::FromAddress(reinterpret_cast<Address>(array)); |
+ for (int i = 0; i < length; i++) { |
+ if (!InNewSpace(array->get(offset + i))) continue; |
+ RememberedSet<OLD_TO_NEW>::Insert( |
+ page, |
+ reinterpret_cast<Address>(array->RawFieldOfElementAt(offset + i))); |
+ } |
} |