GCProbes.h (1289B)
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 "gc/AllocKind.h" 18 #include "js/TraceKind.h" 19 20 class JSObject; 21 22 namespace js { 23 namespace gc { 24 25 class GCRuntime; 26 struct Cell; 27 28 namespace gcprobes { 29 30 inline void Init(gc::GCRuntime* gc) {} 31 inline void Finish(gc::GCRuntime* gc) {} 32 inline void NurseryAlloc(void* ptr, JS::TraceKind kind) {} 33 inline void TenuredAlloc(void* ptr, gc::AllocKind kind) {} 34 inline void CreateObject(JSObject* object) {} 35 inline void MinorGCStart() {} 36 inline void PromoteToTenured(gc::Cell* src, gc::Cell* dst) {} 37 inline void MinorGCEnd() {} 38 inline void MajorGCStart() {} 39 inline void TenuredFinalize(gc::Cell* thing) { 40 } // May be called off main thread. 41 inline void MajorGCEnd() {} 42 43 } // namespace gcprobes 44 } // namespace gc 45 } // namespace js 46 47 #endif // gc_GCProbes_h