
    pixB                    V   d Z ddlZddlZddlmZmZmZ ddlmZ ddl	m
Z
mZmZmZ ddlmZmZ ddlmZ ddlmZ  ej*                  e      Zd	ZeZ eh d
      Zedv rddlmZ  G d de      ZeZnedv rn e e      e G d de!             Z" G d de!      Z#d Z$ G d de!      Z%e G d de!             Z& G d de&      Z' G d de'      Z(edv re(Z)nedv re'Z)nedk  re&Z)n e e       ed g d!      Z* G d" d#e!      Z+ ed$g d%      Z,d& Z-d' Z. G d( d)e!      Z/ G d* d+e!      Z0y),z)
Implement python 3.8+ bytecode analysis
    N)
namedtupledefaultdictdeque)total_ordering)
UniqueDict	PYVERSIONALL_BINOPS_TO_OPERATORS_lazy_pformat)NEW_BLOCKERSCFGraph)Loc)UnsupportedBytecodeError   >   NOPPRECALL
LOAD_CONST
LOAD_DEREF      r      r      )Enumc                       e Zd ZdZdZdZy)CALL_INTRINSIC_1_Operandr      r   N)__name__
__module____qualname__INTRINSIC_STOPITERATION_ERRORUNARY_POSITIVEINTRINSIC_LIST_TO_TUPLE     U/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/numba/core/byteflow.pyr   r      s    ()%"#r'   r   r   
   r      c                   B    e Zd ZdZ eh d      Zd Zd Zd Zd Z	d Z
y)		BlockKindz?Kinds of block to make related code safer than just `str`.
    >   TRYLOOPWITHEXCEPTFINALLYWITH_FINALLYc                 2    || j                   v sJ || _        y N)_members_value)selfvalues     r(   __init__zBlockKind.__init__4   s    %%%r'   c                 B    t        t        |       | j                  f      S r7   )hashtyper9   r:   s    r(   __hash__zBlockKind.__hash__8   s    T$Z-..r'   c                     t        |t              r| j                  |j                  k  S t        dj	                  t        |                  Nzcannot compare to {!r}
isinstancer/   r9   	TypeErrorformatr?   r:   others     r(   __lt__zBlockKind.__lt__;   s:    eY';;--4;;DKHIIr'   c                     t        |t              r| j                  |j                  k(  S t        dj	                  t        |                  rC   rD   rH   s     r(   __eq__zBlockKind.__eq__A   s:    eY';;%,,..4;;DKHIIr'   c                 8    dj                  | j                        S )NzBlockKind({}))rG   r9   r@   s    r(   __repr__zBlockKind.__repr__G   s    %%dkk22r'   N)r    r!   r"   __doc__	frozensetr8   r<   rA   rJ   rL   rN   r&   r'   r(   r/   r/   *   s1      H/JJ3r'   r/   c                       e Zd ZdZd Zd Zedv rd Znedv rd Zn ee      d Z	d	 Z
d
 Zedv rd Zyedv rd Zy ee      )FlowziData+Control Flow analysis.

    Simulate execution to recover dataflow and controlflow information.
    c                 t    t         j                  dt        |d              || _        t	               | _        y )Nzbytecode dump:
%sc                 "    | j                         S r7   )dumpxs    r(   <lambda>zFlow.__init__.<locals>.<lambda>R   s    !&&( r'   )	lazy_func)_loggerdebugr
   	_bytecoder   block_infos)r:   bytecodes     r(   r<   zFlow.__init__P   s.    *#H8JK	M!%<r'   c                    t        | j                  ddd      }t        | j                  j                  j                        }|j
                  j                  |       t               }|j
                  rlt        j                  d|j
                         |j
                  j                         }||j                  vrt        j                  d|j                         t        j                  d|       |||j                  <   	 |j                  |       |j                         rnG| j!                  ||      rn4| j#                  |      r"| j%                  |       |j'                          nit        j                  d|j(                         |j                  j+                  |       |j-                         }|j
                  j/                  |       |j
                  rl| j1                  |j                         | j3                  |       t5        |j                  d	 
      D ]=  }t7        |      x| j8                  |j                  <   }t        j                  d||       ? y)a  Run a trace over the bytecode over all reachable path.

        The trace starts at bytecode offset 0 and gathers stack and control-
        flow information by partially interpreting each bytecode.
        Each ``State`` instance in the trace corresponds to a basic-block.
        The State instances forks when a jump instruction is encountered.
        A newly forked state is then added to the list of pending states.
        The trace ends when there are no more pending states.
        r   r&   )r^   pcnstack
blockstack)debug_filenamezpending: %sz	stack: %szstate.pc_initial: %szend state. edges=%sc                     | j                   S r7   )
pc_initialrV   s    r(   rX   zFlow.run.<locals>.<lambda>   s
    1<< r'   )keyzblock_infos %s:
%sN)Stater\   TraceRunnerfunc_idfilenamependingappendr   rZ   r[   popleftfinished_stackre   dispatchhas_terminated_run_handle_exception_is_implicit_new_block_guard_with_assplit_new_blockoutgoing_edgesaddget_outgoing_statesextend
_build_cfg_prune_phissortedadapt_state_infosr]   )r:   
firststaterunnerfirst_encounterstate
out_statessis          r(   runzFlow.runV   s    DNNq&(*
DNN,B,B,K,KLj)
 %, nnMM-8NN**,EFOO+k5<<84e<49 0 01OOE*++-55feD!66u= //6!113!  3U5I5IJ##E*"668
%%j15 nn: 	( FOO1GH 	<E6G6NNDU--.MM/;	<r'   r,   r   r   r   c                    |j                         sl|j                         r\|j                         j                  t        vr<|j                  |j                         j                         |j                  |       y|j                          |j                         s|j                         rt        j                  d|j                         |j                         |j                         }|j                  d      }|r|d   |j                  k(  rd }y |j!                  d|j                        }|j"                  |d<   |j$                  |d<   |j&                  |d	<   |j                  |j                  |
       yy y )Nr`   Tz3.11 exception %s PC=%sr0   endr   
end_offsetstack_depth
push_lastir`   extra_block)in_withhas_active_tryget_instopname_NO_RAISE_OPSforknext_adjust_except_stack
advance_pcis_in_exceptionrZ   r[   get_exception_pcget_top_blocktarget
make_blockr   depthlasti)r:   r   r   eheh_topeh_blocks         r(   rr   zFlow._run_handle_exception   s3   ==?((*NN$++=@

enn.33
4++E2  " }}5+@+@+BMM";"'"5"5"7D,,.B"007F&-299"<#'#(#3#3Eryy#3#I13.24((/13.

eiiX
F# ,Cr'   r*   c                    |j                         r|j                         j                  t        vr|j	                  |j                         j
                         |j                  d      }|j                  |       |j                  }i }||d   kD  r||d   z
  |d<   |d   }t        d      t        t        d      t        i|d      |d	<   ||d
<    |j                  dd|d   i| y|j                          y )Nr   r0   entry_stacknpophandlerr3   r4   kindnpushr   r`   r   Tr&   )r   r   r   r   r   r   r   pop_block_and_abover   r/   _EXCEPT_STACK_OFFSET_FINALLY_POPr   )r:   r   r   tryblkra   kwargsr   s          r(   rr   zFlow._run_handle_exception   s    $$&NN$++=@

enn.33
4,,U3))&1**F=11%+f].C%CF6N +h')=i(,# &/##w )0}%

6fUm6v6  "r'   c                 .   t               }|D ]  }|j                  }|j                  |       ! |D ]:  }|j                  D ])  }|j	                  |j                  |j
                  d       + < |j                  d       |j                          || _        y )Nr   )	r   re   add_noderv   add_edger`   set_entry_pointprocesscfgraph)r:   
all_statesgraphr   bedges         r(   rz   zFlow._build_cfg   s    	 	E  ANN1	   	=E,, =u//!<=	= 	a r'   c                 N  	 t         j                  dj                  dd             fd}	fd}	fd}fd} |       \  }	t         j                  dt        |              |       \  }} ||        |||       t         j                  d	j                  dd             y )
Nz
Prune PHIs<   -c                      t        t              } t               }j                  D ]A  }t        |j                        }t        |j                        }| |xx   ||z  z  cc<   ||z  }C | |fS r7   )r   setrn   
_used_regs_phis)	used_phisphi_setr   usedphisr   s        r(   get_used_phis_per_statez1Flow._prune_phis.<locals>.get_used_phis_per_state   so    #C(IeG  5++,5;;'% D4K/ 4	 
 g%%r'   c                  N   i } t        t              }j                  D ]C  }|j                  j	                         D ]$  \  }}|vr|| |<   ||   j                  ||f       & E t        j                  dt        |              t        j                  dt        |             | |fS )Nz
defmap: %szphismap: %s)	r   r   rn   _outgoing_phisitemsrw   rZ   r[   r
   )defmapphismapr   phirhsr   r   s        r(   find_use_defsz'Flow._prune_phis.<locals>.find_use_defs   s    F!#&G 3 % 4 4 : : < 3HC')&+sCL$$c5\2	33 MM,f(=>MM-w)?@7?"r'   c                 d   t        t              }	 d}t        t        | j	                                     D ]V  \  }}t        t        |            D ](  \  }}|v s|| |   z  }||   j                  ||f       * ||   }||z  sP||z  }d}X t        j                  dt        |              |sy)znAn iterative dataflow algorithm to find the definition
            (the source) of each PHI node.
            TFzchanging phismap: %sN)	r   r   r|   listr   rw   rZ   r[   r
   )	r   	blacklistchangingr   defsitesr   r   	to_remover   s	           r(   propagate_phi_mapz+Flow._prune_phis.<locals>.propagate_phi_map   s     $C(I %+D,A%B (MC&,T(^&< =
U'>$4H%cN..U|<= !*#I 8+ I-#'( 4mG6LM r'   c                    i }| j                         D ]  \  }}|D ]
  }||   ||<     t        j                  dt        |             t	        t
              }|D ]  }||   D ]  \  }}|||   |<     t        j                  dt        |             j                  D ]:  }|j                  j                          |j                  j                  ||          < y )Nzkeep phismap: %sznew_out: %s)
r   rZ   r[   r
   r   dictrn   r   clearupdate)	r   r   keepr   used_setr   new_outr   r   s	           r(   apply_changesz'Flow._prune_phis.<locals>.apply_changes  s    D#,??#4 -x# -C 'DI-- MM,mD.AB!$'G ."&s) .JC*-GEN3'.. MM-w)?@ <$$**,$$++GEN;<r'   zUsed_phis: %szDONE Prune PHIs)rZ   r[   centerr
   )
