(&mut self, bytes: &[u8])
| 551 | } |
| 552 | |
| 553 | fn compile(&mut self, bytes: &[u8]) -> Result<()> { |
| 554 | self.module = None; |
| 555 | self.component = None; |
| 556 | |
| 557 | let mut builder = CodeBuilder::new(self.linker.engine()); |
| 558 | builder.wasm_binary(bytes, None)?; |
| 559 | |
| 560 | match builder.hint() { |
| 561 | Some(CodeHint::Component) => { |
| 562 | (self.compilation_start)(self.compilation_timer); |
| 563 | let component = builder.compile_component()?; |
| 564 | (self.compilation_end)(self.compilation_timer); |
| 565 | self.component = Some(component); |
| 566 | } |
| 567 | Some(CodeHint::Module) | None => { |
| 568 | (self.compilation_start)(self.compilation_timer); |
| 569 | let module = builder.compile_module()?; |
| 570 | (self.compilation_end)(self.compilation_timer); |
| 571 | self.module = Some(module); |
| 572 | } |
| 573 | } |
| 574 | |
| 575 | Ok(()) |
| 576 | } |
| 577 | |
| 578 | fn instantiate(&mut self) -> Result<()> { |
| 579 | self.store_and_instance = None; |
no test coverage detected