Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Unified Diff: src/heap.cc

Issue 11737006: Filter old to new references when moving parts of an object. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/heap.h ('K') | « src/heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« src/heap.h ('K') | « src/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698