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

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

Issue 1815153002: Introduce EmbedderHeapTracer (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Gave the api a week to settle down and this is the result Created 4 years, 8 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
« src/api.cc ('K') | « src/heap/heap.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ast/scopeinfo.h" 9 #include "src/ast/scopeinfo.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 remembered_unmapped_pages_index_(0), 109 remembered_unmapped_pages_index_(0),
110 #ifdef DEBUG 110 #ifdef DEBUG
111 allocation_timeout_(0), 111 allocation_timeout_(0),
112 #endif // DEBUG 112 #endif // DEBUG
113 old_generation_allocation_limit_(initial_old_generation_size_), 113 old_generation_allocation_limit_(initial_old_generation_size_),
114 old_gen_exhausted_(false), 114 old_gen_exhausted_(false),
115 optimize_for_memory_usage_(false), 115 optimize_for_memory_usage_(false),
116 inline_allocation_disabled_(false), 116 inline_allocation_disabled_(false),
117 total_regexp_code_generated_(0), 117 total_regexp_code_generated_(0),
118 tracer_(nullptr), 118 tracer_(nullptr),
119 embedder_heap_tracer_(nullptr),
119 high_survival_rate_period_length_(0), 120 high_survival_rate_period_length_(0),
120 promoted_objects_size_(0), 121 promoted_objects_size_(0),
121 promotion_ratio_(0), 122 promotion_ratio_(0),
122 semi_space_copied_object_size_(0), 123 semi_space_copied_object_size_(0),
123 previous_semi_space_copied_object_size_(0), 124 previous_semi_space_copied_object_size_(0),
124 semi_space_copied_rate_(0), 125 semi_space_copied_rate_(0),
125 nodes_died_in_new_space_(0), 126 nodes_died_in_new_space_(0),
126 nodes_copied_in_new_space_(0), 127 nodes_copied_in_new_space_(0),
127 nodes_promoted_(0), 128 nodes_promoted_(0),
128 maximum_size_scavenges_(0), 129 maximum_size_scavenges_(0),
(...skipping 5284 matching lines...) Expand 10 before | Expand all | Expand 10 after
5413 #ifdef DEBUG 5414 #ifdef DEBUG
5414 // All pages right after bootstrapping must be marked as never-evacuate. 5415 // All pages right after bootstrapping must be marked as never-evacuate.
5415 PagedSpaces spaces(this); 5416 PagedSpaces spaces(this);
5416 for (PagedSpace* s = spaces.next(); s != NULL; s = spaces.next()) { 5417 for (PagedSpace* s = spaces.next(); s != NULL; s = spaces.next()) {
5417 PageIterator it(s); 5418 PageIterator it(s);
5418 while (it.has_next()) CHECK(it.next()->NeverEvacuate()); 5419 while (it.has_next()) CHECK(it.next()->NeverEvacuate());
5419 } 5420 }
5420 #endif // DEBUG 5421 #endif // DEBUG
5421 } 5422 }
5422 5423
5424 void Heap::AddObjectToMarkingDeque(Object** object) {
5425 DCHECK(incremental_marking()->IsMarking());
5426 HeapObject* heap_object = HeapObject::cast(*object);
5427 IncrementalMarking::MarkObject(isolate()->heap(), heap_object);
jochen (gone - plz use gerrit) 2016/03/30 16:46:17 isolate()->heap() === this
Marcel Hlopko 2016/03/30 18:51:12 In the meantime I fixed a bug, ptal at new version
5428 }
5423 5429
5424 void Heap::TearDown() { 5430 void Heap::TearDown() {
5425 #ifdef VERIFY_HEAP 5431 #ifdef VERIFY_HEAP
5426 if (FLAG_verify_heap) { 5432 if (FLAG_verify_heap) {
5427 Verify(); 5433 Verify();
5428 } 5434 }
5429 #endif 5435 #endif
5430 5436
5431 UpdateMaximumCommitted(); 5437 UpdateMaximumCommitted();
5432 5438
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
5578 DCHECK(callback != NULL); 5584 DCHECK(callback != NULL);
5579 for (int i = 0; i < gc_epilogue_callbacks_.length(); ++i) { 5585 for (int i = 0; i < gc_epilogue_callbacks_.length(); ++i) {
5580 if (gc_epilogue_callbacks_[i].callback == callback) { 5586 if (gc_epilogue_callbacks_[i].callback == callback) {
5581 gc_epilogue_callbacks_.Remove(i); 5587 gc_epilogue_callbacks_.Remove(i);
5582 return; 5588 return;
5583 } 5589 }
5584 } 5590 }
5585 UNREACHABLE(); 5591 UNREACHABLE();
5586 } 5592 }
5587 5593
5594 void Heap::SetEmbedderHeapTracer(EmbedderHeapTracer* tracer) {
5595 DCHECK(tracer != nullptr);
jochen (gone - plz use gerrit) 2016/03/30 16:46:17 DCHECK_NOT_NULL() I'd also add CHECK_NULL(embedde
Marcel Hlopko 2016/03/30 18:51:12 Done.
5596 embedder_heap_tracer_ = tracer;
5597 }
5588 5598
5589 // TODO(ishell): Find a better place for this. 5599 // TODO(ishell): Find a better place for this.
5590 void Heap::AddWeakObjectToCodeDependency(Handle<HeapObject> obj, 5600 void Heap::AddWeakObjectToCodeDependency(Handle<HeapObject> obj,
5591 Handle<DependentCode> dep) { 5601 Handle<DependentCode> dep) {
5592 DCHECK(!InNewSpace(*obj)); 5602 DCHECK(!InNewSpace(*obj));
5593 DCHECK(!InNewSpace(*dep)); 5603 DCHECK(!InNewSpace(*dep));
5594 Handle<WeakHashTable> table(weak_object_to_code_table(), isolate()); 5604 Handle<WeakHashTable> table(weak_object_to_code_table(), isolate());
5595 table = WeakHashTable::Put(table, obj, dep); 5605 table = WeakHashTable::Put(table, obj, dep);
5596 if (*table != weak_object_to_code_table()) 5606 if (*table != weak_object_to_code_table())
5597 set_weak_object_to_code_table(*table); 5607 set_weak_object_to_code_table(*table);
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
6473 } 6483 }
6474 6484
6475 6485
6476 // static 6486 // static
6477 int Heap::GetStaticVisitorIdForMap(Map* map) { 6487 int Heap::GetStaticVisitorIdForMap(Map* map) {
6478 return StaticVisitorBase::GetVisitorId(map); 6488 return StaticVisitorBase::GetVisitorId(map);
6479 } 6489 }
6480 6490
6481 } // namespace internal 6491 } // namespace internal
6482 } // namespace v8 6492 } // namespace v8
OLDNEW
« src/api.cc ('K') | « src/heap/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698