Chromium Code Reviews| Index: src/heap.cc |
| diff --git a/src/heap.cc b/src/heap.cc |
| index 7f748b9fabf78ca7ddb9443825213c7ff802d8e2..29f42b94347eb5f79d2d7164e62816afa8a93c5c 100644 |
| --- a/src/heap.cc |
| +++ b/src/heap.cc |
| @@ -4314,11 +4314,15 @@ bool Heap::LookupSymbolIfExists(String* string, String** symbol) { |
| #ifdef DEBUG |
| void Heap::ZapFromSpace() { |
|
Erik Corry
2011/06/07 08:49:55
I wonder why this isn't called NukeFromOrbit?
Lasse Reichstein
2011/06/07 09:36:06
We weren't sure.
|
| - ASSERT(reinterpret_cast<Object*>(kFromSpaceZapValue)->IsFailure()); |
| - for (Address a = new_space_.FromSpaceLow(); |
| - a < new_space_.FromSpaceHigh(); |
| - a += kPointerSize) { |
| - Memory::Address_at(a) = kFromSpaceZapValue; |
| + NewSpacePageIterator it(new_space_.FromSpaceLow(), |
| + new_space_.FromSpaceHigh()); |
| + while (it.has_next()) { |
| + NewSpacePage* page = it.next(); |
| + for (Address cursor = page->body(), limit = page->body_limit(); |
| + cursor < limit; |
| + cursor += kPointerSize) { |
| + Memory::Address_at(cursor) = kFromSpaceZapValue; |
| + } |
| } |
| } |
| #endif // DEBUG |