From 4811b7ae42e3fe501486e2edbc26cbbffa3809ae Mon Sep 17 00:00:00 2001 From: Michael Schierl Date: Sat, 29 Jun 2024 00:16:55 +0200 Subject: [PATCH] Dusk v8: Fix JIT The logic in getWordName was broken due to the metadata field change, therefore the workaround to not create a JIT version for INPTR word has been disabled. Of course, the real problem remains why that INPTR word compiling results in such weird effects (maybe a word mark missing somewhere?) --- kernel.ts | 7 +------ script.js | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/kernel.ts b/kernel.ts index fd325b4..569e43b 100644 --- a/kernel.ts +++ b/kernel.ts @@ -1,10 +1,5 @@ // change these for debugging when needed -// TODO: re-enable JIT -// I don't know why, when I removed the "metadata" field of the dict entry -// structure (to be in sync with Dusk commit -// b133abcfce1c4bcea2e072910700f11ea33ed105), dusk-wasm wouldn't boot anymore, -// but if I disable the JIT, it does... -const ENABLE_JIT_SUPPORT: bool = false; +const ENABLE_JIT_SUPPORT: bool = true; const DEBUG_DETECT_STACK_IMBALANCE: bool = false; // size of JIT vmOp Area in bytes (0 to disable) diff --git a/script.js b/script.js index 18f8b99..56520fa 100644 --- a/script.js +++ b/script.js @@ -193,8 +193,8 @@ function getUint32(addr, mem) { function getWordName(where) { const mem = new Uint8Array(wasm.exports.memory.buffer, wasm.exports.GetMemBase(), 0x1000000); let prefix = ""; - const len = mem[where - 9] & 0x3f; - let name = String.fromCharCode.apply(null, mem.slice(where - 9 - len, where - 9)); + const len = mem[where - 5] & 0x3f; + let name = String.fromCharCode.apply(null, mem.slice(where - 5 - len, where - 5)); if (!/^[!-~]+$/.test(name)) name = ""; return prefix + name; } -- 2.45.2