Index: src/wasm/wasm-module.cc |
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc |
index 7a276dfc94e0597c0b6922d2291d7ac00520c0a2..ec881d19f17e7355e5da00c81680d0418bd59629 100644 |
--- a/src/wasm/wasm-module.cc |
+++ b/src/wasm/wasm-module.cc |
@@ -1640,6 +1640,25 @@ Handle<JSObject> CreateCompiledModuleObject( |
return module_obj; |
} |
+MaybeHandle<JSObject> CreateModuleObjectFromBytes( |
+ Isolate* isolate, const byte* start, const byte* end, ErrorThrower* thrower, |
+ bool verify, ModuleOrigin origin) { |
+ MaybeHandle<JSObject> nothing; |
+ Zone zone(isolate->allocator()); |
+ ModuleResult result = |
+ DecodeWasmModule(isolate, &zone, start, end, verify, origin); |
+ std::unique_ptr<const WasmModule> decoded_module(result.val); |
+ if (result.failed()) { |
+ thrower->Failed("Wasm decoding failed", result); |
+ return nothing; |
+ } |
+ MaybeHandle<FixedArray> compiled_module = |
+ decoded_module->CompileFunctions(isolate, thrower); |
+ if (compiled_module.is_null()) return nothing; |
+ |
+ return CreateCompiledModuleObject(isolate, compiled_module.ToHandleChecked()); |
+} |
+ |
namespace testing { |
int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start, |