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

Unified Diff: src/heap/spaces-inl.h

Issue 2462613002: [not for landing] Debugging gpu failures
Patch Set: more checks Created 4 years, 1 month 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 | « src/heap/spaces.cc ('k') | src/runtime/runtime-internal.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces-inl.h
diff --git a/src/heap/spaces-inl.h b/src/heap/spaces-inl.h
index f9f6f08bd54aa320c27e688791bbbf84d36c843b..2606b909ce4be37c4c0e69d060cdf8c3b346d217 100644
--- a/src/heap/spaces-inl.h
+++ b/src/heap/spaces-inl.h
@@ -380,6 +380,12 @@ bool FreeListCategory::is_linked() {
// the paged spaces.
HeapObject* PagedSpace::AllocateLinearly(int size_in_bytes) {
Address current_top = allocation_info_.top();
+ if (allocation_info_.top() > allocation_info_.limit()) {
+ PrintF("top > limit: %p %p\n",
+ reinterpret_cast<void*>(allocation_info_.top()),
+ reinterpret_cast<void*>(allocation_info_.limit())),
+ PrintStackFramesAndDie();
+ }
Address new_top = current_top + size_in_bytes;
if (new_top > allocation_info_.limit()) return NULL;
@@ -477,14 +483,20 @@ AllocationResult PagedSpace::AllocateRawAligned(int size_in_bytes,
object = free_list_.Allocate(allocation_size);
if (object == NULL) {
object = SlowAllocateRaw(allocation_size);
+ } else {
+ DCHECK(allocation_info_.limit() != nullptr);
}
if (object != NULL && filler_size != 0) {
+ DCHECK(allocation_info_.limit() != nullptr);
object = heap()->AlignWithFiller(object, size_in_bytes, allocation_size,
alignment);
+ DCHECK(allocation_info_.limit() != nullptr);
// Filler objects are initialized, so mark only the aligned object memory
// as uninitialized.
allocation_size = size_in_bytes;
}
+ } else {
+ DCHECK(allocation_info_.limit() != nullptr);
}
if (object != NULL) {
@@ -508,7 +520,9 @@ AllocationResult PagedSpace::AllocateRaw(int size_in_bytes,
#endif
HeapObject* heap_obj = nullptr;
if (!result.IsRetry() && result.To(&heap_obj)) {
+ DCHECK(allocation_info_.limit() != nullptr);
AllocationStep(heap_obj->address(), size_in_bytes);
+ DCHECK(allocation_info_.limit() != nullptr);
}
return result;
}
« no previous file with comments | « src/heap/spaces.cc ('k') | src/runtime/runtime-internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698