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

Unified Diff: test/cctest/test-spaces.cc

Issue 3970005: Make Failure inherit from MaybeObject instead of Object. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 2 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 | « test/cctest/test-serialize.cc ('k') | test/cctest/test-strings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-spaces.cc
===================================================================
--- test/cctest/test-spaces.cc (revision 5696)
+++ test/cctest/test-spaces.cc (working copy)
@@ -160,8 +160,8 @@
CHECK(new_space.HasBeenSetup());
while (new_space.Available() >= Page::kMaxHeapObjectSize) {
- Object* obj = new_space.AllocateRaw(Page::kMaxHeapObjectSize);
- CHECK(!obj->IsFailure());
+ Object* obj =
+ new_space.AllocateRaw(Page::kMaxHeapObjectSize)->ToObjectUnchecked();
CHECK(new_space.Contains(HeapObject::cast(obj)));
}
@@ -188,8 +188,7 @@
CHECK(s->Setup(start, size));
while (s->Available() > 0) {
- Object* obj = s->AllocateRaw(Page::kMaxHeapObjectSize);
- CHECK(!obj->IsFailure());
+ s->AllocateRaw(Page::kMaxHeapObjectSize)->ToObjectUnchecked();
}
s->TearDown();
@@ -207,8 +206,7 @@
Map* faked_map = reinterpret_cast<Map*>(HeapObject::FromAddress(0));
int lo_size = Page::kPageSize;
- Object* obj = lo->AllocateRaw(lo_size);
- CHECK(!obj->IsFailure());
+ Object* obj = lo->AllocateRaw(lo_size)->ToObjectUnchecked();
CHECK(obj->IsHeapObject());
HeapObject* ho = HeapObject::cast(obj);
@@ -222,16 +220,16 @@
while (true) {
intptr_t available = lo->Available();
- obj = lo->AllocateRaw(lo_size);
- if (obj->IsFailure()) break;
+ { MaybeObject* maybe_obj = lo->AllocateRaw(lo_size);
+ if (!maybe_obj->ToObject(&obj)) break;
+ }
HeapObject::cast(obj)->set_map(faked_map);
CHECK(lo->Available() < available);
};
CHECK(!lo->IsEmpty());
- obj = lo->AllocateRaw(lo_size);
- CHECK(obj->IsFailure());
+ CHECK(lo->AllocateRaw(lo_size)->IsFailure());
lo->TearDown();
delete lo;
« no previous file with comments | « test/cctest/test-serialize.cc ('k') | test/cctest/test-strings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698