Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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_SPACES_H_ | 5 #ifndef V8_SPACES_H_ |
| 6 #define V8_SPACES_H_ | 6 #define V8_SPACES_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/base/atomicops.h" | 9 #include "src/base/atomicops.h" |
| 10 #include "src/base/platform/mutex.h" | 10 #include "src/base/platform/mutex.h" |
| (...skipping 1887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1898 | 1898 |
| 1899 // Report code object related statistics | 1899 // Report code object related statistics |
| 1900 void CollectCodeStatistics(); | 1900 void CollectCodeStatistics(); |
| 1901 static void ReportCodeStatistics(Isolate* isolate); | 1901 static void ReportCodeStatistics(Isolate* isolate); |
| 1902 static void ResetCodeStatistics(Isolate* isolate); | 1902 static void ResetCodeStatistics(Isolate* isolate); |
| 1903 #endif | 1903 #endif |
| 1904 | 1904 |
| 1905 bool was_swept_conservatively() { return was_swept_conservatively_; } | 1905 bool was_swept_conservatively() { return was_swept_conservatively_; } |
| 1906 void set_was_swept_conservatively(bool b) { was_swept_conservatively_ = b; } | 1906 void set_was_swept_conservatively(bool b) { was_swept_conservatively_ = b; } |
| 1907 | 1907 |
| 1908 bool was_swept_concurrently() { return was_swept_concurrently_; } | |
| 1909 void set_was_swept_concurrently(bool b) { was_swept_concurrently_ = b; } | |
| 1910 | |
| 1908 // Evacuation candidates are swept by evacuator. Needs to return a valid | 1911 // Evacuation candidates are swept by evacuator. Needs to return a valid |
| 1909 // result before _and_ after evacuation has finished. | 1912 // result before _and_ after evacuation has finished. |
| 1910 static bool ShouldBeSweptBySweeperThreads(Page* p) { | 1913 static bool ShouldBeSweptBySweeperThreads(Page* p) { |
| 1911 return !p->IsEvacuationCandidate() && | 1914 return !p->IsEvacuationCandidate() && |
| 1912 !p->IsFlagSet(Page::RESCAN_ON_EVACUATION) && | 1915 !p->IsFlagSet(Page::RESCAN_ON_EVACUATION) && |
| 1913 !p->WasSweptPrecisely(); | 1916 !p->WasSweptPrecisely(); |
| 1914 } | 1917 } |
| 1915 | 1918 |
| 1916 void IncrementUnsweptFreeBytes(intptr_t by) { | 1919 void IncrementUnsweptFreeBytes(intptr_t by) { |
| 1917 unswept_free_bytes_ += by; | 1920 unswept_free_bytes_ += by; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1979 | 1982 |
| 1980 // The dummy page that anchors the double linked list of pages. | 1983 // The dummy page that anchors the double linked list of pages. |
| 1981 Page anchor_; | 1984 Page anchor_; |
| 1982 | 1985 |
| 1983 // The space's free list. | 1986 // The space's free list. |
| 1984 FreeList free_list_; | 1987 FreeList free_list_; |
| 1985 | 1988 |
| 1986 // Normal allocation information. | 1989 // Normal allocation information. |
| 1987 AllocationInfo allocation_info_; | 1990 AllocationInfo allocation_info_; |
| 1988 | 1991 |
| 1992 // Indicates if this space was swept conservatively or precisely resulting in | |
| 1993 // an non-iterable or iterable heap, respectively. | |
|
Hannes Payer (out of office)
2014/07/02 07:02:53
Actually, we could just store the sweeper type its
| |
| 1989 bool was_swept_conservatively_; | 1994 bool was_swept_conservatively_; |
| 1990 | 1995 |
| 1996 // Indicates if this space was swept by concurrent sweeper threads. | |
| 1997 bool was_swept_concurrently_; | |
| 1998 | |
| 1991 // The number of free bytes which could be reclaimed by advancing the | 1999 // The number of free bytes which could be reclaimed by advancing the |
| 1992 // concurrent sweeper threads. This is only an estimation because concurrent | 2000 // concurrent sweeper threads. This is only an estimation because concurrent |
| 1993 // sweeping is done conservatively. | 2001 // sweeping is done conservatively. |
| 1994 intptr_t unswept_free_bytes_; | 2002 intptr_t unswept_free_bytes_; |
| 1995 | 2003 |
| 1996 // The sweeper threads iterate over the list of pointer and data space pages | 2004 // The sweeper threads iterate over the list of pointer and data space pages |
| 1997 // and sweep these pages concurrently. They will stop sweeping after the | 2005 // and sweep these pages concurrently. They will stop sweeping after the |
| 1998 // end_of_unswept_pages_ page. | 2006 // end_of_unswept_pages_ page. |
| 1999 Page* end_of_unswept_pages_; | 2007 Page* end_of_unswept_pages_; |
| 2000 | 2008 |
| (...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3007 } | 3015 } |
| 3008 // Must be small, since an iteration is used for lookup. | 3016 // Must be small, since an iteration is used for lookup. |
| 3009 static const int kMaxComments = 64; | 3017 static const int kMaxComments = 64; |
| 3010 }; | 3018 }; |
| 3011 #endif | 3019 #endif |
| 3012 | 3020 |
| 3013 | 3021 |
| 3014 } } // namespace v8::internal | 3022 } } // namespace v8::internal |
| 3015 | 3023 |
| 3016 #endif // V8_SPACES_H_ | 3024 #endif // V8_SPACES_H_ |
| OLD | NEW |