Creates a new interpreter ready to interpret code.
(engine: &Engine)
| 59 | impl Interpreter { |
| 60 | /// Creates a new interpreter ready to interpret code. |
| 61 | pub fn new(engine: &Engine) -> Result<Interpreter, OutOfMemory> { |
| 62 | let ret = Interpreter { |
| 63 | pulley: StoreBox::new(VmState { |
| 64 | vm: Vm::with_stack(engine.config().max_wasm_stack)?, |
| 65 | resume_at_pc: None, |
| 66 | })?, |
| 67 | }; |
| 68 | engine.profiler().register_interpreter(&ret); |
| 69 | Ok(ret) |
| 70 | } |
| 71 | |
| 72 | /// Returns the `InterpreterRef` structure which can be used to actually |
| 73 | /// execute interpreted code. |
nothing calls this directly
no test coverage detected