mirror of
https://github.com/python/cpython.git
synced 2026-05-06 20:51:17 -04:00
GH-131726: Split up _CHECK_VALIDITY_AND_SET_IP (GH-131810)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user