Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ tests/all/pulley_provenance_test.cwasm
/artifacts
testcase*.wat
testcase*.wasm
perf.data*
3 changes: 3 additions & 0 deletions crates/wasmtime/src/runtime/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,7 @@ impl Func {
/// `StoreOpaque` while the `FuncType` is also being used (from the
/// perspective of the borrow-checker) because otherwise the signature would
/// consider `StoreOpaque` borrowed mutable while `FuncType` is in use.
#[inline]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems related to the dynamic calls case which we don't tend to try to put too much effort into optimizing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was hot in a benchmark that was regressing compared to main; easy to fix; don't see why we wouldn't do this.

fn ty_ref<'a>(&self, store: &'a mut StoreOpaque) -> (&'a FuncType, &'a StoreOpaque) {
// If we haven't loaded our type into the store yet then do so lazily at
// this time.
Expand Down Expand Up @@ -1737,6 +1738,7 @@ impl EntryStoreContext {
/// function through this type's `Drop` implementation. This ensures that we
/// even restore the values if we unwind the stack (e.g., because we are
/// panicing out of a Wasm execution).
#[inline]
fn exit_wasm(&mut self) {
unsafe {
if let Some(limit) = self.stack_limit {
Expand All @@ -1751,6 +1753,7 @@ impl EntryStoreContext {
}

impl Drop for EntryStoreContext {
#[inline]
fn drop(&mut self) {
self.exit_wasm();
}
Expand Down
1 change: 1 addition & 0 deletions crates/wasmtime/src/runtime/func/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ where
/// connected to an asynchronous store.
///
/// [`Trap`]: crate::Trap
#[inline]
pub fn call(&self, mut store: impl AsContextMut, params: Params) -> Result<Results> {
let mut store = store.as_context_mut();
assert!(
Expand Down
1 change: 1 addition & 0 deletions crates/wasmtime/src/runtime/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2384,6 +2384,7 @@ impl FuncType {
}

#[cfg(feature = "gc")]
#[inline]
pub(crate) fn as_wasm_func_type(&self) -> &WasmFuncType {
self.registered_type.unwrap_func()
}
Expand Down
2 changes: 2 additions & 0 deletions crates/wasmtime/src/runtime/vm/vmcontext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@ impl VMFuncRef {
///
/// Note that the unsafety invariants to maintain here are not currently
/// exhaustively documented.
#[inline]
pub unsafe fn array_call(
&self,
pulley: Option<InterpreterRef<'_>>,
Expand Down Expand Up @@ -867,6 +868,7 @@ impl VMFuncRef {
)
}

#[inline]
unsafe fn array_call_native(
&self,
caller: NonNull<VMOpaqueContext>,
Expand Down