³ò
Ü‘RMc           @   s  d  Z  d d d d d d d d d	 d
 d g Z d e f d „  ƒ  YZ d d d „  ƒ  YZ d e f d „  ƒ  YZ d d k l Z d d k l	 Z
 l Z d „  Z e ƒ  [ e d e	 e ƒ Z e d e
 e ƒ Z e i ƒ  e i Z e i Z e e i e i ƒ Z e e i ƒ Z d S(   s¡   
Opcodes PyPy compiles Python source to.
Also gives access to opcodes of the host Python PyPy was bootstrapped with
(module attributes with the `host_` prefix).
t   opmapt   opnamet   HAVE_ARGUMENTt   hasconstt   hasnamet   hasjrelt   hasjabst   haslocalt
   hascomparet   hasfreet   cmp_opt   _BaseOpcodeDescc        \   B   sg  e  Z d  „  Z d „  Z d „  Z d e _ d d d d d d	 d
 d d d d d d d d d d d d d d d d d d d d d d  d! d" d# d$ d% d& d' d( d) d* d+ d, d- d. d/ d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d: d; d< d= d> d? d@ dA dB dC dD dE dF dG dH dI dJ dK dL dM dN dO dP dQ dR dS dT dU dV dW dX dY dZ d[ d\ d] d^ d_ g\ Z d` „  Z da „  Z db „  Z	 e	 Z
 RS(c   c         C   s:   | |  _  | |  _ | |  _ | |  _ | |  i j |  _ d  S(   N(   t   bytecode_spect   namet
   methodnamet   indexR   t   hasarg(   t   selfR   R   R   R   (    (    s+   /64/home/arigo/u/pypy/tool/stdlib_opcode.pyt   __init__   s
    				c         C   s   t  S(   N(   t   True(   R   (    (    s+   /64/home/arigo/u/pypy/tool/stdlib_opcode.pyt   _freeze_   s    c         C   s"   | i  i i } t | |  i t ƒ S(   st   Check if the opcode should be enabled in the space's configuration.
        (Returns True for all standard opcodes.)(   t   configt   objspacet   opcodest   getattrR   R   (   R   t   spacet   opt(    (    s+   /64/home/arigo/u/pypy/tool/stdlib_opcode.pyt
   is_enabled   s    s   specialize:memoi|   i}   id   ii   i   iƒ   it   io   ij   iS   i   i]   iq   i   i_   i@   ip   iB   if   in   i<   i\   i>   ix   iD   iW   i    iˆ   i   ig   i   i?   i   iA   i   i7   iy   i   ie   i   i   iP   iV   i‡   i~   iZ   iŒ   ih   i   i!   i   il   ik   i   i†   i„   iX   i   i…   i‚   i‰   i   i=   iz   i   i(   iJ   iI   i3   i`   i   i*   i8   iU   iR   iY   iŽ   iM   iN   iO   i[   iL   ia   i9   i   i+   iT   i2   i)   ic   i5   i   c         C   sB   y |  i  i |  i ƒ } Wn t j
 o d } n X| |  i f S(   Ni@B (   t   opcodeorderR   t
   ValueError(   R   t   i(    (    s+   /64/home/arigo/u/pypy/tool/stdlib_opcode.pyt   sortkey%   s
    c         C   s/   t  |  i | i ƒ p t  |  i ƒ  | i ƒ  ƒ S(   N(   t   cmpt	   __class__R   (   R   t   other(    (    s+   /64/home/arigo/u/pypy/tool/stdlib_opcode.pyt   __cmp__,   s    c         C   s   d |  i  |  i t |  ƒ f S(   Ns"   <OpcodeDesc code=%d name=%s at %x>(   R   R   t   id(   R   (    (    s+   /64/home/arigo/u/pypy/tool/stdlib_opcode.pyt   __str__0   s    (   t   __name__t
   __module__R   R   R   t   _annspecialcase_R   R   R#   R%   t   __repr__(    (    (    s+   /64/home/arigo/u/pypy/tool/stdlib_opcode.pyR      s   				ÿ 			t   _baseopcodedescc           B   s   e  Z d  Z RS(   s4   A namespace mapping OPCODE_NAME to _BaseOpcodeDescs.(   R&   R'   t   __doc__(    (    (    s+   /64/home/arigo/u/pypy/tool/stdlib_opcode.pyR*   5   s   t   BytecodeSpecc           B   s/   e  Z d  Z d „  Z d „  Z d „  Z e Z RS(   s:   A bunch of mappings describing a bytecode instruction set.c         C   s  d t  f d „  ƒ  Y} d t f d „  ƒ  Y} | |  _ | |  _ | |  _ | |  _ | |  _ d g d |  _ } h  |  _ xi | i	 ƒ  D][ \ } } | i
 d d ƒ | | <} | |  | | | ƒ }	 t |  i | |	 ƒ |	 |  i | <qƒ W|  i i ƒ  |  _ }
 |
 i ƒ  d	 S(
   s   NOT_RPYTHON.t
   OpcodeDescc           B   s   e  Z e Z RS(    (   R&   R'   R   (    (    (    s+   /64/home/arigo/u/pypy/tool/stdlib_opcode.pyR-   ?   s   t
   opcodedescc           B   s   e  Z d  Z RS(   s/   A namespace mapping OPCODE_NAME to OpcodeDescs.(   R&   R'   R+   (    (    (    s+   /64/home/arigo/u/pypy/tool/stdlib_opcode.pyR.   A   s   t   MISSING_OPCODEi   t   +t   _N(   R   R*   R   R-   R.   R   R    t   method_namest	   opdescmapt   itemst   replacet   setattrt   valuest   ordered_opdescst   sort(   R   R   R    R   R-   R.   t   tblR   R   t   desct   lst(    (    s+   /64/home/arigo/u/pypy/tool/stdlib_opcode.pyR   =   s"    						 c         C   sP   t  ƒ  } | i |  i ƒ |  i d | d <|  i d | d <|  i d | d <d S(   s<   NOT_RPYTHON. Add individual opcodes to the module constants.s   SLICE+0t   SLICEs   STORE_SLICE+0t   STORE_SLICEs   DELETE_SLICE+0t   DELETE_SLICEN(   t   globalst   updateR    (   R   t   g(    (    s+   /64/home/arigo/u/pypy/tool/stdlib_opcode.pyt
   to_globalsW   s
    	c         C   s   d |  i  f S(   Ns   <%s bytecode>(   R   (   R   (    (    s+   /64/home/arigo/u/pypy/tool/stdlib_opcode.pyR%   _   s    (   R&   R'   R+   R   RC   R%   R)   (    (    (    s+   /64/home/arigo/u/pypy/tool/stdlib_opcode.pyR,   :   s
   			iÿÿÿÿ(   t   unrolling_iterable(   R    R   c          C   so   d d k  l }  |  i d ƒ } h  } t t | ƒ | ƒ x0 t D]( } | | j o | | t ƒ  | <q? q? W| S(   Niÿÿÿÿ(   t   LIB_PYTHON_MODIFIEDs	   opcode.py(   t   pypy.tool.lib_pypyRE   t   joint   execfilet   strt   __all__R@   (   RE   t   opcode_patht   dR   (    (    s+   /64/home/arigo/u/pypy/tool/stdlib_opcode.pyt   load_pypy_opcodel   s     t   pypyt   hostN(    (   R+   RJ   t   objectR   R*   R,   t   pypy.rlib.unrollRD   t   opcodeR    t
   host_opmapR   t   host_HAVE_ARGUMENTRM   R   t   host_bytecode_specRC   R2   t   opcode_method_namesR.   R8   t   unrolling_all_opcode_descst   unrolling_opcode_descs(    (    (    s+   /64/home/arigo/u/pypy/tool/stdlib_opcode.pys   <module>   s(   	%-	

		
