Commits

Manuel Jacob committed dcefe6f Merge

hg merge default

  • Participants
  • Parent commits 4cfd5cc, e9c81df
  • Branches refactor-str-types

Comments (0)

Files changed (189)

 =======
 
 Except when otherwise stated (look for LICENSE files in directories or
-information at the beginning of each file) all software and
-documentation in the 'pypy', 'ctype_configure', 'dotviewer', 'demo',
-and 'lib_pypy' directories is licensed as follows: 
+information at the beginning of each file) all software and documentation in
+the 'rpython', 'pypy', 'ctype_configure', 'dotviewer', 'demo', and 'lib_pypy'
+directories is licensed as follows: 
 
     The MIT License
 
     Armin Rigo
     Maciej Fijalkowski
     Carl Friedrich Bolz
+    Antonio Cuni
     Amaury Forgeot d'Arc
-    Antonio Cuni
     Samuele Pedroni
+    Alex Gaynor
     Michael Hudson
+    David Schneider
     Holger Krekel
-    Alex Gaynor
     Christian Tismer
     Hakan Ardo
     Benjamin Peterson
-    David Schneider
+    Matti Picus
+    Philip Jenvey
+    Anders Chrigstrom
+    Brian Kearns
     Eric van Riet Paap
-    Anders Chrigstrom
     Richard Emslie
+    Alexander Schremmer
+    Wim Lavrijsen
     Dan Villiom Podlaski Christiansen
-    Alexander Schremmer
+    Manuel Jacob
     Lukas Diekmann
+    Sven Hager
+    Anders Lehmann
     Aurelien Campeas
-    Anders Lehmann
+    Niklaus Haldimann
+    Ronan Lamy
     Camillo Bruni
-    Niklaus Haldimann
-    Sven Hager
+    Laura Creighton
+    Toon Verwaest
     Leonardo Santagada
-    Toon Verwaest
     Seo Sanghyeon
     Justin Peel
+    Ronny Pfannschmidt
+    David Edelsohn
+    Anders Hammarquist
+    Jakub Gustak
+    Guido Wesdorp
     Lawrence Oluyede
     Bartosz Skowron
-    Jakub Gustak
-    Guido Wesdorp
     Daniel Roberts
-    Laura Creighton
+    Niko Matsakis
     Adrien Di Mascio
     Ludovic Aubry
-    Niko Matsakis
-    Wim Lavrijsen
-    Matti Picus
+    Alexander Hesse
+    Jacob Hallen
+    Romain Guillebert
     Jason Creighton
-    Jacob Hallen
     Alex Martelli
-    Anders Hammarquist
+    Michal Bendowski
     Jan de Mooij
+    Michael Foord
     Stephan Diehl
-    Michael Foord
     Stefan Schwarzer
+    Valentino Volonghi
     Tomek Meka
     Patrick Maupin
+    stian
     Bob Ippolito
     Bruno Gola
+    Jean-Paul Calderone
+    Timo Paulssen
     Alexandre Fayolle
+    Simon Burton
     Marius Gedminas
-    Simon Burton
-    David Edelsohn
-    Jean-Paul Calderone
     John Witulski
-    Timo Paulssen
-    holger krekel
+    Greg Price
     Dario Bertini
     Mark Pearse
+    Simon Cross
+    Konstantin Lopuhin
     Andreas Stührk
     Jean-Philippe St. Pierre
     Guido van Rossum
     Pavel Vinogradov
-    Valentino Volonghi
     Paul deGrandis
     Ilya Osadchiy
-    Ronny Pfannschmidt
     Adrian Kuhn
+    Boris Feigin
     tav
     Georg Brandl
-    Philip Jenvey
+    Bert Freudenberg
+    Stian Andreassen
+    Stefano Rivera
+    Wanja Saatkamp
     Gerald Klix
-    Wanja Saatkamp
-    Boris Feigin
+    Mike Blume
+    Taavi Burns
     Oscar Nierstrasz
     David Malcolm
     Eugene Oden
     Henry Mason
+    Preston Timmons
     Jeff Terrace
+    David Ripton
+    Dusty Phillips
     Lukas Renggli
     Guenter Jantzen
+    Tobias Oberstein
+    Remi Meier
     Ned Batchelder
-    Bert Freudenberg
     Amit Regmi
     Ben Young
     Nicolas Chauvat
     Andrew Durdin
     Michael Schneider
     Nicholas Riley
+    Jason Chu
+    Igor Trindade Oliveira
+    Jeremy Thurgood
     Rocco Moretti
     Gintautas Miliauskas
     Michael Twomey
-    Igor Trindade Oliveira
     Lucian Branescu Mihaila
+    Tim Felgentreff
+    Tyler Wade
+    Gabriel Lavoie
     Olivier Dormond
     Jared Grubb
     Karl Bartel
-    Gabriel Lavoie
+    Brian Dorsey
     Victor Stinner
-    Brian Dorsey
     Stuart Williams
+    Jasper Schulz
     Toby Watson
     Antoine Pitrou
+    Aaron Iles
+    Michael Cheng
     Justas Sadzevicius
+    Gasper Zejn
     Neil Shepperd
     Mikael Schönenberg
-    Gasper Zejn
+    Elmo Mäntynen
+    Tobias Pape
     Jonathan David Riehl
-    Elmo Mäntynen
+    Stanislaw Halik
     Anders Qvist
+    Chirag Jadwani
     Beatrice During
+    Alex Perry
+    Vincent Legoll
+    Alan McIntyre
     Alexander Sedov
     Corbin Simpson
-    Vincent Legoll
-    Romain Guillebert
-    Alan McIntyre
-    Alex Perry
+    Christopher Pope
+    Laurence Tratt
+    Guillebert Romain
+    Christian Tismer 
+    Dan Stromberg
+    Stefano Parmesan
+    Christian Hudon
+    Alexis Daboville
     Jens-Uwe Mager
-    Simon Cross
-    Dan Stromberg
-    Guillebert Romain
     Carl Meyer
+    Karl Ramm
     Pieter Zieschang
+    Gabriel
+    Paweł Piotr Przeradowski
+    Andrew Dalke
+    Sylvain Thenault
+    Nathan Taylor
+    Vladimir Kryachko
+    Jacek Generowicz
     Alejandro J. Cura
-    Sylvain Thenault
-    Christoph Gerum
+    Jacob Oscarson
     Travis Francis Athougies
+    Kristjan Valur Jonsson
+    Neil Blakey-Milner
+    Lutz Paelike
+    Lucio Torre
+    Lars Wassermann
     Henrik Vendelbo
-    Lutz Paelike
-    Jacob Oscarson
-    Martin Blais
-    Lucio Torre
-    Lene Wagner
+    Dan Buch
     Miguel de Val Borro
     Artur Lisiecki
-    Bruno Gola
+    Sergey Kishchenko
     Ignas Mikalajunas
-    Stefano Rivera
+    Christoph Gerum
+    Martin Blais
+    Lene Wagner
+    Tomo Cocoa
+    Andrews Medina
+    roberto@goyle
+    William Leslie
+    Bobby Impollonia
+    timo@eistee.fritz.box
+    Andrew Thompson
+    Yusei Tahara
+    Roberto De Ioris
+    Juan Francisco Cantero Hurtado
+    Godefroid Chappelle
     Joshua Gilbert
-    Godefroid Chappelle
-    Yusei Tahara
+    Dan Colish
     Christopher Armstrong
