Commit 2e1f5567 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[cleanup] Prefer handle.address() over handle.location() in some places.

... so that we can get rid of explicit AllowHandleDereference at the
call sites.

Bug: v8:6048
Change-Id: I1c31998fc8e0a63348f52ad60dd8c49244d45b40
Reviewed-on: https://chromium-review.googlesource.com/563658Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46500}
parent 66b54ab1
......@@ -374,9 +374,8 @@ void RelocInfo::unchecked_update_wasm_size(Isolate* isolate, uint32_t size,
// See assembler-arm-inl.h for inlined constructors
Operand::Operand(Handle<HeapObject> handle) {
AllowHandleDereference using_location;
rm_ = no_reg;
value_.immediate = reinterpret_cast<intptr_t>(handle.location());
value_.immediate = reinterpret_cast<intptr_t>(handle.address());
rmode_ = RelocInfo::EMBEDDED_OBJECT;
}
......@@ -511,7 +510,7 @@ void Assembler::AllocateAndInstallRequestedHeapObjects(Isolate* isolate) {
}
Address pc = buffer_ + request.offset();
Memory::Address_at(constant_pool_entry_address(pc, 0 /* unused */)) =
reinterpret_cast<Address>(object.location());
object.address();
}
}
......
......@@ -51,8 +51,7 @@ void TurboAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
Condition cond) {
DCHECK(RelocInfo::IsCodeTarget(rmode));
// 'code' is always generated ARM code, never THUMB code
AllowHandleDereference using_location;
Jump(reinterpret_cast<intptr_t>(code.location()), rmode, cond);
Jump(reinterpret_cast<intptr_t>(code.address()), rmode, cond);
}
int TurboAssembler::CallSize(Register target, Condition cond) {
......@@ -126,8 +125,7 @@ void TurboAssembler::Call(Address target, RelocInfo::Mode rmode, Condition cond,
int TurboAssembler::CallSize(Handle<Code> code, RelocInfo::Mode rmode,
Condition cond) {
AllowHandleDereference using_location;
return CallSize(reinterpret_cast<Address>(code.location()), rmode, cond);
return CallSize(code.address(), rmode, cond);
}
void TurboAssembler::Call(Handle<Code> code, RelocInfo::Mode rmode,
......@@ -135,8 +133,7 @@ void TurboAssembler::Call(Handle<Code> code, RelocInfo::Mode rmode,
bool check_constant_pool) {
DCHECK(RelocInfo::IsCodeTarget(rmode));
// 'code' is always generated ARM code, never THUMB code
AllowHandleDereference using_location;
Call(reinterpret_cast<Address>(code.location()), rmode, cond, mode);
Call(code.address(), rmode, cond, mode);
}
void MacroAssembler::CallDeoptimizer(Address target) {
......
......@@ -309,8 +309,7 @@ bool AreConsecutive(const VRegister& reg1, const VRegister& reg2,
}
void Immediate::InitializeHandle(Handle<HeapObject> handle) {
AllowHandleDereference using_location;
value_ = reinterpret_cast<intptr_t>(handle.location());
value_ = reinterpret_cast<intptr_t>(handle.address());
rmode_ = RelocInfo::EMBEDDED_OBJECT;
}
......@@ -616,8 +615,7 @@ void Assembler::AllocateAndInstallRequestedHeapObjects(Isolate* isolate) {
break;
}
Address pc = buffer_ + request.offset();
Memory::Address_at(target_pointer_address_at(pc)) =
reinterpret_cast<Address>(object.location());
Memory::Address_at(target_pointer_address_at(pc)) = object.address();
}
}
......
......@@ -2049,8 +2049,7 @@ void TurboAssembler::Jump(Address target, RelocInfo::Mode rmode,
void TurboAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
Condition cond) {
DCHECK(RelocInfo::IsCodeTarget(rmode));
AllowHandleDereference using_location;
Jump(reinterpret_cast<intptr_t>(code.location()), rmode, cond);
Jump(reinterpret_cast<intptr_t>(code.address()), rmode, cond);
}
void TurboAssembler::Call(Register target) {
......@@ -2119,8 +2118,7 @@ void TurboAssembler::Call(Handle<Code> code, RelocInfo::Mode rmode) {
Bind(&start_call);
#endif
AllowHandleDereference using_location;
Call(reinterpret_cast<Address>(code.location()), rmode);
Call(code.address(), rmode);
#ifdef DEBUG
// Check the size of the code generated.
......
......@@ -316,8 +316,7 @@ Immediate::Immediate(Label* internal_offset) {
}
Immediate::Immediate(Handle<HeapObject> handle) {
AllowHandleDereference using_location;
value_.immediate = reinterpret_cast<intptr_t>(handle.location());
value_.immediate = reinterpret_cast<intptr_t>(handle.address());
rmode_ = RelocInfo::EMBEDDED_OBJECT;
}
......@@ -346,8 +345,7 @@ void Assembler::emit_q(uint64_t x) {
}
void Assembler::emit(Handle<HeapObject> handle) {
AllowHandleDereference using_location;
emit(reinterpret_cast<intptr_t>(handle.location()),
emit(reinterpret_cast<intptr_t>(handle.address()),
RelocInfo::EMBEDDED_OBJECT);
}
......@@ -359,8 +357,7 @@ void Assembler::emit(uint32_t x, RelocInfo::Mode rmode) {
}
void Assembler::emit(Handle<Code> code, RelocInfo::Mode rmode) {
AllowHandleDereference using_location;
emit(reinterpret_cast<intptr_t>(code.location()), rmode);
emit(reinterpret_cast<intptr_t>(code.address()), rmode);
}
......
......@@ -396,9 +396,7 @@ class Operand BASE_EMBEDDED {
}
static Operand ForCell(Handle<Cell> cell) {
AllowDeferredHandleDereference embedding_raw_address;
return Operand(reinterpret_cast<int32_t>(cell.location()),
RelocInfo::CELL);
return Operand(reinterpret_cast<int32_t>(cell.address()), RelocInfo::CELL);
}
static Operand ForRegisterPlusImmediate(Register base, Immediate imm) {
......
......@@ -2827,8 +2827,7 @@ void TurboAssembler::Push(Handle<HeapObject> source) {
void TurboAssembler::Move(Register result, Handle<HeapObject> object,
RelocInfo::Mode rmode) {
AllowHandleDereference using_location;
movp(result, reinterpret_cast<void*>(object.location()), rmode);
movp(result, reinterpret_cast<void*>(object.address()), rmode);
}
void TurboAssembler::Move(const Operand& dst, Handle<HeapObject> object,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment