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

Side by Side Diff: src/sweeper-thread.h

Issue 12261011: Move sweeping pending status field of concurrent sweepers to MarkCompactCollector. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mark-compact.cc ('k') | src/sweeper-thread.cc » ('j') | 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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 class SweeperThread : public Thread { 43 class SweeperThread : public Thread {
44 public: 44 public:
45 explicit SweeperThread(Isolate* isolate); 45 explicit SweeperThread(Isolate* isolate);
46 46
47 void Run(); 47 void Run();
48 void Stop(); 48 void Stop();
49 void StartSweeping(); 49 void StartSweeping();
50 void WaitForSweeperThread(); 50 void WaitForSweeperThread();
51 intptr_t StealMemory(PagedSpace* space); 51 intptr_t StealMemory(PagedSpace* space);
52 52
53 static bool sweeping_pending() { return sweeping_pending_; }
54 static void set_sweeping_pending(bool sweeping_pending) {
55 sweeping_pending_ = sweeping_pending;
56 }
57
58 ~SweeperThread() { 53 ~SweeperThread() {
59 delete start_sweeping_semaphore_; 54 delete start_sweeping_semaphore_;
60 delete end_sweeping_semaphore_; 55 delete end_sweeping_semaphore_;
61 delete stop_semaphore_; 56 delete stop_semaphore_;
62 } 57 }
63 58
64 private: 59 private:
65 Isolate* isolate_; 60 Isolate* isolate_;
66 Heap* heap_; 61 Heap* heap_;
67 MarkCompactCollector* collector_; 62 MarkCompactCollector* collector_;
68 Semaphore* start_sweeping_semaphore_; 63 Semaphore* start_sweeping_semaphore_;
69 Semaphore* end_sweeping_semaphore_; 64 Semaphore* end_sweeping_semaphore_;
70 Semaphore* stop_semaphore_; 65 Semaphore* stop_semaphore_;
71 FreeList free_list_old_data_space_; 66 FreeList free_list_old_data_space_;
72 FreeList free_list_old_pointer_space_; 67 FreeList free_list_old_pointer_space_;
73 FreeList private_free_list_old_data_space_; 68 FreeList private_free_list_old_data_space_;
74 FreeList private_free_list_old_pointer_space_; 69 FreeList private_free_list_old_pointer_space_;
75 volatile AtomicWord stop_thread_; 70 volatile AtomicWord stop_thread_;
76 static bool sweeping_pending_;
77 }; 71 };
78 72
79 } } // namespace v8::internal 73 } } // namespace v8::internal
80 74
81 #endif // V8_SWEEPER_THREAD_H_ 75 #endif // V8_SWEEPER_THREAD_H_
OLDNEW
« 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