| 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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 // For i == 7, the count is the number of objects that survived at least
7 GCs. | 522 // For i == 7, the count is the number of objects that survived at least
7 GCs. |
| 523 using GenerationCountsVector = Vector<int, numberOfGenerationsToTrack>; | 523 using GenerationCountsVector = Vector<int, numberOfGenerationsToTrack>; |
| 524 Vector<GenerationCountsVector> generations; | 524 Vector<GenerationCountsVector> generations; |
| 525 | 525 |
| 526 explicit SnapshotInfo(ThreadState* state) : state(state), freeSize(0), p
ageCount(0) { } | 526 explicit SnapshotInfo(ThreadState* state) : state(state), freeSize(0), p
ageCount(0) { } |
| 527 | 527 |
| 528 size_t getClassTag(const GCInfo*); | 528 size_t getClassTag(const GCInfo*); |
| 529 }; | 529 }; |
| 530 | 530 |
| 531 void snapshot(); | 531 void snapshot(); |
| 532 |
| 533 void snapshotFreeListIfNecessary(); |
| 532 #endif | 534 #endif |
| 533 | 535 |
| 534 void pushWeakPointerCallback(void*, WeakPointerCallback); | 536 void pushWeakPointerCallback(void*, WeakPointerCallback); |
| 535 bool popAndInvokeWeakPointerCallback(Visitor*); | 537 bool popAndInvokeWeakPointerCallback(Visitor*); |
| 536 | 538 |
| 537 size_t objectPayloadSizeForTesting(); | 539 size_t objectPayloadSizeForTesting(); |
| 538 | 540 |
| 539 void postGCProcessing(); | 541 void postGCProcessing(); |
| 540 void prepareHeapForTermination(); | 542 void prepareHeapForTermination(); |
| 541 | 543 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 // to sweep away any objects that are left on this heap. | 608 // to sweep away any objects that are left on this heap. |
| 607 // We assert that nothing must remain after this cleanup. | 609 // We assert that nothing must remain after this cleanup. |
| 608 // If assertion does not hold we crash as we are potentially | 610 // If assertion does not hold we crash as we are potentially |
| 609 // in the dangling pointer situation. | 611 // in the dangling pointer situation. |
| 610 void cleanup(); | 612 void cleanup(); |
| 611 void cleanupPages(); | 613 void cleanupPages(); |
| 612 | 614 |
| 613 void unregisterPreFinalizerInternal(void*); | 615 void unregisterPreFinalizerInternal(void*); |
| 614 void invokePreFinalizers(Visitor&); | 616 void invokePreFinalizers(Visitor&); |
| 615 | 617 |
| 618 #if ENABLE(GC_PROFILING) |
| 619 void snapshotFreeList(); |
| 620 #endif |
| 621 |
| 616 static WTF::ThreadSpecific<ThreadState*>* s_threadSpecific; | 622 static WTF::ThreadSpecific<ThreadState*>* s_threadSpecific; |
| 617 static uintptr_t s_mainThreadStackStart; | 623 static uintptr_t s_mainThreadStackStart; |
| 618 static uintptr_t s_mainThreadUnderestimatedStackSize; | 624 static uintptr_t s_mainThreadUnderestimatedStackSize; |
| 619 static SafePointBarrier* s_safePointBarrier; | 625 static SafePointBarrier* s_safePointBarrier; |
| 620 | 626 |
| 621 // We can't create a static member of type ThreadState here | 627 // We can't create a static member of type ThreadState here |
| 622 // because it will introduce global constructor and destructor. | 628 // because it will introduce global constructor and destructor. |
| 623 // We would like to manage lifetime of the ThreadState attached | 629 // We would like to manage lifetime of the ThreadState attached |
| 624 // to the main thread explicitly instead and still use normal | 630 // to the main thread explicitly instead and still use normal |
| 625 // constructor and destructor for the ThreadState class. | 631 // constructor and destructor for the ThreadState class. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 653 HashMap<void*, bool (*)(void*, Visitor&)> m_preFinalizers; | 659 HashMap<void*, bool (*)(void*, Visitor&)> m_preFinalizers; |
| 654 | 660 |
| 655 v8::Isolate* m_isolate; | 661 v8::Isolate* m_isolate; |
| 656 void (*m_traceDOMWrappers)(v8::Isolate*, Visitor*); | 662 void (*m_traceDOMWrappers)(v8::Isolate*, Visitor*); |
| 657 | 663 |
| 658 #if defined(ADDRESS_SANITIZER) | 664 #if defined(ADDRESS_SANITIZER) |
| 659 void* m_asanFakeStack; | 665 void* m_asanFakeStack; |
| 660 #endif | 666 #endif |
| 661 | 667 |
| 662 Vector<PageMemoryRegion*> m_allocatedRegionsSinceLastGC; | 668 Vector<PageMemoryRegion*> m_allocatedRegionsSinceLastGC; |
| 669 |
| 670 #if ENABLE(GC_PROFILING) |
| 671 double m_nextFreeListSnapshotTime; |
| 672 #endif |
| 663 }; | 673 }; |
| 664 | 674 |
| 665 template<ThreadAffinity affinity> class ThreadStateFor; | 675 template<ThreadAffinity affinity> class ThreadStateFor; |
| 666 | 676 |
| 667 template<> class ThreadStateFor<MainThreadOnly> { | 677 template<> class ThreadStateFor<MainThreadOnly> { |
| 668 public: | 678 public: |
| 669 static ThreadState* state() | 679 static ThreadState* state() |
| 670 { | 680 { |
| 671 // This specialization must only be used from the main thread. | 681 // This specialization must only be used from the main thread. |
| 672 ASSERT(ThreadState::current()->isMainThread()); | 682 ASSERT(ThreadState::current()->isMainThread()); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 m_locked = false; | 740 m_locked = false; |
| 731 } | 741 } |
| 732 | 742 |
| 733 MutexBase& m_mutex; | 743 MutexBase& m_mutex; |
| 734 bool m_locked; | 744 bool m_locked; |
| 735 }; | 745 }; |
| 736 | 746 |
| 737 } // namespace blink | 747 } // namespace blink |
| 738 | 748 |
| 739 #endif // ThreadState_h | 749 #endif // ThreadState_h |
| OLD | NEW |