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

Unified Diff: src/serialize.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 | « src/runtime.cc ('k') | src/spaces.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/serialize.cc
===================================================================
--- src/serialize.cc (revision 5696)
+++ src/serialize.cc (working copy)
@@ -555,14 +555,16 @@
if (!SpaceIsLarge(space_index)) {
ASSERT(!SpaceIsPaged(space_index) ||
size <= Page::kPageSize - Page::kObjectStartOffset);
- Object* new_allocation;
+ MaybeObject* maybe_new_allocation;
if (space_index == NEW_SPACE) {
- new_allocation = reinterpret_cast<NewSpace*>(space)->AllocateRaw(size);
+ maybe_new_allocation =
+ reinterpret_cast<NewSpace*>(space)->AllocateRaw(size);
} else {
- new_allocation = reinterpret_cast<PagedSpace*>(space)->AllocateRaw(size);
+ maybe_new_allocation =
+ reinterpret_cast<PagedSpace*>(space)->AllocateRaw(size);
}
+ Object* new_allocation = maybe_new_allocation->ToObjectUnchecked();
HeapObject* new_object = HeapObject::cast(new_allocation);
- ASSERT(!new_object->IsFailure());
address = new_object->address();
high_water_[space_index] = address + size;
} else {
@@ -571,14 +573,14 @@
LargeObjectSpace* lo_space = reinterpret_cast<LargeObjectSpace*>(space);
Object* new_allocation;
if (space_index == kLargeData) {
- new_allocation = lo_space->AllocateRaw(size);
+ new_allocation = lo_space->AllocateRaw(size)->ToObjectUnchecked();
} else if (space_index == kLargeFixedArray) {
- new_allocation = lo_space->AllocateRawFixedArray(size);
+ new_allocation =
+ lo_space->AllocateRawFixedArray(size)->ToObjectUnchecked();
} else {
ASSERT_EQ(kLargeCode, space_index);
- new_allocation = lo_space->AllocateRawCode(size);
+ new_allocation = lo_space->AllocateRawCode(size)->ToObjectUnchecked();
}
- ASSERT(!new_allocation->IsFailure());
HeapObject* new_object = HeapObject::cast(new_allocation);
// Record all large objects in the same space.
address = new_object->address();
« no previous file with comments | « src/runtime.cc ('k') | src/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698