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

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

Issue 2232653003: Reland of "[heap] Switch to 500k pages" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Switch back to using the high water mark. Also: dont sweep immortal immovable pages Created 4 years, 4 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/ast/context-slot-cache.h" 9 #include "src/ast/context-slot-cache.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 Heap::Heap() 71 Heap::Heap()
72 : external_memory_(0), 72 : external_memory_(0),
73 external_memory_limit_(kExternalAllocationLimit), 73 external_memory_limit_(kExternalAllocationLimit),
74 external_memory_at_last_mark_compact_(0), 74 external_memory_at_last_mark_compact_(0),
75 isolate_(nullptr), 75 isolate_(nullptr),
76 code_range_size_(0), 76 code_range_size_(0),
77 // semispace_size_ should be a power of 2 and old_generation_size_ should 77 // semispace_size_ should be a power of 2 and old_generation_size_ should
78 // be a multiple of Page::kPageSize. 78 // be a multiple of Page::kPageSize.
79 max_semi_space_size_(8 * (kPointerSize / 4) * MB), 79 max_semi_space_size_(8 * (kPointerSize / 4) * MB),
80 initial_semispace_size_(Page::kPageSize), 80 initial_semispace_size_(MB),
81 max_old_generation_size_(700ul * (kPointerSize / 4) * MB), 81 max_old_generation_size_(700ul * (kPointerSize / 4) * MB),
82 initial_old_generation_size_(max_old_generation_size_ / 82 initial_old_generation_size_(max_old_generation_size_ /
83 kInitalOldGenerationLimitFactor), 83 kInitalOldGenerationLimitFactor),
84 old_generation_size_configured_(false), 84 old_generation_size_configured_(false),
85 max_executable_size_(256ul * (kPointerSize / 4) * MB), 85 max_executable_size_(256ul * (kPointerSize / 4) * MB),
86 // Variables set based on semispace_size_ and old_generation_size_ in 86 // Variables set based on semispace_size_ and old_generation_size_ in
87 // ConfigureHeap. 87 // ConfigureHeap.
88 // Will be 4 * reserved_semispace_size_ to ensure that young 88 // Will be 4 * reserved_semispace_size_ to ensure that young
89 // generation can be aligned to its size. 89 // generation can be aligned to its size.
90 maximum_committed_(0), 90 maximum_committed_(0),
(...skipping 5329 matching lines...) Expand 10 before | Expand all | Expand 10 after
5420 } 5420 }
5421 5421
5422 void Heap::PrintAlloctionsHash() { 5422 void Heap::PrintAlloctionsHash() {
5423 uint32_t hash = StringHasher::GetHashCore(raw_allocations_hash_); 5423 uint32_t hash = StringHasher::GetHashCore(raw_allocations_hash_);
5424 PrintF("\n### Allocations = %u, hash = 0x%08x\n", allocations_count(), hash); 5424 PrintF("\n### Allocations = %u, hash = 0x%08x\n", allocations_count(), hash);
5425 } 5425 }
5426 5426
5427 5427
5428 void Heap::NotifyDeserializationComplete() { 5428 void Heap::NotifyDeserializationComplete() {
5429 deserialization_complete_ = true; 5429 deserialization_complete_ = true;
5430 #ifdef DEBUG 5430
5431 // All pages right after bootstrapping must be marked as never-evacuate.
5432 PagedSpaces spaces(this); 5431 PagedSpaces spaces(this);
5433 for (PagedSpace* s = spaces.next(); s != NULL; s = spaces.next()) { 5432 for (PagedSpace* s = spaces.next(); s != NULL; s = spaces.next()) {
5433 if (isolate()->snapshot_available()) s->ShrinkImmortalImmovablePages();
5434 #ifdef DEBUG
5435 // All pages right after bootstrapping must be marked as never-evacuate.
5434 for (Page* p : *s) { 5436 for (Page* p : *s) {
5435 CHECK(p->NeverEvacuate()); 5437 CHECK(p->NeverEvacuate());
5436 } 5438 }
5439 #endif // DEBUG
5437 } 5440 }
5438 #endif // DEBUG
5439 } 5441 }
5440 5442
5441 void Heap::SetEmbedderHeapTracer(EmbedderHeapTracer* tracer) { 5443 void Heap::SetEmbedderHeapTracer(EmbedderHeapTracer* tracer) {
5442 mark_compact_collector()->SetEmbedderHeapTracer(tracer); 5444 mark_compact_collector()->SetEmbedderHeapTracer(tracer);
5443 } 5445 }
5444 5446
5445 bool Heap::UsingEmbedderHeapTracer() { 5447 bool Heap::UsingEmbedderHeapTracer() {
5446 return mark_compact_collector()->UsingEmbedderHeapTracer(); 5448 return mark_compact_collector()->UsingEmbedderHeapTracer();
5447 } 5449 }
5448 5450
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after
6483 } 6485 }
6484 6486
6485 6487
6486 // static 6488 // static
6487 int Heap::GetStaticVisitorIdForMap(Map* map) { 6489 int Heap::GetStaticVisitorIdForMap(Map* map) {
6488 return StaticVisitorBase::GetVisitorId(map); 6490 return StaticVisitorBase::GetVisitorId(map);
6489 } 6491 }
6490 6492
6491 } // namespace internal 6493 } // namespace internal
6492 } // namespace v8 6494 } // namespace v8
OLDNEW
« no previous file with comments | « src/base/build_config.h ('k') | src/heap/mark-compact.cc » ('j') | src/heap/spaces.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698