Commit 5870236e authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[wasm][cleanup] Use getters in IndirectFunctionTableEntry::CopyFrom

This makes the code easier to read, and will also be helpful for the
extension to multiple indirect function tables.

R=clemensh@chromium.org

Bug: v8:9396
Change-Id: Idba143611e13f6b6cfc0e9d6c6f380ee3566db80
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1678476
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62390}
parent 00e389d2
......@@ -1506,26 +1506,21 @@ void IndirectFunctionTableEntry::Set(int sig_id, Address call_target,
instance_->indirect_function_table_refs().set(index_, ref);
}
Object IndirectFunctionTableEntry::object_ref() {
Object IndirectFunctionTableEntry::object_ref() const {
return instance_->indirect_function_table_refs().get(index_);
}
int IndirectFunctionTableEntry::sig_id() {
int IndirectFunctionTableEntry::sig_id() const {
return instance_->indirect_function_table_sig_ids()[index_];
}
Address IndirectFunctionTableEntry::target() {
Address IndirectFunctionTableEntry::target() const {
return instance_->indirect_function_table_targets()[index_];
}
void IndirectFunctionTableEntry::CopyFrom(
const IndirectFunctionTableEntry& that) {
instance_->indirect_function_table_sig_ids()[index_] =
that.instance_->indirect_function_table_sig_ids()[that.index_];
instance_->indirect_function_table_targets()[index_] =
that.instance_->indirect_function_table_targets()[that.index_];
instance_->indirect_function_table_refs().set(
index_, that.instance_->indirect_function_table_refs().get(that.index_));
Set(that.sig_id(), that.target(), that.object_ref());
}
void ImportedFunctionEntry::SetWasmToJs(
......
......@@ -71,9 +71,9 @@ class IndirectFunctionTableEntry {
void CopyFrom(const IndirectFunctionTableEntry& that);
Object object_ref();
int sig_id();
Address target();
Object object_ref() const;
int sig_id() const;
Address target() const;
private:
Handle<WasmInstanceObject> const instance_;
......
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