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 jit_JitScript_inl_h
8 #define jit_JitScript_inl_h
10 #include "jit/JitScript.h"
12 #include "mozilla/Assertions.h"
15 #include "jit/JitZone.h"
16 #include "vm/JSContext.h"
17 #include "vm/JSScript.h"
22 inline AutoKeepJitScripts::AutoKeepJitScripts(JSContext
* cx
)
23 : zone_(cx
->zone()->jitZone()), prev_(zone_
->keepJitScripts()) {
24 zone_
->setKeepJitScripts(true);
27 inline AutoKeepJitScripts::~AutoKeepJitScripts() {
28 MOZ_ASSERT(zone_
->keepJitScripts());
29 zone_
->setKeepJitScripts(prev_
);
35 inline bool JSScript::ensureHasJitScript(JSContext
* cx
,
36 js::jit::AutoKeepJitScripts
&) {
40 return createJitScript(cx
);
43 #endif /* jit_JitScript_inl_h */