summaryrefslogtreecommitdiffstats
path: root/Python/optimizer_analysis.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-02-27 13:25:02 (GMT)
committerGitHub <noreply@github.com>2024-02-27 13:25:02 (GMT)
commit6ecfcfe8946cf701c6c7018e30ae54d8b7a7ac2a (patch)
tree866ef77e88de4f69c85fda6d61a43bc17f1ccd2f /Python/optimizer_analysis.c
parent10fbcd6c5dc25bfe14e02fd93ef93498a393860c (diff)
downloadcpython-6ecfcfe8946cf701c6c7018e30ae54d8b7a7ac2a.zip
cpython-6ecfcfe8946cf701c6c7018e30ae54d8b7a7ac2a.tar.gz
cpython-6ecfcfe8946cf701c6c7018e30ae54d8b7a7ac2a.tar.bz2
GH-115816: Assorted naming and formatting changes to improve maintainability. (GH-115987)
* Rename _Py_UOpsAbstractInterpContext to _Py_UOpsContext and _Py_UOpsSymType to _Py_UopsSymbol. * #define shortened form of _Py_uop_... names for improved readability.
Diffstat (limited to 'Python/optimizer_analysis.c')
-rw-r--r--Python/optimizer_analysis.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/Python/optimizer_analysis.c b/Python/optimizer_analysis.c
index 6b2aec8..b29a00c 100644
--- a/Python/optimizer_analysis.c
+++ b/Python/optimizer_analysis.c
@@ -282,6 +282,23 @@ remove_globals(_PyInterpreterFrame *frame, _PyUOpInstruction *buffer,
} while (0);
+/* Shortened forms for convenience, used in optimizer_bytecodes.c */
+#define sym_is_not_null _Py_uop_sym_is_not_null
+#define sym_is_const _Py_uop_sym_is_const
+#define sym_get_const _Py_uop_sym_get_const
+#define sym_new_unknown _Py_uop_sym_new_unknown
+#define sym_new_not_null _Py_uop_sym_new_not_null
+#define sym_new_type _Py_uop_sym_new_type
+#define sym_is_null _Py_uop_sym_is_null
+#define sym_new_const _Py_uop_sym_new_const
+#define sym_new_null _Py_uop_sym_new_null
+#define sym_matches_type _Py_uop_sym_matches_type
+#define sym_set_null _Py_uop_sym_set_null
+#define sym_set_type _Py_uop_sym_set_type
+#define frame_new _Py_uop_frame_new
+#define frame_pop _Py_uop_frame_pop
+
+
/* 1 for success, 0 for not ready, cannot error at the moment. */
static int
optimize_uops(
@@ -293,13 +310,13 @@ optimize_uops(
)
{
- _Py_UOpsAbstractInterpContext context;
- _Py_UOpsAbstractInterpContext *ctx = &context;
+ _Py_UOpsContext context;
+ _Py_UOpsContext *ctx = &context;
if (_Py_uop_abstractcontext_init(ctx) < 0) {
goto out_of_space;
}
- _Py_UOpsAbstractFrame *frame = _Py_uop_ctx_frame_new(ctx, co, ctx->n_consumed, 0, curr_stacklen);
+ _Py_UOpsAbstractFrame *frame = _Py_uop_frame_new(ctx, co, ctx->n_consumed, 0, curr_stacklen);
if (frame == NULL) {
return -1;
}
@@ -313,7 +330,7 @@ optimize_uops(
int oparg = this_instr->oparg;
uint32_t opcode = this_instr->opcode;
- _Py_UOpsSymType **stack_pointer = ctx->frame->stack_pointer;
+ _Py_UopsSymbol **stack_pointer = ctx->frame->stack_pointer;
DPRINTF(3, "Abstract interpreting %s:%d ",
_PyUOpName(opcode),