Chromium Code Reviews| 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: get rid of the additional GC. | |
|
haraken
2014/02/27 11:30:31
Just help me understand: Why is this a FIXME? I gu
Vyacheslav Egorov (Chromium)
2014/02/27 11:32:26
Because in the end everything will be moved to the
haraken
2014/02/27 11:37:20
I'm not sure how realistic it is. We'll anyway hav
| |
| 302 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack); | |
| 301 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack); | 303 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack); |
|
haraken
2014/02/27 11:30:31
Are two GCs enough?
Vyacheslav Egorov (Chromium)
2014/02/27 11:32:26
It is enough for the test we are trying to fix.
| |
| 302 | 304 |
| 303 // Verify that all heaps are empty now. | 305 // Verify that all heaps are empty now. |
| 304 for (int i = 0; i < NumberOfHeaps; i++) | 306 for (int i = 0; i < NumberOfHeaps; i++) |
| 305 m_heaps[i]->assertEmpty(); | 307 m_heaps[i]->assertEmpty(); |
|
haraken
2014/02/27 11:37:20
As long as we assert this (this assertion is enabl
| |
| 306 | 308 |
| 307 for (size_t i = 0; i < m_cleanupTasks.size(); i++) | 309 for (size_t i = 0; i < m_cleanupTasks.size(); i++) |
| 308 m_cleanupTasks[i]->postCleanup(); | 310 m_cleanupTasks[i]->postCleanup(); |
| 309 | 311 |
| 310 m_cleanupTasks.clear(); | 312 m_cleanupTasks.clear(); |
| 311 } | 313 } |
| 312 | 314 |
| 313 void ThreadState::detach() | 315 void ThreadState::detach() |
| 314 { | 316 { |
| 315 ThreadState* state = current(); | 317 ThreadState* state = current(); |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 696 state->safePoint(HeapPointersOnStack); | 698 state->safePoint(HeapPointersOnStack); |
| 697 } | 699 } |
| 698 | 700 |
| 699 ThreadState::AttachedThreadStateSet& ThreadState::attachedThreads() | 701 ThreadState::AttachedThreadStateSet& ThreadState::attachedThreads() |
| 700 { | 702 { |
| 701 DEFINE_STATIC_LOCAL(AttachedThreadStateSet, threads, ()); | 703 DEFINE_STATIC_LOCAL(AttachedThreadStateSet, threads, ()); |
| 702 return threads; | 704 return threads; |
| 703 } | 705 } |
| 704 | 706 |
| 705 } | 707 } |
| OLD | NEW |