+    Michael Hudson-Doyle
+    Anders Sigfridsson
+    Yasir Suhail
+    Floris Bruynooghe
+    Akira Li
+    Gustavo Niemeyer
     Stephan Busemann
-    Gustavo Niemeyer
-    William Leslie
-    Akira Li
-    Kristjan Valur Jonsson
-    Bobby Impollonia
-    Michael Hudson-Doyle
-    Laurence Tratt
-    Yasir Suhail
-    Andrew Thompson
-    Anders Sigfridsson
-    Floris Bruynooghe
-    Jacek Generowicz
-    Dan Colish
-    Zooko Wilcox-O Hearn
-    Dan Loewenherz
+    Anna Katrina Dominguez
+    Christian Muirhead
+    James Lan
+    shoma hosaka
+    Daniel Neuhäuser
+    Buck Golemon
+    Konrad Delong
+    Dinu Gherman
     Chris Lambacher
-    Dinu Gherman
-    Brett Cannon
-    Daniel Neuhäuser
-    Michael Chermside
-    Konrad Delong
-    Anna Ravencroft
-    Greg Price
-    Armin Ronacher
-    Christian Muirhead
+    coolbutuseless@gmail.com
     Jim Baker
     Rodrigo Araújo
-    Romain Guillebert
+    Armin Ronacher
+    Brett Cannon
+    yrttyr
+    Zooko Wilcox-O Hearn
+    Tomer Chachamu
+    Christopher Groskopf
+    opassembler.py
+    Antony Lee
+    Jim Hunziker
+    Markus Unterwaditzer
+    Even Wiik Thomassen
+    jbs
+    soareschen
+    Flavio Percoco
+    Kristoffer Kleine
+    yasirs
+    Michael Chermside
+    Anna Ravencroft
+    Andrew Chambers
+    Julien Phalip
+    Dan Loewenherz
 
     Heinrich-Heine University, Germany 
     Open End AB (formerly AB Strakt), Sweden
     Change Maker, Sweden 
     University of California Berkeley, USA
     Google Inc.
+    King's College London
 
 The PyPy Logo as used by http://speed.pypy.org and others was created
 by Samuel Reis and is distributed on terms of Creative Commons Share Alike
 License.
  
-License for 'lib-python/2.7.0' and 'lib-python/2.7.0-modified'
-============================================================== 
+License for 'lib-python/2.7'
+============================
 
-Except when otherwise stated (look for LICENSE files or
-copyright/license information at the beginning of each file) the files
-in the 'lib-python/2.7.0' and 'lib-python/2.7.0-modified' directories
-are all copyrighted by the Python Software Foundation and licensed under
-the Python Software License of which you can find a copy here:
+Except when otherwise stated (look for LICENSE files or copyright/license
+information at the beginning of each file) the files in the 'lib-python/2.7'
+directory are all copyrighted by the Python Software Foundation and licensed
+under the Python Software License of which you can find a copy here:
 http://www.python.org/doc/Copyright.html 
 
-License for 'pypy/translator/jvm/src/jna.jar'
+License for 'rpython/translator/jvm/src/jna.jar'
 =============================================
 
-The file 'pypy/translator/jvm/src/jna.jar' is licensed under the GNU
+The file 'rpyhton/translator/jvm/src/jna.jar' is licensed under the GNU
 Lesser General Public License of which you can find a copy here:
 http://www.gnu.org/licenses/lgpl.html
 
-License for 'pypy/translator/jvm/src/jasmin.jar'
+License for 'rpython/translator/jvm/src/jasmin.jar'
 ================================================
 
-The file 'pypy/translator/jvm/src/jasmin.jar' is copyright (c) 1996-2004 Jon Meyer
+The file 'rpyhton/translator/jvm/src/jasmin.jar' is copyright (c) 1996-2004 Jon Meyer
 and distributed with permission.  The use of Jasmin by PyPy does not imply
 that PyPy is endorsed by Jon Meyer nor any of Jasmin's contributors.  Furthermore,
 the following disclaimer applies to Jasmin:

File lib-python/2.7/distutils/sysconfig_pypy.py

     g['SOABI'] = g['SO'].rsplit('.')[0]
     g['LIBDIR'] = os.path.join(sys.prefix, 'lib')
     g['CC'] = "gcc -pthread" # -pthread might not be valid on OS/X, check
