Index: src/wasm/wasm-module.h |
diff --git a/src/wasm/wasm-module.h b/src/wasm/wasm-module.h |
index 67fff1d2007163d864a7d47936714460aec43cd6..384287e0b68ff2aef52c6f947652ad15e50d1a0f 100644 |
--- a/src/wasm/wasm-module.h |
+++ b/src/wasm/wasm-module.h |
@@ -271,11 +271,30 @@ struct V8_EXPORT_PRIVATE ModuleWireBytes { |
// minimal information about the globals, functions, and function tables. |
struct V8_EXPORT_PRIVATE ModuleEnv { |
ModuleEnv(const WasmModule* module, WasmInstance* instance) |
- : module(module), instance(instance) {} |
+ : module(module), instance(instance) { |
+ if (instance) { |
+ function_tables = &instance->function_tables; |
+ signature_tables = &instance->signature_tables; |
+ } |
+ } |
const WasmModule* module; |
WasmInstance* instance; |
+ // TODO(clemensh): Find a better solution for this. |
+ std::vector<Handle<FixedArray>>* function_tables = nullptr; |
+ std::vector<Handle<FixedArray>>* signature_tables = nullptr; |
+ bool used_indirect_tables = false; |
+ |
+ Handle<FixedArray> GetFunctionTableObj(size_t index) { |
+ used_indirect_tables = true; |
+ return (*function_tables)[index]; |
+ } |
+ Handle<FixedArray> GetSignatureTableObj(size_t index) { |
+ used_indirect_tables = true; |
+ return (*signature_tables)[index]; |
+ } |
+ |
bool IsValidGlobal(uint32_t index) const { |
return module && index < module->globals.size(); |
} |
@@ -443,6 +462,8 @@ V8_EXPORT_PRIVATE void AsyncCompileAndInstantiate( |
Isolate* isolate, Handle<JSPromise> promise, const ModuleWireBytes& bytes, |
MaybeHandle<JSReceiver> imports); |
+Handle<Code> CompileLazy(Isolate* isolate); |
+ |
namespace testing { |
void ValidateInstancesChain(Isolate* isolate, |
Handle<WasmModuleObject> module_obj, |