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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 } | 449 } |
450 return true; | 450 return true; |
451 } | 451 } |
452 | 452 |
453 void BaseHeap::completeSweep() | 453 void BaseHeap::completeSweep() |
454 { | 454 { |
455 RELEASE_ASSERT(threadState()->isSweepingInProgress()); | 455 RELEASE_ASSERT(threadState()->isSweepingInProgress()); |
456 ASSERT(threadState()->sweepForbidden()); | 456 ASSERT(threadState()->sweepForbidden()); |
457 ASSERT(!threadState()->isMainThread() || ScriptForbiddenScope::isScriptForbi
dden()); | 457 ASSERT(!threadState()->isMainThread() || ScriptForbiddenScope::isScriptForbi
dden()); |
458 | 458 |
459 while (m_firstUnsweptPage) { | 459 #if ENABLE(ASSERT) |
| 460 if (heapIndex() == EagerSweepHeapIndex) |
| 461 threadState()->enterEagerSweepScope(); |
| 462 #endif |
| 463 |
| 464 while (m_firstUnsweptPage) |
460 sweepUnsweptPage(); | 465 sweepUnsweptPage(); |
461 } | 466 |
| 467 #if ENABLE(ASSERT) |
| 468 if (heapIndex() == EagerSweepHeapIndex) |
| 469 threadState()->leaveEagerSweepScope(); |
| 470 #endif |
462 } | 471 } |
463 | 472 |
464 NormalPageHeap::NormalPageHeap(ThreadState* state, int index) | 473 NormalPageHeap::NormalPageHeap(ThreadState* state, int index) |
465 : BaseHeap(state, index) | 474 : BaseHeap(state, index) |
466 , m_currentAllocationPoint(nullptr) | 475 , m_currentAllocationPoint(nullptr) |
467 , m_remainingAllocationSize(0) | 476 , m_remainingAllocationSize(0) |
468 , m_lastRemainingAllocationSize(0) | 477 , m_lastRemainingAllocationSize(0) |
469 , m_promptlyFreedSize(0) | 478 , m_promptlyFreedSize(0) |
470 #if ENABLE(GC_PROFILING) | 479 #if ENABLE(GC_PROFILING) |
471 , m_cumulativeAllocationSize(0) | 480 , m_cumulativeAllocationSize(0) |
(...skipping 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2282 size_t Heap::s_allocatedObjectSize = 0; | 2291 size_t Heap::s_allocatedObjectSize = 0; |
2283 size_t Heap::s_allocatedSpace = 0; | 2292 size_t Heap::s_allocatedSpace = 0; |
2284 size_t Heap::s_markedObjectSize = 0; | 2293 size_t Heap::s_markedObjectSize = 0; |
2285 // We don't want to use 0 KB for the initial value because it may end up | 2294 // We don't want to use 0 KB for the initial value because it may end up |
2286 // triggering the first GC of some thread too prematurely. | 2295 // triggering the first GC of some thread too prematurely. |
2287 size_t Heap::s_estimatedLiveObjectSize = 512 * 1024; | 2296 size_t Heap::s_estimatedLiveObjectSize = 512 * 1024; |
2288 size_t Heap::s_externalObjectSizeAtLastGC = 0; | 2297 size_t Heap::s_externalObjectSizeAtLastGC = 0; |
2289 double Heap::s_estimatedMarkingTimePerByte = 0.0; | 2298 double Heap::s_estimatedMarkingTimePerByte = 0.0; |
2290 | 2299 |
2291 } // namespace blink | 2300 } // namespace blink |
OLD | NEW |