| 64 | } |
| 65 | |
| 66 | fn evaluate( |
| 67 | &mut self, |
| 68 | function_name: &str, |
| 69 | arguments: &[DiffValue], |
| 70 | _results: &[DiffValueType], |
| 71 | ) -> Result<Option<Vec<DiffValue>>> { |
| 72 | let arguments = arguments.iter().map(SpecValue::from).collect(); |
| 73 | match wasm_spec_interpreter::interpret(&self.instance, function_name, Some(arguments)) { |
| 74 | Ok(results) => Ok(Some(results.into_iter().map(SpecValue::into).collect())), |
| 75 | Err(err) => Err(format_err!(err)), |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | fn get_global(&mut self, name: &str, _ty: DiffValueType) -> Option<DiffValue> { |
| 80 | use wasm_spec_interpreter::{SpecExport::Global, export}; |