Skip to content

Commit b72ab8b

Browse files
Address review
1 parent f8a764a commit b72ab8b

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

Python/bytecodes.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5462,33 +5462,33 @@ dummy_func(
54625462
}
54635463

54645464
tier2 op(_GUARD_IP__PUSH_FRAME, (ip/4 --)) {
5465-
_Py_CODEUNIT *target = frame->instr_ptr + OFFSET_OF(_PUSH_FRAME);
5465+
_Py_CODEUNIT *target = frame->instr_ptr + IP_OFFSET_OF(_PUSH_FRAME);
54665466
if (target != (_Py_CODEUNIT *)ip) {
5467-
frame->instr_ptr += OFFSET_OF(_PUSH_FRAME);
5467+
frame->instr_ptr += IP_OFFSET_OF(_PUSH_FRAME);
54685468
EXIT_IF(true);
54695469
}
54705470
}
54715471

54725472
tier2 op(_GUARD_IP_YIELD_VALUE, (ip/4 --)) {
5473-
_Py_CODEUNIT *target = frame->instr_ptr + OFFSET_OF(YIELD_VALUE);
5473+
_Py_CODEUNIT *target = frame->instr_ptr + IP_OFFSET_OF(YIELD_VALUE);
54745474
if (target != (_Py_CODEUNIT *)ip) {
5475-
frame->instr_ptr += OFFSET_OF(YIELD_VALUE);
5475+
frame->instr_ptr += IP_OFFSET_OF(YIELD_VALUE);
54765476
EXIT_IF(true);
54775477
}
54785478
}
54795479

54805480
tier2 op(_GUARD_IP_RETURN_VALUE, (ip/4 --)) {
5481-
_Py_CODEUNIT *target = frame->instr_ptr + OFFSET_OF(RETURN_VALUE);
5481+
_Py_CODEUNIT *target = frame->instr_ptr + IP_OFFSET_OF(RETURN_VALUE);
54825482
if (target != (_Py_CODEUNIT *)ip) {
5483-
frame->instr_ptr += OFFSET_OF(RETURN_VALUE);
5483+
frame->instr_ptr += IP_OFFSET_OF(RETURN_VALUE);
54845484
EXIT_IF(true);
54855485
}
54865486
}
54875487

54885488
tier2 op(_GUARD_IP_RETURN_GENERATOR, (ip/4 --)) {
5489-
_Py_CODEUNIT *target = frame->instr_ptr + OFFSET_OF(RETURN_GENERATOR);
5489+
_Py_CODEUNIT *target = frame->instr_ptr + IP_OFFSET_OF(RETURN_GENERATOR);
54905490
if (target != (_Py_CODEUNIT *)ip) {
5491-
frame->instr_ptr += OFFSET_OF(RETURN_GENERATOR);
5491+
frame->instr_ptr += IP_OFFSET_OF(RETURN_GENERATOR);
54925492
EXIT_IF(true);
54935493
}
54945494
}
@@ -5647,7 +5647,7 @@ dummy_func(
56475647
int full = !_PyJit_translate_single_bytecode_to_trace(tstate, frame, next_instr, stop_tracing);
56485648
if (full) {
56495649
LEAVE_TRACING();
5650-
int err = bail_tracing_and_jit(tstate, frame);
5650+
int err = stop_tracing_and_jit(tstate, frame);
56515651
ERROR_IF(err < 0);
56525652
DISPATCH_GOTO_NON_TRACING();
56535653
}
@@ -5686,7 +5686,7 @@ dummy_func(
56865686
int opcode = next_instr->op.code;
56875687
_PyJit_translate_single_bytecode_to_trace(tstate, frame, NULL, true);
56885688
LEAVE_TRACING();
5689-
int err = bail_tracing_and_jit(tstate, frame);
5689+
int err = stop_tracing_and_jit(tstate, frame);
56905690
ERROR_IF(err < 0);
56915691
DISPATCH_GOTO_NON_TRACING();
56925692
#else

Python/ceval.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ _PyObjectArray_Free(PyObject **array, PyObject **scratch)
993993
#if _Py_TIER2
994994
// 0 for success, -1 for error.
995995
static int
996-
bail_tracing_and_jit(PyThreadState *tstate, _PyInterpreterFrame *frame)
996+
stop_tracing_and_jit(PyThreadState *tstate, _PyInterpreterFrame *frame)
997997
{
998998
int _is_sys_tracing = (tstate->c_tracefunc != NULL) || (tstate->c_profilefunc != NULL);
999999
int err = 0;
@@ -1245,7 +1245,7 @@ _PyTier2Interpreter(
12451245
uopcode = next_uop->opcode;
12461246
#ifdef Py_DEBUG
12471247
if (frame->lltrace >= 3) {
1248-
// dump_stack(frame, stack_pointer);
1248+
dump_stack(frame, stack_pointer);
12491249
if (next_uop->opcode == _START_EXECUTOR) {
12501250
printf("%4d uop: ", 0);
12511251
}

Python/generated_cases.c.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tools/cases_generator/tier2_generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Tier2Emitter(Emitter):
6363
def __init__(self, out: CWriter, labels: dict[str, Label]):
6464
super().__init__(out, labels)
6565
self._replacers["oparg"] = self.oparg
66-
self._replacers["OFFSET_OF"] = self.offset_of
66+
self._replacers["IP_OFFSET_OF"] = self.ip_offset_of
6767

6868
def goto_error(self, offset: int, storage: Storage) -> str:
6969
# To do: Add jump targets for popping values.
@@ -135,7 +135,7 @@ def oparg(
135135
self.out.emit_at(uop.name[-1], tkn)
136136
return True
137137

138-
def offset_of(
138+
def ip_offset_of(
139139
self,
140140
tkn: Token,
141141
tkn_iter: TokenIterator,

0 commit comments

Comments
 (0)