OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 // From here on ignore all conservatively discovered | 291 // From here on ignore all conservatively discovered |
292 // pointers into the heap owned by this thread. | 292 // pointers into the heap owned by this thread. |
293 m_isCleaningUp = true; | 293 m_isCleaningUp = true; |
294 | 294 |
295 for (size_t i = 0; i < m_cleanupTasks.size(); i++) | 295 for (size_t i = 0; i < m_cleanupTasks.size(); i++) |
296 m_cleanupTasks[i]->preCleanup(); | 296 m_cleanupTasks[i]->preCleanup(); |
297 | 297 |
298 // After this GC we expect heap to be empty because | 298 // After this GC we expect heap to be empty because |
299 // preCleanup tasks should have cleared all persistent | 299 // preCleanup tasks should have cleared all persistent |
300 // handles that were externally owned. | 300 // handles that were externally owned. |
| 301 // FIXME: oilpan: we should perform a single GC and everything |
| 302 // should die. Unfortunately it is not the case for all objects |
| 303 // because the hierarchy was not completely moved to the heap and |
| 304 // some heap allocated objects own objects that contain persistents |
| 305 // pointing to other heap allocated objects. |
| 306 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack); |
301 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack); | 307 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack); |
302 | 308 |
303 // Verify that all heaps are empty now. | 309 // Verify that all heaps are empty now. |
304 for (int i = 0; i < NumberOfHeaps; i++) | 310 for (int i = 0; i < NumberOfHeaps; i++) |
305 m_heaps[i]->assertEmpty(); | 311 m_heaps[i]->assertEmpty(); |
306 | 312 |
307 for (size_t i = 0; i < m_cleanupTasks.size(); i++) | 313 for (size_t i = 0; i < m_cleanupTasks.size(); i++) |
308 m_cleanupTasks[i]->postCleanup(); | 314 m_cleanupTasks[i]->postCleanup(); |
309 | 315 |
310 m_cleanupTasks.clear(); | 316 m_cleanupTasks.clear(); |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 state->safePoint(HeapPointersOnStack); | 702 state->safePoint(HeapPointersOnStack); |
697 } | 703 } |
698 | 704 |
699 ThreadState::AttachedThreadStateSet& ThreadState::attachedThreads() | 705 ThreadState::AttachedThreadStateSet& ThreadState::attachedThreads() |
700 { | 706 { |
701 DEFINE_STATIC_LOCAL(AttachedThreadStateSet, threads, ()); | 707 DEFINE_STATIC_LOCAL(AttachedThreadStateSet, threads, ()); |
702 return threads; | 708 return threads; |
703 } | 709 } |
704 | 710 |
705 } | 711 } |
OLD | NEW |