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

Unified Diff: src/spaces.cc

Issue 259173003: Kiss goodbye to MaybeObject. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebase + addressed comments Created 6 years, 8 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 | « src/spaces.h ('k') | src/spaces-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.cc
diff --git a/src/spaces.cc b/src/spaces.cc
index c4ebabb32fdc45ff89e6ebe0ff2532e30212041b..6d25d75715337cedf16de815e78cf522f4a39b97 100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -1397,7 +1397,7 @@ bool NewSpace::AddFreshPage() {
}
-MaybeObject* NewSpace::SlowAllocateRaw(int size_in_bytes) {
+AllocationResult NewSpace::SlowAllocateRaw(int size_in_bytes) {
Address old_top = allocation_info_.top();
Address high = to_space_.page_high();
if (allocation_info_.limit() < high) {
@@ -1419,7 +1419,7 @@ MaybeObject* NewSpace::SlowAllocateRaw(int size_in_bytes) {
top_on_previous_step_ = to_space_.page_low();
return AllocateRaw(size_in_bytes);
} else {
- return Failure::RetryAfterGC();
+ return AllocationResult::Retry();
}
}
@@ -2842,22 +2842,22 @@ void LargeObjectSpace::TearDown() {
}
-MaybeObject* LargeObjectSpace::AllocateRaw(int object_size,
- Executability executable) {
+AllocationResult LargeObjectSpace::AllocateRaw(int object_size,
+ Executability executable) {
// Check if we want to force a GC before growing the old space further.
// If so, fail the allocation.
if (!heap()->always_allocate() &&
heap()->OldGenerationAllocationLimitReached()) {
- return Failure::RetryAfterGC(identity());
+ return AllocationResult::Retry(identity());
}
if (Size() + object_size > max_capacity_) {
- return Failure::RetryAfterGC(identity());
+ return AllocationResult::Retry(identity());
}
LargePage* page = heap()->isolate()->memory_allocator()->
AllocateLargePage(object_size, this, executable);
- if (page == NULL) return Failure::RetryAfterGC(identity());
+ if (page == NULL) return AllocationResult::Retry(identity());
ASSERT(page->area_size() >= object_size);
size_ += static_cast<int>(page->size());
« no previous file with comments | « src/spaces.h ('k') | src/spaces-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698