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_x64_CodeGenerator_x64_h
8 : #define jit_x64_CodeGenerator_x64_h
9 :
10 : #include "jit/x86-shared/CodeGenerator-x86-shared.h"
11 :
12 : namespace js {
13 : namespace jit {
14 :
15 8 : class CodeGeneratorX64 : public CodeGeneratorX86Shared
16 : {
17 : CodeGeneratorX64* thisFromCtor() {
18 : return this;
19 : }
20 :
21 : protected:
22 : Operand ToOperand64(const LInt64Allocation& a);
23 : ValueOperand ToValue(LInstruction* ins, size_t pos);
24 : ValueOperand ToOutValue(LInstruction* ins);
25 : ValueOperand ToTempValue(LInstruction* ins, size_t pos);
26 :
27 : void storeUnboxedValue(const LAllocation* value, MIRType valueType,
28 : Operand dest, MIRType slotType);
29 :
30 : void wasmStore(const wasm::MemoryAccessDesc& access, const LAllocation* value, Operand dstAddr);
31 : template <typename T> void emitWasmLoad(T* ins);
32 : template <typename T> void emitWasmStore(T* ins);
33 :
34 : public:
35 : CodeGeneratorX64(MIRGenerator* gen, LIRGraph* graph, MacroAssembler* masm);
36 :
37 : public:
38 : void visitValue(LValue* value);
39 : void visitBox(LBox* box);
40 : void visitUnbox(LUnbox* unbox);
41 : void visitCompareB(LCompareB* lir);
42 : void visitCompareBAndBranch(LCompareBAndBranch* lir);
43 : void visitCompareBitwise(LCompareBitwise* lir);
44 : void visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir);
45 : void visitCompareI64(LCompareI64* lir);
46 : void visitCompareI64AndBranch(LCompareI64AndBranch* lir);
47 : void visitDivOrModI64(LDivOrModI64* lir);
48 : void visitUDivOrModI64(LUDivOrModI64* lir);
49 : void visitNotI64(LNotI64* lir);
50 : void visitClzI64(LClzI64* lir);
51 : void visitCtzI64(LCtzI64* lir);
52 : void visitTruncateDToInt32(LTruncateDToInt32* ins);
53 : void visitTruncateFToInt32(LTruncateFToInt32* ins);
54 : void visitWrapInt64ToInt32(LWrapInt64ToInt32* lir);
55 : void visitExtendInt32ToInt64(LExtendInt32ToInt64* lir);
56 : void visitWasmTruncateToInt64(LWasmTruncateToInt64* lir);
57 : void visitInt64ToFloatingPoint(LInt64ToFloatingPoint* lir);
58 : void visitLoadTypedArrayElementStatic(LLoadTypedArrayElementStatic* ins);
59 : void visitStoreTypedArrayElementStatic(LStoreTypedArrayElementStatic* ins);
60 : void visitWasmLoad(LWasmLoad* ins);
61 : void visitWasmLoadI64(LWasmLoadI64* ins);
62 : void visitWasmStore(LWasmStore* ins);
63 : void visitWasmStoreI64(LWasmStoreI64* ins);
64 : void visitWasmSelectI64(LWasmSelectI64* ins);
65 : void visitAsmJSLoadHeap(LAsmJSLoadHeap* ins);
66 : void visitAsmJSStoreHeap(LAsmJSStoreHeap* ins);
67 : void visitAsmJSCompareExchangeHeap(LAsmJSCompareExchangeHeap* ins);
68 : void visitAsmJSAtomicExchangeHeap(LAsmJSAtomicExchangeHeap* ins);
69 : void visitAsmJSAtomicBinopHeap(LAsmJSAtomicBinopHeap* ins);
70 : void visitAsmJSAtomicBinopHeapForEffect(LAsmJSAtomicBinopHeapForEffect* ins);
71 : void visitWasmUint32ToDouble(LWasmUint32ToDouble* lir);
72 : void visitWasmUint32ToFloat32(LWasmUint32ToFloat32* lir);
73 : void visitWasmReinterpretFromI64(LWasmReinterpretFromI64* lir);
74 : void visitWasmReinterpretToI64(LWasmReinterpretToI64* lir);
75 : void visitTestI64AndBranch(LTestI64AndBranch* lir);
76 : };
77 :
78 : typedef CodeGeneratorX64 CodeGeneratorSpecific;
79 :
80 : } // namespace jit
81 : } // namespace js
82 :
83 : #endif /* jit_x64_CodeGenerator_x64_h */
|