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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 { | 433 { |
434 m_markingStack->decommit(); | 434 m_markingStack->decommit(); |
435 m_postMarkingCallbackStack->decommit(); | 435 m_postMarkingCallbackStack->decommit(); |
436 m_globalWeakCallbackStack->decommit(); | 436 m_globalWeakCallbackStack->decommit(); |
437 m_ephemeronStack->decommit(); | 437 m_ephemeronStack->decommit(); |
438 } | 438 } |
439 | 439 |
440 void ThreadHeap::preGC() | 440 void ThreadHeap::preGC() |
441 { | 441 { |
442 ASSERT(!ThreadState::current()->isInGC()); | 442 ASSERT(!ThreadState::current()->isInGC()); |
443 for (ThreadState* state : m_threads) { | 443 for (ThreadState* state : m_threads) |
444 state->preGC(); | 444 state->preGC(); |
445 } | |
446 } | 445 } |
447 | 446 |
448 void ThreadHeap::postGC(BlinkGC::GCType gcType) | 447 void ThreadHeap::postGC(BlinkGC::GCType gcType) |
449 { | 448 { |
450 ASSERT(ThreadState::current()->isInGC()); | 449 ASSERT(ThreadState::current()->isInGC()); |
451 for (ThreadState* state : m_threads) { | 450 for (ThreadState* state : m_threads) |
452 state->postGC(gcType); | 451 state->postGC(gcType); |
453 } | |
454 } | 452 } |
455 | 453 |
456 const char* ThreadHeap::gcReasonString(BlinkGC::GCReason reason) | 454 const char* ThreadHeap::gcReasonString(BlinkGC::GCReason reason) |
457 { | 455 { |
458 switch (reason) { | 456 switch (reason) { |
459 case BlinkGC::IdleGC: | 457 case BlinkGC::IdleGC: |
460 return "IdleGC"; | 458 return "IdleGC"; |
461 case BlinkGC::PreciseGC: | 459 case BlinkGC::PreciseGC: |
462 return "PreciseGC"; | 460 return "PreciseGC"; |
463 case BlinkGC::ConservativeGC: | 461 case BlinkGC::ConservativeGC: |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 } | 735 } |
738 return objectPayloadSize; | 736 return objectPayloadSize; |
739 } | 737 } |
740 | 738 |
741 void ThreadHeap::visitPersistentRoots(Visitor* visitor) | 739 void ThreadHeap::visitPersistentRoots(Visitor* visitor) |
742 { | 740 { |
743 ASSERT(ThreadState::current()->isInGC()); | 741 ASSERT(ThreadState::current()->isInGC()); |
744 TRACE_EVENT0("blink_gc", "ThreadHeap::visitPersistentRoots"); | 742 TRACE_EVENT0("blink_gc", "ThreadHeap::visitPersistentRoots"); |
745 ProcessHeap::crossThreadPersistentRegion().tracePersistentNodes(visitor); | 743 ProcessHeap::crossThreadPersistentRegion().tracePersistentNodes(visitor); |
746 | 744 |
747 for (ThreadState* state : m_threads) { | 745 for (ThreadState* state : m_threads) |
748 state->visitPersistents(visitor); | 746 state->visitPersistents(visitor); |
749 } | |
750 } | 747 } |
751 | 748 |
752 void ThreadHeap::visitStackRoots(Visitor* visitor) | 749 void ThreadHeap::visitStackRoots(Visitor* visitor) |
753 { | 750 { |
754 ASSERT(ThreadState::current()->isInGC()); | 751 ASSERT(ThreadState::current()->isInGC()); |
755 TRACE_EVENT0("blink_gc", "ThreadHeap::visitStackRoots"); | 752 TRACE_EVENT0("blink_gc", "ThreadHeap::visitStackRoots"); |
756 for (ThreadState* state : m_threads) { | 753 for (ThreadState* state : m_threads) |
757 state->visitStack(visitor); | 754 state->visitStack(visitor); |
758 } | |
759 } | 755 } |
760 | 756 |
761 void ThreadHeap::checkAndPark(ThreadState* threadState, SafePointAwareMutexLocke
r* locker) | 757 void ThreadHeap::checkAndPark(ThreadState* threadState, SafePointAwareMutexLocke
r* locker) |
762 { | 758 { |
763 m_safePointBarrier->checkAndPark(threadState, locker); | 759 m_safePointBarrier->checkAndPark(threadState, locker); |
764 } | 760 } |
765 | 761 |
766 void ThreadHeap::enterSafePoint(ThreadState* threadState) | 762 void ThreadHeap::enterSafePoint(ThreadState* threadState) |
767 { | 763 { |
768 m_safePointBarrier->enterSafePoint(threadState); | 764 m_safePointBarrier->enterSafePoint(threadState); |
(...skipping 24 matching lines...) Expand all Loading... |
793 ProcessHeap::decreaseTotalMarkedObjectSize(m_stats.markedObjectSize()); | 789 ProcessHeap::decreaseTotalMarkedObjectSize(m_stats.markedObjectSize()); |
794 | 790 |
795 m_stats.reset(); | 791 m_stats.reset(); |
796 for (ThreadState* state : m_threads) | 792 for (ThreadState* state : m_threads) |
797 state->resetHeapCounters(); | 793 state->resetHeapCounters(); |
798 } | 794 } |
799 | 795 |
800 ThreadHeap* ThreadHeap::s_mainThreadHeap = nullptr; | 796 ThreadHeap* ThreadHeap::s_mainThreadHeap = nullptr; |
801 | 797 |
802 } // namespace blink | 798 } // namespace blink |
OLD | NEW |