| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #include <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "src/globals.h" | 7 #include "src/globals.h" |
| 8 #include "src/heap/heap.h" | 8 #include "src/heap/heap.h" |
| 9 #include "src/heap/spaces.h" | 9 #include "src/heap/spaces.h" |
| 10 #include "src/heap/spaces-inl.h" | 10 #include "src/heap/spaces-inl.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 } | 39 } |
| 40 | 40 |
| 41 | 41 |
| 42 static bool AllocateFromLab(Heap* heap, LocalAllocationBuffer* lab, | 42 static bool AllocateFromLab(Heap* heap, LocalAllocationBuffer* lab, |
| 43 intptr_t size_in_bytes, | 43 intptr_t size_in_bytes, |
| 44 AllocationAlignment alignment = kWordAligned) { | 44 AllocationAlignment alignment = kWordAligned) { |
| 45 HeapObject* obj; | 45 HeapObject* obj; |
| 46 AllocationResult result = | 46 AllocationResult result = |
| 47 lab->AllocateRawAligned(static_cast<int>(size_in_bytes), alignment); | 47 lab->AllocateRawAligned(static_cast<int>(size_in_bytes), alignment); |
| 48 if (result.To(&obj)) { | 48 if (result.To(&obj)) { |
| 49 heap->CreateFillerObjectAt(obj->address(), static_cast<int>(size_in_bytes)); | 49 heap->CreateFillerObjectAt(obj->address(), static_cast<int>(size_in_bytes), |
| 50 ClearRecordedSlots::kNo); |
| 50 return true; | 51 return true; |
| 51 } | 52 } |
| 52 return false; | 53 return false; |
| 53 } | 54 } |
| 54 | 55 |
| 55 | 56 |
| 56 TEST(InvalidLab) { | 57 TEST(InvalidLab) { |
| 57 LocalAllocationBuffer lab = LocalAllocationBuffer::InvalidBuffer(); | 58 LocalAllocationBuffer lab = LocalAllocationBuffer::InvalidBuffer(); |
| 58 CHECK(!lab.IsValid()); | 59 CHECK(!lab.IsValid()); |
| 59 } | 60 } |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 break; | 276 break; |
| 276 } | 277 } |
| 277 } | 278 } |
| 278 } | 279 } |
| 279 VerifyIterable(base, limit, expected_sizes); | 280 VerifyIterable(base, limit, expected_sizes); |
| 280 } | 281 } |
| 281 #endif // V8_HOST_ARCH_32_BIT | 282 #endif // V8_HOST_ARCH_32_BIT |
| 282 | 283 |
| 283 } // namespace internal | 284 } // namespace internal |
| 284 } // namespace v8 | 285 } // namespace v8 |
| OLD | NEW |