Debian Codegraph @

js/src/vtune/VTuneWrapper.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 vtune_vtunewrapper_h
8 #define vtune_vtunewrapper_h
9
10 #ifdef MOZ_VTUNE
11
12 # include "jstypes.h"
13
14 class JS_PUBLIC_API JSScript;
15
16 namespace js {
17
18 namespace jit {
19 class JitCode;
20 }
21
22 namespace vtune {
23
24 bool Initialize();
25 void Shutdown();
26
27 // VTune profiling may be attached/detached at any time, but there is no API for
28 // attaching a callback to execute at attachment time. Methods compiled before
29 // VTune was most recently attached therefore do not provide any information to
30 // VTune.
31 bool IsProfilingActive();
32
33 // Wrapper exists in case we need locking in the future.
34 uint32_t GenerateUniqueMethodID();
35
36 void MarkStub(const js::jit::JitCode* code, const char* name);
37
38 void MarkRegExp(const js::jit::JitCode* code, bool match_only);
39
40 void MarkScript(const js::jit::JitCode* code, JSScript* script,
41 const char* module);
42
43 void MarkWasm(unsigned methodId, const char* name, void* start, uintptr_t size);
44
45 void UnmarkCode(const js::jit::JitCode* code);
46
47 void UnmarkBytes(void* bytes, unsigned size);
48
49 } // namespace vtune
50 } // namespace js
51
52 #endif // MOZ_VTUNE
53
54 #endif // vtune_vtunewrapper_h