+    g['OPT'] = ""
+    g['CFLAGS'] = ""
+    g['CPPFLAGS'] = ""
+    g['CCSHARED'] = '-shared -O2 -fPIC -Wimplicit'
+    g['LDSHARED'] = g['CC'] + ' -shared'
 
     global _config_vars
     _config_vars = g
     optional C speedup components.
     """
     if compiler.compiler_type == "unix":
-        compiler.compiler_so.extend(['-O2', '-fPIC', '-Wimplicit'])
+        cc, opt, cflags, ccshared, ldshared = get_config_vars(
+            'CC', 'OPT', 'CFLAGS', 'CCSHARED', 'LDSHARED')
+
         compiler.shared_lib_extension = get_config_var('SO')
-        if "CFLAGS" in os.environ:
-            cflags = os.environ["CFLAGS"].split()
-            compiler.compiler.extend(cflags)
-            compiler.compiler_so.extend(cflags)
-            compiler.linker_so.extend(cflags)
+
+        if 'LDSHARED' in os.environ:
+            ldshared = os.environ['LDSHARED']
+        if 'CPP' in os.environ:
+            cpp = os.environ['CPP']
+        else:
+            cpp = cc + " -E"           # not always
+        if 'LDFLAGS' in os.environ:
+            ldshared = ldshared + ' ' + os.environ['LDFLAGS']
+        if 'CFLAGS' in os.environ:
+            cflags = opt + ' ' + os.environ['CFLAGS']
+            ldshared = ldshared + ' ' + os.environ['CFLAGS']
+        if 'CPPFLAGS' in os.environ:
+            cpp = cpp + ' ' + os.environ['CPPFLAGS']
+            cflags = cflags + ' ' + os.environ['CPPFLAGS']
+            ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
+
+        cc_cmd = cc + ' ' + cflags
+
+        compiler.set_executables(
+            preprocessor=cpp,
+            compiler=cc_cmd,
+            compiler_so=cc_cmd + ' ' + ccshared,
+            linker_so=ldshared)
 
 
 from sysconfig_cpython import (

File lib-python/2.7/json/__init__.py

 
 __author__ = 'Bob Ippolito <bob@redivi.com>'
 
+try:
+    # PyPy speedup, the interface is different than CPython's _json
+    import _pypyjson
+except ImportError:
+    _pypyjson = None
+
 from .decoder import JSONDecoder
 from .encoder import JSONEncoder
 
 _default_decoder = JSONDecoder(encoding=None, object_hook=None,
                                object_pairs_hook=None)
 
-
 def load(fp, encoding=None, cls=None, object_hook=None, parse_float=None,
         parse_int=None, parse_constant=None, object_pairs_hook=None, **kw):
     """Deserialize ``fp`` (a ``.read()``-supporting file-like object containing
     if (cls is None and encoding is None and object_hook is None and
             parse_int is None and parse_float is None and
             parse_constant is None and object_pairs_hook is None and not kw):
-        return _default_decoder.decode(s)
+        if _pypyjson and not isinstance(s, unicode):
+            return _pypyjson.loads(s)
+        else:
+            return _default_decoder.decode(s)
     if cls is None:
         cls = JSONDecoder
     if object_hook is not None:

File lib_pypy/ctypes_config_cache/syslog.ctc.py

-"""
-'ctypes_configure' source for syslog.py.
-Run this to rebuild _syslog_cache.py.
-"""
-
-from ctypes_configure.configure import (configure,
-    ExternalCompilationInfo, ConstantInteger, DefinedConstantInteger)
-import dumpcache
-
-
-_CONSTANTS = (
-    'LOG_EMERG',
-    'LOG_ALERT',
-    'LOG_CRIT',
-    'LOG_ERR',
-    'LOG_WARNING',
-    'LOG_NOTICE',
-    'LOG_INFO',
-    'LOG_DEBUG',
-
-    'LOG_PID',
-    'LOG_CONS',
-    'LOG_NDELAY',
-
-    'LOG_KERN',
-    'LOG_USER',
-    'LOG_MAIL',
-    'LOG_DAEMON',
-    'LOG_AUTH',
-    'LOG_LPR',
-    'LOG_LOCAL0',
-    'LOG_LOCAL1',
-    'LOG_LOCAL2',
-    'LOG_LOCAL3',
-    'LOG_LOCAL4',
-    'LOG_LOCAL5',
-    'LOG_LOCAL6',
-    'LOG_LOCAL7',
-)
-_OPTIONAL_CONSTANTS = (
-    'LOG_NOWAIT',
-    'LOG_PERROR',
-
-    'LOG_SYSLOG',
-    'LOG_CRON',
-    'LOG_UUCP',
-    'LOG_NEWS',
-)
-
-# Constant aliases if there are not defined
-_ALIAS = (
-    ('LOG_SYSLOG', 'LOG_DAEMON'),
-    ('LOG_CRON', 'LOG_DAEMON'),
-    ('LOG_NEWS', 'LOG_MAIL'),
-    ('LOG_UUCP', 'LOG_MAIL'),
-)
-
-class SyslogConfigure:
-    _compilation_info_ = ExternalCompilationInfo(includes=['sys/syslog.h'])
-for key in _CONSTANTS:
-    setattr(SyslogConfigure, key, ConstantInteger(key))
-for key in _OPTIONAL_CONSTANTS:
-    setattr(SyslogConfigure, key, DefinedConstantInteger(key))
-
-config = configure(SyslogConfigure)
-for key in _OPTIONAL_CONSTANTS:
-    if config[key] is None:
-        del config[key]
-for alias, key in _ALIAS:
-    config.setdefault(alias, config[key])
-
-all_constants = config.keys()
-all_constants.sort()
-config['ALL_CONSTANTS'] = tuple(all_constants)
-dumpcache.dumpcache2('syslog', config)

File lib_pypy/greenlet.py

+import sys
 import _continuation
 
 __version__ = "0.4.0"
 # ____________________________________________________________
 # Exceptions
 
-class GreenletExit(Exception):
+class GreenletExit(BaseException):
     """This special exception does not propagate to the parent greenlet; it
 can be used to kill a single greenlet."""
 
         if parent is not None:
             self.parent = parent
 
-    def switch(self, *args):
+    def switch(self, *args, **kwds):
         "Switch execution to this greenlet, optionally passing the values "
         "given as argument(s).  Returns the value passed when switching back."
-        return self.__switch('switch', args)
+        return self.__switch('switch', (args, kwds))
 
     def throw(self, typ=GreenletExit, val=None, tb=None):
         "raise exception in greenlet, return value passed when switching back"
         return self.__switch('throw', typ, val, tb)
 
-    def __switch(target, methodname, *args):
+    def __switch(target, methodname, *baseargs):
         current = getcurrent()
         #
         while not (target.__main or _continulet.is_pending(target)):
                     greenlet_func = _greenlet_start
                 else:
                     greenlet_func = _greenlet_throw
-                _continulet.__init__(target, greenlet_func, *args)
+                _continulet.__init__(target, greenlet_func, *baseargs)
                 methodname = 'switch'
-                args = ()
+                baseargs = ()
                 target.__started = True
                 break
             # already done, go to the parent instead
             # up the 'parent' explicitly.  Good enough, because a Ctrl-C
             # will show that the program is caught in this loop here.)
             target = target.parent
+            # convert a "raise GreenletExit" into "return GreenletExit"
+            if methodname == 'throw':
+                try:
+                    raise baseargs[0], baseargs[1]
+                except GreenletExit, e:
+                    methodname = 'switch'
+                    baseargs = (((e,), {}),)
+                except:
+                    baseargs = sys.exc_info()[:2] + baseargs[2:]
         #
         try:
             unbound_method = getattr(_continulet, methodname)
-            args = unbound_method(current, *args, to=target)
+            args, kwds = unbound_method(current, *baseargs, to=target)
         finally:
             _tls.current = current
         #
-        if len(args) == 1:
+        if kwds:
+            if args:
+                return args, kwds
+            return kwds
+        elif len(args) == 1:
             return args[0]
         else:
             return args
     _tls.current = gmain
 
 def _greenlet_start(greenlet, args):
+    args, kwds = args
     _tls.current = greenlet
     try:
-        res = greenlet.run(*args)
+        res = greenlet.run(*args, **kwds)
     except GreenletExit, e:
         res = e
     finally:
         _continuation.permute(greenlet, greenlet.parent)
-    return (res,)
+    return ((res,), None)
 
 def _greenlet_throw(greenlet, exc, value, tb):
     _tls.current = greenlet
     try:
         raise exc, value, tb
+    except GreenletExit, e:
+        res = e
     finally:
         _continuation.permute(greenlet, greenlet.parent)
+    return ((res,), None)

File lib_pypy/grp.py

 
 from ctypes import Structure, c_char_p, c_int, POINTER
 from ctypes_support import standard_c_lib as libc
+import _structseq
 
 try: from __pypy__ import builtinify
 except ImportError: builtinify = lambda f: f
         ('gr_mem', POINTER(c_char_p)),
         )
 
-class Group(object):
-    def __init__(self, gr_name, gr_passwd, gr_gid, gr_mem):
-        self.gr_name = gr_name
-        self.gr_passwd = gr_passwd
-        self.gr_gid = gr_gid
-        self.gr_mem = gr_mem
+class struct_group:
+    __metaclass__ = _structseq.structseqtype
 
-    def __getitem__(self, item):
-        if item == 0:
-            return self.gr_name
-        elif item == 1:
-            return self.gr_passwd
-        elif item == 2:
-            return self.gr_gid
-        elif item == 3:
-            return self.gr_mem
-        else:
-            raise IndexError(item)
-
-    def __len__(self):
-        return 4
-
-    def __repr__(self):
-        return str((self.gr_name, self.gr_passwd, self.gr_gid, self.gr_mem))
-
-    # whatever else...
+    gr_name   = _structseq.structseqfield(0)
+    gr_passwd = _structseq.structseqfield(1)
+    gr_gid    = _structseq.structseqfield(2)
+    gr_mem    = _structseq.structseqfield(3)
 
 libc.getgrgid.argtypes = [gid_t]
 libc.getgrgid.restype = POINTER(GroupStruct)
     while res.contents.gr_mem[i]:
         mem.append(res.contents.gr_mem[i])
         i += 1
-    return Group(res.contents.gr_name, res.contents.gr_passwd,
-                 res.contents.gr_gid, mem)
+    return struct_group((res.contents.gr_name, res.contents.gr_passwd,
+                         res.contents.gr_gid, mem))
 
 @builtinify
 def getgrgid(gid):

