1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 * vim: set ts=8 sts=4 et sw=4 tw=99:
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 vm_Probes_inl_h
8 #define vm_Probes_inl_h
10 #include "vm/Probes.h"
17 * Many probe handlers are implemented inline for minimal performance impact,
18 * especially important when no backends are enabled.
22 probes::CallTrackingActive(JSContext
* cx
)
24 #ifdef INCLUDE_MOZILLA_DTRACE
25 if (JAVASCRIPT_FUNCTION_ENTRY_ENABLED() || JAVASCRIPT_FUNCTION_RETURN_ENABLED())
32 probes::WantNativeAddressInfo(JSContext
* cx
)
34 return cx
->reportGranularity
>= JITREPORT_GRANULARITY_FUNCTION
&&
35 JITGranularityRequested(cx
) >= JITREPORT_GRANULARITY_FUNCTION
;
39 probes::EnterScript(JSContext
* cx
, JSScript
* script
, JSFunction
* maybeFun
,
42 #ifdef INCLUDE_MOZILLA_DTRACE
43 if (JAVASCRIPT_FUNCTION_ENTRY_ENABLED())
44 DTraceEnterJSFun(cx
, maybeFun
, script
);
47 JSRuntime
* rt
= cx
->runtime();
48 if (rt
->spsProfiler
.enabled()) {
49 if (!rt
->spsProfiler
.enter(script
, maybeFun
))
51 MOZ_ASSERT_IF(!fp
->script()->isGenerator(), !fp
->hasPushedSPSFrame());
52 fp
->setPushedSPSFrame();
59 probes::ExitScript(JSContext
* cx
, JSScript
* script
, JSFunction
* maybeFun
, bool popSPSFrame
)
61 #ifdef INCLUDE_MOZILLA_DTRACE
62 if (JAVASCRIPT_FUNCTION_RETURN_ENABLED())
63 DTraceExitJSFun(cx
, maybeFun
, script
);
67 cx
->runtime()->spsProfiler
.exit(script
, maybeFun
);
71 probes::StartExecution(JSScript
* script
)
75 #ifdef INCLUDE_MOZILLA_DTRACE
76 if (JAVASCRIPT_EXECUTE_START_ENABLED())
77 JAVASCRIPT_EXECUTE_START((script
->filename() ? (char*)script
->filename() : nullName
),
85 probes::StopExecution(JSScript
* script
)
89 #ifdef INCLUDE_MOZILLA_DTRACE
90 if (JAVASCRIPT_EXECUTE_DONE_ENABLED())
91 JAVASCRIPT_EXECUTE_DONE((script
->filename() ? (char*)script
->filename() : nullName
),
100 #endif /* vm_Probes_inl_h */