Skip to content

Commit 7d72a9a

Browse files
authored
Rename memory32_grow builtin to memory_grow (#11208)
This builtin is used for both 32 and 64-bit linear memories, no need to bake "32" into the name any more.
1 parent 22f51bc commit 7d72a9a

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

crates/cranelift/src/func_environ.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2752,7 +2752,7 @@ impl FuncEnvironment<'_> {
27522752
val: ir::Value,
27532753
) -> WasmResult<ir::Value> {
27542754
let mut pos = builder.cursor();
2755-
let memory_grow = self.builtin_functions.memory32_grow(&mut pos.func);
2755+
let memory_grow = self.builtin_functions.memory_grow(&mut pos.func);
27562756
let index_arg = index.index();
27572757

27582758
let memory_index = pos.ins().iconst(I32, index_arg as i64);

crates/environ/src/builtin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ macro_rules! foreach_builtin_function {
44
($mac:ident) => {
55
$mac! {
66
// Returns an index for wasm's `memory.grow` builtin function.
7-
memory32_grow(vmctx: vmctx, delta: u64, index: u32) -> pointer;
7+
memory_grow(vmctx: vmctx, delta: u64, index: u32) -> pointer;
88
// Returns an index for wasm's `table.copy` when both tables are locally
99
// defined.
1010
table_copy(vmctx: vmctx, dst_index: u32, src_index: u32, dst: u64, src: u64, len: u64) -> bool;
@@ -377,7 +377,7 @@ impl BuiltinFunctionIndex {
377377
}};
378378

379379
// Growth-related functions return -2 as a sentinel.
380-
(@get memory32_grow pointer) => (TrapSentinel::NegativeTwo);
380+
(@get memory_grow pointer) => (TrapSentinel::NegativeTwo);
381381
(@get table_grow_func_ref pointer) => (TrapSentinel::NegativeTwo);
382382
(@get table_grow_gc_ref pointer) => (TrapSentinel::NegativeTwo);
383383
(@get table_grow_cont_obj pointer) => (TrapSentinel::NegativeTwo);

crates/wasmtime/src/runtime/vm/libcalls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ pub mod raw {
162162
wasmtime_environ::foreach_builtin_function!(libcall);
163163
}
164164

165-
fn memory32_grow(
165+
fn memory_grow(
166166
store: &mut dyn VMStore,
167167
mut instance: Pin<&mut Instance>,
168168
delta: u64,

winch/codegen/src/visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1874,7 +1874,7 @@ where
18741874
self.context.stack.extend([mem.try_into()?]);
18751875

18761876
let heap = self.env.resolve_heap(MemoryIndex::from_u32(mem));
1877-
let builtin = self.env.builtins.memory32_grow::<M::ABI, M::Ptr>()?;
1877+
let builtin = self.env.builtins.memory_grow::<M::ABI, M::Ptr>()?;
18781878
FnCall::emit::<M>(
18791879
&mut self.env,
18801880
self.masm,

0 commit comments

Comments
 (0)