@@ -677,6 +677,7 @@ const uint16_t op_without_push[MAX_UOP_ID + 1] = {
677677 [_LOAD_FAST ] = _NOP ,
678678 [_LOAD_FAST_BORROW ] = _NOP ,
679679 [_LOAD_SMALL_INT ] = _NOP ,
680+ [_PUSH_NULL ] = _NOP ,
680681};
681682
682683const bool op_skip [MAX_UOP_ID + 1 ] = {
@@ -692,13 +693,6 @@ const uint16_t op_without_pop[MAX_UOP_ID + 1] = {
692693 [_POP_TOP_INT ] = _NOP ,
693694 [_POP_TOP_FLOAT ] = _NOP ,
694695 [_POP_TOP_UNICODE ] = _NOP ,
695- [_POP_TWO ] = _POP_TOP ,
696- [_POP_CALL_TWO ] = _POP_CALL_ONE ,
697- [_POP_CALL_ONE ] = _POP_CALL ,
698- };
699-
700- const uint16_t op_without_pop_null [MAX_UOP_ID + 1 ] = {
701- [_POP_CALL ] = _POP_TOP ,
702696};
703697
704698
@@ -733,10 +727,10 @@ remove_unneeded_uops(_PyUOpInstruction *buffer, int buffer_size)
733727 default :
734728 {
735729 // Cancel out pushes and pops, repeatedly. So:
736- // _LOAD_FAST + _POP_TWO + _LOAD_CONST_INLINE_BORROW + _POP_TOP
730+ // _LOAD_FAST + _POP_TOP + _POP_TOP + _LOAD_CONST_INLINE_BORROW + _POP_TOP
737731 // ...becomes:
738- // _NOP + _POP_TOP + _NOP + _NOP
739- while (op_without_pop [opcode ] || op_without_pop_null [ opcode ] ) {
732+ // _NOP + _NOP + _POP_TOP + _NOP + _NOP
733+ while (op_without_pop [opcode ]) {
740734 _PyUOpInstruction * last = & buffer [pc - 1 ];
741735 while (op_skip [last -> opcode ]) {
742736 last -- ;
@@ -749,14 +743,6 @@ remove_unneeded_uops(_PyUOpInstruction *buffer, int buffer_size)
749743 pc = (int )(last - buffer );
750744 }
751745 }
752- else if (last -> opcode == _PUSH_NULL ) {
753- // Handle _POP_CALL separately.
754- // This looks for a preceding _PUSH_NULL instruction and
755- // simplifies to _POP_TOP.
756- last -> opcode = _NOP ;
757- opcode = buffer [pc ].opcode = op_without_pop_null [opcode ];
758- assert (opcode );
759- }
760746 else {
761747 break ;
762748 }
0 commit comments