Skip to content

Commit a5bea47

Browse files
author
j30ng
committed
Remove Enum Instruction::Unpack
1 parent 95d57ef commit a5bea47

File tree

3 files changed

+1
-14
lines changed

3 files changed

+1
-14
lines changed

bytecode/src/bytecode.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ pub enum Instruction {
258258
before: usize,
259259
after: usize,
260260
},
261-
Unpack,
262261
FormatValue {
263262
conversion: Option<ConversionFlag>,
264263
spec: String,
@@ -522,7 +521,6 @@ impl Instruction {
522521
LoadBuildClass => w!(LoadBuildClass),
523522
UnpackSequence { size } => w!(UnpackSequence, size),
524523
UnpackEx { before, after } => w!(UnpackEx, before, after),
525-
Unpack => w!(Unpack),
526524
FormatValue { spec, .. } => w!(FormatValue, spec), // TODO: write conversion
527525
PopException => w!(PopException),
528526
Reverse { amount } => w!(Reverse, amount),

compiler/src/compile.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,9 +1617,8 @@ impl<O: OutputStream> Compiler<O> {
16171617
self.compile_comprehension(kind, generators)?;
16181618
}
16191619
Starred { .. } => {
1620-
use std::string::String;
16211620
return Err(CompileError {
1622-
error: CompileErrorType::SyntaxError(String::from(
1621+
error: CompileErrorType::SyntaxError(std::string::String::from(
16231622
"Invalid starred expression",
16241623
)),
16251624
location: self.current_source_location.clone(),

vm/src/frame.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,6 @@ impl Frame {
478478
bytecode::Instruction::UnpackEx { before, after } => {
479479
self.execute_unpack_ex(vm, *before, *after)
480480
}
481-
bytecode::Instruction::Unpack => self.execute_unpack(vm),
482481
bytecode::Instruction::FormatValue { conversion, spec } => {
483482
use bytecode::ConversionFlag::*;
484483
let value = match conversion {
@@ -979,15 +978,6 @@ impl Frame {
979978
}
980979
}
981980

982-
fn execute_unpack(&self, vm: &VirtualMachine) -> FrameResult {
983-
let value = self.pop_value();
984-
let elements = vm.extract_elements(&value)?;
985-
for element in elements.into_iter().rev() {
986-
self.push_value(element);
987-
}
988-
Ok(None)
989-
}
990-
991981
fn jump(&self, label: bytecode::Label) {
992982
let target_pc = self.code.label_map[&label];
993983
#[cfg(feature = "vm-tracing-logging")]

0 commit comments

Comments
 (0)