
ϑRMc        S   @   s	  d  d k  Z  d  d k Z d  d k Z d  d k Z d  d k l Z l Z l Z l Z l	 Z	 d  d k l
 Z
 l Z l Z l Z d  d k l Z d  d k l Z d Z d Z d Z e d Z d Z e i d	 j Z d
 d d g Z e d d e d d d e d d d dd e f g e
 d d d d g d d d d d h  d e f d e f dg d <e
 d d  d! d" d# g d d! d h  dg d! <dg d" <dg d# <d d$ e d% d& d e d d' e d( d) d e d d* e
 d+ d, d d- d. d/ d0 d1 d2 d3 d d4 g
 d- d h  d5 e f d	g d- <d5 e f d
g d4 <dg d/ <dg d. <dg d0 <dg d1 <dg d2 <dg d <dg d3 <dg d <d d8 e
 d9 d: d d- d7 d4 g d d- d d d h  dd e f g d <dd e f g d- <dd e f g d4 <e d= d> d e d d? e
 d@ dA d< dB dC g dB d dD d h  dg dB <ddg dC <e dF dG d e d dH e dI dJ d e d dK d dL e f g dM dg e dN dO d e e dP dQ d e dM d e f ddR e f g e
 dS dT dU dV dW dX g d dU d dY e
 dZ d[ d\ d] g d d\ e d^ d_ d e e d` da d e e db dc d dd d e e de df d e d dg e dh di d dj e dk dl d dm e dn do d e d dp dq e e dr ds d e d d e dt du d e d d e
 dv dw dx dy dz d{ d| d} g d d d d~ e d d d d e d d d d e d d d d d d e d d d d d e d dg e d d d e d d d d e f g e d d d e d d dq e e d d d d e d d d d e d d d d d e dq e e d d d d d e   e d d d e e d d d e d d e d d d e d d e d d d d e d d d e e d d e d d d e g  e dz d e d d d e e	 d d d e d d e d d d d d d e d d d e e d d d d d e e d d d e d d e d d d e e d d d e e d d d d d d e	 d d d e d d e d d d d d d e d d d e d d e	 d d d e d d e d d d d d d e d d d e e d d d e e d d d e e d d d e e d4 d d d e f dd e f d e f d e f g g  e d" d e d d d e d d e d d d e g  e
 d d d g e d d d d g,  Z d d d e d  Z d d d d d d dP g Z d Z h  d d <d d <d d <d d <d d <d d <d dP <Z  h  d d <d d <d d <e d d <e d d <e d d <e d dP <Z! d   Z" d  Z# d  Z$ d  Z% d S(  iN(   t   OptionDescriptiont
   BoolOptiont	   IntOptiont   ArbitraryOptiont   FloatOption(   t   ChoiceOptiont	   StrOptiont   to_optparset   Config(   t   ConfigError(   t   detect_number_of_processorsg333333@@g       @t   minimarkit   maemot   hostt	   distutilst   translations   Translation Optionst	   stacklesss,   enable stackless features during compilationt   defaultt   cmdlines   --stacklesst   requiress   translation.type_systemt   lltypes   translation.gcremovetypeptrt   type_systems   Type system to use when RTypingt   ootypes    translation.backendopt.constfolds,   translation.backendopt.clever_malloc_removals   translation.gct   boehmt   backends"   Backend to use for code generationt   ct   clit   jvms   -b --backendt   shareds   Build as a shared librarys   --sharedt   logs5   Include debug prints in the translation (PYPYLOG=...)s   --logt   gcs   Garbage Collection Strategyt   reft	   marksweept	   semispacet
   statisticst
   generationt   hybridt   markcompactt   nones   translation.rweakrefs   translation.gctransformert	   frameworks   --gct   gctransformers&   GC transformer that is used - internals   translation.gcrootfinders   n/at   gcremovetypeptrs$   Remove the typeptr from every objects   --gcremovetypeptrt   gcrootfinders2   Strategy for finding GC Roots (framework GCs only)t   shadowstackt   asmgccs   --gcrootfinders   translation.backendt   threads"   enable use of threading primitivess   --threadt   sandboxs$   Produce a fully-sandboxed executables	   --sandboxs   translation.threadt   suggestst   rweakrefs+   The backend supports RPython-level weakrefst   jits   generate a JITs)   translation.list_comprehension_operationst   jit_backends   choose the backend for the JITt   autot   x86s   x86-without-sse2t   llvms   --jit-backendt   jit_profilers'   integrate profiler support into the JITt   offt   oprofilet   jit_ffis   optimize libffi callst   verboses   Print extra informationt   debugs#   Record extra annotation informations
   -d --debugt   insists   Try hard to go on RTypings   --insistt   ccs1   Specify compiler to use for compiling generated Cs   --cct   profopts)   Specify profile based optimization scripts	   --profoptt	   noprofopts$   Don't use profile based optimizations   --no-profoptt   negationt
   instruments!   internal: turn instrumentation ont   countmallocss   Count mallocs and freest   fork_befores0   (UNIX) Create restartable checkpoint before stept   annotatet   rtypet
   backendoptt   databaset   sourcet   pyjitpls   --fork-beforet   instrumentctlt   internalt   outputs   Output file names   --outputt   secondaryentrypointss;   Comma separated list of keys choosing secondary entrypointss   --entrypointst    t   dump_static_data_infos   Dump static data infos   --dump_static_data_infot   vanillas4   Try to be as portable as possible, which is not muchs	   --vanillas   translation.no__threadt
   no__threads'   don't use __thread for implementing TLSs   --no__threadt   compilerflagss    Specify flags for the C compilers   --cflagst   linkerflagss-   Specify flags for the linker (C backend only)s	   --ldflagst
   force_makes7   Force execution of makefile instead of calling platforms   --force-maket	   make_jobss<   Specify -j argument to make for compilation (C backend only)s   --make-jobst   simplifyings   Simplify flow graphst   builtins_can_raise_exceptionss_   When true, assume any call to a 'simple' builtin such as 'hex' can raise an arbitrary exceptiont   list_comprehension_operationss   When true, look for and special-case the sequence of operations that results from a list comprehension and attempt to pre-allocate the lists   --listcomprt   withsmallfuncsetssD   Represent groups of less funtions than this as indices into an arrayi    t   taggedpointerssI   When true, enable the use of tagged pointers. If false, use normal boxings"   Object Oriented Typesystem optionst   mangles   Mangle names of class memberss   Backend Optimization Optionst   inlines$   Do basic inlining and malloc removalt   inline_thresholds"   Threshold when to inline functionss   --inline-thresholdt   inline_heuristics1   Dotted name of an heuristic function for inlinings4   pypy.translator.backendopt.inline.inlining_heuristics   --inline-heuristict   print_statisticss!   Print statistics while optimizingt   merge_if_blockss   Merge if ... elif chainss   --if-block-merget   raisingop2direct_callst   Transform operations that can implicitly raise an exception into calls to functions that explicitly raise exceptionss   --raisingop2direct_callt   mallocss   Remove mallocst	   constfolds   Constant propagationt   profile_based_inlines=   Use call count profiling to drive inlining, specify argumentss   --prof-based-inlinet   profile_based_inline_thresholds=   Threshold when to inline functions for profile based inlinings   --prof-based-inline-thresholdt   profile_based_inline_heuristics?   Dotted name of an heuristic function for profile based inlinings   --prof-based-inline-heuristict   clever_malloc_removals1   Drives inlining to remove mallocs in a clever ways   --clever-malloc-removalt   clever_malloc_removal_thresholds;   Threshold when to inline functions in clever malloc removals!   --clever-malloc-removal-thresholdt   clever_malloc_removal_heuristicsJ   Dotted name of an heuristic function for inlining in clever malloc removals!   --clever-malloc-removal-heuristict   remove_assertssf   Remove operations that look like 'raise AssertionError', which lets the C optimizer remove the assertst   really_remove_assertssa   Really remove operations that look like 'raise AssertionError', without relying on the C compilert   stack_optimizationsu   Tranform graphs in SSI form into graphs tailored for stack based virtual machines (only for backends that support it)t	   storesinks   Perform store sinkings$   Do not run any backend optimizationss   translation.backendopt.inlines'   translation.backendopt.inline_thresholds&   translation.backendopt.merge_if_blockss   translation.backendopt.mallocss   GenCLI optionst   trace_callss   Trace function callss   --cli-trace-callst   exception_transformers   Use exception transformert   platforms   target platforms
   --platformc         C   s[  | d  j o
 h  } n t d d d t d d  } |  d  j o g  } d } n |  g } |  i } | d  j o | | t g 7} n@ | g  } | i i D]! } | i | j o | | q q ~ 7} t d d |  }	 t |	 |  }
 | o t	 |
 _
 n | d  j	 oT xQ | i i D]? } | i | j o qn t | | i  } | |
 i | i <qWn |
 S(   Nt   translatings.   indicates whether we are translating currentlyR   R   RN   t   pypys   all options(   t   NoneR   t   Falset   _namet   translation_optiondescriptiont   _cfgimpl_descrt	   _childrenR    R   t   TrueRq   t   getattrt   _cfgimpl_values(   t   other_optdescrt   existing_configt	   overridesRq   t   dt   childrent   newnamet   _[1]t   childt   descrt   configt   value(    (    s1   /64/home/arigo/u/pypy/config/translationoption.pyt   get_combined_translation_config   s4    

		% t   0t   1t   sizet   memt   2t   3s$   No optimization.  Uses the Boehm GC.s:   Enable a default set of optimizations.  Uses the Boehm GC.s<   Optimize for the size of the executable.  Uses the Boehm GC.s>   Optimize for run-time memory usage and use a memory-saving GC.s8   Enable most optimizations and use a high-performance GC.s7   Enable all optimizations and use a high-performance GC.s   Enable the JIT.s   boehm       nobackendopts   boehm       lowinlines(   boehm       lowinline     remove_assertss/     lowinline     remove_asserts    removetypeptrs     extraoptss     extraopts     remove_assertss     extraopts     jitc         C   s   d  S(   N(    (   R   (    (    s1   /64/home/arigo/u/pypy/config/translationoption.pyt   final_check_configZ  s    c         C   s  |  i  i } |  i  i } y t | } Wn& t j
 o t d | f   n X| i   } | i d  } |  i  i d d j o |  i  i	 d |  n x| D]} | d j o |  i  i
 i	 d t  q | d j o |  i  i
 i	 d t  q | d	 j o |  i  i
 i	 d	 t  q | d
 j o |  i  i	 d d  q | d j o4 |  i  i	 d t  |  i  i o t d   qq | d j o |  i  i	 d t  q t |   q W|  i  i	 d t  d S(   s   Apply optimization suggestions on the 'config'.
    The optimizations depend on the selected level and possibly on the backend.
    s   no such optimization level: %ri    R   t	   suggestedt   nobackendoptR&   t	   lowinlineR]   Rj   t	   extraoptsRY   i   R1   s$   JIT conflicts with stackless for nowt   removetypeptrR)   RX   N(   R   R   R   t	   OPT_TABLEt   KeyErrorR	   t   splitt   popt   _cfgimpl_value_ownerst   suggestRF   Ry   t   DEFL_LOW_INLINE_THRESHOLDR   t   NotImplementedErrort
   ValueError(   R   t   levelR   R   t   optst   wordsR   t   word(    (    s1   /64/home/arigo/u/pypy/config/translationoption.pyt   set_opt_level]  s:     c         C   s-   d d k  l } | |  i i |  i i  d  S(   Ni(   t   set_platform(   t   pypy.translator.platformR   R   Rp   R=   (   R   R   (    (    s1   /64/home/arigo/u/pypy/config/translationoption.pyR     s    c         C   s5   d d k  l } |  i i } |  i i } | | |  S(   Ni(   t   pick_platform(   R   R   R   Rp   R=   (   R   R   t   optR=   (    (    s1   /64/home/arigo/u/pypy/config/translationoption.pyt   get_platform  s    (   s   translation.type_systems   lltype(   s   translation.gcR   (   s   translation.type_systems   lltype(   s   translation.type_systems   ootype(   s   translation.type_systems   ootype(   s   translation.gctransformers   ref(   s   translation.gctransformers   none(   s   translation.gctransformerR'   (   s   translation.gctransformerR'   (   s   translation.gctransformerR'   (   s   translation.gctransformerR'   (   s   translation.gctransformerR'   (   s   translation.gctransformerR   (   s   translation.gctransformerR'   (   s   translation.gctransformerR'   (   s   translation.gcrootfinders   n/a(   s   translation.gcrootfinders   n/a(   s   translation.gcrootfinders   n/a(   s   translation.gctransformerR'   (   s   translation.gctransformerR'   (   s   translation.backendR   (   s   translation.gcs
   generation(   s   translation.gcrootfinderR,   (   s   translation.backendR   (   s'   translation.backendopt.inline_thresholdi    (&   t   autopatht   pyt   ost   syst   pypy.config.configR    R   R   R   R   R   R   R   R   R	   t   pypy.config.supportR
   t   DEFL_INLINE_THRESHOLDt    DEFL_PROF_BASED_INLINE_THRESHOLDt+   DEFL_CLEVER_MALLOC_REMOVAL_INLINE_THRESHOLDR   t   DEFL_GCt   maxintt
   IS_64_BITSt	   PLATFORMSRt   Rs   Ry   Rv   R   t
   OPT_LEVELSt   DEFAULT_OPT_LEVELt   OPT_TABLE_DOCR   R   R   R   R   (    (    (    s1   /64/home/arigo/u/pypy/config/translationoption.pys   <module>   s  $("
						
																									/	
