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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 chunk->progress_bar_ = 0; | 511 chunk->progress_bar_ = 0; |
512 chunk->high_water_mark_.SetValue(static_cast<intptr_t>(area_start - base)); | 512 chunk->high_water_mark_.SetValue(static_cast<intptr_t>(area_start - base)); |
513 chunk->concurrent_sweeping_state().SetValue(kSweepingDone); | 513 chunk->concurrent_sweeping_state().SetValue(kSweepingDone); |
514 chunk->mutex_ = nullptr; | 514 chunk->mutex_ = nullptr; |
515 chunk->available_in_free_list_ = 0; | 515 chunk->available_in_free_list_ = 0; |
516 chunk->wasted_memory_ = 0; | 516 chunk->wasted_memory_ = 0; |
517 chunk->ResetLiveBytes(); | 517 chunk->ResetLiveBytes(); |
518 Bitmap::Clear(chunk); | 518 Bitmap::Clear(chunk); |
519 chunk->set_next_chunk(nullptr); | 519 chunk->set_next_chunk(nullptr); |
520 chunk->set_prev_chunk(nullptr); | 520 chunk->set_prev_chunk(nullptr); |
521 chunk->local_tracker_ = nullptr; | |
522 | 521 |
523 DCHECK(OFFSET_OF(MemoryChunk, flags_) == kFlagsOffset); | 522 DCHECK(OFFSET_OF(MemoryChunk, flags_) == kFlagsOffset); |
524 DCHECK(OFFSET_OF(MemoryChunk, live_byte_count_) == kLiveBytesOffset); | 523 DCHECK(OFFSET_OF(MemoryChunk, live_byte_count_) == kLiveBytesOffset); |
525 | 524 |
526 if (executable == EXECUTABLE) { | 525 if (executable == EXECUTABLE) { |
527 chunk->SetFlag(IS_EXECUTABLE); | 526 chunk->SetFlag(IS_EXECUTABLE); |
528 } | 527 } |
529 | 528 |
530 if (reservation != nullptr) { | 529 if (reservation != nullptr) { |
531 chunk->reservation_.TakeControl(reservation); | 530 chunk->reservation_.TakeControl(reservation); |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 skip_list_ = nullptr; | 1032 skip_list_ = nullptr; |
1034 } | 1033 } |
1035 if (mutex_ != nullptr) { | 1034 if (mutex_ != nullptr) { |
1036 delete mutex_; | 1035 delete mutex_; |
1037 mutex_ = nullptr; | 1036 mutex_ = nullptr; |
1038 } | 1037 } |
1039 if (old_to_new_slots_ != nullptr) ReleaseOldToNewSlots(); | 1038 if (old_to_new_slots_ != nullptr) ReleaseOldToNewSlots(); |
1040 if (old_to_old_slots_ != nullptr) ReleaseOldToOldSlots(); | 1039 if (old_to_old_slots_ != nullptr) ReleaseOldToOldSlots(); |
1041 if (typed_old_to_new_slots_ != nullptr) ReleaseTypedOldToNewSlots(); | 1040 if (typed_old_to_new_slots_ != nullptr) ReleaseTypedOldToNewSlots(); |
1042 if (typed_old_to_old_slots_ != nullptr) ReleaseTypedOldToOldSlots(); | 1041 if (typed_old_to_old_slots_ != nullptr) ReleaseTypedOldToOldSlots(); |
1043 | |
1044 if (local_tracker_ != nullptr) { | |
1045 delete local_tracker_; | |
1046 local_tracker_ = nullptr; | |
1047 } | |
1048 } | 1042 } |
1049 | 1043 |
1050 static SlotSet* AllocateSlotSet(size_t size, Address page_start) { | 1044 static SlotSet* AllocateSlotSet(size_t size, Address page_start) { |
1051 size_t pages = (size + Page::kPageSize - 1) / Page::kPageSize; | 1045 size_t pages = (size + Page::kPageSize - 1) / Page::kPageSize; |
1052 DCHECK(pages > 0); | 1046 DCHECK(pages > 0); |
1053 SlotSet* slot_set = new SlotSet[pages]; | 1047 SlotSet* slot_set = new SlotSet[pages]; |
1054 for (size_t i = 0; i < pages; i++) { | 1048 for (size_t i = 0; i < pages; i++) { |
1055 slot_set[i].SetPageStart(page_start + i * Page::kPageSize); | 1049 slot_set[i].SetPageStart(page_start + i * Page::kPageSize); |
1056 } | 1050 } |
1057 return slot_set; | 1051 return slot_set; |
(...skipping 2181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3239 object->ShortPrint(); | 3233 object->ShortPrint(); |
3240 PrintF("\n"); | 3234 PrintF("\n"); |
3241 } | 3235 } |
3242 printf(" --------------------------------------\n"); | 3236 printf(" --------------------------------------\n"); |
3243 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3237 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
3244 } | 3238 } |
3245 | 3239 |
3246 #endif // DEBUG | 3240 #endif // DEBUG |
3247 } // namespace internal | 3241 } // namespace internal |
3248 } // namespace v8 | 3242 } // namespace v8 |
OLD | NEW |