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

Unified Diff: src/heap/heap.h

Issue 1293283003: [heap,cctest] Get rid of protected-for-sake-of-testing scope. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add heap-tester.h to cctest.gyp 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 | test/cctest/cctest.h » ('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 415e7d0c5ee569ea458263beb294efc1245cead9..e3099501296cb3a953df22d31d02fd53c7ff2557 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -1618,8 +1618,31 @@ class Heap {
bool ShouldOptimizeForMemoryUsage() { return optimize_for_memory_usage_; }
- protected:
- // Methods made available to tests.
+ private:
+ static const int kInitialStringTableSize = 2048;
+ static const int kInitialEvalCacheSize = 64;
+ static const int kInitialNumberStringCacheSize = 256;
+
+ 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;
+ }
// Allocates a JS Map in the heap.
MUST_USE_RESULT AllocationResult
@@ -1674,32 +1697,6 @@ class Heap {
MUST_USE_RESULT AllocationResult
AllocateFixedArray(int length, PretenureFlag pretenure = NOT_TENURED);
- static const int kInitialStringTableSize = 2048;
- static const int kInitialEvalCacheSize = 64;
- static const int kInitialNumberStringCacheSize = 256;
-
- 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_;
« no previous file with comments | « no previous file | test/cctest/cctest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698