From 423fc3db24041722974c017c640f304a18ef04b3 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Sat, 29 Nov 2025 11:17:44 +0200 Subject: [PATCH 01/15] Sort `Instruction` enum. Variants hold 1 element --- crates/compiler-core/src/bytecode.rs | 351 +++++++++------------------ 1 file changed, 117 insertions(+), 234 deletions(-) diff --git a/crates/compiler-core/src/bytecode.rs b/crates/compiler-core/src/bytecode.rs index 144054860e..a391e09451 100644 --- a/crates/compiler-core/src/bytecode.rs +++ b/crates/compiler-core/src/bytecode.rs @@ -549,263 +549,146 @@ pub type NameIdx = u32; #[derive(Debug, Copy, Clone, PartialEq, Eq)] #[repr(u8)] pub enum Instruction { - Nop, - /// Importing by name - ImportName { - idx: Arg, - }, - /// Importing without name - ImportNameless, - /// from ... import ... - ImportFrom { - idx: Arg, - }, - LoadFast(Arg), - LoadNameAny(Arg), - LoadGlobal(Arg), - LoadDeref(Arg), - LoadClassDeref(Arg), - StoreFast(Arg), - StoreLocal(Arg), - StoreGlobal(Arg), - StoreDeref(Arg), + BeforeAsyncWith, + BinaryOperation(Arg), + BinaryOperationInplace(Arg), + BinarySubscript, + Break(Arg