1 use crate::Result; 2 use core::ops::Range; 3 4 use crate::runtime::vm::stack_switching::VMHostArray; 5 use crate::runtime::vm::{VMContext, VMFuncRef, ValRaw}; 6 7 /// Making sure that this has the same size as the non-dummy version, to 8 /// make some tests happy. 9 #[derive(Debug)] 10 #[repr(C)] 11 pub struct VMContinuationStack { 12 _top: *mut u8, 13 _len: usize, 14 _match_size_on_unix: u8, 15 } 16 17 impl VMContinuationStack { new(_size: usize) -> Result<Self>18 pub fn new(_size: usize) -> Result<Self> { 19 crate::bail!("Stack switching disabled or not implemented on this platform") 20 } 21 unallocated() -> Self22 pub fn unallocated() -> Self { 23 panic!("Stack switching disabled or not implemented on this platform") 24 } 25 is_unallocated(&self) -> bool26 pub fn is_unallocated(&self) -> bool { 27 panic!("Stack switching disabled or not implemented on this platform") 28 } 29 from_raw_parts(_base: *mut u8, _guard_size: usize, _len: usize) -> Result<Self>30 pub unsafe fn from_raw_parts(_base: *mut u8, _guard_size: usize, _len: usize) -> Result<Self> { 31 crate::bail!("Stack switching disabled or not implemented on this platform") 32 } 33 is_from_raw_parts(&self) -> bool34 pub fn is_from_raw_parts(&self) -> bool { 35 panic!("Stack switching disabled or not implemented on this platform") 36 } 37 top(&self) -> Option<*mut u8>38 pub fn top(&self) -> Option<*mut u8> { 39 panic!("Stack switching disabled or not implemented on this platform") 40 } 41 range(&self) -> Option<Range<usize>>42 pub fn range(&self) -> Option<Range<usize>> { 43 panic!("Stack switching disabled or not implemented on this platform") 44 } 45 control_context_instruction_pointer(&self) -> usize46 pub fn control_context_instruction_pointer(&self) -> usize { 47 panic!("Stack switching disabled or not implemented on this platform") 48 } 49 control_context_frame_pointer(&self) -> usize50 pub fn control_context_frame_pointer(&self) -> usize { 51 panic!("Stack switching disabled or not implemented on this platform") 52 } 53 control_context_stack_pointer(&self) -> usize54 pub fn control_context_stack_pointer(&self) -> usize { 55 panic!("Stack switching disabled or not implemented on this platform") 56 } 57 initialize( &self, _func_ref: *const VMFuncRef, _caller_vmctx: *mut VMContext, _args: *mut VMHostArray<ValRaw>, _parameter_count: u32, _return_value_count: u32, )58 pub fn initialize( 59 &self, 60 _func_ref: *const VMFuncRef, 61 _caller_vmctx: *mut VMContext, 62 _args: *mut VMHostArray<ValRaw>, 63 _parameter_count: u32, 64 _return_value_count: u32, 65 ) { 66 } 67 } 68