@@ -678,7 +678,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
678
678
#ifdef Py_STATS
679
679
int lastopcode = 0 ;
680
680
#endif
681
- uint16_t opcode ; /* Current opcode */
681
+ uint8_t opcode ; /* Current opcode */
682
682
int oparg ; /* Current opcode argument, if any */
683
683
#ifdef LLTRACE
684
684
int lltrace = 0 ;
@@ -765,9 +765,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
765
765
/* Start instructions */
766
766
#if !USE_COMPUTED_GOTOS
767
767
dispatch_opcode :
768
- // Cast to an 8-bit value to improve the code generated by MSVC
769
- // (in combination with the EXTRA_CASES macro).
770
- switch ((uint8_t )opcode )
768
+ switch (opcode )
771
769
#endif
772
770
{
773
771
@@ -983,30 +981,31 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
983
981
984
982
OPT_STAT_INC (traces_executed );
985
983
_PyUOpInstruction * next_uop = current_executor -> trace ;
984
+ uint16_t uopcode ;
986
985
uint64_t operand ;
987
986
#ifdef Py_STATS
988
987
uint64_t trace_uop_execution_counter = 0 ;
989
988
#endif
990
989
991
990
for (;;) {
992
- opcode = next_uop -> opcode ;
991
+ uopcode = next_uop -> opcode ;
993
992
oparg = next_uop -> oparg ;
994
993
operand = next_uop -> operand ;
995
994
DPRINTF (3 ,
996
995
"%4d: uop %s, oparg %d, operand %" PRIu64 ", stack_level %d\n" ,
997
996
(int )(next_uop - current_executor -> trace ),
998
- opcode < 256 ? _PyOpcode_OpName [opcode ] : _PyOpcode_uop_name [opcode ],
997
+ uopcode < 256 ? _PyOpcode_OpName [uopcode ] : _PyOpcode_uop_name [uopcode ],
999
998
oparg ,
1000
999
operand ,
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
@@ -1042,7 +1041,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
1042
1041
pop_1_error_tier_two :
1043
1042
STACK_SHRINK (1 );
1044
1043
error_tier_two :
1045
- DPRINTF (2 , "Error: [Opcode %d, operand %" PRIu64 "]\n" , opcode , operand );
1044
+ DPRINTF (2 , "Error: [Opcode %d, operand %" PRIu64 "]\n" , uopcode , operand );
1046
1045
OPT_HIST (trace_uop_execution_counter , trace_run_length_hist );
1047
1046
frame -> return_offset = 0 ; // Don't leave this random
1048
1047
_PyFrame_SetStackPointer (frame , stack_pointer );
@@ -1053,9 +1052,9 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
1053
1052
deoptimize :
1054
1053
// On DEOPT_IF we just repeat the last instruction.
1055
1054
// This presumes nothing was popped from the stack (nor pushed).
1056
- DPRINTF (2 , "DEOPT: [Opcode %d, operand %" PRIu64 " @ %d]\n" , opcode , operand , (int )(next_uop - current_executor -> trace - 1 ));
1055
+ DPRINTF (2 , "DEOPT: [Opcode %d, operand %" PRIu64 " @ %d]\n" , uopcode , operand , (int )(next_uop - current_executor -> trace - 1 ));
1057
1056
OPT_HIST (trace_uop_execution_counter , trace_run_length_hist );
1058
- UOP_STAT_INC (opcode , miss );
1057
+ UOP_STAT_INC (uopcode , miss );
1059
1058
frame -> return_offset = 0 ; // Dispatch to frame->instr_ptr
1060
1059
_PyFrame_SetStackPointer (frame , stack_pointer );
1061
1060
frame -> instr_ptr = next_uop [-1 ].target + _PyCode_CODE ((PyCodeObject * )frame -> f_executable );
0 commit comments