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

Unified Diff: src/heap/heap.cc

Issue 439863006: Precise sweeping makes zapping of garbage memory when trimming arrays obsolete (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698