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

Unified Diff: src/heap/heap.h

Issue 1301183002: [heap] Cleanup and fix GC flags / add testing infra (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed Hannes' comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index 4b26b6c5169a59ca6dfc61ea63f86a4795b3d543..83c5099b0caf00728d5d4ccc384c3c55f8cea631 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -1671,6 +1671,25 @@ class Heap {
private:
Heap();
+ int current_gc_flags() { return current_gc_flags_; }
+ void set_current_gc_flags(int flags) {
+ current_gc_flags_ = flags;
+ DCHECK(!ShouldFinalizeIncrementalMarking() ||
+ !ShouldAbortIncrementalMarking());
+ }
+
+ inline bool ShouldReduceMemory() const {
+ return current_gc_flags_ & kReduceMemoryFootprintMask;
+ }
+
+ inline bool ShouldAbortIncrementalMarking() const {
+ return current_gc_flags_ & kAbortIncrementalMarkingMask;
+ }
+
+ inline bool ShouldFinalizeIncrementalMarking() const {
+ return current_gc_flags_ & kFinalizeIncrementalMarkingMask;
+ }
+
// The amount of external memory registered through the API kept alive
// by global handles
int64_t amount_of_external_allocated_memory_;
@@ -2273,6 +2292,9 @@ class Heap {
// configured through the API until it is set up.
bool configured_;
+ // Currently set GC flags that are respected by all GC components.
+ int current_gc_flags_;
+
ExternalStringTable external_string_table_;
VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_;
@@ -2316,12 +2338,16 @@ class Heap {
friend class GCCallbacksScope;
friend class GCTracer;
friend class HeapIterator;
+ friend class IncrementalMarking;
friend class Isolate;
friend class MarkCompactCollector;
friend class MarkCompactMarkingVisitor;
friend class MapCompact;
friend class Page;
+ // Used in cctest.
+ friend class HeapTester;
+
DISALLOW_COPY_AND_ASSIGN(Heap);
};
« 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