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

Unified Diff: src/spaces.h

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/objects-inl.h ('k') | src/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.h
diff --git a/src/spaces.h b/src/spaces.h
index 1fb856265bcb2ed1dce6d91d9deeeb15bf9e1569..5670f6a62bd94e74f3b1cde53e65e02b806bbac7 100644
--- a/src/spaces.h
+++ b/src/spaces.h
@@ -1722,10 +1722,10 @@ class PagedSpace : public Space {
bool Contains(HeapObject* o) { return Contains(o->address()); }
// Given an address occupied by a live object, return that object if it is
- // in this space, or Failure::Exception() if it is not. The implementation
- // iterates over objects in the page containing the address, the cost is
- // linear in the number of objects in the page. It may be slow.
- MUST_USE_RESULT MaybeObject* FindObject(Address addr);
+ // in this space, or a Smi if it is not. The implementation iterates over
+ // objects in the page containing the address, the cost is linear in the
+ // number of objects in the page. It may be slow.
+ Object* FindObject(Address addr);
// During boot the free_space_map is created, and afterwards we may need
// to write it into the free list nodes that were already created.
@@ -2841,10 +2841,9 @@ class LargeObjectSpace : public Space {
return page_count_;
}
- // Finds an object for a given address, returns Failure::Exception()
- // if it is not found. The function iterates through all objects in this
- // space, may be slow.
- MaybeObject* FindObject(Address a);
+ // Finds an object for a given address, returns a Smi if it is not found.
+ // The function iterates through all objects in this space, may be slow.
+ Object* FindObject(Address a);
// Finds a large object page containing the given address, returns NULL
// if such a page doesn't exist.
@@ -2872,7 +2871,7 @@ class LargeObjectSpace : public Space {
#endif
// Checks whether an address is in the object area in this space. It
// iterates all objects in the space. May be slow.
- bool SlowContains(Address addr) { return !FindObject(addr)->IsFailure(); }
+ bool SlowContains(Address addr) { return FindObject(addr)->IsHeapObject(); }
private:
intptr_t max_capacity_;
« no previous file with comments | « src/objects-inl.h ('k') | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698