Index: src/runtime/runtime-wasm.cc |
diff --git a/src/runtime/runtime-wasm.cc b/src/runtime/runtime-wasm.cc |
index c883fb7e1a94fee7c4c064a8e1e64bd4e270e6bd..b55acf1b33fd70e8c23a1a4035682296288282c3 100644 |
--- a/src/runtime/runtime-wasm.cc |
+++ b/src/runtime/runtime-wasm.cc |
@@ -152,11 +152,18 @@ RUNTIME_FUNCTION(Runtime_JITSingleFunction) { |
Handle<JSArrayBuffer> mem_buffer = Handle<JSArrayBuffer>::cast(obj); |
- wasm::WasmModule module(reinterpret_cast<byte*>(mem_buffer->backing_store())); |
wasm::ErrorThrower thrower(isolate, "JITSingleFunction"); |
+ wasm::WasmModule module(reinterpret_cast<byte*>(mem_buffer->backing_store())); |
+ wasm::WasmModuleInstance instance(&module); |
+ instance.context = isolate->native_context(); |
+ instance.mem_size = |
+ static_cast<uint32_t>(mem_buffer->byte_length()->Number()); |
+ instance.mem_start = reinterpret_cast<byte*>(mem_buffer->backing_store()); |
+ instance.globals_start = nullptr; |
+ |
wasm::ModuleEnv module_env; |
module_env.module = &module; |
- module_env.instance = nullptr; |
+ module_env.instance = &instance; |
module_env.origin = wasm::kWasmOrigin; |
uint32_t signature_size = args.length() - fixed_args; |