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 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1294 | 1294 |
1295 // Call weak callbacks on objects that may now be pointing to dead | 1295 // Call weak callbacks on objects that may now be pointing to dead |
1296 // objects. | 1296 // objects. |
1297 while (popAndInvokeWeakPointerCallback(&marker)) { } | 1297 while (popAndInvokeWeakPointerCallback(&marker)) { } |
1298 | 1298 |
1299 // It is not permitted to trace pointers of live objects in the weak | 1299 // It is not permitted to trace pointers of live objects in the weak |
1300 // callback phase, so the marking stack should still be empty here. | 1300 // callback phase, so the marking stack should still be empty here. |
1301 s_markingStack->assertIsEmpty(); | 1301 s_markingStack->assertIsEmpty(); |
1302 } | 1302 } |
1303 | 1303 |
| 1304 void Heap::collectAllGarbage(ThreadState::StackState stackState, GCType gcType) |
| 1305 { |
| 1306 // FIXME: oilpan: we should perform a single GC and everything |
| 1307 // should die. Unfortunately it is not the case for all objects |
| 1308 // because the hierarchy was not completely moved to the heap and |
| 1309 // some heap allocated objects own objects that contain persistents |
| 1310 // pointing to other heap allocated objects. |
| 1311 for (int i = 0; i < 5; i++) |
| 1312 collectGarbage(stackState, gcType); |
| 1313 } |
| 1314 |
1304 void Heap::getStats(HeapStats* stats) | 1315 void Heap::getStats(HeapStats* stats) |
1305 { | 1316 { |
1306 stats->clear(); | 1317 stats->clear(); |
1307 ASSERT(ThreadState::isAnyThreadInGC()); | 1318 ASSERT(ThreadState::isAnyThreadInGC()); |
1308 ThreadState::AttachedThreadStateSet& threads = ThreadState::attachedThreads(
); | 1319 ThreadState::AttachedThreadStateSet& threads = ThreadState::attachedThreads(
); |
1309 typedef ThreadState::AttachedThreadStateSet::iterator ThreadStateIterator; | 1320 typedef ThreadState::AttachedThreadStateSet::iterator ThreadStateIterator; |
1310 for (ThreadStateIterator it = threads.begin(), end = threads.end(); it != en
d; ++it) { | 1321 for (ThreadStateIterator it = threads.begin(), end = threads.end(); it != en
d; ++it) { |
1311 HeapStats temp; | 1322 HeapStats temp; |
1312 (*it)->getStats(temp); | 1323 (*it)->getStats(temp); |
1313 stats->add(&temp); | 1324 stats->add(&temp); |
(...skipping 19 matching lines...) Expand all Loading... |
1333 | 1344 |
1334 // Force template instantiations for the types that we need. | 1345 // Force template instantiations for the types that we need. |
1335 template class HeapPage<FinalizedHeapObjectHeader>; | 1346 template class HeapPage<FinalizedHeapObjectHeader>; |
1336 template class HeapPage<HeapObjectHeader>; | 1347 template class HeapPage<HeapObjectHeader>; |
1337 template class ThreadHeap<FinalizedHeapObjectHeader>; | 1348 template class ThreadHeap<FinalizedHeapObjectHeader>; |
1338 template class ThreadHeap<HeapObjectHeader>; | 1349 template class ThreadHeap<HeapObjectHeader>; |
1339 | 1350 |
1340 CallbackStack* Heap::s_markingStack; | 1351 CallbackStack* Heap::s_markingStack; |
1341 CallbackStack* Heap::s_weakCallbackStack; | 1352 CallbackStack* Heap::s_weakCallbackStack; |
1342 } | 1353 } |
OLD | NEW |