Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1255)

Unified Diff: src/wasm/wasm-module.h

Issue 2731523005: [wasm] Lazy compilation for asm.js (Closed)
Patch Set: [wasm] Lazy compilation for asm.js Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wasm/wasm-code-specialization.cc ('k') | src/wasm/wasm-module.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « src/wasm/wasm-code-specialization.cc ('k') | src/wasm/wasm-module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698