@@ -680,7 +680,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
680
680
#ifdef Py_STATS
681
681
int lastopcode = 0 ;
682
682
#endif
683
- uint16_t opcode ; /* Current opcode */
683
+ uint8_t opcode ; /* Current opcode */
684
684 int oparg ; /* Current opcode argument, if any */
685
685
#ifdef LLTRACE
686
686
int lltrace = 0 ;
@@ -767,9 +767,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
767
767
/* Start instructions */
768
768
#if !USE_COMPUTED_GOTOS
769
769
dispatch_opcode :
770
- // Cast to an 8-bit value to improve the code generated by MSVC
771
- // (in combination with the EXTRA_CASES macro).
772
- switch ((uint8_t )opcode )
770
+ switch (opcode )
773
771
#endif
774
772
{
775
773
@@ -985,28 +983,29 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
985
983
986
984
OPT_STAT_INC (traces_executed );
987
985
_PyUOpInstruction * next_uop = current_executor -> trace ;
986
+ uint16_t uopcode ;
988
987
#ifdef Py_STATS
989
988
uint64_t trace_uop_execution_counter = 0 ;
990
989
#endif
991
990
992
991
for (;;) {
993
- opcode = next_uop -> opcode ;
992
+ uopcode = next_uop -> opcode ;
994
993
DPRINTF (3 ,
995
994
"%4d: uop %s, oparg %d, operand %" PRIu64 ", target %d, stack_level %d\n" ,
996
995
(int )(next_uop - current_executor -> trace ),
997
- _PyUopName (opcode ),
996
+ _PyUopName (uopcode ),
998
997
next_uop -> oparg ,
999
998
next_uop -> operand ,
1000
999
next_uop -> target ,
1001
1000
(int )(stack_pointer - _PyFrame_Stackbase (frame )));
1002
1001
next_uop ++ ;
1003
1002
OPT_STAT_INC (uops_executed );
1004
- UOP_STAT_INC (opcode , execution_count );
1003
+ UOP_STAT_INC (uopcode , execution_count );
1005
1004
#ifdef Py_STATS
1006
1005
trace_uop_execution_counter ++ ;
1007
1006
#endif
1008
1007
1009
- switch (opcode ) {
1008
+ switch (uopcode ) {
1010
1009
1011
1010
#include "executor_cases.c.h"
1012
1011
@@ -1044,7 +1043,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
1044
1043
STACK_SHRINK (1 );
1045
1044
error_tier_two :
1046
1045
DPRINTF (2 , "Error: [Uop %d (%s), oparg %d, operand %" PRIu64 ", target %d @ %d]\n" ,
1047
- opcode , _PyUopName (opcode ), next_uop [-1 ].oparg , next_uop [-1 ].operand , next_uop [-1 ].target ,
1046
+ uopcode , _PyUopName (uopcode ), next_uop [-1 ].oparg , next_uop [-1 ].operand , next_uop [-1 ].target ,
1048
1047
(int )(next_uop - current_executor -> trace - 1 ));
1049
1048
OPT_HIST (trace_uop_execution_counter , trace_run_length_hist );
1050
1049
frame -> return_offset = 0 ; // Don't leave this random
@@ -1057,10 +1056,10 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
1057
1056
// On DEOPT_IF we just repeat the last instruction.
1058
1057
// This presumes nothing was popped from the stack (nor pushed).
1059
1058
DPRINTF (2 , "DEOPT: [Uop %d (%s), oparg %d, operand %" PRIu64 ", target %d @ %d]\n" ,
1060
- opcode , _PyUopName (opcode ), next_uop [-1 ].oparg , next_uop [-1 ].operand , next_uop [-1 ].target ,
1059
+ uopcode , _PyUopName (uopcode ), next_uop [-1 ].oparg , next_uop [-1 ].operand , next_uop [-1 ].target ,
1061
1060
(int )(next_uop - current_executor -> trace - 1 ));
1062
1061
OPT_HIST (trace_uop_execution_counter , trace_run_length_hist );
1063
- UOP_STAT_INC (opcode , miss );
1062
+ UOP_STAT_INC (uopcode , miss );
1064
1063
frame -> return_offset = 0 ; // Dispatch to frame->instr_ptr
1065
1064
_PyFrame_SetStackPointer (frame , stack_pointer );
1066
1065
frame -> instr_ptr = next_uop [-1 ].target + _PyCode_CODE (_PyFrame_GetCode (frame ));
0 commit comments