Debian Codegraph @

js/src/gc/GCProbes.h

raw
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set ts=8 sts=2 et sw=2 tw=80:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7 #ifndef gc_GCProbes_h
8 #define gc_GCProbes_h
9
10 /*
11 * This interface can be used to insert probes for GC related events.
12 *
13 * The code must be built with JS_GC_PROBES for these probes to be called
14 * from JIT code.
15 */
16
17 #include <stddef.h>
18
19 #include "gc/AllocKind.h"
20 #include "js/TraceKind.h"
21
22 class JSObject;
23
24 namespace js {
25 namespace gc {
26
27 class GCRuntime;
28 struct Cell;
29
30 namespace gcprobes {
31
32 inline void Init(gc::GCRuntime* gc) {}
33 inline void Finish(gc::GCRuntime* gc) {}
34 inline void NurseryAlloc(void* ptr, JS::TraceKind kind) {}
35 inline void TenuredAlloc(void* ptr, gc::AllocKind kind) {}
36 inline void CreateObject(JSObject* object) {}
37 inline void MinorGCStart() {}
38 inline void PromoteToTenured(gc::Cell* src, gc::Cell* dst) {}
39 inline void MinorGCEnd() {}
40 inline void MajorGCStart() {}
41 inline void TenuredFinalize(gc::Cell* thing) {
42 } // May be called off main thread.
43 inline void MajorGCEnd() {}
44
45 } // namespace gcprobes
46 } // namespace gc
47 } // namespace js
48
49 #endif // gc_GCProbes_h