Line data Source code
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/. */
6 :
7 : #ifndef jit_Linker_h
8 : #define jit_Linker_h
9 :
10 : #include "jscntxt.h"
11 : #include "jscompartment.h"
12 : #include "jsgc.h"
13 :
14 : #include "jit/ExecutableAllocator.h"
15 : #include "jit/IonCode.h"
16 : #include "jit/JitCompartment.h"
17 : #include "jit/MacroAssembler.h"
18 :
19 : namespace js {
20 : namespace jit {
21 :
22 4499 : class Linker
23 : {
24 : MacroAssembler& masm;
25 : mozilla::Maybe<AutoWritableJitCode> awjc;
26 :
27 0 : JitCode* fail(JSContext* cx) {
28 0 : ReportOutOfMemory(cx);
29 0 : return nullptr;
30 : }
31 :
32 : public:
33 4499 : explicit Linker(MacroAssembler& masm)
34 4499 : : masm(masm)
35 : {
36 4499 : masm.finish();
37 4499 : }
38 :
39 : template <AllowGC allowGC>
40 : JitCode* newCode(JSContext* cx, CodeKind kind, bool hasPatchableBackedges = false);
41 : };
42 :
43 : } // namespace jit
44 : } // namespace js
45 :
46 : #endif /* jit_Linker_h */
|