8000 GH-98831: Typed stack effects, and more instructions converted by gvanrossum · Pull Request #99764 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-98831: Typed stack effects, and more instructions converted #99764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 34 commits into from
Dec 8, 2022
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6860ed7
Make BINARY_OP_INPLACE_ADD_UNICODE a legit super instruction
gvanrossum Nov 22, 2022
dcba32e
COMPARE_OP
gvanrossum Nov 24, 2022
30cb8cd
COMPARE_OP_FLOAT_JUMP
gvanrossum Nov 24, 2022
6af0a5d
COMPARE_OP_INT_JUMP
gvanrossum Nov 24, 2022
039efbf
COMPARE_OP_STR_JUMP
gvanrossum Nov 24, 2022
2fd8822
Support typed stack effects
gvanrossum Nov 25, 2022
14bbd50
Refactor common code of analyze_{super,macro}
gvanrossum Nov 25, 2022
00a2495
Reverse temporary variable numbering
gvanrossum Nov 25, 2022
f01dff5
STORE_ATTR
gvanrossum Nov 25, 2022
71ee089
DELETE_ATTR
gvanrossum Nov 25, 2022
966da1a
STORE_GLOBAL
gvanrossum Nov 25, 2022
7c94591
STORE_ATTR_INSTANCE_VALUE
gvanrossum Nov 25, 2022
2c76046
STORE_ATTR_WITH_HINT
gvanrossum Nov 25, 2022
d0f29f8
STORE_ATTR_SLOT, and complete the store_attr family
gvanrossum Nov 25, 2022
001c418
Complete the store_subscr family: STORE_SUBSCR{,DICT,LIST_INT}
gvanrossum Nov 26, 2022
05caa7e
DELETE_SUBSCR
gvanrossum Nov 26, 2022
8d445ae
PRINT_EXPR
gvanrossum Nov 26, 2022
c1f3034
INTERPRETER_EXIT (a bit weird, ends in return)
gvanrossum Nov 26, 2022
e2f376b
RETURN_VALUE
gvanrossum Nov 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename _JUMP_ON_SIGN to _JUMP_IF
  • Loading branch information
gvanrossum committed Dec 8, 2022
commit 029bf073644a87bb2d5b52c9ac1fcd725f2d172c
10 changes: 5 additions & 5 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static uint32_t type_version;
#define _COMPARE_OP_FLOAT 1003
#define _COMPARE_OP_INT 1004
#define _COMPARE_OP_STR 1005
#define _JUMP_ON_SIGN 1006
#define _JUMP_IF 1006

static PyObject *
dummy_func(
Expand Down Expand Up @@ -2035,14 +2035,14 @@ dummy_func(
jump = sign_ish & when_to_jump_mask;
}
// The input is an int disguised as an object pointer!
op(_JUMP_ON_SIGN, (jump: size_t --)) {
op(_JUMP_IF, (jump: size_t --)) {
assert(opcode == POP_JUMP_IF_FALSE || opcode == POP_JUMP_IF_TRUE);
if (jump) {
JUMPBY(oparg);
}
}
// We're praying that the compiler optimizes the flags manipuations.
super(COMPARE_OP_FLOAT_JUMP) = _COMPARE_OP_FLOAT + _JUMP_ON_SIGN;
super(COMPARE_OP_FLOAT_JUMP) = _COMPARE_OP_FLOAT + _JUMP_IF;

// Similar to COMPARE_OP_FLOAT
op(_COMPARE_OP_INT, (unused/1, when_to_jump_mask/1, left, right -- jump: size_t)) {
Expand All @@ -2062,7 +2062,7 @@ dummy_func(
_Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free);
jump = sign_ish & when_to_jump_mask;
}
super(COMPARE_OP_INT_JUMP) = _COMPARE_OP_INT + _JUMP_ON_SIGN;
super(COMPARE_OP_INT_JUMP) = _COMPARE_OP_INT + _JUMP_IF;

// Similar to COMPARE_OP_FLOAT, but for ==, != only
op(_COMPARE_OP_STR, (unused/1, invert/1, left, right -- jump: size_t)) {
Expand All @@ -2079,7 +2079,7 @@ dummy_func(
assert(invert == 0 || invert == 1);
jump = res ^ invert;
}
super(COMPARE_OP_STR_JUMP) = _COMPARE_OP_STR + _JUMP_ON_SIGN;
super(COMPARE_OP_STR_JUMP) = _COMPARE_OP_STR + _JUMP_IF;

// stack effect: (__0 -- )
inst(IS_OP) {
Expand Down
0