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 jit_x86_CodeGenerator_x86_h
8 #define jit_x86_CodeGenerator_x86_h
9 
10 #include "jit/x86-shared/CodeGenerator-x86-shared.h"
11 #include "jit/x86/Assembler-x86.h"
12 
13 namespace js {
14 namespace jit {
15 
16 class OutOfLineTruncate;
17 class OutOfLineTruncateFloat32;
18 
19 class CodeGeneratorX86 : public CodeGeneratorX86Shared {
20  protected:
21   CodeGeneratorX86(MIRGenerator* gen, LIRGraph* graph, MacroAssembler* masm);
22 
23   ValueOperand ToValue(LInstruction* ins, size_t pos);
24   ValueOperand ToTempValue(LInstruction* ins, size_t pos);
25 
26   void emitBigIntDiv(LBigIntDiv* ins, Register dividend, Register divisor,
27                      Register output, Label* fail);
28   void emitBigIntMod(LBigIntMod* ins, Register dividend, Register divisor,
29                      Register output, Label* fail);
30 
31   template <typename T>
32   void emitWasmLoad(T* ins);
33   template <typename T>
34   void emitWasmStore(T* ins);
35   template <typename T>
36   void emitWasmStoreOrExchangeAtomicI64(T* ins,
37                                         const wasm::MemoryAccessDesc& access);
38 
39  public:
40   void visitOutOfLineTruncate(OutOfLineTruncate* ool);
41   void visitOutOfLineTruncateFloat32(OutOfLineTruncateFloat32* ool);
42 };
43 
44 typedef CodeGeneratorX86 CodeGeneratorSpecific;
45 
46 }  // namespace jit
47 }  // namespace js
48 
49 #endif /* jit_x86_CodeGenerator_x86_h */
50