Skip to content

Commit 28f9783

Browse files
authored
Remove a dead trait method (#11407)
* Remove a dead trait method Made obsolete from previous refactorings, so no need to keep this any more. * Fix unused import * Fix missing import
1 parent 734f71c commit 28f9783

File tree

3 files changed

+3
-40
lines changed

3 files changed

+3
-40
lines changed

crates/wasmtime/src/runtime/store.rs

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ use crate::runtime::vm::mpk::ProtectionKey;
9393
use crate::runtime::vm::{
9494
self, GcStore, Imports, InstanceAllocationRequest, InstanceAllocator, InstanceHandle,
9595
Interpreter, InterpreterRef, ModuleRuntimeInfo, OnDemandInstanceAllocator, SendSyncPtr,
96-
SignalHandler, StoreBox, StorePtr, Unwind, VMContext, VMFuncRef, VMGcRef, VMStoreContext,
96+
SignalHandler, StoreBox, StorePtr, Unwind, VMContext, VMFuncRef, VMStoreContext,
9797
};
9898
use crate::trampoline::VMHostGlobalContext;
9999
use crate::{Engine, Module, Trap, Val, ValRaw, module::ModuleRegistry};
@@ -1638,7 +1638,7 @@ impl StoreOpaque {
16381638
let raw: u32 = unsafe { core::ptr::read(stack_slot) };
16391639
log::trace!("Stack slot @ {stack_slot:p} = {raw:#x}");
16401640

1641-
let gc_ref = VMGcRef::from_raw_u32(raw);
1641+
let gc_ref = vm::VMGcRef::from_raw_u32(raw);
16421642
if gc_ref.is_some() {
16431643
unsafe {
16441644
gc_roots_list
@@ -2298,24 +2298,6 @@ unsafe impl<T> vm::VMStore for StoreInner<T> {
22982298
delta_result
22992299
}
23002300

2301-
#[cfg(feature = "gc")]
2302-
unsafe fn maybe_async_grow_or_collect_gc_heap(
2303-
&mut self,
2304-
root: Option<VMGcRef>,
2305-
bytes_needed: Option<u64>,
2306-
) -> Result<Option<VMGcRef>> {
2307-
unsafe { self.inner.maybe_async_gc(root, bytes_needed) }
2308-
}
2309-
2310-
#[cfg(not(feature = "gc"))]
2311-
unsafe fn maybe_async_grow_or_collect_gc_heap(
2312-
&mut self,
2313-
root: Option<VMGcRef>,
2314-
_bytes_needed: Option<u64>,
2315-
) -> Result<Option<VMGcRef>> {
2316-
Ok(root)
2317-
}
2318-
23192301
#[cfg(feature = "component-model")]
23202302
fn component_calls(&mut self) -> &mut vm::component::CallContexts {
23212303
&mut self.component_calls

crates/wasmtime/src/runtime/store/gc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
use super::*;
44
use crate::GcHeapOutOfMemory;
5+
use crate::runtime::vm::VMGcRef;
56

67
impl StoreOpaque {
78
/// Collect garbage, potentially growing the GC heap.

crates/wasmtime/src/runtime/vm.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -242,26 +242,6 @@ pub unsafe trait VMStore: 'static {
242242
#[cfg(target_has_atomic = "64")]
243243
fn new_epoch(&mut self) -> Result<u64, Error>;
244244

245-
/// Callback invoked whenever an instance needs to grow-or-collect the GC
246-
/// heap.
247-
///
248-
/// Optionally given a GC reference that is rooted for the collection, and
249-
/// then whose updated GC reference is returned.
250-
///
251-
/// Optionally given a number of bytes that are needed for an upcoming
252-
/// allocation.
253-
///
254-
/// Cooperative, async-yielding (if configured) is completely transparent,
255-
/// but must be called from a fiber stack in that case.
256-
///
257-
/// If the async GC was cancelled, returns an error. This should be raised
258-
/// as a trap to clean up Wasm execution.
259-
unsafe fn maybe_async_grow_or_collect_gc_heap(
260-
&mut self,
261-
root: Option<VMGcRef>,
262-
bytes_needed: Option<u64>,
263-
) -> Result<Option<VMGcRef>>;
264-
265245
/// Metadata required for resources for the component model.
266246
#[cfg(feature = "component-model")]
267247
fn component_calls(&mut self) -> &mut component::CallContexts;

0 commit comments

Comments
 (0)