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

Unified Diff: src/heap.cc

Issue 661105: Faster filling of arrays of holes. (Closed)
Patch Set: Addressing comments Created 10 years, 10 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/utils.h » ('j') | 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 cfb786ac7ab9e8b3f00910029d31b5d6f63e14ca..d96b6f7d21b4e319bd48722c3e8a6fd0ac39b320 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -2978,11 +2978,10 @@ Object* Heap::AllocateFixedArrayWithHoles(int length) {
FixedArray* array = FixedArray::cast(result);
array->set_length(length);
// Initialize body.
- Object* value = the_hole_value();
- for (int index = 0; index < length; index++) {
- ASSERT(!Heap::InNewSpace(value)); // value = the hole
- array->set(index, value, SKIP_WRITE_BARRIER);
- }
+ ASSERT(!Heap::InNewSpace(the_hole_value()));
+ MemsetPointer(HeapObject::RawField(array, FixedArray::kHeaderSize),
+ the_hole_value(),
+ length);
}
return result;
}
« no previous file with comments | « no previous file | src/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698