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

Unified Diff: src/heap/spaces.h

Issue 1038313003: New algorithm for selecting evacuation candidates (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 7 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 | « src/heap/mark-compact.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.h
diff --git a/src/heap/spaces.h b/src/heap/spaces.h
index c81cf77257407fc25bea7466703f9a875df7d8b5..21548a04973822f5212acdef6f663037b3c8be90 100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -678,11 +678,11 @@ class MemoryChunk {
base::AtomicWord parallel_sweeping_;
// PagedSpace free-list statistics.
- intptr_t available_in_small_free_list_;
- intptr_t available_in_medium_free_list_;
- intptr_t available_in_large_free_list_;
- intptr_t available_in_huge_free_list_;
- intptr_t non_available_small_blocks_;
+ int available_in_small_free_list_;
+ int available_in_medium_free_list_;
+ int available_in_large_free_list_;
+ int available_in_huge_free_list_;
+ int non_available_small_blocks_;
static MemoryChunk* Initialize(Heap* heap, Address base, size_t size,
Address area_start, Address area_end,
@@ -776,16 +776,22 @@ class Page : public MemoryChunk {
void ResetFreeListStatistics();
+ int LiveBytesFromFreeList() {
+ return area_size() - non_available_small_blocks_ -
+ available_in_small_free_list_ - available_in_medium_free_list_ -
+ available_in_large_free_list_ - available_in_huge_free_list_;
+ }
+
#define FRAGMENTATION_STATS_ACCESSORS(type, name) \
type name() { return name##_; } \
void set_##name(type name) { name##_ = name; } \
void add_##name(type name) { name##_ += name; }
- FRAGMENTATION_STATS_ACCESSORS(intptr_t, non_available_small_blocks)
- FRAGMENTATION_STATS_ACCESSORS(intptr_t, available_in_small_free_list)
- FRAGMENTATION_STATS_ACCESSORS(intptr_t, available_in_medium_free_list)
- FRAGMENTATION_STATS_ACCESSORS(intptr_t, available_in_large_free_list)
- FRAGMENTATION_STATS_ACCESSORS(intptr_t, available_in_huge_free_list)
+ FRAGMENTATION_STATS_ACCESSORS(int, non_available_small_blocks)
+ FRAGMENTATION_STATS_ACCESSORS(int, available_in_small_free_list)
+ FRAGMENTATION_STATS_ACCESSORS(int, available_in_medium_free_list)
+ FRAGMENTATION_STATS_ACCESSORS(int, available_in_large_free_list)
+ FRAGMENTATION_STATS_ACCESSORS(int, available_in_huge_free_list)
#undef FRAGMENTATION_STATS_ACCESSORS
@@ -1700,18 +1706,6 @@ class PagedSpace : public Space {
// Approximate amount of physical memory committed for this space.
size_t CommittedPhysicalMemory() override;
- struct SizeStats {
- intptr_t Total() {
- return small_size_ + medium_size_ + large_size_ + huge_size_;
- }
-
- intptr_t small_size_;
- intptr_t medium_size_;
- intptr_t large_size_;
- intptr_t huge_size_;
- };
-
- void ObtainFreeListStatistics(Page* p, SizeStats* sizes);
void ResetFreeListStatistics();
// Sets the capacity, the available space and the wasted space to zero.
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698