Chromium Code Reviews| Index: src/heap.cc |
| diff --git a/src/heap.cc b/src/heap.cc |
| index a2c5752d736253e2434f3affd9e6ac26bb9b0d00..3cdec5725a736b617eb4b15b1836407f7f57137b 100644 |
| --- a/src/heap.cc |
| +++ b/src/heap.cc |
| @@ -4992,7 +4992,9 @@ bool Heap::Setup(bool create_heap_objects) { |
| // size) and old-space-size if set or the initial values of semispace_size_ |
| // and old_generation_size_ otherwise. |
| if (!configured_) { |
| - if (!ConfigureHeapDefault()) return false; |
| + if (!ConfigureHeapDefault()) { |
|
Erik Corry
2011/07/15 21:37:33
This looks like an unnecessary change.
Lasse Reichstein
2011/08/01 12:40:33
Added to allow a breakpoint at the return.
It's a
|
| + return false; |
| + } |
| } |
| gc_initializer_mutex->Lock(); |
| @@ -5008,8 +5010,10 @@ bool Heap::Setup(bool create_heap_objects) { |
| MarkMapPointersAsEncoded(false); |
| // Setup memory allocator. |
| - if (!isolate_->memory_allocator()->Setup(MaxReserved(), MaxExecutableSize())) |
| - return false; |
| + if (!isolate_->memory_allocator()-> |
| + Setup(MaxReserved(), MaxExecutableSize())) { |
| + return false; |
| + } |
| // Setup new space. |
| if (!new_space_.Setup(reserved_semispace_size_)) { |
| @@ -5022,8 +5026,9 @@ bool Heap::Setup(bool create_heap_objects) { |
| max_old_generation_size_, |
| OLD_POINTER_SPACE, |
| NOT_EXECUTABLE); |
| - if (old_pointer_space_ == NULL) return false; |
| - if (!old_pointer_space_->Setup()) return false; |
| + if (old_pointer_space_ == NULL || !old_pointer_space_->Setup()) { |
| + return false; |
| + } |
| // Initialize old data space. |
| old_data_space_ = |
| @@ -5031,8 +5036,9 @@ bool Heap::Setup(bool create_heap_objects) { |
| max_old_generation_size_, |
| OLD_DATA_SPACE, |
| NOT_EXECUTABLE); |
| - if (old_data_space_ == NULL) return false; |
| - if (!old_data_space_->Setup()) return false; |
| + if (old_data_space_ == NULL || !old_data_space_->Setup()) { |
| + return false; |
| + } |
| // Initialize the code space, set its maximum capacity to the old |
| // generation size. It needs executable memory. |
| @@ -5046,35 +5052,45 @@ bool Heap::Setup(bool create_heap_objects) { |
| code_space_ = |
| new OldSpace(this, max_old_generation_size_, CODE_SPACE, EXECUTABLE); |
| - if (code_space_ == NULL) return false; |
| - if (!code_space_->Setup()) return false; |
| + if (code_space_ == NULL || !code_space_->Setup()) { |
|
Erik Corry
2011/07/15 21:37:33
These all fit on one line.
|
| + return false; |
| + } |
| // Initialize map space. |
| map_space_ = new MapSpace(this, |
| max_old_generation_size_, |
| FLAG_max_map_space_pages, |
| MAP_SPACE); |
| - if (map_space_ == NULL) return false; |
| - if (!map_space_->Setup()) return false; |
| + if (map_space_ == NULL || !map_space_->Setup()) { |
| + return false; |
| + } |
| // Initialize global property cell space. |
| cell_space_ = new CellSpace(this, max_old_generation_size_, CELL_SPACE); |
| - if (cell_space_ == NULL) return false; |
| - if (!cell_space_->Setup()) return false; |
| + if (cell_space_ == NULL || !cell_space_->Setup()) { |
| + return false; |
| + } |
| // The large object code space may contain code or data. We set the memory |
| // to be non-executable here for safety, but this means we need to enable it |
| // explicitly when allocating large code objects. |
| lo_space_ = new LargeObjectSpace(this, LO_SPACE); |
| - if (lo_space_ == NULL) return false; |
| - if (!lo_space_->Setup()) return false; |
| + if (lo_space_ == NULL || !lo_space_->Setup()) { |
| + return false; |
| + } |
| if (create_heap_objects) { |
| // Create initial maps. |
| - if (!CreateInitialMaps()) return false; |
| - if (!CreateApiObjects()) return false; |
| + if (!CreateInitialMaps()) { |
| + return false; |
| + } |
| + if (!CreateApiObjects()) { |
| + return false; |
| + } |
| // Create initial objects |
| - if (!CreateInitialObjects()) return false; |
| + if (!CreateInitialObjects()) { |
| + return false; |
| + } |
| global_contexts_list_ = undefined_value(); |
| } |
| @@ -5090,7 +5106,7 @@ bool Heap::Setup(bool create_heap_objects) { |
| void Heap::SetStackLimits() { |
| ASSERT(isolate_ != NULL); |
| - ASSERT(isolate_ == isolate()); |
| + CHECK_EQ(isolate_, isolate()); |
|
Lasse Reichstein
2011/08/01 12:40:33
This should probably have been ASSERT_EQ.
|
| // On 64 bit machines, pointers are generally out of range of Smis. We write |
| // something that looks like an out of range Smi to the GC. |