From c6bb168fbeb9cc1442282f1993af671255b2ab74 Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Thu, 17 Mar 2022 12:06:51 +0200 Subject: [PATCH] fix: asm.js allocations adjustments (#110) --- lib/lexer.asm.js | 4 ++-- src/lexer.asm.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/lexer.asm.js b/lib/lexer.asm.js index 22f3a46..eafe51b 100644 --- a/lib/lexer.asm.js +++ b/lib/lexer.asm.js @@ -26,9 +26,9 @@ export function parse (_source, _name = '@') { copy(words, new Uint16Array(asmBuffer, 16, words.length)); asm = asmInit(typeof self !== 'undefined' ? self : global, {}, asmBuffer); // 2 bytes per string code point - // + analysis space (~4000 imports @ 8 bytes per import) + // + analysis space // remaining space is stack space - addr = asm.su(source.length * 2 + (2 << 15)); + addr = asm.su(source.length * 2 + (2 << 16)); } const len = source.length + 1; asm.ses(addr); diff --git a/src/lexer.asm.js b/src/lexer.asm.js index 56462b6..16cf3cf 100644 --- a/src/lexer.asm.js +++ b/src/lexer.asm.js @@ -26,9 +26,9 @@ export function parse (_source, _name = '@') { copy(words, new Uint16Array(asmBuffer, 16, words.length)); asm = asmInit(typeof self !== 'undefined' ? self : global, {}, asmBuffer); // 2 bytes per string code point - // + analysis space (~4000 imports @ 8 bytes per import) + // + analysis space // remaining space is stack space - addr = asm.su(source.length * 2 + (2 << 15)); + addr = asm.su(source.length * 2 + (2 << 16)); } const len = source.length + 1; asm.ses(addr);