r:   r   r   r   r   r   r   r   r   r   s
    `       @r(   r{   zFlow._prune_phis   s    l))"c23	&	#	,	<  56	7o}Y'?@'/'"i)'..r378r'   c                     |j                         }|j                  | j                  j                  v ry|j                  t
        v ryy)NTF)r   offsetr\   labelsr   r   r:   r   insts      r(   rs   zFlow._is_implicit_new_block  s9    ~~;;$..///[[L(r'   r   c                      y r7   r&   )r:   r   s     r(   rt   zFlow._guard_with_as)  s    r'   r*   r,   r   r   c                     |j                         }|j                  dv r6| j                  |j                     j                  }|dk7  rd}t	        |      yy)zChecks if the next instruction after a SETUP_WITH is something
            other than a POP_TOP, if it is something else it'll be some sort of
            store which is not supported (this corresponds to `with CTXMGR as
            VAR(S)`).>   
SETUP_WITHBEFORE_WITHPOP_TOPGThe 'with (context manager) as (variable):' construct is not supported.N)r   r   r\   r   r   )r:   r   current_instnext_opmsgs        r(   rt   zFlow._guard_with_as-  s^    
 !>>+L""&CC..):):;BBi'9C2377 ( Dr'   N)r    r!   r"   rO   r<   r   r   rr   NotImplementedErrorrz   r{   rs   rt   r&   r'   r(   rR   rR   K   s{    (8<t 88	$6 
j	 	#, "),,
K9Z J	 
:	:	8 "),,r'   rR   c                 $    | j                  d      S )Nz$null$)
startswith)regs    r(   _is_null_temp_regr   =  s    >>(##r'   c                      e Zd ZdZd Zd Zd Zd Zd Ze	dv reZ
ne	dv rn ee	      d	 Zd
 Zd Zd Zd Ze	dv rd Zne	dv rn ee	      d Zd Zd Ze	dv reZne	dv rn ee	      e	dv rd Zne	dv rn ee	      e	dv rd Zne	dv rd Zne	dv rd Zn ee	      d Zd Zd Zd Ze	dv rd Zne	dv rn ee	      d Zd  Ze	dv r
d! Zd" Z d# Z!ne	dv rn ee	      e	d$v reZ"eZ#ne	d%v rn ee	      e	dv reZ$eZ%ne	dv rn ee	      d& Z&d' Z'd( Z(d) Z)d* Z*d+ Z+d, Z,d- Z-d. Z.d/ Z/d0 Z0d1 Z1d2 Z2d3 Z3d4 Z4d5 Z5d6 Z6e	d$v rd7 Z7ne	d%v rn ee	      e	d$v rd8 Z8ne	d%v rn ee	      d9 Z9e9Z:e9Z;e	d$v re9Z<e9Z=ne	d%v rn ee	      d: Z>e>Z?e>Z@d; ZAd< ZBd= ZCd> ZDd? ZEd@ ZFdA ZGdB ZHdC ZIdD ZJeJZKdE ZLdF ZMdG ZNe	d$v rdH ZOne	d%v rn ee	      dI ZPe	dJv rdK ZQne	dv rdL ZQn ee	      dM ZRdN ZSe	dv rdO ZTne	dPv rdQ ZTne	d%v rn ee	      dR ZUdS ZVdT ZWdU ZXdV ZYdW ZZe	dv rne	dv rdX Z[n ee	      dY Z\dZ Z]d[ Z^d\ Z_e	dJv rd] Z`ne	dv rd^ Z`n ee	      d_ Zae	dv rne	dv rd` Zbn ee	      da Zcdb Zddc Zedd Zfde Zgdf Zhe	dv rdg Zine	dv rn ee	      e	dv rdh Zjne	div rdj Zjne	dv rdk Zjn ee	      dl Zke	d$v rdm Zlne	d%v rn ee	      dn Zmdo Zndp Zodq Zpdr Zqds Zrdt Zsdu Ztdv Zudw Zvdx Zwdy Zxdz Zyd{ Zzd| Z{d} Z|d~ Z}d Z~d Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZeZeZeZeZd ZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZddZd Zd Zd Ze	dv rne	dv rd Zn ee	      d Zd Ze	dJv rd Zne	dv rd Zn ee	      e	d$v rne	dv rd Zne	dv rd Zn ee	      d Ze	dv rd Zne	dv rn ee	      e	dv rd Zye	dv ry ee	      )rh   zLTrace runner contains the states for the trace and the opcode dispatch.
    c                 N    || _         t               | _        t               | _        y r7   )rc   r   rk   r   rn   )r:   rc   s     r(   r<   zTraceRunner.__init__D  s    ,wr'   c                 .    t        | j                  |      S r7   )r   rc   )r:   linenos     r(   get_debug_loczTraceRunner.get_debug_locI  s    4&&//r'   c                    t         dv rg|j                  rs|j                  rg|j                  d   }|d   }|*||j                  k  r|j                  j                          nn&|j                  rNnt         dv rnt	        t               |j                         }|j                  dk7  rAt        j                  d|j                  |       t        j                  d|j                         t        | dj                  |j                        d       }|
 |||       y d	|j                  z  }t        || j                  |j                        
      )Nr   r   r   CACHEzdispatch pc=%s, inst=%szstack %szop_{}z$Use of unsupported opcode (%s) foundloc)r   _blockstackre   popr   r   r   rZ   r[   r   ro   getattrrG   r   r   r   )r:   r   topblkblk_endr   fnr   s          r(   rp   zTraceRunner.dispatchL  s   <<  ''"..r2F$UmG*w%:J:J/J))--/ '' *$%i00~~;;'!MM3UYYEMM*ell3T7>>$++6=>udO84;;FC*3/3/A/A$++/NP Pr'   c                     |j                  d      }|j                  |       |j                  }i }|d   }||kD  r||z
  |d<   d}|d   r|dz  }||d<    |j                  d
d|d   i| y	)zo
        Adjust stack when entering an exception handler to match expectation
        by the bytecode.
        r0   r   r      r   r   r`   r   Nr&   )r   r   r   r   )r:   r   r   ra   r   expected_depthextra_stacks          r(   r   z TraceRunner._adjust_except_stackg  s    
 $$U+!!&)"".N"#n4F6N,1K%w

.fUm.v.r'   c                 &    |j                  |       y r7   rl   r   s      r(   op_NOPzTraceRunner.op_NOP{      Tr'   r   r   c                 &    |j                  |       y r7   r  r   s      r(   	op_RESUMEzTraceRunner.op_RESUME  r	  r'   c                 &    |j                  |       y r7   r  r   s      r(   op_CACHEzTraceRunner.op_CACHE  r	  r'   c                 &    |j                  |       y r7   r  r   s      r(   
op_PRECALLzTraceRunner.op_PRECALL  r	  r'   c                 d    |j                  |j                                |j                  |       y r7   )push	make_nullrl   r   s      r(   op_PUSH_NULLzTraceRunner.op_PUSH_NULL  s!    

5??$%Tr'   c                 d    |j                  |j                                |j                  |       y r7   )r  	make_temprl   r   s      r(   op_RETURN_GENERATORzTraceRunner.op_RETURN_GENERATOR  s#     	

5??$%Tr'   r   r   c                     |j                         }|j                         }|j                         }|j                  ||||       |j                  |       y )Nr;   resstrvarr   r  rl   r  )r:   r   r   r;   r  r  s         r(   op_FORMAT_SIMPLEzTraceRunner.op_FORMAT_SIMPLE  sD    IIKE__&F//#CLLUFLCJJsOr'   r*   r,   r   c                    |j                   dk7  r(d}t        || j                  |j                              |j	                         }|j                         }|j                         }|j                  ||||       |j                  |       y)aF  
        FORMAT_VALUE(flags): flags argument specifies format spec which is
        not supported yet. Currently, we just call str() on the value.
        Pops a value from stack and pushes results back.
        Required for supporting f-strings.
        https://docs.python.org/3/library/dis.html#opcode-FORMAT_VALUE
        r   z*format spec in f-strings not supported yetr   r  N)argr   r   r   r   r  rl   r  )r:   r   r   r   r;   r  r  s          r(   op_FORMAT_VALUEzTraceRunner.op_FORMAT_VALUE  sy     88q=>C*3/3/A/A$++/NP P		"ooTC?

3r'   c           	      r   |j                   }t        t        t        |      D cg c]  }|j	                          c}            }|dk(  r|j                         g}n)t        |dz
        D cg c]  }|j                          }}|j                  |||       |j                  |d          yc c}w c c}w )z
        BUILD_STRING(count): Concatenates count strings from the stack and
        pushes the resulting string onto the stack.
        Required for supporting f-strings.
        https://docs.python.org/3/library/dis.html#opcode-BUILD_STRING
        r   r  )stringstmpsr   Nr   r   reversedranger   r  rl   r  )r:   r   r   count_r#  r$  s          r(   op_BUILD_STRINGzTraceRunner.op_BUILD_STRING  s     xeEl C CDEA:OO%&D/4UQY/?@!EOO%@D@T76

48 !D
 As   B/-B4c                 $    |j                          y r7   r   r   s      r(   
op_POP_TOPzTraceRunner.op_POP_TOP  s    		r'   c                     |j                         }|j                         }|j                  |||       |j                  |       y )N)valr  )r  r   rl   r  )r:   r   r   r  toss        r(   
op_TO_BOOLzTraceRunner.op_TO_BOOL  s6    //#C))+CLL3CL0JJsOr'   c                     |j                         }|j                  dz	  }|j                  |||       |j                  |       |j                  dz  r |j                  |j	                                y y Nr  )idxr  r  r   rl   r  r  r:   r   r   r  r4  s        r(   op_LOAD_GLOBALzTraceRunner.op_LOAD_GLOBAL  s[    //#C((a-CLL3CL0JJsOxx!|

5??,- r'   r,   r   c                     |j                         }|j                  dz	  }|j                  |||       |j                  dz  r|j                  |j	                                |j                  |       y r3  r5  r6  s        r(   r7  zTraceRunner.op_LOAD_GLOBAL  sV    //#C((a-CLL3CL0xx!|

5??,-JJsOr'   r   c                 l    |j                         }|j                  ||       |j                  |       y Nr  r  rl   r  r:   r   r   r  s       r(   r7  zTraceRunner.op_LOAD_GLOBAL  s)    //#CLL3L'JJsOr'   c                 &    |j                  |       y r7   r  r   s      r(   op_COPY_FREE_VARSzTraceRunner.op_COPY_FREE_VARS   r	  r'   c                 &    |j                  |       y r7   r  r   s      r(   op_MAKE_CELLzTraceRunner.op_MAKE_CELL  r	  r'   c                 l    |j                         }|j                  ||       |j                  |       y r;  r=  r>  s       r(   op_LOAD_DEREFzTraceRunner.op_LOAD_DEREF  )    ooTs#

3r'   c                     |j                  d      d|j                   z   }|j                  |       |j                  ||       y )Nconst.r<  )r  r   r  rl   r>  s       r(   op_LOAD_CONSTzTraceRunner.op_LOAD_CONST  s:    oog&1TXXJ7

3Ts#r'   c                     d|j                   cxk  rdk  sJ  J |j                  d      d|j                    z   }|j                  |       |j                  ||       y )Nr      rG  rH  r<  )r   r  r  rl   r>  s       r(   op_LOAD_SMALL_INTzTraceRunner.op_LOAD_SMALL_INT  sW    &3&&&&&//'*q
^;CJJsOLL3L'r'   c                    |j                         }|j                         }t        dv r@|j                  |       |j                  dz  r|j                  |j                                nqt        dv r@|j                  dz  r|j                  |j                                |j                  |       n)t        dv r|j                  |       nt        t              |j                  |||       y )Nr  r  r   r)   itemr  )r   r  r   r  r   r  r   rl   )r:   r   r   rP  r  s        r(   op_LOAD_ATTRzTraceRunner.op_LOAD_ATTR  s    yy{oo**JJsOxx!|

5??,-*$xx!|

5??,-JJsO,,JJsO%i00T#.r'   c                 X   t         dv r	 |j                  |      }n)t         dv r|j                  |      }nt        t               |j                  |      }	|j                  ||	       |j                  |	       y # t        $ r |j                  }t	        |j
                        }t	        |j                        }t	        |j                        }||z   }d|j                  |z
  cxk  r|k  sJ  J |j                         }	|j                  ||	d       |j                  |	       Y y w xY w)Nr  r   T)r  as_load_derefr  r<  )r   get_varname
IndexErrorr\   lenco_varnamesco_freevarsco_cellvarsr   r  rl   r  r   )
r:   r   r   namebcnum_varnamesnum_freevarsnum_cellvarsmax_fast_localr  s
             r(   op_LOAD_FASTzTraceRunner.op_LOAD_FAST.  s   **((." 55$$T*D%i00ood#Ts#

3-   __"2>>2"2>>2"2>>2!-!<DHH|3DnDDDDDoo'Ts$?

3s   A; ;B+D)(D)c                 $   |j                   }|dz	  }|dz  }|j                  |      }|j                  |      }|j                  |      }|j                  |      }	|j                  |||	       |j	                  |       |j	                  |	       y )N      )res1res2)r   get_varname_by_argr  rl   r  )
r:   r   r   opargoparg1oparg2name1name2rd  re  s
             r(   op_LOAD_FAST_LOAD_FASTz"TraceRunner.op_LOAD_FAST_LOAD_FASTK  s    HHEaZFRZF,,V4E,,V4E??5)D??5)DLLDtL4JJtJJtr'   c                     |j                   }|dz  }|j                         }|j                  |      }|j                  |      }|j	                  |||       |j                  |       y )Nrc  )store_valueload_res)r   r   rf  r  rl   r  )r:   r   r   rg  ri  rn  	load_namero  s           r(   op_STORE_FAST_LOAD_FASTz#TraceRunner.op_STORE_FAST_LOAD_FASTW  s[    HHERZF))+K008Iy1HLL;LJJJx r'   c                 l    |j                         }|j                         }|j                  |||       y )N)value1value2r   rl   )r:   r   r   rs  rt  s        r(   op_STORE_FAST_STORE_FASTz$TraceRunner.op_STORE_FAST_STORE_FASTa  s*    YY[FYY[FLLfVL<r'   r   r)   c                 &    |j                  |       y r7   r  r   s      r(   op_DELETE_FASTzTraceRunner.op_DELETE_FAST|  r	  r'   c                 J    |j                         }|j                  ||       y )N)r   ru  )r:   r   r   r   s       r(   op_DELETE_ATTRzTraceRunner.op_DELETE_ATTR  s    T&)r'   c                 l    |j                         }|j                         }|j                  |||       y )N)r   r;   ru  )r:   r   r   r   r;   s        r(   op_STORE_ATTRzTraceRunner.op_STORE_ATTR  s*    		T&6r'   c                 J    |j                         }|j                  ||       y N)r;   ru  r:   r   r   r;   s       r(   op_STORE_DEREFzTraceRunner.op_STORE_DEREF      		T'r'   c                 J    |j                         }|j                  ||       y r~  ru  r  s       r(   op_STORE_FASTzTraceRunner.op_STORE_FAST  r  r'   c           	         |j                         }|j                         }|j                         }|j                         }|j                         }|j                         }|j                  |||||||       |j                  |       y)z"
        TOS = TOS1[TOS:]
        )basestartr  slicevarindexvarnonevarNr  	r:   r   r   r0  tos1r  r  r  r  s	            r(   
op_SLICE_1zTraceRunner.op_SLICE_1  s}     iikyy{oo??$??$//# 	 	
 	

3r'   c           	         |j                         }|j                         }|j                         }|j                         }|j                         }|j                         }|j                  |||||||       |j                  |       y)z"
        TOS = TOS1[:TOS]
        )r  stopr  r  r  r  Nr  r  s	            r(   
op_SLICE_2zTraceRunner.op_SLICE_2  s}     iikyy{oo??$??$//# 	 	
 	

3r'   c           	         |j                         }|j                         }|j                         }|j                         }|j                         }|j                         }|j                  |||||||       |j                  |       y)z&
        TOS = TOS2[TOS1:TOS]
        )r  r  r  r  r  r  Nr  )	r:   r   r   r0  r  tos2r  r  r  s	            r(   
op_SLICE_3zTraceRunner.op_SLICE_3  s|     iikyy{yy{oo??$??$ 	 	
 	

3r'   c                     |j                         }|j                         }|j                         }|j                         }|j                         }|j                  ||||||       y)z
        TOS[:] = TOS1
        )r  r;   r  r  r  Nr   r  rl   )r:   r   r   r0  r;   r  r  r  s           r(   op_STORE_SLICE_0zTraceRunner.op_STORE_SLICE_0  sa     iik		??$??$//# 	 	
r'   c           	          |j                         }|j                         }|j                         }|j                         }|j                         }|j                         }|j                  |||||||       y)z#
        TOS1[TOS:] = TOS2
        )r  r  r  r;   r  r  Nr  	r:   r   r   r0  r  r;   r  r  r  s	            r(   op_STORE_SLICE_1zTraceRunner.op_STORE_SLICE_1  so     iikyy{		??$??$//# 	 	
r'   c           	          |j                         }|j                         }|j                         }|j                         }|j                         }|j                         }|j                  |||||||       y)z#
        TOS1[:TOS] = TOS2
        )r  r  r;   r  r  r  Nr  r  s	            r(   op_STORE_SLICE_2zTraceRunner.op_STORE_SLICE_2  so     iikyy{		??$??$//# 	 	
r'   c           	          |j                         }|j                         }|j                         }|j                         }|j                         }|j                         }|j                  |||||||       y)z'
        TOS2[TOS1:TOS] = TOS3
        )r  r  r  r;   r  r  Nr  )	r:   r   r   r0  r  r  r;   r  r  s	            r(   op_STORE_SLICE_3zTraceRunner.op_STORE_SLICE_3	  sn     iikyy{yy{		??$??$ 	 	
r'   c                     |j                         }|j                         }|j                         }|j                         }|j                  |||||       y)z
        del TOS[:]
        )r  r  r  r  Nr  )r:   r   r   r0  r  r  r  s          r(   op_DELETE_SLICE_0zTraceRunner.op_DELETE_SLICE_0  sP     iik??$??$//#sX 	 	
r'   c                     |j                         }|j                         }|j                         }|j                         }|j                         }|j                  ||||||       y)z 
        del TOS1[TOS:]
        )r  r  r  r  r  Nr  r:   r   r   r0  r  r  r  r  s           r(   op_DELETE_SLICE_1zTraceRunner.op_DELETE_SLICE_1*  sa     iikyy{??$??$//# 	 	
r'   c                     |j                         }|j                         }|j                         }|j                         }|j                         }|j                  ||||||       y)z 
        del TOS1[:TOS]
        )r  r  r  r  r  Nr  r  s           r(   op_DELETE_SLICE_2zTraceRunner.op_DELETE_SLICE_2<  sa     iikyy{??$??$//# 	 	
r'   c                     |j                         }|j                         }|j                         }|j                         }|j                         }|j                  ||||||       y)z$
        del TOS2[TOS1:TOS]
        )r  r  r  r  r  Nr  )r:   r   r   r0  r  r  r  r  s           r(   op_DELETE_SLICE_3zTraceRunner.op_DELETE_SLICE_3N  s\     iikyy{yy{??$??$t4cH 	 	
r'   c                    |j                   }|dk(  r'|j                         }|j                         }|}|}d}nG|dk(  r7|j                         }|j                         }|j                         }	|	}|}|}nt        d      |j                         }
|j                         }|j	                  ||||||
       |j                  |       y)z<
        slice(TOS1, TOS) or slice(TOS2, TOS1, TOS)
           Nr   unreachable)r  r  stepr  r  )r   r   	Exceptionr  rl   r  )r:   r   r   argcr0  r  r  r  r  r  r  r  s               r(   op_BUILD_SLICEzTraceRunner.op_BUILD_SLICE\  s     xx19))+C99;DEDDQY))+C99;D99;DEDDM**??$ooDtx 	 	
 	

3r'   c           	         |j                         }|j                         }|j                         }|j                         }|j                         }|j                         }|j                  |||||||       |j                  |       y )N)r  r   	containerr  r  temp_resr  )	r:   r   r   r   r  r  r  r  r  s	            r(   op_BINARY_SLICEzTraceRunner.op_BINARY_SLICEx  su    ))+CIIKE		I(H//#C(HLLEsiS!H   JJsOr'   c           	          |j                         }|j                         }|j                         }|j                         }|j                         }|j                         }|j                  |||||||       y )N)r  r   r  r;   r  r  r  )	r:   r   r   r   r  r  r;   r  r  s	            r(   op_STORE_SLICEzTraceRunner.op_STORE_SLICE  sg    ))+CIIKE		IIIKE(H//#CLLEsiu(  r'   c                     |j                         }|j                  ||       |j                         }|j                  }|j	                  |       ||k7  r|j	                  |       y y )Npredr   )r   rl   get_jump_targetr   r   )r:   r   r   r  target_inst	next_insts         r(   _op_POP_JUMP_IFzTraceRunner._op_POP_JUMP_IF  s_    yy{T%**,II	 	

i
 )#JJ+J& $r'   c                     |j                         }|j                  ||       |j                  |j                  d       |j                  |j	                                y )Nr  r  r`   r   r   )get_tosrl   r   r   r  )r:   r   r   r  s       r(   _op_JUMP_IF_OR_POPzTraceRunner._op_JUMP_IF_OR_POP  sH    }}T%

diia
(

d**,
-r'   c                 (    | j                  ||       y r7   r  r   s      r(   op_POP_JUMP_FORWARD_IF_NONEz'TraceRunner.op_POP_JUMP_FORWARD_IF_NONE      UD)r'   c                 (    | j                  ||       y r7   r  r   s      r(   op_POP_JUMP_FORWARD_IF_NOT_NONEz+TraceRunner.op_POP_JUMP_FORWARD_IF_NOT_NONE  r  r'   c                 (    | j                  ||       y r7   r  r   s      r(   op_POP_JUMP_BACKWARD_IF_NONEz(TraceRunner.op_POP_JUMP_BACKWARD_IF_NONE  r  r'   c                 (    | j                  ||       y r7   r  r   s      r(    op_POP_JUMP_BACKWARD_IF_NOT_NONEz,TraceRunner.op_POP_JUMP_BACKWARD_IF_NOT_NONE  r  r'   c                 (    | j                  ||       y r7   r  r   s      r(   op_POP_JUMP_FORWARD_IF_FALSEz(TraceRunner.op_POP_JUMP_FORWARD_IF_FALSE  r  r'   c                 (    | j                  ||       y r7   r  r   s      r(   op_POP_JUMP_FORWARD_IF_TRUEz'TraceRunner.op_POP_JUMP_FORWARD_IF_TRUE  r  r'   c                 (    | j                  ||       y r7   r  r   s      r(   op_POP_JUMP_BACKWARD_IF_FALSEz)TraceRunner.op_POP_JUMP_BACKWARD_IF_FALSE  r  r'   c                 (    | j                  ||       y r7   r  r   s      r(   op_POP_JUMP_BACKWARD_IF_TRUEz(TraceRunner.op_POP_JUMP_BACKWARD_IF_TRUE  r  r'   c                 f    |j                  |       |j                  |j                                y Nr   rl   r   r  r   s      r(   op_JUMP_FORWARDzTraceRunner.op_JUMP_FORWARD  %    T

d**,
-r'   c                 f    |j                  |       |j                  |j                                y r  r  r   s      r(   op_JUMP_BACKWARDzTraceRunner.op_JUMP_BACKWARD  r  r'   c                 f    |j                  |       |j                  |j                                y r  r  r   s      r(   op_JUMP_ABSOLUTEzTraceRunner.op_JUMP_ABSOLUTE  r  r'   c                     |j                  d      d   }|j                  ||       |j                          |j                  |       y )Nr1   r   r   r   )r   rl   	pop_blockr   )r:   r   r   r   s       r(   op_BREAK_LOOPzTraceRunner.op_BREAK_LOOP  s?    !!&)%0Ts#

c
r'   c                     |j                  ||j                         |j                                |j                          y )Nretvalcastval)rl   r   r  	terminater   s      r(   op_RETURN_VALUEzTraceRunner.op_RETURN_VALUE  s+    T%))+u7HIr'   c                     |j                  d      }|j                  |||j                                |j                          y )NrG  r  )r  rl   r  r>  s       r(   op_RETURN_CONSTzTraceRunner.op_RETURN_CONST  s3    //'*CLLc5??3DLEOOr'   c                     |j                         }|j                         }|j                  |||       |j                  |       y N)r;   r  r  r:   r   r   r/  r  s        r(   op_YIELD_VALUEzTraceRunner.op_YIELD_VALUE  6    iikooT#.

3r'   r   c                 r   |j                   dk(  r8d }|j                         rQt        d| j                  |j                              |j                   dk(  r|j                         }nt        d      |j                  ||       |j                         r| j                  |       y |j                          y )Nr   4The re-raising of an exception is not yet supported.r   r  )Multiple argument raise is not supported.exc)
r   r   r   r   r   r   
ValueErrorrl   r   r  r:   r   r   r  s       r(   op_RAISE_VARARGSzTraceRunner.op_RAISE_VARARGS  s    xx1} '')2N ..t{{;  Qiik !LMMLL3L'##%))%0!r'   c                 p   t        |j                  d      d u|j                  d      d ug      }|j                  dk(  r*d }|rQt        d| j	                  |j
                              |j                  dk(  r|j                         }nt        d      |j                  ||       |j                          y )	Nr3   r4   r   r  r   r  r  r  )
anyr   r   r   r   r   r   r  rl   r  )r:   r   r   in_exc_blockr  s        r(   r  zTraceRunner.op_RAISE_VARARGS  s    ##H-T9##I.d:  L xx1}2N ..t{{;  Qiik !LMMLL3L'OOr'   c                     g }t        t              D ]4  }|j                         }|j                  |       |j	                  |       6 |j                  ||       y )N)temps)r'  r   r  rl   r  )r:   r   r   r  itmps         r(   op_BEGIN_FINALLYzTraceRunner.op_BEGIN_FINALLY(  sQ    +, 	A//#CLLJJsO	 	T'r'   c                 L    |j                         }|j                  |d          y )Nr   )r  reset_stackr:   r   r   blks       r(   op_END_FINALLYzTraceRunner.op_END_FINALLY0  s!    oo#m,-r'   c                 $    |j                          y r7   r,  r   s      r(   
op_END_FORzTraceRunner.op_END_FOR5      IIKr'   rN  c                 D    |j                          |j                          y r7   r,  r   s      r(   r  zTraceRunner.op_END_FOR8  s    IIKIIKr'   c                 r    |j                   dk7  r(d}t        || j                  |j                              y )Nr   zGUnsupported use of a bytecode related to try..finally or a with-contextr   )r   r   r   r   )r:   r   r   r   s       r(   op_POP_FINALLYzTraceRunner.op_POP_FINALLY@  s<    88q=(C*3/3/A/A$++/NP P r'   c                      y r7   r&   r   s      r(   op_CALL_FINALLYzTraceRunner.op_CALL_FINALLYH  s    r'   c                 $    |j                          y r7   )r  r   s      r(   op_WITH_EXCEPT_STARTz TraceRunner.op_WITH_EXCEPT_STARTK  s    r'   c                 &    |j                  |       y r7   r  r   s      r(   op_WITH_CLEANUP_STARTz!TraceRunner.op_WITH_CLEANUP_STARTN      Tr'   c                 &    |j                  |       y r7   r  r   s      r(   op_WITH_CLEANUP_FINISHz"TraceRunner.op_WITH_CLEANUP_FINISHR  r
  r'   c                 d    |j                  |j                  d|j                                      y )Nr1   r   r   )
push_blockr   r  r   s      r(   op_SETUP_LOOPzTraceRunner.op_SETUP_LOOPV  s2    ((*  	
r'   c                 B   |j                         }|j                         }|j                  d      }|j                  |       |j                  |       |j                  }|j	                  |j
                        }|g}|j                  D ]-  }	|	j                  |j                  k(  s|j                  |	       / t        d |D              }
|j                  ||||
       |j                  |j                  d|
             |j                  |j
                         y )Nsetup_with_exitfnprefixc              3   4   K   | ]  }|j                     y wr7   r   .0r   s     r(   	<genexpr>z-TraceRunner.op_BEFORE_WITH.<locals>.<genexpr>u       1bff1   )contextmanagerexitfnr   r2   r  r   )r   r  r  r\   find_exception_entryr   exception_entriesr   rl   maxr  r   r   )r:   r   r   cmyieldedr  r[  ehhead	ehrelatedr   r   s              r(   op_BEFORE_WITHzTraceRunner.op_BEFORE_WITHb  s     Boo'G__,?_@FJJvJJw B,,TYY7FI** )99-$$R() 1y11CLLbSLI   !  JJ$))J$r'   c                 l   |j                         }|j                         }|j                  d      }|j                  |||       |j                  |       |j                  |       |j	                  |j                  d|j                                      |j                  |j                         y )Nr  r  )r  r  r2   r  r   )	r   r  rl   r  r  r   r  r   r   )r:   r   r   r   r!  r  s         r(   op_SETUP_WITHzTraceRunner.op_SETUP_WITH  s    YY[//#(;<T"V<

6

7((*  	
 	

dii
 r'   c           	      x    |j                  |d d      }|j                  ||j                  d|d|             y )NF)r   r   r  r0   )r   r   r  r   r   )r   r   )r:   r   r   r   r   handler_blocks         r(   
_setup_tryzTraceRunner._setup_try  sW     (( ) 
 	

((!%	 )  	 	
r'   c                     |j                         }|j                  |j                  d             |j                  |       y )N	exception)r   r  r  )r:   r   r   r0  s       r(   op_PUSH_EXC_INFOzTraceRunner.op_PUSH_EXC_INFO  s-    iik

5??;/0

3r'   c                     |j                  |       | j                  d||j                  |j                                y )Nr4   )r   r   )rl   r)  r   r  r   s      r(   op_SETUP_FINALLYzTraceRunner.op_SETUP_FINALLY  s5    Tu499$2F2F2H 	 	
r'   c                 $    |j                          y r7   r,  r   s      r(   op_POP_EXCEPTzTraceRunner.op_POP_EXCEPT  r   r'   c                 J   |j                         }|d   t        d      t        d      hvr,t        d|d    | j                  |j                              |j                          |j                          |j                          |j                  |j                         y )Nr   r3   r4   z$POP_EXCEPT got an unexpected block: r   r   )r  r/   r   r   r   r   r   r   r  s       r(   r0  zTraceRunner.op_POP_EXCEPT  s    //#C6{9X#6	)8L"MM.:3v;-H**4;;7  IIKIIKIIKJJ$))J$r'   c                     |j                         }|d   t        d      k(  r|j                  |d       n$|d   t        d      k(  r|j                  |d       |j                  |j                         y )Nr   r0   try)r   r2   withr   )r  r/   rl   r   r   r  s       r(   op_POP_BLOCKzTraceRunner.op_POP_BLOCK  sb    oov;)E**LLEL*[If--LLFL+

dii
 r'   c                     |j                         }|j                         }|j                         }|j                  ||||       |j                  |       y )N)indexr   r  r  )r:   r   r   r7  r   r  s         r(   op_BINARY_SUBSCRzTraceRunner.op_BINARY_SUBSCR  sC    IIKEYY[F//#CLLU6sLCJJsOr'   c                     |j                         }|j                         }|j                         }|j                  ||||       y )N)r   r7  r;   ru  )r:   r   r   r7  r   r;   s         r(   op_STORE_SUBSCRzTraceRunner.op_STORE_SUBSCR  s7    				T&UCr'   c                 l    |j                         }|j                         }|j                  |||       y )N)r   r7  ru  )r:   r   r   r7  r   s        r(   op_DELETE_SUBSCRzTraceRunner.op_DELETE_SUBSCR  s*    		T&6r'   c           	         |j                   }t        t        t        |      D cg c]  }|j	                          c}            }t
        dv r3|j	                         }|j	                         }t        |      s|g|}d }nNt
        dk  rE|j	                         }	|j	                         }
t        |
      r|	}n|
}|	g|}|j                         }|j                         }|j                  |||       |j                  |       y c c}w )Nr  r   funcargskw_namesr  )r   r   r&  r'  r   r   r   pop_kw_namesr  rl   r  )r:   r   r   nargr)  r@  null_or_selfcallablerA  callable_or_firstargnull_or_callabler  s               r(   op_CALLzTraceRunner.op_CALL  s    xxH5;?aeiik?@A** 99;Lyy{H$\2$,t,H #(99; $yy{ !12/+,4t4))+HooTthCP

3) @s   Dc                 :    |j                  |j                         y r7   )set_kw_namesr   r   s      r(   op_KW_NAMESzTraceRunner.op_KW_NAMES  s    488$r'   c           	      $   |j                   }t        t        t        |      D cg c]  }|j	                          c}            }|j	                         }|j                         }|j                  ||||       |j                  |       y c c}w )N)r?  r@  r  r%  )r:   r   r   rC  r)  r@  r?  r  s           r(   op_CALL_FUNCTIONzTraceRunner.op_CALL_FUNCTION  sk    xxH5;?aeiik?@Ayy{ooT4S9

3 @s   Bc           	      F   |j                   }|j                         }t        t        t	        |      D cg c]  }|j                          c}            }|j                         }|j                         }|j                  |||||       |j                  |       y c c}w )N)r?  r@  namesr  )r   r   r   r&  r'  r  rl   r  )	r:   r   r   rC  rO  r)  r@  r?  r  s	            r(   op_CALL_FUNCTION_KWzTraceRunner.op_CALL_FUNCTION_KW  sx    xx		H5;?aeiik?@Ayy{ooT4u#F

3 @s   Bc           	         |j                   }|j                         }t        t        t	        |      D cg c]  }|j                          c}            }|j                         }|j                         }t        |      s|g|}|j                         }	|j                  |||||	       |j                  |	       y c c}w )Nr>  )	r   r   r   r&  r'  r   r  rl   r  )
r:   r   r   rC  rA  r)  r@  null_or_firstargrE  r  s
             r(   
op_CALL_KWzTraceRunner.op_CALL_KW  s    88Dyy{HuT{!C!%))+!CDED$yy{yy{H$%56(040//#CLLH4(   "JJsO "Ds   B>c                    |j                         }t        |      rd }|j                         }|j                          |j                         }|j                         }|j                  |||||       |j	                  |       y )Nr?  varargvarkwargr  )r   r   r  rl   r  r:   r   r   rW  rV  r?  r  s          r(   op_CALL_FUNCTION_EXzTraceRunner.op_CALL_FUNCTION_EX,  sn     yy{H *YY[FIIK99;D//#CLLD(   "JJsOr'   )r   c                    |j                   dz  r|j                         }nd }|j                         }|j                          |j                         }|j                         }|j                  |||||       |j	                  |       y )Nr  rU  )r   r   r  rl   r  rX  s          r(   rY  zTraceRunner.op_CALL_FUNCTION_EX<  so    xx!| 99;YY[FIIK99;D//#CLLD(   "JJsOr'   c                    |j                   dz  r|j                         }nd }|j                         }|j                         }t        dv r+t        |j	                  d            r)|j                          nt        dv rnt        t              |j                         }|j                  |||||       |j                  |       y )Nr  r8  r   rU  )	r   r   r   r   peekr   r  rl   r  rX  s          r(   rY  zTraceRunner.op_CALL_FUNCTION_EXL  s    xx!| 99;YY[F99;D..$UZZ]3IIKj())44//#CLLD(   "JJsOr'   c                 X   t        |      D cg c]  }|j                          }}|j                          t        |      D cg c]  }|j                          }}|j	                  |||       |D ]  }|j                  |        |D ]  }|j                  |        y c c}w c c}w )N)origduped)r'  r   reverser  rl   r  )r:   r   r   r(  r)  r^  r_  r/  s           r(   	_dup_topxzTraceRunner._dup_topxc  s    %*5\2		22 -2%L9q"99TE2 	CJJsO	 	CJJsO	 3 :s   B"B'c                    	 t        |j                        }|t        j                  k(  r$|j                  ||       |j                          y |t        j                  k(  rG|j                         }|j                         }|j                  ||||       |j                  |       y |t        j                  k(  rG|j                         }|j                         }|j                  ||||       |j                  |       y t        |      # t        $ r9 d|j                   d}| j                  |j                        }t        ||      w xY w)Nzop_CALL_INTRINSIC_1()r   )operand)rd  r;   r  )rd  
const_listr  )r   r   rF   r   r   r   ci1opr#   rl   r  r$   r   r  r  r%   r   )	r:   r   r   rd  r   r   r/  r  r0  s	            r(   op_CALL_INTRINSIC_1zTraceRunner.op_CALL_INTRINSIC_1p  s+   =2488<
 %===T73!E000iikoo'T7#&C  1

3E999iikoo'T7(+  6

3)'22/  =,TXXJa8((5.s<<=s   D AEc                 v    |j                   }d|cxk  rdk  sJ d        J d       | j                  |||       y )Nr  r   zInvalid DUP_TOPX count)r   ra  )r:   r   r   r(  s       r(   op_DUP_TOPXzTraceRunner.op_DUP_TOPX  s<    EQ8 888 88udE*r'   c                 ,    | j                  ||d       y )Nr  r(  ra  r   s      r(   
op_DUP_TOPzTraceRunner.op_DUP_TOP      ud!,r'   c                 ,    | j                  ||d       y )Nr  rk  rl  r   s      r(   op_DUP_TOP_TWOzTraceRunner.op_DUP_TOP_TWO  rn  r'   c                 X    |j                  |j                  |j                               y r7   )r  r\  r   r   s      r(   op_COPYzTraceRunner.op_COPY  s    

5::dhh'(r'   c                 :    |j                  |j                         y r7   )swapr   r   s      r(   op_SWAPzTraceRunner.op_SWAP  s    

488r'   c                     |j                         }|j                         }|j                  |       |j                  |       y r7   r   r  )r:   r   r   firstseconds        r(   
op_ROT_TWOzTraceRunner.op_ROT_TWO  s0    		

5

6r'   c                     |j                         }|j                         }|j                         }|j                  |       |j                  |       |j                  |       y r7   rw  )r:   r   r   rx  ry  thirds         r(   op_ROT_THREEzTraceRunner.op_ROT_THREE  sG    				

5

5

6r'   c                    |j                         }|j                         }|j                         }|j                         }|j                  |       |j                  |       |j                  |       |j                  |       y r7   rw  )r:   r   r   rx  ry  r|  forths          r(   op_ROT_FOURzTraceRunner.op_ROT_FOUR  s^    						

5

5

5

6r'   c                    |j                   }|j                         }t        |      D cg c]  }|j                          }}|j                         }|j	                  ||||       t        |      D ]  }|j                  |        y c c}w )N)iterablestorestupleobj)r   r   r'  r  rl   r&  r  )	r:   r   r   r(  r  r)  r  r  sts	            r(   op_UNPACK_SEQUENCEzTraceRunner.op_UNPACK_SEQUENCE  sx    99;-25\:%//#::??$THVhO6" 	BJJrN	 ;s   B
c           	         |j                   }t        t        t        |      D cg c]  }|j	                          c}            }|j                         }|j                  |||       |j                  |       y c c}w N)r   r  r%  )r:   r   r   r(  r)  r   tups          r(   op_BUILD_TUPLEzTraceRunner.op_BUILD_TUPLE  ^    XE%LAquyy{ABCooTC0

3 B   A<c           	         t        t        t        |j                        D cg c]  }|j	                          c}            }t        t        |      dz
        D cg c]  }|j                          }}t        |      dk(  }|r|j                         g}|j                  ||||       |j                  |d          y c c}w c c}w )Nr  )tuplesr  	is_assignr   )	r   r&  r'  r   r   rV  r  rl   r  )r:   r   r   r)  r  r  r  s          r(   _build_tuple_unpackzTraceRunner._build_tuple_unpack  s    hU488_E		EFG,1#f+/,BCq"CC K1$	__&(ET&K

59  FCs   CCc                 (    | j                  ||       y r7   r  r   s      r(   op_BUILD_TUPLE_UNPACK_WITH_CALLz+TraceRunner.op_BUILD_TUPLE_UNPACK_WITH_CALL  s      -r'   c                 (    | j                  ||       y r7   r  r   s      r(   op_BUILD_TUPLE_UNPACKz!TraceRunner.op_BUILD_TUPLE_UNPACK  s      -r'   c                     |j                         }|j                         }|j                  |||       |j                  |       y )N)re  r  r  )r:   r   r   r0  r  s        r(   op_LIST_TO_TUPLEzTraceRunner.op_LIST_TO_TUPLE  s8     iikooTcs3

3r'   c           	         |j                         }t        t        t        |j                        D cg c]  }|j                          c}            }t        |j                        D cg c]  }|j                          }}|j                         }|j                  |||||       |j                  |       y c c}w c c}w )N)keyskeytmpsvaluesr  )r   r   r&  r'  r   r  rl   r  )r:   r   r   r  r)  valsr  r  s           r(   op_BUILD_CONST_KEY_MAPz"TraceRunner.op_BUILD_CONST_KEY_MAP  s    yy{H5?CaeiikCDE.3DHHo>5??$>>ooTgdL

3	 D>s   B<+Cc           	         |j                   }t        t        t        |      D cg c]  }|j	                          c}            }|j                         }|j                  |||       |j                  |       y c c}w r  r%  )r:   r   r   r(  r)  r   lsts          r(   op_BUILD_LISTzTraceRunner.op_BUILD_LIST  r  r  c                     |j                         }|j                  }|j                  |      }|j                         }|j                         }|j	                  |||||       y )N)r   r;   	appendvarr  r   r   r\  r  rl   )r:   r   r   r;   r7  r   r  r  s           r(   op_LIST_APPENDzTraceRunner.op_LIST_APPEND  X    		E"OO%	ooT& 	 	r'   c                     |j                         }|j                  }|j                  |      }|j                         }|j                         }|j	                  |||||       y )N)r   r;   	extendvarr  r  )r:   r   r   r;   r7  r   r  r  s           r(   op_LIST_EXTENDzTraceRunner.op_LIST_EXTEND  r  r'   c                    |j                         }|j                  }g }t        |      D ]5  }|j                         |j                         }}|j	                  ||f       7 |j	                  ||d d d   ||       |j                  |       y )Nr   )r   sizer  )r  r   r'  r   rl   r  )	r:   r   r   dctr(  r   r  vks	            r(   op_BUILD_MAPzTraceRunner.op_BUILD_MAP  s}    oou 	!A99;		qALL!Q 	! 	Ttt5cB

3r'   c                     |j                         }|j                         }||}}|j                  }|j                  |      }|j                         }	|j                         }
|j	                  |||||	|
       y )N)r   rf   r;   
setitemvarr  r  )r:   r   r   TOSTOS1rf   r;   r7  r   r  r  s              r(   
op_MAP_ADDzTraceRunner.op_MAP_ADD  sn    iikyy{CUE"__&
ooT&c * 	 	5r'   c           	         |j                   }t        t        t        |      D cg c]  }|j	                          c}            }|j                         }|j                  |||       |j                  |       y c c}w r  r%  )r:   r   r   r(  r)  r   r  s          r(   op_BUILD_SETzTraceRunner.op_BUILD_SET!  s^    XE%LAquyy{ABCooTC0

3 Br  c                     |j                         }|j                         }|j                         }|j                         }|j                  |||||       y )N)r;   r   addvarr  )r   r  r  rl   )r:   r   r   r;   r   r  r  s          r(   
op_SET_ADDzTraceRunner.op_SET_ADD)  sF    		"ooTvf#Nr'   c                     |j                         }|j                  }|j                  |      }|j                         }|j                         }|j	                  |||||       y N)r   r;   	updatevarr  r  r:   r   r   r;   r7  r   r  r  s           r(   op_SET_UPDATEzTraceRunner.op_SET_UPDATE0  r  r'   c                     |j                         }|j                  }|j                  |      }|j                         }|j                         }|j	                  |||||       y r  r  r  s           r(   op_DICT_UPDATEzTraceRunner.op_DICT_UPDATE9  r  r'   c                     |j                         }|j                         }|j                  |||       |j                  |       y r  r  )r:   r   r   r;   r  s        r(   op_GET_ITERzTraceRunner.op_GET_ITERB  s6    		ooTC0

3r'   c                    |j                         }|j                         }|j                         }|j                         }|j                  |||||       |j                  |       |j	                         }t
        dv r|j                  |       n+t
        dv r|j                  |d       nt        t
              |j                  |j                         y )N)iteratorpairindvalr  r   r   r)   r  r  )	r  r  rl   r  r  r   r   r   r   )r:   r   r   r  r  r  r  r   s           r(   op_FOR_ITERzTraceRunner.op_FOR_ITERH  s    ==? " TH4 	 	 

6""$33 JJ#J,,JJ#AJ&%i00

dii
 r'   c                      y)a(  Pops TOS. If TOS was not None, raises an exception. The kind
        operand corresponds to the type of generator or coroutine and
        determines the error message. The legal kinds are 0 for generator,
        1 for coroutine, and 2 for async generator.

        New in version 3.10.
        Nr&   r   s      r(   op_GEN_STARTzTraceRunner.op_GEN_START\  s     	r'   c                    t         j                  |j                     d   }|j                         }|j                         }|dk(  rCt        dk(  sJ |j                         }|j                  |||||       |j                  |       y t        |   j                  }|j                  d|       }|j                  |||||       |j                  |       y )Nr  z[]r   )oplhsr   r  binop_r  )
dis_nb_opsr   r   r   r  rl   r  r	   r    )r:   r   r   r  r   r  r  op_names           r(   op_BINARY_OPzTraceRunner.op_BINARY_OPg  s    [["1%iikiik:'''//#CLL"#3CL@JJsO-b1::G//6');/<CLL"#3CL@JJsOr'   c                     |j                         }|j                         }|j                  |||       |j                  |       y r  r  r  s        r(   _unaryopzTraceRunner._unaryopw  r  r'   c                     |j                         }|j                         }|j                         }|j                  ||||       |j                  |       y )N)r  r   r  r  )r:   r   r   r   r  r  s         r(   	_binaryopzTraceRunner._binaryop  sC    iikiikooTs5

3r'   c                 8   t         dv rd }n(t         dv r|j                         }nt        t               |j                         }d x}x}x}x}	}
t         dv r|j                  ~J |j                  dz  r|j                         }|j                  dz  r|j                         }|j                  dz  r|j                         }	|j                  dz  r|j                         }
|j	                         }|j                  |||||||	|
|	       |j                  |       y )	Nr   r   r     rb  r  r  )rZ  codeclosureannotationsannotate
kwdefaultsdefaultsr  )r   r   r   r   r  rl   r  )r:   r   r   MAKE_CLOSURErZ  r  r  r  r  r  r  r  s               r(   op_MAKE_FUNCTIONzTraceRunner.op_MAKE_FUNCTION  s   << D*$99;D%i00yy{CGGG+GG:**88### xx#~))+xx#~#iikxx#~"YY[
xx#~ 99;oo#! 	 
	
 	

3r'   c                    t         dv sJ |j                         }|j                         }|j                  dz  r|j                  ||       n|j                  dz  r|j                  ||       nt|j                  dz  r|j                  ||       nQ|j                  dz  r|j                  ||	       n.|j                  d
z  r|j                  ||       nt	        d      |j                  |       y )Nr  r  )r  r  )r  rb  )r  r  )r     )r  r  )r   r   r   set_function_attributeAssertionErrorr  )r:   r   r   make_func_stackdatas        r(   op_SET_FUNCTION_ATTRIBUTEz%TraceRunner.op_SET_FUNCTION_ATTRIBUTE  s    ....))+yy{88d? ((4(HXX_((T(JXX_((d(KXX_(($(GXX_ ((4(H //

?#r'   c                 ,    | j                  ||d       y )NT)r  )r  r   s      r(   op_MAKE_CLOSUREzTraceRunner.op_MAKE_CLOSURE  s    eT=r'   c                 l    |j                         }|j                  ||       |j                  |       y r;  r=  r>  s       r(   op_LOAD_CLOSUREzTraceRunner.op_LOAD_CLOSURE  rE  r'   c                 n    |j                  d      }|j                  ||       |j                  |       y )Nassertion_errorr<  r=  r>  s       r(   op_LOAD_ASSERTION_ERRORz#TraceRunner.op_LOAD_ASSERTION_ERROR  s,    //"34CLL3L'JJsOr'   c                     |j                  d      }|j                         }|j                         }|j                  ||||       |j	                  |       y )N	predicater  r0  r  )r  r   r  rl   r  r:   r   r   r  r0  r  s         r(   op_CHECK_EXC_MATCHzTraceRunner.op_CHECK_EXC_MATCH  sF    {+iik}}T#D9

4r'   c                    |j                  d      }|j                         }|j                         }|j                  ||||       |j                  |j                         |j                  |j                                y )Nr  r  r   )r  r   rl   r   r   r  r  s         r(   op_JUMP_IF_NOT_EXC_MATCHz$TraceRunner.op_JUMP_IF_NOT_EXC_MATCH  se     {+iikyy{T#D9

dii
 

d**,
-r'   c                     |j                         }|j                  dk7  r|j                          |j                  ||       |j                         r| j	                  |       y |j                          y )Nr   r  )r   r   rl   r   r   r  r  s       r(   
op_RERAISEzTraceRunner.op_RERAISE  sU    ))+Cxx1}		LL3L'##%))%0!r'   c                 j    |j                         }|j                  ||       |j                          y )Nr  )r   rl   r  r  s       r(   r  zTraceRunner.op_RERAISE  s'    ))+CLL3L'OOr'   )r,   c                     |j                         }|j                         }|j                  |       |j                         }|j	                  |||       |j                  |       y )NrO  )r   r  r  r  rl   )r:   r   r   rP  extrar  s         r(   op_LOAD_METHODzTraceRunner.op_LOAD_METHOD-  sN    99;DOO%EJJu//#CLLDcL2JJsOr'   c                 (    | j                  ||       y r7   )rQ  r   s      r(   r  zTraceRunner.op_LOAD_METHOD5  s    eT*r'   c                 (    | j                  ||       y r7   )rM  r   s      r(   op_CALL_METHODzTraceRunner.op_CALL_METHOD:  s    eT*r'   c                    t         j                  |j                     dvrt        d      |j	                         }|j	                         }|j                  d      }|}dD ]N  \  }}|j                          |j                         }|j                  |k7  s|j                  |k7  sEt        d       |j                          |j                         }|j                  dk7  rd}	t        |	      |j                  J |j                  }
|
j                  |j                        }|g}|
j                  D ]-  }|j                  |j                  k(  s|j                  |       / t!        d	 |D              }|j#                  |       |j#                  |       |j                  ||||
       |j%                  |j'                  d|             |j)                  |j*                         y )N)	__enter____exit__z#async special methods not supportedr  r  ))SWAPr  )r   r   )LOAD_SPECIALr   )CALLr   z0Unsupported bytecode pattern for 'LOAD_SPECIAL'.r   r   c              3   4   K   | ]  }|j                     y wr7   r   r  s     r(   r  z.TraceRunner.op_LOAD_SPECIAL.<locals>.<genexpr>  r  r  )r  exit_method	block_endr2   r  r   )r  _special_method_namesr   r   r   r  r   r   r   r   r\   r  r   r  r   rl   r  r  r  r   r   r   )r:   r   r   r0  r)  methodold_instr  ar   r[  r"  r#  r   r   s                  r(   op_LOAD_SPECIALzTraceRunner.op_LOAD_SPECIAL?  s    ))$((345)9; ;> ))+C		A __,?_@FH 	L!
   "~~'KK1$A2JL L	L >>#D
 {{i'$ /s3388### B,,T[[9FI** )99-$$R() 1y11C JJvJJsOLL#6#&  (    !  JJ$))J$r'   c                     |j                   }t        j                  |   t        k(  rd}nt        |j                  |      }|j                  |||       |j                  |       y )Nr  )r  r4  )r   r  _common_constantsr  r   r  rl   r  )r:   r   r   rg  rZ  r  s         r(   op_LOAD_COMMON_CONSTANTz#TraceRunner.op_LOAD_COMMON_CONSTANT  sT    HHE$$U+~=())//$'CLL3EL2JJsOr'   N)F)r    r!   r"   rO   r<   r   rp   r   r  r   op_NOT_TAKENr   r  r  r  r  r  r  r!  r*  r-  op_POP_ITERr1  r7  r@  rB  rD  rI  rL  rQ  r`  rl  rq  rv  op_LOAD_FAST_CHECKop_LOAD_FAST_AND_CLEARop_LOAD_FAST_BORROW$op_LOAD_FAST_BORROW_LOAD_FAST_BORROWrx  rz  r|  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  op_POP_JUMP_IF_TRUEop_POP_JUMP_IF_FALSEop_POP_JUMP_IF_NONEop_POP_JUMP_IF_NOT_NONEr  op_JUMP_IF_FALSE_OR_POPop_JUMP_IF_TRUE_OR_POPr  r  r  r  r  r  r  r  r  r  op_JUMP_BACKWARD_NO_INTERRUPTr  r  r  r  r  r  r  r  r  r  r  r  r	  r  r  r$  r&  r)  r,  r.  r0  r5  r8  r:  r<  rH  rK  rM  rP  rS  rY  ra  rg  ri  rm  rp  rr  ru  rz  r}  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  op_UNARY_NEGATIVEop_UNARY_POSITIVEop_UNARY_NOTop_UNARY_INVERTr  op_COMPARE_OPop_IS_OPop_CONTAINS_OPop_INPLACE_ADDop_INPLACE_SUBTRACTop_INPLACE_MULTIPLYop_INPLACE_DIVIDEop_INPLACE_TRUE_DIVIDEop_INPLACE_FLOOR_DIVIDEop_INPLACE_MODULOop_INPLACE_POWERop_INPLACE_MATRIX_MULTIPLYop_INPLACE_LSHIFTop_INPLACE_RSHIFTop_INPLACE_ANDop_INPLACE_ORop_INPLACE_XORop_BINARY_ADDop_BINARY_SUBTRACTop_BINARY_MULTIPLYop_BINARY_DIVIDEop_BINARY_TRUE_DIVIDEop_BINARY_FLOOR_DIVIDEop_BINARY_MODULOop_BINARY_POWERop_BINARY_MATRIX_MULTIPLYop_BINARY_LSHIFTop_BINARY_RSHIFTop_BINARY_ANDop_BINARY_ORop_BINARY_XORr  r  r  r  r  r  r  r  r  r  r
  r  r&   r'   r(   rh   rh   A  s   
0P6/( J	:	:!),, &&	 
1	1!),,$" K 	:	:!),,%%	
 
