mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
gh-98831: rewrite MAKE_FUNCTION and BUILD_SLICE in the instruction definition DSL (#101529)
This commit is contained in:
parent
04e06e20ee
commit
433fb3ef08
3 changed files with 53 additions and 54 deletions
|
@ -325,11 +325,11 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) {
|
|||
case CALL_FUNCTION_EX:
|
||||
return -1;
|
||||
case MAKE_FUNCTION:
|
||||
return -1;
|
||||
return ((oparg & 0x01) ? 1 : 0) + ((oparg & 0x02) ? 1 : 0) + ((oparg & 0x04) ? 1 : 0) + ((oparg & 0x08) ? 1 : 0) + 1;
|
||||
case RETURN_GENERATOR:
|
||||
return 0;
|
||||
case BUILD_SLICE:
|
||||
return -1;
|
||||
return ((oparg == 3) ? 1 : 0) + 2;
|
||||
case FORMAT_VALUE:
|
||||
return -1;
|
||||
case COPY:
|
||||
|
@ -671,11 +671,11 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) {
|
|||
case CALL_FUNCTION_EX:
|
||||
return -1;
|
||||
case MAKE_FUNCTION:
|
||||
return -1;
|
||||
return 1;
|
||||
case RETURN_GENERATOR:
|
||||
return 0;
|
||||
case BUILD_SLICE:
|
||||
return -1;
|
||||
return 1;
|
||||
case FORMAT_VALUE:
|
||||
return -1;
|
||||
case COPY:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue