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

Unified Diff: src/builtins.cc

Issue 1770001: Use Heap::CreateFillerArrayAt to create a filler instead of copied code. (Closed)
Patch Set: Created 10 years, 8 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.cc » ('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 767820acb8cccba53a88ea01fe05ef90eed3a5c0..9850f5583830664fb52330b712df461fb29154bd 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -348,15 +348,7 @@ static FixedArray* LeftTrimFixedArray(FixedArray* elms, int to_trim) {
// Technically in new space this write might be omitted (except for
// debug mode which iterates through the heap), but to play safer
// we still do it.
- if (to_trim == 1) {
- former_start[0] = Heap::raw_unchecked_one_pointer_filler_map();
- } else if (to_trim == 2) {
- former_start[0] = Heap::raw_unchecked_two_pointer_filler_map();
- } else {
- former_start[0] = Heap::raw_unchecked_byte_array_map();
- ByteArray* as_byte_array = reinterpret_cast<ByteArray*>(elms);
- as_byte_array->set_length(ByteArray::LengthFor(to_trim * kPointerSize));
- }
+ Heap::CreateFillerObjectAt(elms->address(), to_trim * kPointerSize);
former_start[to_trim] = Heap::fixed_array_map();
former_start[to_trim + 1] = reinterpret_cast<Object*>(len - to_trim);
« no previous file with comments | « no previous file | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698