Force-set the VM stage to Validated for a loaded component without actually running validation. Only used in spec tests and will be removed when component-model is fully supported. Returns failure if no component is loaded.
| 149 | /// when component-model is fully supported. |
| 150 | /// Returns failure if no component is loaded. |
| 151 | Expect<void> forceValidateForComponent() { |
| 152 | std::unique_lock Lock(Mutex); |
| 153 | if (Stage < VMStage::Loaded || !Comp) { |
| 154 | return Unexpect(ErrCode::Value::WrongVMWorkflow); |
| 155 | } |
| 156 | Comp->setIsValidated(); |
| 157 | Stage = VMStage::Validated; |
| 158 | return {}; |
| 159 | } |
| 160 | |
| 161 | /// ======= Functions can be called after the validated stage. ======= |
| 162 | /// Instantiate validated wasm module. |