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/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-deque.h" |
25 #include "src/heap/concurrent-marking.h" | 26 #include "src/heap/concurrent-marking.h" |
26 #include "src/heap/embedder-tracing.h" | 27 #include "src/heap/embedder-tracing.h" |
27 #include "src/heap/gc-idle-time-handler.h" | 28 #include "src/heap/gc-idle-time-handler.h" |
28 #include "src/heap/gc-tracer.h" | 29 #include "src/heap/gc-tracer.h" |
29 #include "src/heap/incremental-marking.h" | 30 #include "src/heap/incremental-marking.h" |
30 #include "src/heap/mark-compact-inl.h" | 31 #include "src/heap/mark-compact-inl.h" |
31 #include "src/heap/mark-compact.h" | 32 #include "src/heap/mark-compact.h" |
32 #include "src/heap/memory-reducer.h" | 33 #include "src/heap/memory-reducer.h" |
33 #include "src/heap/object-stats.h" | 34 #include "src/heap/object-stats.h" |
34 #include "src/heap/objects-visiting-inl.h" | 35 #include "src/heap/objects-visiting-inl.h" |
(...skipping 5452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5487 | 5488 |
5488 base::CallOnce(&initialize_gc_once, &InitializeGCOnce); | 5489 base::CallOnce(&initialize_gc_once, &InitializeGCOnce); |
5489 | 5490 |
5490 // Set up memory allocator. | 5491 // Set up memory allocator. |
5491 memory_allocator_ = new MemoryAllocator(isolate_); | 5492 memory_allocator_ = new MemoryAllocator(isolate_); |
5492 if (!memory_allocator_->SetUp(MaxReserved(), code_range_size_)) return false; | 5493 if (!memory_allocator_->SetUp(MaxReserved(), code_range_size_)) return false; |
5493 | 5494 |
5494 store_buffer_ = new StoreBuffer(this); | 5495 store_buffer_ = new StoreBuffer(this); |
5495 | 5496 |
5496 incremental_marking_ = new IncrementalMarking(this); | 5497 incremental_marking_ = new IncrementalMarking(this); |
5497 concurrent_marking_ = new ConcurrentMarking(this); | |
5498 | 5498 |
5499 for (int i = 0; i <= LAST_SPACE; i++) { | 5499 for (int i = 0; i <= LAST_SPACE; i++) { |
5500 space_[i] = nullptr; | 5500 space_[i] = nullptr; |
5501 } | 5501 } |
5502 | 5502 |
5503 space_[NEW_SPACE] = new_space_ = new NewSpace(this); | 5503 space_[NEW_SPACE] = new_space_ = new NewSpace(this); |
5504 if (!new_space_->SetUp(initial_semispace_size_, max_semi_space_size_)) { | 5504 if (!new_space_->SetUp(initial_semispace_size_, max_semi_space_size_)) { |
5505 return false; | 5505 return false; |
5506 } | 5506 } |
5507 new_space_top_after_last_gc_ = new_space()->top(); | 5507 new_space_top_after_last_gc_ = new_space()->top(); |
(...skipping 28 matching lines...) Expand all Loading... |
5536 for (int i = 0; i < static_cast<int>(v8::Isolate::kUseCounterFeatureCount); | 5536 for (int i = 0; i < static_cast<int>(v8::Isolate::kUseCounterFeatureCount); |
5537 i++) { | 5537 i++) { |
5538 deferred_counters_[i] = 0; | 5538 deferred_counters_[i] = 0; |
5539 } | 5539 } |
5540 | 5540 |
5541 tracer_ = new GCTracer(this); | 5541 tracer_ = new GCTracer(this); |
5542 scavenge_collector_ = new Scavenger(this); | 5542 scavenge_collector_ = new Scavenger(this); |
5543 mark_compact_collector_ = new MarkCompactCollector(this); | 5543 mark_compact_collector_ = new MarkCompactCollector(this); |
5544 incremental_marking_->set_marking_deque( | 5544 incremental_marking_->set_marking_deque( |
5545 mark_compact_collector_->marking_deque()); | 5545 mark_compact_collector_->marking_deque()); |
| 5546 concurrent_marking_ = |
| 5547 new ConcurrentMarking(this, mark_compact_collector_->marking_deque()); |
5546 if (FLAG_minor_mc) | 5548 if (FLAG_minor_mc) |
5547 minor_mark_compact_collector_ = new MinorMarkCompactCollector(this); | 5549 minor_mark_compact_collector_ = new MinorMarkCompactCollector(this); |
5548 gc_idle_time_handler_ = new GCIdleTimeHandler(); | 5550 gc_idle_time_handler_ = new GCIdleTimeHandler(); |
5549 memory_reducer_ = new MemoryReducer(this); | 5551 memory_reducer_ = new MemoryReducer(this); |
5550 if (V8_UNLIKELY(FLAG_gc_stats)) { | 5552 if (V8_UNLIKELY(FLAG_gc_stats)) { |
5551 live_object_stats_ = new ObjectStats(this); | 5553 live_object_stats_ = new ObjectStats(this); |
5552 dead_object_stats_ = new ObjectStats(this); | 5554 dead_object_stats_ = new ObjectStats(this); |
5553 } | 5555 } |
5554 scavenge_job_ = new ScavengeJob(); | 5556 scavenge_job_ = new ScavengeJob(); |
5555 local_embedder_heap_tracer_ = new LocalEmbedderHeapTracer(); | 5557 local_embedder_heap_tracer_ = new LocalEmbedderHeapTracer(); |
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6415 case LO_SPACE: | 6417 case LO_SPACE: |
6416 return "LO_SPACE"; | 6418 return "LO_SPACE"; |
6417 default: | 6419 default: |
6418 UNREACHABLE(); | 6420 UNREACHABLE(); |
6419 } | 6421 } |
6420 return NULL; | 6422 return NULL; |
6421 } | 6423 } |
6422 | 6424 |
6423 } // namespace internal | 6425 } // namespace internal |
6424 } // namespace v8 | 6426 } // namespace v8 |
OLD | NEW |