Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change 'here' to 'this_instr' in bytecodes.c and generated cases
  • Loading branch information
markshannon committed Oct 30, 2023
commit 2b2819819a99fc03be20d9498864d6e98e805df1
16 changes: 8 additions & 8 deletions Lib/test/test_generated_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,13 +359,13 @@ def test_cache_effect(self):
"""
output = """
TARGET(OP) {
_Py_CODEUNIT *here = frame->instr_ptr = next_instr;
_Py_CODEUNIT *this_instr = frame->instr_ptr = next_instr;
next_instr += 4;
INSTRUCTION_STATS(OP);
PyObject *value;
value = stack_pointer[-1];
uint16_t counter = read_u16(&here[1].cache);
uint32_t extra = read_u32(&here[2].cache);
uint16_t counter = read_u16(&this_instr[1].cache);
uint32_t extra = read_u32(&this_instr[2].cache);
STACK_SHRINK(1);
DISPATCH();
}
Expand Down Expand Up @@ -404,14 +404,14 @@ def test_macro_instruction(self):
"""
output = """
TARGET(OP1) {
_Py_CODEUNIT *here = frame->instr_ptr = next_instr;
_Py_CODEUNIT *this_instr = frame->instr_ptr = next_instr;
next_instr += 2;
INSTRUCTION_STATS(OP1);
PyObject *right;
PyObject *left;
right = stack_pointer[-1];
left = stack_pointer[-2];
uint16_t counter = read_u16(&here[1].cache);
uint16_t counter = read_u16(&this_instr[1].cache);
op1(left, right);
DISPATCH();
}
Expand All @@ -421,7 +421,7 @@ def test_macro_instruction(self):
next_instr += 6;
INSTRUCTION_STATS(OP);
PREDICTED(OP);
_Py_CODEUNIT *here = next_instr - 6;
_Py_CODEUNIT *this_instr = next_instr - 6;
static_assert(INLINE_CACHE_ENTRIES_OP == 5, "incorrect cache size");
PyObject *right;
PyObject *left;
Expand All @@ -431,13 +431,13 @@ def test_macro_instruction(self):
right = stack_pointer[-1];
left = stack_pointer[-2];
{
uint16_t counter = read_u16(&here[1].cache);
uint16_t counter = read_u16(&this_instr[1].cache);
op1(left, right);
}
// OP2
arg2 = stack_pointer[-3];
{
uint32_t extra = read_u32(&here[4].cache);
uint32_t extra = read_u32(&this_instr[4].cache);
res = op2(arg2, left, right);
}
STACK_SHRINK(2);
Expand Down
Loading