File lib_pypy/pyrepl/curses.py

 # CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
-# avoid importing the whole curses, if possible
-try:
+# If we are running on top of pypy, we import only _minimal_curses.
+# Don't try to fall back to _curses, because that's going to use cffi
+# and fall again more loudly.
+import sys
+if '__pypy__' in sys.builtin_module_names:
     # pypy case
     import _minimal_curses as _curses
-except ImportError:
+else:
+    # cpython case
     try:
         import _curses
     except ImportError:

File lib_pypy/syslog.py

+# this cffi version was rewritten based on the
 # ctypes implementation: Victor Stinner, 2008-05-08
 """
 This module provides an interface to the Unix syslog library routines.
 if sys.platform == 'win32':
     raise ImportError("No syslog on Windows")
 
-# load the platform-specific cache made by running syslog.ctc.py
-from ctypes_config_cache._syslog_cache import *
-
-from ctypes_support import standard_c_lib as libc
-from ctypes import c_int, c_char_p
+from cffi import FFI
 
 try: from __pypy__ import builtinify
 except ImportError: builtinify = lambda f: f
 
+ffi = FFI()
 
-# Real prototype is:
-# void syslog(int priority, const char *format, ...);
-# But we also need format ("%s") and one format argument (message)
-_syslog = libc.syslog
-_syslog.argtypes = (c_int, c_char_p, c_char_p)
-_syslog.restype = None
+ffi.cdef("""
+/* mandatory constants */
+#define LOG_EMERG ...
+#define LOG_ALERT ...
+#define LOG_CRIT ...
+#define LOG_ERR ...
+#define LOG_WARNING ...
+#define LOG_NOTICE ...
+#define LOG_INFO ...
+#define LOG_DEBUG ...
 
-_openlog = libc.openlog
-_openlog.argtypes = (c_char_p, c_int, c_int)
-_openlog.restype = None
+#define LOG_PID ...
+#define LOG_CONS ...
+#define LOG_NDELAY ...
 
-_closelog = libc.closelog
-_closelog.argtypes = None
-_closelog.restype = None
+#define LOG_KERN ...
+#define LOG_USER ...
+#define LOG_MAIL ...
+#define LOG_DAEMON ...
+#define LOG_AUTH ...
+#define LOG_LPR ...
+#define LOG_LOCAL0 ...
+#define LOG_LOCAL1 ...
+#define LOG_LOCAL2 ...
+#define LOG_LOCAL3 ...
+#define LOG_LOCAL4 ...
+#define LOG_LOCAL5 ...
+#define LOG_LOCAL6 ...
+#define LOG_LOCAL7 ...
 
-_setlogmask = libc.setlogmask
-_setlogmask.argtypes = (c_int,)
-_setlogmask.restype = c_int
+/* optional constants, gets defined to -919919 if missing */
+#define LOG_NOWAIT ...
+#define LOG_PERROR ...
+
+/* aliased constants, gets defined as some other constant if missing */
+#define LOG_SYSLOG ...
+#define LOG_CRON ...
+#define LOG_UUCP ...
+#define LOG_NEWS ...
+
+/* functions */
+void openlog(const char *ident, int option, int facility);
+void syslog(int priority, const char *format, const char *string);
+// NB. the signature of syslog() is specialized to the only case we use
+void closelog(void);
+int setlogmask(int mask);
+""")
+
+lib = ffi.verify("""
+#include <syslog.h>
+
+#ifndef LOG_NOWAIT
+#define LOG_NOWAIT -919919
+#endif
+#ifndef LOG_PERROR
+#define LOG_PERROR -919919
+#endif
+#ifndef LOG_SYSLOG
+#define LOG_SYSLOG LOG_DAEMON
+#endif
+#ifndef LOG_CRON
+#define LOG_CRON LOG_DAEMON
+#endif
+#ifndef LOG_UUCP
+#define LOG_UUCP LOG_MAIL
+#endif
+#ifndef LOG_NEWS
+#define LOG_NEWS LOG_MAIL
+#endif
+""")
+
 
 _S_log_open = False
 _S_ident_o = None
     return None
 
 @builtinify
-def openlog(ident=None, logoption=0, facility=LOG_USER):
+def openlog(ident=None, logoption=0, facility=lib.LOG_USER):
     global _S_ident_o, _S_log_open
     if ident is None:
         ident = _get_argv()
-    _S_ident_o = c_char_p(ident)    # keepalive
-    _openlog(_S_ident_o, logoption, facility)
+    if ident is None:
+        _S_ident_o = ffi.NULL
+    elif isinstance(ident, str):
+        _S_ident_o = ffi.new("char[]", ident)    # keepalive
+    else:
+        raise TypeError("'ident' must be a string or None")
+    lib.openlog(_S_ident_o, logoption, facility)
     _S_log_open = True
 
 @builtinify
     # if log is not opened, open it now
     if not _S_log_open:
         openlog()
-    _syslog(priority, "%s", message)
+    lib.syslog(priority, "%s", message)
 
 @builtinify
 def closelog():
     global _S_log_open, S_ident_o
     if _S_log_open:
-        _closelog()
+        lib.closelog()
         _S_log_open = False
         _S_ident_o = None
 
 @builtinify
 def setlogmask(mask):
-    return _setlogmask(mask)
+    return lib.setlogmask(mask)
 
 @builtinify
 def LOG_MASK(pri):
 def LOG_UPTO(pri):
     return (1 << (pri + 1)) - 1
 
-__all__ = ALL_CONSTANTS + (
+__all__ = []
+
+for name in sorted(lib.__dict__):
+    if name.startswith('LOG_'):
+        value = getattr(lib, name)
+        if value != -919919:
+            globals()[name] = value
+            __all__.append(name)
+
+__all__ = tuple(__all__) + (
     'openlog', 'syslog', 'closelog', 'setlogmask',
     'LOG_MASK', 'LOG_UPTO')
-
-del ALL_CONSTANTS

File pypy/config/pypyoption.py

      "thread", "itertools", "pyexpat", "_ssl", "cpyext", "array",
      "binascii", "_multiprocessing", '_warnings',
      "_collections", "_multibytecodec", "micronumpy", "_ffi",
-     "_continuation", "_cffi_backend", "_csv", "cppyy"]
+     "_continuation", "_cffi_backend", "_csv", "cppyy", "_pypyjson"]
 ))
 
 translation_modules = default_modules.copy()
                    requires=module_dependencies.get(modname, []),
                    suggests=module_suggests.get(modname, []),
                    negation=modname not in essential_modules,
-                   validator=get_module_validator(modname))
+                   ) #validator=get_module_validator(modname))
         for modname in all_modules]),
 
     BoolOption("allworkingmodules", "use as many working modules as possible",

File pypy/doc/coding-guide.rst

 
 Here is the order in which PyPy looks up Python modules:
 
-*pypy/modules*
+*pypy/module*
 
     mixed interpreter/app-level builtin modules, such as
     the ``sys`` and ``__builtin__`` module.
 on some classes being old-style.
 
 We just maintain those changes in place,
-to see what is changed we have a branch called `vendot/stdlib`
+to see what is changed we have a branch called `vendor/stdlib`
 wich contains the unmodified cpython stdlib
 
 .. _`mixed module mechanism`:
 runs at application level. If you need to use modules
 you have to import them within the test function.
 
-Another possibility to pass in data into the AppTest is to use
+Data can be passed into the AppTest using 
 the ``setup_class`` method of the AppTest. All wrapped objects that are
 attached to the class there and start with ``w_`` can be accessed
 via self (but without the ``w_``) in the actual test method. An example::
 
 .. _`run the tests as usual`:
 
+Another possibility is to use cls.space.appexec, for example::
+
+    class AppTestSomething(object):
+        def setup_class(cls):
+            arg = 2
+            cls.w_result = cls.space.appexec([cls.space.wrap(arg)], """(arg):
+                return arg ** 6
+                """)
+
+        def test_power(self):
+            assert self.result == 2 ** 6
+
+which executes the code string function with the given arguments at app level.
+Note the use of ``w_result`` in ``setup_class`` but self.result in the test 
+Here is how to define an app level class  in ``setup_class`` that can be used
+in subsequent tests::
+
+    class AppTestSet(object):
+        def setup_class(cls):
+            w_fakeint = cls.space.appexec([], """():
+                class FakeInt(object):
+                    def __init__(self, value):
+                        self.value = value
+                    def __hash__(self):
+                        return hash(self.value)
+
+                    def __eq__(self, other):
+                        if other == self.value:
+                            return True
+                        return False
+                return FakeInt
+                """)
+            cls.w_FakeInt = w_fakeint
+
+        def test_fakeint(self):
+            f1 = self.FakeInt(4)
+            assert f1 == 4
+            assert hash(f1) == hash(4)
+
+
 Command line tool test_all
 --------------------------
 

File pypy/doc/config/objspace.usemodules._pypyjson.txt

+RPython speedups for the stdlib json module

File pypy/doc/contributor.rst

 code base, ordered by number of commits (which is certainly not a very
 appropriate measure but it's something)::
 
-    Armin Rigo
-    Maciej Fijalkowski
-    Carl Friedrich Bolz
-    Antonio Cuni
-    Amaury Forgeot d'Arc
-    Samuele Pedroni
-    Michael Hudson
-    Holger Krekel
-    Benjamin Peterson
-    Christian Tismer
-    Hakan Ardo
-    Alex Gaynor
-    Eric van Riet Paap
-    Anders Chrigstrom
-    David Schneider
-    Richard Emslie
-    Dan Villiom Podlaski Christiansen
-    Alexander Schremmer
-    Aurelien Campeas
-    Anders Lehmann
-    Camillo Bruni
-    Niklaus Haldimann
-    Leonardo Santagada
-    Toon Verwaest
-    Seo Sanghyeon
-    Lawrence Oluyede
-    Bartosz Skowron
-    Jakub Gustak
-    Guido Wesdorp
-    Daniel Roberts
-    Adrien Di Mascio
-    Laura Creighton
-    Ludovic Aubry
-    Niko Matsakis
-    Jason Creighton
-    Jacob Hallen
-    Alex Martelli
-    Anders Hammarquist
-    Jan de Mooij
-    Wim Lavrijsen
-    Stephan Diehl
-    Michael Foord
-    Stefan Schwarzer
-    Tomek Meka
-    Patrick Maupin
-    Bob Ippolito
-    Bruno Gola
-    Alexandre Fayolle
-    Marius Gedminas
-    Simon Burton
-    Justin Peel
-    Jean-Paul Calderone
-    John Witulski
-    Lukas Diekmann
-    holger krekel
-    Wim Lavrijsen
-    Dario Bertini
-    Andreas Stührk
-    Jean-Philippe St. Pierre
-    Guido van Rossum
-    Pavel Vinogradov
-    Valentino Volonghi
-    Paul deGrandis
-    Adrian Kuhn
-    tav
-    Georg Brandl
-    Gerald Klix
-    Wanja Saatkamp
-    Ronny Pfannschmidt
-    Boris Feigin
-    Oscar Nierstrasz
-    David Malcolm
-    Eugene Oden
-    Henry Mason
-    Sven Hager
-    Lukas Renggli
-    Ilya Osadchiy
-    Guenter Jantzen
-    Bert Freudenberg
-    Amit Regmi
-    Ben Young
-    Nicolas Chauvat
-    Andrew Durdin
-    Michael Schneider
-    Nicholas Riley
-    Rocco Moretti
-    Gintautas Miliauskas
-    Michael Twomey
-    Igor Trindade Oliveira
-    Lucian Branescu Mihaila
-    Olivier Dormond
-    Jared Grubb
-    Karl Bartel
-    Gabriel Lavoie
-    Victor Stinner
-    Brian Dorsey
-    Stuart Williams
-    Toby Watson
-    Antoine Pitrou
-    Justas Sadzevicius
-    Neil Shepperd
-    Mikael Schönenberg
-    Gasper Zejn
-    Jonathan David Riehl
-    Elmo Mäntynen
-    Anders Qvist
-    Beatrice During
-    Alexander Sedov
-    Timo Paulssen
-    Corbin Simpson
-    Vincent Legoll
-    Romain Guillebert
-    Alan McIntyre
-    Alex Perry
-    Jens-Uwe Mager
-    Simon Cross
-    Dan Stromberg
-    Guillebert Romain
-    Carl Meyer
-    Pieter Zieschang
-    Alejandro J. Cura
-    Sylvain Thenault
-    Christoph Gerum
-    Travis Francis Athougies
-    Henrik Vendelbo
-    Lutz Paelike
-    Jacob Oscarson
-    Martin Blais
-    Lucio Torre
-    Lene Wagner
-    Miguel de Val Borro
-    Ignas Mikalajunas
-    Artur Lisiecki
-    Philip Jenvey
-    Joshua Gilbert
-    Godefroid Chappelle
-    Yusei Tahara
-    Christopher Armstrong
-    Stephan Busemann
-    Gustavo Niemeyer
-    William Leslie
-    Akira Li
-    Kristjan Valur Jonsson
-    Bobby Impollonia
-    Michael Hudson-Doyle
-    Andrew Thompson
-    Anders Sigfridsson
-    Floris Bruynooghe
-    Jacek Generowicz
-    Dan Colish
-    Zooko Wilcox-O Hearn
-    Dan Villiom Podlaski Christiansen
-    Anders Hammarquist
-    Chris Lambacher
-    Dinu Gherman
-    Dan Colish
-    Brett Cannon
-    Daniel Neuhäuser
-    Michael Chermside
-    Konrad Delong
-    Anna Ravencroft
-    Greg Price
-    Armin Ronacher
-    Christian Muirhead
-    Jim Baker
-    Rodrigo Araújo
-    Romain Guillebert
+  Armin Rigo
+  Maciej Fijalkowski
+  Carl Friedrich Bolz
+  Antonio Cuni
+  Amaury Forgeot d'Arc
+  Samuele Pedroni
+  Alex Gaynor
+  Michael Hudson
+  David Schneider
+  Holger Krekel
+  Christian Tismer
+  Hakan Ardo
+  Benjamin Peterson
+  Matti Picus
+  Philip Jenvey
+  Anders Chrigstrom
+  Brian Kearns
+  Eric van Riet Paap
+  Richard Emslie
+  Alexander Schremmer
+  Wim Lavrijsen
+  Dan Villiom Podlaski Christiansen
+  Manuel Jacob
+  Lukas Diekmann
+  Sven Hager
+  Anders Lehmann
+  Aurelien Campeas
+  Niklaus Haldimann
+  Ronan Lamy
+  Camillo Bruni
+  Laura Creighton
+  Toon Verwaest
+  Leonardo Santagada
+  Seo Sanghyeon
+  Justin Peel
+  Ronny Pfannschmidt
+  David Edelsohn
+  Anders Hammarquist
+  Jakub Gustak
+  Guido Wesdorp
+  Lawrence Oluyede
+  Bartosz Skowron
+  Daniel Roberts
+  Niko Matsakis
+  Adrien Di Mascio
+  Ludovic Aubry
+  Alexander Hesse
+  Jacob Hallen
+  Romain Guillebert
+  Jason Creighton
+  Alex Martelli
+  Michal Bendowski
+  Jan de Mooij
+  Michael Foord
+  Stephan Diehl
+  Stefan Schwarzer
+  Valentino Volonghi
+  Tomek Meka
+  Patrick Maupin
+  stian
+  Bob Ippolito
+  Bruno Gola
+  Jean-Paul Calderone
+  Timo Paulssen
+  Alexandre Fayolle
+  Simon Burton
+  Marius Gedminas
+  John Witulski
+  Greg Price
+  Dario Bertini
+  Mark Pearse
+  Simon Cross
+  Konstantin Lopuhin
+  Andreas Stührk
+  Jean-Philippe St. Pierre
+  Guido van Rossum
+  Pavel Vinogradov
+  Paul deGrandis
+  Ilya Osadchiy
+  Adrian Kuhn
+  Boris Feigin
+  tav
+  Georg Brandl
+  Bert Freudenberg
+  Stian Andreassen
+  Stefano Rivera
+  Wanja Saatkamp
+  Gerald Klix
+  Mike Blume
+  Taavi Burns
+  Oscar Nierstrasz
+  David Malcolm
+  Eugene Oden
+  Henry Mason
+  Preston Timmons
+  Jeff Terrace
+  David Ripton
+  Dusty Phillips
+  Lukas Renggli
+  Guenter Jantzen
+  Tobias Oberstein
+  Remi Meier
+  Ned Batchelder
+  Amit Regmi
+  Ben Young
+  Nicolas Chauvat
+  Andrew Durdin
+  Michael Schneider
+  Nicholas Riley
+  Jason Chu
+  Igor Trindade Oliveira
+  Jeremy Thurgood
+  Rocco Moretti
+  Gintautas Miliauskas
+  Michael Twomey
+  Lucian Branescu Mihaila
+  Tim Felgentreff
+  Tyler Wade
+  Gabriel Lavoie
+  Olivier Dormond
+  Jared Grubb
+  Karl Bartel
+  Brian Dorsey
+  Victor Stinner
+  Stuart Williams
+  Jasper Schulz
+  Toby Watson
+  Antoine Pitrou
+  Aaron Iles
+  Michael Cheng
+  Justas Sadzevicius
+  Gasper Zejn
+  Neil Shepperd
+  Mikael Schönenberg
+  Elmo Mäntynen
+  Tobias Pape
+  Jonathan David Riehl
+  Stanislaw Halik
+  Anders Qvist
+  Chirag Jadwani
+  Beatrice During
+  Alex Perry
+  Vincent Legoll
+  Alan McIntyre
+  Alexander Sedov
+  Corbin Simpson
+  Christopher Pope
+  Laurence Tratt
+  Guillebert Romain
+  Christian Tismer 
+  Dan Stromberg
+  Stefano Parmesan
+  Christian Hudon
+  Alexis Daboville
+  Jens-Uwe Mager
+  Carl Meyer
+  Karl Ramm
+  Pieter Zieschang
+  Gabriel
+  Paweł Piotr Przeradowski
+  Andrew Dalke
+  Sylvain Thenault
+  Nathan Taylor
+  Vladimir Kryachko
+  Jacek Generowicz
+  Alejandro J. Cura
+  Jacob Oscarson
+  Travis Francis Athougies
+  Kristjan Valur Jonsson
+  Neil Blakey-Milner
+  Lutz Paelike
+  Lucio Torre
+  Lars Wassermann
+  Henrik Vendelbo
+  Dan Buch
+  Miguel de Val Borro
+  Artur Lisiecki
+  Sergey Kishchenko
+  Ignas Mikalajunas
+  Christoph Gerum
+  Martin Blais
+  Lene Wagner
+  Tomo Cocoa
+  Andrews Medina
+  roberto@goyle
+  William Leslie
+  Bobby Impollonia
+  timo@eistee.fritz.box
+  Andrew Thompson
+  Yusei Tahara
+  Roberto De Ioris
+  Juan Francisco Cantero Hurtado
+  Godefroid Chappelle
+  Joshua Gilbert
+  Dan Colish
+  Christopher Armstrong
+  Michael Hudson-Doyle
+  Anders Sigfridsson
+  Yasir Suhail
+  Floris Bruynooghe
+  Akira Li
+  Gustavo Niemeyer
+  Stephan Busemann
+  Anna Katrina Dominguez
+  Christian Muirhead
+  James Lan
+  shoma hosaka
+  Daniel Neuhäuser
+  Buck Golemon
+  Konrad Delong
+  Dinu Gherman
+  Chris Lambacher
+  coolbutuseless@gmail.com
+  Jim Baker
+  Rodrigo Araújo
+  Armin Ronacher
+  Brett Cannon
+  yrttyr
+  Zooko Wilcox-O Hearn
+  Tomer Chachamu
+  Christopher Groskopf
+  opassembler.py
+  Antony Lee
+  Jim Hunziker
+  Markus Unterwaditzer
+  Even Wiik Thomassen
+  jbs
+  soareschen
+  Flavio Percoco
+  Kristoffer Kleine
+  yasirs
+  Michael Chermside
+  Anna Ravencroft
+  Andrew Chambers
+  Julien Phalip
+  Dan Loewenherz
 

File pypy/doc/faq.rst

 Does PyPy have a GIL?  Why?
 -------------------------------------------------
 
-Yes, PyPy has a GIL.  Removing the GIL is very hard.  The first problem
-is that our garbage collectors are not re-entrant.
+Yes, PyPy has a GIL.  Removing the GIL is very hard.  The problems are
+essentially the same as with CPython (including the fact that our
+garbage collectors are not thread-safe so far).  Fixing it is possible,
+as shown by Jython and IronPython, but difficult.  It would require
+adapting the whole source code of PyPy, including subtle decisions about
+whether some effects are ok or not for the user (i.e. the Python
+programmer).
+
+Instead, since 2012, there is work going on on a still very experimental
+Software Transactional Memory (STM) version of PyPy.  This should give
+an alternative PyPy which internally has no GIL, while at the same time
+continuing to give the Python programmer the complete illusion of having
+one.  It would in fact push forward *more* GIL-ish behavior, like
+declaring that some sections of the code should run without releasing
+the GIL in the middle (these are called *atomic sections* in STM).
 
 ------------------------------------------
 How do I write extension modules for PyPy?
 
 No, and you shouldn't try.  First and foremost, RPython is a language
 designed for writing interpreters. It is a restricted subset of
-Python.  If you program is not an interpreter but tries to do "real
+Python.  If your program is not an interpreter but tries to do "real
 things", like use *any* part of the standard Python library or *any*
 3rd-party library, then it is not RPython to start with.  You should
 only look at RPython if you try to `write your own interpreter`__.
 Yes, it is possible with enough effort to compile small self-contained
 pieces of RPython code doing a few performance-sensitive things.  But
 this case is not interesting for us.  If you needed to rewrite the code
-in RPython, you could as well have rewritten it in C for example.  The
-latter is a much more supported, much more documented language `:-)`
+in RPython, you could as well have rewritten it in C or C++ or Java for
+example.  These are much more supported, much more documented languages
+`:-)`
+
+  *The above paragraphs are not the whole truth.  It* is *true that there
+  are cases where writing a program as RPython gives you substantially
+  better speed than running it on top of PyPy.  However, the attitude of
+  the core group of people behind PyPy is to answer: "then report it as a
+  performance bug against PyPy!".*
+
+  *Here is a more diluted way to put it.  The "No, don't!" above is a
+  general warning we give to new people.  They are likely to need a lot
+  of help from* some *source, because RPython is not so simple nor
+  extensively documented; but at the same time, we, the pypy core group
+  of people, are not willing to invest time in supporting 3rd-party
+  projects that do very different things than interpreters for dynamic
+  languages --- just because we have other interests and there are only
+  so many hours a day.  So as a summary I believe it is only fair to
+  attempt to point newcomers at existing alternatives, which are more
+  mainstream and where they will get help from many people.*
+
+  *If anybody seriously wants to promote RPython anyway, he is welcome
+  to: we won't actively resist such a plan.  There are a lot of things
+  that could be done to make RPython a better Java-ish language for
+  example, starting with supporting non-GIL-based multithreading, but we
+  don't implement them because they have little relevance to us.  This
+  is open source, which means that anybody is free to promote and
+  develop anything; but it also means that you must let us choose* not
+  *to go into that direction ourselves.*
 
 ---------------------------------------------------
 Which backends are there for the RPython toolchain?

File pypy/doc/getting-started-dev.rst

 
 .. contents::
 
+.. warning::
+
+    Please `read this FAQ entry`_ first!
+
+.. _`read this FAQ entry`: http://doc.pypy.org/en/latest/faq.html#do-i-have-to-rewrite-my-programs-in-rpython
+
 RPython is a subset of Python that can be statically compiled. The PyPy
 interpreter is written mostly in RPython (with pieces in Python), while
 the RPython compiler is written in Python. The hard to understand part

File pypy/doc/how-to-contribute.rst

 entry point.
 
 .. _`introduction to RPython`: getting-started-dev.html
+.. _`pytest`: http://pytest.org/

File pypy/doc/how-to-release.rst

 * go to pypy/tool/release and run:
   force-builds.py /release/<release branch>
 * wait for builds to complete, make sure there are no failures
-* run pypy/tool/release/make_release.py, this will build necessary binaries
-  and upload them to pypy.org
+* upload binaries to https://bitbucket.org/pypy/pypy/downloads
 
   Following binaries should be built, however, we need more buildbots:
-    JIT: windows, linux, os/x
+    JIT: windows, linux, os/x, armhf, armel
     no JIT: windows, linux, os/x
     sandbox: linux, os/x
 

File pypy/doc/release-2.1.0-beta1.rst

+===============
+PyPy 2.1 beta 1
+===============
+
+We're pleased to announce the first beta of the upcoming 2.1 release of PyPy.
+This beta contains many bugfixes and improvements, numerous improvements to the
+numpy in pypy effort. The main feature being that the ARM processor support is
+not longer considered alpha level. We would like to thank the `Raspberry Pi
+Foundation`_ for supporting the work to finish PyPy's ARM support.
+
+You can download the PyPy 2.1 beta 1 release here:
+
+    http://pypy.org/download.html 
+
+.. _`Raspberry Pi Foundation`: http://www.raspberrypi.org
+
+Highlights
+==========
+
+* Bugfixes to the ARM JIT backend, so that ARM is now an officially
+  supported processor architecture
+
+* Stacklet support on ARM
+
+* Interpreter improvements
+
+* Various numpy improvements
+
+* Bugfixes to cffi and ctypes
+
+* Bugfixes to the stacklet support
+
+* Improved logging performance
+
+* Faster sets for objects
+
+What is PyPy?
+=============
+
+PyPy is a very compliant Python interpreter, almost a drop-in replacement for
+CPython 2.7.3. It's fast due to its integrated tracing JIT compiler.
+
+This release supports x86 machines running Linux 32/64, Mac OS X 64 or Windows
+32. Also this release supports ARM machines running Linux 32bit - anything with
+``ARMv6`` (like the Raspberry Pi) or ``ARMv7`` (like Beagleboard,
+Chromebook, Cubieboard, etc.) that supports ``VFPv3`` should work. Both
+hard-float ``armhf/gnueabihf`` and soft-float ``armel/gnueabi`` builds are
+provided. ``armhf`` builds for Raspbian are created using the Raspberry Pi
+`custom cross-compilation toolchain <https://github.com/raspberrypi>`_
+based on ``gcc-arm-linux-gnueabihf`` and should work on ``ARMv6`` and
+``ARMv7`` devices running Debian or Raspbian. ``armel`` builds are built
+using the ``gcc-arm-linux-gnuebi`` toolchain provided by Ubuntu and
+currently target ``ARMv7``.
+
+Windows 64 work is still stalling, we would welcome a volunteer
+to handle that.
+
+How to use PyPy?
+================
+
+We suggest using PyPy from a `virtualenv`_. Once you have a virtualenv
+installed, you can follow instructions from `pypy documentation`_ on how
+to proceed. This document also covers other `installation schemes`_.
+
+.. _`pypy documentation`: http://doc.pypy.org/en/latest/getting-started.html#installing-using-virtualenv
+.. _`virtualenv`: http://www.virtualenv.org/en/latest/
+.. _`installation schemes`: http://doc.pypy.org/en/latest/getting-started.html#installing-pypy
+.. _`PyPy and pip`: http://doc.pypy.org/en/latest/getting-started.html#installing-pypy
+
+
+Cheers,
+the PyPy team

File pypy/doc/rffi.rst

 See cbuild_ for more info on ExternalCompilationInfo.
 
 .. _`low level types`: rtyper.html#low-level-type
-.. _cbuild: https://bitbucket.org/pypy/pypy/src/tip/pypy/translator/tool/cbuild.py
+.. _cbuild: https://bitbucket.org/pypy/pypy/src/tip/rpython/translator/tool/cbuild.py
 
 
 Types
 as a fake low-level implementation for tests performed by an llinterp.
 
 .. _`extfunc.py`: https://bitbucket.org/pypy/pypy/src/tip/pypy/rpython/extfunc.py
-
-
-OO backends
------------
-
-XXX to be written

File pypy/doc/whatsnew-2.1.rst

+======================
+What's new in PyPy 2.1
+======================
+
+.. this is a revision shortly after release-2.0
+.. startrev: a13c07067613
+
+.. branch: ndarray-ptp
+put and array.put
+
+.. branch: numpy-pickle
+Pickling of numpy arrays and dtypes (including record dtypes)
+
+.. branch: remove-array-smm
+Remove multimethods in the arraymodule
+
+.. branch: callback-stacklet
+Fixed bug when switching stacklets from a C callback
+
+.. branch: remove-set-smm
+Remove multi-methods on sets
+
+.. branch: numpy-subarrays
+Implement subarrays for numpy
+
+.. branch: remove-dict-smm
+Remove multi-methods on dict
+
+.. branch: remove-list-smm-2
+Remove remaining multi-methods on list
+
+.. branch: arm-stacklet
+Stacklet support for ARM, enables _continuation support
+
+.. branch: remove-tuple-smm
+Remove multi-methods on tuple
+
+.. branch: remove-iter-smm
+Remove multi-methods on iterators
+
+.. branch: emit-call-x86
+.. branch: emit-call-arm
+
+.. branch: on-abort-resops
+Added list of resops to the pypyjit on_abort hook.
+
+.. branch: logging-perf
+Speeds up the stdlib logging module
+
+.. branch: operrfmt-NT
+Adds a couple convenient format specifiers to operationerrfmt
+
+.. branch: win32-fixes3
+Skip and fix some non-translated (own) tests for win32 builds
+
+.. branch: ctypes-byref
+Add the '_obj' attribute on ctypes pointer() and byref() objects
+
+.. branch: argsort-segfault
+Fix a segfault in argsort when sorting by chunks on multidim numpypy arrays (mikefc)
+
+.. branch: dtype-isnative
+.. branch: ndarray-round
+
+.. branch: faster-str-of-bigint
+Improve performance of str(long).
+
+.. branch: ndarray-view
+Add view to ndarray and zeroD arrays, not on dtype scalars yet
+
+.. branch: numpypy-segfault
+fix segfault caused by iterating over empty ndarrays
+
+.. branch: identity-set
+Faster sets for objects
+
+.. branch: inline-identityhash
+Inline the fast path of id() and hash()
+
+.. branch: package-tk
+Adapt package.py script to compile CFFI tk extension. Add a --without-tk switch
+to optionally skip it.
+

File pypy/doc/whatsnew-head.rst

 What's new in PyPy 2.1
 ======================
 
-.. this is a revision shortly after release-2.0
-.. startrev: a13c07067613
+.. this is a revision shortly after release-2.1-beta
+.. startrev: 4eb52818e7c0
 
-.. branch: numpy-pickle
-Pickling of numpy arrays and dtypes (including record dtypes)
+.. branch: fastjson
+Fast json decoder written in RPython, about 3-4x faster than the pure Python
+decoder which comes with the stdlib
 
-.. branch: remove-array-smm
-Remove multimethods in the arraymodule
+.. branch: improve-str2charp
+Improve the performance of I/O writing up to 15% by using memcpy instead of
+copying char-by-char in str2charp and get_nonmovingbuffer
 
-.. branch: callback-stacklet
-Fixed bug when switching stacklets from a C callback
+.. branch: flowoperators
+Simplify rpython/flowspace/ code by using more metaprogramming.  Create
+SpaceOperator class to gather static information about flow graph operations.
 
-.. branch: remove-set-smm
-Remove multi-methods on sets
+.. branch: package-tk
+Adapt package.py script to compile CFFI tk extension. Add a --without-tk switch
+to optionally skip it.
 
-.. branch: numpy-subarrays
-Implement subarrays for numpy
+.. branch: distutils-cppldflags
+Copy CPython's implementation of customize_compiler, dont call split on
+environment variables, honour CFLAGS, CPPFLAGS, LDSHARED and LDFLAGS on Unices.
 
-.. branch: remove-dict-smm
-Remove multi-methods on dict
+.. branch: precise-instantiate
+When an RPython class is instantiated via an indirect call (that is, which
+class is being instantiated isn't known precisely) allow the optimizer to have
+more precise information about which functions can be called. Needed for Topaz.
 
-.. branch: remove-list-smm-2
-Remove remaining multi-methods on list
-
-.. branch: arm-stacklet
-Stacklet support for ARM, enables _continuation support
-
-.. branch: remove-tuple-smm
-Remove multi-methods on tuple
-
-.. branch: remove-iter-smm
-Remove multi-methods on iterators
-
-.. branch: emit-call-x86
-.. branch: emit-call-arm
-
-.. branch: on-abort-resops
-Added list of resops to the pypyjit on_abort hook.
-
-.. branch: logging-perf
-Speeds up the stdlib logging module
-
-.. branch: operrfmt-NT
-Adds a couple convenient format specifiers to operationerrfmt
-
-.. branch: win32-fixes3
-Skip and fix some non-translated (own) tests for win32 builds
-
-.. branch: ctypes-byref
-Add the '_obj' attribute on ctypes pointer() and byref() objects
-
-.. branch: argsort-segfault
-Fix a segfault in argsort when sorting by chunks on multidim numpypy arrays (mikefc)
-
-.. branch: dtype-isnative
-.. branch: ndarray-round
-
-.. branch: faster-str-of-bigint
-Improve performance of str(long).
+.. branch: ssl_moving_write_buffer

File pypy/interpreter/app_main.py

     print >> sys.stderr, "Python", sys.version
     raise SystemExit
 
+
+def funroll_loops(*args):
+    print("Vroom vroom, I'm a racecar!")
+
+
 def set_jit_option(options, jitparam, *args):
     if jitparam == 'help':
         _print_jit_help()
     'Q':         (div_option,      Ellipsis),
     '--info':    (print_info,      None),
     '--jit':     (set_jit_option,  Ellipsis),
+    '-funroll-loops': (funroll_loops, None),
     '--':        (end_options,     None),
     }
 

File pypy/interpreter/astcompiler/test/test_compiler.py

         assert "0 ('hi')" not in output.getvalue()
 
     def test_print_to(self):
-         exec """if 1:
-         from StringIO import StringIO
-         s = StringIO()
-         print >> s, "hi", "lovely!"
-         assert s.getvalue() == "hi lovely!\\n"
-         s = StringIO()
-         print >> s, "hi", "lovely!",
-         assert s.getvalue() == "hi lovely!"
-         """ in {}
+        exec """if 1:
+        from StringIO import StringIO
+        s = StringIO()
+        print >> s, "hi", "lovely!"
+        assert s.getvalue() == "hi lovely!\\n"
+        s = StringIO()
+        print >> s, "hi", "lovely!",
+        assert s.getvalue() == "hi lovely!"
+        """ in {}
 
     def test_assert_with_tuple_arg(self):
         try:

File pypy/interpreter/gateway.py

                            (self.use(typ), self.nextarg()))
 
     def visit__ObjSpace(self, el):
-        if self.finger != 0:
+        if self.finger > 1:
             raise FastFuncNotSupported
         self.unwrap.append("space")
 
                 mod = ""
             if mod == 'pypy.interpreter.astcompiler.ast':
                 raise FastFuncNotSupported
-            if (not mod.startswith('pypy.module.__builtin__') and
-                not mod.startswith('pypy.module.sys') and
-                not mod.startswith('pypy.module.math')):
-                if not func.__name__.startswith('descr'):
-                    raise FastFuncNotSupported
+            #if (not mod.startswith('pypy.module.__builtin__') and
+            #    not mod.startswith('pypy.module.sys') and
+            #    not mod.startswith('pypy.module.math')):
+            #    if not func.__name__.startswith('descr'):
+            #        raise FastFuncNotSupported
             d = {}
             unwrap_info.miniglobals['func'] = func
             source = """if 1:
                 def fastfunc_%s_%d(%s):
                     return func(%s)
-                \n""" % (func.__name__, narg,
+                \n""" % (func.__name__.replace('-', '_'), narg,
                          ', '.join(args),
                          ', '.join(unwrap_info.unwrap))
             exec compile2(source) in unwrap_info.miniglobals, d
-            fastfunc = d['fastfunc_%s_%d' % (func.__name__, narg)]
+            fastfunc = d['fastfunc_%s_%d' % (func.__name__.replace('-', '_'), narg)]