move-language / move

Apache License 2.0
2.25k stars 679 forks source link

[RFC][DRAFT][VM] Function pointer support in VM #989

Open runtian-zhou opened 1 year ago

runtian-zhou commented 1 year ago

Motivation

This is the very first initial draft of how MoveVM can potentially support function pointer. We believe function pointer could be a very important corner stone of how interface should be implemented in the future.

In this implemetnation, we add three new opcodes and one more SignatureToken type:

Right now it has the following limitations:

Have you read the Contributing Guidelines on pull requests?

Yes.

Test Plan

This implementation only passed compilation and is no way close to merging into main. The intention of this PR is just to assess the safety of this change and to collect usability feedbacks. I'll try to see how I can mod the IR to try the new feature out in the compiler