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

Unified Diff: test/cctest/test-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 | « test/cctest/test-serialize.cc ('k') | test/cctest/test-symbols.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-spaces.cc
diff --git a/test/cctest/test-spaces.cc b/test/cctest/test-spaces.cc
index 223912e37b55ffc6b0b5f01a1819fdc160bcd15c..47e2536fc9a79e2598b65455a18767bf442dbcd4 100644
--- a/test/cctest/test-spaces.cc
+++ b/test/cctest/test-spaces.cc
@@ -328,9 +328,8 @@ TEST(NewSpace) {
CHECK(new_space.HasBeenSetUp());
while (new_space.Available() >= Page::kMaxRegularHeapObjectSize) {
- Object* obj =
- new_space.AllocateRaw(Page::kMaxRegularHeapObjectSize)->
- ToObjectUnchecked();
+ Object* obj = new_space.AllocateRaw(
+ Page::kMaxRegularHeapObjectSize).ToObjectChecked();
CHECK(new_space.Contains(HeapObject::cast(obj)));
}
@@ -359,7 +358,7 @@ TEST(OldSpace) {
CHECK(s->SetUp());
while (s->Available() > 0) {
- s->AllocateRaw(Page::kMaxRegularHeapObjectSize)->ToObjectUnchecked();
+ s->AllocateRaw(Page::kMaxRegularHeapObjectSize).ToObjectChecked();
}
s->TearDown();
@@ -377,7 +376,7 @@ TEST(LargeObjectSpace) {
int lo_size = Page::kPageSize;
- Object* obj = lo->AllocateRaw(lo_size, NOT_EXECUTABLE)->ToObjectUnchecked();
+ Object* obj = lo->AllocateRaw(lo_size, NOT_EXECUTABLE).ToObjectChecked();
CHECK(obj->IsHeapObject());
HeapObject* ho = HeapObject::cast(obj);
@@ -390,15 +389,15 @@ TEST(LargeObjectSpace) {
while (true) {
intptr_t available = lo->Available();
- { MaybeObject* maybe_obj = lo->AllocateRaw(lo_size, NOT_EXECUTABLE);
- if (!maybe_obj->ToObject(&obj)) break;
+ { AllocationResult allocation = lo->AllocateRaw(lo_size, NOT_EXECUTABLE);
+ if (allocation.IsRetry()) break;
}
CHECK(lo->Available() < available);
};
CHECK(!lo->IsEmpty());
- CHECK(lo->AllocateRaw(lo_size, NOT_EXECUTABLE)->IsFailure());
+ CHECK(lo->AllocateRaw(lo_size, NOT_EXECUTABLE).IsRetry());
}
« no previous file with comments | « test/cctest/test-serialize.cc ('k') | test/cctest/test-symbols.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698