| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 namespace blink { | 51 namespace blink { |
| 52 | 52 |
| 53 class BasePage; | 53 class BasePage; |
| 54 class CallbackStack; | 54 class CallbackStack; |
| 55 struct GCInfo; | 55 struct GCInfo; |
| 56 class GarbageCollectedMixinConstructorMarker; | 56 class GarbageCollectedMixinConstructorMarker; |
| 57 class HeapObjectHeader; | 57 class HeapObjectHeader; |
| 58 class PageMemoryRegion; | 58 class PageMemoryRegion; |
| 59 class PageMemory; | 59 class PageMemory; |
| 60 class PersistentNode; | 60 class PersistentAnchor; |
| 61 class BaseHeap; | 61 class BaseHeap; |
| 62 class SafePointAwareMutexLocker; | 62 class SafePointAwareMutexLocker; |
| 63 class SafePointBarrier; | 63 class SafePointBarrier; |
| 64 class ThreadState; | 64 class ThreadState; |
| 65 class Visitor; | 65 class Visitor; |
| 66 | 66 |
| 67 using Address = uint8_t*; | 67 using Address = uint8_t*; |
| 68 | 68 |
| 69 using FinalizationCallback = void (*)(void*); | 69 using FinalizationCallback = void (*)(void*); |
| 70 using VisitorCallback = void (*)(Visitor*, void* self); | 70 using VisitorCallback = void (*)(Visitor*, void* self); |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 | 467 |
| 468 #if ENABLE(ASSERT) || ENABLE(GC_PROFILING) | 468 #if ENABLE(ASSERT) || ENABLE(GC_PROFILING) |
| 469 // Infrastructure to determine if an address is within one of the | 469 // Infrastructure to determine if an address is within one of the |
| 470 // address ranges for the Blink heap. If the address is in the Blink | 470 // address ranges for the Blink heap. If the address is in the Blink |
| 471 // heap the containing heap page is returned. | 471 // heap the containing heap page is returned. |
| 472 BasePage* findPageFromAddress(Address); | 472 BasePage* findPageFromAddress(Address); |
| 473 BasePage* findPageFromAddress(const void* pointer) { return findPageFromAddr
ess(reinterpret_cast<Address>(const_cast<void*>(pointer))); } | 473 BasePage* findPageFromAddress(const void* pointer) { return findPageFromAddr
ess(reinterpret_cast<Address>(const_cast<void*>(pointer))); } |
| 474 #endif | 474 #endif |
| 475 | 475 |
| 476 // List of persistent roots allocated on the given thread. | 476 // List of persistent roots allocated on the given thread. |
| 477 PersistentNode* roots() const { return m_persistents.get(); } | 477 PersistentAnchor* roots() const { return m_persistents.get(); } |
| 478 | 478 |
| 479 // List of global persistent roots not owned by any particular thread. | 479 // List of global persistent roots not owned by any particular thread. |
| 480 // globalRootsMutex must be acquired before any modifications. | 480 // globalRootsMutex must be acquired before any modifications. |
| 481 static PersistentNode& globalRoots(); | 481 static PersistentAnchor& globalRoots(); |
| 482 static Mutex& globalRootsMutex(); | 482 static Mutex& globalRootsMutex(); |
| 483 | 483 |
| 484 // Visit local thread stack and trace all pointers conservatively. | 484 // Visit local thread stack and trace all pointers conservatively. |
| 485 void visitStack(Visitor*); | 485 void visitStack(Visitor*); |
| 486 | 486 |
| 487 // Visit the asan fake stack frame corresponding to a slot on the | 487 // Visit the asan fake stack frame corresponding to a slot on the |
| 488 // real machine stack if there is one. | 488 // real machine stack if there is one. |
| 489 void visitAsanFakeStackForPointer(Visitor*, Address); | 489 void visitAsanFakeStackForPointer(Visitor*, Address); |
| 490 | 490 |
| 491 // Visit all persistents allocated on this thread. | 491 // Visit all persistents allocated on this thread. |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 // We can't create a static member of type ThreadState here | 704 // We can't create a static member of type ThreadState here |
| 705 // because it will introduce global constructor and destructor. | 705 // because it will introduce global constructor and destructor. |
| 706 // We would like to manage lifetime of the ThreadState attached | 706 // We would like to manage lifetime of the ThreadState attached |
| 707 // to the main thread explicitly instead and still use normal | 707 // to the main thread explicitly instead and still use normal |
| 708 // constructor and destructor for the ThreadState class. | 708 // constructor and destructor for the ThreadState class. |
| 709 // For this we reserve static storage for the main ThreadState | 709 // For this we reserve static storage for the main ThreadState |
| 710 // and lazily construct ThreadState in it using placement new. | 710 // and lazily construct ThreadState in it using placement new. |
| 711 static uint8_t s_mainThreadStateStorage[]; | 711 static uint8_t s_mainThreadStateStorage[]; |
| 712 | 712 |
| 713 ThreadIdentifier m_thread; | 713 ThreadIdentifier m_thread; |
| 714 OwnPtr<PersistentNode> m_persistents; | 714 OwnPtr<PersistentAnchor> m_persistents; |
| 715 StackState m_stackState; | 715 StackState m_stackState; |
| 716 intptr_t* m_startOfStack; | 716 intptr_t* m_startOfStack; |
| 717 intptr_t* m_endOfStack; | 717 intptr_t* m_endOfStack; |
| 718 void* m_safePointScopeMarker; | 718 void* m_safePointScopeMarker; |
| 719 Vector<Address> m_safePointStackCopy; | 719 Vector<Address> m_safePointStackCopy; |
| 720 bool m_atSafePoint; | 720 bool m_atSafePoint; |
| 721 Vector<Interruptor*> m_interruptors; | 721 Vector<Interruptor*> m_interruptors; |
| 722 bool m_sweepForbidden; | 722 bool m_sweepForbidden; |
| 723 size_t m_noAllocationCount; | 723 size_t m_noAllocationCount; |
| 724 size_t m_gcForbiddenCount; | 724 size_t m_gcForbiddenCount; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 }; | 771 }; |
| 772 | 772 |
| 773 template<> class ThreadStateFor<AnyThread> { | 773 template<> class ThreadStateFor<AnyThread> { |
| 774 public: | 774 public: |
| 775 static ThreadState* state() { return ThreadState::current(); } | 775 static ThreadState* state() { return ThreadState::current(); } |
| 776 }; | 776 }; |
| 777 | 777 |
| 778 } // namespace blink | 778 } // namespace blink |
| 779 | 779 |
| 780 #endif // ThreadState_h | 780 #endif // ThreadState_h |
| OLD | NEW |