| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_HEAP_SPACES_INL_H_ | 5 #ifndef V8_HEAP_SPACES_INL_H_ |
| 6 #define V8_HEAP_SPACES_INL_H_ | 6 #define V8_HEAP_SPACES_INL_H_ |
| 7 | 7 |
| 8 #include "src/heap/spaces.h" | 8 #include "src/heap/spaces.h" |
| 9 #include "src/heap-profiler.h" | 9 #include "src/heap-profiler.h" |
| 10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 AllocationResult PagedSpace::AllocateRawDoubleAligned(int size_in_bytes) { | 296 AllocationResult PagedSpace::AllocateRawDoubleAligned(int size_in_bytes) { |
| 297 DCHECK(identity() == OLD_SPACE); | 297 DCHECK(identity() == OLD_SPACE); |
| 298 HeapObject* object = AllocateLinearlyDoubleAlign(size_in_bytes); | 298 HeapObject* object = AllocateLinearlyDoubleAlign(size_in_bytes); |
| 299 int aligned_size_in_bytes = size_in_bytes + kPointerSize; | 299 int aligned_size_in_bytes = size_in_bytes + kPointerSize; |
| 300 | 300 |
| 301 if (object == NULL) { | 301 if (object == NULL) { |
| 302 object = free_list_.Allocate(aligned_size_in_bytes); | 302 object = free_list_.Allocate(aligned_size_in_bytes); |
| 303 if (object == NULL) { | 303 if (object == NULL) { |
| 304 object = SlowAllocateRaw(aligned_size_in_bytes); | 304 object = SlowAllocateRaw(aligned_size_in_bytes); |
| 305 } | 305 } |
| 306 object = heap()->EnsureDoubleAligned(object, aligned_size_in_bytes); | 306 if (object != NULL) { |
| 307 object = heap()->EnsureDoubleAligned(object, aligned_size_in_bytes); |
| 308 } |
| 307 } | 309 } |
| 308 | 310 |
| 309 if (object != NULL) { | 311 if (object != NULL) { |
| 310 MSAN_ALLOCATED_UNINITIALIZED_MEMORY(object->address(), size_in_bytes); | 312 MSAN_ALLOCATED_UNINITIALIZED_MEMORY(object->address(), size_in_bytes); |
| 311 return object; | 313 return object; |
| 312 } | 314 } |
| 313 | 315 |
| 314 return AllocationResult::Retry(identity()); | 316 return AllocationResult::Retry(identity()); |
| 315 } | 317 } |
| 316 | 318 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 | 377 |
| 376 | 378 |
| 377 intptr_t LargeObjectSpace::Available() { | 379 intptr_t LargeObjectSpace::Available() { |
| 378 return ObjectSizeFor(heap()->isolate()->memory_allocator()->Available()); | 380 return ObjectSizeFor(heap()->isolate()->memory_allocator()->Available()); |
| 379 } | 381 } |
| 380 | 382 |
| 381 } | 383 } |
| 382 } // namespace v8::internal | 384 } // namespace v8::internal |
| 383 | 385 |
| 384 #endif // V8_HEAP_SPACES_INL_H_ | 386 #endif // V8_HEAP_SPACES_INL_H_ |
| OLD | NEW |