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

Unified Diff: src/builtins.cc

Issue 1530005: Refactor word copying logic. (Closed)
Patch Set: Assert added and param renamed Created 10 years, 9 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
« no previous file with comments | « no previous file | src/heap-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index feb912f4147754a7ebc2f09c60dc65f18b22ef0a..dd6d3bc60a6ff8aff65c248cfa6f815ad61a3d42 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -268,9 +268,9 @@ static void CopyElements(AssertNoAllocation* no_gc,
int src_index,
int len) {
ASSERT(dst != src); // Use MoveElements instead.
- memcpy(dst->data_start() + dst_index,
- src->data_start() + src_index,
- len * kPointerSize);
+ CopyWords(dst->data_start() + dst_index,
+ src->data_start() + src_index,
+ len);
WriteBarrierMode mode = dst->GetWriteBarrierMode(*no_gc);
if (mode == UPDATE_WRITE_BARRIER) {
Heap::RecordWrites(dst->address(), dst->OffsetOfElementAt(dst_index), len);
« no previous file with comments | « no previous file | src/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698