| 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 #ifndef HEAP_UTILS_H_ | 5 #ifndef HEAP_UTILS_H_ |
| 6 #define HEAP_UTILS_H_ | 6 #define HEAP_UTILS_H_ |
| 7 | 7 |
| 8 #include "src/factory.h" | 8 #include "src/factory.h" |
| 9 #include "src/heap/heap-inl.h" | 9 #include "src/heap/heap-inl.h" |
| 10 #include "src/heap/incremental-marking.h" | 10 #include "src/heap/incremental-marking.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 while (free_memory > 0) { | 42 while (free_memory > 0) { |
| 43 if (free_memory > object_size) { | 43 if (free_memory > object_size) { |
| 44 allocate_memory = object_size; | 44 allocate_memory = object_size; |
| 45 length = LenFromSize(allocate_memory); | 45 length = LenFromSize(allocate_memory); |
| 46 } else { | 46 } else { |
| 47 allocate_memory = free_memory; | 47 allocate_memory = free_memory; |
| 48 length = LenFromSize(allocate_memory); | 48 length = LenFromSize(allocate_memory); |
| 49 if (length <= 0) { | 49 if (length <= 0) { |
| 50 // Not enough room to create another fixed array. Let's create a filler. | 50 // Not enough room to create another fixed array. Let's create a filler. |
| 51 heap->CreateFillerObjectAt(*heap->old_space()->allocation_top_address(), | 51 heap->CreateFillerObjectAt(*heap->old_space()->allocation_top_address(), |
| 52 free_memory); | 52 free_memory, ClearRecordedSlots::kNo); |
| 53 break; | 53 break; |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 handles.push_back(isolate->factory()->NewFixedArray(length, tenure)); | 56 handles.push_back(isolate->factory()->NewFixedArray(length, tenure)); |
| 57 CHECK((tenure == NOT_TENURED && heap->InNewSpace(*handles.back())) || | 57 CHECK((tenure == NOT_TENURED && heap->InNewSpace(*handles.back())) || |
| 58 (tenure == TENURED && heap->InOldSpace(*handles.back()))); | 58 (tenure == TENURED && heap->InOldSpace(*handles.back()))); |
| 59 free_memory -= allocate_memory; | 59 free_memory -= allocate_memory; |
| 60 } | 60 } |
| 61 return handles; | 61 return handles; |
| 62 } | 62 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 marking->FinalizeIncrementally(); | 128 marking->FinalizeIncrementally(); |
| 129 } | 129 } |
| 130 } | 130 } |
| 131 CHECK(marking->IsComplete()); | 131 CHECK(marking->IsComplete()); |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace internal | 134 } // namespace internal |
| 135 } // namespace v8 | 135 } // namespace v8 |
| 136 | 136 |
| 137 #endif // HEAP_UTILS_H_ | 137 #endif // HEAP_UTILS_H_ |
| OLD | NEW |