gh-109214: Rename SAVE_IP to _SET_IP, and similar (#109285)

* Rename SAVE_IP to _SET_IP
* Rename EXIT_TRACE to _EXIT_TRACE
* Rename SAVE_CURRENT_IP to _SAVE_CURRENT_IP
* Rename INSERT to _INSERT (This is for Ken Jin's abstract interpreter)
* Rename IS_NONE to _IS_NONE
* Rename JUMP_TO_TOP to _JUMP_TO_TOP
This commit is contained in:
Guido van Rossum 2023-09-11 15:39:19 -07:00 committed by GitHub
parent 1ee50e2a78
commit fbaf77eb9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 117 additions and 117 deletions

View file

@ -803,8 +803,8 @@ dummy_func(
}
macro(RETURN_VALUE) =
SAVE_IP + // Tier 2 only; special-cased oparg
SAVE_CURRENT_IP + // Sets frame->prev_instr
_SET_IP + // Tier 2 only; special-cased oparg
_SAVE_CURRENT_IP + // Sets frame->prev_instr
_POP_FRAME;
inst(INSTRUMENTED_RETURN_VALUE, (retval --)) {
@ -828,8 +828,8 @@ dummy_func(
macro(RETURN_CONST) =
LOAD_CONST +
SAVE_IP + // Tier 2 only; special-cased oparg
SAVE_CURRENT_IP + // Sets frame->prev_instr
_SET_IP + // Tier 2 only; special-cased oparg
_SAVE_CURRENT_IP + // Sets frame->prev_instr
_POP_FRAME;
inst(INSTRUMENTED_RETURN_CONST, (--)) {
@ -2310,7 +2310,7 @@ dummy_func(
JUMPBY(oparg * flag);
}
op(IS_NONE, (value -- b)) {
op(_IS_NONE, (value -- b)) {
if (Py_IsNone(value)) {
b = Py_True;
}
@ -2320,9 +2320,9 @@ dummy_func(
}
}
macro(POP_JUMP_IF_NONE) = IS_NONE + POP_JUMP_IF_TRUE;
macro(POP_JUMP_IF_NONE) = _IS_NONE + POP_JUMP_IF_TRUE;
macro(POP_JUMP_IF_NOT_NONE) = IS_NONE + POP_JUMP_IF_FALSE;
macro(POP_JUMP_IF_NOT_NONE) = _IS_NONE + POP_JUMP_IF_FALSE;
inst(JUMP_BACKWARD_NO_INTERRUPT, (--)) {
/* This bytecode is used in the `yield from` or `await` loop.
@ -3069,8 +3069,8 @@ dummy_func(
_CHECK_FUNCTION_EXACT_ARGS +
_CHECK_STACK_SPACE +
_INIT_CALL_PY_EXACT_ARGS +
SAVE_IP + // Tier 2 only; special-cased oparg
SAVE_CURRENT_IP + // Sets frame->prev_instr
_SET_IP + // Tier 2 only; special-cased oparg
_SAVE_CURRENT_IP + // Sets frame->prev_instr
_PUSH_FRAME;
macro(CALL_PY_EXACT_ARGS) =
@ -3079,8 +3079,8 @@ dummy_func(
_CHECK_FUNCTION_EXACT_ARGS +
_CHECK_STACK_SPACE +
_INIT_CALL_PY_EXACT_ARGS +
SAVE_IP + // Tier 2 only; special-cased oparg
SAVE_CURRENT_IP + // Sets frame->prev_instr
_SET_IP + // Tier 2 only; special-cased oparg
_SAVE_CURRENT_IP + // Sets frame->prev_instr
_PUSH_FRAME;
inst(CALL_PY_WITH_DEFAULTS, (unused/1, func_version/2, callable, self_or_null, args[oparg] -- unused)) {
@ -3851,33 +3851,33 @@ dummy_func(
}
}
op(JUMP_TO_TOP, (--)) {
op(_JUMP_TO_TOP, (--)) {
pc = 0;
CHECK_EVAL_BREAKER();
}
op(SAVE_IP, (--)) {
op(_SET_IP, (--)) {
frame->prev_instr = ip_offset + oparg;
}
op(SAVE_CURRENT_IP, (--)) {
op(_SAVE_CURRENT_IP, (--)) {
#if TIER_ONE
frame->prev_instr = next_instr - 1;
#endif
#if TIER_TWO
// Relies on a preceding SAVE_IP
// Relies on a preceding _SET_IP
frame->prev_instr--;
#endif
}
op(EXIT_TRACE, (--)) {
op(_EXIT_TRACE, (--)) {
frame->prev_instr--; // Back up to just before destination
_PyFrame_SetStackPointer(frame, stack_pointer);
Py_DECREF(self);
return frame;
}
op(INSERT, (unused[oparg], top -- top, unused[oparg])) {
op(_INSERT, (unused[oparg], top -- top, unused[oparg])) {
// Inserts TOS at position specified by oparg;
memmove(&stack_pointer[-1 - oparg], &stack_pointer[-oparg], oparg * sizeof(stack_pointer[0]));
}