5 #ifndef V8_HEAP_LOCAL_ALLOCATOR_H_ 6 #define V8_HEAP_LOCAL_ALLOCATOR_H_ 8 #include "src/globals.h" 9 #include "src/heap/heap.h" 10 #include "src/heap/spaces.h" 19 static const int kLabSize = 32 * KB;
20 static const int kMaxLabObjectSize = 8 * KB;
24 new_space_(heap->new_space()),
25 compaction_spaces_(heap),
26 new_space_lab_(LocalAllocationBuffer::InvalidBuffer()),
27 lab_allocation_will_fail_(
false) {}
31 heap_->old_space()->MergeCompactionSpace(compaction_spaces_.Get(OLD_SPACE));
32 heap_->code_space()->MergeCompactionSpace(
33 compaction_spaces_.Get(CODE_SPACE));
37 const Address top = new_space_->top();
38 if (info.limit() != kNullAddress && info.limit() == top) {
39 DCHECK_NE(info.top(), kNullAddress);
40 *new_space_->allocation_top_address() = info.top();
45 AllocationAlignment alignment);
46 inline void FreeLast(AllocationSpace space,
HeapObject*
object,
51 AllocationAlignment alignment);
52 inline bool NewLocalAllocationBuffer();
54 AllocationAlignment alignment);
55 inline void FreeLastInNewSpace(
HeapObject*
object,
int object_size);
56 inline void FreeLastInOldSpace(
HeapObject*
object,
int object_size);
62 bool lab_allocation_will_fail_;
68 #endif // V8_HEAP_LOCAL_ALLOCATOR_H_