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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 // TODO(sof): support complete poisoning of all heaps. | 361 // TODO(sof): support complete poisoning of all heaps. |
362 ASSERT(objectsToPoison != MarkedAndUnmarked || heapIndex() == EagerSweepHeap
Index); | 362 ASSERT(objectsToPoison != MarkedAndUnmarked || heapIndex() == EagerSweepHeap
Index); |
363 | 363 |
364 // This method may either be called to poison (SetPoison) heap | 364 // This method may either be called to poison (SetPoison) heap |
365 // object payloads prior to sweeping, or it may be called at | 365 // object payloads prior to sweeping, or it may be called at |
366 // the completion of a sweep to unpoison (ClearPoison) the | 366 // the completion of a sweep to unpoison (ClearPoison) the |
367 // objects remaining in the heap. Those will all be live and unmarked. | 367 // objects remaining in the heap. Those will all be live and unmarked. |
368 // | 368 // |
369 // Poisoning may be limited to unmarked objects only, or apply to all. | 369 // Poisoning may be limited to unmarked objects only, or apply to all. |
370 if (poisoning == SetPoison) { | 370 if (poisoning == SetPoison) { |
371 ASSERT(!m_firstPage); | |
372 for (BasePage* page = m_firstUnsweptPage; page; page = page->next()) | 371 for (BasePage* page = m_firstUnsweptPage; page; page = page->next()) |
373 page->poisonObjects(objectsToPoison, poisoning); | 372 page->poisonObjects(objectsToPoison, poisoning); |
374 return; | 373 return; |
375 } | 374 } |
376 // Support clearing of poisoning after sweeping has completed, | 375 // Support clearing of poisoning after sweeping has completed, |
377 // in which case the pages of the live objects are reachable | 376 // in which case the pages of the live objects are reachable |
378 // via m_firstPage. | 377 // via m_firstPage. |
379 ASSERT(!m_firstUnsweptPage); | 378 ASSERT(!m_firstUnsweptPage); |
380 for (BasePage* page = m_firstPage; page; page = page->next()) | 379 for (BasePage* page = m_firstPage; page; page = page->next()) |
381 page->poisonObjects(objectsToPoison, poisoning); | 380 page->poisonObjects(objectsToPoison, poisoning); |
(...skipping 1901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2283 size_t Heap::s_allocatedObjectSize = 0; | 2282 size_t Heap::s_allocatedObjectSize = 0; |
2284 size_t Heap::s_allocatedSpace = 0; | 2283 size_t Heap::s_allocatedSpace = 0; |
2285 size_t Heap::s_markedObjectSize = 0; | 2284 size_t Heap::s_markedObjectSize = 0; |
2286 // We don't want to use 0 KB for the initial value because it may end up | 2285 // We don't want to use 0 KB for the initial value because it may end up |
2287 // triggering the first GC of some thread too prematurely. | 2286 // triggering the first GC of some thread too prematurely. |
2288 size_t Heap::s_estimatedLiveObjectSize = 512 * 1024; | 2287 size_t Heap::s_estimatedLiveObjectSize = 512 * 1024; |
2289 size_t Heap::s_externalObjectSizeAtLastGC = 0; | 2288 size_t Heap::s_externalObjectSizeAtLastGC = 0; |
2290 double Heap::s_estimatedMarkingTimePerByte = 0.0; | 2289 double Heap::s_estimatedMarkingTimePerByte = 0.0; |
2291 | 2290 |
2292 } // namespace blink | 2291 } // namespace blink |
OLD | NEW |