OLD | NEW |
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 25 matching lines...) Expand all Loading... |
36 #include "spaces.h" | 36 #include "spaces.h" |
37 | 37 |
38 #include "heap.h" | 38 #include "heap.h" |
39 | 39 |
40 namespace v8 { | 40 namespace v8 { |
41 namespace internal { | 41 namespace internal { |
42 | 42 |
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 ~SweeperThread() {} |
46 | 47 |
47 void Run(); | 48 void Run(); |
48 void Stop(); | 49 void Stop(); |
49 void StartSweeping(); | 50 void StartSweeping(); |
50 void WaitForSweeperThread(); | 51 void WaitForSweeperThread(); |
51 intptr_t StealMemory(PagedSpace* space); | 52 intptr_t StealMemory(PagedSpace* space); |
52 | 53 |
53 ~SweeperThread() { | |
54 delete start_sweeping_semaphore_; | |
55 delete end_sweeping_semaphore_; | |
56 delete stop_semaphore_; | |
57 } | |
58 | |
59 private: | 54 private: |
60 Isolate* isolate_; | 55 Isolate* isolate_; |
61 Heap* heap_; | 56 Heap* heap_; |
62 MarkCompactCollector* collector_; | 57 MarkCompactCollector* collector_; |
63 Semaphore* start_sweeping_semaphore_; | 58 Semaphore start_sweeping_semaphore_; |
64 Semaphore* end_sweeping_semaphore_; | 59 Semaphore end_sweeping_semaphore_; |
65 Semaphore* stop_semaphore_; | 60 Semaphore stop_semaphore_; |
66 FreeList free_list_old_data_space_; | 61 FreeList free_list_old_data_space_; |
67 FreeList free_list_old_pointer_space_; | 62 FreeList free_list_old_pointer_space_; |
68 FreeList private_free_list_old_data_space_; | 63 FreeList private_free_list_old_data_space_; |
69 FreeList private_free_list_old_pointer_space_; | 64 FreeList private_free_list_old_pointer_space_; |
70 volatile AtomicWord stop_thread_; | 65 volatile AtomicWord stop_thread_; |
71 }; | 66 }; |
72 | 67 |
73 } } // namespace v8::internal | 68 } } // namespace v8::internal |
74 | 69 |
75 #endif // V8_SWEEPER_THREAD_H_ | 70 #endif // V8_SWEEPER_THREAD_H_ |
OLD | NEW |