Reviewers: Michael Starzinger,

Description:
Precise sweeping makes zapping of garbage memory when trimming arrays obsolete

BUG=

Please review this at https://codereview.chromium.org/439863006/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+0, -27 lines):
  M src/heap/heap.cc


Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 6b1bb33c7b698a5473cd0bee0a2203e7f95d3e47..3f3d591025ce5522b99ff474f5e6d5561de47c2e 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -3260,15 +3260,6 @@ void Heap::AdjustLiveBytes(Address address, int by, InvocationMode mode) {
 }


-static void ZapFixedArrayForTrimming(Address address, int elements_to_trim) {
-  Object** zap = reinterpret_cast<Object**>(address);
-  zap++;  // Header of filler must be at least one word so skip that.
-  for (int i = 1; i < elements_to_trim; i++) {
-    *zap++ = Smi::FromInt(0);
-  }
-}
-
-
 FixedArrayBase* Heap::LeftTrimFixedArray(FixedArrayBase* object,
                                          int elements_to_trim) {
const int element_size = object->IsFixedArray() ? kPointerSize : kDoubleSize; @@ -3291,15 +3282,6 @@ FixedArrayBase* Heap::LeftTrimFixedArray(FixedArrayBase* object,
   // Calculate location of new array start.
   Address new_start = object->address() + bytes_to_trim;

-  if (bytes_to_trim > FreeSpace::kHeaderSize &&
-      object->IsFixedArray() &&
-      !new_space()->Contains(object)) {
- // If we are doing a big trim in old space then we zap the space that was
-    // formerly part of the array so that the GC (aided by the card-based
-    // remembered set) won't find pointers to new-space there.
-    ZapFixedArrayForTrimming(object->address(), elements_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.
@@ -3348,15 +3330,6 @@ void Heap::RightTrimFixedArray(FixedArrayBase* object, int elements_to_trim) {
   // Calculate location of new array end.
   Address new_end = object->address() + object->Size() - bytes_to_trim;

-  if (bytes_to_trim > FreeSpace::kHeaderSize &&
-      object->IsFixedArray() &&
-      (mode != Heap::FROM_GC || Heap::ShouldZapGarbage())) {
- // If we are doing a big trim in old space then we zap the space that was
-    // formerly part of the array so that the GC (aided by the card-based
-    // remembered set) won't find pointers to new-space there.
-    ZapFixedArrayForTrimming(new_end, elements_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.


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to