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 2155d17731 - Show all commits

17
asm.js
View File

@@ -947,6 +947,9 @@ export class Assembler {
?? this.lookup_param(func, action.symbol) ?? 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)
?? this.lookup_table(action.symbol)
?? this.lookup_type(action.symbol)
?? this.lookup_func(action.symbol)
if (value == null) { if (value == null) {
const def_value = this.lookup_def(action.symbol); const def_value = this.lookup_def(action.symbol);
if (def_value == null) { if (def_value == null) {
@@ -1092,6 +1095,20 @@ export class Assembler {
return index == -1 ? null : index; return index == -1 ? null : index;
} }
lookup_table(symbol) {
const index = Object.keys(this.tables).indexOf(symbol);
return index == -1 ? null : index;
}
lookup_type(symbol) {
return this.type_bindings[symbol];
}
lookup_func(symbol) {
const index = Object.keys(this.funcs).indexOf(symbol);
return index == -1 ? null : index;
}
lookup_def(symbol) { lookup_def(symbol) {
return this.defs[symbol]; return this.defs[symbol];
} }