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

Unified Diff: src/spaces.h

Issue 12184016: Set unswept free bytes for concurent sweeper. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 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/mark-compact.cc ('k') | src/sweeper-thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.h
diff --git a/src/spaces.h b/src/spaces.h
index 3f8e395676649820cdd322ee16ae1196e2b9978e..02982cfddcf9d6b20aa9243e9fde82dc7334f8c9 100644
--- a/src/spaces.h
+++ b/src/spaces.h
@@ -1630,6 +1630,11 @@ class PagedSpace : public Space {
accounting_stats_.ClearSizeWaste();
}
+ // Increases the number of available bytes of that space.
+ void AddToAccountingStats(intptr_t bytes) {
+ accounting_stats_.DeallocateBytes(bytes);
+ }
+
// Available bytes without growing. These are the bytes on the free list.
// The bytes in the linear allocation area are not included in this total
// because updating the stats would slow down allocation. New pages are
@@ -1749,11 +1754,19 @@ class PagedSpace : public Space {
unswept_free_bytes_ += (p->area_size() - p->LiveBytes());
}
+ void DecrementUnsweptFreeBytes(int by) {
+ unswept_free_bytes_ -= by;
+ }
+
void DecreaseUnsweptFreeBytes(Page* p) {
ASSERT(ShouldBeSweptLazily(p));
unswept_free_bytes_ -= (p->area_size() - p->LiveBytes());
}
+ void ResetUnsweptFreeBytes() {
+ unswept_free_bytes_ = 0;
+ }
+
bool AdvanceSweeper(intptr_t bytes_to_sweep);
// When parallel sweeper threads are active this function waits
@@ -1787,10 +1800,6 @@ class PagedSpace : public Space {
protected:
FreeList* free_list() { return &free_list_; }
- void AddToAccountingStats(intptr_t bytes) {
- accounting_stats_.DeallocateBytes(bytes);
- }
-
int area_size_;
// Maximum capacity of this space.
« no previous file with comments | « src/mark-compact.cc ('k') | src/sweeper-thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698