From 07e7f4684f11cedf9dee2d3b6254a3e79463b840 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Sat, 10 Jan 2026 14:00:18 +0200 Subject: [PATCH] LoadClassDeref -> LoadFromDictOrDeref --- Lib/_opcode_metadata.py | 1 - crates/codegen/src/compile.rs | 2 +- crates/compiler-core/src/bytecode.rs | 38 +++++++++++++++++++++++----- crates/stdlib/src/opcode.rs | 2 +- crates/vm/src/frame.rs | 2 +- 5 files changed, 34 insertions(+), 11 deletions(-) diff --git a/Lib/_opcode_metadata.py b/Lib/_opcode_metadata.py index e72a76a576c..40cd95cca0c 100644 --- a/Lib/_opcode_metadata.py +++ b/Lib/_opcode_metadata.py @@ -136,7 +136,6 @@ 'JUMP_IF_FALSE_OR_POP': 129, 'JUMP_IF_TRUE_OR_POP': 130, 'JUMP_IF_NOT_EXC_MATCH': 131, - 'LOAD_CLASS_DEREF': 132, 'SET_EXC_INFO': 134, 'SUBSCRIPT': 135, 'RESUME': 149, diff --git a/crates/codegen/src/compile.rs b/crates/codegen/src/compile.rs index d5fbd194866..a3f3b0ba255 100644 --- a/crates/codegen/src/compile.rs +++ b/crates/codegen/src/compile.rs @@ -1561,7 +1561,7 @@ impl Compiler { NameUsage::Load => { // Special case for class scope if self.ctx.in_class && !self.ctx.in_func() { - Instruction::LoadClassDeref + Instruction::LoadFromDictOrDeref } else { Instruction::LoadDeref } diff --git a/crates/compiler-core/src/bytecode.rs b/crates/compiler-core/src/bytecode.rs index d3a74d8828a..98a257bbd8d 100644 --- a/crates/compiler-core/src/bytecode.rs +++ b/crates/compiler-core/src/bytecode.rs @@ -842,7 +842,7 @@ pub enum Instruction { LoadFastLoadFast { arg: Arg, } = 88, // Placeholder - LoadFromDictOrDeref(Arg) = 89, // Placeholder + LoadFromDictOrDeref(Arg) = 89, LoadFromDictOrGlobals(Arg) = 90, // Placeholder LoadGlobal(Arg) = 91, LoadName(Arg) = 92, @@ -945,7 +945,6 @@ pub enum Instruction { target: Arg