Commit b091f22f authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[assembler] Remove {RelocInfo::embedded_address} helper.

R=clemensh@chromium.org

Change-Id: I0ea2e8db0e2b52a2edbd485d0cd52e94eea84d9e
Reviewed-on: https://chromium-review.googlesource.com/1084487
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53499}
parent 0c509613
......@@ -338,24 +338,16 @@ bool RelocInfo::IsInConstantPool() {
return Assembler::is_constant_pool_load(pc_);
}
Address RelocInfo::embedded_address() const {
return Assembler::target_address_at(pc_, constant_pool_);
}
void RelocInfo::set_embedded_address(Address address,
ICacheFlushMode flush_mode) {
Assembler::set_target_address_at(pc_, constant_pool_, address, flush_mode);
}
void RelocInfo::set_js_to_wasm_address(Address address,
ICacheFlushMode icache_flush_mode) {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
set_embedded_address(address, icache_flush_mode);
Assembler::set_target_address_at(pc_, constant_pool_, address,
icache_flush_mode);
}
Address RelocInfo::js_to_wasm_address() const {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
return embedded_address();
return Assembler::target_address_at(pc_, constant_pool_);
}
uint32_t RelocInfo::wasm_stub_call_tag() const {
......
......@@ -179,24 +179,16 @@ bool RelocInfo::IsInConstantPool() {
return instr->IsLdrLiteralX();
}
Address RelocInfo::embedded_address() const {
return Assembler::target_address_at(pc_, constant_pool_);
}
void RelocInfo::set_embedded_address(Address address,
ICacheFlushMode flush_mode) {
Assembler::set_target_address_at(pc_, constant_pool_, address, flush_mode);
}
void RelocInfo::set_js_to_wasm_address(Address address,
ICacheFlushMode icache_flush_mode) {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
set_embedded_address(address, icache_flush_mode);
Assembler::set_target_address_at(pc_, constant_pool_, address,
icache_flush_mode);
}
Address RelocInfo::js_to_wasm_address() const {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
return embedded_address();
return Assembler::target_address_at(pc_, constant_pool_);
}
uint32_t RelocInfo::wasm_stub_call_tag() const {
......
......@@ -614,10 +614,6 @@ class RelocInfo {
static const int kApplyMask; // Modes affected by apply. Depends on arch.
private:
void set_embedded_address(Address address, ICacheFlushMode flush_mode);
Address embedded_address() const;
// On ARM/ARM64, note that pc_ is the address of the instruction referencing
// the constant pool and not the address of the constant pool entry.
Address pc_;
......
......@@ -203,16 +203,6 @@ bool RelocInfo::IsInConstantPool() {
return false;
}
Address RelocInfo::embedded_address() const { return Memory::Address_at(pc_); }
void RelocInfo::set_embedded_address(Address address,
ICacheFlushMode icache_flush_mode) {
Memory::Address_at(pc_) = address;
if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
Assembler::FlushICache(pc_, sizeof(Address));
}
}
void RelocInfo::set_js_to_wasm_address(Address address,
ICacheFlushMode icache_flush_mode) {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
......
......@@ -198,24 +198,16 @@ bool RelocInfo::IsInConstantPool() {
return false;
}
Address RelocInfo::embedded_address() const {
return Assembler::target_address_at(pc_, constant_pool_);
}
void RelocInfo::set_embedded_address(Address address,
ICacheFlushMode flush_mode) {
Assembler::set_target_address_at(pc_, constant_pool_, address, flush_mode);
}
void RelocInfo::set_js_to_wasm_address(Address address,
ICacheFlushMode icache_flush_mode) {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
set_embedded_address(address, icache_flush_mode);
Assembler::set_target_address_at(pc_, constant_pool_, address,
icache_flush_mode);
}
Address RelocInfo::js_to_wasm_address() const {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
return embedded_address();
return Assembler::target_address_at(pc_, constant_pool_);
}
uint32_t RelocInfo::wasm_stub_call_tag() const {
......
......@@ -176,24 +176,16 @@ bool RelocInfo::IsInConstantPool() {
return false;
}
Address RelocInfo::embedded_address() const {
return Assembler::target_address_at(pc_, constant_pool_);
}
void RelocInfo::set_embedded_address(Address address,
ICacheFlushMode flush_mode) {
Assembler::set_target_address_at(pc_, constant_pool_, address, flush_mode);
}
void RelocInfo::set_js_to_wasm_address(Address address,
ICacheFlushMode icache_flush_mode) {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
set_embedded_address(address, icache_flush_mode);
Assembler::set_target_address_at(pc_, constant_pool_, address,
icache_flush_mode);
}
Address RelocInfo::js_to_wasm_address() const {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
return embedded_address();
return Assembler::target_address_at(pc_, constant_pool_);
}
uint32_t RelocInfo::wasm_stub_call_tag() const {
......
......@@ -161,20 +161,11 @@ bool RelocInfo::IsInConstantPool() {
return false;
}
Address RelocInfo::embedded_address() const {
return Assembler::target_address_at(pc_, constant_pool_);
}
uint32_t RelocInfo::embedded_size() const {
return static_cast<uint32_t>(
Assembler::target_address_at(pc_, constant_pool_));
}
void RelocInfo::set_embedded_address(Address address,
ICacheFlushMode flush_mode) {
Assembler::set_target_address_at(pc_, constant_pool_, address, flush_mode);
}
void RelocInfo::set_embedded_size(uint32_t size, ICacheFlushMode flush_mode) {
Assembler::set_target_address_at(pc_, constant_pool_,
static_cast<Address>(size), flush_mode);
......@@ -183,12 +174,13 @@ void RelocInfo::set_embedded_size(uint32_t size, ICacheFlushMode flush_mode) {
void RelocInfo::set_js_to_wasm_address(Address address,
ICacheFlushMode icache_flush_mode) {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
set_embedded_address(address, icache_flush_mode);
Assembler::set_target_address_at(pc_, constant_pool_, address,
icache_flush_mode);
}
Address RelocInfo::js_to_wasm_address() const {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
return embedded_address();
return Assembler::target_address_at(pc_, constant_pool_);
}
// -----------------------------------------------------------------------------
......
......@@ -270,20 +270,11 @@ bool RelocInfo::IsCodedSpecially() {
bool RelocInfo::IsInConstantPool() { return false; }
Address RelocInfo::embedded_address() const {
return Assembler::target_address_at(pc_, constant_pool_);
}
uint32_t RelocInfo::embedded_size() const {
return static_cast<uint32_t>(
Assembler::target_address_at(pc_, constant_pool_));
}
void RelocInfo::set_embedded_address(Address address,
ICacheFlushMode flush_mode) {
Assembler::set_target_address_at(pc_, constant_pool_, address, flush_mode);
}
void RelocInfo::set_embedded_size(uint32_t size, ICacheFlushMode flush_mode) {
Assembler::set_target_address_at(pc_, constant_pool_,
static_cast<Address>(size), flush_mode);
......@@ -292,12 +283,13 @@ void RelocInfo::set_embedded_size(uint32_t size, ICacheFlushMode flush_mode) {
void RelocInfo::set_js_to_wasm_address(Address address,
ICacheFlushMode icache_flush_mode) {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
set_embedded_address(address, icache_flush_mode);
Assembler::set_target_address_at(pc_, constant_pool_, address,
icache_flush_mode);
}
Address RelocInfo::js_to_wasm_address() const {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
return embedded_address();
return Assembler::target_address_at(pc_, constant_pool_);
}
// -----------------------------------------------------------------------------
......
......@@ -123,25 +123,18 @@ void CpuFeatures::PrintFeatures() {
// -----------------------------------------------------------------------------
// Implementation of RelocInfo
Address RelocInfo::embedded_address() const { return Memory::Address_at(pc_); }
void RelocInfo::set_embedded_address(Address address,
ICacheFlushMode icache_flush_mode) {
void RelocInfo::set_js_to_wasm_address(Address address,
ICacheFlushMode icache_flush_mode) {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
Memory::Address_at(pc_) = address;
if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
Assembler::FlushICache(pc_, sizeof(Address));
}
}
void RelocInfo::set_js_to_wasm_address(Address address,
ICacheFlushMode icache_flush_mode) {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
set_embedded_address(address, icache_flush_mode);
}
Address RelocInfo::js_to_wasm_address() const {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
return embedded_address();
return Memory::Address_at(pc_);
}
uint32_t RelocInfo::wasm_stub_call_tag() const {
......
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