[pallet-revive] pack exceeding syscall arguments into registers (#7319)
This PR changes how we call runtime API methods with more than 6 arguments: They are no longer spilled to the stack but packed into registers instead. Pointers are 32 bit wide so we can pack two of them into a single 64 bit register. Since we mostly pass pointers, this technique effectively increases the number of arguments we can pass using the available registers. To make this work for `instantiate` too we now pass the code hash and the call data in the same buffer, akin to how the `create` family opcodes work in the EVM. The code hash is fixed in size, implying the start of the constructor call data. --------- Signed-off-by:xermicus <cyrill@parity.io> Signed-off-by:
Cyrill Leutwiler <bigcyrill@hotmail.com> Co-authored-by: command-bot <> Co-authored-by:
cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by:
Alexander Theißen <alex.theissen@me.com>
parent
e6aad5b0
Showing
- prdoc/pr_7319.prdoc 16 additions, 0 deletionsprdoc/pr_7319.prdoc
- substrate/frame/revive/fixtures/contracts/call_diverging_out_len.rs 1 addition, 2 deletions...frame/revive/fixtures/contracts/call_diverging_out_len.rs
- substrate/frame/revive/fixtures/contracts/caller_contract.rs 25 additions, 21 deletionssubstrate/frame/revive/fixtures/contracts/caller_contract.rs
- substrate/frame/revive/fixtures/contracts/create1_with_value.rs 2 additions, 12 deletions...ate/frame/revive/fixtures/contracts/create1_with_value.rs
- substrate/frame/revive/fixtures/contracts/create_storage_and_instantiate.rs 5 additions, 3 deletions...vive/fixtures/contracts/create_storage_and_instantiate.rs
- substrate/frame/revive/fixtures/contracts/destroy_and_transfer.rs 1 addition, 3 deletions...e/frame/revive/fixtures/contracts/destroy_and_transfer.rs
- substrate/frame/revive/fixtures/contracts/instantiate_return_code.rs 5 additions, 7 deletions...rame/revive/fixtures/contracts/instantiate_return_code.rs
- substrate/frame/revive/fixtures/contracts/return_data_api.rs 8 additions, 4 deletionssubstrate/frame/revive/fixtures/contracts/return_data_api.rs
- substrate/frame/revive/proc-macro/src/lib.rs 6 additions, 33 deletionssubstrate/frame/revive/proc-macro/src/lib.rs
- substrate/frame/revive/rpc/examples/js/pvm/FlipperCaller.polkavm 0 additions, 0 deletions...te/frame/revive/rpc/examples/js/pvm/FlipperCaller.polkavm
- substrate/frame/revive/rpc/examples/js/pvm/PiggyBank.polkavm 0 additions, 0 deletionssubstrate/frame/revive/rpc/examples/js/pvm/PiggyBank.polkavm
- substrate/frame/revive/src/benchmarking/mod.rs 21 additions, 33 deletionssubstrate/frame/revive/src/benchmarking/mod.rs
- substrate/frame/revive/src/tests.rs 7 additions, 7 deletionssubstrate/frame/revive/src/tests.rs
- substrate/frame/revive/src/wasm/runtime.rs 36 additions, 23 deletionssubstrate/frame/revive/src/wasm/runtime.rs
- substrate/frame/revive/src/weights.rs 498 additions, 506 deletionssubstrate/frame/revive/src/weights.rs
- substrate/frame/revive/uapi/src/host.rs 2 additions, 3 deletionssubstrate/frame/revive/uapi/src/host.rs
- substrate/frame/revive/uapi/src/host/riscv64.rs 71 additions, 88 deletionssubstrate/frame/revive/uapi/src/host/riscv64.rs
- substrate/frame/revive/uapi/src/lib.rs 11 additions, 0 deletionssubstrate/frame/revive/uapi/src/lib.rs
Please register or sign in to comment