diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/asm2wasm.h | 2 | ||||
-rw-r--r-- | src/wasm-binary.h | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h index 05f3a2c0c..c852885f8 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -761,6 +761,7 @@ void Asm2WasmBuilder::processAsm(Ref ast) { wasm.memory.exportName = MEMORY; +#if 0 // enable asm2wasm i64 optimizations when browsers have consistent i64 support in wasm if (udivmoddi4.is() && getTempRet0.is()) { // generate a wasm-optimized __udivmoddi4 method, which we can do much more efficiently in wasm // we can only do this if we know getTempRet0 as well since we use it to figure out which minified global is tempRet0 @@ -856,6 +857,7 @@ void Asm2WasmBuilder::processAsm(Ref ast) { ); func->body = body; } +#endif } Function* Asm2WasmBuilder::processFunction(Ref ast) { diff --git a/src/wasm-binary.h b/src/wasm-binary.h index 0630c0234..8fed9f6d9 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -215,6 +215,11 @@ public: namespace BinaryConsts { +enum Meta { + Magic = 0x6d736100, + Version = 11 +}; + namespace Section { auto Memory = "memory"; auto Signatures = "type"; @@ -477,8 +482,8 @@ public: void writeHeader() { if (debug) std::cerr << "== writeHeader" << std::endl; - o << int32_t(0x6d736100); // magic number \0asm - o << int32_t(10); // version number + o << int32_t(BinaryConsts::Magic); // magic number \0asm + o << int32_t(BinaryConsts::Version); } int32_t writeU32LEBPlaceholder() { @@ -1325,8 +1330,8 @@ public: void readHeader() { if (debug) std::cerr << "== readHeader" << std::endl; - verifyInt32(0x6d736100); - verifyInt32(10); + verifyInt32(BinaryConsts::Magic); + verifyInt32(BinaryConsts::Version); } void readStart() { |