Use Vec<Instruct> in InstrSeq
commitc553284e35dd0c7b3359f8f6be501cb58d313620
authorEdwin Smith <smith@fb.com>
Thu, 24 Feb 2022 14:05:07 +0000 (24 06:05 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 24 Feb 2022 14:05:07 +0000 (24 06:05 -0800)
treee9c3943c816a3e8274fe9463c87127113b85d500
parentc75e15c9392dfffcc7cc908a3c522ac9525153a0
Use Vec<Instruct> in InstrSeq

Summary:
Every InstrSeq is constructed using a vec![...] which is immediately copied into
the arena and then destroyed. Now that InstrSeq is not part of the hhbc_ast FFI,
we can avoid all that copying by using the Vec directly.

This diff stops using arena allocation for InstrSeq, and unlocks a ton of `alloc`
plumbing for the next diff to clean up (and speed up a bit).

While here, rename several InstrSeq methods to idiomatic Rust names.

Reviewed By: aorenste

Differential Revision: D34363971

fbshipit-source-id: 3f4c950a0790ab1c41e07e8245e8457c221130fb
hphp/hack/src/hackc/emitter/emit_adata.rs
hphp/hack/src/hackc/emitter/emit_body.rs
hphp/hack/src/hackc/emitter/instruction_sequence.rs
hphp/hack/src/hackc/emitter/label_rewriter.rs