Chromium Code Reviews| Index: src/heap.cc |
| diff --git a/src/heap.cc b/src/heap.cc |
| index 401f4f7948adc09cb845390ef7f37036fa179aee..dcc460d231e90fd363051574324c146645d5e3d3 100644 |
| --- a/src/heap.cc |
| +++ b/src/heap.cc |
| @@ -677,6 +677,24 @@ void Heap::PerformScavenge() { |
| } |
| +void Heap::MoveElements(FixedArray* dst, int dst_index, FixedArray* src, |
| + int src_index, int len) { |
| + if (len == 0) return; |
| + |
| + ASSERT(dst->map() != HEAP->fixed_cow_array_map()); |
| + Object** dst_objects = dst->data_start() + dst_index; |
| + memmove(dst_objects, |
| + src->data_start() + src_index, |
| + len * kPointerSize); |
| + for (int i = 0; i < len; i++) { |
| + if (!InNewSpace(src) && InNewSpace(dst_objects[i])) { |
|
Michael Starzinger
2013/01/08 13:46:32
As discussed offline, this second loop is no longe
Hannes Payer (out of office)
2013/01/09 09:32:46
I will submit an optimization in a follow-up CL.
|
| + RecordWrite(dst->address(), dst->OffsetOfElementAt(dst_index + i)); |
| + } |
| + } |
| + incremental_marking()->RecordWrites(dst); |
| +} |
| + |
| + |
| #ifdef VERIFY_HEAP |
| // Helper class for verifying the symbol table. |
| class SymbolTableVerifier : public ObjectVisitor { |
| @@ -4973,7 +4991,6 @@ MUST_USE_RESULT static MaybeObject* AllocateFixedArrayWithFiller( |
| ASSERT(length >= 0); |
| ASSERT(heap->empty_fixed_array()->IsFixedArray()); |
| if (length == 0) return heap->empty_fixed_array(); |
| - |
| ASSERT(!heap->InNewSpace(filler)); |
| Object* result; |
| { MaybeObject* maybe_result = heap->AllocateRawFixedArray(length, pretenure); |