| 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 #include "src/heap/spaces.h" | 5 #include "src/heap/spaces.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
| (...skipping 3116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3127 if (Heap::ShouldZapGarbage()) { | 3127 if (Heap::ShouldZapGarbage()) { |
| 3128 // Make the object consistent so the heap can be verified in OldSpaceStep. | 3128 // Make the object consistent so the heap can be verified in OldSpaceStep. |
| 3129 // We only need to do this in debug builds or if verify_heap is on. | 3129 // We only need to do this in debug builds or if verify_heap is on. |
| 3130 reinterpret_cast<Object**>(object->address())[0] = | 3130 reinterpret_cast<Object**>(object->address())[0] = |
| 3131 heap()->fixed_array_map(); | 3131 heap()->fixed_array_map(); |
| 3132 reinterpret_cast<Object**>(object->address())[1] = Smi::kZero; | 3132 reinterpret_cast<Object**>(object->address())[1] = Smi::kZero; |
| 3133 } | 3133 } |
| 3134 | 3134 |
| 3135 heap()->StartIncrementalMarkingIfAllocationLimitIsReached(Heap::kNoGCFlags, | 3135 heap()->StartIncrementalMarkingIfAllocationLimitIsReached(Heap::kNoGCFlags, |
| 3136 kNoGCCallbackFlags); | 3136 kNoGCCallbackFlags); |
| 3137 |
| 3137 AllocationStep(object->address(), object_size); | 3138 AllocationStep(object->address(), object_size); |
| 3138 | 3139 |
| 3139 heap()->CreateFillerObjectAt(object->address(), object_size, | 3140 heap()->CreateFillerObjectAt(object->address(), object_size, |
| 3140 ClearRecordedSlots::kNo); | 3141 ClearRecordedSlots::kNo); |
| 3141 | 3142 |
| 3142 if (heap()->incremental_marking()->black_allocation()) { | 3143 if (heap()->incremental_marking()->black_allocation()) { |
| 3143 ObjectMarking::WhiteToBlack(object, MarkingState::Internal(object)); | 3144 ObjectMarking::WhiteToBlack(object, MarkingState::Internal(object)); |
| 3144 } | 3145 } |
| 3145 return object; | 3146 return object; |
| 3146 } | 3147 } |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3383 PrintF("\n"); | 3384 PrintF("\n"); |
| 3384 } | 3385 } |
| 3385 printf(" --------------------------------------\n"); | 3386 printf(" --------------------------------------\n"); |
| 3386 printf(" Marked: %x, LiveCount: %" V8PRIdPTR "\n", mark_size, | 3387 printf(" Marked: %x, LiveCount: %" V8PRIdPTR "\n", mark_size, |
| 3387 MarkingState::Internal(this).live_bytes()); | 3388 MarkingState::Internal(this).live_bytes()); |
| 3388 } | 3389 } |
| 3389 | 3390 |
| 3390 #endif // DEBUG | 3391 #endif // DEBUG |
| 3391 } // namespace internal | 3392 } // namespace internal |
| 3392 } // namespace v8 | 3393 } // namespace v8 |
| OLD | NEW |