1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit/x86/CodeGenerator-x86.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,90 @@ 1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 1.5 + * vim: set ts=8 sts=4 et sw=4 tw=99: 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef jit_x86_CodeGenerator_x86_h 1.11 +#define jit_x86_CodeGenerator_x86_h 1.12 + 1.13 +#include "jit/shared/CodeGenerator-x86-shared.h" 1.14 +#include "jit/x86/Assembler-x86.h" 1.15 + 1.16 +namespace js { 1.17 +namespace jit { 1.18 + 1.19 +class OutOfLineLoadTypedArrayOutOfBounds; 1.20 +class OutOfLineTruncate; 1.21 +class OutOfLineTruncateFloat32; 1.22 + 1.23 +class CodeGeneratorX86 : public CodeGeneratorX86Shared 1.24 +{ 1.25 + private: 1.26 + CodeGeneratorX86 *thisFromCtor() { 1.27 + return this; 1.28 + } 1.29 + 1.30 + protected: 1.31 + ValueOperand ToValue(LInstruction *ins, size_t pos); 1.32 + ValueOperand ToOutValue(LInstruction *ins); 1.33 + ValueOperand ToTempValue(LInstruction *ins, size_t pos); 1.34 + 1.35 + template<typename T> 1.36 + bool loadAndNoteViewTypeElement(ArrayBufferView::ViewType vt, const T &srcAddr, 1.37 + const LDefinition *out); 1.38 + template<typename T> 1.39 + void loadViewTypeElement(ArrayBufferView::ViewType vt, const T &srcAddr, 1.40 + const LDefinition *out); 1.41 + template<typename T> 1.42 + bool storeAndNoteViewTypeElement(ArrayBufferView::ViewType vt, const LAllocation *value, 1.43 + const T &dstAddr); 1.44 + template<typename T> 1.45 + void storeViewTypeElement(ArrayBufferView::ViewType vt, const LAllocation *value, 1.46 + const T &dstAddr); 1.47 + void storeElementTyped(const LAllocation *value, MIRType valueType, MIRType elementType, 1.48 + const Register &elements, const LAllocation *index); 1.49 + 1.50 + public: 1.51 + CodeGeneratorX86(MIRGenerator *gen, LIRGraph *graph, MacroAssembler *masm); 1.52 + 1.53 + public: 1.54 + bool visitBox(LBox *box); 1.55 + bool visitBoxFloatingPoint(LBoxFloatingPoint *box); 1.56 + bool visitUnbox(LUnbox *unbox); 1.57 + bool visitValue(LValue *value); 1.58 + bool visitLoadSlotV(LLoadSlotV *load); 1.59 + bool visitLoadSlotT(LLoadSlotT *load); 1.60 + bool visitStoreSlotT(LStoreSlotT *store); 1.61 + bool visitLoadElementT(LLoadElementT *load); 1.62 + bool visitImplicitThis(LImplicitThis *lir); 1.63 + bool visitInterruptCheck(LInterruptCheck *lir); 1.64 + bool visitCompareB(LCompareB *lir); 1.65 + bool visitCompareBAndBranch(LCompareBAndBranch *lir); 1.66 + bool visitCompareV(LCompareV *lir); 1.67 + bool visitCompareVAndBranch(LCompareVAndBranch *lir); 1.68 + bool visitAsmJSUInt32ToDouble(LAsmJSUInt32ToDouble *lir); 1.69 + bool visitAsmJSUInt32ToFloat32(LAsmJSUInt32ToFloat32 *lir); 1.70 + bool visitTruncateDToInt32(LTruncateDToInt32 *ins); 1.71 + bool visitTruncateFToInt32(LTruncateFToInt32 *ins); 1.72 + bool visitLoadTypedArrayElementStatic(LLoadTypedArrayElementStatic *ins); 1.73 + bool visitStoreTypedArrayElementStatic(LStoreTypedArrayElementStatic *ins); 1.74 + bool visitAsmJSLoadHeap(LAsmJSLoadHeap *ins); 1.75 + bool visitAsmJSStoreHeap(LAsmJSStoreHeap *ins); 1.76 + bool visitAsmJSLoadGlobalVar(LAsmJSLoadGlobalVar *ins); 1.77 + bool visitAsmJSStoreGlobalVar(LAsmJSStoreGlobalVar *ins); 1.78 + bool visitAsmJSLoadFuncPtr(LAsmJSLoadFuncPtr *ins); 1.79 + bool visitAsmJSLoadFFIFunc(LAsmJSLoadFFIFunc *ins); 1.80 + 1.81 + bool visitOutOfLineLoadTypedArrayOutOfBounds(OutOfLineLoadTypedArrayOutOfBounds *ool); 1.82 + bool visitOutOfLineTruncate(OutOfLineTruncate *ool); 1.83 + bool visitOutOfLineTruncateFloat32(OutOfLineTruncateFloat32 *ool); 1.84 + 1.85 + void postAsmJSCall(LAsmJSCall *lir); 1.86 +}; 1.87 + 1.88 +typedef CodeGeneratorX86 CodeGeneratorSpecific; 1.89 + 1.90 +} // namespace jit 1.91 +} // namespace js 1.92 + 1.93 +#endif /* jit_x86_CodeGenerator_x86_h */