michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * vim: set ts=8 sts=4 et sw=4 tw=99: michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef jit_BaselineCompiler_h michael@0: #define jit_BaselineCompiler_h michael@0: michael@0: #ifdef JS_ION michael@0: michael@0: #include "jit/FixedList.h" michael@0: #if defined(JS_CODEGEN_X86) michael@0: # include "jit/x86/BaselineCompiler-x86.h" michael@0: #elif defined(JS_CODEGEN_X64) michael@0: # include "jit/x64/BaselineCompiler-x64.h" michael@0: #elif defined(JS_CODEGEN_ARM) michael@0: # include "jit/arm/BaselineCompiler-arm.h" michael@0: #elif defined(JS_CODEGEN_MIPS) michael@0: # include "jit/mips/BaselineCompiler-mips.h" michael@0: #else michael@0: # error "Unknown architecture!" michael@0: #endif michael@0: michael@0: namespace js { michael@0: namespace jit { michael@0: michael@0: #define OPCODE_LIST(_) \ michael@0: _(JSOP_NOP) \ michael@0: _(JSOP_LABEL) \ michael@0: _(JSOP_POP) \ michael@0: _(JSOP_POPN) \ michael@0: _(JSOP_DUPAT) \ michael@0: _(JSOP_ENTERWITH) \ michael@0: _(JSOP_LEAVEWITH) \ michael@0: _(JSOP_DUP) \ michael@0: _(JSOP_DUP2) \ michael@0: _(JSOP_SWAP) \ michael@0: _(JSOP_PICK) \ michael@0: _(JSOP_GOTO) \ michael@0: _(JSOP_IFEQ) \ michael@0: _(JSOP_IFNE) \ michael@0: _(JSOP_AND) \ michael@0: _(JSOP_OR) \ michael@0: _(JSOP_NOT) \ michael@0: _(JSOP_POS) \ michael@0: _(JSOP_LOOPHEAD) \ michael@0: _(JSOP_LOOPENTRY) \ michael@0: _(JSOP_VOID) \ michael@0: _(JSOP_UNDEFINED) \ michael@0: _(JSOP_HOLE) \ michael@0: _(JSOP_NULL) \ michael@0: _(JSOP_THIS) \ michael@0: _(JSOP_TRUE) \ michael@0: _(JSOP_FALSE) \ michael@0: _(JSOP_ZERO) \ michael@0: _(JSOP_ONE) \ michael@0: _(JSOP_INT8) \ michael@0: _(JSOP_INT32) \ michael@0: _(JSOP_UINT16) \ michael@0: _(JSOP_UINT24) \ michael@0: _(JSOP_DOUBLE) \ michael@0: _(JSOP_STRING) \ michael@0: _(JSOP_OBJECT) \ michael@0: _(JSOP_REGEXP) \ michael@0: _(JSOP_LAMBDA) \ michael@0: _(JSOP_LAMBDA_ARROW) \ michael@0: _(JSOP_BITOR) \ michael@0: _(JSOP_BITXOR) \ michael@0: _(JSOP_BITAND) \ michael@0: _(JSOP_LSH) \ michael@0: _(JSOP_RSH) \ michael@0: _(JSOP_URSH) \ michael@0: _(JSOP_ADD) \ michael@0: _(JSOP_SUB) \ michael@0: _(JSOP_MUL) \ michael@0: _(JSOP_DIV) \ michael@0: _(JSOP_MOD) \ michael@0: _(JSOP_LT) \ michael@0: _(JSOP_LE) \ michael@0: _(JSOP_GT) \ michael@0: _(JSOP_GE) \ michael@0: _(JSOP_EQ) \ michael@0: _(JSOP_NE) \ michael@0: _(JSOP_STRICTEQ) \ michael@0: _(JSOP_STRICTNE) \ michael@0: _(JSOP_CONDSWITCH) \ michael@0: _(JSOP_CASE) \ michael@0: _(JSOP_DEFAULT) \ michael@0: _(JSOP_LINENO) \ michael@0: _(JSOP_BITNOT) \ michael@0: _(JSOP_NEG) \ michael@0: _(JSOP_NEWARRAY) \ michael@0: _(JSOP_INITELEM_ARRAY) \ michael@0: _(JSOP_NEWOBJECT) \ michael@0: _(JSOP_NEWINIT) \ michael@0: _(JSOP_INITELEM) \ michael@0: _(JSOP_INITELEM_GETTER) \ michael@0: _(JSOP_INITELEM_SETTER) \ michael@0: _(JSOP_MUTATEPROTO) \ michael@0: _(JSOP_INITPROP) \ michael@0: _(JSOP_INITPROP_GETTER) \ michael@0: _(JSOP_INITPROP_SETTER) \ michael@0: _(JSOP_ENDINIT) \ michael@0: _(JSOP_ARRAYPUSH) \ michael@0: _(JSOP_GETELEM) \ michael@0: _(JSOP_SETELEM) \ michael@0: _(JSOP_CALLELEM) \ michael@0: _(JSOP_DELELEM) \ michael@0: _(JSOP_IN) \ michael@0: _(JSOP_GETGNAME) \ michael@0: _(JSOP_BINDGNAME) \ michael@0: _(JSOP_SETGNAME) \ michael@0: _(JSOP_SETNAME) \ michael@0: _(JSOP_GETPROP) \ michael@0: _(JSOP_SETPROP) \ michael@0: _(JSOP_CALLPROP) \ michael@0: _(JSOP_DELPROP) \ michael@0: _(JSOP_LENGTH) \ michael@0: _(JSOP_GETXPROP) \ michael@0: _(JSOP_GETALIASEDVAR) \ michael@0: _(JSOP_SETALIASEDVAR) \ michael@0: _(JSOP_NAME) \ michael@0: _(JSOP_BINDNAME) \ michael@0: _(JSOP_DELNAME) \ michael@0: _(JSOP_GETINTRINSIC) \ michael@0: _(JSOP_DEFVAR) \ michael@0: _(JSOP_DEFCONST) \ michael@0: _(JSOP_SETCONST) \ michael@0: _(JSOP_DEFFUN) \ michael@0: _(JSOP_GETLOCAL) \ michael@0: _(JSOP_SETLOCAL) \ michael@0: _(JSOP_GETARG) \ michael@0: _(JSOP_SETARG) \ michael@0: _(JSOP_CALL) \ michael@0: _(JSOP_FUNCALL) \ michael@0: _(JSOP_FUNAPPLY) \ michael@0: _(JSOP_NEW) \ michael@0: _(JSOP_EVAL) \ michael@0: _(JSOP_IMPLICITTHIS) \ michael@0: _(JSOP_INSTANCEOF) \ michael@0: _(JSOP_TYPEOF) \ michael@0: _(JSOP_TYPEOFEXPR) \ michael@0: _(JSOP_SETCALL) \ michael@0: _(JSOP_THROW) \ michael@0: _(JSOP_TRY) \ michael@0: _(JSOP_FINALLY) \ michael@0: _(JSOP_GOSUB) \ michael@0: _(JSOP_RETSUB) \ michael@0: _(JSOP_PUSHBLOCKSCOPE) \ michael@0: _(JSOP_POPBLOCKSCOPE) \ michael@0: _(JSOP_DEBUGLEAVEBLOCK) \ michael@0: _(JSOP_EXCEPTION) \ michael@0: _(JSOP_DEBUGGER) \ michael@0: _(JSOP_ARGUMENTS) \ michael@0: _(JSOP_RUNONCE) \ michael@0: _(JSOP_REST) \ michael@0: _(JSOP_TOID) \ michael@0: _(JSOP_TABLESWITCH) \ michael@0: _(JSOP_ITER) \ michael@0: _(JSOP_MOREITER) \ michael@0: _(JSOP_ITERNEXT) \ michael@0: _(JSOP_ENDITER) \ michael@0: _(JSOP_CALLEE) \ michael@0: _(JSOP_SETRVAL) \ michael@0: _(JSOP_RETRVAL) \ michael@0: _(JSOP_RETURN) michael@0: michael@0: class BaselineCompiler : public BaselineCompilerSpecific michael@0: { michael@0: FixedList