On step 6.a to 6.c of instantiation, a frame is pushed into to stack with an auxiliary module instance that only consists of the imported globals.
https://webassembly.github.io/reference-types/core/exec/modules.html#instantiation
And then on the step 6.d, reference values are the results of evaluating the initializer expressions.
Let's assume there's only a ref.func x instruction in an initializer expression.
When evaluating this expression, the ref.func x will be executed with the current frame, which points to the auxiliary module instance.
https://webassembly.github.io/reference-types/core/exec/instructions.html#reference-instructions
But when executing the ref.func x instruction, it needs to query the function address F.module.funcaddrs[x].
I think that F.module, which is the auxiliary module instance that only consists of the imported globals, has no function addresses, right?
On step 6.a to 6.c of instantiation, a frame is pushed into to stack with an auxiliary module instance that only consists of the imported globals. https://webassembly.github.io/reference-types/core/exec/modules.html#instantiation And then on the step 6.d, reference values are the results of evaluating the initializer expressions. Let's assume there's only a
ref.func x
instruction in an initializer expression. When evaluating this expression, theref.func x
will be executed with the current frame, which points to the auxiliary module instance. https://webassembly.github.io/reference-types/core/exec/instructions.html#reference-instructions But when executing theref.func x
instruction, it needs to query the function addressF.module.funcaddrs[x]
. I think thatF.module
, which is the auxiliary module instance that only consists of the imported globals, has no function addresses, right?