| 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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 PersistentNode* roots() const { return m_persistents.get(); } | 471 PersistentNode* roots() const { return m_persistents.get(); } |
| 472 | 472 |
| 473 // List of global persistent roots not owned by any particular thread. | 473 // List of global persistent roots not owned by any particular thread. |
| 474 // globalRootsMutex must be acquired before any modifications. | 474 // globalRootsMutex must be acquired before any modifications. |
| 475 static PersistentNode* globalRoots(); | 475 static PersistentNode* globalRoots(); |
| 476 static Mutex& globalRootsMutex(); | 476 static Mutex& globalRootsMutex(); |
| 477 | 477 |
| 478 // Visit local thread stack and trace all pointers conservatively. | 478 // Visit local thread stack and trace all pointers conservatively. |
| 479 void visitStack(Visitor*); | 479 void visitStack(Visitor*); |
| 480 | 480 |
| 481 // Visit the asan fake stack frame corresponding to a slot on the |
| 482 // real machine stack if there is one. |
| 483 void visitAsanFakeStackForPointer(Visitor*, Address); |
| 484 |
| 481 // Visit all persistents allocated on this thread. | 485 // Visit all persistents allocated on this thread. |
| 482 void visitPersistents(Visitor*); | 486 void visitPersistents(Visitor*); |
| 483 | 487 |
| 484 // Checks a given address and if a pointer into the oilpan heap marks | 488 // Checks a given address and if a pointer into the oilpan heap marks |
| 485 // the object to which it points. | 489 // the object to which it points. |
| 486 bool checkAndMarkPointer(Visitor*, Address); | 490 bool checkAndMarkPointer(Visitor*, Address); |
| 487 | 491 |
| 488 void pushWeakObjectPointerCallback(void*, WeakPointerCallback); | 492 void pushWeakObjectPointerCallback(void*, WeakPointerCallback); |
| 489 bool popAndInvokeWeakPointerCallback(Visitor*); | 493 bool popAndInvokeWeakPointerCallback(Visitor*); |
| 490 | 494 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 bool m_inGC; | 562 bool m_inGC; |
| 559 BaseHeap* m_heaps[NumberOfHeaps]; | 563 BaseHeap* m_heaps[NumberOfHeaps]; |
| 560 OwnPtr<HeapContainsCache> m_heapContainsCache; | 564 OwnPtr<HeapContainsCache> m_heapContainsCache; |
| 561 HeapStats m_stats; | 565 HeapStats m_stats; |
| 562 HeapStats m_statsAfterLastGC; | 566 HeapStats m_statsAfterLastGC; |
| 563 | 567 |
| 564 Vector<OwnPtr<CleanupTask> > m_cleanupTasks; | 568 Vector<OwnPtr<CleanupTask> > m_cleanupTasks; |
| 565 bool m_isCleaningUp; | 569 bool m_isCleaningUp; |
| 566 | 570 |
| 567 CallbackStack* m_weakCallbackStack; | 571 CallbackStack* m_weakCallbackStack; |
| 572 |
| 573 #if defined(ADDRESS_SANITIZER) && !OS(WIN) |
| 574 void* m_asanFakeStack; |
| 575 #endif |
| 568 }; | 576 }; |
| 569 | 577 |
| 570 template<ThreadAffinity affinity> class ThreadStateFor; | 578 template<ThreadAffinity affinity> class ThreadStateFor; |
| 571 | 579 |
| 572 template<> class ThreadStateFor<MainThreadOnly> { | 580 template<> class ThreadStateFor<MainThreadOnly> { |
| 573 public: | 581 public: |
| 574 static ThreadState* state() | 582 static ThreadState* state() |
| 575 { | 583 { |
| 576 // This specialization must only be used from the main thread. | 584 // This specialization must only be used from the main thread. |
| 577 ASSERT(ThreadState::isMainThread()); | 585 ASSERT(ThreadState::isMainThread()); |
| 578 return ThreadState::mainThreadState(); | 586 return ThreadState::mainThreadState(); |
| 579 } | 587 } |
| 580 }; | 588 }; |
| 581 | 589 |
| 582 template<> class ThreadStateFor<AnyThread> { | 590 template<> class ThreadStateFor<AnyThread> { |
| 583 public: | 591 public: |
| 584 static ThreadState* state() { return ThreadState::current(); } | 592 static ThreadState* state() { return ThreadState::current(); } |
| 585 }; | 593 }; |
| 586 | 594 |
| 587 } | 595 } |
| 588 | 596 |
| 589 #endif // ThreadState_h | 597 #endif // ThreadState_h |
| OLD | NEW |