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