Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef V8_HEAP_EMBEDDER_TRACING_H_ | |
| 6 #define V8_HEAP_EMBEDDER_TRACING_H_ | |
| 7 | |
| 8 #include "include/v8.h" | |
| 9 | |
| 10 namespace v8 { | |
| 11 namespace internal { | |
| 12 | |
| 13 class Heap; | |
| 14 | |
| 15 class LocalEmbedderHeapTracer final { | |
| 16 public: | |
| 17 typedef std::pair<void*, void*> WrapperInfo; | |
| 18 | |
| 19 LocalEmbedderHeapTracer() : remote_tracer_(nullptr) {} | |
| 20 | |
| 21 void SetRemoteTracer(EmbedderHeapTracer* tracer) { remote_tracer_ = tracer; } | |
| 22 bool InUse() { return remote_tracer_ != nullptr; } | |
| 23 | |
| 24 void TracePrologue(); | |
| 25 void TraceEpilogue(); | |
| 26 void AbortTracing(); | |
| 27 void EnterFinalPause(); | |
| 28 bool Trace(double deadline, | |
| 29 EmbedderHeapTracer::AdvanceTracingActions actions); | |
| 30 | |
| 31 size_t NumberOfWrappersToTrace(); | |
| 32 size_t NumberOfCachedWrappersToTrace() { | |
| 33 return cached_wrappers_to_trace_.size(); | |
| 34 } | |
| 35 void AddWrapperToTrace(WrapperInfo entry) { | |
| 36 cached_wrappers_to_trace_.push_back(entry); | |
| 37 } | |
| 38 void RegisterWrappersWithRemoteTracer(); | |
| 39 | |
| 40 // In order to avoid running out of memory we force tracing wrappers if there | |
| 41 // are too many of them. | |
| 42 bool RequiresImmediateWrapperProcessing(); | |
| 43 | |
| 44 private: | |
| 45 typedef std::vector<WrapperInfo> WrapperCache; | |
| 46 | |
| 47 EmbedderHeapTracer* remote_tracer_; | |
| 48 WrapperCache cached_wrappers_to_trace_; | |
|
Hannes Payer (out of office)
2016/12/19 16:50:05
How about wrappers_to_trace_? It's simpler.
Michael Lippautz
2016/12/19 17:01:24
I want to indicate that this is just the cached v8
| |
| 49 }; | |
| 50 | |
| 51 } // namespace internal | |
| 52 } // namespace v8 | |
| 53 | |
| 54 #endif // V8_HEAP_EMBEDDER_TRACING_H_ | |
| OLD | NEW |