|
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/shared/CodeGenerator-x86-shared.h" |
|
11 |
|
12 namespace js { |
|
13 namespace jit { |
|
14 |
|
15 class CodeGeneratorX64 : public CodeGeneratorX86Shared |
|
16 { |
|
17 CodeGeneratorX64 *thisFromCtor() { |
|
18 return this; |
|
19 } |
|
20 |
|
21 protected: |
|
22 ValueOperand ToValue(LInstruction *ins, size_t pos); |
|
23 ValueOperand ToOutValue(LInstruction *ins); |
|
24 ValueOperand ToTempValue(LInstruction *ins, size_t pos); |
|
25 |
|
26 |
|
27 void loadUnboxedValue(Operand source, MIRType type, const LDefinition *dest); |
|
28 void storeUnboxedValue(const LAllocation *value, MIRType valueType, |
|
29 Operand dest, MIRType slotType); |
|
30 |
|
31 void storeElementTyped(const LAllocation *value, MIRType valueType, MIRType elementType, |
|
32 const Register &elements, const LAllocation *index); |
|
33 |
|
34 public: |
|
35 CodeGeneratorX64(MIRGenerator *gen, LIRGraph *graph, MacroAssembler *masm); |
|
36 |
|
37 public: |
|
38 bool visitValue(LValue *value); |
|
39 bool visitBox(LBox *box); |
|
40 bool visitUnbox(LUnbox *unbox); |
|
41 bool visitLoadSlotV(LLoadSlotV *ins); |
|
42 bool visitLoadSlotT(LLoadSlotT *load); |
|
43 bool visitStoreSlotT(LStoreSlotT *store); |
|
44 bool visitLoadElementT(LLoadElementT *load); |
|
45 bool visitImplicitThis(LImplicitThis *lir); |
|
46 bool visitInterruptCheck(LInterruptCheck *lir); |
|
47 bool visitCompareB(LCompareB *lir); |
|
48 bool visitCompareBAndBranch(LCompareBAndBranch *lir); |
|
49 bool visitCompareV(LCompareV *lir); |
|
50 bool visitCompareVAndBranch(LCompareVAndBranch *lir); |
|
51 bool visitTruncateDToInt32(LTruncateDToInt32 *ins); |
|
52 bool visitTruncateFToInt32(LTruncateFToInt32 *ins); |
|
53 bool visitLoadTypedArrayElementStatic(LLoadTypedArrayElementStatic *ins); |
|
54 bool visitStoreTypedArrayElementStatic(LStoreTypedArrayElementStatic *ins); |
|
55 bool visitAsmJSLoadHeap(LAsmJSLoadHeap *ins); |
|
56 bool visitAsmJSStoreHeap(LAsmJSStoreHeap *ins); |
|
57 bool visitAsmJSLoadGlobalVar(LAsmJSLoadGlobalVar *ins); |
|
58 bool visitAsmJSStoreGlobalVar(LAsmJSStoreGlobalVar *ins); |
|
59 bool visitAsmJSLoadFuncPtr(LAsmJSLoadFuncPtr *ins); |
|
60 bool visitAsmJSLoadFFIFunc(LAsmJSLoadFFIFunc *ins); |
|
61 bool visitAsmJSUInt32ToDouble(LAsmJSUInt32ToDouble *lir); |
|
62 bool visitAsmJSUInt32ToFloat32(LAsmJSUInt32ToFloat32 *lir); |
|
63 |
|
64 void postAsmJSCall(LAsmJSCall *lir) {} |
|
65 }; |
|
66 |
|
67 typedef CodeGeneratorX64 CodeGeneratorSpecific; |
|
68 |
|
69 } // namespace jit |
|
70 } // namespace js |
|
71 |
|
72 #endif /* jit_x64_CodeGenerator_x64_h */ |