mirror of
https://github.com/python/cpython.git
synced 2025-08-29 21:25:01 +00:00
gh-105481: Generate the opcode lists in dis from data extracted from bytecodes.c (#106758)
This commit is contained in:
parent
3535ef1eec
commit
40f3f11a77
16 changed files with 402 additions and 158 deletions
|
@ -3604,7 +3604,7 @@ dummy_func(
|
|||
_PyBinaryOpCache *cache = (_PyBinaryOpCache *)next_instr;
|
||||
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
|
||||
next_instr--;
|
||||
_Py_Specialize_BinaryOp(lhs, rhs, next_instr, oparg, &GETLOCAL(0));
|
||||
_Py_Specialize_BinaryOp(lhs, rhs, next_instr, oparg, LOCALS_ARRAY);
|
||||
DISPATCH_SAME_OPARG();
|
||||
}
|
||||
STAT_INC(BINARY_OP, deferred);
|
||||
|
|
|
@ -234,6 +234,7 @@ GETITEM(PyObject *v, Py_ssize_t i) {
|
|||
|
||||
/* Local variable macros */
|
||||
|
||||
#define LOCALS_ARRAY (frame->localsplus)
|
||||
#define GETLOCAL(i) (frame->localsplus[i])
|
||||
|
||||
/* The SETLOCAL() macro must not DECREF the local variable in-place and
|
||||
|
|
|
@ -896,6 +896,24 @@ PyUnstable_OpcodeHasJump(int opcode)
|
|||
return OPCODE_HAS_JUMP(opcode);
|
||||
}
|
||||
|
||||
int
|
||||
PyUnstable_OpcodeHasFree(int opcode)
|
||||
{
|
||||
return OPCODE_HAS_FREE(opcode);
|
||||
}
|
||||
|
||||
int
|
||||
PyUnstable_OpcodeHasLocal(int opcode)
|
||||
{
|
||||
return OPCODE_HAS_LOCAL(opcode);
|
||||
}
|
||||
|
||||
int
|
||||
PyUnstable_OpcodeHasExc(int opcode)
|
||||
{
|
||||
return IS_BLOCK_PUSH_OPCODE(opcode);
|
||||
}
|
||||
|
||||
static int
|
||||
codegen_addop_noarg(instr_sequence *seq, int opcode, location loc)
|
||||
{
|
||||
|
|
2
Python/executor_cases.c.h
generated
2
Python/executor_cases.c.h
generated
|
@ -2449,7 +2449,7 @@
|
|||
_PyBinaryOpCache *cache = (_PyBinaryOpCache *)next_instr;
|
||||
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
|
||||
next_instr--;
|
||||
_Py_Specialize_BinaryOp(lhs, rhs, next_instr, oparg, &GETLOCAL(0));
|
||||
_Py_Specialize_BinaryOp(lhs, rhs, next_instr, oparg, LOCALS_ARRAY);
|
||||
DISPATCH_SAME_OPARG();
|
||||
}
|
||||
STAT_INC(BINARY_OP, deferred);
|
||||
|
|
2
Python/generated_cases.c.h
generated
2
Python/generated_cases.c.h
generated
|
@ -4451,7 +4451,7 @@
|
|||
_PyBinaryOpCache *cache = (_PyBinaryOpCache *)next_instr;
|
||||
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
|
||||
next_instr--;
|
||||
_Py_Specialize_BinaryOp(lhs, rhs, next_instr, oparg, &GETLOCAL(0));
|
||||
_Py_Specialize_BinaryOp(lhs, rhs, next_instr, oparg, LOCALS_ARRAY);
|
||||
DISPATCH_SAME_OPARG();
|
||||
}
|
||||
STAT_INC(BINARY_OP, deferred);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue