From a0c9cf9456c2ee7a89d9bd859c07afac8cf5e893 Mon Sep 17 00:00:00 2001 From: Mark Shannon Date: Wed, 10 Jan 2024 15:44:34 +0000 Subject: GH-113860: All executors are now defined in terms of micro ops. Convert counter executor to use uops. (GH-113864) --- Python/bytecodes.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'Python/bytecodes.c') diff --git a/Python/bytecodes.c b/Python/bytecodes.c index e1a6a256fbd..f53ddae8df9 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -2366,16 +2366,8 @@ dummy_func( _PyExecutorObject *executor = (_PyExecutorObject *)code->co_executors->executors[oparg&255]; if (executor->vm_data.valid) { Py_INCREF(executor); - if (executor->execute == _PyUOpExecute) { - current_executor = (_PyUOpExecutorObject *)executor; - GOTO_TIER_TWO(); - } - next_instr = executor->execute(executor, frame, stack_pointer); - frame = tstate->current_frame; - if (next_instr == NULL) { - goto resume_with_error; - } - stack_pointer = _PyFrame_GetStackPointer(frame); + current_executor = (_PyUOpExecutorObject *)executor; + GOTO_TIER_TWO(); } else { code->co_executors->executors[oparg & 255] = NULL; @@ -4066,6 +4058,16 @@ dummy_func( DEOPT_IF(!current_executor->base.vm_data.valid); } + op(_LOAD_CONST_INLINE_BORROW, (ptr/4 -- value)) { + value = ptr; + } + + /* Internal -- for testing executors */ + op(_INTERNAL_INCREMENT_OPT_COUNTER, (opt --)) { + _PyCounterOptimizerObject *exe = (_PyCounterOptimizerObject *)opt; + exe->count++; + } + // END BYTECODES // -- cgit v1.2.3