Skip to content

Commit 7a65439

Browse files
authored
GH-122390: Replace _Py_GetbaseOpcode with _Py_GetBaseCodeUnit (GH-122942)
1 parent fe23f8e commit 7a65439

16 files changed

+299
-326
lines changed

Include/internal/pycore_code.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ adaptive_counter_backoff(_Py_BackoffCounter counter) {
586586

587587
extern int _Py_Instrument(PyCodeObject *co, PyInterpreterState *interp);
588588

589-
extern int _Py_GetBaseOpcode(PyCodeObject *code, int offset);
589+
extern _Py_CODEUNIT _Py_GetBaseCodeUnit(PyCodeObject *code, int offset);
590590

591591
extern int _PyInstruction_GetLength(PyCodeObject *code, int offset);
592592

Include/internal/pycore_magic_number.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ Known values:
256256
Python 3.14a1 3602 (Add LOAD_SPECIAL. Remove BEFORE_WITH and BEFORE_ASYNC_WITH)
257257
Python 3.14a1 3603 (Remove BUILD_CONST_KEY_MAP)
258258
Python 3.14a1 3604 (Do not duplicate test at end of while statements)
259+
Python 3.14a1 3605 (Move ENTER_EXECUTOR to opcode 255)
259260
260261
Python 3.15 will start with 3650
261262
@@ -268,7 +269,7 @@ PC/launcher.c must also be updated.
268269
269270
*/
270271

271-
#define PYC_MAGIC_NUMBER 3604
272+
#define PYC_MAGIC_NUMBER 3605
272273
/* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
273274
(little-endian) and then appending b'\r\n'. */
274275
#define PYC_MAGIC_NUMBER_TOKEN \

Include/internal/pycore_opcode_metadata.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/opcode_ids.h

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

Lib/_opcode_metadata.py

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

Lib/test/test__opcode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def check_bool_function_result(self, func, ops, expected):
1717
self.assertEqual(func(op), expected)
1818

1919
def test_invalid_opcodes(self):
20-
invalid = [-100, -1, 255, 512, 513, 1000]
20+
invalid = [-100, -1, 512, 513, 1000]
2121
self.check_bool_function_result(_opcode.is_valid, invalid, False)
2222
self.check_bool_function_result(_opcode.has_arg, invalid, False)
2323
self.check_bool_function_result(_opcode.has_const, invalid, False)

0 commit comments

Comments
 (0)