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

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

Issue 1314853002: [heap] Make the current GCCallbackFlags are part of {Heap}. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: StartIncrementalMarking: made GC flags optional Created 5 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
« no previous file with comments | « no previous file | 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 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 // =========================================================================== 1355 // ===========================================================================
1356 // Incremental marking API. ================================================== 1356 // Incremental marking API. ==================================================
1357 // =========================================================================== 1357 // ===========================================================================
1358 1358
1359 // Start incremental marking and ensure that idle time handler can perform 1359 // Start incremental marking and ensure that idle time handler can perform
1360 // incremental steps. 1360 // incremental steps.
1361 void StartIdleIncrementalMarking(); 1361 void StartIdleIncrementalMarking();
1362 1362
1363 // Starts incremental marking assuming incremental marking is currently 1363 // Starts incremental marking assuming incremental marking is currently
1364 // stopped. 1364 // stopped.
1365 void StartIncrementalMarking(int gc_flags, 1365 void StartIncrementalMarking(int gc_flags = kNoGCFlags,
1366 const GCCallbackFlags gc_callback_flags, 1366 const GCCallbackFlags gc_callback_flags =
1367 GCCallbackFlags::kNoGCCallbackFlags,
1367 const char* reason = nullptr); 1368 const char* reason = nullptr);
1368 1369
1369 // Performs incremental marking steps of step_size_in_bytes as long as 1370 // Performs incremental marking steps of step_size_in_bytes as long as
1370 // deadline_ins_ms is not reached. step_size_in_bytes can be 0 to compute 1371 // deadline_ins_ms is not reached. step_size_in_bytes can be 0 to compute
1371 // an estimate increment. Returns the remaining time that cannot be used 1372 // an estimate increment. Returns the remaining time that cannot be used
1372 // for incremental marking anymore because a single step would exceed the 1373 // for incremental marking anymore because a single step would exceed the
1373 // deadline. 1374 // deadline.
1374 double AdvanceIncrementalMarking( 1375 double AdvanceIncrementalMarking(
1375 intptr_t step_size_in_bytes, double deadline_in_ms, 1376 intptr_t step_size_in_bytes, double deadline_in_ms,
1376 IncrementalMarking::StepActions step_actions); 1377 IncrementalMarking::StepActions step_actions);
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1670 ROOT_LIST(ROOT_ACCESSOR) 1671 ROOT_LIST(ROOT_ACCESSOR)
1671 #undef ROOT_ACCESSOR 1672 #undef ROOT_ACCESSOR
1672 1673
1673 int current_gc_flags() { return current_gc_flags_; } 1674 int current_gc_flags() { return current_gc_flags_; }
1674 1675
1675 void set_current_gc_flags(int flags) { 1676 void set_current_gc_flags(int flags) {
1676 current_gc_flags_ = flags; 1677 current_gc_flags_ = flags;
1677 DCHECK(!ShouldFinalizeIncrementalMarking() || 1678 DCHECK(!ShouldFinalizeIncrementalMarking() ||
1678 !ShouldAbortIncrementalMarking()); 1679 !ShouldAbortIncrementalMarking());
1679 } 1680 }
1680 1681
Hannes Payer (out of office) 2015/08/25 09:21:20 The local variable is just used within heap. The g
Michael Lippautz 2015/08/25 10:33:39 Done.
1682 GCCallbackFlags current_gc_callback_flags() {
1683 return current_gc_callback_flags_;
1684 }
1685
1686 void set_current_gc_callback_flags(GCCallbackFlags callback_flags) {
1687 current_gc_callback_flags_ = callback_flags;
1688 }
1689
1681 inline bool ShouldReduceMemory() const { 1690 inline bool ShouldReduceMemory() const {
1682 return current_gc_flags_ & kReduceMemoryFootprintMask; 1691 return current_gc_flags_ & kReduceMemoryFootprintMask;
1683 } 1692 }
1684 1693
1685 inline bool ShouldAbortIncrementalMarking() const { 1694 inline bool ShouldAbortIncrementalMarking() const {
1686 return current_gc_flags_ & kAbortIncrementalMarkingMask; 1695 return current_gc_flags_ & kAbortIncrementalMarkingMask;
1687 } 1696 }
1688 1697
1689 inline bool ShouldFinalizeIncrementalMarking() const { 1698 inline bool ShouldFinalizeIncrementalMarking() const {
1690 return current_gc_flags_ & kFinalizeIncrementalMarkingMask; 1699 return current_gc_flags_ & kFinalizeIncrementalMarkingMask;
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
2339 // Shared state read by the scavenge collector and set by ScavengeObject. 2348 // Shared state read by the scavenge collector and set by ScavengeObject.
2340 PromotionQueue promotion_queue_; 2349 PromotionQueue promotion_queue_;
2341 2350
2342 // Flag is set when the heap has been configured. The heap can be repeatedly 2351 // Flag is set when the heap has been configured. The heap can be repeatedly
2343 // configured through the API until it is set up. 2352 // configured through the API until it is set up.
2344 bool configured_; 2353 bool configured_;
2345 2354
2346 // Currently set GC flags that are respected by all GC components. 2355 // Currently set GC flags that are respected by all GC components.
2347 int current_gc_flags_; 2356 int current_gc_flags_;
2348 2357
2358 // Currently set GC callback flags that are used to pass information between
2359 // the embedder and V8's GC.
2360 GCCallbackFlags current_gc_callback_flags_;
2361
2349 ExternalStringTable external_string_table_; 2362 ExternalStringTable external_string_table_;
2350 2363
2351 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_; 2364 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_;
2352 2365
2353 MemoryChunk* chunks_queued_for_free_; 2366 MemoryChunk* chunks_queued_for_free_;
2354 2367
2355 base::Semaphore pending_unmap_job_semaphore_; 2368 base::Semaphore pending_unmap_job_semaphore_;
2356 2369
2357 base::Mutex relocation_mutex_; 2370 base::Mutex relocation_mutex_;
2358 2371
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
2763 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 2776 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
2764 2777
2765 private: 2778 private:
2766 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2779 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2767 }; 2780 };
2768 #endif // DEBUG 2781 #endif // DEBUG
2769 } 2782 }
2770 } // namespace v8::internal 2783 } // namespace v8::internal
2771 2784
2772 #endif // V8_HEAP_HEAP_H_ 2785 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698