bpo-46039: Split yield from in two (GH-30035)

* Split YIELD_FROM opcode into SEND and JUMP_ABSOLUTE.

* Remove YIELD_FROM opcode.
This commit is contained in:
Mark Shannon 2021-12-15 10:30:09 +00:00 committed by GitHub
parent 86de99588d
commit 0b50a4f0cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 91 additions and 53 deletions

View file

@ -249,7 +249,13 @@ mark_stacks(PyCodeObject *code_obj, int len)
next_stack = pop_value(pop_value(pop_value(next_stack)));
stacks[i+1] = next_stack;
break;
case SEND:
j = get_arg(code, i) + i + 1;
assert(j < len);
assert(stacks[j] == UNINITIALIZED || stacks[j] == pop_value(next_stack));
stacks[j] = pop_value(next_stack);
stacks[i+1] = next_stack;
break;
case JUMP_FORWARD:
j = get_arg(code, i) + i + 1;
assert(j < len);