Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: src/heap/embedder-tracing.h

Issue 2576453002: [heap] Create a thin wrapper around wrapper tracing in V8 to avoid misuse (Closed)
Patch Set: Include Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « BUILD.gn ('k') | src/heap/embedder-tracing.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 #include "src/globals.h"
10
11 namespace v8 {
12 namespace internal {
13
14 class Heap;
15
16 class V8_EXPORT_PRIVATE LocalEmbedderHeapTracer final {
17 public:
18 typedef std::pair<void*, void*> WrapperInfo;
19
20 LocalEmbedderHeapTracer() : remote_tracer_(nullptr) {}
21
22 void SetRemoteTracer(EmbedderHeapTracer* tracer) { remote_tracer_ = tracer; }
23 bool InUse() { return remote_tracer_ != nullptr; }
24
25 void TracePrologue();
26 void TraceEpilogue();
27 void AbortTracing();
28 void EnterFinalPause();
29 bool Trace(double deadline,
30 EmbedderHeapTracer::AdvanceTracingActions actions);
31
32 size_t NumberOfWrappersToTrace();
33 size_t NumberOfCachedWrappersToTrace() {
34 return cached_wrappers_to_trace_.size();
35 }
36 void AddWrapperToTrace(WrapperInfo entry) {
37 cached_wrappers_to_trace_.push_back(entry);
38 }
39 void ClearCachedWrappersToTrace() { cached_wrappers_to_trace_.clear(); }
40 void RegisterWrappersWithRemoteTracer();
41
42 // In order to avoid running out of memory we force tracing wrappers if there
43 // are too many of them.
44 bool RequiresImmediateWrapperProcessing();
45
46 private:
47 typedef std::vector<WrapperInfo> WrapperCache;
48
49 EmbedderHeapTracer* remote_tracer_;
50 WrapperCache cached_wrappers_to_trace_;
51 };
52
53 } // namespace internal
54 } // namespace v8
55
56 #endif // V8_HEAP_EMBEDDER_TRACING_H_
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/heap/embedder-tracing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698