FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Remove `Reverse` bytecode by ShaharNaveh · Pull Request #6675 · RustPython/RustPython · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) .rs  (2) .yaml  (1) All 3 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ jobs:
- name: Ensure Lib/_opcode_metadata is updated
run: |
python scripts/generate_opcode_metadata.py
if [ -z "$(git status --porcelain)" ]; then
if [ -n "$(git status --porcelain)" ]; then
exit 1
fi

Expand Down
5 changes: 0 additions & 5 deletions Lib/_opcode_metadata.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

_specializations = {}





_specialized_opmap = {}

opmap = {
Expand Down Expand Up @@ -141,7 +137,6 @@
'JUMP_IF_TRUE_OR_POP': 130,
'JUMP_IF_NOT_EXC_MATCH': 131,
'LOAD_CLASS_DEREF': 132,
'REVERSE': 133,
'SET_EXC_INFO': 134,
'SUBSCRIPT': 135,
'RESUME': 149,
Expand Down
8 changes: 0 additions & 8 deletions crates/compiler-core/src/bytecode.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -932,9 +932,6 @@ pub enum Instruction {
} = 130,
JumpIfNotExcMatch(Arg<Label>) = 131,
LoadClassDeref(Arg<NameIdx>) = 132,
Reverse {
amount: Arg<u32>,
} = 133,
SetExcInfo = 134,
Subscript = 135,
// ===== Pseudo Opcodes (252+) ======
Expand Down Expand Up @@ -1000,9 +997,6 @@ impl TryFrom<u8> for Instruction {
}),
u8::from(Self::JumpIfNotExcMatch(Arg::marker())),
u8::from(Self::LoadClassDeref(Arg::marker())),
u8::from(Self::Reverse {
amount: Arg::marker(),
}),
u8::from(Self::SetExcInfo),
u8::from(Self::Subscript),
];
Expand Down Expand Up @@ -1922,7 +1916,6 @@ impl Instruction {
-1 + before as i32 + 1 + after as i32
}
PopExcept => 0,
Reverse { .. } => 0,
GetAwaitable => 0,
BeforeAsyncWith => 1,
GetAIter => 0,
Expand Down Expand Up @@ -2094,7 +2087,6 @@ impl Instruction {
Resume { arg } => w!(RESUME, arg),
ReturnConst { idx } => fmt_const("RETURN_CONST", arg, f, idx),
ReturnValue => w!(RETURN_VALUE),
Reverse { amount } => w!(REVERSE, amount),
Send { target } => w!(SEND, target),
SetAdd { i } => w!(SET_ADD, i),
SetExcInfo => w!(SET_EXC_INFO),
Expand Down
5 changes: 0 additions & 5 deletions crates/vm/src/frame.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1458,11 +1458,6 @@ impl ExecutingFrame<'_> {
let value = self.pop_value();
self.unwind_blocks(vm, UnwindReason::Returning { value })
}
bytecode::Instruction::Reverse { amount } => {
let stack_len = self.state.stack.len();
self.state.stack[stack_len - amount.get(arg) as usize..stack_len].reverse();
Ok(None)
}
bytecode::Instruction::SetAdd { i } => {
let item = self.pop_value();
let obj = self.nth_value(i.get(arg));
Expand Down
2 changes: 0 additions & 2 deletions scripts/generate_opcode_metadata.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ def cpython_name(self) -> str:
name = self.rust_name
name = re.sub(r"(?<=[a-z0-9])([A-Z])", r"_\1", name)
return re.sub(r"(\D)(\d+)$", r"\1_\2", name).upper()
return re.sub(r"(?<=[a-z0-9])([A-Z])", r"_\1", self.rust_name).upper()
return re.sub(r"(?<!^)(?=[A-Z])", "_", self.rust_name).upper()

@classmethod
def from_str(cls, body: str):
Expand Down
Loading

Back | FazBrowse Home | New Git URL