| 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 "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/base/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
| 9 #include "src/base/platform/semaphore.h" | 9 #include "src/base/platform/semaphore.h" |
| 10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 chunk->progress_bar_ = 0; | 513 chunk->progress_bar_ = 0; |
| 514 chunk->high_water_mark_.SetValue(static_cast<intptr_t>(area_start - base)); | 514 chunk->high_water_mark_.SetValue(static_cast<intptr_t>(area_start - base)); |
| 515 chunk->concurrent_sweeping_state().SetValue(kSweepingDone); | 515 chunk->concurrent_sweeping_state().SetValue(kSweepingDone); |
| 516 chunk->mutex_ = nullptr; | 516 chunk->mutex_ = nullptr; |
| 517 chunk->available_in_free_list_ = 0; | 517 chunk->available_in_free_list_ = 0; |
| 518 chunk->wasted_memory_ = 0; | 518 chunk->wasted_memory_ = 0; |
| 519 chunk->ResetLiveBytes(); | 519 chunk->ResetLiveBytes(); |
| 520 Bitmap::Clear(chunk); | 520 Bitmap::Clear(chunk); |
| 521 chunk->set_next_chunk(nullptr); | 521 chunk->set_next_chunk(nullptr); |
| 522 chunk->set_prev_chunk(nullptr); | 522 chunk->set_prev_chunk(nullptr); |
| 523 chunk->local_tracker_ = nullptr; |
| 523 | 524 |
| 524 DCHECK(OFFSET_OF(MemoryChunk, flags_) == kFlagsOffset); | 525 DCHECK(OFFSET_OF(MemoryChunk, flags_) == kFlagsOffset); |
| 525 DCHECK(OFFSET_OF(MemoryChunk, live_byte_count_) == kLiveBytesOffset); | 526 DCHECK(OFFSET_OF(MemoryChunk, live_byte_count_) == kLiveBytesOffset); |
| 526 | 527 |
| 527 if (executable == EXECUTABLE) { | 528 if (executable == EXECUTABLE) { |
| 528 chunk->SetFlag(IS_EXECUTABLE); | 529 chunk->SetFlag(IS_EXECUTABLE); |
| 529 } | 530 } |
| 530 | 531 |
| 531 if (reservation != nullptr) { | 532 if (reservation != nullptr) { |
| 532 chunk->reservation_.TakeControl(reservation); | 533 chunk->reservation_.TakeControl(reservation); |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 if (skip_list_ != nullptr) { | 1036 if (skip_list_ != nullptr) { |
| 1036 delete skip_list_; | 1037 delete skip_list_; |
| 1037 skip_list_ = nullptr; | 1038 skip_list_ = nullptr; |
| 1038 } | 1039 } |
| 1039 if (mutex_ != nullptr) { | 1040 if (mutex_ != nullptr) { |
| 1040 delete mutex_; | 1041 delete mutex_; |
| 1041 mutex_ = nullptr; | 1042 mutex_ = nullptr; |
| 1042 } | 1043 } |
| 1043 if (old_to_new_slots_ != nullptr) ReleaseOldToNewSlots(); | 1044 if (old_to_new_slots_ != nullptr) ReleaseOldToNewSlots(); |
| 1044 if (old_to_old_slots_ != nullptr) ReleaseOldToOldSlots(); | 1045 if (old_to_old_slots_ != nullptr) ReleaseOldToOldSlots(); |
| 1046 |
| 1047 if (local_tracker_ != nullptr) { |
| 1048 delete local_tracker_; |
| 1049 local_tracker_ = nullptr; |
| 1050 } |
| 1045 } | 1051 } |
| 1046 | 1052 |
| 1047 static SlotSet* AllocateSlotSet(size_t size, Address page_start) { | 1053 static SlotSet* AllocateSlotSet(size_t size, Address page_start) { |
| 1048 size_t pages = (size + Page::kPageSize - 1) / Page::kPageSize; | 1054 size_t pages = (size + Page::kPageSize - 1) / Page::kPageSize; |
| 1049 DCHECK(pages > 0); | 1055 DCHECK(pages > 0); |
| 1050 SlotSet* slot_set = new SlotSet[pages]; | 1056 SlotSet* slot_set = new SlotSet[pages]; |
| 1051 for (size_t i = 0; i < pages; i++) { | 1057 for (size_t i = 0; i < pages; i++) { |
| 1052 slot_set[i].SetPageStart(page_start + i * Page::kPageSize); | 1058 slot_set[i].SetPageStart(page_start + i * Page::kPageSize); |
| 1053 } | 1059 } |
| 1054 return slot_set; | 1060 return slot_set; |
| (...skipping 2171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3226 object->ShortPrint(); | 3232 object->ShortPrint(); |
| 3227 PrintF("\n"); | 3233 PrintF("\n"); |
| 3228 } | 3234 } |
| 3229 printf(" --------------------------------------\n"); | 3235 printf(" --------------------------------------\n"); |
| 3230 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3236 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
| 3231 } | 3237 } |
| 3232 | 3238 |
| 3233 #endif // DEBUG | 3239 #endif // DEBUG |
| 3234 } // namespace internal | 3240 } // namespace internal |
| 3235 } // namespace v8 | 3241 } // namespace v8 |
| OLD | NEW |