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

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

Issue 1742073002: [wasm] Properly plumb the origin of the WASM module from asm.js translation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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-js.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 a05dd393bc412bcf7c36a94bd26d6de856d85b64..90d0fcca820fa25f1129b14c54d262cb78c8e6e0 100644
--- a/src/wasm/wasm-module.h
+++ b/src/wasm/wasm-module.h
@@ -97,6 +97,8 @@ struct WasmDataSegment {
bool init; // true if loaded upon instantiation.
};
+enum ModuleOrigin { kWasmOrigin, kAsmJsOrigin };
+
// Static representation of a module.
struct WasmModule {
static const uint8_t kMinMemSize = 12; // Minimum memory size = 4kb
@@ -110,6 +112,7 @@ struct WasmModule {
bool mem_export; // true if the memory is exported.
bool mem_external; // true if the memory is external.
int start_function_index; // start function, if any.
+ ModuleOrigin origin; // origin of the module
std::vector<WasmGlobal>* globals; // globals in this module.
std::vector<FunctionSig*>* signatures; // signatures in this module.
@@ -176,7 +179,7 @@ struct ModuleEnv {
WasmModule* module;
WasmModuleInstance* instance;
WasmLinker* linker;
- bool asm_js; // true if the module originated from asm.js.
+ ModuleOrigin origin;
bool IsValidGlobal(uint32_t index) {
return module && index < module->globals->size();
@@ -211,6 +214,8 @@ struct ModuleEnv {
: 0;
}
+ bool asm_js() { return origin == kAsmJsOrigin; }
+
Handle<Code> GetFunctionCode(uint32_t index);
Handle<Code> GetImportCode(uint32_t index);
Handle<FixedArray> GetFunctionTable();
« no previous file with comments | « src/wasm/wasm-js.cc ('k') | src/wasm/wasm-module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698