diff options
author | Kevin Newton <kddnewton@gmail.com> | 2022-08-18 15:39:18 -0400 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-08-29 09:09:41 -0700 |
commit | f883aabc13d334771da926e632dca5758bb506c8 (patch) | |
tree | fbf667cc6ab86170583e4702c86c0b11effb9413 /scheduler.c | |
parent | ea9ee31744a905d7bafdd064ed97f68b5b1f21fa (diff) | |
download | ruby-f883aabc13d334771da926e632dca5758bb506c8.tar.gz |
Instruction enum (https://github.com/Shopify/ruby/pull/423)
* Remove references to explicit instruction parts
Previously we would reference individual instruction fields
manually. We can't do that with instructions that are enums, so
this commit removes those references. As a side effect, we can
remove the push_insn_parts() function from the assembler because we
now explicitly push instruction structs every time.
* Switch instructions to enum
Instructions are now no longer a large struct with a bunch of
optional fields. Instead they are an enum with individual shapes
for the variants.
In terms of size, the instruction struct was 120 bytes while the
new instruction enum is 106 bytes. The bigger win however is that
we're not allocating any vectors for instruction operands (except
for CCall), which should help cut down on memory usage.
Adding new instructions will be a little more complicated going
forward, but every mission-critical function that needs to be
touched will have an exhaustive match, so the compiler should guide
any additions.
Diffstat (limited to 'scheduler.c')
0 files changed, 0 insertions, 0 deletions