Rename the address field of Table/Memory/Global exports to definition.

For functions, `address` makes sense because it's the address of the
function. Bt for Table/Memory/Global, it points to a `VM*Definition` field.
This commit is contained in:
Dan Gohman
2018-12-24 18:20:15 -08:00
parent 8f74c7f3d5
commit 71c0142cd4
4 changed files with 31 additions and 27 deletions

View File

@@ -260,7 +260,7 @@ impl Instance {
}
}
wasmtime_environ::Export::Table(index) => {
let (address, vmctx) = if let Some(def_index) =
let (definition, vmctx) = if let Some(def_index) =
self.module.defined_table_index(*index)
{
(
@@ -272,13 +272,13 @@ impl Instance {
(import.from, import.vmctx)
};
Export::Table {
address,
definition,
vmctx,
table: self.module.table_plans[*index].clone(),
}
}
wasmtime_environ::Export::Memory(index) => {
let (address, vmctx) = if let Some(def_index) =
let (definition, vmctx) = if let Some(def_index) =
self.module.defined_memory_index(*index)
{
(
@@ -290,13 +290,13 @@ impl Instance {
(import.from, import.vmctx)
};
Export::Memory {
address,
definition,
vmctx,
memory: self.module.memory_plans[*index].clone(),
}
}
wasmtime_environ::Export::Global(index) => Export::Global {
address: if let Some(def_index) = self.module.defined_global_index(*index) {
definition: if let Some(def_index) = self.module.defined_global_index(*index) {
unsafe { self.vmctx.global_mut(def_index) }
} else {
unsafe { self.vmctx.imported_global(*index).from }