| 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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 explicit GCForbiddenScope(ThreadState* threadState) | 294 explicit GCForbiddenScope(ThreadState* threadState) |
| 295 : m_threadState(threadState) { | 295 : m_threadState(threadState) { |
| 296 m_threadState->enterGCForbiddenScope(); | 296 m_threadState->enterGCForbiddenScope(); |
| 297 } | 297 } |
| 298 ~GCForbiddenScope() { m_threadState->leaveGCForbiddenScope(); } | 298 ~GCForbiddenScope() { m_threadState->leaveGCForbiddenScope(); } |
| 299 | 299 |
| 300 private: | 300 private: |
| 301 ThreadState* const m_threadState; | 301 ThreadState* const m_threadState; |
| 302 }; | 302 }; |
| 303 | 303 |
| 304 #if DCHECK_IS_ON() |
| 305 bool canAllocateScriptWrappable() const { return !m_noScriptWrappableCount; } |
| 306 void enterNoScriptWrappableScope() { m_noScriptWrappableCount++; } |
| 307 void leaveNoScriptWrappableScope() { |
| 308 DCHECK(m_noScriptWrappableCount); |
| 309 m_noScriptWrappableCount--; |
| 310 } |
| 311 #endif |
| 312 |
| 304 void flushHeapDoesNotContainCacheIfNeeded(); | 313 void flushHeapDoesNotContainCacheIfNeeded(); |
| 305 | 314 |
| 306 // Safepoint related functionality. | 315 // Safepoint related functionality. |
| 307 // | 316 // |
| 308 // When a thread attempts to perform GC it needs to stop all other threads | 317 // When a thread attempts to perform GC it needs to stop all other threads |
| 309 // that use the heap or at least guarantee that they will not touch any | 318 // that use the heap or at least guarantee that they will not touch any |
| 310 // heap allocated object until GC is complete. | 319 // heap allocated object until GC is complete. |
| 311 // | 320 // |
| 312 // We say that a thread is at a safepoint if this thread is guaranteed to | 321 // We say that a thread is at a safepoint if this thread is guaranteed to |
| 313 // not touch any heap allocated object or any heap related functionality until | 322 // not touch any heap allocated object or any heap related functionality until |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 intptr_t* m_endOfStack; | 654 intptr_t* m_endOfStack; |
| 646 | 655 |
| 647 void* m_safePointScopeMarker; | 656 void* m_safePointScopeMarker; |
| 648 Vector<Address> m_safePointStackCopy; | 657 Vector<Address> m_safePointStackCopy; |
| 649 bool m_atSafePoint; | 658 bool m_atSafePoint; |
| 650 Vector<std::unique_ptr<BlinkGCInterruptor>> m_interruptors; | 659 Vector<std::unique_ptr<BlinkGCInterruptor>> m_interruptors; |
| 651 bool m_sweepForbidden; | 660 bool m_sweepForbidden; |
| 652 size_t m_noAllocationCount; | 661 size_t m_noAllocationCount; |
| 653 size_t m_gcForbiddenCount; | 662 size_t m_gcForbiddenCount; |
| 654 size_t m_mixinsBeingConstructedCount; | 663 size_t m_mixinsBeingConstructedCount; |
| 664 #if DCHECK_IS_ON() |
| 665 size_t m_noScriptWrappableCount; |
| 666 #endif |
| 667 |
| 655 double m_accumulatedSweepingTime; | 668 double m_accumulatedSweepingTime; |
| 656 | 669 |
| 657 BaseArena* m_arenas[BlinkGC::NumberOfArenas]; | 670 BaseArena* m_arenas[BlinkGC::NumberOfArenas]; |
| 658 int m_vectorBackingArenaIndex; | 671 int m_vectorBackingArenaIndex; |
| 659 size_t m_arenaAges[BlinkGC::NumberOfArenas]; | 672 size_t m_arenaAges[BlinkGC::NumberOfArenas]; |
| 660 size_t m_currentArenaAges; | 673 size_t m_currentArenaAges; |
| 661 | 674 |
| 662 GarbageCollectedMixinConstructorMarker* m_gcMixinMarker; | 675 GarbageCollectedMixinConstructorMarker* m_gcMixinMarker; |
| 663 | 676 |
| 664 bool m_shouldFlushHeapDoesNotContainCache; | 677 bool m_shouldFlushHeapDoesNotContainCache; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 class ThreadStateFor<AnyThread> { | 741 class ThreadStateFor<AnyThread> { |
| 729 STATIC_ONLY(ThreadStateFor); | 742 STATIC_ONLY(ThreadStateFor); |
| 730 | 743 |
| 731 public: | 744 public: |
| 732 static ThreadState* state() { return ThreadState::current(); } | 745 static ThreadState* state() { return ThreadState::current(); } |
| 733 }; | 746 }; |
| 734 | 747 |
| 735 } // namespace blink | 748 } // namespace blink |
| 736 | 749 |
| 737 #endif // ThreadState_h | 750 #endif // ThreadState_h |
| OLD | NEW |