| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ScriptWrappableVisitor_h | 5 #ifndef ScriptWrappableVisitor_h |
| 6 #define ScriptWrappableVisitor_h | 6 #define ScriptWrappableVisitor_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/RuntimeEnabledFeatures.h" | 9 #include "platform/RuntimeEnabledFeatures.h" |
| 10 #include "platform/heap/HeapPage.h" | 10 #include "platform/heap/HeapPage.h" |
| 11 #include "platform/heap/VisitorImpl.h" | 11 #include "platform/heap/VisitorImpl.h" |
| 12 #include "platform/heap/WrapperVisitor.h" | 12 #include "platform/heap/WrapperVisitor.h" |
| 13 #include "platform/wtf/Deque.h" | 13 #include "platform/wtf/Deque.h" |
| 14 #include "platform/wtf/Vector.h" | 14 #include "platform/wtf/Vector.h" |
| 15 #include "v8/include/v8.h" | 15 #include "v8/include/v8.h" |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 | 18 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 friend class ScriptWrappableVisitor; | 71 friend class ScriptWrappableVisitor; |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 // ScriptWrappableVisitor is able to trace through the objects to get all | 74 // ScriptWrappableVisitor is able to trace through the objects to get all |
| 75 // wrappers. It is used during V8 garbage collection. When this visitor is | 75 // wrappers. It is used during V8 garbage collection. When this visitor is |
| 76 // set to the v8::Isolate as its embedder heap tracer, V8 will call it during | 76 // set to the v8::Isolate as its embedder heap tracer, V8 will call it during |
| 77 // its garbage collection. At the beginning, it will call TracePrologue, then | 77 // its garbage collection. At the beginning, it will call TracePrologue, then |
| 78 // repeatedly it will call AdvanceTracing, and at the end it will call | 78 // repeatedly it will call AdvanceTracing, and at the end it will call |
| 79 // TraceEpilogue. Everytime V8 finds new wrappers, it will let the tracer | 79 // TraceEpilogue. Everytime V8 finds new wrappers, it will let the tracer |
| 80 // know using RegisterV8References. | 80 // know using RegisterV8References. |
| 81 class CORE_EXPORT ScriptWrappableVisitor : public v8::EmbedderHeapTracer, | 81 class PLATFORM_EXPORT ScriptWrappableVisitor : public v8::EmbedderHeapTracer, |
| 82 public WrapperVisitor { | 82 public WrapperVisitor { |
| 83 DISALLOW_IMPLICIT_CONSTRUCTORS(ScriptWrappableVisitor); | 83 DISALLOW_IMPLICIT_CONSTRUCTORS(ScriptWrappableVisitor); |
| 84 | 84 |
| 85 public: | 85 public: |
| 86 ScriptWrappableVisitor(v8::Isolate* isolate) : isolate_(isolate){}; | 86 ScriptWrappableVisitor(v8::Isolate* isolate) : isolate_(isolate){}; |
| 87 ~ScriptWrappableVisitor() override; | 87 ~ScriptWrappableVisitor() override; |
| 88 | 88 |
| 89 // Replace all dead objects in the marking deque with nullptr after oilpan | 89 // Replace all dead objects in the marking deque with nullptr after oilpan |
| 90 // gc. | 90 // gc. |
| 91 static void InvalidateDeadObjectsInMarkingDeque(v8::Isolate*); | 91 static void InvalidateDeadObjectsInMarkingDeque(v8::Isolate*); |
| 92 | 92 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 // - oilpan objects cannot move | 235 // - oilpan objects cannot move |
| 236 // - objects this headers belong to are invalidated by the oilpan GC in | 236 // - objects this headers belong to are invalidated by the oilpan GC in |
| 237 // invalidateDeadObjectsInMarkingDeque. | 237 // invalidateDeadObjectsInMarkingDeque. |
| 238 mutable WTF::Vector<HeapObjectHeader*> headers_to_unmark_; | 238 mutable WTF::Vector<HeapObjectHeader*> headers_to_unmark_; |
| 239 v8::Isolate* isolate_; | 239 v8::Isolate* isolate_; |
| 240 }; | 240 }; |
| 241 | 241 |
| 242 } // namespace blink | 242 } // namespace blink |
| 243 | 243 |
| 244 #endif // ScriptWrappableVisitor_h | 244 #endif // ScriptWrappableVisitor_h |
| OLD | NEW |