mirror of
https://github.com/python/cpython.git
synced 2025-08-22 01:35:16 +00:00
GH-131726: Split up _CHECK_VALIDITY_AND_SET_IP (GH-131810)
This commit is contained in:
parent
1a9d4a1fb3
commit
3a8cefba0b
7 changed files with 148 additions and 189 deletions
|
@ -554,16 +554,6 @@ remove_unneeded_uops(_PyUOpInstruction *buffer, int buffer_size)
|
|||
buffer[pc].opcode = _NOP;
|
||||
}
|
||||
break;
|
||||
case _CHECK_VALIDITY_AND_SET_IP:
|
||||
if (may_have_escaped) {
|
||||
may_have_escaped = false;
|
||||
buffer[pc].opcode = _CHECK_VALIDITY;
|
||||
}
|
||||
else {
|
||||
buffer[pc].opcode = _NOP;
|
||||
}
|
||||
last_set_ip = pc;
|
||||
break;
|
||||
case _POP_TOP:
|
||||
{
|
||||
_PyUOpInstruction *last = &buffer[pc-1];
|
||||
|
@ -597,13 +587,8 @@ remove_unneeded_uops(_PyUOpInstruction *buffer, int buffer_size)
|
|||
may_have_escaped = true;
|
||||
}
|
||||
if (needs_ip && last_set_ip >= 0) {
|
||||
if (buffer[last_set_ip].opcode == _CHECK_VALIDITY) {
|
||||
buffer[last_set_ip].opcode = _CHECK_VALIDITY_AND_SET_IP;
|
||||
}
|
||||
else {
|
||||
assert(buffer[last_set_ip].opcode == _NOP);
|
||||
buffer[last_set_ip].opcode = _SET_IP;
|
||||
}
|
||||
assert(buffer[last_set_ip].opcode == _NOP);
|
||||
buffer[last_set_ip].opcode = _SET_IP;
|
||||
last_set_ip = -1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue