Assemble kernel on the client #1

Merged
cdo merged 72 commits from client-side-assembler into main 2026-03-18 15:21:33 +00:00
Showing only changes of commit d4718f1106 - Show all commits

11
asm.js
View File

@@ -675,14 +675,15 @@ export class Assembler {
action_symbol(action) { action_symbol(action) {
const func = this.funcs[this.current_func]; const func = this.funcs[this.current_func];
const index = this.lookup_param(func, action.symbol) const value = this.lookup_param(func, action.symbol)
?? this.lookup_local(func, action.symbol) ?? this.lookup_local(func, action.symbol)
?? this.lookup_global(action.symbol); ?? this.lookup_global(action.symbol)
if (index == null) { ?? this.lookup_def(action.symbol);
if (value == null) {
console.error(`ERROR: Unable to resolve symbol {action.symbol}`); console.error(`ERROR: Unable to resolve symbol {action.symbol}`);
index = 0; value = 0;
} }
func.body.push(index); func.body.push(value);
} }
action_mem(action) { action_mem(action) {