gh-98831: Modernize CALL_FUNCTION_EX (#101627)

New generator feature: Move CHECK_EVAL_BREAKER() call to just before DISPATCH().
This commit is contained in:
Guido van Rossum 2023-02-07 20:03:22 -08:00 committed by GitHub
parent 790ff6bc6a
commit a9f01448a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 37 deletions

View file

@ -325,7 +325,7 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) {
case CALL_NO_KW_METHOD_DESCRIPTOR_FAST:
return -1;
case CALL_FUNCTION_EX:
return -1;
return ((oparg & 1) ? 1 : 0) + 3;
case MAKE_FUNCTION:
return ((oparg & 0x01) ? 1 : 0) + ((oparg & 0x02) ? 1 : 0) + ((oparg & 0x04) ? 1 : 0) + ((oparg & 0x08) ? 1 : 0) + 1;
case RETURN_GENERATOR:
@ -673,7 +673,7 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) {
case CALL_NO_KW_METHOD_DESCRIPTOR_FAST:
return -1;
case CALL_FUNCTION_EX:
return -1;
return 1;
case MAKE_FUNCTION:
return 1;
case RETURN_GENERATOR: