Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/heap/spaces.cc

Issue 2009893003: Revert of "[heap] Fine-grained JSArrayBuffer tracking" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/spaces.h ('k') | src/heap/spaces-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 chunk->InitializeReservedMemory(); 504 chunk->InitializeReservedMemory();
505 chunk->old_to_new_slots_ = nullptr; 505 chunk->old_to_new_slots_ = nullptr;
506 chunk->old_to_old_slots_ = nullptr; 506 chunk->old_to_old_slots_ = nullptr;
507 chunk->typed_old_to_new_slots_ = nullptr; 507 chunk->typed_old_to_new_slots_ = nullptr;
508 chunk->typed_old_to_old_slots_ = nullptr; 508 chunk->typed_old_to_old_slots_ = nullptr;
509 chunk->skip_list_ = nullptr; 509 chunk->skip_list_ = nullptr;
510 chunk->write_barrier_counter_ = kWriteBarrierCounterGranularity; 510 chunk->write_barrier_counter_ = kWriteBarrierCounterGranularity;
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_ = new base::Mutex(); 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_.SetValue(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
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_.Value() != nullptr) ReleaseLocalTracker();
1045 } 1042 }
1046 1043
1047 static SlotSet* AllocateSlotSet(size_t size, Address page_start) { 1044 static SlotSet* AllocateSlotSet(size_t size, Address page_start) {
1048 size_t pages = (size + Page::kPageSize - 1) / Page::kPageSize; 1045 size_t pages = (size + Page::kPageSize - 1) / Page::kPageSize;
1049 DCHECK(pages > 0); 1046 DCHECK(pages > 0);
1050 SlotSet* slot_set = new SlotSet[pages]; 1047 SlotSet* slot_set = new SlotSet[pages];
1051 for (size_t i = 0; i < pages; i++) { 1048 for (size_t i = 0; i < pages; i++) {
1052 slot_set[i].SetPageStart(page_start + i * Page::kPageSize); 1049 slot_set[i].SetPageStart(page_start + i * Page::kPageSize);
1053 } 1050 }
1054 return slot_set; 1051 return slot_set;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 1083
1087 void MemoryChunk::AllocateTypedOldToOldSlots() { 1084 void MemoryChunk::AllocateTypedOldToOldSlots() {
1088 DCHECK(nullptr == typed_old_to_old_slots_); 1085 DCHECK(nullptr == typed_old_to_old_slots_);
1089 typed_old_to_old_slots_ = new TypedSlotSet(address()); 1086 typed_old_to_old_slots_ = new TypedSlotSet(address());
1090 } 1087 }
1091 1088
1092 void MemoryChunk::ReleaseTypedOldToOldSlots() { 1089 void MemoryChunk::ReleaseTypedOldToOldSlots() {
1093 delete typed_old_to_old_slots_; 1090 delete typed_old_to_old_slots_;
1094 typed_old_to_old_slots_ = nullptr; 1091 typed_old_to_old_slots_ = nullptr;
1095 } 1092 }
1096
1097 void MemoryChunk::ReleaseLocalTracker() {
1098 delete local_tracker_.Value();
1099 local_tracker_.SetValue(nullptr);
1100 }
1101
1102 // ----------------------------------------------------------------------------- 1093 // -----------------------------------------------------------------------------
1103 // PagedSpace implementation 1094 // PagedSpace implementation
1104 1095
1105 STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::NEW_SPACE) == 1096 STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::NEW_SPACE) ==
1106 ObjectSpace::kObjectSpaceNewSpace); 1097 ObjectSpace::kObjectSpaceNewSpace);
1107 STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::OLD_SPACE) == 1098 STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::OLD_SPACE) ==
1108 ObjectSpace::kObjectSpaceOldSpace); 1099 ObjectSpace::kObjectSpaceOldSpace);
1109 STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::CODE_SPACE) == 1100 STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::CODE_SPACE) ==
1110 ObjectSpace::kObjectSpaceCodeSpace); 1101 ObjectSpace::kObjectSpaceCodeSpace);
1111 STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::MAP_SPACE) == 1102 STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::MAP_SPACE) ==
(...skipping 2132 matching lines...) Expand 10 before | Expand all | Expand 10 after
3244 object->ShortPrint(); 3235 object->ShortPrint();
3245 PrintF("\n"); 3236 PrintF("\n");
3246 } 3237 }
3247 printf(" --------------------------------------\n"); 3238 printf(" --------------------------------------\n");
3248 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 3239 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
3249 } 3240 }
3250 3241
3251 #endif // DEBUG 3242 #endif // DEBUG
3252 } // namespace internal 3243 } // namespace internal
3253 } // namespace v8 3244 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/spaces.h ('k') | src/heap/spaces-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698