-
Notifications
You must be signed in to change notification settings - Fork 651
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Dylan Reimerink
committed
Feb 22, 2022
1 parent
299accb
commit 7bfde55
Showing
16 changed files
with
200 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.