@@ -1109,6 +1109,19 @@ pub struct VMStoreContext {
11091109 /// The `VMMemoryDefinition` for this store's GC heap.
11101110 pub gc_heap : VMMemoryDefinition ,
11111111
1112+ /// The value of the frame pointer register in the trampoline used
1113+ /// to call from Wasm to the host.
1114+ ///
1115+ /// Maintained by our Wasm-to-host trampoline, and cleared just
1116+ /// before calling into Wasm in `catch_traps`.
1117+ ///
1118+ /// This member is `0` when Wasm is actively running and has not called out
1119+ /// to the host.
1120+ ///
1121+ /// Used to find the size of the bottom-most Wasm frame (relative
1122+ /// to `last_wasm_exit_fp`) when walking the stack.
1123+ pub last_wasm_exit_trampoline_fp : UnsafeCell < usize > ,
1124+
11121125 /// The value of the frame pointer register when we last called from Wasm to
11131126 /// the host.
11141127 ///
@@ -1189,6 +1202,7 @@ impl Default for VMStoreContext {
11891202 current_length : AtomicUsize :: new ( 0 ) ,
11901203 } ,
11911204 last_wasm_exit_fp : UnsafeCell :: new ( 0 ) ,
1205+ last_wasm_exit_trampoline_fp : UnsafeCell :: new ( 0 ) ,
11921206 last_wasm_exit_pc : UnsafeCell :: new ( 0 ) ,
11931207 last_wasm_entry_fp : UnsafeCell :: new ( 0 ) ,
11941208 stack_chain : UnsafeCell :: new ( VMStackChain :: Absent ) ,
@@ -1231,6 +1245,10 @@ mod test_vmstore_context {
12311245 offset_of!( VMStoreContext , gc_heap) + offset_of!( VMMemoryDefinition , current_length) ,
12321246 usize :: from( offsets. ptr. vmstore_context_gc_heap_current_length( ) )
12331247 ) ;
1248+ assert_eq ! (
1249+ offset_of!( VMStoreContext , last_wasm_exit_trampoline_fp) ,
1250+ usize :: from( offsets. ptr. vmstore_context_last_wasm_exit_trampoline_fp( ) )
1251+ ) ;
12341252 assert_eq ! (
12351253 offset_of!( VMStoreContext , last_wasm_exit_fp) ,
12361254 usize :: from( offsets. ptr. vmstore_context_last_wasm_exit_fp( ) )
0 commit comments