[wasm] Rename native_pointer() to pointer_type() to make it more apparent it's a type;
This commit is contained in:
committed by
Dan Gohman
parent
32d657d62a
commit
5f3cd868cd
@@ -141,7 +141,7 @@ impl<'dummy_environment> DummyFuncEnvironment<'dummy_environment> {
|
||||
fn vmctx_sig(&self, sigidx: SignatureIndex) -> ir::Signature {
|
||||
let mut sig = self.mod_info.signatures[sigidx].clone();
|
||||
sig.params.push(ir::AbiParam::special(
|
||||
self.native_pointer(),
|
||||
self.pointer_type(),
|
||||
ir::ArgumentPurpose::VMContext,
|
||||
));
|
||||
sig
|
||||
@@ -217,7 +217,7 @@ impl<'dummy_environment> FuncEnvironment for DummyFuncEnvironment<'dummy_environ
|
||||
// The `callee` value is an index into a table of function pointers.
|
||||
// Apparently, that table is stored at absolute address 0 in this dummy environment.
|
||||
// TODO: Generate bounds checking code.
|
||||
let ptr = self.native_pointer();
|
||||
let ptr = self.pointer_type();
|
||||
let callee_offset = if ptr == I32 {
|
||||
pos.ins().imul_imm(callee, 4)
|
||||
} else {
|
||||
|
||||
@@ -85,7 +85,7 @@ pub trait FuncEnvironment {
|
||||
/// Get the Cranelift integer type to use for native pointers.
|
||||
///
|
||||
/// This returns `I64` for 64-bit architectures and `I32` for 32-bit architectures.
|
||||
fn native_pointer(&self) -> ir::Type {
|
||||
fn pointer_type(&self) -> ir::Type {
|
||||
ir::Type::int(u16::from(self.triple().pointer_width().unwrap().bits())).unwrap()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user