Minor adjustments to the object migration code: When copying
large objects we use memcpy. If this turns out to be a wash on the benchmarks, I'd be happy to rip it out again. Review URL: http://codereview.chromium.org/6576 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@469 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
079a607442
commit
614d78367f
18
src/heap.cc
18
src/heap.cc
@ -733,10 +733,20 @@ HeapObject* Heap::MigrateObject(HeapObject** source_p,
|
|||||||
int size) {
|
int size) {
|
||||||
void** src = reinterpret_cast<void**>((*source_p)->address());
|
void** src = reinterpret_cast<void**>((*source_p)->address());
|
||||||
void** dst = reinterpret_cast<void**>(target->address());
|
void** dst = reinterpret_cast<void**>(target->address());
|
||||||
int counter = size/kPointerSize - 1;
|
|
||||||
do {
|
// Use block copying memcpy if the object we're migrating is big
|
||||||
*dst++ = *src++;
|
// enough to justify the extra call/setup overhead.
|
||||||
} while (counter-- > 0);
|
static const int kBlockCopyLimit = 16 * kPointerSize;
|
||||||
|
|
||||||
|
if (size >= kBlockCopyLimit) {
|
||||||
|
memcpy(dst, src, size);
|
||||||
|
} else {
|
||||||
|
int remaining = size / kPointerSize;
|
||||||
|
do {
|
||||||
|
remaining--;
|
||||||
|
*dst++ = *src++;
|
||||||
|
} while (remaining > 0);
|
||||||
|
}
|
||||||
|
|
||||||
// Set the forwarding address.
|
// Set the forwarding address.
|
||||||
(*source_p)->set_map_word(MapWord::FromForwardingAddress(target));
|
(*source_p)->set_map_word(MapWord::FromForwardingAddress(target));
|
||||||
|
Loading…
Reference in New Issue
Block a user