5 #ifndef V8_X64_ASSEMBLER_X64_INL_H_
6 #define V8_X64_ASSEMBLER_X64_INL_H_
47 pc_ +=
sizeof(uint64_t);
68 if (current > 0 &&
code_targets_.last().is_identical_to(target)) {
91 emit(0x48 | (reg.
code() & 0x8) >> 1 | rm_reg.
code() >> 3);
96 emit(0x48 | (reg.
code() & 0x8) >> 1 | rm_reg.
code() >> 3);
106 emit(0x48 | (reg.
code() & 0x8) >> 1 | op.rex_);
117 emit(0x48 | op.rex_);
137 emit(0x40 | op.rex_);
143 if (rex_bits != 0)
emit(0x40 | rex_bits);
148 byte rex_bits = reg.
high_bit() << 2 | op.rex_;
149 if (rex_bits != 0)
emit(0x40 | rex_bits);
154 byte rex_bits = (reg.
code() & 0x8) >> 1 | op.rex_;
155 if (rex_bits != 0)
emit(0x40 | rex_bits);
160 byte rex_bits = (reg.
code() & 0x8) >> 1 | (base.
code() & 0x8) >> 3;
161 if (rex_bits != 0)
emit(0x40 | rex_bits);
166 byte rex_bits = (reg.
code() & 0x8) >> 1 | (base.
code() & 0x8) >> 3;
167 if (rex_bits != 0)
emit(0x40 | rex_bits);
172 byte rex_bits = (reg.
code() & 0x8) >> 1 | (base.
code() & 0x8) >> 3;
173 if (rex_bits != 0)
emit(0x40 | rex_bits);
183 if (op.rex_ != 0)
emit(0x40 | op.rex_);
194 ConstantPoolArray* constant_pool,
227 void RelocInfo::apply(intptr_t delta,
ICacheFlushMode icache_flush_mode) {
239 *p -=
static_cast<int32_t>(delta);
246 Address RelocInfo::target_address() {
252 Address RelocInfo::target_address_address() {
260 Address RelocInfo::constant_pool_entry_address() {
266 int RelocInfo::target_address_size() {
275 void RelocInfo::set_target_address(
Address target,
284 host(),
this, HeapObject::cast(target_code));
289 Object* RelocInfo::target_object() {
295 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) {
300 return origin->code_target_object_handle_at(
pc_);
305 Address RelocInfo::target_reference() {
311 void RelocInfo::set_target_object(
Object* target,
321 target->IsHeapObject()) {
328 Address RelocInfo::target_runtime_entry(Assembler* origin) {
330 return origin->runtime_entry_at(
pc_);
334 void RelocInfo::set_target_runtime_entry(
Address target,
338 if (target_address() != target) {
339 set_target_address(target, write_barrier_mode, icache_flush_mode);
344 Handle<Cell> RelocInfo::target_cell_handle() {
347 return Handle<Cell>(
reinterpret_cast<Cell**
>(address));
351 Cell* RelocInfo::target_cell() {
357 void RelocInfo::set_target_cell(Cell* cell,
376 void RelocInfo::WipeOut() {
388 bool RelocInfo::IsPatchedReturnSequence() {
400 bool RelocInfo::IsPatchedDebugBreakSlotSequence() {
405 Handle<Object> RelocInfo::code_age_stub_handle(Assembler* origin) {
408 return origin->code_target_object_handle_at(
pc_ + 1);
412 Code* RelocInfo::code_age_stub() {
420 void RelocInfo::set_code_age_stub(Code* stub,
429 Address RelocInfo::call_address() {
437 void RelocInfo::set_call_address(
Address target) {
447 host(),
this, HeapObject::cast(target_code));
452 Object* RelocInfo::call_object() {
453 return *call_object_address();
457 void RelocInfo::set_call_object(
Object* target) {
458 *call_object_address() = target;
462 Object** RelocInfo::call_object_address() {
465 return reinterpret_cast<Object**
>(
473 visitor->VisitEmbeddedPointer(
this);
476 visitor->VisitCodeTarget(
this);
478 visitor->VisitCell(
this);
480 visitor->VisitExternalReference(
this);
483 visitor->VisitCodeAgeSequence(
this);
485 IsPatchedReturnSequence()) ||
487 IsPatchedDebugBreakSlotSequence())) &&
488 isolate->debug()->has_break_points()) {
489 visitor->VisitDebugTarget(
this);
491 visitor->VisitRuntimeEntry(
this);
496 template<
typename StaticVisitor>
500 StaticVisitor::VisitEmbeddedPointer(heap,
this);
503 StaticVisitor::VisitCodeTarget(heap,
this);
505 StaticVisitor::VisitCell(heap,
this);
507 StaticVisitor::VisitExternalReference(
this);
510 StaticVisitor::VisitCodeAgeSequence(heap,
this);
511 }
else if (heap->isolate()->debug()->has_break_points() &&
513 IsPatchedReturnSequence()) ||
515 IsPatchedDebugBreakSlotSequence()))) {
516 StaticVisitor::VisitDebugTarget(heap,
this);
518 StaticVisitor::VisitRuntimeEntry(
this);
526 void Operand::set_modrm(
int mod, Register rm_reg) {
528 buf_[0] = mod << 6 | rm_reg.low_bits();
530 rex_ |= rm_reg.high_bit();
534 void Operand::set_sib(
ScaleFactor scale, Register index, Register base) {
540 buf_[1] = (scale << 6) | (index.low_bits() << 3) | base.low_bits();
541 rex_ |= index.high_bit() << 1 | base.high_bit();
545 void Operand::set_disp8(
int disp) {
547 DCHECK(len_ == 1 || len_ == 2);
548 int8_t* p =
reinterpret_cast<int8_t*
>(&buf_[len_]);
550 len_ +=
sizeof(int8_t);
553 void Operand::set_disp32(
int disp) {
554 DCHECK(len_ == 1 || len_ == 2);
Isolate * isolate() const
static const int kSpecialTargetSize
Address runtime_entry_at(Address pc)
static Address target_address_at(Address pc, ConstantPoolArray *constant_pool)
static bool IsNop(Instr instr, int type=NON_MARKING_NOP)
void emit_optional_rex_32(Register reg, Register rm_reg)
static const int kPatchDebugBreakSlotReturnOffset
List< Handle< Code > > code_targets_
static Address break_address_from_return_address(Address pc)
void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data=0)
void emit_code_target(Handle< Code > target, RelocInfo::Mode rmode, TypeFeedbackId ast_id=TypeFeedbackId::None())
void emit_rex_32(Register reg, Register rm_reg)
void emit_runtime_entry(Address entry, RelocInfo::Mode rmode)
static void set_target_address_at(Address pc, ConstantPoolArray *constant_pool, Address target, ICacheFlushMode icache_flush_mode=FLUSH_ICACHE_IF_NEEDED)
static Address target_address_from_return_address(Address pc)
Handle< Object > code_target_object_handle_at(Address pc)
static const int kMoveAddressIntoScratchRegisterInstructionLength
void emitp(void *x, RelocInfo::Mode rmode)
static const int kRealPatchReturnSequenceAddressOffset
static const int kCallTargetAddressOffset
static const int kPatchReturnSequenceAddressOffset
static const int kValueOffset
static Cell * FromValueAddress(Address value)
static Code * GetCodeFromTargetAddress(Address address)
byte * instruction_start()
static void FlushICache(void *start, size_t size)
static bool SupportsCrankshaft()
IncrementalMarking * incremental_marking()
static uint32_t & uint32_at(Address addr)
static Object *& Object_at(Address addr)
static Address & Address_at(Address addr)
static Handle< Object > & Object_Handle_at(Address addr)
static uint16_t & uint16_at(Address addr)
static uint64_t & uint64_at(Address addr)
static uintptr_t & uintptr_at(Address addr)
static int32_t & int32_at(Address addr)
static bool IsDebugBreakSlot(Mode mode)
static bool IsJSReturn(Mode mode)
static bool IsEmbeddedObject(Mode mode)
static bool IsRuntimeEntry(Mode mode)
static bool IsCodeTarget(Mode mode)
static bool IsNone(Mode mode)
static bool IsExternalReference(Mode mode)
static bool IsInternalReference(Mode mode)
static bool IsCodeAgeSequence(Mode mode)
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)
#define DCHECK_EQ(v1, v2)
kSerializedDataOffset Object
static const byte kCallOpcode
static const int kNoCodeAgeSequenceLength
Debugger support for the V8 JavaScript engine.