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

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

Issue 2728363002: [heap] Implement concurrent marking boilerplate. (Closed)
Patch Set: Add missing test file Created 3 years, 9 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/heap.h" 5 #include "src/heap/heap.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/assembler-inl.h" 9 #include "src/assembler-inl.h"
10 #include "src/ast/context-slot-cache.h" 10 #include "src/ast/context-slot-cache.h"
11 #include "src/base/bits.h" 11 #include "src/base/bits.h"
12 #include "src/base/once.h" 12 #include "src/base/once.h"
13 #include "src/base/utils/random-number-generator.h" 13 #include "src/base/utils/random-number-generator.h"
14 #include "src/bootstrapper.h" 14 #include "src/bootstrapper.h"
15 #include "src/codegen.h" 15 #include "src/codegen.h"
16 #include "src/compilation-cache.h" 16 #include "src/compilation-cache.h"
17 #include "src/compiler-dispatcher/optimizing-compile-dispatcher.h" 17 #include "src/compiler-dispatcher/optimizing-compile-dispatcher.h"
18 #include "src/conversions.h" 18 #include "src/conversions.h"
19 #include "src/debug/debug.h" 19 #include "src/debug/debug.h"
20 #include "src/deoptimizer.h" 20 #include "src/deoptimizer.h"
21 #include "src/feedback-vector.h" 21 #include "src/feedback-vector.h"
22 #include "src/global-handles.h" 22 #include "src/global-handles.h"
23 #include "src/heap/array-buffer-tracker-inl.h" 23 #include "src/heap/array-buffer-tracker-inl.h"
24 #include "src/heap/code-stats.h" 24 #include "src/heap/code-stats.h"
25 #include "src/heap/concurrent-marking.h"
25 #include "src/heap/embedder-tracing.h" 26 #include "src/heap/embedder-tracing.h"
26 #include "src/heap/gc-idle-time-handler.h" 27 #include "src/heap/gc-idle-time-handler.h"
27 #include "src/heap/gc-tracer.h" 28 #include "src/heap/gc-tracer.h"
28 #include "src/heap/incremental-marking.h" 29 #include "src/heap/incremental-marking.h"
29 #include "src/heap/mark-compact-inl.h" 30 #include "src/heap/mark-compact-inl.h"
30 #include "src/heap/mark-compact.h" 31 #include "src/heap/mark-compact.h"
31 #include "src/heap/memory-reducer.h" 32 #include "src/heap/memory-reducer.h"
32 #include "src/heap/object-stats.h" 33 #include "src/heap/object-stats.h"
33 #include "src/heap/objects-visiting-inl.h" 34 #include "src/heap/objects-visiting-inl.h"
34 #include "src/heap/objects-visiting.h" 35 #include "src/heap/objects-visiting.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 nodes_copied_in_new_space_(0), 129 nodes_copied_in_new_space_(0),
129 nodes_promoted_(0), 130 nodes_promoted_(0),
130 maximum_size_scavenges_(0), 131 maximum_size_scavenges_(0),
131 last_idle_notification_time_(0.0), 132 last_idle_notification_time_(0.0),
132 last_gc_time_(0.0), 133 last_gc_time_(0.0),
133 scavenge_collector_(nullptr), 134 scavenge_collector_(nullptr),
134 mark_compact_collector_(nullptr), 135 mark_compact_collector_(nullptr),
135 memory_allocator_(nullptr), 136 memory_allocator_(nullptr),
136 store_buffer_(nullptr), 137 store_buffer_(nullptr),
137 incremental_marking_(nullptr), 138 incremental_marking_(nullptr),
139 concurrent_marking_(nullptr),
138 gc_idle_time_handler_(nullptr), 140 gc_idle_time_handler_(nullptr),
139 memory_reducer_(nullptr), 141 memory_reducer_(nullptr),
140 live_object_stats_(nullptr), 142 live_object_stats_(nullptr),
141 dead_object_stats_(nullptr), 143 dead_object_stats_(nullptr),
142 scavenge_job_(nullptr), 144 scavenge_job_(nullptr),
143 idle_scavenge_observer_(nullptr), 145 idle_scavenge_observer_(nullptr),
144 new_space_allocation_counter_(0), 146 new_space_allocation_counter_(0),
145 old_generation_allocation_counter_at_last_gc_(0), 147 old_generation_allocation_counter_at_last_gc_(0),
146 old_generation_size_at_last_gc_(0), 148 old_generation_size_at_last_gc_(0),
147 gcs_since_last_deopt_(0), 149 gcs_since_last_deopt_(0),
(...skipping 5345 matching lines...) Expand 10 before | Expand all | Expand 10 after
5493 } 5495 }
5494 5496
5495 base::CallOnce(&initialize_gc_once, &InitializeGCOnce); 5497 base::CallOnce(&initialize_gc_once, &InitializeGCOnce);
5496 5498
5497 // Set up memory allocator. 5499 // Set up memory allocator.
5498 memory_allocator_ = new MemoryAllocator(isolate_); 5500 memory_allocator_ = new MemoryAllocator(isolate_);
5499 if (!memory_allocator_->SetUp(MaxReserved(), MaxExecutableSize(), 5501 if (!memory_allocator_->SetUp(MaxReserved(), MaxExecutableSize(),
5500 code_range_size_)) 5502 code_range_size_))
5501 return false; 5503 return false;
5502 5504
5503 // Initialize store buffer.
5504 store_buffer_ = new StoreBuffer(this); 5505 store_buffer_ = new StoreBuffer(this);
5505 5506
5506 // Initialize incremental marking.
5507 incremental_marking_ = new IncrementalMarking(this); 5507 incremental_marking_ = new IncrementalMarking(this);
5508 5508
5509 concurrent_marking_ = new ConcurrentMarking(this);
5510
5509 for (int i = 0; i <= LAST_SPACE; i++) { 5511 for (int i = 0; i <= LAST_SPACE; i++) {
5510 space_[i] = nullptr; 5512 space_[i] = nullptr;
5511 } 5513 }
5512 5514
5513 space_[NEW_SPACE] = new_space_ = new NewSpace(this); 5515 space_[NEW_SPACE] = new_space_ = new NewSpace(this);
5514 if (!new_space_->SetUp(initial_semispace_size_, max_semi_space_size_)) { 5516 if (!new_space_->SetUp(initial_semispace_size_, max_semi_space_size_)) {
5515 return false; 5517 return false;
5516 } 5518 }
5517 new_space_top_after_last_gc_ = new_space()->top(); 5519 new_space_top_after_last_gc_ = new_space()->top();
5518 5520
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
5683 5685
5684 if (mark_compact_collector_ != nullptr) { 5686 if (mark_compact_collector_ != nullptr) {
5685 mark_compact_collector_->TearDown(); 5687 mark_compact_collector_->TearDown();
5686 delete mark_compact_collector_; 5688 delete mark_compact_collector_;
5687 mark_compact_collector_ = nullptr; 5689 mark_compact_collector_ = nullptr;
5688 } 5690 }
5689 5691
5690 delete incremental_marking_; 5692 delete incremental_marking_;
5691 incremental_marking_ = nullptr; 5693 incremental_marking_ = nullptr;
5692 5694
5695 delete concurrent_marking_;
5696 concurrent_marking_ = nullptr;
5697
5693 delete gc_idle_time_handler_; 5698 delete gc_idle_time_handler_;
5694 gc_idle_time_handler_ = nullptr; 5699 gc_idle_time_handler_ = nullptr;
5695 5700
5696 if (memory_reducer_ != nullptr) { 5701 if (memory_reducer_ != nullptr) {
5697 memory_reducer_->TearDown(); 5702 memory_reducer_->TearDown();
5698 delete memory_reducer_; 5703 delete memory_reducer_;
5699 memory_reducer_ = nullptr; 5704 memory_reducer_ = nullptr;
5700 } 5705 }
5701 5706
5702 if (live_object_stats_ != nullptr) { 5707 if (live_object_stats_ != nullptr) {
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
6379 } 6384 }
6380 6385
6381 6386
6382 // static 6387 // static
6383 int Heap::GetStaticVisitorIdForMap(Map* map) { 6388 int Heap::GetStaticVisitorIdForMap(Map* map) {
6384 return StaticVisitorBase::GetVisitorId(map); 6389 return StaticVisitorBase::GetVisitorId(map);
6385 } 6390 }
6386 6391
6387 } // namespace internal 6392 } // namespace internal
6388 } // namespace v8 6393 } // namespace v8
OLDNEW
« src/heap/concurrent-marking.h ('K') | « src/heap/heap.h ('k') | src/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698