diff -r 000000000000 -r 6474c204b198 js/src/jit/x86/CodeGenerator-x86.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit/x86/CodeGenerator-x86.h Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,90 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef jit_x86_CodeGenerator_x86_h +#define jit_x86_CodeGenerator_x86_h + +#include "jit/shared/CodeGenerator-x86-shared.h" +#include "jit/x86/Assembler-x86.h" + +namespace js { +namespace jit { + +class OutOfLineLoadTypedArrayOutOfBounds; +class OutOfLineTruncate; +class OutOfLineTruncateFloat32; + +class CodeGeneratorX86 : public CodeGeneratorX86Shared +{ + private: + CodeGeneratorX86 *thisFromCtor() { + return this; + } + + protected: + ValueOperand ToValue(LInstruction *ins, size_t pos); + ValueOperand ToOutValue(LInstruction *ins); + ValueOperand ToTempValue(LInstruction *ins, size_t pos); + + template + bool loadAndNoteViewTypeElement(ArrayBufferView::ViewType vt, const T &srcAddr, + const LDefinition *out); + template + void loadViewTypeElement(ArrayBufferView::ViewType vt, const T &srcAddr, + const LDefinition *out); + template + bool storeAndNoteViewTypeElement(ArrayBufferView::ViewType vt, const LAllocation *value, + const T &dstAddr); + template + void storeViewTypeElement(ArrayBufferView::ViewType vt, const LAllocation *value, + const T &dstAddr); + void storeElementTyped(const LAllocation *value, MIRType valueType, MIRType elementType, + const Register &elements, const LAllocation *index); + + public: + CodeGeneratorX86(MIRGenerator *gen, LIRGraph *graph, MacroAssembler *masm); + + public: + bool visitBox(LBox *box); + bool visitBoxFloatingPoint(LBoxFloatingPoint *box); + bool visitUnbox(LUnbox *unbox); + bool visitValue(LValue *value); + bool visitLoadSlotV(LLoadSlotV *load); + bool visitLoadSlotT(LLoadSlotT *load); + bool visitStoreSlotT(LStoreSlotT *store); + bool visitLoadElementT(LLoadElementT *load); + bool visitImplicitThis(LImplicitThis *lir); + bool visitInterruptCheck(LInterruptCheck *lir); + bool visitCompareB(LCompareB *lir); + bool visitCompareBAndBranch(LCompareBAndBranch *lir); + bool visitCompareV(LCompareV *lir); + bool visitCompareVAndBranch(LCompareVAndBranch *lir); + bool visitAsmJSUInt32ToDouble(LAsmJSUInt32ToDouble *lir); + bool visitAsmJSUInt32ToFloat32(LAsmJSUInt32ToFloat32 *lir); + bool visitTruncateDToInt32(LTruncateDToInt32 *ins); + bool visitTruncateFToInt32(LTruncateFToInt32 *ins); + bool visitLoadTypedArrayElementStatic(LLoadTypedArrayElementStatic *ins); + bool visitStoreTypedArrayElementStatic(LStoreTypedArrayElementStatic *ins); + bool visitAsmJSLoadHeap(LAsmJSLoadHeap *ins); + bool visitAsmJSStoreHeap(LAsmJSStoreHeap *ins); + bool visitAsmJSLoadGlobalVar(LAsmJSLoadGlobalVar *ins); + bool visitAsmJSStoreGlobalVar(LAsmJSStoreGlobalVar *ins); + bool visitAsmJSLoadFuncPtr(LAsmJSLoadFuncPtr *ins); + bool visitAsmJSLoadFFIFunc(LAsmJSLoadFFIFunc *ins); + + bool visitOutOfLineLoadTypedArrayOutOfBounds(OutOfLineLoadTypedArrayOutOfBounds *ool); + bool visitOutOfLineTruncate(OutOfLineTruncate *ool); + bool visitOutOfLineTruncateFloat32(OutOfLineTruncateFloat32 *ool); + + void postAsmJSCall(LAsmJSCall *lir); +}; + +typedef CodeGeneratorX86 CodeGeneratorSpecific; + +} // namespace jit +} // namespace js + +#endif /* jit_x86_CodeGenerator_x86_h */