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

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

Issue 1352453004: Perform scavenge in idle tasks. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 2 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
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 class GCIdleTimeAction; 424 class GCIdleTimeAction;
425 class GCIdleTimeHandler; 425 class GCIdleTimeHandler;
426 class GCIdleTimeHeapState; 426 class GCIdleTimeHeapState;
427 class GCTracer; 427 class GCTracer;
428 class HeapObjectsFilter; 428 class HeapObjectsFilter;
429 class HeapStats; 429 class HeapStats;
430 class Isolate; 430 class Isolate;
431 class MemoryReducer; 431 class MemoryReducer;
432 class ObjectStats; 432 class ObjectStats;
433 class Scavenger; 433 class Scavenger;
434 class ScavengeJob;
434 class WeakObjectRetainer; 435 class WeakObjectRetainer;
435 436
436 437
437 // A queue of objects promoted during scavenge. Each object is accompanied 438 // A queue of objects promoted during scavenge. Each object is accompanied
438 // by it's size to avoid dereferencing a map pointer for scanning. 439 // by it's size to avoid dereferencing a map pointer for scanning.
439 // The last page in to-space is used for the promotion queue. On conflict 440 // The last page in to-space is used for the promotion queue. On conflict
440 // during scavenge, the promotion queue is allocated externally and all 441 // during scavenge, the promotion queue is allocated externally and all
441 // entries are copied to the external queue. 442 // entries are copied to the external queue.
442 class PromotionQueue { 443 class PromotionQueue {
443 public: 444 public:
(...skipping 1433 matching lines...) Expand 10 before | Expand all | Expand 10 after
1877 // Calculates the allocation limit based on a given growing factor and a 1878 // Calculates the allocation limit based on a given growing factor and a
1878 // given old generation size. 1879 // given old generation size.
1879 intptr_t CalculateOldGenerationAllocationLimit(double factor, 1880 intptr_t CalculateOldGenerationAllocationLimit(double factor,
1880 intptr_t old_gen_size); 1881 intptr_t old_gen_size);
1881 1882
1882 // Sets the allocation limit to trigger the next full garbage collection. 1883 // Sets the allocation limit to trigger the next full garbage collection.
1883 void SetOldGenerationAllocationLimit(intptr_t old_gen_size, double gc_speed, 1884 void SetOldGenerationAllocationLimit(intptr_t old_gen_size, double gc_speed,
1884 double mutator_speed); 1885 double mutator_speed);
1885 1886
1886 // =========================================================================== 1887 // ===========================================================================
1888 // Inline allocation. ========================================================
1889 // ===========================================================================
1890
1891 void LowerInlineAllocationLimit(intptr_t step);
1892 void ResetInlineAllocationLimit();
1893
1894 // ===========================================================================
1887 // Idle notification. ======================================================== 1895 // Idle notification. ========================================================
1888 // =========================================================================== 1896 // ===========================================================================
1889 1897
1890 bool RecentIdleNotificationHappened(); 1898 bool RecentIdleNotificationHappened();
1899 void ScheduleIdleScavengeIfNeeded(int bytes_allocated);
1891 1900
1892 // =========================================================================== 1901 // ===========================================================================
1893 // Allocation methods. ======================================================= 1902 // Allocation methods. =======================================================
1894 // =========================================================================== 1903 // ===========================================================================
1895 1904
1896 // Returns a deep copy of the JavaScript object. 1905 // Returns a deep copy of the JavaScript object.
1897 // Properties and elements are copied too. 1906 // Properties and elements are copied too.
1898 // Optionally takes an AllocationSite to be appended in an AllocationMemento. 1907 // Optionally takes an AllocationSite to be appended in an AllocationMemento.
1899 MUST_USE_RESULT AllocationResult CopyJSObject(JSObject* source, 1908 MUST_USE_RESULT AllocationResult CopyJSObject(JSObject* source,
1900 AllocationSite* site = NULL); 1909 AllocationSite* site = NULL);
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
2260 StoreBuffer store_buffer_; 2269 StoreBuffer store_buffer_;
2261 2270
2262 IncrementalMarking incremental_marking_; 2271 IncrementalMarking incremental_marking_;
2263 2272
2264 GCIdleTimeHandler* gc_idle_time_handler_; 2273 GCIdleTimeHandler* gc_idle_time_handler_;
2265 2274
2266 MemoryReducer* memory_reducer_; 2275 MemoryReducer* memory_reducer_;
2267 2276
2268 ObjectStats* object_stats_; 2277 ObjectStats* object_stats_;
2269 2278
2279 ScavengeJob* scavenge_job_;
2280
2270 // These two counters are monotomically increasing and never reset. 2281 // These two counters are monotomically increasing and never reset.
2271 size_t full_codegen_bytes_generated_; 2282 size_t full_codegen_bytes_generated_;
2272 size_t crankshaft_codegen_bytes_generated_; 2283 size_t crankshaft_codegen_bytes_generated_;
2273 2284
2274 // This counter is increased before each GC and never reset. 2285 // This counter is increased before each GC and never reset.
2275 // To account for the bytes allocated since the last GC, use the 2286 // To account for the bytes allocated since the last GC, use the
2276 // NewSpaceAllocationCounter() function. 2287 // NewSpaceAllocationCounter() function.
2277 size_t new_space_allocation_counter_; 2288 size_t new_space_allocation_counter_;
2278 2289
2279 // This counter is increased before each GC and never reset. To 2290 // This counter is increased before each GC and never reset. To
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
2333 ArrayBufferTracker* array_buffer_tracker_; 2344 ArrayBufferTracker* array_buffer_tracker_;
2334 2345
2335 // Classes in "heap" can be friends. 2346 // Classes in "heap" can be friends.
2336 friend class AlwaysAllocateScope; 2347 friend class AlwaysAllocateScope;
2337 friend class GCCallbacksScope; 2348 friend class GCCallbacksScope;
2338 friend class GCTracer; 2349 friend class GCTracer;
2339 friend class HeapIterator; 2350 friend class HeapIterator;
2340 friend class IncrementalMarking; 2351 friend class IncrementalMarking;
2341 friend class MarkCompactCollector; 2352 friend class MarkCompactCollector;
2342 friend class MarkCompactMarkingVisitor; 2353 friend class MarkCompactMarkingVisitor;
2354 friend class NewSpace;
2343 friend class ObjectStatsVisitor; 2355 friend class ObjectStatsVisitor;
2344 friend class Page; 2356 friend class Page;
2345 friend class Scavenger; 2357 friend class Scavenger;
2346 friend class StoreBuffer; 2358 friend class StoreBuffer;
2347 2359
2348 // The allocator interface. 2360 // The allocator interface.
2349 friend class Factory; 2361 friend class Factory;
2350 2362
2351 // The Isolate constructs us. 2363 // The Isolate constructs us.
2352 friend class Isolate; 2364 friend class Isolate;
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
2701 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 2713 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
2702 2714
2703 private: 2715 private:
2704 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2716 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2705 }; 2717 };
2706 #endif // DEBUG 2718 #endif // DEBUG
2707 } 2719 }
2708 } // namespace v8::internal 2720 } // namespace v8::internal
2709 2721
2710 #endif // V8_HEAP_HEAP_H_ 2722 #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