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

Moved Instruction.Symbol and Instruction.Reference into per-instruction metadata #582

Merged
merged 1 commit into from Feb 24, 2022

Commits on Feb 23, 2022

  1. asm: moved Instruction.Symbol and Instruction.Reference into metadata

    This commit adds per-instruction metadata, which is sparse in nature,
    meaning that most instructions don't have metadata but some do. Metadata
    is linked to an instruction via a pointer which is nil by default, thus
    if an instruction has no metadata, at most one pointer worth of space is
    unused which is desirable since we expect the size of the metadata
    struct to grow in future commits.
    
    The metadata struct is copy-on-write, so multiple instructions can share
    the same metadata object after being copied, but as soon as a
    modification on one of the instruction's metadata is performed, the
    metadata object is copied so writes to a copied instruction doesn't
    effect the original instruction.
    
    This commit also deprecates `Instruction.Sym` in favor of
    `Instruction.WithSymbol`. This follows the convention of prefixing
    func names with `With...` if they have value receivers to make it clear
    to callers that this doesn't modify the instruction it is being called
    on.
    Dylan Reimerink committed Feb 23, 2022
    Copy the full SHA
    6d93b9f View commit details
    Browse the repository at this point in the history