36 #ifndef V8_MIPS_ASSEMBLER_MIPS_H_
37 #define V8_MIPS_ASSEMBLER_MIPS_H_
80 #if defined(V8_TARGET_LITTLE_ENDIAN)
81 static const int kMantissaOffset = 0;
82 static const int kExponentOffset = 4;
83 #elif defined(V8_TARGET_BIG_ENDIAN)
84 static const int kMantissaOffset = 4;
85 static const int kExponentOffset = 0;
87 #error Unknown endianness
109 const char*
const names[] = {
148 #define REGISTER(N, C) \
149 const int kRegister_ ## N ## _Code = C; \
150 const Register N = { C }
329 #define kRootRegister s6
331 #define kLithiumScratchReg s3
332 #define kLithiumScratchReg2 s4
333 #define kLithiumScratchDouble f30
334 #define kDoubleRegZero f28
336 #define kDoubleCompareReg f31
483 bool jump_elimination_allowed) {
626 void nop(
unsigned int type = 0) {
628 Register nop_rt_reg = (type == 0) ? zero_reg : at;
629 sll(zero_reg, nop_rt_reg, type,
true);
1046 *
reinterpret_cast<Instr*
>(
pc) = instr;
1187 static const int kGap = 32;
1338 return trampoline_slot;
Isolate * isolate() const
DISALLOW_IMPLICIT_CONSTRUCTORS(BlockGrowBufferScope)
BlockGrowBufferScope(Assembler *assem)
DISALLOW_IMPLICIT_CONSTRUCTORS(BlockTrampolinePoolScope)
BlockTrampolinePoolScope(Assembler *assem)
~BlockTrampolinePoolScope()
Trampoline(int start, int slot_count)
static const int kSpecialTargetSize
void bind_to(Label *L, int pos)
void beqc(Register rs, Register rt, int16_t offset)
void bltz(Register rs, int16_t offset)
static Instr SF(Register rd)
int branch_offset(Label *L, bool jump_elimination_allowed)
RelocInfoWriter reloc_info_writer
void GenInstrRegister(Opcode opcode, Register rs, Register rt, Register rd, uint16_t sa=0, SecondaryField func=NULLSF)
void GenInstrImmediate(Opcode opcode, Register rs, SecondaryField SF, int32_t j)
bool is_buffer_growth_blocked() const
int32_t branch_offset21(Label *L, bool jump_elimination_allowed)
void slti(Register rd, Register rs, int32_t j)
void GenInstrRegister(Opcode opcode, SecondaryField fmt, Register rt, FPUControlRegister fs, SecondaryField func=NULLSF)
void slt(Register rd, Register rs, Register rt)
void lwl(Register rd, const MemOperand &rs)
void add_d(FPURegister fd, FPURegister fs, FPURegister ft)
static const int kMaxRelocSize
void lbu(Register rd, const MemOperand &rs)
static const int kInstrSize
void movf(Register rd, Register rs, uint16_t cc=0)
static bool IsJ(Instr instr)
void break_(uint32_t code, bool break_as_stop=false)
void mfhc1(Register rt, FPURegister fs)
void bnezalc(Register rt, Label *L)
void label_at_put(Label *L, int at_offset)
static bool IsPush(Instr instr)
void bgezal(Register rs, int16_t offset)
void cvt_s_w(FPURegister fd, FPURegister fs)
static bool IsJump(Instr instr)
void bgezc(Register rt, Label *L)
void round_l_d(FPURegister fd, FPURegister fs)
void bgeuc(Register rs, Register rt, int16_t offset)
static uint32_t GetRtField(Instr instr)
void addu(Register rd, Register rs, Register rt)
void CheckTrampolinePool()
bool is_trampoline_emitted() const
static const int kBufferCheckInterval
void hint(SystemHint code)
void pref(int32_t hint, const MemOperand &rs)
static bool IsLw(Instr instr)
void seleqz(SecondaryField fmt, FPURegister fd, FPURegister ft, FPURegister fs)
void ctc1(Register rt, FPUControlRegister fs)
void EndBlockTrampolinePool()
void ceil_w_s(FPURegister fd, FPURegister fs)
static Address target_address_at(Address pc, ConstantPoolArray *constant_pool)
void beqzalc(Register rt, int16_t offset)
void target_at_put(int32_t pos, int32_t target_pos)
void beqc(Register rs, Register rt, Label *L)
void stop(const char *msg, uint32_t code=kMaxStopCode)
static const int kBranchPCOffset
void lwr(Register rd, const MemOperand &rs)
void bgez(Register rs, int16_t offset)
void cmp(FPUCondition cond, SecondaryField fmt, FPURegister fd, FPURegister ft, FPURegister fs)
static uint32_t GetOpcodeField(Instr instr)
static void deserialization_set_special_target_at(Address instruction_payload, Code *code, Address target)
void swc1(FPURegister fs, const MemOperand &dst)
void cvt_l_s(FPURegister fd, FPURegister fs)
void lb(Register rd, const MemOperand &rs)
void jalr(Register rs, Register rd=ra)
void movz(Register rd, Register rs, Register rt)
static const int kInstructionsFor32BitConstant
void sltiu(Register rd, Register rs, int32_t j)
void CheckTrampolinePoolQuick()
static bool IsBne(Instr instr)
static bool IsPop(Instr instr)
void tltu(Register rs, Register rt, uint16_t code)
void tgeu(Register rs, Register rt, uint16_t code)
void bc1f(int16_t offset, uint16_t cc=0)
TypeFeedbackId RecordedAstId()
void bnezalc(Register rt, int16_t offset)
void bc1nez(int16_t offset, FPURegister ft)
void bc1eqz(int16_t offset, FPURegister ft)
static bool IsSwRegFpOffset(Instr instr)
static void QuietNaN(HeapObject *nan)
void mulu(Register rd, Register rs, Register rt)
void GenInstrJump(Opcode opcode, uint32_t address)
void fcmp(FPURegister src1, const double src2, FPUCondition cond)
void bltzalc(Register rt, Label *L)
void sdc1(FPURegister fs, const MemOperand &dst)
void bltuc(Register rs, Register rt, int16_t offset)
void bnvc(Register rs, Register rt, Label *L)
void divu(Register rd, Register rs, Register rt)
void mov_d(FPURegister fd, FPURegister fs)
void modu(Register rd, Register rs, Register rt)
bool internal_trampoline_exception_
void bnec(Register rs, Register rt, Label *L)
static uint32_t GetFunctionField(Instr instr)
void floor_l_s(FPURegister fd, FPURegister fs)
static void instr_at_put(byte *pc, Instr instr)
void bc1t(Label *L, uint16_t cc=0)
void ClearRecordedAstId()
void c(FPUCondition cond, SecondaryField fmt, FPURegister ft, FPURegister fs, uint16_t cc=0)
static Address target_address_at(Address pc)
void j(Condition cc, Label *L, Label::Distance distance=Label::kFar)
void StartBlockGrowBuffer()
TypeFeedbackId recorded_ast_id_
bool is_trampoline_pool_blocked() const
static uint32_t GetFunction(Instr instr)
void StartBlockTrampolinePool()
static bool IsJalr(Instr instr)
void nop(unsigned int type=0)
void bc1t(int16_t offset, uint16_t cc=0)
void cvt_l_d(FPURegister fd, FPURegister fs)
void max(SecondaryField fmt, FPURegister fd, FPURegister ft, FPURegister fs)
void round_w_s(FPURegister fd, FPURegister fs)
static const int kDebugBreakSlotInstructions
void cvt_d_s(FPURegister fd, FPURegister fs)
void GetCode(CodeDesc *desc)
void cvt_d_w(FPURegister fd, FPURegister fs)
int InstructionsGeneratedSince(Label *label)
int available_space() const
void GenInstrImmediate(Opcode opcode, Register rs, Register rt, int32_t j)
void abs_d(FPURegister fd, FPURegister fs)
void cvt_w_d(FPURegister fd, FPURegister fs)
void GenInstrImmediate(Opcode opcode, Register r1, FPURegister r2, int32_t j)
void seleqz(Register rs, Register rt, Register rd)
static const int kPatchDebugBreakSlotAddressOffset
int32_t buffer_space() const
bool has_exception() const
void div(Register rs, Register rt)
static bool IsOri(Instr instr)
static uint32_t GetSa(Instr instr)
void instr_at_put(int pos, Instr instr)
void beqzc(Register rs, Label *L)
void maxa(SecondaryField fmt, FPURegister fd, FPURegister ft, FPURegister fs)
void bgezall(Register rs, Label *L)
void neg_d(FPURegister fd, FPURegister fs)
void blezc(Register rt, int16_t offset)
int32_t branch_offset21_compact(Label *L, bool jump_elimination_allowed)
void trunc_w_s(FPURegister fd, FPURegister fs)
void bnec(Register rs, Register rt, int16_t offset)
static const int kTrampolineSlotsSize
static uint32_t GetLabelConst(Instr instr)
void bltc(Register rs, Register rt, int16_t offset)
void bnvc(Register rs, Register rt, int16_t offset)
void trunc_l_d(FPURegister fd, FPURegister fs)
void mul(Register rd, Register rs, Register rt)
void selnez(SecondaryField fmt, FPURegister fd, FPURegister ft, FPURegister fs)
static const int kInvalidSlotPos
void teq(Register rs, Register rt, uint16_t code)
static uint32_t GetRsField(Instr instr)
void floor_w_s(FPURegister fd, FPURegister fs)
static const int kPatchDebugBreakSlotReturnOffset
void bc1eqz(Label *L, FPURegister ft)
int last_trampoline_pool_end_
void tlt(Register rs, Register rt, uint16_t code)
@ PROPERTY_ACCESS_INLINED
@ PROPERTY_ACCESS_INLINED_CONTEXT
@ PROPERTY_ACCESS_INLINED_CONTEXT_DONT_DELETE
static Instr SetSwOffset(Instr instr, int16_t offset)
void bne(Register rs, Register rt, int16_t offset)
int32_t branch_offset(Label *L, bool jump_elimination_allowed)
void rotr(Register rd, Register rt, uint16_t sa)
void mtc1(Register rt, FPURegister fs)
static bool IsJr(Instr instr)
void lw(Register rd, const MemOperand &rs)
void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data=0)
void beqzalc(Register rt, Label *L)
void floor_l_d(FPURegister fd, FPURegister fs)
static bool IsLui(Instr instr)
void bltzc(Register rt, int16_t offset)
int target_at(int32_t pos)
static Address break_address_from_return_address(Address pc)
void ceil_l_s(FPURegister fd, FPURegister fs)
bool MustUseReg(RelocInfo::Mode rmode)
static uint32_t GetRdField(Instr instr)
void addiu(Register rd, Register rs, int32_t j)
void xori(Register rd, Register rs, int32_t j)
static uint32_t GetRt(Instr instr)
static Register GetRdReg(Instr instr)
static int32_t GetBranchOffset(Instr instr)
void rotrv(Register rd, Register rt, Register rs)
void GenInstrRegister(Opcode opcode, SecondaryField fmt, FPURegister ft, FPURegister fs, FPURegister fd, SecondaryField func=NULLSF)
void trunc_w_d(FPURegister fd, FPURegister fs)
static Instr instr_at(byte *pc)
void sltu(Register rd, Register rs, Register rt)
void ori(Register rd, Register rs, int32_t j)
void bgec(Register rs, Register rt, Label *L)
static bool IsAddImmediate(Instr instr)
void andi(Register rd, Register rs, int32_t j)
void selnez(Register rs, Register rt, Register rd)
INLINE(static Address target_address_at(Address pc, Code *code))
INLINE(static Address target_address_at(Address pc, ConstantPoolArray *constant_pool))
void bgezalc(Register rt, Label *L)
void div(Register rd, Register rs, Register rt)
void GenInstrRegister(Opcode opcode, FPURegister fr, FPURegister ft, FPURegister fs, FPURegister fd, SecondaryField func=NULLSF)
Handle< ConstantPoolArray > NewConstantPool(Isolate *isolate)
void swl(Register rd, const MemOperand &rs)
void trunc_l_s(FPURegister fd, FPURegister fs)
void sb(Register rd, const MemOperand &rs)
void madd_d(FPURegister fd, FPURegister fr, FPURegister fs, FPURegister ft)
static uint32_t GetRs(Instr instr)
void ins_(Register rt, Register rs, uint16_t pos, uint16_t size)
static Register GetRsReg(Instr instr)
void blezalc(Register rt, Label *L)
void lui(Register rd, int32_t j)
static bool IsBranch(Instr instr)
void lh(Register rd, const MemOperand &rs)
void srav(Register rt, Register rd, Register rs)
void bgtzalc(Register rt, Label *L)
void RecordComment(const char *msg)
static const int kCheckConstIntervalInst
void muh(Register rd, Register rs, Register rt)
friend class PositionsRecorder
void BlockTrampolinePoolFor(int instructions)
void and_(Register rd, Register rs, Register rt)
void GenInstrRegister(Opcode opcode, Register rs, Register rt, uint16_t msb, uint16_t lsb, SecondaryField func)
static int16_t GetLwOffset(Instr instr)
uint32_t jump_address(Label *L)
void ldc1(FPURegister fd, const MemOperand &src)
void bltzal(Register rs, int16_t offset)
static Instr SetAddImmediateOffset(Instr instr, int16_t offset)
void ext_(Register rt, Register rs, uint16_t pos, uint16_t size)
void mult(Register rs, Register rt)
static uint32_t GetSaField(Instr instr)
static const int kJSReturnSequenceInstructions
static uint32_t GetRd(Instr instr)
static Instr SetLwOffset(Instr instr, int16_t offset)
void bc1nez(Label *L, FPURegister ft)
INLINE(static void set_target_address_at(Address pc, Code *code, Address target, ICacheFlushMode icache_flush_mode=FLUSH_ICACHE_IF_NEEDED))
static void set_target_address_at(Address pc, ConstantPoolArray *constant_pool, Address target, ICacheFlushMode icache_flush_mode=FLUSH_ICACHE_IF_NEEDED)
void DoubleAsTwoUInt32(double d, uint32_t *lo, uint32_t *hi)
int no_trampoline_pool_before_
void SetRecordedAstId(TypeFeedbackId ast_id)
void bgtzc(Register rt, Label *L)
void beqzc(Register rs, int32_t offset)
static void set_target_address_at(Address pc, Address target, ICacheFlushMode icache_flush_mode=FLUSH_ICACHE_IF_NEEDED)
void bovc(Register rs, Register rt, int16_t offset)
void srl(Register rd, Register rt, uint16_t sa)
void cfc1(Register rt, FPUControlRegister fs)
void min(SecondaryField fmt, FPURegister fd, FPURegister ft, FPURegister fs)
void mod(Register rd, Register rs, Register rt)
void bne(Register rs, Register rt, Label *L)
void mina(SecondaryField fmt, FPURegister fd, FPURegister ft, FPURegister fs)
void sll(Register rd, Register rt, uint16_t sa, bool coming_from_nop=false)
void RecordDebugBreakSlot()
void cvt_d_l(FPURegister fd, FPURegister fs)
static const int kCheckConstInterval
void mfc1(Register rt, FPURegister fs)
static bool IsEmittedConstant(Instr instr)
void cvt_s_d(FPURegister fd, FPURegister fs)
void round_l_s(FPURegister fd, FPURegister fs)
void blez(Register rs, int16_t offset)
void srlv(Register rd, Register rt, Register rs)
void movt(Register rd, Register rs, uint16_t cc=0)
void round_w_d(FPURegister fd, FPURegister fs)
static const int kDebugBreakSlotLength
int32_t get_trampoline_entry(int32_t pos)
void div_d(FPURegister fd, FPURegister fs, FPURegister ft)
INLINE(static void set_target_address_at(Address pc, ConstantPoolArray *constant_pool, Address target, ICacheFlushMode icache_flush_mode=FLUSH_ICACHE_IF_NEEDED))
static Register GetRtReg(Instr instr)
int unbound_labels_count_
void xor_(Register rd, Register rs, Register rt)
void sel(SecondaryField fmt, FPURegister fd, FPURegister ft, FPURegister fs, uint8_t sel)
void or_(Register rd, Register rs, Register rt)
void bgezalc(Register rt, int16_t offset)
void cvt_s_l(FPURegister fd, FPURegister fs)
static bool IsSw(Instr instr)
void beq(Register rs, Register rt, int16_t offset)
void bltuc(Register rs, Register rt, Label *L)
void LoadRegPlusOffsetToAt(const MemOperand &src)
void bovc(Register rs, Register rt, Label *L)
void bnezc(Register rt, int32_t offset)
void tne(Register rs, Register rt, uint16_t code)
void lhu(Register rd, const MemOperand &rs)
int32_t shifted_branch_offset(Label *L, bool jump_elimination_allowed)
void EndBlockGrowBuffer()
void bltzc(Register rt, Label *L)
void bgtz(Register rs, int16_t offset)
void bgec(Register rs, Register rt, int16_t offset)
void bltc(Register rs, Register rt, Label *L)
static const int kCallTargetAddressOffset
void tge(Register rs, Register rt, uint16_t code)
void sw(Register rd, const MemOperand &rs)
void emit_code_stub_address(Code *stub)
static const int kPatchReturnSequenceAddressOffset
void blezalc(Register rt, int16_t offset)
void muhu(Register rd, Register rs, Register rt)
void movn(Register rd, Register rs, Register rt)
static uint32_t GetImmediate16(Instr instr)
void mthc1(Register rt, FPURegister fs)
static void JumpLabelToJumpRegister(Address pc)
void cvt_w_s(FPURegister fd, FPURegister fs)
void sqrt_d(FPURegister fd, FPURegister fs)
void ceil_l_d(FPURegister fd, FPURegister fs)
int trampoline_pool_blocked_nesting_
void beq(Register rs, Register rt, Label *L)
void bnezc(Register rt, Label *L)
void GenInstrRegister(Opcode opcode, SecondaryField fmt, Register rt, FPURegister fs, FPURegister fd, SecondaryField func=NULLSF)
static bool IsAndImmediate(Instr instr)
void lwc1(FPURegister fd, const MemOperand &src)
static const int kPcLoadDelta
void sh(Register rd, const MemOperand &rs)
void multu(Register rs, Register rt)
void j_or_jr(int32_t target, Register rs)
void bltzalc(Register rt, int16_t offset)
PositionsRecorder positions_recorder_
Assembler(Isolate *isolate, void *buffer, int buffer_size)
bool block_buffer_growth_
PositionsRecorder * positions_recorder()
void aui(Register rs, Register rt, int32_t j)
void divu(Register rs, Register rt)
void clz(Register rd, Register rs)
static Address target_address_from_return_address(Address pc)
void blezc(Register rt, Label *L)
static const int kMaxBranchOffset
void swr(Register rd, const MemOperand &rs)
void nor(Register rd, Register rs, Register rt)
static bool IsBeq(Instr instr)
static bool IsLwRegFpNegOffset(Instr instr)
static bool IsLwRegFpOffset(Instr instr)
void jal_or_jalr(int32_t target, Register rs)
void sllv(Register rd, Register rt, Register rs)
int SizeOfCodeGeneratedSince(Label *label)
static bool IsSwRegFpNegOffset(Instr instr)
int32_t branch_offset_compact(Label *L, bool jump_elimination_allowed)
void bgtzc(Register rt, int16_t offset)
void ceil_w_d(FPURegister fd, FPURegister fs)
static bool IsJal(Instr instr)
void bc1f(Label *L, uint16_t cc=0)
int32_t shifted_branch_offset_compact(Label *L, bool jump_elimination_allowed)
void BlockTrampolinePoolBefore(int pc_offset)
void mul_d(FPURegister fd, FPURegister fs, FPURegister ft)
static bool IsNop(Instr instr, unsigned int type)
static int RelocateInternalReference(byte *pc, intptr_t pc_delta)
void bgeuc(Register rs, Register rt, Label *L)
void sub_d(FPURegister fd, FPURegister fs, FPURegister ft)
void sra(Register rt, Register rd, uint16_t sa)
void floor_w_d(FPURegister fd, FPURegister fs)
void bgtzalc(Register rt, int16_t offset)
void subu(Register rd, Register rs, Register rt)
void PopulateConstantPool(ConstantPoolArray *constant_pool)
void bgezc(Register rt, int16_t offset)
void bgezall(Register rs, int16_t offset)
INLINE(explicit Operand(const ExternalReference &f))
INLINE(explicit Operand(Context **cpp))
INLINE(explicit Operand(int32_t immediate, RelocInfo::Mode rmode=RelocInfo::NONE32))
INLINE(bool is_reg() const)
INLINE(explicit Operand(Object **opp))
Operand(Handle< Object > handle)
EnsureSpace(Assembler *assembler)
INLINE(explicit Operand(Smi *value))
INLINE(explicit Operand(Register rm))
INLINE(explicit Operand(const char *s))
int32_t immediate() const
ConstantPoolArray * constant_pool()
bool OffsetIsInt16Encodable() const
MemOperand(Register rn, int32_t unit, int32_t multiplier, OffsetAddend offset_addend=offset_zero)
MemOperand(Register rn, int32_t offset=0)
Operand(Register reg, Shift shift=LSL, unsigned shift_amount=0)
Immediate immediate() const
static TypeFeedbackId None()
enable harmony numeric enable harmony object literal extensions Optimize object size
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define DCHECK(condition)
const int kInvalidFPUControlRegister
const FPUControlRegister FCSR
const uint32_t kMaxStopCode
DwVfpRegister DoubleRegister
const FPURegister no_freg
int ToNumber(Register reg)
const int kNumFPURegisters
Handle< T > handle(T *t, Isolate *isolate)
const FPUControlRegister no_fpucreg
Register ToRegister(int num)
FPURegister FloatRegister
Debugger support for the V8 JavaScript engine.
bool is(FPUControlRegister creg) const
static FPURegister FromAllocationIndex(int index)
static const int kMaxNumAllocatableRegisters
static const int kNumReservedRegisters
static FPURegister from_code(int code)
static int ToAllocationIndex(FPURegister reg)
static const char * AllocationIndexToString(int index)
static int NumAllocatableAliasedRegisters()
static int NumAllocatableRegisters()
static int NumRegisters()
bool is(FPURegister creg) const
static const int kMaxNumRegisters
static const int kNumRegisters
static const int kSizeInBytes
static int NumAllocatableRegisters()
static Register from_code(int code)
static int ToAllocationIndex(Register reg)
bool is(Register reg) const
static const char * AllocationIndexToString(int index)
static const int kMaxNumAllocatableRegisters
static Register FromAllocationIndex(int index)
static const int kCpRegister