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

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

Issue 1214813004: Version 4.5.95.1 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.5.95
Patch Set: Created 5 years, 5 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
« no previous file with comments | « src/heap/gc-idle-time-handler.cc ('k') | src/heap/heap.cc » ('j') | 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 #ifndef V8_HEAP_HEAP_H_ 5 #ifndef V8_HEAP_HEAP_H_
6 #define V8_HEAP_HEAP_H_ 6 #define V8_HEAP_HEAP_H_
7 7
8 #include <cmath> 8 #include <cmath>
9 #include <map> 9 #include <map>
10 10
11 #include "src/allocation.h" 11 #include "src/allocation.h"
12 #include "src/assert-scope.h" 12 #include "src/assert-scope.h"
13 #include "src/counters.h" 13 #include "src/counters.h"
14 #include "src/globals.h" 14 #include "src/globals.h"
15 #include "src/heap/gc-idle-time-handler.h" 15 #include "src/heap/gc-idle-time-handler.h"
16 #include "src/heap/gc-tracer.h" 16 #include "src/heap/gc-tracer.h"
17 #include "src/heap/incremental-marking.h" 17 #include "src/heap/incremental-marking.h"
18 #include "src/heap/mark-compact.h" 18 #include "src/heap/mark-compact.h"
19 #include "src/heap/memory-reducer.h"
20 #include "src/heap/objects-visiting.h" 19 #include "src/heap/objects-visiting.h"
21 #include "src/heap/spaces.h" 20 #include "src/heap/spaces.h"
22 #include "src/heap/store-buffer.h" 21 #include "src/heap/store-buffer.h"
23 #include "src/list.h" 22 #include "src/list.h"
24 #include "src/splay-tree-inl.h" 23 #include "src/splay-tree-inl.h"
25 24
26 namespace v8 { 25 namespace v8 {
27 namespace internal { 26 namespace internal {
28 27
29 // Defines all the roots in Heap. 28 // Defines all the roots in Heap.
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 824
826 // Last hope GC, should try to squeeze as much as possible. 825 // Last hope GC, should try to squeeze as much as possible.
827 void CollectAllAvailableGarbage(const char* gc_reason = NULL); 826 void CollectAllAvailableGarbage(const char* gc_reason = NULL);
828 827
829 // Check whether the heap is currently iterable. 828 // Check whether the heap is currently iterable.
830 bool IsHeapIterable(); 829 bool IsHeapIterable();
831 830
832 // Notify the heap that a context has been disposed. 831 // Notify the heap that a context has been disposed.
833 int NotifyContextDisposed(bool dependant_context); 832 int NotifyContextDisposed(bool dependant_context);
834 833
835 // Start incremental marking and ensure that idle time handler can perform
836 // incremental steps.
837 void StartIdleIncrementalMarking();
838
839 inline void increment_scan_on_scavenge_pages() { 834 inline void increment_scan_on_scavenge_pages() {
840 scan_on_scavenge_pages_++; 835 scan_on_scavenge_pages_++;
841 if (FLAG_gc_verbose) { 836 if (FLAG_gc_verbose) {
842 PrintF("Scan-on-scavenge pages: %d\n", scan_on_scavenge_pages_); 837 PrintF("Scan-on-scavenge pages: %d\n", scan_on_scavenge_pages_);
843 } 838 }
844 } 839 }
845 840
846 inline void decrement_scan_on_scavenge_pages() { 841 inline void decrement_scan_on_scavenge_pages() {
847 scan_on_scavenge_pages_--; 842 scan_on_scavenge_pages_--;
848 if (FLAG_gc_verbose) { 843 if (FLAG_gc_verbose) {
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
1615 // marking or scavenge phase. 1610 // marking or scavenge phase.
1616 void FreeDeadArrayBuffers(bool from_scavenge); 1611 void FreeDeadArrayBuffers(bool from_scavenge);
1617 1612
1618 // Prepare for a new scavenge phase. A new marking phase is implicitly 1613 // Prepare for a new scavenge phase. A new marking phase is implicitly
1619 // prepared by finishing the previous one. 1614 // prepared by finishing the previous one.
1620 void PrepareArrayBufferDiscoveryInNewSpace(); 1615 void PrepareArrayBufferDiscoveryInNewSpace();
1621 1616
1622 // An ArrayBuffer moved from new space to old space. 1617 // An ArrayBuffer moved from new space to old space.
1623 void PromoteArrayBuffer(Object* buffer); 1618 void PromoteArrayBuffer(Object* buffer);
1624 1619
1625 bool HasLowAllocationRate();
1626 bool HasHighFragmentation();
1627 bool HasHighFragmentation(intptr_t used, intptr_t committed);
1628
1629 protected: 1620 protected:
1630 // Methods made available to tests. 1621 // Methods made available to tests.
1631 1622
1632 // Allocates a JS Map in the heap. 1623 // Allocates a JS Map in the heap.
1633 MUST_USE_RESULT AllocationResult 1624 MUST_USE_RESULT AllocationResult
1634 AllocateMap(InstanceType instance_type, int instance_size, 1625 AllocateMap(InstanceType instance_type, int instance_size,
1635 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND); 1626 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND);
1636 1627
1637 // Allocates and initializes a new JavaScript object based on a 1628 // Allocates and initializes a new JavaScript object based on a
1638 // constructor. 1629 // constructor.
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1779 // remain until the next failure and garbage collection. 1770 // remain until the next failure and garbage collection.
1780 int allocation_timeout_; 1771 int allocation_timeout_;
1781 #endif // DEBUG 1772 #endif // DEBUG
1782 1773
1783 // Limit that triggers a global GC on the next (normally caused) GC. This 1774 // Limit that triggers a global GC on the next (normally caused) GC. This
1784 // is checked when we have already decided to do a GC to help determine 1775 // is checked when we have already decided to do a GC to help determine
1785 // which collector to invoke, before expanding a paged space in the old 1776 // which collector to invoke, before expanding a paged space in the old
1786 // generation and on every allocation in large object space. 1777 // generation and on every allocation in large object space.
1787 intptr_t old_generation_allocation_limit_; 1778 intptr_t old_generation_allocation_limit_;
1788 1779
1780 // The allocation limit when there is >16.66ms idle time in the idle time
1781 // handler.
1782 intptr_t idle_old_generation_allocation_limit_;
1783
1789 // Indicates that an allocation has failed in the old generation since the 1784 // Indicates that an allocation has failed in the old generation since the
1790 // last GC. 1785 // last GC.
1791 bool old_gen_exhausted_; 1786 bool old_gen_exhausted_;
1792 1787
1793 // Indicates that inline bump-pointer allocation has been globally disabled 1788 // Indicates that inline bump-pointer allocation has been globally disabled
1794 // for all spaces. This is used to disable allocations in generated code. 1789 // for all spaces. This is used to disable allocations in generated code.
1795 bool inline_allocation_disabled_; 1790 bool inline_allocation_disabled_;
1796 1791
1797 // Weak list heads, threaded through the objects. 1792 // Weak list heads, threaded through the objects.
1798 // List heads are initialized lazily and contain the undefined_value at start. 1793 // List heads are initialized lazily and contain the undefined_value at start.
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
2255 bool IsHighSurvivalRate() { return high_survival_rate_period_length_ > 0; } 2250 bool IsHighSurvivalRate() { return high_survival_rate_period_length_ > 0; }
2256 2251
2257 void ConfigureInitialOldGenerationSize(); 2252 void ConfigureInitialOldGenerationSize();
2258 2253
2259 void ConfigureNewGenerationSize(); 2254 void ConfigureNewGenerationSize();
2260 2255
2261 void SelectScavengingVisitorsTable(); 2256 void SelectScavengingVisitorsTable();
2262 2257
2263 bool HasLowYoungGenerationAllocationRate(); 2258 bool HasLowYoungGenerationAllocationRate();
2264 bool HasLowOldGenerationAllocationRate(); 2259 bool HasLowOldGenerationAllocationRate();
2260 bool HasLowAllocationRate();
2265 2261
2266 void ReduceNewSpaceSize(); 2262 void ReduceNewSpaceSize();
2267 2263
2268 bool TryFinalizeIdleIncrementalMarking( 2264 bool TryFinalizeIdleIncrementalMarking(
2269 double idle_time_in_ms, size_t size_of_objects, 2265 double idle_time_in_ms, size_t size_of_objects,
2270 size_t mark_compact_speed_in_bytes_per_ms); 2266 size_t mark_compact_speed_in_bytes_per_ms);
2271 2267
2272 GCIdleTimeHandler::HeapState ComputeHeapState(); 2268 GCIdleTimeHandler::HeapState ComputeHeapState();
2273 2269
2274 bool PerformIdleTimeAction(GCIdleTimeAction action, 2270 bool PerformIdleTimeAction(GCIdleTimeAction action,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
2321 MarkCompactCollector mark_compact_collector_; 2317 MarkCompactCollector mark_compact_collector_;
2322 2318
2323 StoreBuffer store_buffer_; 2319 StoreBuffer store_buffer_;
2324 2320
2325 Marking marking_; 2321 Marking marking_;
2326 2322
2327 IncrementalMarking incremental_marking_; 2323 IncrementalMarking incremental_marking_;
2328 2324
2329 GCIdleTimeHandler gc_idle_time_handler_; 2325 GCIdleTimeHandler gc_idle_time_handler_;
2330 2326
2331 MemoryReducer memory_reducer_;
2332
2333 // These two counters are monotomically increasing and never reset. 2327 // These two counters are monotomically increasing and never reset.
2334 size_t full_codegen_bytes_generated_; 2328 size_t full_codegen_bytes_generated_;
2335 size_t crankshaft_codegen_bytes_generated_; 2329 size_t crankshaft_codegen_bytes_generated_;
2336 2330
2337 // This counter is increased before each GC and never reset. 2331 // This counter is increased before each GC and never reset.
2338 // To account for the bytes allocated since the last GC, use the 2332 // To account for the bytes allocated since the last GC, use the
2339 // NewSpaceAllocationCounter() function. 2333 // NewSpaceAllocationCounter() function.
2340 size_t new_space_allocation_counter_; 2334 size_t new_space_allocation_counter_;
2341 2335
2342 // This counter is increased before each GC and never reset. To 2336 // This counter is increased before each GC and never reset. To
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
2864 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 2858 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
2865 2859
2866 private: 2860 private:
2867 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2861 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2868 }; 2862 };
2869 #endif // DEBUG 2863 #endif // DEBUG
2870 } 2864 }
2871 } // namespace v8::internal 2865 } // namespace v8::internal
2872 2866
2873 #endif // V8_HEAP_HEAP_H_ 2867 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « src/heap/gc-idle-time-handler.cc ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698