diff options
Diffstat (limited to 'deps/v8/src/x64/assembler-x64-inl.h')
-rw-r--r-- | deps/v8/src/x64/assembler-x64-inl.h | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/deps/v8/src/x64/assembler-x64-inl.h b/deps/v8/src/x64/assembler-x64-inl.h index 559ebedc1de..4c6cce54825 100644 --- a/deps/v8/src/x64/assembler-x64-inl.h +++ b/deps/v8/src/x64/assembler-x64-inl.h @@ -24,12 +24,12 @@ bool CpuFeatures::SupportsWasmSimd128() { return IsSupported(SSE4_1); } void Assembler::emitl(uint32_t x) { - Memory::uint32_at(reinterpret_cast<Address>(pc_)) = x; + Memory<uint32_t>(pc_) = x; pc_ += sizeof(uint32_t); } void Assembler::emitp(Address x, RelocInfo::Mode rmode) { - Memory::uintptr_at(reinterpret_cast<Address>(pc_)) = x; + Memory<uintptr_t>(pc_) = x; if (!RelocInfo::IsNone(rmode)) { RecordRelocInfo(rmode, x); } @@ -38,13 +38,13 @@ void Assembler::emitp(Address x, RelocInfo::Mode rmode) { void Assembler::emitq(uint64_t x) { - Memory::uint64_at(reinterpret_cast<Address>(pc_)) = x; + Memory<uint64_t>(pc_) = x; pc_ += sizeof(uint64_t); } void Assembler::emitw(uint16_t x) { - Memory::uint16_at(reinterpret_cast<Address>(pc_)) = x; + Memory<uint16_t>(pc_) = x; pc_ += sizeof(uint16_t); } @@ -75,6 +75,10 @@ void Assembler::emit_rex_64(Register reg, XMMRegister rm_reg) { emit(0x48 | (reg.code() & 0x8) >> 1 | rm_reg.code() >> 3); } +void Assembler::emit_rex_64(XMMRegister reg, XMMRegister rm_reg) { + emit(0x48 | (reg.code() & 0x8) >> 1 | rm_reg.code() >> 3); +} + void Assembler::emit_rex_64(Register reg, Operand op) { emit(0x48 | reg.high_bit() << 2 | op.data().rex); } @@ -229,13 +233,13 @@ void Assembler::emit_vex_prefix(Register reg, Register vreg, Operand rm, Address Assembler::target_address_at(Address pc, Address constant_pool) { - return Memory::int32_at(pc) + pc + 4; + return Memory<int32_t>(pc) + pc + 4; } void Assembler::set_target_address_at(Address pc, Address constant_pool, Address target, ICacheFlushMode icache_flush_mode) { - Memory::int32_at(pc) = static_cast<int32_t>(target - pc - 4); + Memory<int32_t>(pc) = static_cast<int32_t>(target - pc - 4); if (icache_flush_mode != SKIP_ICACHE_FLUSH) { Assembler::FlushICache(pc, sizeof(int32_t)); } @@ -243,7 +247,7 @@ void Assembler::set_target_address_at(Address pc, Address constant_pool, void Assembler::deserialization_set_target_internal_reference_at( Address pc, Address target, RelocInfo::Mode mode) { - Memory::Address_at(pc) = target; + Memory<Address>(pc) = target; } @@ -263,11 +267,11 @@ int Assembler::deserialization_special_target_size( } Handle<Code> Assembler::code_target_object_handle_at(Address pc) { - return GetCodeTarget(Memory::int32_at(pc)); + return GetCodeTarget(Memory<int32_t>(pc)); } Address Assembler::runtime_entry_at(Address pc) { - return Memory::int32_at(pc) + options().code_range_start; + return Memory<int32_t>(pc) + options().code_range_start; } // ----------------------------------------------------------------------------- @@ -276,10 +280,10 @@ Address Assembler::runtime_entry_at(Address pc) { // The modes possibly affected by apply must be in kApplyMask. void RelocInfo::apply(intptr_t delta) { if (IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)) { - Memory::int32_at(pc_) -= static_cast<int32_t>(delta); + Memory<int32_t>(pc_) -= static_cast<int32_t>(delta); } else if (IsInternalReference(rmode_)) { // absolute code pointer inside code object moves with the code object. - Memory::Address_at(pc_) += delta; + Memory<Address>(pc_) += delta; } } @@ -312,13 +316,13 @@ int RelocInfo::target_address_size() { HeapObject* RelocInfo::target_object() { DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); - return HeapObject::cast(Memory::Object_at(pc_)); + return HeapObject::cast(Memory<Object*>(pc_)); } Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) { DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); if (rmode_ == EMBEDDED_OBJECT) { - return Handle<HeapObject>::cast(Memory::Object_Handle_at(pc_)); + return Handle<HeapObject>::cast(Memory<Handle<Object>>(pc_)); } else { return origin->code_target_object_handle_at(pc_); } @@ -326,13 +330,13 @@ Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) { Address RelocInfo::target_external_reference() { DCHECK(rmode_ == RelocInfo::EXTERNAL_REFERENCE); - return Memory::Address_at(pc_); + return Memory<Address>(pc_); } void RelocInfo::set_target_external_reference( Address target, ICacheFlushMode icache_flush_mode) { DCHECK(rmode_ == RelocInfo::EXTERNAL_REFERENCE); - Memory::Address_at(pc_) = target; + Memory<Address>(pc_) = target; if (icache_flush_mode != SKIP_ICACHE_FLUSH) { Assembler::FlushICache(pc_, sizeof(Address)); } @@ -340,7 +344,7 @@ void RelocInfo::set_target_external_reference( Address RelocInfo::target_internal_reference() { DCHECK(rmode_ == INTERNAL_REFERENCE); - return Memory::Address_at(pc_); + return Memory<Address>(pc_); } @@ -353,13 +357,12 @@ void RelocInfo::set_target_object(Heap* heap, HeapObject* target, WriteBarrierMode write_barrier_mode, ICacheFlushMode icache_flush_mode) { DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); - Memory::Object_at(pc_) = target; + Memory<Object*>(pc_) = target; if (icache_flush_mode != SKIP_ICACHE_FLUSH) { Assembler::FlushICache(pc_, sizeof(Address)); } if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != nullptr) { - heap->incremental_marking()->RecordWriteIntoCode(host(), this, target); - heap->RecordWriteIntoCode(host(), this, target); + WriteBarrierForCode(host(), this, target); } } @@ -380,13 +383,13 @@ void RelocInfo::set_target_runtime_entry(Address target, Address RelocInfo::target_off_heap_target() { DCHECK(IsOffHeapTarget(rmode_)); - return Memory::Address_at(pc_); + return Memory<Address>(pc_); } void RelocInfo::WipeOut() { if (IsEmbeddedObject(rmode_) || IsExternalReference(rmode_) || - IsInternalReference(rmode_)) { - Memory::Address_at(pc_) = kNullAddress; + IsInternalReference(rmode_) || IsOffHeapTarget(rmode_)) { + Memory<Address>(pc_) = kNullAddress; } else if (IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)) { // Effectively write zero into the relocation. Assembler::set_target_address_at(pc_, constant_pool_, |