FuelLabs / FuelLabs/sway

Change `StateLoad/StoreQuad` intrinsics and `FuelVMInstruction` to use untyped `Pointer` for for dest/source instead of `TypedPointer(b256)`

Open
#7,571 0 comments 0 reactions 1 assignee Claimed by @ironcev View on GitHub
compiler compiler: codegen compiler: ir
Dominant language
Rust
Stars
61.4k
Forks
5.4k
Avg merge
3h 33m
Merged PRs (30d)
4

Description

Currently, `StateLoad/StoreQuad` intrinsics and `FuelVMInstruction`s use `TypedPointer(b256)` to represent memory destination and source pointers, respectively.

Indeed, we might see the dest/source memory locations as a sequence of `b256` values. But even in that case, it would strictly be `*[b256; N]`. In reality, destination/source locations are just pointers and the `len` actually defines how much data we copy.

This distinction becomes more prominent with the new dynamic storage opcodes where we cannot talk about pointers to data of certain known size like `b256` or their multipliers.

To unify the approaches and the validation of all `FuelVMInstruction`s, the proposal is to model `StateLoad/StoreQuad` intrinsics and `FuelVMInstruction`s to use untyped `Pointer` for modeling the memory destination and source pointer.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.