Backed out changeset 1e582a0e5593 (bug 1852921) for causing build bustages
[gecko.git] / js / src / vtune / VTuneWrapper.h
blob65e0ab1fc5f3051164bdc8f169c628279793f863
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/. */
7 #ifndef vtune_vtunewrapper_h
8 #define vtune_vtunewrapper_h
10 #ifdef MOZ_VTUNE
12 # include "jstypes.h"
14 class JS_PUBLIC_API JSScript;
16 namespace js {
18 namespace jit {
19 class JitCode;
22 namespace vtune {
24 bool Initialize();
25 void Shutdown();
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();
33 // Wrapper exists in case we need locking in the future.
34 uint32_t GenerateUniqueMethodID();
36 void MarkStub(const js::jit::JitCode* code, const char* name);
38 void MarkRegExp(const js::jit::JitCode* code, bool match_only);
40 void MarkScript(const js::jit::JitCode* code, JSScript* script,
41 const char* module);
43 void MarkWasm(unsigned methodId, const char* name, void* start, uintptr_t size);
45 void UnmarkCode(const js::jit::JitCode* code);
47 void UnmarkBytes(void* bytes, unsigned size);
49 } // namespace vtune
50 } // namespace js
52 #endif // MOZ_VTUNE
54 #endif // vtune_vtunewrapper_h