Statically determined procedure calls

Hi everyone,

I am looking to get more precision about the statically determined call resolution.

Does this means that the used / exported code of a module will be redeployed along the importer bytecode ?

These quotes are from the Move whitepaper :

No dynamic dispatch. The target of each call site can be statically determined. This makes it easy for verification tools to reason precisely about the effects of a procedure call without performing a complex call graph construction analysis.

This ensures that all procedure calls in Move are statically determined — there are no function pointers or virtual calls.

The execution of bytecode proceeds by executing operations in sequence unless there is a branch operation that causes a jump to a statically determined offset in the current procedure.

1 Like

Hi Jonathan,

Does this means that the used / exported code of a module will be redeployed along the importer bytecode ?

Good question. The short answer is no. What happens is: when a new module M is deployed, the bytecode verifier links the external types and procedures used by M against their definitions published on the blockchain. If the type or procedure does not exist or does not match its declaration, M will not be published.

At runtime, if the Move VM encounters a call to procedure 0x1/E.p(), it will fetch the module E from its published at address 0x1 and use the definition of p found there. The linking performed by the bytecode verifier guarantees that E/p will exist.

1 Like

Hi Sam,

Thanks for providing an answer to my question.

Have a great day !