| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #include "wtf/ThreadingPrimitives.h" | 47 #include "wtf/ThreadingPrimitives.h" |
| 48 #include <memory> | 48 #include <memory> |
| 49 | 49 |
| 50 namespace v8 { | 50 namespace v8 { |
| 51 class Isolate; | 51 class Isolate; |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 namespace blink { | 54 namespace blink { |
| 55 | 55 |
| 56 class BasePage; | 56 class BasePage; |
| 57 class CallbackStack; | |
| 58 class GarbageCollectedMixinConstructorMarker; | 57 class GarbageCollectedMixinConstructorMarker; |
| 59 class PersistentNode; | 58 class PersistentNode; |
| 60 class PersistentRegion; | 59 class PersistentRegion; |
| 61 class BaseArena; | 60 class BaseArena; |
| 62 class SafePointAwareMutexLocker; | 61 class SafePointAwareMutexLocker; |
| 63 class SafePointBarrier; | 62 class SafePointBarrier; |
| 64 class ThreadHeap; | 63 class ThreadHeap; |
| 65 class ThreadState; | 64 class ThreadState; |
| 66 class Visitor; | 65 class Visitor; |
| 67 | 66 |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 STACK_ALLOCATED(); | 382 STACK_ALLOCATED(); |
| 384 GCSnapshotInfo(size_t numObjectTypes); | 383 GCSnapshotInfo(size_t numObjectTypes); |
| 385 | 384 |
| 386 // Map from gcInfoIndex (vector-index) to count/size. | 385 // Map from gcInfoIndex (vector-index) to count/size. |
| 387 Vector<int> liveCount; | 386 Vector<int> liveCount; |
| 388 Vector<int> deadCount; | 387 Vector<int> deadCount; |
| 389 Vector<size_t> liveSize; | 388 Vector<size_t> liveSize; |
| 390 Vector<size_t> deadSize; | 389 Vector<size_t> deadSize; |
| 391 }; | 390 }; |
| 392 | 391 |
| 393 void pushThreadLocalWeakCallback(void*, WeakCallback); | |
| 394 bool popAndInvokeThreadLocalWeakCallback(Visitor*); | |
| 395 void threadLocalWeakProcessing(); | |
| 396 | |
| 397 size_t objectPayloadSizeForTesting(); | 392 size_t objectPayloadSizeForTesting(); |
| 398 | 393 |
| 399 void shouldFlushHeapDoesNotContainCache() { | 394 void shouldFlushHeapDoesNotContainCache() { |
| 400 m_shouldFlushHeapDoesNotContainCache = true; | 395 m_shouldFlushHeapDoesNotContainCache = true; |
| 401 } | 396 } |
| 402 | 397 |
| 403 void registerTraceDOMWrappers( | 398 void registerTraceDOMWrappers( |
| 404 v8::Isolate* isolate, | 399 v8::Isolate* isolate, |
| 405 void (*traceDOMWrappers)(v8::Isolate*, Visitor*), | 400 void (*traceDOMWrappers)(v8::Isolate*, Visitor*), |
| 406 void (*invalidateDeadObjectsInWrappersMarkingDeque)(v8::Isolate*), | 401 void (*invalidateDeadObjectsInWrappersMarkingDeque)(v8::Isolate*), |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 BaseArena* m_arenas[BlinkGC::NumberOfArenas]; | 654 BaseArena* m_arenas[BlinkGC::NumberOfArenas]; |
| 660 int m_vectorBackingArenaIndex; | 655 int m_vectorBackingArenaIndex; |
| 661 size_t m_arenaAges[BlinkGC::NumberOfArenas]; | 656 size_t m_arenaAges[BlinkGC::NumberOfArenas]; |
| 662 size_t m_currentArenaAges; | 657 size_t m_currentArenaAges; |
| 663 | 658 |
| 664 GarbageCollectedMixinConstructorMarker* m_gcMixinMarker; | 659 GarbageCollectedMixinConstructorMarker* m_gcMixinMarker; |
| 665 | 660 |
| 666 bool m_shouldFlushHeapDoesNotContainCache; | 661 bool m_shouldFlushHeapDoesNotContainCache; |
| 667 GCState m_gcState; | 662 GCState m_gcState; |
| 668 | 663 |
| 669 std::unique_ptr<CallbackStack> m_threadLocalWeakCallbackStack; | |
| 670 | |
| 671 using PreFinalizerCallback = bool (*)(void*); | 664 using PreFinalizerCallback = bool (*)(void*); |
| 672 using PreFinalizer = std::pair<void*, PreFinalizerCallback>; | 665 using PreFinalizer = std::pair<void*, PreFinalizerCallback>; |
| 673 | 666 |
| 674 // Pre-finalizers are called in the reverse order in which they are | 667 // Pre-finalizers are called in the reverse order in which they are |
| 675 // registered by the constructors (including constructors of Mixin objects) | 668 // registered by the constructors (including constructors of Mixin objects) |
| 676 // for an object, by processing the m_orderedPreFinalizers back-to-front. | 669 // for an object, by processing the m_orderedPreFinalizers back-to-front. |
| 677 ListHashSet<PreFinalizer> m_orderedPreFinalizers; | 670 ListHashSet<PreFinalizer> m_orderedPreFinalizers; |
| 678 | 671 |
| 679 v8::Isolate* m_isolate; | 672 v8::Isolate* m_isolate; |
| 680 void (*m_traceDOMWrappers)(v8::Isolate*, Visitor*); | 673 void (*m_traceDOMWrappers)(v8::Isolate*, Visitor*); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 class ThreadStateFor<AnyThread> { | 723 class ThreadStateFor<AnyThread> { |
| 731 STATIC_ONLY(ThreadStateFor); | 724 STATIC_ONLY(ThreadStateFor); |
| 732 | 725 |
| 733 public: | 726 public: |
| 734 static ThreadState* state() { return ThreadState::current(); } | 727 static ThreadState* state() { return ThreadState::current(); } |
| 735 }; | 728 }; |
| 736 | 729 |
| 737 } // namespace blink | 730 } // namespace blink |
| 738 | 731 |
| 739 #endif // ThreadState_h | 732 #endif // ThreadState_h |
| OLD | NEW |