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

Side by Side Diff: runtime/vm/gc_sweeper.h

Issue 1292353004: Safepointing in GC (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Scavenger again. 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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/gc_sweeper.cc » ('j') | runtime/vm/gc_sweeper.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_GC_SWEEPER_H_ 5 #ifndef VM_GC_SWEEPER_H_
6 #define VM_GC_SWEEPER_H_ 6 #define VM_GC_SWEEPER_H_
7 7
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 #include "vm/thread.h"
9 10
10 namespace dart { 11 namespace dart {
11 12
12 // Forward declarations. 13 // Forward declarations.
13 class FreeList; 14 class FreeList;
14 class Heap; 15 class Heap;
15 class HeapPage; 16 class HeapPage;
16 class Isolate; 17 class Isolate;
17 class PageSpace; 18 class PageSpace;
18 19
19 // The class GCSweeper is used to visit the heap after marking to reclaim unused 20 // The class GCSweeper is used to visit the heap after marking to reclaim unused
20 // memory. 21 // memory.
21 class GCSweeper { 22 class GCSweeper {
22 public: 23 public:
23 GCSweeper() {} 24 GCSweeper() {}
24 ~GCSweeper() {} 25 ~GCSweeper() {}
25 26
26 // Sweep the memory area for the page while clearing the mark bits and adding 27 // Sweep the memory area for the page while clearing the mark bits and adding
27 // all the unmarked objects to the freelist. Whether the freelist is 28 // all the unmarked objects to the freelist. Whether the freelist is
28 // pre-locked is indicated by the locked parameter. 29 // pre-locked is indicated by the locked parameter.
29 // Returns true if the page is in use. Freelist is untouched if page is not 30 // Returns true if the page is in use. Freelist is untouched if page is not
30 // in use. 31 // in use.
31 bool SweepPage(HeapPage* page, FreeList* freelist, bool locked); 32 bool SweepPage(HeapPage* page, FreeList* freelist, bool locked);
32 33
33 // Returns the number of words from page->object_start() to the end of the 34 // Returns the number of words from page->object_start() to the end of the
34 // last marked object. 35 // last marked object.
35 intptr_t SweepLargePage(HeapPage* page); 36 intptr_t SweepLargePage(HeapPage* page);
36 37
37 // Sweep the regular sized data pages between first and last inclusive. 38 // Sweep the regular sized data pages between first and last inclusive.
39 // Waits for the concurrent sweeper task to enter the isolate before
40 // returning to the caller.
38 static void SweepConcurrent(Isolate* isolate, 41 static void SweepConcurrent(Isolate* isolate,
39 HeapPage* first, 42 HeapPage* first,
40 HeapPage* last, 43 HeapPage* last,
41 FreeList* freelist); 44 FreeList* freelist,
45 SafepointId pass_safepoint);
42 }; 46 };
43 47
44 } // namespace dart 48 } // namespace dart
45 49
46 #endif // VM_GC_SWEEPER_H_ 50 #endif // VM_GC_SWEEPER_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/gc_sweeper.cc » ('j') | runtime/vm/gc_sweeper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698