37 #ifndef V8_X87_ASSEMBLER_X87_H_
38 #define V8_X87_ASSEMBLER_X87_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();
164 const char*
const names[] = {
165 "stX_0",
"stX_1",
"stX_2",
"stX_3",
"stX_4",
166 "stX_5",
"stX_6",
"stX_7"
174 result.
code_ = index;
279 inline explicit Immediate(
const ExternalReference& ext);
358 const ExternalReference& arr) {
359 return Operand(index, scale,
reinterpret_cast<int32_t>(arr.address()),
370 return Operand(base, imm.x_, imm.rmode_);
430 int data()
const {
return data_; }
431 Type type()
const {
return TypeField::decode(data_); }
433 int n = NextField::decode(data_);
434 n > 0 ?
L->link_to(n) :
L->Unuse();
443 PrintF(
"%s (%x) ", (type() == UNCONDITIONAL_JUMP ?
"jmp" :
"[other]"),
444 NextField::decode(data_));
450 class TypeField:
public BitField<Type, 0, 2> {};
451 class NextField:
public BitField<int, 2, 32-2> {};
468 static const int kGap = 32;
818 void jmp(Label*
L, Label::Distance distance = Label::kFar);
827 Label::Distance distance = Label::kFar);
937 void db(uint8_t data);
1042 if (assembler_->buffer_overflow()) assembler_->GrowBuffer();
1044 space_before_ = assembler_->available_space();
1050 int bytes_generated = space_before_ - assembler_->available_space();
1051 DCHECK(bytes_generated < assembler_->kGap);
1056 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)
static const int kCallInstructionLength
int CallSize(const Operand &adr)
RelocInfoWriter reloc_info_writer
void shrd(Register dst, Register src)
void and_(const Operand &dst, const Immediate &x)
void j(Condition cc, Handle< Code > code)
void fadd_d(const Operand &adr)
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 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 shr_cl(const Operand &dst)
void mov(Register dst, Handle< Object > handle)
void emit(const Immediate &x)
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 fnstcw(const Operand &adr)
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 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)
static const byte kNopByte
void imul(Register dst, Register src, int32_t imm32)
void RecordComment(const char *msg, bool force=false)
void xor_(const Operand &dst, const Immediate &x)
void disp_at_put(Label *L, Displacement disp)
void fild_s(const Operand &adr)
void emit_code_relative_offset(Label *label)
static const byte kJmpShortOpcode
void mov_b(Register dst, int8_t imm8)
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 pop(const Operand &dst)
void sbb(Register dst, const Operand &src)
void fnsave(const Operand &adr)
void emit_disp(Label *L, Displacement::Type type)
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 fldcw(const Operand &adr)
void and_(Register dst, int32_t imm32)
static const byte kJccShortPrefix
void emit_near_disp(Label *L)
void long_at_put(int pos, uint32_t x)
void shr(Register dst, uint8_t imm8)
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 dec_b(const Operand &dst)
Displacement disp_at(Label *L)
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 shl(Register dst, uint8_t imm8)
void mov_b(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 mov_b(Register dst, Register src)
void test(const Operand &op, const Immediate &imm)
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 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 cmp(Register reg, Handle< Object > handle)
void call(byte *entry, RelocInfo::Mode rmode)
void fstp_d(const Operand &adr)
void mov_b(const Operand &dst, int8_t imm8)
void cmp(Register reg, const Immediate &imm)
void adr(const Register &rd, Label *label)
void imul(Register dst, Register src)
friend class PositionsRecorder
void and_(Register dst, Register src)
void emit_operand(Register reg, const Operand &adr)
void test_b(const Operand &op, uint8_t imm8)
void jmp(Label *L, Label::Distance distance=Label::kFar)
void emit(Handle< Object > handle)
void test(Register reg, const Operand &op)
static Address target_address_at(Address pc, ConstantPoolArray *constant_pool)
void movsx_w(Register dst, Register src)
void sub(Register dst, const Operand &src)
void xchg(Register dst, Register src)
void frstor(const Operand &adr)
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 test(Register reg0, Register reg1)
void fisub_s(const Operand &adr)
static bool IsNop(Address addr)
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 xchg(Register dst, const Operand &src)
void sel(SecondaryField fmt, FPURegister fd, FPURegister ft, FPURegister fs, uint8_t sel)
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 emit(Handle< Code > code, RelocInfo::Mode rmode, TypeFeedbackId id=TypeFeedbackId::None())
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 movzx_w(Register dst, const Operand &src)
void fstp_s(const Operand &adr)
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 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 bts(Register dst, Register src)
void sar_cl(Register dst)
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 xor_(Register dst, Register 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 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 emit(uint32_t x, RelocInfo::Mode rmode, TypeFeedbackId id=TypeFeedbackId::None())
void mov_w(Register dst, const Operand &src)
int SizeOfCodeGeneratedSince(Label *label)
void not_(const Operand &dst)
void shl_cl(const Operand &dst)
void emit_arith(int sel, Operand dst, const Immediate &x)
static const byte kJzShortOpcode
void PopulateConstantPool(ConstantPoolArray *constant_pool)
void push(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(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
#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 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 int NumAllocatableAliasedRegisters()
static const char * AllocationIndexToString(int index)
static int NumAllocatableRegisters()
static const int kMaxNumAllocatableRegisters
static int ToAllocationIndex(X87Register reg)
static X87Register FromAllocationIndex(int index)
bool is(X87Register reg) const
static const int kMaxNumRegisters