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

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

Issue 1406303008: Introduce new API for detecting when the embedder is in foreground/background. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix comment 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/api.cc ('k') | no next file » | 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 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after
1022 // This event is triggered after object is moved to a new place. 1022 // This event is triggered after object is moved to a new place.
1023 inline void OnMoveEvent(HeapObject* target, HeapObject* source, 1023 inline void OnMoveEvent(HeapObject* target, HeapObject* source,
1024 int size_in_bytes); 1024 int size_in_bytes);
1025 1025
1026 bool deserialization_complete() const { return deserialization_complete_; } 1026 bool deserialization_complete() const { return deserialization_complete_; }
1027 1027
1028 bool HasLowAllocationRate(); 1028 bool HasLowAllocationRate();
1029 bool HasHighFragmentation(); 1029 bool HasHighFragmentation();
1030 bool HasHighFragmentation(intptr_t used, intptr_t committed); 1030 bool HasHighFragmentation(intptr_t used, intptr_t committed);
1031 1031
1032 void SetOptimizeForLatency() { optimize_for_memory_usage_ = false; }
1033 void SetOptimizeForMemoryUsage() { optimize_for_memory_usage_ = true; }
1032 bool ShouldOptimizeForMemoryUsage() { return optimize_for_memory_usage_; } 1034 bool ShouldOptimizeForMemoryUsage() { return optimize_for_memory_usage_; }
1033 1035
1034 // =========================================================================== 1036 // ===========================================================================
1035 // Initialization. =========================================================== 1037 // Initialization. ===========================================================
1036 // =========================================================================== 1038 // ===========================================================================
1037 1039
1038 // Configure heap size in MB before setup. Return false if the heap has been 1040 // Configure heap size in MB before setup. Return false if the heap has been
1039 // set up already. 1041 // set up already.
1040 bool ConfigureHeap(int max_semi_space_size, int max_old_space_size, 1042 bool ConfigureHeap(int max_semi_space_size, int max_old_space_size,
1041 int max_executable_size, size_t code_range_size); 1043 int max_executable_size, size_t code_range_size);
(...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after
2732 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 2734 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
2733 2735
2734 private: 2736 private:
2735 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2737 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2736 }; 2738 };
2737 #endif // DEBUG 2739 #endif // DEBUG
2738 } // namespace internal 2740 } // namespace internal
2739 } // namespace v8 2741 } // namespace v8
2740 2742
2741 #endif // V8_HEAP_HEAP_H_ 2743 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698