| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 namespace blink { | 49 namespace blink { |
| 50 | 50 |
| 51 class BaseHeap; | 51 class BaseHeap; |
| 52 class BaseHeapPage; | 52 class BaseHeapPage; |
| 53 class FinalizedHeapObjectHeader; | 53 class FinalizedHeapObjectHeader; |
| 54 struct GCInfo; | 54 struct GCInfo; |
| 55 class HeapContainsCache; | 55 class HeapContainsCache; |
| 56 class HeapObjectHeader; | 56 class HeapObjectHeader; |
| 57 class PageMemory; | 57 class PageMemory; |
| 58 class PersistentNode; | 58 class PersistentNode; |
| 59 class WrapperPersistentRegion; | |
| 60 class Visitor; | 59 class Visitor; |
| 61 class SafePointBarrier; | 60 class SafePointBarrier; |
| 62 class SafePointAwareMutexLocker; | 61 class SafePointAwareMutexLocker; |
| 63 template<typename Header> class ThreadHeap; | 62 template<typename Header> class ThreadHeap; |
| 64 class CallbackStack; | 63 class CallbackStack; |
| 65 | 64 |
| 66 typedef uint8_t* Address; | 65 typedef uint8_t* Address; |
| 67 | 66 |
| 68 typedef void (*FinalizationCallback)(void*); | 67 typedef void (*FinalizationCallback)(void*); |
| 69 typedef void (*VisitorCallback)(Visitor*, void* self); | 68 typedef void (*VisitorCallback)(Visitor*, void* self); |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 BaseHeap* heap(int index) const { return m_heaps[index]; } | 531 BaseHeap* heap(int index) const { return m_heaps[index]; } |
| 533 | 532 |
| 534 // Infrastructure to determine if an address is within one of the | 533 // Infrastructure to determine if an address is within one of the |
| 535 // address ranges for the Blink heap. If the address is in the Blink | 534 // address ranges for the Blink heap. If the address is in the Blink |
| 536 // heap the containing heap page is returned. | 535 // heap the containing heap page is returned. |
| 537 HeapContainsCache* heapContainsCache() { return m_heapContainsCache.get(); } | 536 HeapContainsCache* heapContainsCache() { return m_heapContainsCache.get(); } |
| 538 BaseHeapPage* contains(Address address) { return heapPageFromAddress(address
); } | 537 BaseHeapPage* contains(Address address) { return heapPageFromAddress(address
); } |
| 539 BaseHeapPage* contains(void* pointer) { return contains(reinterpret_cast<Add
ress>(pointer)); } | 538 BaseHeapPage* contains(void* pointer) { return contains(reinterpret_cast<Add
ress>(pointer)); } |
| 540 BaseHeapPage* contains(const void* pointer) { return contains(const_cast<voi
d*>(pointer)); } | 539 BaseHeapPage* contains(const void* pointer) { return contains(const_cast<voi
d*>(pointer)); } |
| 541 | 540 |
| 542 WrapperPersistentRegion* wrapperRoots() const | |
| 543 { | |
| 544 ASSERT(m_liveWrapperPersistents); | |
| 545 return m_liveWrapperPersistents; | |
| 546 } | |
| 547 WrapperPersistentRegion* takeWrapperPersistentRegion(); | |
| 548 void freeWrapperPersistentRegion(WrapperPersistentRegion*); | |
| 549 | |
| 550 // List of persistent roots allocated on the given thread. | 541 // List of persistent roots allocated on the given thread. |
| 551 PersistentNode* roots() const { return m_persistents.get(); } | 542 PersistentNode* roots() const { return m_persistents.get(); } |
| 552 | 543 |
| 553 // List of global persistent roots not owned by any particular thread. | 544 // List of global persistent roots not owned by any particular thread. |
| 554 // globalRootsMutex must be acquired before any modifications. | 545 // globalRootsMutex must be acquired before any modifications. |
| 555 static PersistentNode* globalRoots(); | 546 static PersistentNode* globalRoots(); |
| 556 static Mutex& globalRootsMutex(); | 547 static Mutex& globalRootsMutex(); |
| 557 | 548 |
| 558 // Visit local thread stack and trace all pointers conservatively. | 549 // Visit local thread stack and trace all pointers conservatively. |
| 559 void visitStack(Visitor*); | 550 void visitStack(Visitor*); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 // We can't create a static member of type ThreadState here | 655 // We can't create a static member of type ThreadState here |
| 665 // because it will introduce global constructor and destructor. | 656 // because it will introduce global constructor and destructor. |
| 666 // We would like to manage lifetime of the ThreadState attached | 657 // We would like to manage lifetime of the ThreadState attached |
| 667 // to the main thread explicitly instead and still use normal | 658 // to the main thread explicitly instead and still use normal |
| 668 // constructor and destructor for the ThreadState class. | 659 // constructor and destructor for the ThreadState class. |
| 669 // For this we reserve static storage for the main ThreadState | 660 // For this we reserve static storage for the main ThreadState |
| 670 // and lazily construct ThreadState in it using placement new. | 661 // and lazily construct ThreadState in it using placement new. |
| 671 static uint8_t s_mainThreadStateStorage[]; | 662 static uint8_t s_mainThreadStateStorage[]; |
| 672 | 663 |
| 673 ThreadIdentifier m_thread; | 664 ThreadIdentifier m_thread; |
| 674 WrapperPersistentRegion* m_liveWrapperPersistents; | |
| 675 WrapperPersistentRegion* m_pooledWrapperPersistents; | |
| 676 size_t m_pooledWrapperPersistentRegionCount; | |
| 677 OwnPtr<PersistentNode> m_persistents; | 665 OwnPtr<PersistentNode> m_persistents; |
| 678 StackState m_stackState; | 666 StackState m_stackState; |
| 679 intptr_t* m_startOfStack; | 667 intptr_t* m_startOfStack; |
| 680 intptr_t* m_endOfStack; | 668 intptr_t* m_endOfStack; |
| 681 void* m_safePointScopeMarker; | 669 void* m_safePointScopeMarker; |
| 682 Vector<Address> m_safePointStackCopy; | 670 Vector<Address> m_safePointStackCopy; |
| 683 bool m_atSafePoint; | 671 bool m_atSafePoint; |
| 684 Vector<Interruptor*> m_interruptors; | 672 Vector<Interruptor*> m_interruptors; |
| 685 bool m_gcRequested; | 673 bool m_gcRequested; |
| 686 bool m_forcePreciseGCForTesting; | 674 bool m_forcePreciseGCForTesting; |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 // whether the page is part of a terminting thread or | 821 // whether the page is part of a terminting thread or |
| 834 // if the page is traced after being terminated (orphaned). | 822 // if the page is traced after being terminated (orphaned). |
| 835 uintptr_t m_terminating : 1; | 823 uintptr_t m_terminating : 1; |
| 836 uintptr_t m_tracedAfterOrphaned : 1; | 824 uintptr_t m_tracedAfterOrphaned : 1; |
| 837 uintptr_t m_promptlyFreedSize : 17; // == blinkPageSizeLog2 | 825 uintptr_t m_promptlyFreedSize : 17; // == blinkPageSizeLog2 |
| 838 }; | 826 }; |
| 839 | 827 |
| 840 } | 828 } |
| 841 | 829 |
| 842 #endif // ThreadState_h | 830 #endif // ThreadState_h |
| OLD | NEW |