Revision: 4479
Author: [email protected]
Date: Thu Apr 22 11:50:27 2010
Log: Use Heap::CreateFillerArrayAt to create a filler instead of copied code.

Review URL: http://codereview.chromium.org/1770001
http://code.google.com/p/v8/source/detail?r=4479

Modified:
 /branches/bleeding_edge/src/builtins.cc
 /branches/bleeding_edge/src/heap.cc

=======================================
--- /branches/bleeding_edge/src/builtins.cc     Tue Apr  6 10:58:28 2010
+++ /branches/bleeding_edge/src/builtins.cc     Thu Apr 22 11:50:27 2010
@@ -348,15 +348,7 @@
   // 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);
=======================================
--- /branches/bleeding_edge/src/heap.cc Mon Apr 19 12:30:11 2010
+++ /branches/bleeding_edge/src/heap.cc Thu Apr 22 11:50:27 2010
@@ -2188,9 +2188,11 @@
   if (size == 0) return;
   HeapObject* filler = HeapObject::FromAddress(addr);
   if (size == kPointerSize) {
-    filler->set_map(Heap::one_pointer_filler_map());
+    filler->set_map(one_pointer_filler_map());
+  } else if (size == 2 * kPointerSize) {
+    filler->set_map(two_pointer_filler_map());
   } else {
-    filler->set_map(Heap::byte_array_map());
+    filler->set_map(byte_array_map());
     ByteArray::cast(filler)->set_length(ByteArray::LengthFor(size));
   }
 }

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to