mirror of
https://github.com/python/cpython.git
synced 2025-09-02 06:57:58 +00:00
gh-118423: Add INSTRUCTION_SIZE
macro to code generator (GH-125467)
This commit is contained in:
parent
b2eaa75b17
commit
aab58a93ef
9 changed files with 115 additions and 34 deletions
24
Python/generated_cases.c.h
generated
24
Python/generated_cases.c.h
generated
|
@ -539,7 +539,7 @@
|
|||
new_frame = _PyFrame_PushUnchecked(tstate, PyStackRef_FromPyObjectNew(getitem), 2, frame);
|
||||
new_frame->localsplus[0] = container;
|
||||
new_frame->localsplus[1] = sub;
|
||||
frame->return_offset = (uint16_t)(1 + INLINE_CACHE_ENTRIES_BINARY_SUBSCR);
|
||||
frame->return_offset = 2 ;
|
||||
}
|
||||
// _PUSH_FRAME
|
||||
{
|
||||
|
@ -935,7 +935,7 @@
|
|||
if (new_frame == NULL) {
|
||||
goto error;
|
||||
}
|
||||
frame->return_offset = (uint16_t)(next_instr - this_instr);
|
||||
frame->return_offset = 4 ;
|
||||
DISPATCH_INLINED(new_frame);
|
||||
}
|
||||
/* Callable is not a normal Python function */
|
||||
|
@ -1737,7 +1737,7 @@
|
|||
if (new_frame == NULL) {
|
||||
goto error;
|
||||
}
|
||||
assert(next_instr - this_instr == 1);
|
||||
assert( 1 == 1);
|
||||
frame->return_offset = 1;
|
||||
DISPATCH_INLINED(new_frame);
|
||||
}
|
||||
|
@ -1958,8 +1958,8 @@
|
|||
if (new_frame == NULL) {
|
||||
goto error;
|
||||
}
|
||||
assert(next_instr - this_instr == 1 + INLINE_CACHE_ENTRIES_CALL_KW);
|
||||
frame->return_offset = 1 + INLINE_CACHE_ENTRIES_CALL_KW;
|
||||
assert( 4 == 1 + INLINE_CACHE_ENTRIES_CALL_KW);
|
||||
frame->return_offset = 4 ;
|
||||
DISPATCH_INLINED(new_frame);
|
||||
}
|
||||
/* Callable is not a normal Python function */
|
||||
|
@ -3986,7 +3986,7 @@
|
|||
tstate->exc_info = &gen->gi_exc_state;
|
||||
gen_frame->previous = frame;
|
||||
// oparg is the return offset from the next instruction.
|
||||
frame->return_offset = (uint16_t)(1 + INLINE_CACHE_ENTRIES_FOR_ITER + oparg);
|
||||
frame->return_offset = (uint16_t)( 2 + oparg);
|
||||
}
|
||||
// _PUSH_FRAME
|
||||
{
|
||||
|
@ -4448,7 +4448,7 @@
|
|||
if (new_frame == NULL) {
|
||||
goto error;
|
||||
}
|
||||
frame->return_offset = (uint16_t)(next_instr - this_instr);
|
||||
frame->return_offset = 4 ;
|
||||
DISPATCH_INLINED(new_frame);
|
||||
}
|
||||
/* Callable is not a normal Python function */
|
||||
|
@ -5352,7 +5352,7 @@
|
|||
STACK_SHRINK(1);
|
||||
new_frame->localsplus[0] = owner;
|
||||
new_frame->localsplus[1] = PyStackRef_FromPyObjectNew(name);
|
||||
frame->return_offset = (uint16_t)(next_instr - this_instr);
|
||||
frame->return_offset = 10 ;
|
||||
DISPATCH_INLINED(new_frame);
|
||||
}
|
||||
|
||||
|
@ -7035,8 +7035,8 @@
|
|||
gen->gi_frame_state = FRAME_EXECUTING;
|
||||
gen->gi_exc_state.previous_item = tstate->exc_info;
|
||||
tstate->exc_info = &gen->gi_exc_state;
|
||||
assert(next_instr - this_instr + oparg <= UINT16_MAX);
|
||||
frame->return_offset = (uint16_t)(next_instr - this_instr + oparg);
|
||||
assert( 2 + oparg <= UINT16_MAX);
|
||||
frame->return_offset = (uint16_t)( 2 + oparg);
|
||||
assert(gen_frame->previous == NULL);
|
||||
gen_frame->previous = frame;
|
||||
DISPATCH_INLINED(gen_frame);
|
||||
|
@ -7108,8 +7108,8 @@
|
|||
gen->gi_frame_state = FRAME_EXECUTING;
|
||||
gen->gi_exc_state.previous_item = tstate->exc_info;
|
||||
tstate->exc_info = &gen->gi_exc_state;
|
||||
assert(1 + INLINE_CACHE_ENTRIES_SEND + oparg <= UINT16_MAX);
|
||||
frame->return_offset = (uint16_t)(1 + INLINE_CACHE_ENTRIES_SEND + oparg);
|
||||
assert( 2 + oparg <= UINT16_MAX);
|
||||
frame->return_offset = (uint16_t)( 2 + oparg);
|
||||
gen_frame->previous = frame;
|
||||
}
|
||||
// _PUSH_FRAME
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue