@@ -42,12 +42,6 @@ is_block_push(cfg_instr *i)
4242 return IS_BLOCK_PUSH_OPCODE (i -> i_opcode );
4343}
4444
45- static inline int
46- is_relative_jump (cfg_instr * i )
47- {
48- return IS_RELATIVE_JUMP (i -> i_opcode );
49- }
50-
5145static inline int
5246is_jump (cfg_instr * i )
5347{
@@ -199,8 +193,7 @@ blocksize(basicblock *b)
199193static void
200194dump_instr (cfg_instr * i )
201195{
202- const char * jrel = (is_relative_jump (i )) ? "jrel " : "" ;
203- const char * jabs = (is_jump (i ) && !is_relative_jump (i ))? "jabs " : "" ;
196+ const char * jump = is_jump (i ) ? "jump " : "" ;
204197
205198 char arg [128 ];
206199
@@ -211,8 +204,8 @@ dump_instr(cfg_instr *i)
211204 if (HAS_TARGET (i -> i_opcode )) {
212205 sprintf (arg , "target: %p [%d] " , i -> i_target , i -> i_oparg );
213206 }
214- fprintf (stderr , "line: %d, opcode: %d %s%s%s \n" ,
215- i -> i_loc .lineno , i -> i_opcode , arg , jabs , jrel );
207+ fprintf (stderr , "line: %d, opcode: %d %s%s\n" ,
208+ i -> i_loc .lineno , i -> i_opcode , arg , jump );
216209}
217210
218211static inline int
@@ -500,25 +493,20 @@ resolve_jump_offsets(basicblock *entryblock)
500493 for (int i = 0 ; i < b -> b_iused ; i ++ ) {
501494 cfg_instr * instr = & b -> b_instr [i ];
502495 int isize = _PyCfg_InstrSize (instr );
503- /* Relative jumps are computed relative to
504- the instruction pointer after fetching
505- the jump instruction.
506- */
496+ /* jump offsets are computed relative to
497+ * the instruction pointer after fetching
498+ * the jump instruction.
499+ */
507500 bsize += isize ;
508501 if (is_jump (instr )) {
509502 instr -> i_oparg = instr -> i_target -> b_offset ;
510- if (is_relative_jump (instr )) {
511- if (instr -> i_oparg < bsize ) {
512- assert (IS_BACKWARDS_JUMP_OPCODE (instr -> i_opcode ));
513- instr -> i_oparg = bsize - instr -> i_oparg ;
514- }
515- else {
516- assert (!IS_BACKWARDS_JUMP_OPCODE (instr -> i_opcode ));
517- instr -> i_oparg -= bsize ;
518- }
503+ if (instr -> i_oparg < bsize ) {
504+ assert (IS_BACKWARDS_JUMP_OPCODE (instr -> i_opcode ));
505+ instr -> i_oparg = bsize - instr -> i_oparg ;
519506 }
520507 else {
521508 assert (!IS_BACKWARDS_JUMP_OPCODE (instr -> i_opcode ));
509+ instr -> i_oparg -= bsize ;
522510 }
523511 if (_PyCfg_InstrSize (instr ) != isize ) {
524512 extended_arg_recompile = 1 ;
0 commit comments