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

Unified Diff: src/spaces.cc

Issue 245963007: Clean up some uses of Failures and MaybeObjects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address 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/stub-cache.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 996afe46770a8bbef4270637501819e9b67c98e2..5a7bc4b1af0d6c95634182f9d06d7c133b9dd905 100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -1005,11 +1005,11 @@ size_t PagedSpace::CommittedPhysicalMemory() {
}
-MaybeObject* PagedSpace::FindObject(Address addr) {
+Object* PagedSpace::FindObject(Address addr) {
// Note: this function can only be called on precisely swept spaces.
ASSERT(!heap()->mark_compact_collector()->in_use());
- if (!Contains(addr)) return Failure::Exception();
+ if (!Contains(addr)) return Smi::FromInt(0); // Signaling not found.
Page* p = Page::FromAddress(addr);
HeapObjectIterator it(p, NULL);
@@ -1020,7 +1020,7 @@ MaybeObject* PagedSpace::FindObject(Address addr) {
}
UNREACHABLE();
- return Failure::Exception();
+ return Smi::FromInt(0);
}
@@ -3015,12 +3015,12 @@ size_t LargeObjectSpace::CommittedPhysicalMemory() {
// GC support
-MaybeObject* LargeObjectSpace::FindObject(Address a) {
+Object* LargeObjectSpace::FindObject(Address a) {
LargePage* page = FindPage(a);
if (page != NULL) {
return page->GetObject();
}
- return Failure::Exception();
+ return Smi::FromInt(0); // Signaling not found.
}
@@ -3101,7 +3101,7 @@ bool LargeObjectSpace::Contains(HeapObject* object) {
bool owned = (chunk->owner() == this);
- SLOW_ASSERT(!owned || !FindObject(address)->IsFailure());
+ SLOW_ASSERT(!owned || FindObject(address)->IsHeapObject());
return owned;
}
« no previous file with comments | « src/spaces.h ('k') | src/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698