diff --git a/compiler/gen_wasm/src/wasm_module/sections.rs b/compiler/gen_wasm/src/wasm_module/sections.rs index da43361ed1..46c07d888e 100644 --- a/compiler/gen_wasm/src/wasm_module/sections.rs +++ b/compiler/gen_wasm/src/wasm_module/sections.rs @@ -578,6 +578,7 @@ struct SectionCounter { impl SectionCounter { /// Update the section counter if buffer size increased since last call + #[inline] fn update(&mut self, buffer: &mut SB) { let new_size = buffer.size(); if new_size > self.buffer_size { @@ -586,6 +587,7 @@ impl SectionCounter { } } + #[inline] fn serialize_and_count( &mut self, buffer: &mut SB, diff --git a/compiler/gen_wasm/src/wasm_module/serialize.rs b/compiler/gen_wasm/src/wasm_module/serialize.rs index 2f051553db..9445d8c30b 100644 --- a/compiler/gen_wasm/src/wasm_module/serialize.rs +++ b/compiler/gen_wasm/src/wasm_module/serialize.rs @@ -27,6 +27,7 @@ impl Serialize for u32 { // Unit is used as a placeholder in parts of the Wasm spec we don't use yet impl Serialize for () { + #[inline(always)] fn serialize(&self, _buffer: &mut T) {} }