Implement type, table and func symbol resolution
This commit is contained in:
17
asm.js
17
asm.js
@@ -947,6 +947,9 @@ export class Assembler {
|
||||
?? this.lookup_param(func, action.symbol)
|
||||
?? this.lookup_local(func, 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) {
|
||||
const def_value = this.lookup_def(action.symbol);
|
||||
if (def_value == null) {
|
||||
@@ -1092,6 +1095,20 @@ export class Assembler {
|
||||
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) {
|
||||
return this.defs[symbol];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user