| 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 SkipList::Update(object->address(), size_in_bytes); | 349 SkipList::Update(object->address(), size_in_bytes); |
| 350 } | 350 } |
| 351 MSAN_ALLOCATED_UNINITIALIZED_MEMORY(object->address(), size_in_bytes); | 351 MSAN_ALLOCATED_UNINITIALIZED_MEMORY(object->address(), size_in_bytes); |
| 352 return object; | 352 return object; |
| 353 } | 353 } |
| 354 | 354 |
| 355 return AllocationResult::Retry(identity()); | 355 return AllocationResult::Retry(identity()); |
| 356 } | 356 } |
| 357 | 357 |
| 358 | 358 |
| 359 AllocationResult PagedSpace::AllocateRawUnalignedSynchronized( |
| 360 int size_in_bytes) { |
| 361 base::LockGuard<base::Mutex> lock_guard(&space_mutex_); |
| 362 return AllocateRawUnaligned(size_in_bytes); |
| 363 } |
| 364 |
| 365 |
| 359 // Raw allocation. | 366 // Raw allocation. |
| 360 AllocationResult PagedSpace::AllocateRawAligned(int size_in_bytes, | 367 AllocationResult PagedSpace::AllocateRawAligned(int size_in_bytes, |
| 361 AllocationAlignment alignment) { | 368 AllocationAlignment alignment) { |
| 362 DCHECK(identity() == OLD_SPACE); | 369 DCHECK(identity() == OLD_SPACE); |
| 363 int allocation_size = size_in_bytes; | 370 int allocation_size = size_in_bytes; |
| 364 HeapObject* object = AllocateLinearlyAligned(&allocation_size, alignment); | 371 HeapObject* object = AllocateLinearlyAligned(&allocation_size, alignment); |
| 365 | 372 |
| 366 if (object == NULL) { | 373 if (object == NULL) { |
| 367 // We don't know exactly how much filler we need to align until space is | 374 // We don't know exactly how much filler we need to align until space is |
| 368 // allocated, so assume the worst case. | 375 // allocated, so assume the worst case. |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 | 484 |
| 478 | 485 |
| 479 intptr_t LargeObjectSpace::Available() { | 486 intptr_t LargeObjectSpace::Available() { |
| 480 return ObjectSizeFor(heap()->isolate()->memory_allocator()->Available()); | 487 return ObjectSizeFor(heap()->isolate()->memory_allocator()->Available()); |
| 481 } | 488 } |
| 482 | 489 |
| 483 } | 490 } |
| 484 } // namespace v8::internal | 491 } // namespace v8::internal |
| 485 | 492 |
| 486 #endif // V8_HEAP_SPACES_INL_H_ | 493 #endif // V8_HEAP_SPACES_INL_H_ |
| OLD | NEW |