From e70981caae2ed0f6ce9cd2f2d80bc0a8e0ae30a9 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 12 Mar 2016 20:17:26 -0800 Subject: de-recurse binary block reading --- src/wasm-binary.h | 57 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 13 deletions(-) (limited to 'src/wasm-binary.h') diff --git a/src/wasm-binary.h b/src/wasm-binary.h index 715c06287..f772be353 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -522,7 +522,7 @@ public: o << int8_t(BinaryConsts::EndMarker); assert(depth == 0); size_t size = o.size() - start; - assert(size <= std::numeric_limits::max()); + assert(size <= std::numeric_limits::max()); if (debug) std::cerr << "body size: " << size << ", writing at " << sizePos << ", next starts at " << o.size() << std::endl; o.writeAt(sizePos, uint32_t(size)); // XXX int32, diverge from v8 format, to get more code to compile } else { @@ -1079,6 +1079,12 @@ public: assert(x == y); } + void ungetInt8() { + assert(pos > 0); + if (debug) std::cerr << "ungetInt8 (at " << pos << ")" << std::endl; + pos--; + } + void readStart() { if (debug) std::cerr << "== readStart" << std::endl; wasm.start = getString(); @@ -1335,19 +1341,44 @@ public: void visitBlock(Block *curr) { if (debug) std::cerr << "zz node: Block" << std::endl; - curr->name = getNextLabel(); - breakStack.push_back(curr->name); - size_t start = expressionStack.size(); // everything after this, that is left when we see the marker, is ours - processExpressions(); - size_t end = expressionStack.size(); - assert(end >= start); - for (size_t i = start; i < end; i++) { - if (debug) std::cerr << " " << size_t(expressionStack[i]) << "\n zz Block element " << curr->list.size() << std::endl; - curr->list.push_back(expressionStack[i]); + // special-case Block and de-recurse nested blocks in their first position, as that is + // a common pattern that can be very highly nested. + std::vector stack; + while (1) { + curr->name = getNextLabel(); + breakStack.push_back(curr->name); + stack.push_back(curr); + if (getInt8() == BinaryConsts::Block) { + // a recursion + curr = allocator.alloc(); + continue; + } else { + // end of recursion + ungetInt8(); + break; + } + } + Block* last = nullptr; + while (stack.size() > 0) { + curr = stack.back(); + stack.pop_back(); + size_t start = expressionStack.size(); // everything after this, that is left when we see the marker, is ours + if (last) { + // the previous block is our first-position element + expressionStack.push_back(last); + } + last = curr; + processExpressions(); + size_t end = expressionStack.size(); + assert(end >= start); + for (size_t i = start; i < end; i++) { + if (debug) std::cerr << " " << size_t(expressionStack[i]) << "\n zz Block element " << curr->list.size() << std::endl; + curr->list.push_back(expressionStack[i]); + } + expressionStack.resize(start); + curr->finalize(); + breakStack.pop_back(); } - expressionStack.resize(start); - curr->finalize(); - breakStack.pop_back(); } void visitIf(If *curr, uint8_t code) { if (debug) std::cerr << "zz node: If" << std::endl; -- cgit v1.2.3 From f41c310f8da01d082e776112a643d6483757999f Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sun, 13 Mar 2016 17:15:12 -0700 Subject: use a 32-bit int for break offsets, as it is necessary (e.g. for bigswitch.cpp) --- bin/wasm.js | 62 +++++++++++++++++++++++++++---------------------------- check.py | 22 ++++++++++++++------ src/wasm-binary.h | 16 +++++++------- 3 files changed, 55 insertions(+), 45 deletions(-) (limited to 'src/wasm-binary.h') diff --git a/bin/wasm.js b/bin/wasm.js index 8ae44a3dc..45a2264b3 100644 --- a/bin/wasm.js +++ b/bin/wasm.js @@ -55575,7 +55575,7 @@ function __ZN4wasm17WasmBinaryBuilder11visitSwitchEPNS_6SwitchE(i11, i10) { i5 = i10 + 8 | 0; i7 = 0; while (1) { - i1 = __ZN4wasm17WasmBinaryBuilder12getBreakNameEi(i11, (__ZN4wasm17WasmBinaryBuilder8getInt16Ev(i11) | 0) & 65535) | 0; + i1 = __ZN4wasm17WasmBinaryBuilder12getBreakNameEi(i11, __ZN4wasm17WasmBinaryBuilder8getInt32Ev(i11) | 0) | 0; if ((i7 | 0) >= (i2 | 0)) break; HEAP32[i8 >> 2] = i1; i6 = HEAP32[i3 >> 2] | 0; @@ -62469,36 +62469,6 @@ function __ZNSt3__16vectorIN4wasm8NameTypeENS_9allocatorIS2_EEE24__emplace_back_ return; } -function __ZN4wasm17WasmBinaryBuilder10visitBreakEPNS_5BreakEh(i4, i3, i2) { - i4 = i4 | 0; - i3 = i3 | 0; - i2 = i2 | 0; - var i1 = 0, i5 = 0, i6 = 0, i7 = 0; - i5 = STACKTOP; - STACKTOP = STACKTOP + 16 | 0; - i1 = i5; - if (HEAP8[i4 + 12 >> 0] | 0) { - i6 = __ZNSt3__1lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(43432, 18483) | 0; - i7 = __ZNKSt3__18ios_base6getlocEv(i6 + (HEAP32[(HEAP32[i6 >> 2] | 0) + -12 >> 2] | 0) | 0) | 0; - HEAP32[i1 >> 2] = i7; - i7 = __ZNKSt3__16locale9use_facetERNS0_2idE(i1, 44308) | 0; - i7 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[i7 >> 2] | 0) + 28 >> 2] & 31](i7, 10) | 0; - __ZNSt3__16localeD2Ev(i1); - __ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc(i6, i7) | 0; - __ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv(i6) | 0; - } - i7 = __ZN4wasm17WasmBinaryBuilder12getBreakNameEi(i4, (__ZN4wasm17WasmBinaryBuilder7getInt8Ev(i4) | 0) & 255) | 0; - HEAP32[i3 + 8 >> 2] = i7; - if (i2 << 24 >> 24 == 7) { - i7 = __ZN4wasm17WasmBinaryBuilder13popExpressionEv(i4) | 0; - HEAP32[i3 + 16 >> 2] = i7; - } - i7 = __ZN4wasm17WasmBinaryBuilder13popExpressionEv(i4) | 0; - HEAP32[i3 + 12 >> 2] = i7; - STACKTOP = i5; - return; -} - function ___cxx_global_array_dtor(i1) { i1 = i1 | 0; __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(44536); @@ -62615,6 +62585,36 @@ function __ZNSt3__16vectorIN4wasm8NameTypeENS_9allocatorIS2_EEE24__emplace_back_ return; } +function __ZN4wasm17WasmBinaryBuilder10visitBreakEPNS_5BreakEh(i4, i3, i2) { + i4 = i4 | 0; + i3 = i3 | 0; + i2 = i2 | 0; + var i1 = 0, i5 = 0, i6 = 0, i7 = 0; + i5 = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + i1 = i5; + if (HEAP8[i4 + 12 >> 0] | 0) { + i6 = __ZNSt3__1lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(43432, 18483) | 0; + i7 = __ZNKSt3__18ios_base6getlocEv(i6 + (HEAP32[(HEAP32[i6 >> 2] | 0) + -12 >> 2] | 0) | 0) | 0; + HEAP32[i1 >> 2] = i7; + i7 = __ZNKSt3__16locale9use_facetERNS0_2idE(i1, 44308) | 0; + i7 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[i7 >> 2] | 0) + 28 >> 2] & 31](i7, 10) | 0; + __ZNSt3__16localeD2Ev(i1); + __ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc(i6, i7) | 0; + __ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv(i6) | 0; + } + i7 = __ZN4wasm17WasmBinaryBuilder12getBreakNameEi(i4, __ZN4wasm17WasmBinaryBuilder8getInt32Ev(i4) | 0) | 0; + HEAP32[i3 + 8 >> 2] = i7; + if (i2 << 24 >> 24 == 7) { + i7 = __ZN4wasm17WasmBinaryBuilder13popExpressionEv(i4) | 0; + HEAP32[i3 + 16 >> 2] = i7; + } + i7 = __ZN4wasm17WasmBinaryBuilder13popExpressionEv(i4) | 0; + HEAP32[i3 + 12 >> 2] = i7; + STACKTOP = i5; + return; +} + function __ZNSt3__113unordered_mapIN6cashew7IStringEN7AsmData5LocalENS_4hashIS2_EENS_8equal_toIS2_EENS_9allocatorINS_4pairIKS2_S4_EEEEEixERSB_(i5, i4) { i5 = i5 | 0; i4 = i4 | 0; diff --git a/check.py b/check.py index e42bae2a4..34f3f4e4c 100755 --- a/check.py +++ b/check.py @@ -672,12 +672,22 @@ if has_emcc: except: args = [] print ' (no args)' - if has_node: - proc = subprocess.Popen([has_node, 'a.' + which + '.js'] + args, stdout=subprocess.PIPE) - out, err = proc.communicate() - assert proc.returncode == 0 - if out.strip() != expected.strip(): - fail(out, expected) + + def execute(): + if has_node: + proc = subprocess.Popen([has_node, 'a.' + which + '.js'] + args, stdout=subprocess.PIPE) + out, err = proc.communicate() + assert proc.returncode == 0 + if out.strip() != expected.strip(): + fail(out, expected) + + execute() + + # binary and back + shutil.copyfile('a.wasm.wast', 'a.wasm.original.wast') + recreated = binary_format_check('a.wasm.wast', verify_final_result=False) + shutil.copyfile(recreated, 'a.wasm.wast') + execute() print '\n[ success! ]' diff --git a/src/wasm-binary.h b/src/wasm-binary.h index f772be353..5d25323de 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -650,7 +650,7 @@ public: o << int8_t(BinaryConsts::EndMarker); } - int getBreakIndex(Name name) { // -1 if not found + int32_t getBreakIndex(Name name) { // -1 if not found for (int i = breakStack.size() - 1; i >= 0; i--) { if (breakStack[i] == name) { return breakStack.size() - 1 - i; @@ -669,15 +669,15 @@ public: } if (curr->condition) recurse(curr->condition); o << int8_t(curr->condition ? BinaryConsts::BrIf : BinaryConsts::Br) - << int8_t(getBreakIndex(curr->name)); + << int32_t(getBreakIndex(curr->name)); } void visitSwitch(Switch *curr) { if (debug) std::cerr << "zz node: Switch" << std::endl; o << int8_t(BinaryConsts::TableSwitch) << int16_t(curr->targets.size() + 1) << int8_t(curr->value != nullptr); for (auto target : curr->targets) { - o << (int16_t)getBreakIndex(target); + o << (int32_t)getBreakIndex(target); } - o << (int16_t)getBreakIndex(curr->default_); + o << (int32_t)getBreakIndex(curr->default_); recurse(curr->condition); o << int8_t(BinaryConsts::EndMarker); if (curr->value) { @@ -1405,14 +1405,14 @@ public: curr->finalize(); } - Name getBreakName(int offset) { + Name getBreakName(int32_t offset) { assert(breakStack.size() - 1 - offset < breakStack.size()); return breakStack[breakStack.size() - 1 - offset]; } void visitBreak(Break *curr, uint8_t code) { if (debug) std::cerr << "zz node: Break" << std::endl; - curr->name = getBreakName(getInt8()); + curr->name = getBreakName(getInt32()); if (code == BinaryConsts::BrIf) curr->condition = popExpression(); curr->value = popExpression(); } @@ -1421,9 +1421,9 @@ public: auto numTargets = getInt16(); auto hasValue = getInt8(); for (auto i = 0; i < numTargets - 1; i++) { - curr->targets.push_back(getBreakName(getInt16())); + curr->targets.push_back(getBreakName(getInt32())); } - curr->default_ = getBreakName(getInt16()); + curr->default_ = getBreakName(getInt32()); processExpressions(); curr->condition = popExpression(); if (hasValue) { -- cgit v1.2.3 From 8de76ffa8588a72788f3967806df43d4d4e43453 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sun, 13 Mar 2016 21:10:04 -0700 Subject: add two missing finalize() calls in wasm-binary --- bin/wasm.js | 628 +++++++++++++++++++++++++++--------------------------- src/wasm-binary.h | 2 + 2 files changed, 318 insertions(+), 312 deletions(-) (limited to 'src/wasm-binary.h') diff --git a/bin/wasm.js b/bin/wasm.js index 45a2264b3..6e051a45b 100644 --- a/bin/wasm.js +++ b/bin/wasm.js @@ -31351,239 +31351,6 @@ function __ZNSt3__112__next_primeEj(i5) { return i1 | 0; } -function __ZN10__cxxabiv112_GLOBAL__N_121parse_unresolved_typeINS0_2DbEEEPKcS4_S4_RT_(i6, i2, i12) { - i6 = i6 | 0; - i2 = i2 | 0; - i12 = i12 | 0; - var i1 = 0, i3 = 0, i4 = 0, i5 = 0, i7 = 0, i8 = 0, i9 = 0, i10 = 0, i11 = 0, i13 = 0; - i13 = STACKTOP; - STACKTOP = STACKTOP + 96 | 0; - i11 = i13 + 72 | 0; - i10 = i13 + 56 | 0; - i7 = i13 + 48 | 0; - i8 = i13 + 32 | 0; - i3 = i13 + 24 | 0; - i9 = i13 + 8 | 0; - i4 = i13; - L1 : do if ((i6 | 0) == (i2 | 0)) i1 = i6; else switch (HEAP8[i6 >> 0] | 0) { - case 84: - { - i5 = i12 + 4 | 0; - i4 = ((HEAP32[i5 >> 2] | 0) - (HEAP32[i12 >> 2] | 0) | 0) / 24 | 0; - i1 = __ZN10__cxxabiv112_GLOBAL__N_120parse_template_paramINS0_2DbEEEPKcS4_S4_RT_(i6, i2, i12) | 0; - i2 = HEAP32[i5 >> 2] | 0; - i3 = (i2 - (HEAP32[i12 >> 2] | 0) | 0) / 24 | 0; - if (!((i1 | 0) != (i6 | 0) & (i3 | 0) == (i4 + 1 | 0))) { - i1 = i2; - while (1) { - if ((i3 | 0) == (i4 | 0)) { - i1 = i6; - break L1; - } - i2 = i1 + -24 | 0; - while (1) { - if ((i1 | 0) == (i2 | 0)) break; - i12 = i1 + -24 | 0; - HEAP32[i5 >> 2] = i12; - __ZN10__cxxabiv112_GLOBAL__N_111string_pairD2Ev(i12); - i1 = HEAP32[i5 >> 2] | 0; - } - i1 = i2; - i3 = i3 + -1 | 0; - } - } - i6 = i12 + 16 | 0; - HEAP32[i7 >> 2] = HEAP32[i12 + 12 >> 2]; - __ZNSt3__16vectorIN10__cxxabiv112_GLOBAL__N_111string_pairENS2_11short_allocIS3_Lj4096EEEEC2EjRKS3_RKS5_(i10, i2 + -24 | 0, i7); - i2 = i12 + 20 | 0; - i3 = HEAP32[i2 >> 2] | 0; - i9 = HEAP32[i12 + 24 >> 2] | 0; - i4 = i9; - if (i3 >>> 0 < i9 >>> 0) { - HEAP32[i3 + 12 >> 2] = HEAP32[i10 + 12 >> 2]; - HEAP32[i3 >> 2] = HEAP32[i10 >> 2]; - i12 = i10 + 4 | 0; - HEAP32[i3 + 4 >> 2] = HEAP32[i12 >> 2]; - i11 = i10 + 8 | 0; - HEAP32[i3 + 8 >> 2] = HEAP32[i11 >> 2]; - HEAP32[i11 >> 2] = 0; - HEAP32[i12 >> 2] = 0; - HEAP32[i10 >> 2] = 0; - HEAP32[i2 >> 2] = (HEAP32[i2 >> 2] | 0) + 16; - } else { - i2 = HEAP32[i6 >> 2] | 0; - i9 = i3 - i2 | 0; - i5 = i9 >> 4; - i3 = i5 + 1 | 0; - if ((i9 | 0) < -16) __ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv(i6); - i2 = i4 - i2 | 0; - if (i2 >> 4 >>> 0 < 1073741823) { - i2 = i2 >> 3; - i2 = i2 >>> 0 < i3 >>> 0 ? i3 : i2; - } else i2 = 2147483647; - __ZNSt3__114__split_bufferINS_6vectorIN10__cxxabiv112_GLOBAL__N_111string_pairENS3_11short_allocIS4_Lj4096EEEEERNS5_IS7_Lj4096EEEEC2EjjS9_(i11, i2, i5, i12 + 28 | 0); - i12 = i11 + 8 | 0; - i9 = HEAP32[i12 >> 2] | 0; - HEAP32[i9 + 12 >> 2] = HEAP32[i10 + 12 >> 2]; - HEAP32[i9 >> 2] = HEAP32[i10 >> 2]; - i8 = i10 + 4 | 0; - HEAP32[i9 + 4 >> 2] = HEAP32[i8 >> 2]; - i7 = i10 + 8 | 0; - HEAP32[i9 + 8 >> 2] = HEAP32[i7 >> 2]; - HEAP32[i7 >> 2] = 0; - HEAP32[i8 >> 2] = 0; - HEAP32[i10 >> 2] = 0; - HEAP32[i12 >> 2] = i9 + 16; - __ZNSt3__16vectorINS0_IN10__cxxabiv112_GLOBAL__N_111string_pairENS2_11short_allocIS3_Lj4096EEEEENS4_IS6_Lj4096EEEE26__swap_out_circular_bufferERNS_14__split_bufferIS6_RS7_EE(i6, i11); - __ZNSt3__114__split_bufferINS_6vectorIN10__cxxabiv112_GLOBAL__N_111string_pairENS3_11short_allocIS4_Lj4096EEEEERNS5_IS7_Lj4096EEEED2Ev(i11); - } - __ZNSt3__113__vector_baseIN10__cxxabiv112_GLOBAL__N_111string_pairENS2_11short_allocIS3_Lj4096EEEED2Ev(i10); - break L1; - } - case 68: - { - i1 = __ZN10__cxxabiv112_GLOBAL__N_114parse_decltypeINS0_2DbEEEPKcS4_S4_RT_(i6, i2, i12) | 0; - if ((i1 | 0) == (i6 | 0)) { - i1 = i6; - break L1; - } - i2 = HEAP32[i12 + 4 >> 2] | 0; - if ((HEAP32[i12 >> 2] | 0) == (i2 | 0)) { - i1 = i6; - break L1; - } - i6 = i12 + 16 | 0; - HEAP32[i3 >> 2] = HEAP32[i12 + 12 >> 2]; - __ZNSt3__16vectorIN10__cxxabiv112_GLOBAL__N_111string_pairENS2_11short_allocIS3_Lj4096EEEEC2EjRKS3_RKS5_(i8, i2 + -24 | 0, i3); - i2 = i12 + 20 | 0; - i3 = HEAP32[i2 >> 2] | 0; - i10 = HEAP32[i12 + 24 >> 2] | 0; - i5 = i10; - if (i3 >>> 0 < i10 >>> 0) { - HEAP32[i3 + 12 >> 2] = HEAP32[i8 + 12 >> 2]; - HEAP32[i3 >> 2] = HEAP32[i8 >> 2]; - i12 = i8 + 4 | 0; - HEAP32[i3 + 4 >> 2] = HEAP32[i12 >> 2]; - i11 = i8 + 8 | 0; - HEAP32[i3 + 8 >> 2] = HEAP32[i11 >> 2]; - HEAP32[i11 >> 2] = 0; - HEAP32[i12 >> 2] = 0; - HEAP32[i8 >> 2] = 0; - HEAP32[i2 >> 2] = (HEAP32[i2 >> 2] | 0) + 16; - } else { - i2 = HEAP32[i6 >> 2] | 0; - i10 = i3 - i2 | 0; - i4 = i10 >> 4; - i3 = i4 + 1 | 0; - if ((i10 | 0) < -16) __ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv(i6); - i2 = i5 - i2 | 0; - if (i2 >> 4 >>> 0 < 1073741823) { - i2 = i2 >> 3; - i2 = i2 >>> 0 < i3 >>> 0 ? i3 : i2; - } else i2 = 2147483647; - __ZNSt3__114__split_bufferINS_6vectorIN10__cxxabiv112_GLOBAL__N_111string_pairENS3_11short_allocIS4_Lj4096EEEEERNS5_IS7_Lj4096EEEEC2EjjS9_(i11, i2, i4, i12 + 28 | 0); - i12 = i11 + 8 | 0; - i10 = HEAP32[i12 >> 2] | 0; - HEAP32[i10 + 12 >> 2] = HEAP32[i8 + 12 >> 2]; - HEAP32[i10 >> 2] = HEAP32[i8 >> 2]; - i9 = i8 + 4 | 0; - HEAP32[i10 + 4 >> 2] = HEAP32[i9 >> 2]; - i7 = i8 + 8 | 0; - HEAP32[i10 + 8 >> 2] = HEAP32[i7 >> 2]; - HEAP32[i7 >> 2] = 0; - HEAP32[i9 >> 2] = 0; - HEAP32[i8 >> 2] = 0; - HEAP32[i12 >> 2] = i10 + 16; - __ZNSt3__16vectorINS0_IN10__cxxabiv112_GLOBAL__N_111string_pairENS2_11short_allocIS3_Lj4096EEEEENS4_IS6_Lj4096EEEE26__swap_out_circular_bufferERNS_14__split_bufferIS6_RS7_EE(i6, i11); - __ZNSt3__114__split_bufferINS_6vectorIN10__cxxabiv112_GLOBAL__N_111string_pairENS3_11short_allocIS4_Lj4096EEEEERNS5_IS7_Lj4096EEEED2Ev(i11); - } - __ZNSt3__113__vector_baseIN10__cxxabiv112_GLOBAL__N_111string_pairENS2_11short_allocIS3_Lj4096EEEED2Ev(i8); - break L1; - } - case 83: - { - i1 = __ZN10__cxxabiv112_GLOBAL__N_118parse_substitutionINS0_2DbEEEPKcS4_S4_RT_(i6, i2, i12) | 0; - if ((i1 | 0) != (i6 | 0)) break L1; - if ((i2 - i6 | 0) <= 2) { - i1 = i6; - break L1; - } - if ((HEAP8[i6 + 1 >> 0] | 0) != 116) { - i1 = i6; - break L1; - } - i10 = i6 + 2 | 0; - i1 = __ZN10__cxxabiv112_GLOBAL__N_122parse_unqualified_nameINS0_2DbEEEPKcS4_S4_RT_(i10, i2, i12) | 0; - if ((i1 | 0) == (i10 | 0)) { - i1 = i6; - break L1; - } - i3 = i12 + 4 | 0; - i2 = HEAP32[i3 >> 2] | 0; - if ((HEAP32[i12 >> 2] | 0) == (i2 | 0)) { - i1 = i6; - break L1; - } - __ZNSt3__112basic_stringIcNS_11char_traitsIcEEN10__cxxabiv112_GLOBAL__N_112malloc_allocIcEEE6insertEjPKc(i2 + -24 | 0, 0, 40696) | 0; - i6 = i12 + 16 | 0; - i2 = (HEAP32[i3 >> 2] | 0) + -24 | 0; - HEAP32[i4 >> 2] = HEAP32[i12 + 12 >> 2]; - __ZNSt3__16vectorIN10__cxxabiv112_GLOBAL__N_111string_pairENS2_11short_allocIS3_Lj4096EEEEC2EjRKS3_RKS5_(i9, i2, i4); - i2 = i12 + 20 | 0; - i3 = HEAP32[i2 >> 2] | 0; - i10 = HEAP32[i12 + 24 >> 2] | 0; - i4 = i10; - if (i3 >>> 0 < i10 >>> 0) { - HEAP32[i3 + 12 >> 2] = HEAP32[i9 + 12 >> 2]; - HEAP32[i3 >> 2] = HEAP32[i9 >> 2]; - i12 = i9 + 4 | 0; - HEAP32[i3 + 4 >> 2] = HEAP32[i12 >> 2]; - i11 = i9 + 8 | 0; - HEAP32[i3 + 8 >> 2] = HEAP32[i11 >> 2]; - HEAP32[i11 >> 2] = 0; - HEAP32[i12 >> 2] = 0; - HEAP32[i9 >> 2] = 0; - HEAP32[i2 >> 2] = (HEAP32[i2 >> 2] | 0) + 16; - } else { - i2 = HEAP32[i6 >> 2] | 0; - i10 = i3 - i2 | 0; - i5 = i10 >> 4; - i3 = i5 + 1 | 0; - if ((i10 | 0) < -16) __ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv(i6); - i2 = i4 - i2 | 0; - if (i2 >> 4 >>> 0 < 1073741823) { - i2 = i2 >> 3; - i2 = i2 >>> 0 < i3 >>> 0 ? i3 : i2; - } else i2 = 2147483647; - __ZNSt3__114__split_bufferINS_6vectorIN10__cxxabiv112_GLOBAL__N_111string_pairENS3_11short_allocIS4_Lj4096EEEEERNS5_IS7_Lj4096EEEEC2EjjS9_(i11, i2, i5, i12 + 28 | 0); - i12 = i11 + 8 | 0; - i10 = HEAP32[i12 >> 2] | 0; - HEAP32[i10 + 12 >> 2] = HEAP32[i9 + 12 >> 2]; - HEAP32[i10 >> 2] = HEAP32[i9 >> 2]; - i8 = i9 + 4 | 0; - HEAP32[i10 + 4 >> 2] = HEAP32[i8 >> 2]; - i7 = i9 + 8 | 0; - HEAP32[i10 + 8 >> 2] = HEAP32[i7 >> 2]; - HEAP32[i7 >> 2] = 0; - HEAP32[i8 >> 2] = 0; - HEAP32[i9 >> 2] = 0; - HEAP32[i12 >> 2] = i10 + 16; - __ZNSt3__16vectorINS0_IN10__cxxabiv112_GLOBAL__N_111string_pairENS2_11short_allocIS3_Lj4096EEEEENS4_IS6_Lj4096EEEE26__swap_out_circular_bufferERNS_14__split_bufferIS6_RS7_EE(i6, i11); - __ZNSt3__114__split_bufferINS_6vectorIN10__cxxabiv112_GLOBAL__N_111string_pairENS3_11short_allocIS4_Lj4096EEEEERNS5_IS7_Lj4096EEEED2Ev(i11); - } - __ZNSt3__113__vector_baseIN10__cxxabiv112_GLOBAL__N_111string_pairENS2_11short_allocIS3_Lj4096EEEED2Ev(i9); - break L1; - } - default: - { - i1 = i6; - break L1; - } - } while (0); - STACKTOP = i13; - return i1 | 0; -} - function __ZN4wasm17WasmBinaryBuilder14maybeVisitImplEPNS_6BinaryEh(i4, i3, i2) { i4 = i4 | 0; i3 = i3 | 0; @@ -32104,48 +31871,282 @@ function __ZN4wasm17WasmBinaryBuilder14maybeVisitImplEPNS_6BinaryEh(i4, i3, i2) i5 = 78; break; } - case 155: + case 155: + { + HEAP32[i3 + 8 >> 2] = 31; + HEAP32[i3 + 4 >> 2] = 4; + i5 = 78; + break; + } + case 136: + { + HEAP32[i3 + 8 >> 2] = 32; + HEAP32[i3 + 4 >> 2] = 3; + i5 = 78; + break; + } + case 156: + { + HEAP32[i3 + 8 >> 2] = 32; + HEAP32[i3 + 4 >> 2] = 4; + i5 = 78; + break; + } + default: + i1 = 0; + } while (0); + if ((i5 | 0) == 78) { + if (HEAP8[i4 + 12 >> 0] | 0) { + i5 = __ZNSt3__1lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(43432, 18781) | 0; + i2 = __ZNKSt3__18ios_base6getlocEv(i5 + (HEAP32[(HEAP32[i5 >> 2] | 0) + -12 >> 2] | 0) | 0) | 0; + HEAP32[i1 >> 2] = i2; + i2 = __ZNKSt3__16locale9use_facetERNS0_2idE(i1, 44308) | 0; + i2 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[i2 >> 2] | 0) + 28 >> 2] & 31](i2, 10) | 0; + __ZNSt3__16localeD2Ev(i1); + __ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc(i5, i2) | 0; + __ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv(i5) | 0; + } + i1 = __ZN4wasm17WasmBinaryBuilder13popExpressionEv(i4) | 0; + HEAP32[i3 + 16 >> 2] = i1; + i1 = __ZN4wasm17WasmBinaryBuilder13popExpressionEv(i4) | 0; + HEAP32[i3 + 12 >> 2] = i1; + __ZN4wasm6Binary8finalizeEv(i3); + i1 = 1; + } + STACKTOP = i6; + return i1 | 0; +} + +function __ZN10__cxxabiv112_GLOBAL__N_121parse_unresolved_typeINS0_2DbEEEPKcS4_S4_RT_(i6, i2, i12) { + i6 = i6 | 0; + i2 = i2 | 0; + i12 = i12 | 0; + var i1 = 0, i3 = 0, i4 = 0, i5 = 0, i7 = 0, i8 = 0, i9 = 0, i10 = 0, i11 = 0, i13 = 0; + i13 = STACKTOP; + STACKTOP = STACKTOP + 96 | 0; + i11 = i13 + 72 | 0; + i10 = i13 + 56 | 0; + i7 = i13 + 48 | 0; + i8 = i13 + 32 | 0; + i3 = i13 + 24 | 0; + i9 = i13 + 8 | 0; + i4 = i13; + L1 : do if ((i6 | 0) == (i2 | 0)) i1 = i6; else switch (HEAP8[i6 >> 0] | 0) { + case 84: + { + i5 = i12 + 4 | 0; + i4 = ((HEAP32[i5 >> 2] | 0) - (HEAP32[i12 >> 2] | 0) | 0) / 24 | 0; + i1 = __ZN10__cxxabiv112_GLOBAL__N_120parse_template_paramINS0_2DbEEEPKcS4_S4_RT_(i6, i2, i12) | 0; + i2 = HEAP32[i5 >> 2] | 0; + i3 = (i2 - (HEAP32[i12 >> 2] | 0) | 0) / 24 | 0; + if (!((i1 | 0) != (i6 | 0) & (i3 | 0) == (i4 + 1 | 0))) { + i1 = i2; + while (1) { + if ((i3 | 0) == (i4 | 0)) { + i1 = i6; + break L1; + } + i2 = i1 + -24 | 0; + while (1) { + if ((i1 | 0) == (i2 | 0)) break; + i12 = i1 + -24 | 0; + HEAP32[i5 >> 2] = i12; + __ZN10__cxxabiv112_GLOBAL__N_111string_pairD2Ev(i12); + i1 = HEAP32[i5 >> 2] | 0; + } + i1 = i2; + i3 = i3 + -1 | 0; + } + } + i6 = i12 + 16 | 0; + HEAP32[i7 >> 2] = HEAP32[i12 + 12 >> 2]; + __ZNSt3__16vectorIN10__cxxabiv112_GLOBAL__N_111string_pairENS2_11short_allocIS3_Lj4096EEEEC2EjRKS3_RKS5_(i10, i2 + -24 | 0, i7); + i2 = i12 + 20 | 0; + i3 = HEAP32[i2 >> 2] | 0; + i9 = HEAP32[i12 + 24 >> 2] | 0; + i4 = i9; + if (i3 >>> 0 < i9 >>> 0) { + HEAP32[i3 + 12 >> 2] = HEAP32[i10 + 12 >> 2]; + HEAP32[i3 >> 2] = HEAP32[i10 >> 2]; + i12 = i10 + 4 | 0; + HEAP32[i3 + 4 >> 2] = HEAP32[i12 >> 2]; + i11 = i10 + 8 | 0; + HEAP32[i3 + 8 >> 2] = HEAP32[i11 >> 2]; + HEAP32[i11 >> 2] = 0; + HEAP32[i12 >> 2] = 0; + HEAP32[i10 >> 2] = 0; + HEAP32[i2 >> 2] = (HEAP32[i2 >> 2] | 0) + 16; + } else { + i2 = HEAP32[i6 >> 2] | 0; + i9 = i3 - i2 | 0; + i5 = i9 >> 4; + i3 = i5 + 1 | 0; + if ((i9 | 0) < -16) __ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv(i6); + i2 = i4 - i2 | 0; + if (i2 >> 4 >>> 0 < 1073741823) { + i2 = i2 >> 3; + i2 = i2 >>> 0 < i3 >>> 0 ? i3 : i2; + } else i2 = 2147483647; + __ZNSt3__114__split_bufferINS_6vectorIN10__cxxabiv112_GLOBAL__N_111string_pairENS3_11short_allocIS4_Lj4096EEEEERNS5_IS7_Lj4096EEEEC2EjjS9_(i11, i2, i5, i12 + 28 | 0); + i12 = i11 + 8 | 0; + i9 = HEAP32[i12 >> 2] | 0; + HEAP32[i9 + 12 >> 2] = HEAP32[i10 + 12 >> 2]; + HEAP32[i9 >> 2] = HEAP32[i10 >> 2]; + i8 = i10 + 4 | 0; + HEAP32[i9 + 4 >> 2] = HEAP32[i8 >> 2]; + i7 = i10 + 8 | 0; + HEAP32[i9 + 8 >> 2] = HEAP32[i7 >> 2]; + HEAP32[i7 >> 2] = 0; + HEAP32[i8 >> 2] = 0; + HEAP32[i10 >> 2] = 0; + HEAP32[i12 >> 2] = i9 + 16; + __ZNSt3__16vectorINS0_IN10__cxxabiv112_GLOBAL__N_111string_pairENS2_11short_allocIS3_Lj4096EEEEENS4_IS6_Lj4096EEEE26__swap_out_circular_bufferERNS_14__split_bufferIS6_RS7_EE(i6, i11); + __ZNSt3__114__split_bufferINS_6vectorIN10__cxxabiv112_GLOBAL__N_111string_pairENS3_11short_allocIS4_Lj4096EEEEERNS5_IS7_Lj4096EEEED2Ev(i11); + } + __ZNSt3__113__vector_baseIN10__cxxabiv112_GLOBAL__N_111string_pairENS2_11short_allocIS3_Lj4096EEEED2Ev(i10); + break L1; + } + case 68: { - HEAP32[i3 + 8 >> 2] = 31; - HEAP32[i3 + 4 >> 2] = 4; - i5 = 78; - break; + i1 = __ZN10__cxxabiv112_GLOBAL__N_114parse_decltypeINS0_2DbEEEPKcS4_S4_RT_(i6, i2, i12) | 0; + if ((i1 | 0) == (i6 | 0)) { + i1 = i6; + break L1; + } + i2 = HEAP32[i12 + 4 >> 2] | 0; + if ((HEAP32[i12 >> 2] | 0) == (i2 | 0)) { + i1 = i6; + break L1; + } + i6 = i12 + 16 | 0; + HEAP32[i3 >> 2] = HEAP32[i12 + 12 >> 2]; + __ZNSt3__16vectorIN10__cxxabiv112_GLOBAL__N_111string_pairENS2_11short_allocIS3_Lj4096EEEEC2EjRKS3_RKS5_(i8, i2 + -24 | 0, i3); + i2 = i12 + 20 | 0; + i3 = HEAP32[i2 >> 2] | 0; + i10 = HEAP32[i12 + 24 >> 2] | 0; + i5 = i10; + if (i3 >>> 0 < i10 >>> 0) { + HEAP32[i3 + 12 >> 2] = HEAP32[i8 + 12 >> 2]; + HEAP32[i3 >> 2] = HEAP32[i8 >> 2]; + i12 = i8 + 4 | 0; + HEAP32[i3 + 4 >> 2] = HEAP32[i12 >> 2]; + i11 = i8 + 8 | 0; + HEAP32[i3 + 8 >> 2] = HEAP32[i11 >> 2]; + HEAP32[i11 >> 2] = 0; + HEAP32[i12 >> 2] = 0; + HEAP32[i8 >> 2] = 0; + HEAP32[i2 >> 2] = (HEAP32[i2 >> 2] | 0) + 16; + } else { + i2 = HEAP32[i6 >> 2] | 0; + i10 = i3 - i2 | 0; + i4 = i10 >> 4; + i3 = i4 + 1 | 0; + if ((i10 | 0) < -16) __ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv(i6); + i2 = i5 - i2 | 0; + if (i2 >> 4 >>> 0 < 1073741823) { + i2 = i2 >> 3; + i2 = i2 >>> 0 < i3 >>> 0 ? i3 : i2; + } else i2 = 2147483647; + __ZNSt3__114__split_bufferINS_6vectorIN10__cxxabiv112_GLOBAL__N_111string_pairENS3_11short_allocIS4_Lj4096EEEEERNS5_IS7_Lj4096EEEEC2EjjS9_(i11, i2, i4, i12 + 28 | 0); + i12 = i11 + 8 | 0; + i10 = HEAP32[i12 >> 2] | 0; + HEAP32[i10 + 12 >> 2] = HEAP32[i8 + 12 >> 2]; + HEAP32[i10 >> 2] = HEAP32[i8 >> 2]; + i9 = i8 + 4 | 0; + HEAP32[i10 + 4 >> 2] = HEAP32[i9 >> 2]; + i7 = i8 + 8 | 0; + HEAP32[i10 + 8 >> 2] = HEAP32[i7 >> 2]; + HEAP32[i7 >> 2] = 0; + HEAP32[i9 >> 2] = 0; + HEAP32[i8 >> 2] = 0; + HEAP32[i12 >> 2] = i10 + 16; + __ZNSt3__16vectorINS0_IN10__cxxabiv112_GLOBAL__N_111string_pairENS2_11short_allocIS3_Lj4096EEEEENS4_IS6_Lj4096EEEE26__swap_out_circular_bufferERNS_14__split_bufferIS6_RS7_EE(i6, i11); + __ZNSt3__114__split_bufferINS_6vectorIN10__cxxabiv112_GLOBAL__N_111string_pairENS3_11short_allocIS4_Lj4096EEEEERNS5_IS7_Lj4096EEEED2Ev(i11); + } + __ZNSt3__113__vector_baseIN10__cxxabiv112_GLOBAL__N_111string_pairENS2_11short_allocIS3_Lj4096EEEED2Ev(i8); + break L1; } - case 136: + case 83: { - HEAP32[i3 + 8 >> 2] = 32; - HEAP32[i3 + 4 >> 2] = 3; - i5 = 78; - break; + i1 = __ZN10__cxxabiv112_GLOBAL__N_118parse_substitutionINS0_2DbEEEPKcS4_S4_RT_(i6, i2, i12) | 0; + if ((i1 | 0) != (i6 | 0)) break L1; + if ((i2 - i6 | 0) <= 2) { + i1 = i6; + break L1; + } + if ((HEAP8[i6 + 1 >> 0] | 0) != 116) { + i1 = i6; + break L1; + } + i10 = i6 + 2 | 0; + i1 = __ZN10__cxxabiv112_GLOBAL__N_122parse_unqualified_nameINS0_2DbEEEPKcS4_S4_RT_(i10, i2, i12) | 0; + if ((i1 | 0) == (i10 | 0)) { + i1 = i6; + break L1; + } + i3 = i12 + 4 | 0; + i2 = HEAP32[i3 >> 2] | 0; + if ((HEAP32[i12 >> 2] | 0) == (i2 | 0)) { + i1 = i6; + break L1; + } + __ZNSt3__112basic_stringIcNS_11char_traitsIcEEN10__cxxabiv112_GLOBAL__N_112malloc_allocIcEEE6insertEjPKc(i2 + -24 | 0, 0, 40696) | 0; + i6 = i12 + 16 | 0; + i2 = (HEAP32[i3 >> 2] | 0) + -24 | 0; + HEAP32[i4 >> 2] = HEAP32[i12 + 12 >> 2]; + __ZNSt3__16vectorIN10__cxxabiv112_GLOBAL__N_111string_pairENS2_11short_allocIS3_Lj4096EEEEC2EjRKS3_RKS5_(i9, i2, i4); + i2 = i12 + 20 | 0; + i3 = HEAP32[i2 >> 2] | 0; + i10 = HEAP32[i12 + 24 >> 2] | 0; + i4 = i10; + if (i3 >>> 0 < i10 >>> 0) { + HEAP32[i3 + 12 >> 2] = HEAP32[i9 + 12 >> 2]; + HEAP32[i3 >> 2] = HEAP32[i9 >> 2]; + i12 = i9 + 4 | 0; + HEAP32[i3 + 4 >> 2] = HEAP32[i12 >> 2]; + i11 = i9 + 8 | 0; + HEAP32[i3 + 8 >> 2] = HEAP32[i11 >> 2]; + HEAP32[i11 >> 2] = 0; + HEAP32[i12 >> 2] = 0; + HEAP32[i9 >> 2] = 0; + HEAP32[i2 >> 2] = (HEAP32[i2 >> 2] | 0) + 16; + } else { + i2 = HEAP32[i6 >> 2] | 0; + i10 = i3 - i2 | 0; + i5 = i10 >> 4; + i3 = i5 + 1 | 0; + if ((i10 | 0) < -16) __ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv(i6); + i2 = i4 - i2 | 0; + if (i2 >> 4 >>> 0 < 1073741823) { + i2 = i2 >> 3; + i2 = i2 >>> 0 < i3 >>> 0 ? i3 : i2; + } else i2 = 2147483647; + __ZNSt3__114__split_bufferINS_6vectorIN10__cxxabiv112_GLOBAL__N_111string_pairENS3_11short_allocIS4_Lj4096EEEEERNS5_IS7_Lj4096EEEEC2EjjS9_(i11, i2, i5, i12 + 28 | 0); + i12 = i11 + 8 | 0; + i10 = HEAP32[i12 >> 2] | 0; + HEAP32[i10 + 12 >> 2] = HEAP32[i9 + 12 >> 2]; + HEAP32[i10 >> 2] = HEAP32[i9 >> 2]; + i8 = i9 + 4 | 0; + HEAP32[i10 + 4 >> 2] = HEAP32[i8 >> 2]; + i7 = i9 + 8 | 0; + HEAP32[i10 + 8 >> 2] = HEAP32[i7 >> 2]; + HEAP32[i7 >> 2] = 0; + HEAP32[i8 >> 2] = 0; + HEAP32[i9 >> 2] = 0; + HEAP32[i12 >> 2] = i10 + 16; + __ZNSt3__16vectorINS0_IN10__cxxabiv112_GLOBAL__N_111string_pairENS2_11short_allocIS3_Lj4096EEEEENS4_IS6_Lj4096EEEE26__swap_out_circular_bufferERNS_14__split_bufferIS6_RS7_EE(i6, i11); + __ZNSt3__114__split_bufferINS_6vectorIN10__cxxabiv112_GLOBAL__N_111string_pairENS3_11short_allocIS4_Lj4096EEEEERNS5_IS7_Lj4096EEEED2Ev(i11); + } + __ZNSt3__113__vector_baseIN10__cxxabiv112_GLOBAL__N_111string_pairENS2_11short_allocIS3_Lj4096EEEED2Ev(i9); + break L1; } - case 156: + default: { - HEAP32[i3 + 8 >> 2] = 32; - HEAP32[i3 + 4 >> 2] = 4; - i5 = 78; - break; + i1 = i6; + break L1; } - default: - i1 = 0; } while (0); - if ((i5 | 0) == 78) { - if (HEAP8[i4 + 12 >> 0] | 0) { - i5 = __ZNSt3__1lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(43432, 18781) | 0; - i2 = __ZNKSt3__18ios_base6getlocEv(i5 + (HEAP32[(HEAP32[i5 >> 2] | 0) + -12 >> 2] | 0) | 0) | 0; - HEAP32[i1 >> 2] = i2; - i2 = __ZNKSt3__16locale9use_facetERNS0_2idE(i1, 44308) | 0; - i2 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[i2 >> 2] | 0) + 28 >> 2] & 31](i2, 10) | 0; - __ZNSt3__16localeD2Ev(i1); - __ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc(i5, i2) | 0; - __ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv(i5) | 0; - } - i1 = __ZN4wasm17WasmBinaryBuilder13popExpressionEv(i4) | 0; - HEAP32[i3 + 16 >> 2] = i1; - i1 = __ZN4wasm17WasmBinaryBuilder13popExpressionEv(i4) | 0; - HEAP32[i3 + 12 >> 2] = i1; - i1 = 1; - } - STACKTOP = i6; + STACKTOP = i13; return i1 | 0; } @@ -60754,6 +60755,53 @@ function __ZNKSt3__18messagesIcE6do_getEiiiRKNS_12basic_stringIcNS_11char_traits return; } +function __ZN4wasm17WasmBinaryBuilder14maybeVisitImplEPNS_4HostEh(i4, i3, i2) { + i4 = i4 | 0; + i3 = i3 | 0; + i2 = i2 | 0; + var i1 = 0, i5 = 0, i6 = 0; + i6 = STACKTOP; + STACKTOP = STACKTOP + 16 | 0; + i1 = i6; + switch (i2 & 255 | 0) { + case 59: + { + HEAP32[i3 + 8 >> 2] = 1; + HEAP32[i3 + 4 >> 2] = 1; + i5 = 4; + break; + } + case 57: + { + HEAP32[i3 + 8 >> 2] = 2; + i5 = i3 + 16 | 0; + __ZNSt3__16vectorIPN4wasm10ExpressionENS_9allocatorIS3_EEE6resizeEj(i5, 1); + i2 = __ZN4wasm17WasmBinaryBuilder13popExpressionEv(i4) | 0; + HEAP32[HEAP32[i5 >> 2] >> 2] = i2; + i5 = 4; + break; + } + default: + i1 = 0; + } + if ((i5 | 0) == 4) { + if (HEAP8[i4 + 12 >> 0] | 0) { + i5 = __ZNSt3__1lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(43432, 18923) | 0; + i4 = __ZNKSt3__18ios_base6getlocEv(i5 + (HEAP32[(HEAP32[i5 >> 2] | 0) + -12 >> 2] | 0) | 0) | 0; + HEAP32[i1 >> 2] = i4; + i4 = __ZNKSt3__16locale9use_facetERNS0_2idE(i1, 44308) | 0; + i4 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[i4 >> 2] | 0) + 28 >> 2] & 31](i4, 10) | 0; + __ZNSt3__16localeD2Ev(i1); + __ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc(i5, i4) | 0; + __ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv(i5) | 0; + } + __ZN4wasm4Host8finalizeEv(i3); + i1 = 1; + } + STACKTOP = i6; + return i1 | 0; +} + function __ZNSt3__116__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj(i5, i7, i4, i8) { i5 = i5 | 0; i7 = i7 | 0; @@ -61144,50 +61192,6 @@ function __ZNSt3__112__hash_tableINS_17__hash_value_typeIN6cashew7IStringEiEENS_ return; } -function __ZN4wasm17WasmBinaryBuilder14maybeVisitImplEPNS_4HostEh(i4, i3, i2) { - i4 = i4 | 0; - i3 = i3 | 0; - i2 = i2 | 0; - var i1 = 0, i5 = 0, i6 = 0; - i6 = STACKTOP; - STACKTOP = STACKTOP + 16 | 0; - i1 = i6; - switch (i2 & 255 | 0) { - case 59: - { - HEAP32[i3 + 8 >> 2] = 1; - HEAP32[i3 + 4 >> 2] = 1; - i5 = 4; - break; - } - case 57: - { - HEAP32[i3 + 8 >> 2] = 2; - i5 = i3 + 16 | 0; - __ZNSt3__16vectorIPN4wasm10ExpressionENS_9allocatorIS3_EEE6resizeEj(i5, 1); - i3 = __ZN4wasm17WasmBinaryBuilder13popExpressionEv(i4) | 0; - HEAP32[HEAP32[i5 >> 2] >> 2] = i3; - i5 = 4; - break; - } - default: - i1 = 0; - } - if ((i5 | 0) == 4) if (!(HEAP8[i4 + 12 >> 0] | 0)) i1 = 1; else { - i5 = __ZNSt3__1lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc(43432, 18923) | 0; - i4 = __ZNKSt3__18ios_base6getlocEv(i5 + (HEAP32[(HEAP32[i5 >> 2] | 0) + -12 >> 2] | 0) | 0) | 0; - HEAP32[i1 >> 2] = i4; - i4 = __ZNKSt3__16locale9use_facetERNS0_2idE(i1, 44308) | 0; - i4 = FUNCTION_TABLE_iii[HEAP32[(HEAP32[i4 >> 2] | 0) + 28 >> 2] & 31](i4, 10) | 0; - __ZNSt3__16localeD2Ev(i1); - __ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc(i5, i4) | 0; - __ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv(i5) | 0; - i1 = 1; - } - STACKTOP = i6; - return i1 | 0; -} - function __ZN4wasm22SExpressionWasmBuilder9makeBreakERNS_7ElementE(i4, i3) { i4 = i4 | 0; i3 = i3 | 0; diff --git a/src/wasm-binary.h b/src/wasm-binary.h index 5d25323de..081924ba0 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -1655,6 +1655,7 @@ public: if (debug) std::cerr << "zz node: Binary" << std::endl; curr->right = popExpression(); curr->left = popExpression(); + curr->finalize(); return true; #undef TYPED_CODE #undef INT_TYPED_CODE @@ -1687,6 +1688,7 @@ public: default: return false; } if (debug) std::cerr << "zz node: Host" << std::endl; + curr->finalize(); return true; } void visitNop(Nop *curr) { -- cgit v1.2.3