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

Side by Side Diff: src/heap/spaces.cc

Issue 2328503002: [heap] Fix debug check in ShrinkToHighWaterMark (Closed)
Patch Set: better order Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/heap/spaces.h" 5 #include "src/heap/spaces.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 788
789 #ifdef DEBUG 789 #ifdef DEBUG
790 // Check the the filler is indeed the last filler on the page. 790 // Check the the filler is indeed the last filler on the page.
791 HeapObjectIterator it(this); 791 HeapObjectIterator it(this);
792 HeapObject* filler2 = nullptr; 792 HeapObject* filler2 = nullptr;
793 for (HeapObject* obj = it.Next(); obj != nullptr; obj = it.Next()) { 793 for (HeapObject* obj = it.Next(); obj != nullptr; obj = it.Next()) {
794 filler2 = HeapObject::FromAddress(obj->address() + obj->Size()); 794 filler2 = HeapObject::FromAddress(obj->address() + obj->Size());
795 } 795 }
796 if (filler2 == nullptr || filler2->address() == area_end()) return 0; 796 if (filler2 == nullptr || filler2->address() == area_end()) return 0;
797 DCHECK(filler2->IsFiller()); 797 DCHECK(filler2->IsFiller());
798 // The deserializer might leave behind fillers. In this case we need to
799 // iterate even further.
800 while ((filler2->address() + filler2->Size()) != area_end()) {
801 filler2 = HeapObject::FromAddress(filler2->address() + filler2->Size());
802 DCHECK(filler2->IsFiller());
803 }
798 DCHECK_EQ(filler->address(), filler2->address()); 804 DCHECK_EQ(filler->address(), filler2->address());
799 #endif // DEBUG 805 #endif // DEBUG
800 806
801 size_t unused = RoundDown( 807 size_t unused = RoundDown(
802 static_cast<size_t>(area_end() - filler->address() - FreeSpace::kSize), 808 static_cast<size_t>(area_end() - filler->address() - FreeSpace::kSize),
803 base::OS::CommitPageSize()); 809 base::OS::CommitPageSize());
804 if (unused > 0) { 810 if (unused > 0) {
805 if (FLAG_trace_gc_verbose) { 811 if (FLAG_trace_gc_verbose) {
806 PrintIsolate(heap()->isolate(), "Shrinking page %p: end %p -> %p\n", 812 PrintIsolate(heap()->isolate(), "Shrinking page %p: end %p -> %p\n",
807 reinterpret_cast<void*>(this), 813 reinterpret_cast<void*>(this),
(...skipping 2421 matching lines...) Expand 10 before | Expand all | Expand 10 after
3229 object->ShortPrint(); 3235 object->ShortPrint();
3230 PrintF("\n"); 3236 PrintF("\n");
3231 } 3237 }
3232 printf(" --------------------------------------\n"); 3238 printf(" --------------------------------------\n");
3233 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 3239 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
3234 } 3240 }
3235 3241
3236 #endif // DEBUG 3242 #endif // DEBUG
3237 } // namespace internal 3243 } // namespace internal
3238 } // namespace v8 3244 } // namespace v8
OLDNEW
« 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