1	1!),,&&	. 
(	(	 
j	 	
 "),,
$ K	(
 
:	:!),,/"8 &&
		!	=
 
1	1!),,//)!-	(	(!),,J*/E,	:	:!),,*7
((***
$
(
(
(

$
$
6 //	 
(	(!),,//	 
(	(!),,
' **//-"1	(	(!),,. 1/********.. %5!. //	 
(	(!),, 88	"* 
j	 	& "),,(. &&		j	 	 
(	(!),,P
 K	:	:	%> "),,!&
(

 88	 
j	 	% "),,! J	:	:	 "),,D7
0% &&	 
1	1!),,K	 
k	!	 
1	1	* "),,
 //	3< 
(	(!),,+
--)..		5O!(	  ! LO MHNN##!&'! !*!!NMNM"" %& O )  MLM$L$2>
 K	:	:	
 "),,. 77
	" 
j	 	 "),,
 //	k	!	 
j	 	+ "),,+ Ko	%b 
:	:!),,K	 
:	:!),,r'   rh   c                   >   e Zd ZdZd*dZd Zd Zd Zd Zd Z	e
d        Ze
d	        Ze
d
        Ze
d        Ze
d        Ze
d        Zd Zd Zd Zd Zd+dZd Zd Zd Zd Zd Zd Zd Zd Zd,dZd Zd Z d Z!d  Z"d! Z#d" Z$d#e%fd$Z&d% Z'd-d&Z(d' Z)d( Z*d) Z+y)._StatezState of the trace
    c                    || _         || _        || _        || _        g | _        t        |      | _        t        |      | _        g | _	        g | _
        g | _        d| _        i | _        t               | _        t!               | _        t%        |      D ]I  }||v r| j'                  d      }n| j'                  d      }|| j                  |<   | j)                  |       K y)aG  
        Parameters
        ----------
        bytecode : numba.bytecode.ByteCode
            function bytecode
        pc : int
            program counter
        nstack : int
            stackdepth at entry
        blockstack : Sequence[Dict]
            A sequence of dictionary denoting entries on the blockstack.
        Fnull$r   N)r\   _pc_initialr   _nstack_initialro   tuple_blockstack_initialr   r   _temp_registers_insts	_outedges_terminatedr   r   r   r   r   r'  r  r  )r:   r^   r`   ra   rb   nullvalsr  r   s           r(   r<   z_State.__init__  s     "%#(#4 
+! 
(l%v 	AH}nnW-nnU+DJJsOIIcN	r'   c                 N    dj                  | j                  | j                        S )Nz&State(pc_initial={} nstack_initial={}))rG   rB  rC  r@   s    r(   rN   z_State.__repr__  s&    7>>d22
 	
r'   c                 2    | j                   | j                  fS r7   )rB  rC  r@   s    r(   get_identityz_State.get_identity  s      $"6"677r'   c                 4    t        | j                               S r7   )r>   rM  r@   s    r(   rA   z_State.__hash__  s    D%%'((r'   c                 D    | j                         |j                         k  S r7   rM  rH   s     r(   rJ   z_State.__lt__  s      "U%7%7%999r'   c                 D    | j                         |j                         k(  S r7   rP  rH   s     r(   rL   z_State.__eq__  s      "e&8&8&:::r'   c                     | j                   S )z]The starting bytecode offset of this State.
        The PC given to the constructor.
        )rB  r@   s    r(   re   z_State.pc_initial  s    
 r'   c                     | j                   S )ziThe list of instructions information as a 2-tuple of
        ``(pc : int, register_map : Dict)``
        )rG  r@   s    r(   instructionsz_State.instructions  s    
 {{r'   c                     | j                   S )zaThe list of outgoing edges.

        Returns
        -------
        edges : List[State]
        )rH  r@   s    r(   rv   z_State.outgoing_edges  s     ~~r'   c                     | j                   S )zThe dictionary of outgoing phi nodes.

        The keys are the name of the PHI nodes.
        The values are the outgoing states.
        )r   r@   s    r(   outgoing_phisz_State.outgoing_phis  s     """r'   c                     | j                   S )z6A copy of the initial state of the blockstack
        )rE  r@   s    r(   blockstack_initialz_State.blockstack_initial  s     '''r'   c                 ,    t        | j                        S )zYThe current size of the stack

        Returns
        -------
        res : int
        )rV  ro   r@   s    r(   r   z_State.stack_depth$  s     4;;r'   c                 b    t        | j                        D ]  }|d   t        d      k(  s|c S  y)z&Find the initial *try* block.
        r   r0   N)r&  rE  r/   )r:   r  s     r(   find_initial_try_blockz_State.find_initial_try_block.  s4     D445 	C6{i..
	r'   c                     | j                   S r7   rI  r@   s    r(   rq   z_State.has_terminated5  s    r'   c                 4    | j                   | j                     S r7   )r\   r   r@   s    r(   r   z_State.get_inst8  s    ~~dhh''r'   c                 F    | j                         }|j                  | _        y r7   )r   r   r   r:   r   s     r(   r   z_State.advance_pc;  s    }}99r'   c                 T   |sYdj                  || j                  | j                         j                  j	                         t        | j                              }n1dj                  || j                  t        | j                              }| j                  j                  |       |S )Nz"${prefix}{offset}{opname}.{tempct})r  r   r   tempctz${prefix}{offset}.{tempct})r  r   rc  )rG   r   r   r   lowerrV  rF  rl   )r:   r  rZ  s      r(   r  z_State.make_temp?  s    7>>xx}}--3354//0	 ? D 066xx4//0 7 D 	##D)r'   c                     | j                   j                  |j                  |f       | xj                  t	        t        |j                                     z  c_        y)zAppend new instN)rG  rl   r   r   r   _flatten_inst_regsr  )r:   r   r   s      r(   rl   z_State.appendQ  s<    DKK0131&--/BCCr'   c                 $    | j                  d      S )Nr  )r\  r@   s    r(   r  z_State.get_tosV  s    yy|r'   c                 "    | j                   |    S )z-Return the k'th element on the stack
        ro   )r:   r  s     r(   r\  z_State.peekY  s     {{A2r'   c                 :    | j                   j                  |       y)zPush to stackN)ro   rl   )r:   rP  s     r(   r  z_State.push^  s    4 r'   c                 6    | j                   j                         S )zPop the stack)ro   r   r@   s    r(   r   z
_State.popb  s    {{  r'   c                 B    | j                   }||    |d   c|d<   || <   y)zSwap stack[idx] with the tosr   Nri  )r:   r4  ss      r(   rt  z_State.swapf  s*    KKC4!B%"q#wr'   c                 F    d|v sJ | j                   j                  |       y)z#Push a block to blockstack
        r   N)r   rl   )r:   synblks     r(   r  z_State.push_blockk  s&     &&&'r'   c                 N    | j                   d| | j                   |d c| _         }|S )zVReset the stack to the given stack depth.
        Returning the popped items.
        Nri  )r:   r   poppeds      r(   r  z_State.reset_stackq  s-     #kk&514;;uv3FVr'   Nc                     t        |      |t        | j                        d}|rt        | j                        |d<   nd|d<   ||d<   |S )zMake a new block
        )r   r   r   r   Nr   )r/   rV  ro   )r:   r   r   r  r   ds         r(   r   z_State.make_blockx  sQ     dOt{{+

 "4;;/Am#Am)r'   c                 b    | j                   j                         }| j                  |d          |S )z)Pop a block and unwind the stack
        r   )r   r   r  r:   r   s     r(   r  z_State.pop_block  s0       "=)*r'   c                     | j                   j                  |      }d|cxk  rt        | j                         k  sJ  J | j                   d| | _         y)zcFind *blk* in the blockstack and remove it and all blocks above it
        from the stack.
        r   N)r   r7  rV  )r:   r  r4  s      r(   r   z_State.pop_block_and_above  sS     $$S)C/#d..//////++DS1r'   c                 f    t        |      }t        | j                        D ]  }|d   |k(  s|c S  yz1Find the first block that matches *kind*
        r   Nr/   r&  r   )r:   r   bss      r(   r   z_State.get_top_block  s8     4++, 	B&zT!		r'   c                     |D ch c]  }t        |       }}t        | j                        D ]  }|d   |v s|c S  yc c}w rx  ry  )r:   kindsr   rz  s       r(   get_top_block_eitherz_State.get_top_block_either  sK     .33T4334++, 	B&zU"		 4s   ?c                 (    | j                  d      duS )zGReturns a boolean indicating if the top-block is a *try* block
        r0   N)r   r@   s    r(   r   z_State.has_active_try  s     !!%(44r'   c                 8    | j                  |j                        S )zBGet referenced variable name from the instruction's oparg
        )rf  r   ra  s     r(   rT  z_State.get_varname  s     &&txx00r'   rg  c                 4    | j                   j                  |   S )z4Get referenced variable name from the oparg
        )r\   rW  )r:   rg  s     r(   rf  z_State.get_varname_by_arg  s     ~~))%00r'   c                     d| _         y)z!Mark block as terminated
        TNr^  r@   s    r(   r  z_State.terminate  s      r'   c           
         t        | j                        }|r@d|cxk  rt        | j                        k  sJ  J t        | j                        |z
  }|d| }|r6d|k  sJ t        |      D ]!  }|j	                  | j                                # t        | j                        }t        dv r:|rP|d   }	|	j                  d      xs |	d   }
||
k\  r|j                          nn|r7nt        dv rnt        t              |r|j	                  |       | j                  j	                  t        |t        |      |t        |                   | j                          y)	zFork the state
        r   Nr   r   r   r   r   )r`   stackr   rb   )r   ro   rV  r'  rl   r  r   r   getr   r   rH  EdgerD  r  )r:   r`   r   r   r   r  ra   r  rb   topr   s              r(   r   z_State.fork  sB    T[[!0DKK 000000%,F'6NE::5\ /T^^-./ $**+
<< nggl+9s5z9NN$  *$%i00k*duUZ(
 	 	r'   c                 <    | j                  | j                         y)zSplit the state
        r   N)r   r   r@   s    r(   ru   z_State.split_new_block  s     			TXX	r'   c                    | j                   rJ g }| j                  D ]  }t        | j                  |j                  t        |j                        |j                  t        |j                        D cg c]  \  }}t        |      r| c}}      }|j                  |       |j                  j                         D ]!  \  }}|j                  |   | j                   |<   #  |S c c}}w )z+Get states for each outgoing edges
        )r^   r`   ra   rb   rJ  )r   rH  rg   r\   r`   rV  r  rb   	enumerater   rl   r   r   )r:   retr   r  r  r   r   s          r(   rx   z_State.get_outgoing_states  s     &&&&NN 	9D4>>dgg!$TZZT__2;DJJ2G $=$!Q'8'; %& $=>E JJu++++- 9Q+/::a=##C(9	9 
$=s   2C%c           	          | j                   D ci c]0  }|j                  t        |j                  |j                   d       2 c}S c c}w )z
        Returns
        -------
        Dict[int, int]
            where keys are the PC
            values are the edge-pushed stack values
        N)rH  r`   rD  r  r   )r:   r   s     r(   get_outgoing_edgepushedz_State.get_outgoing_edgepushed  sG     !NN, tzz4::+,788 , 	, ,s   5A)r&   ) )TN)r   r   N),r    r!   r"   rO   r<   rN   rM  rA   rJ   rL   propertyre   rT  rv   rW  rY  r   r\  rq   r   r   r  rl   r  r\  r  r   rt  r  r  r   r  r   r   r}  r   rT  intrf  r  r   ru   rx   r  r&   r'   r(   r?  r?    s)   !F

8):;         # # ( (
     ($D

!!(
(25
1
1 1
 
#J
"
,r'   r?  c                   B     e Zd Z fdZd Zd Zd Zd Zd Zd Z	 xZ
S )
StatePy311c                 2    t        |   |i | d | _        y r7   )superr<   	_kw_namesr:   r@  r   	__class__s      r(   r<   zStatePy311.__init__	  s    $)&)r'   c                 ,    | j                   }d | _         |S r7   r  )r:   outs     r(   rB  zStatePy311.pop_kw_names	  s    nn
r'   c                 .    | j                   J || _         y r7   r  )r:   r/  s     r(   rJ  zStatePy311.set_kw_names	  s    ~~%%%r'   c                 T    | j                   }|j                  | j                        d uS r7   r\   r  r   r:   r[  s     r(   r   zStatePy311.is_in_exception	  s%    ^^&&txx0<<r'   c                 P    | j                   }|j                  | j                        S r7   r  r  s     r(   r   zStatePy311.get_exception	  s     ^^&&txx00r'   c                 L    | j                   D ]  }|d   t        d      k(  s y y )Nr   r2   T)rE  r/   )r:   ents     r(   r   zStatePy311.in_with	  s+    ++ 	C6{i//	r'   c                 &    | j                  d      S )NrA  r  )r  r@   s    r(   r  zStatePy311.make_null	  s    ~~W~--r'   )r    r!   r"   r<   rB  rJ  r   r   r   r  __classcell__r  s   @r(   r  r  	  s&    
=1
.r'   r  c                   *     e Zd Z fdZd Zd Z xZS )
StatePy313c                 L    t        |   |i | t        t              | _        y r7   )r  r<   r   r   _make_func_attrsr  s      r(   r<   zStatePy313.__init__"	  s"    $)&) +D 1r'   c                 @    | j                   |   j                  |       y r7   )r  r   )r:   make_func_resr   s      r(   r  z!StatePy313.set_function_attribute&	  s    m,33F;r'   c                      | j                   |   S r7   )r  )r:   r  s     r(   get_function_attributesz"StatePy313.get_function_attributes)	  s    $$]33r'   )r    r!   r"   r<   r  r  r  r  s   @r(   r  r  !	  s    2<4r'   r  r  r8  r,   r  )r`   r  rb   r   c                   &    e Zd ZdZd Zed        Zy)AdaptDFAz<Adapt Flow to the old DFA class expected by Interpreter
    c                     || _         y r7   )_flow)r:   flows     r(   r<   zAdaptDFA.__init__=	  s	    
r'   c                 .    | j                   j                  S r7   )r  r]   r@   s    r(   infoszAdaptDFA.infos@	  s    zz%%%r'   N)r    r!   r"   rO   r<   r  r  r&   r'   r(   r  r  :	  s      & &r'   r  AdaptBlockInfoinstsrW  rb   active_try_blockoutgoing_edgepushedc                 8     fd}t         dv r t        t        | j                              }n-t         dv rt         j                        }nt	        t               t        | j                   j                   j                          j                               S )Nc                     | \  }}j                   |   }|j                  dk(  r#|j                  j                  |d                ||fS )NMAKE_FUNCTIONr  )r\   r   r   r  )	inst_pairr   r  r   r   s       r(   process_function_attributesz6adapt_state_infos.<locals>.process_function_attributesM	  sK     v&;;/)KK55d5kBCt|r'   r  r  r  )
r   rD  maprT  r   r  rW  rY  r\  r  )r   r  r  s   `  r(   r}   r}   L	  s     &&c5u7I7IJK	1	1e(()!),,))++557!99; r'   c              #      K   | D ]B  }t        |t              r| t        |t        t        f      s/t	        |      D ]  }|  D yw)z<Flatten an iterable of registers used in an instruction
    N)rE   strrD  r   rf  )r  rP  rW   s      r(   rf  rf  b	  sM       dC Judm,'- 	s
   1AAc                   R    e Zd ZdZd Zed        Zed        Zed        Zd Z	d Z
y)	AdaptCFAz<Adapt Flow to the old CFA class expected by Interpreter
    c                    || _         i | _        |j                  j                         D ]  \  }}t	        ||      | j                  |<     | j                   j
                  j                         }|j
                  }|j                         }t               }| j                  j                         D ]%  }|j                  |      s|j                  |       ' ||z
  | _        y r7   )r  _blocksr]   r   AdaptCFBlockr   backboner   blocksr  in_loopsrw   	_backbone)r:   r  r   	blockinfor  r   inloopblocksr   s           r(   r<   zAdaptCFA.__init__p	  s    
!%!1!1!7!7!9 	CFI#/	6#BDLL 	C::%%..0>># u!!# 	$A~~a   #	$ "L0r'   c                 .    | j                   j                  S r7   )r  r   r@   s    r(   r   zAdaptCFA.graph	  s    zz!!!r'   c                     | j                   S r7   )r  r@   s    r(   r  zAdaptCFA.backbone	  s    ~~r'   c                     | j                   S r7   )r  r@   s    r(   r  zAdaptCFA.blocks	  s    ||r'   c              #   b   K   t        | j                        D ]  }| j                  |     y wr7   )r|   r  ru  s     r(   iterliveblockszAdaptCFA.iterliveblocks	  s,     $ 	!A++a. 	!s   -/c                 L    | j                   j                  j                          y r7   )r  r   rU   r@   s    r(   rU   zAdaptCFA.dump	  s    

!r'   N)r    r!   r"   rO   r<   r  r   r  r  r  rU   r&   r'   r(   r  r  m	  sR    1& " "    !"r'   r  c                       e Zd Zd Zy)r  c                 T    || _         t        d |j                  D              | _        y )Nc              3   &   K   | ]	  \  }}|  y wr7   r&   )r  r  r)  s      r(   r  z(AdaptCFBlock.__init__.<locals>.<genexpr>	  s     81!8s   )r   rD  r  body)r:   r  r   s      r(   r<   zAdaptCFBlock.__init__	  s    8	88	r'   N)r    r!   r"   r<   r&   r'   r(   r  r  	  s    9r'   r  )1rO   r  loggingcollectionsr   r   r   	functoolsr   numba.core.utilsr   r   r	   r
   numba.core.controlflowr   r   numba.core.irr   numba.core.errorsr   	getLoggerr    rZ   r   r   rP   r   enumr   r   rf  r   objectr/   rR   r   rh   r?  r  r  rg   r  r  r  r}   rf  r  r  r&   r'   r(   <module>r     s     6 6 $- - 8  6 '

H
% #   ++$4 $ %E$$
i
(( 3 3 3@o-6 o-d$A-& A-H4 y,V y, y,x	. .>	4 	4 ""E$$EE
i
(( &@A&v & ,'"v '"T96 9r'   