| 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 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1349 HeapStats temp; | 1349 HeapStats temp; |
| 1350 (*it)->getStats(temp); | 1350 (*it)->getStats(temp); |
| 1351 stats->add(&temp); | 1351 stats->add(&temp); |
| 1352 } | 1352 } |
| 1353 } | 1353 } |
| 1354 | 1354 |
| 1355 bool Heap::isConsistentForGC() | 1355 bool Heap::isConsistentForGC() |
| 1356 { | 1356 { |
| 1357 ASSERT(ThreadState::isAnyThreadInGC()); | 1357 ASSERT(ThreadState::isAnyThreadInGC()); |
| 1358 ThreadState::AttachedThreadStateSet& threads = ThreadState::attachedThreads(
); | 1358 ThreadState::AttachedThreadStateSet& threads = ThreadState::attachedThreads(
); |
| 1359 for (ThreadState::AttachedThreadStateSet::iterator it = threads.begin(), end
= threads.end(); it != end; ++it) | 1359 for (ThreadState::AttachedThreadStateSet::iterator it = threads.begin(), end
= threads.end(); it != end; ++it) { |
| 1360 return (*it)->isConsistentForGC(); | 1360 if (!(*it)->isConsistentForGC()) |
| 1361 return false; |
| 1362 } |
| 1361 return true; | 1363 return true; |
| 1362 } | 1364 } |
| 1363 | 1365 |
| 1364 void Heap::makeConsistentForGC() | 1366 void Heap::makeConsistentForGC() |
| 1365 { | 1367 { |
| 1366 ASSERT(ThreadState::isAnyThreadInGC()); | 1368 ASSERT(ThreadState::isAnyThreadInGC()); |
| 1367 ThreadState::AttachedThreadStateSet& threads = ThreadState::attachedThreads(
); | 1369 ThreadState::AttachedThreadStateSet& threads = ThreadState::attachedThreads(
); |
| 1368 for (ThreadState::AttachedThreadStateSet::iterator it = threads.begin(), end
= threads.end(); it != end; ++it) | 1370 for (ThreadState::AttachedThreadStateSet::iterator it = threads.begin(), end
= threads.end(); it != end; ++it) |
| 1369 (*it)->makeConsistentForGC(); | 1371 (*it)->makeConsistentForGC(); |
| 1370 } | 1372 } |
| 1371 | 1373 |
| 1372 // Force template instantiations for the types that we need. | 1374 // Force template instantiations for the types that we need. |
| 1373 template class HeapPage<FinalizedHeapObjectHeader>; | 1375 template class HeapPage<FinalizedHeapObjectHeader>; |
| 1374 template class HeapPage<HeapObjectHeader>; | 1376 template class HeapPage<HeapObjectHeader>; |
| 1375 template class ThreadHeap<FinalizedHeapObjectHeader>; | 1377 template class ThreadHeap<FinalizedHeapObjectHeader>; |
| 1376 template class ThreadHeap<HeapObjectHeader>; | 1378 template class ThreadHeap<HeapObjectHeader>; |
| 1377 | 1379 |
| 1378 Visitor* Heap::s_markingVisitor; | 1380 Visitor* Heap::s_markingVisitor; |
| 1379 CallbackStack* Heap::s_markingStack; | 1381 CallbackStack* Heap::s_markingStack; |
| 1380 CallbackStack* Heap::s_weakCallbackStack; | 1382 CallbackStack* Heap::s_weakCallbackStack; |
| 1381 } | 1383 } |
| OLD | NEW |