37 #ifndef V8_IA32_ASSEMBLER_IA32_H_
38 #define V8_IA32_ASSEMBLER_IA32_H_
127 const char*
const kNames[] = {
"eax",
"ecx",
"edx",
"ebx",
"esi",
"edi" };
128 return kNames[index];
134 return (reg.code() >= 6) ? reg.code() - 2 : reg.code();
158 return reg.
code() - 1;
184 const char*
const names[] = {
285 inline explicit Immediate(
const ExternalReference& ext);
367 const ExternalReference& arr) {
368 return Operand(index, scale,
reinterpret_cast<int32_t>(arr.address()),
379 return Operand(base, imm.x_, imm.rmode_);
439 int data()
const {
return data_; }
440 Type type()
const {
return TypeField::decode(data_); }
442 int n = NextField::decode(data_);
443 n > 0 ?
L->link_to(n) :
L->Unuse();
452 PrintF(
"%s (%x) ", (type() == UNCONDITIONAL_JUMP ?
"jmp" :
"[other]"),
453 NextField::decode(data_));
477 static const int kGap = 32;
833 void jmp(Label*
L, Label::Distance distance = Label::kFar);
842 Label::Distance distance = Label::kFar);
1149 inline Displacement
disp_at(Label*
L);
1175 if (assembler_->buffer_overflow()) assembler_->GrowBuffer();
1177 space_before_ = assembler_->available_space();
1183 int bytes_generated = space_before_ - assembler_->available_space();
1184 DCHECK(bytes_generated < assembler_->kGap);
1189 Assembler* assembler_;
Isolate * isolate() const
static const int kSpecialTargetSize
void bind_to(Label *L, int pos)
static Address target_address_at(Address pc, Code *code)
void sar_cl(const Operand &dst)
void movsx_w(Register dst, const Operand &src)
void cmp(const Operand &op, const Immediate &imm)
void cmov(Condition cc, Register dst, Register src)
static const int kCallInstructionLength
void pxor(XMMRegister dst, XMMRegister src)
int CallSize(const Operand &adr)
RelocInfoWriter reloc_info_writer
void shufps(XMMRegister dst, XMMRegister src, byte imm8)
void cvttsd2si(Register dst, const Operand &src)
void shrd(Register dst, Register src)
void subsd(XMMRegister dst, XMMRegister src)
void emit_sse_operand(XMMRegister dst, XMMRegister src)
void and_(const Operand &dst, const Immediate &x)
void j(Condition cc, Handle< Code > code)
void fst_s(const Operand &adr)
void div(const Operand &src)
void shld(Register dst, const Operand &src)
void adc(Register dst, int32_t imm32)
void cvttss2si(Register dst, XMMRegister src)
void cmpb(const Operand &op, int8_t imm8)
void emit_w(const Immediate &x)
void or_(Register dst, Register src)
void sub(Register dst, Register src)
void sub(const Operand &dst, Register src)
void subps(XMMRegister dst, const Operand &src)
void shr_cl(const Operand &dst)
void movdqu(XMMRegister dst, const Operand &src)
void mov(Register dst, Handle< Object > handle)
void test_b(Register reg, uint8_t imm8)
void ror_cl(Register dst)
void imul(Register dst, const Operand &src)
void rcr(Register dst, uint8_t imm8)
void j(Condition cc, byte *entry, RelocInfo::Mode rmode)
void and_(Register dst, const Immediate &x)
void fst_d(const Operand &adr)
void sub(Register dst, const Immediate &imm)
static const byte kJnzShortOpcode
void movsd(const Operand &dst, XMMRegister src)
void sqrtsd(XMMRegister dst, const Operand &src)
void cmov(Condition cc, Register dst, const Operand &src)
static Address target_address_at(Address pc, ConstantPoolArray *constant_pool)
void enter(const Immediate &size)
static void set_target_address_at(Address pc, ConstantPoolArray *constant_pool, Address target, ICacheFlushMode icache_flush_mode=FLUSH_ICACHE_IF_NEEDED)
void fisttp_d(const Operand &adr)
void emit_sse_operand(XMMRegister dst, Register src)
void add(Register dst, const Operand &src)
void sar(Register dst, uint8_t imm8)
void adc(Register dst, const Operand &src)
void jmp(const Operand &adr)
static void deserialization_set_special_target_at(Address instruction_payload, Code *code, Address target)
void movdqa(XMMRegister dst, const Operand &src)
static const byte kNopByte
void ucomisd(XMMRegister dst, XMMRegister src)
void imul(Register dst, Register src, int32_t imm32)
void pinsrd(XMMRegister dst, Register src, int8_t offset)
void RecordComment(const char *msg, bool force=false)
void xor_(const Operand &dst, const Immediate &x)
void sqrtsd(XMMRegister dst, XMMRegister src)
void orpd(XMMRegister dst, XMMRegister src)
void disp_at_put(Label *L, Displacement disp)
void movmskps(Register dst, XMMRegister src)
void fild_s(const Operand &adr)
void emit_code_relative_offset(Label *label)
static const byte kJmpShortOpcode
void andps(XMMRegister dst, const Operand &src)
void mov_b(Register dst, int8_t imm8)
void addsd(XMMRegister dst, XMMRegister src)
void cmpw_ax(const Operand &op)
void j(Condition cc, Label *L, Label::Distance distance=Label::kFar)
void sar(const Operand &dst, uint8_t imm8)
void mulsd(XMMRegister dst, const Operand &src)
void pop(const Operand &dst)
void movd(XMMRegister dst, Register src)
void sbb(Register dst, const Operand &src)
void emit_disp(Label *L, Displacement::Type type)
void movss(const Operand &dst, XMMRegister src)
void GetCode(CodeDesc *desc)
void test_b(Register reg, const Operand &op)
void add(const Operand &dst, Register src)
void ror(Register dst, uint8_t imm8)
void jmp(Handle< Code > code, RelocInfo::Mode rmode)
int available_space() const
void or_(const Operand &dst, const Immediate &x)
static const int kPatchDebugBreakSlotAddressOffset
void lea(Register dst, const Operand &src)
void and_(Register dst, int32_t imm32)
void xorpd(XMMRegister dst, XMMRegister src)
static const byte kJccShortPrefix
void emit_sse_operand(XMMRegister reg, const Operand &adr)
void emit_near_disp(Label *L)
void long_at_put(int pos, uint32_t x)
void xorps(XMMRegister dst, XMMRegister src)
void shr(Register dst, uint8_t imm8)
void ucomisd(XMMRegister dst, const Operand &src)
void add(Register dst, const Immediate &imm)
void shl_cl(Register dst)
static const int kPatchDebugBreakSlotReturnOffset
void and_(const Operand &dst, Register src)
void or_(Register dst, const Operand &src)
static void set_target_address_at(Address pc, Code *code, Address target, ICacheFlushMode icache_flush_mode=FLUSH_ICACHE_IF_NEEDED)
void cmp(const Operand &op, Handle< Object > handle)
void movntdq(const Operand &dst, XMMRegister src)
void dec_b(const Operand &dst)
void movsd(XMMRegister dst, const Operand &src)
Displacement disp_at(Label *L)
void psllq(XMMRegister dst, XMMRegister src)
void divsd(XMMRegister dst, XMMRegister src)
void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data=0)
void shl(const Operand &dst, uint8_t imm8)
void shr(const Operand &dst, uint8_t imm8)
void psllq(XMMRegister reg, int8_t shift)
void shl(Register dst, uint8_t imm8)
void mov_b(Register dst, const Operand &src)
void shift(Register dst, Immediate shift_amount, int subcode, int size)
void cvttss2si(Register dst, const Operand &src)
void setcc(Condition cc, Register reg)
void cmpw(const Operand &op, Immediate imm16)
void fld_d(const Operand &adr)
static const int kMaximalBufferSize
static Address break_address_from_return_address(Address pc)
void movsx_b(Register dst, const Operand &src)
void add(Register dst, Register src)
void mov(Register dst, const Operand &src)
void psrlq(XMMRegister reg, int8_t shift)
void mov_b(Register dst, Register src)
void test(const Operand &op, const Immediate &imm)
void movdq(bool aligned, XMMRegister dst, const Operand &src)
void movss(XMMRegister dst, XMMRegister src)
void fld_s(const Operand &adr)
void fist_s(const Operand &adr)
uint32_t long_at(int pos)
void fisttp_s(const Operand &adr)
void or_(Register dst, int32_t imm32)
void pinsrd(XMMRegister dst, const Operand &src, int8_t offset)
void roundsd(XMMRegister dst, XMMRegister src, RoundingMode mode)
void test(Register reg, const Immediate &imm)
void movzx_w(Register dst, Register src)
void cmpb(Register reg, int8_t imm8)
int relocation_writer_size()
void mov(const Operand &dst, const Immediate &x)
void cmp(Register reg, int32_t imm32)
Handle< ConstantPoolArray > NewConstantPool(Isolate *isolate)
void jmp(byte *entry, RelocInfo::Mode rmode)
void movzx_b(Register dst, Register src)
void mov(Register dst, const Immediate &x)
void xor_(Register dst, int32_t imm32)
void fistp_d(const Operand &adr)
void sub(const Operand &dst, const Immediate &x)
void pcmpeqd(XMMRegister dst, XMMRegister src)
void cmpltsd(XMMRegister dst, XMMRegister src)
void cmp(Register reg, Handle< Object > handle)
void movntdqa(XMMRegister dst, const Operand &src)
void subsd(XMMRegister dst, const Operand &src)
void call(byte *entry, RelocInfo::Mode rmode)
void fstp_d(const Operand &adr)
void mov_b(const Operand &dst, int8_t imm8)
void extractps(Register dst, XMMRegister src, byte imm8)
void andps(XMMRegister dst, XMMRegister src)
void cmp(Register reg, const Immediate &imm)
void adr(const Register &rd, Label *label)
void imul(Register dst, Register src)
void movsd(XMMRegister dst, XMMRegister src)
friend class PositionsRecorder
void and_(Register dst, Register src)
void movaps(XMMRegister dst, XMMRegister src)
void emit_operand(Register reg, const Operand &adr)
void test_b(const Operand &op, uint8_t imm8)
void cvtsi2sd(XMMRegister dst, Register src)
void jmp(Label *L, Label::Distance distance=Label::kFar)
void test(Register reg, const Operand &op)
void movd(const Operand &dst, XMMRegister src)
void emit_sse_operand(Register dst, XMMRegister src)
static Address target_address_at(Address pc, ConstantPoolArray *constant_pool)
void movsx_w(Register dst, Register src)
void divps(XMMRegister dst, const Operand &src)
void sub(Register dst, const Operand &src)
void xchg(Register dst, Register src)
void cvttsd2si(Register dst, XMMRegister src)
void psrlq(XMMRegister dst, XMMRegister src)
void movdqa(const Operand &dst, XMMRegister src)
void por(XMMRegister dst, XMMRegister src)
static void set_target_address_at(Address pc, ConstantPoolArray *constant_pool, Address target, ICacheFlushMode icache_flush_mode=FLUSH_ICACHE_IF_NEEDED)
void shld(Register dst, Register src)
void movss(XMMRegister dst, const Operand &src)
void divps(XMMRegister dst, XMMRegister src)
void addsd(XMMRegister dst, const Operand &src)
void test(Register reg0, Register reg1)
void movd(XMMRegister dst, const Operand &src)
void fisub_s(const Operand &adr)
static bool IsNop(Address addr)
void ptest(XMMRegister dst, XMMRegister src)
void cvtsd2si(Register dst, XMMRegister src)
static const int kJSReturnSequenceLength
void RecordDebugBreakSlot()
void mov_w(const Operand &dst, int16_t imm16)
void cmpb_al(const Operand &op)
void call(const Operand &adr)
void bsr(Register dst, const Operand &src)
void inc(const Operand &dst)
static const int kDebugBreakSlotLength
static const byte kJncShortOpcode
void mov(const Operand &dst, Handle< Object > handle)
void and_(Register dst, const Operand &src)
void andpd(XMMRegister dst, XMMRegister src)
void xchg(Register dst, const Operand &src)
void sel(SecondaryField fmt, FPURegister fd, FPURegister ft, FPURegister fs, uint8_t sel)
void pextrd(const Operand &dst, XMMRegister src, int8_t offset)
void emit_farith(int b1, int b2, int i)
void shr_cl(Register dst)
void set_byte_at(int pos, byte value)
void bts(const Operand &dst, Register src)
static const byte kTestAlByte
void or_(Register dst, const Immediate &imm)
void mulsd(XMMRegister dst, XMMRegister src)
void push(const Immediate &x)
void xor_(const Operand &dst, Register src)
void mov_w(const Operand &dst, Register src)
void rcl(Register dst, uint8_t imm8)
void cmpb(const Operand &op, Register reg)
void emit_arith_b(int op1, int op2, Register dst, int imm8)
int CallSize(Handle< Code > code, RelocInfo::Mode mode)
void orps(XMMRegister dst, XMMRegister src)
void movzx_w(Register dst, const Operand &src)
void mulps(XMMRegister dst, XMMRegister src)
void movdqu(const Operand &dst, XMMRegister src)
void fstp_s(const Operand &adr)
void mulps(XMMRegister dst, const Operand &src)
static const int kCallTargetAddressOffset
void call(Handle< Code > code, RelocInfo::Mode rmode, TypeFeedbackId id=TypeFeedbackId::None())
static const int kPatchReturnSequenceAddressOffset
void fistp_s(const Operand &adr)
void bt(const Operand &dst, Register src)
void mov_b(const Operand &dst, Register src)
void cmpb(Register reg, const Operand &op)
void bsr(Register dst, Register src)
void shrd(Register dst, const Operand &src)
void prefetch(const Operand &src, int level)
void neg(const Operand &dst)
void xor_(Register dst, const Immediate &imm)
void idiv(const Operand &src)
void movsx_b(Register dst, Register src)
void cmp(Register reg0, Register reg1)
void movmskpd(Register dst, XMMRegister src)
void bts(Register dst, Register src)
void movd(Register dst, XMMRegister src)
void sar_cl(Register dst)
void cvtsd2ss(XMMRegister dst, XMMRegister src)
void push_imm32(int32_t imm32)
static const byte kJcShortOpcode
void mov(const Operand &dst, Register src)
void xor_(Register dst, const Operand &src)
void addps(XMMRegister dst, XMMRegister src)
void pshufd(XMMRegister dst, XMMRegister src, uint8_t shuffle)
void xor_(Register dst, Register src)
void subps(XMMRegister dst, XMMRegister src)
void dec(const Operand &dst)
void fild_d(const Operand &adr)
void cmp(Register reg, const Operand &op)
void imul(Register dst, const Operand &src, int32_t imm32)
void pand(XMMRegister dst, XMMRegister src)
void movzx_b(Register dst, const Operand &src)
PositionsRecorder positions_recorder_
Assembler(Isolate *isolate, void *buffer, int buffer_size)
void mov(Register dst, int32_t imm32)
void add(const Operand &dst, const Immediate &x)
PositionsRecorder * positions_recorder()
void mov(Register dst, Register src)
static Address target_address_from_return_address(Address pc)
bool buffer_overflow() const
void or_(const Operand &dst, Register src)
void mov_w(Register dst, const Operand &src)
void addps(XMMRegister dst, const Operand &src)
int SizeOfCodeGeneratedSince(Label *label)
void not_(const Operand &dst)
void xorps(XMMRegister dst, const Operand &src)
void shl_cl(const Operand &dst)
void pextrd(Register dst, XMMRegister src, int8_t offset)
void emit_arith(int sel, Operand dst, const Immediate &x)
void cvtsi2sd(XMMRegister dst, const Operand &src)
static const byte kJzShortOpcode
void PopulateConstantPool(ConstantPoolArray *constant_pool)
void cvtss2sd(XMMRegister dst, XMMRegister src)
void push(const Operand &src)
void orps(XMMRegister dst, const Operand &src)
Displacement(Label *L, Type type)
Operand(Register base, int32_t disp, RelocInfo::Mode rmode=RelocInfo::NONE32)
static Operand ForCell(Handle< Cell > cell)
void set_modrm(int mod, Register rm)
static Operand ForRegisterPlusImmediate(Register base, Immediate imm)
INLINE(explicit Operand(Register reg))
INLINE(explicit Operand(XMMRegister xmm_reg))
INLINE(explicit Operand(Immediate imm))
void set_sib(ScaleFactor scale, Register index, Register base)
void set_disp8(int8_t disp)
INLINE(explicit Operand(int32_t disp, RelocInfo::Mode rmode))
EnsureSpace(Assembler *assembler)
bool is_reg(Register reg) const
static Operand StaticVariable(const ExternalReference &ext)
void set_dispr(int32_t disp, RelocInfo::Mode rmode)
Operand(Register index, ScaleFactor scale, int32_t disp, RelocInfo::Mode rmode=RelocInfo::NONE32)
void next(Label *L) const
Operand(Register base, Register index, ScaleFactor scale, int32_t disp, RelocInfo::Mode rmode=RelocInfo::NONE32)
void init(Label *L, Type type)
static Operand StaticArray(Register index, ScaleFactor scale, const ExternalReference &arr)
Immediate(const ExternalReference &ext)
static Immediate CodeRelativeOffset(Label *label)
Immediate(Handle< Object > handle)
ConstantPoolArray * constant_pool()
Operand(Register reg, Shift shift=LSL, unsigned shift_amount=0)
static bool IsNone(Mode mode)
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 mode(MIPS only)") DEFINE_BOOL(enable_always_align_csp
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
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 aligned(ARM64 only)") DEFINE_STRING(expose_gc_as
#define DCHECK(condition)
const int kRegister_ebx_Code
const int kRegister_ecx_Code
const int kRegister_edx_Code
Condition CommuteCondition(Condition cond)
TypeImpl< ZoneTypeConfig > Type
const int kRegister_esi_Code
const int kRegister_edi_Code
DwVfpRegister DoubleRegister
const int kRegister_esp_Code
Handle< T > handle(T *t, Isolate *isolate)
Condition NegateCondition(Condition cond)
@ times_half_pointer_size
@ times_twice_pointer_size
const XMMRegister no_xmm_reg
const int kRegister_ebp_Code
void PrintF(const char *format,...)
const int kRegister_no_reg_Code
const int kRegister_eax_Code
Debugger support for the V8 JavaScript engine.
static const int kNumRegisters
static int NumAllocatableRegisters()
static Register from_code(int code)
static int ToAllocationIndex(Register reg)
static Register FromAllocationIndex(int index)
bool is(Register reg) const
static const char * AllocationIndexToString(int index)
static int ToAllocationIndex(Register reg)
bool is_byte_register() const
static const char * AllocationIndexToString(int index)
static const int kMaxNumAllocatableRegisters
static Register FromAllocationIndex(int index)
static XMMRegister FromAllocationIndex(int index)
static const int kMaxNumRegisters
static XMMRegister from_code(int code)
static const int kMaxNumAllocatableRegisters
static int NumAllocatableRegisters()
static int ToAllocationIndex(XMMRegister reg)
static const char * AllocationIndexToString(int index)
bool is(XMMRegister reg) const
static int NumAllocatableAliasedRegisters()