Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[move-vm][closures] Types and opcodes for closures #15667

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wrwg
Copy link
Contributor

@wrwg wrwg commented Jan 4, 2025

Description

[PR 1/n for vm closures]

This PR implements the extensions needed in the file format for representing closures:

  • The type SignatureToken has a new variant Function(args, result, abilities) to represent a function type
  • The opcodes are extended by new operations PackClosure, PackClosureGeneric, and CallClosure

This supports bit masks for specifying which arguments of a function are captured when creating a closure.

Bytecode verification is extended to support the new types and opcodes. The implementation of consistency, type, and reference safety should be complete. What is missing are:

  • Interpreter and value representation
  • Value serialization
  • Connection of the new types with the various other type representations

How Has This Been Tested?

Testing postponed until e2e wiring is ready

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Full Node (API, Indexer, etc.)
  • Move/Aptos Virtual Machine
  • Aptos Framework
  • Aptos CLI/SDK
  • Developer Infrastructure
  • Move Compiler
  • Other (specify)

Copy link

trunk-io bot commented Jan 4, 2025

⏱️ 1h 13m total CI duration on this PR
Job Cumulative Duration Recent Runs
rust-move-tests 13m 🟩
rust-move-tests 13m 🟩
rust-move-tests 13m 🟩
rust-cargo-deny 9m 🟩🟩🟩🟩🟩
check-dynamic-deps 9m 🟩🟩🟩🟩🟩 (+1 more)
rust-move-tests 8m 🟥
rust-move-tests 4m 🟥
general-lints 2m 🟩🟩🟩🟩🟩
semgrep/ci 2m 🟩🟩🟩🟩🟩
file_change_determinator 51s 🟩🟩🟩🟩🟩
permission-check 14s 🟩🟩🟩🟩🟩
permission-check 13s 🟩🟩🟩🟩🟩
check-branch-prefix 1s 🟩

settingsfeedbackdocs ⋅ learn more about trunk.io

@wrwg wrwg force-pushed the wrwg/clos_file_format branch 3 times, most recently from 0aa8d5d to 301ccae Compare January 16, 2025 06:44
@wrwg wrwg force-pushed the wrwg/clos_file_format branch 3 times, most recently from 0ebce3a to 58fbf2b Compare January 18, 2025 03:21
@wrwg wrwg force-pushed the wrwg/clos_file_format branch 2 times, most recently from d9a4a9f to e2b0141 Compare January 21, 2025 04:55
@wrwg wrwg changed the base branch from main to wrwg/bv8 January 21, 2025 04:55
@wrwg wrwg force-pushed the wrwg/clos_file_format branch from e2b0141 to 53b97a8 Compare January 21, 2025 05:08
@wrwg wrwg requested a review from georgemitenkov January 21, 2025 05:12
@georgemitenkov
Copy link
Contributor

@wrwg I think this PR got V8 binary format change leaked into it

@wrwg wrwg force-pushed the wrwg/clos_file_format branch from 53b97a8 to 58fb6ba Compare January 21, 2025 16:56
Base automatically changed from wrwg/bv8 to main January 22, 2025 02:39
@wrwg wrwg force-pushed the wrwg/clos_file_format branch from 58fb6ba to 55a5551 Compare January 22, 2025 03:19
Copy link
Contributor Author

wrwg commented Jan 22, 2025

@wrwg I think this PR got V8 binary format change leaked into it

Can't see any unexpected. This PR is based on the (now landed) v8 PR. Perhaps there was a merge conflict which is now resolved after rebase?

@wrwg wrwg force-pushed the wrwg/clos_file_format branch from 55a5551 to ffc2f2d Compare January 22, 2025 06:23
This PR implements the extensions needed in the file format for representing closures:

- The type (SignatureToken) has a new variant `Function(args, result, abilities)` to represent a function type
- The opcodes are extendeed by operations `ClosPack`, `ClosPackGeneric`, and `ClosEval`

This supports bit masks for specifyinng which arguments of a function are captured when creating a closure.

Bytecode verification is extended to support the new types and opcodes. The implementation of consistency, type, and reference safety should be complete. What is missing are:

- File format serialization
- Interpreter and value representation
- Value serialization
- Connection of the new types with the various other type representations
@wrwg wrwg force-pushed the wrwg/clos_file_format branch from ffc2f2d to 781423d Compare January 22, 2025 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants