OLD | NEW |
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 5444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5455 roots_[kRealStackLimitRootIndex] = Smi::FromInt(0); | 5455 roots_[kRealStackLimitRootIndex] = Smi::FromInt(0); |
5456 } | 5456 } |
5457 | 5457 |
5458 void Heap::PrintAlloctionsHash() { | 5458 void Heap::PrintAlloctionsHash() { |
5459 uint32_t hash = StringHasher::GetHashCore(raw_allocations_hash_); | 5459 uint32_t hash = StringHasher::GetHashCore(raw_allocations_hash_); |
5460 PrintF("\n### Allocations = %u, hash = 0x%08x\n", allocations_count(), hash); | 5460 PrintF("\n### Allocations = %u, hash = 0x%08x\n", allocations_count(), hash); |
5461 } | 5461 } |
5462 | 5462 |
5463 | 5463 |
5464 void Heap::NotifyDeserializationComplete() { | 5464 void Heap::NotifyDeserializationComplete() { |
5465 deserialization_complete_ = true; | 5465 DCHECK_EQ(0, gc_count()); |
5466 #ifdef DEBUG | |
5467 // All pages right after bootstrapping must be marked as never-evacuate. | |
5468 PagedSpaces spaces(this); | 5466 PagedSpaces spaces(this); |
5469 for (PagedSpace* s = spaces.next(); s != NULL; s = spaces.next()) { | 5467 for (PagedSpace* s = spaces.next(); s != NULL; s = spaces.next()) { |
| 5468 if (isolate()->snapshot_available()) s->ShrinkImmortalImmovablePages(); |
| 5469 #ifdef DEBUG |
| 5470 // All pages right after bootstrapping must be marked as never-evacuate. |
5470 for (Page* p : *s) { | 5471 for (Page* p : *s) { |
5471 CHECK(p->NeverEvacuate()); | 5472 CHECK(p->NeverEvacuate()); |
5472 } | 5473 } |
| 5474 #endif // DEBUG |
5473 } | 5475 } |
5474 #endif // DEBUG | 5476 |
| 5477 deserialization_complete_ = true; |
5475 } | 5478 } |
5476 | 5479 |
5477 void Heap::SetEmbedderHeapTracer(EmbedderHeapTracer* tracer) { | 5480 void Heap::SetEmbedderHeapTracer(EmbedderHeapTracer* tracer) { |
5478 mark_compact_collector()->SetEmbedderHeapTracer(tracer); | 5481 mark_compact_collector()->SetEmbedderHeapTracer(tracer); |
5479 } | 5482 } |
5480 | 5483 |
5481 bool Heap::UsingEmbedderHeapTracer() { | 5484 bool Heap::UsingEmbedderHeapTracer() { |
5482 return mark_compact_collector()->UsingEmbedderHeapTracer(); | 5485 return mark_compact_collector()->UsingEmbedderHeapTracer(); |
5483 } | 5486 } |
5484 | 5487 |
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6452 } | 6455 } |
6453 | 6456 |
6454 | 6457 |
6455 // static | 6458 // static |
6456 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6459 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6457 return StaticVisitorBase::GetVisitorId(map); | 6460 return StaticVisitorBase::GetVisitorId(map); |
6458 } | 6461 } |
6459 | 6462 |
6460 } // namespace internal | 6463 } // namespace internal |
6461 } // namespace v8 | 6464 } // namespace v8 |
OLD | NEW |