[pypy-commit] pypy release-pypy2.7-5.x: merge default into branch

mattip pypy.commits at gmail.com
Thu Mar 16 08:44:01 EDT 2017


Author: Matti Picus <matti.picus at gmail.com>
Branch: release-pypy2.7-5.x
Changeset: r90721:a7294dae4050
Date: 2017-03-16 14:41 +0200
http://bitbucket.org/pypy/pypy/changeset/a7294dae4050/

Log:	merge default into branch

diff too long, truncating to 2000 out of 2146 lines

diff --git a/LICENSE b/LICENSE
--- a/LICENSE
+++ b/LICENSE
@@ -1,3 +1,5 @@
+#encoding utf-8
+
 License
 =======
 
@@ -42,9 +44,9 @@
   Antonio Cuni
   Samuele Pedroni
   Matti Picus
+  Ronan Lamy
   Alex Gaynor
   Philip Jenvey
-  Ronan Lamy
   Brian Kearns
   Richard Plangger
   Michael Hudson
@@ -55,12 +57,12 @@
   Hakan Ardo
   Benjamin Peterson
   Anders Chrigstrom
+  Wim Lavrijsen
   Eric van Riet Paap
-  Wim Lavrijsen
   Richard Emslie
   Alexander Schremmer
+  Remi Meier
   Dan Villiom Podlaski Christiansen
-  Remi Meier
   Lukas Diekmann
   Sven Hager
   Anders Lehmann
@@ -83,8 +85,8 @@
   Lawrence Oluyede
   Bartosz Skowron
   Daniel Roberts
+  Adrien Di Mascio
   Niko Matsakis
-  Adrien Di Mascio
   Alexander Hesse
   Ludovic Aubry
   Jacob Hallen
@@ -100,8 +102,8 @@
   Michael Foord
   Stephan Diehl
   Stefan Schwarzer
+  Tomek Meka
   Valentino Volonghi
-  Tomek Meka
   Stefano Rivera
   Patrick Maupin
   Devin Jeanpierre
@@ -109,268 +111,273 @@
   Bruno Gola
   David Malcolm
   Jean-Paul Calderone
-  Timo Paulssen
   Edd Barrett
   Squeaky
+  Timo Paulssen
   Marius Gedminas
   Alexandre Fayolle
   Simon Burton
+  Nicolas Truessel
   Martin Matusiak
-  Nicolas Truessel
+  Wenzhu Man
   Konstantin Lopuhin
-  Wenzhu Man
   John Witulski
   Laurence Tratt
+  Greg Price
   Ivan Sichmann Freitas
-  Greg Price
   Dario Bertini
+  Jeremy Thurgood
   Mark Pearse
   Simon Cross
-  Jeremy Thurgood
+  Tobias Pape
   Andreas Stührk
-  Tobias Pape
   Jean-Philippe St. Pierre
   Guido van Rossum
   Pavel Vinogradov
   Paweł Piotr Przeradowski
+  William Leslie
+  marky1991
+  Ilya Osadchiy
+  Tobias Oberstein
   Paul deGrandis
-  Ilya Osadchiy
-  marky1991
-  Tobias Oberstein
+  Boris Feigin
+  Taavi Burns
   Adrian Kuhn
-  Boris Feigin
   tav
-  Taavi Burns
   Georg Brandl
   Bert Freudenberg
   Stian Andreassen
   Wanja Saatkamp
+  Mike Blume
   Gerald Klix
-  Mike Blume
   Oscar Nierstrasz
+  Rami Chowdhury
   Stefan H. Muller
-  Rami Chowdhury
+  Joannah Nanjekye
   Eugene Oden
+  Tim Felgentreff
+  Jeff Terrace
   Henry Mason
   Vasily Kuznetsov
   Preston Timmons
   David Ripton
-  Jeff Terrace
-  Tim Felgentreff
   Dusty Phillips
   Lukas Renggli
   Guenter Jantzen
-  William Leslie
   Ned Batchelder
+  Amit Regmi
   Anton Gulenko
-  Amit Regmi
-  Ben Young
+  Sergey Matyunin
   Jasper Schulz
+  Andrew Chambers
   Nicolas Chauvat
   Andrew Durdin
-  Andrew Chambers
-  Sergey Matyunin
+  Ben Young
   Michael Schneider
   Nicholas Riley
   Jason Chu
   Igor Trindade Oliveira
   Yichao Yu
+  Michael Twomey
   Rocco Moretti
   Gintautas Miliauskas
-  Michael Twomey
   Lucian Branescu Mihaila
   anatoly techtonik
+  Karl Bartel
   Gabriel Lavoie
+  Jared Grubb
   Olivier Dormond
-  Jared Grubb
-  Karl Bartel
   Wouter van Heyst
+  Sebastian Pawluś
   Brian Dorsey
   Victor Stinner
   Andrews Medina
-  Sebastian Pawluś
-  Stuart Williams
-  Daniel Patrick
   Aaron Iles
   Toby Watson
+  Daniel Patrick
+  Stuart Williams
   Antoine Pitrou
   Christian Hudon
+  Justas Sadzevicius
+  Neil Shepperd
   Michael Cheng
-  Justas Sadzevicius
+  Mikael Schönenberg
+  Stanislaw Halik
+  Berkin Ilbeyi
   Gasper Zejn
-  Neil Shepperd
-  Stanislaw Halik
-  Mikael Schönenberg
-  Berkin Ilbeyi
   Faye Zhao
   Elmo Mäntynen
-  Jonathan David Riehl
   Anders Qvist
   Corbin Simpson
   Chirag Jadwani
+  Jonathan David Riehl
   Beatrice During
   Alex Perry
+  p_zieschang at yahoo.de
+  Robert Zaremba
+  Alan McIntyre
+  Alexander Sedov
   Vaibhav Sood
-  Alan McIntyre
   Reuben Cummings
-  Alexander Sedov
-  p_zieschang at yahoo.de
   Attila Gobi
   Christopher Pope
-  Aaron Gallagher
+  Tristan Arthur
+  Christian Tismer 
+  Dan Stromberg
+  Carl Meyer
   Florin Papa
-  Christian Tismer 
-  Marc Abramowitz
-  Dan Stromberg
-  Arjun Naik
   Valentina Mukhamedzhanova
   Stefano Parmesan
   touilleMan
+  Marc Abramowitz
+  Arjun Naik
+  Aaron Gallagher
   Alexis Daboville
-  Jens-Uwe Mager
-  Carl Meyer
+  Pieter Zieschang
   Karl Ramm
-  Pieter Zieschang
-  Gabriel
   Lukas Vacek
-  Kunal Grover
-  Andrew Dalke
+  Omer Katz
+  Jacek Generowicz
   Sylvain Thenault
   Jakub Stasiak
+  Stefan Beyer
+  Andrew Dalke
+  Alejandro J. Cura
+  Vladimir Kryachko
+  Gabriel
+  Mark Williams
+  Kunal Grover
   Nathan Taylor
-  Vladimir Kryachko
-  Omer Katz
-  Mark Williams
-  Jacek Generowicz
-  Alejandro J. Cura
+  Travis Francis Athougies
+  Yasir Suhail
+  Sergey Kishchenko
+  Martin Blais
+  Lutz Paelike
+  Ian Foote
+  Philipp Rustemeuer
+  Catalin Gabriel Manciu
   Jacob Oscarson
-  Travis Francis Athougies
   Ryan Gonzalez
-  Ian Foote
   Kristjan Valur Jonsson
+  Lucio Torre
+  Richard Lancaster
+  Dan Buch
+  Lene Wagner
+  Tomo Cocoa
+  Alecsandru Patrascu
   David Lievens
   Neil Blakey-Milner
-  Lutz Paelike
-  Lucio Torre
+  Henrik Vendelbo
   Lars Wassermann
-  Philipp Rustemeuer
-  Henrik Vendelbo
-  Richard Lancaster
-  Yasir Suhail
-  Dan Buch
+  Ignas Mikalajunas
+  Christoph Gerum
   Miguel de Val Borro
   Artur Lisiecki
-  Sergey Kishchenko
-  Ignas Mikalajunas
-  Alecsandru Patrascu
-  Christoph Gerum
-  Martin Blais
-  Lene Wagner
-  Catalin Gabriel Manciu
-  Tomo Cocoa
-  Kim Jin Su
-  rafalgalczynski at gmail.com
   Toni Mattis
-  Amber Brown
+  Laurens Van Houtven
+  Bobby Impollonia
+  Roberto De Ioris
+  Jeong YunWon
+  Christopher Armstrong
+  Aaron Tubbs
+  Vasantha Ganesh K
+  Jason Michalski
+  Markus Holtermann
+  Andrew Thompson
+  Yusei Tahara
+  Ruochen Huang
+  Fabio Niephaus
+  Akira Li
+  Gustavo Niemeyer
+  Rafał Gałczyński
+  Logan Chien
   Lucas Stadler
-  Julian Berman
-  Markus Holtermann
   roberto at goyle
+  Matt Bogosian
   Yury V. Zaytsev
-  Anna Katrina Dominguez
-  Bobby Impollonia
-  Vasantha Ganesh K
-  Andrew Thompson
   florinpapa
-  Yusei Tahara
-  Aaron Tubbs
-  Ben Darnell
-  Roberto De Ioris
-  Logan Chien
-  Juan Francisco Cantero Hurtado
-  Ruochen Huang
-  Jeong YunWon
-  Godefroid Chappelle
-  Joshua Gilbert
-  Dan Colish
-  Christopher Armstrong
-  Michael Hudson-Doyle
   Anders Sigfridsson
   Nikolay Zinov
-  Jason Michalski
+  rafalgalczynski at gmail.com
+  Joshua Gilbert
+  Anna Katrina Dominguez
+  Kim Jin Su
+  Amber Brown
+  Ben Darnell
+  Juan Francisco Cantero Hurtado
+  Godefroid Chappelle
+  Julian Berman
+  Michael Hudson-Doyle
   Floris Bruynooghe
-  Laurens Van Houtven
-  Akira Li
-  Gustavo Niemeyer
   Stephan Busemann
-  Rafał Gałczyński
-  Matt Bogosian
+  Dan Colish
   timo
-  Christian Muirhead
-  Berker Peksag
-  James Lan
   Volodymyr Vladymyrov
-  shoma hosaka
-  Ben Mather
-  Niclas Olofsson
-  Matthew Miller
-  Rodrigo Araújo
+  Daniel Neuhäuser
+  Flavio Percoco
   halgari
-  Boglarka Vezer
-  Chris Pressey
-  Buck Golemon
-  Diana Popa
-  Konrad Delong
-  Dinu Gherman
+  Jim Baker
   Chris Lambacher
   coolbutuseless at gmail.com
+  Mike Bayer
+  Rodrigo Araújo
   Daniil Yarancev
-  Jim Baker
+  OlivierBlanvillain
+  Jonas Pfannschmidt
+  Zearin
+  Andrey Churin
   Dan Crosta
-  Nikolaos-Digenis Karagiannis
-  James Robert
-  Armin Ronacher
-  Brett Cannon
-  Donald Stufft
-  yrttyr
-  aliceinwire
-  OlivierBlanvillain
-  Dan Sanders
-  Zooko Wilcox-O Hearn
+  reubano at gmail.com
+  Julien Phalip
+  Roman Podoliaka
+  Eli Stevens
+  Boglarka Vezer
+  PavloKapyshin
   Tomer Chachamu
   Christopher Groskopf
   Asmo Soinio
-  jiaaro
-  Mads Kiilerich
   Antony Lee
-  Jason Madden
-  Daniel Neuh�user
-  reubano at gmail.com
-  Yaroslav Fedevych
   Jim Hunziker
-  Markus Unterwaditzer
-  Even Wiik Thomassen
-  jbs
-  squeaky
-  soareschen
-  Jonas Pfannschmidt
-  Kurt Griffiths
-  Mike Bayer
-  Stefan Marr
-  Flavio Percoco
-  Kristoffer Kleine
+  shoma hosaka
+  Buck Golemon
+  JohnDoe
+  yrttyr
   Michael Chermside
   Anna Ravencroft
+  remarkablerocket
+  Berker Peksag
+  Christian Muirhead
+  soareschen
+  Matthew Miller
+  Konrad Delong
+  Dinu Gherman
   pizi
-  remarkablerocket
-  Andrey Churin
-  Zearin
-  Eli Stevens
-  Tobias Diaz
-  Julien Phalip
-  Roman Podoliaka
+  James Robert
+  Armin Ronacher
+  Diana Popa
+  Mads Kiilerich
+  Brett Cannon
+  aliceinwire
+  Zooko Wilcox-O Hearn
+  James Lan
+  jiaaro
+  Markus Unterwaditzer
+  Kristoffer Kleine
+  Graham Markall
   Dan Loewenherz
   werat
+  Niclas Olofsson
+  Chris Pressey
+  Tobias Diaz
+  Nikolaos-Digenis Karagiannis
+  Kurt Griffiths
+  Ben Mather
+  Donald Stufft
+  Dan Sanders
+  Jason Madden
+  Yaroslav Fedevych
+  Even Wiik Thomassen
+  Stefan Marr
 
   Heinrich-Heine University, Germany 
   Open End AB (formerly AB Strakt), Sweden
diff --git a/lib_pypy/cffi/cparser.py b/lib_pypy/cffi/cparser.py
--- a/lib_pypy/cffi/cparser.py
+++ b/lib_pypy/cffi/cparser.py
@@ -803,6 +803,16 @@
                            "the actual array length in this context"
                            % exprnode.coord.line)
         #
+        if (isinstance(exprnode, pycparser.c_ast.BinaryOp) and
+                exprnode.op == '+'):
+            return (self._parse_constant(exprnode.left) +
+                    self._parse_constant(exprnode.right))
+        #
+        if (isinstance(exprnode, pycparser.c_ast.BinaryOp) and
+                exprnode.op == '-'):
+            return (self._parse_constant(exprnode.left) -
+                    self._parse_constant(exprnode.right))
+        #
         raise FFIError(":%d: unsupported expression: expected a "
                        "simple numeric constant" % exprnode.coord.line)
 
diff --git a/pypy/doc/config/translation.gcrootfinder.txt b/pypy/doc/config/translation.gcrootfinder.txt
--- a/pypy/doc/config/translation.gcrootfinder.txt
+++ b/pypy/doc/config/translation.gcrootfinder.txt
@@ -9,10 +9,8 @@
 - ``--gcrootfinder=asmgcc``: use assembler hackery to find the
   roots directly from the normal stack.  This is a bit faster,
   but platform specific.  It works so far with GCC or MSVC,
-  on i386 and x86-64.  It is tested only on Linux (where it is
-  the default) so other platforms (as well as MSVC) may need
-  various fixes before they can be used.
+  on i386 and x86-64.  It is tested only on Linux 
+  so other platforms (as well as MSVC) may need
+  various fixes before they can be used. Note asmgcc will be deprecated
+  at some future date, and does not work with clang.
 
-You may have to force the use of the shadowstack root finder if
-you are running into troubles or if you insist on translating
-PyPy with other compilers like clang.
diff --git a/pypy/doc/contributor.rst b/pypy/doc/contributor.rst
--- a/pypy/doc/contributor.rst
+++ b/pypy/doc/contributor.rst
@@ -11,9 +11,9 @@
   Antonio Cuni
   Samuele Pedroni
   Matti Picus
+  Ronan Lamy
   Alex Gaynor
   Philip Jenvey
-  Ronan Lamy
   Brian Kearns
   Richard Plangger
   Michael Hudson
@@ -24,12 +24,12 @@
   Hakan Ardo
   Benjamin Peterson
   Anders Chrigstrom
+  Wim Lavrijsen
   Eric van Riet Paap
-  Wim Lavrijsen
   Richard Emslie
   Alexander Schremmer
+  Remi Meier
   Dan Villiom Podlaski Christiansen
-  Remi Meier
   Lukas Diekmann
   Sven Hager
   Anders Lehmann
@@ -52,8 +52,8 @@
   Lawrence Oluyede
   Bartosz Skowron
   Daniel Roberts
+  Adrien Di Mascio
   Niko Matsakis
-  Adrien Di Mascio
   Alexander Hesse
   Ludovic Aubry
   Jacob Hallen
@@ -69,8 +69,8 @@
   Michael Foord
   Stephan Diehl
   Stefan Schwarzer
+  Tomek Meka
   Valentino Volonghi
-  Tomek Meka
   Stefano Rivera
   Patrick Maupin
   Devin Jeanpierre
@@ -78,267 +78,270 @@
   Bruno Gola
   David Malcolm
   Jean-Paul Calderone
-  Timo Paulssen
   Edd Barrett
   Squeaky
+  Timo Paulssen
   Marius Gedminas
   Alexandre Fayolle
   Simon Burton
+  Nicolas Truessel
   Martin Matusiak
-  Nicolas Truessel
+  Wenzhu Man
   Konstantin Lopuhin
-  Wenzhu Man
   John Witulski
   Laurence Tratt
+  Greg Price
   Ivan Sichmann Freitas
-  Greg Price
   Dario Bertini
+  Jeremy Thurgood
   Mark Pearse
   Simon Cross
-  Jeremy Thurgood
+  Tobias Pape
   Andreas Stührk
-  Tobias Pape
   Jean-Philippe St. Pierre
   Guido van Rossum
   Pavel Vinogradov
   Paweł Piotr Przeradowski
+  William Leslie
+  marky1991
+  Ilya Osadchiy
+  Tobias Oberstein
   Paul deGrandis
-  Ilya Osadchiy
-  marky1991
-  Tobias Oberstein
+  Boris Feigin
+  Taavi Burns
   Adrian Kuhn
-  Boris Feigin
   tav
-  Taavi Burns
   Georg Brandl
   Bert Freudenberg
   Stian Andreassen
   Wanja Saatkamp
+  Mike Blume
   Gerald Klix
-  Mike Blume
   Oscar Nierstrasz
+  Rami Chowdhury
   Stefan H. Muller
-  Rami Chowdhury
+  Joannah Nanjekye
   Eugene Oden
+  Tim Felgentreff
+  Jeff Terrace
   Henry Mason
   Vasily Kuznetsov
   Preston Timmons
   David Ripton
-  Jeff Terrace
-  Tim Felgentreff
   Dusty Phillips
   Lukas Renggli
   Guenter Jantzen
-  William Leslie
   Ned Batchelder
+  Amit Regmi
   Anton Gulenko
-  Amit Regmi
-  Ben Young
+  Sergey Matyunin
   Jasper Schulz
+  Andrew Chambers
   Nicolas Chauvat
   Andrew Durdin
-  Andrew Chambers
-  Sergey Matyunin
+  Ben Young
   Michael Schneider
   Nicholas Riley
   Jason Chu
   Igor Trindade Oliveira
   Yichao Yu
+  Michael Twomey
   Rocco Moretti
   Gintautas Miliauskas
-  Michael Twomey
   Lucian Branescu Mihaila
   anatoly techtonik
+  Karl Bartel
   Gabriel Lavoie
+  Jared Grubb
   Olivier Dormond
-  Jared Grubb
-  Karl Bartel
   Wouter van Heyst
+  Sebastian Pawluś
   Brian Dorsey
   Victor Stinner
   Andrews Medina
-  Sebastian Pawluś
-  Stuart Williams
-  Daniel Patrick
   Aaron Iles
   Toby Watson
+  Daniel Patrick
+  Stuart Williams
   Antoine Pitrou
   Christian Hudon
+  Justas Sadzevicius
+  Neil Shepperd
   Michael Cheng
-  Justas Sadzevicius
+  Mikael Schönenberg
+  Stanislaw Halik
+  Berkin Ilbeyi
   Gasper Zejn
-  Neil Shepperd
-  Stanislaw Halik
-  Mikael Schönenberg
-  Berkin Ilbeyi
   Faye Zhao
   Elmo Mäntynen
-  Jonathan David Riehl
   Anders Qvist
   Corbin Simpson
   Chirag Jadwani
+  Jonathan David Riehl
   Beatrice During
   Alex Perry
+  p_zieschang at yahoo.de
+  Robert Zaremba
+  Alan McIntyre
+  Alexander Sedov
   Vaibhav Sood
-  Alan McIntyre
   Reuben Cummings
-  Alexander Sedov
-  p_zieschang at yahoo.de
   Attila Gobi
   Christopher Pope
-  Aaron Gallagher
+  Tristan Arthur
+  Christian Tismer 
+  Dan Stromberg
+  Carl Meyer
   Florin Papa
-  Christian Tismer 
-  Marc Abramowitz
-  Dan Stromberg
-  Arjun Naik
   Valentina Mukhamedzhanova
   Stefano Parmesan
   touilleMan
+  Marc Abramowitz
+  Arjun Naik
+  Aaron Gallagher
   Alexis Daboville
-  Jens-Uwe Mager
-  Carl Meyer
+  Pieter Zieschang
   Karl Ramm
-  Pieter Zieschang
-  Gabriel
   Lukas Vacek
-  Kunal Grover
-  Andrew Dalke
+  Omer Katz
+  Jacek Generowicz
   Sylvain Thenault
   Jakub Stasiak
+  Stefan Beyer
+  Andrew Dalke
+  Alejandro J. Cura
+  Vladimir Kryachko
+  Gabriel
+  Mark Williams
+  Kunal Grover
   Nathan Taylor
-  Vladimir Kryachko
-  Omer Katz
-  Mark Williams
-  Jacek Generowicz
-  Alejandro J. Cura
+  Travis Francis Athougies
+  Yasir Suhail
+  Sergey Kishchenko
+  Martin Blais
+  Lutz Paelike
+  Ian Foote
+  Philipp Rustemeuer
+  Catalin Gabriel Manciu
   Jacob Oscarson
-  Travis Francis Athougies
   Ryan Gonzalez
-  Ian Foote
   Kristjan Valur Jonsson
+  Lucio Torre
+  Richard Lancaster
+  Dan Buch
+  Lene Wagner
+  Tomo Cocoa
+  Alecsandru Patrascu
   David Lievens
   Neil Blakey-Milner
-  Lutz Paelike
-  Lucio Torre
+  Henrik Vendelbo
   Lars Wassermann
-  Philipp Rustemeuer
-  Henrik Vendelbo
-  Richard Lancaster
-  Yasir Suhail
-  Dan Buch
+  Ignas Mikalajunas
+  Christoph Gerum
   Miguel de Val Borro
   Artur Lisiecki
-  Sergey Kishchenko
-  Ignas Mikalajunas
-  Alecsandru Patrascu
-  Christoph Gerum
-  Martin Blais
-  Lene Wagner
-  Catalin Gabriel Manciu
-  Tomo Cocoa
-  Kim Jin Su
-  rafalgalczynski at gmail.com
   Toni Mattis
-  Amber Brown
+  Laurens Van Houtven
+  Bobby Impollonia
+  Roberto De Ioris
+  Jeong YunWon
+  Christopher Armstrong
+  Aaron Tubbs
+  Vasantha Ganesh K
+  Jason Michalski
+  Markus Holtermann
+  Andrew Thompson
+  Yusei Tahara
+  Ruochen Huang
+  Fabio Niephaus
+  Akira Li
+  Gustavo Niemeyer
+  Rafał Gałczyński
+  Logan Chien
   Lucas Stadler
-  Julian Berman
-  Markus Holtermann
   roberto at goyle
+  Matt Bogosian
   Yury V. Zaytsev
-  Anna Katrina Dominguez
-  Bobby Impollonia
-  Vasantha Ganesh K
-  Andrew Thompson
   florinpapa
-  Yusei Tahara
-  Aaron Tubbs
-  Ben Darnell
-  Roberto De Ioris
-  Logan Chien
-  Juan Francisco Cantero Hurtado
-  Ruochen Huang
-  Jeong YunWon
-  Godefroid Chappelle
-  Joshua Gilbert
-  Dan Colish
-  Christopher Armstrong
-  Michael Hudson-Doyle
   Anders Sigfridsson
   Nikolay Zinov
-  Jason Michalski
+  rafalgalczynski at gmail.com
+  Joshua Gilbert
+  Anna Katrina Dominguez
+  Kim Jin Su
+  Amber Brown
+  Ben Darnell
+  Juan Francisco Cantero Hurtado
+  Godefroid Chappelle
+  Julian Berman
+  Michael Hudson-Doyle
   Floris Bruynooghe
-  Laurens Van Houtven
-  Akira Li
-  Gustavo Niemeyer
   Stephan Busemann
-  Rafał Gałczyński
-  Matt Bogosian
+  Dan Colish
   timo
-  Christian Muirhead
-  Berker Peksag
-  James Lan
   Volodymyr Vladymyrov
-  shoma hosaka
-  Ben Mather
-  Niclas Olofsson
-  Matthew Miller
-  Rodrigo Araújo
+  Daniel Neuhäuser
+  Flavio Percoco
   halgari
-  Boglarka Vezer
-  Chris Pressey
-  Buck Golemon
-  Diana Popa
-  Konrad Delong
-  Dinu Gherman
+  Jim Baker
   Chris Lambacher
   coolbutuseless at gmail.com
+  Mike Bayer
+  Rodrigo Araújo
   Daniil Yarancev
-  Jim Baker
+  OlivierBlanvillain
+  Jonas Pfannschmidt
+  Zearin
+  Andrey Churin
   Dan Crosta
-  Nikolaos-Digenis Karagiannis
-  James Robert
-  Armin Ronacher
-  Brett Cannon
-  Donald Stufft
-  yrttyr
-  aliceinwire
-  OlivierBlanvillain
-  Dan Sanders
-  Zooko Wilcox-O Hearn
+  reubano at gmail.com
+  Julien Phalip
+  Roman Podoliaka
+  Eli Stevens
+  Boglarka Vezer
+  PavloKapyshin
   Tomer Chachamu
   Christopher Groskopf
   Asmo Soinio
-  jiaaro
-  Mads Kiilerich
   Antony Lee
-  Jason Madden
-  Daniel Neuhäuser
-  reubano at gmail.com
-  Yaroslav Fedevych
   Jim Hunziker
-  Markus Unterwaditzer
-  Even Wiik Thomassen
-  jbs
-  squeaky
-  soareschen
-  Jonas Pfannschmidt
-  Kurt Griffiths
-  Mike Bayer
-  Stefan Marr
-  Flavio Percoco
-  Kristoffer Kleine
+  shoma hosaka
+  Buck Golemon
+  JohnDoe
+  yrttyr
   Michael Chermside
   Anna Ravencroft
+  remarkablerocket
+  Berker Peksag
+  Christian Muirhead
+  soareschen
+  Matthew Miller
+  Konrad Delong
+  Dinu Gherman
   pizi
-  remarkablerocket
-  Andrey Churin
-  Zearin
-  Eli Stevens
-  Tobias Diaz
-  Julien Phalip
-  Roman Podoliaka
+  James Robert
+  Armin Ronacher
+  Diana Popa
+  Mads Kiilerich
+  Brett Cannon
+  aliceinwire
+  Zooko Wilcox-O Hearn
+  James Lan
+  jiaaro
+  Markus Unterwaditzer
+  Kristoffer Kleine
+  Graham Markall
   Dan Loewenherz
   werat
-
-
+  Niclas Olofsson
+  Chris Pressey
+  Tobias Diaz
+  Nikolaos-Digenis Karagiannis
+  Kurt Griffiths
+  Ben Mather
+  Donald Stufft
+  Dan Sanders
+  Jason Madden
+  Yaroslav Fedevych
+  Even Wiik Thomassen
+  Stefan Marr
diff --git a/pypy/doc/index-of-release-notes.rst b/pypy/doc/index-of-release-notes.rst
--- a/pypy/doc/index-of-release-notes.rst
+++ b/pypy/doc/index-of-release-notes.rst
@@ -6,6 +6,7 @@
 
 .. toctree::
 
+   release-v5.7.0.rst
    release-pypy2.7-v5.6.0.rst
    release-pypy2.7-v5.4.1.rst
    release-pypy2.7-v5.4.0.rst
@@ -53,6 +54,12 @@
    release-0.7.0.rst
    release-0.6
 
+CPython 3.5 compatible versions
+-------------------------------
+
+.. toctree::
+
+   release-v5.7.0.rst
 
 CPython 3.3 compatible versions
 -------------------------------
diff --git a/pypy/doc/index-of-whatsnew.rst b/pypy/doc/index-of-whatsnew.rst
--- a/pypy/doc/index-of-whatsnew.rst
+++ b/pypy/doc/index-of-whatsnew.rst
@@ -7,6 +7,7 @@
 .. toctree::
 
    whatsnew-head.rst
+   whatsnew-pypy2-5.7.0.rst
    whatsnew-pypy2-5.6.0.rst
    whatsnew-pypy2-5.4.0.rst
    whatsnew-pypy2-5.3.1.rst
diff --git a/pypy/doc/release-v5.7.0.rst b/pypy/doc/release-v5.7.0.rst
new file mode 100644
--- /dev/null
+++ b/pypy/doc/release-v5.7.0.rst
@@ -0,0 +1,190 @@
+=============================================
+PyPy2.7 and PyPy3.5 v5.7 - two in one release
+=============================================
+
+We have released PyPy2.7 and a beta-quality PyPy3.5 v5.7.
+This new PyPy2.7 release includes the upstream stdlib version 2.7.13, and
+PyPy 3.5 (our first in the 3.5 series) includes the upstream stdlib version
+3.5.3.
+
+We continue to make incremental improvements to our C-API
+compatibility layer (cpyext). PyPy2 can now import and run many c-extension
+packages, among the most notable are numpy, cython, and pandas. Performance may
+be slower than CPython, especially for frequently-called short C functions.
+Please let us know if your use case is slow, we have ideas how to make things
+faster but need real-world examples (not micro-benchmarks) of problematic code.
+
+Work proceeds at a good pace on the PyPy3.5
+version due to a grant_ from the Mozilla Foundation, hence our first 3.5.3 beta
+release. Thanks Mozilla !!! While we do not pass all tests, asyncio works and
+as `these benchmarks show`_ it already gives a nice speed bump.
+We also backported the ``f""`` formatting from 3.6 (as an expection; otherwise
+"PyPy3.5" supports the Python 3.5 language).
+
+CFFI_ has been updated to 1.10, improving an already great package for
+interfacing with C.
+
+We now use shadowstack as our default gcrootfinder_ even on Linux. The
+alternative, asmgcc, will be deprecated at some future point. While about 3%
+slower, shadowstack is much more easily maintained and debuggable. Also,
+the performance of shadowstack has been improved in general: this should
+close the speed gap between Linux and other platforms.
+
+As always, this release fixed many issues and bugs raised by the
+growing community of PyPy users. We strongly recommend updating.
+
+You can download the v5.7 release here:
+
+    http://pypy.org/download.html
+
+We would like to thank our donors for the continued support of the PyPy
+project.
+
+We would also like to thank our contributors and
+encourage new people to join the project. PyPy has many
+layers and we need help with all of them: `PyPy`_ and `RPython`_ documentation
+improvements, tweaking popular `modules`_ to run on pypy, or general `help`_
+with making RPython's JIT even better.
+
+.. _CFFI: https://cffi.readthedocs.io/en/latest/whatsnew.html
+.. _grant: https://morepypy.blogspot.com/2016/08/pypy-gets-funding-from-mozilla-for.html
+.. _`PyPy`: index.html
+.. _`RPython`: https://rpython.readthedocs.org
+.. _`modules`: project-ideas.html#make-more-python-modules-pypy-friendly
+.. _`help`: project-ideas.html
+.. _`these benchmarks show`: https://morepypy.blogspot.com/2017/03/async-http-benchmarks-on-pypy3.html
+.. _gcrootfinder: config/translation.gcrootfinder.html
+
+What is PyPy?
+=============
+
+PyPy is a very compliant Python interpreter, almost a drop-in replacement for
+CPython 2.7 and CPython 3.5. It's fast (`PyPy and CPython 2.7.x`_ performance comparison)
+due to its integrated tracing JIT compiler.
+
+We also welcome developers of other `dynamic languages`_ to see what RPython
+can do for them.
+
+This release supports: 
+
+  * **x86** machines on most common operating systems
+    (Linux 32/64 bits, Mac OS X 64 bits, Windows 32 bits, OpenBSD, FreeBSD)
+  
+  * newer **ARM** hardware (ARMv6 or ARMv7, with VFPv3) running Linux,
+  
+  * big- and little-endian variants of **PPC64** running Linux,
+
+  * **s390x** running Linux
+
+.. _`PyPy and CPython 2.7.x`: http://speed.pypy.org
+.. _`dynamic languages`: http://rpython.readthedocs.io/en/latest/examples.html
+
+Highlights of the PyPy2.7, cpyext, and RPython changes (since 5.6 released Nov, 2016)
+=============================================================================================
+
+See also issues that were resolved_
+
+* New features and cleanups
+
+  * update the format of the PYPYLOG file and improvements to vmprof
+  * improve the consistency of RPython annotation unions
+  * emit more sysconfig values for downstream cextension packages
+  * add PyAnySet_Check, PyModule_GetName, PyWeakref_Check*,
+    _PyImport_{Acquire,Release}Lock, PyGen_Check*, PyOS_AfterFork,
+  * add translation option --keepgoing to continue after the first AnnotationError
+  * detect and raise on recreation of a PyPy object from a PyObject during
+    tp_dealloc
+  * refactor and clean up poor handling of unicode exposed in work on py3.5
+  * builtin cppyy_ supports C++ 11, 14, etc. via cling (reflex has been removed)
+  * add translation time --disable_entrypoints option for embedding PyPy together
+    with another RPython VM
+  * adapt ``weakref`` according to Python issue #19542, will be in CPython 2.7.14
+  * support translations with cpyext and the Boehm GC (for special cases like
+    revdb
+  * implement ``StringBuffer.get_raw_address`` for the buffer protocol, it is
+    now possible to obtain the address of any readonly object without pinning it
+  * refactor the initialization code in translating cpyext
+  * fix ``"".replace("", "x", num)`` to give the same result as CPython
+  * use a cffi-style C parser to create rffi objects in cpyext, now the
+    translating python must have cffi available
+  * add a rpython implementation of siphash24, allow choosing hash algorithm
+    randomizing the seed
+  * make ``attach_gdb`` work on Windows (with Visual Studio Debugger)
+  * implement ``move_to_end(last=True/False)`` on RPython ordered dicts, make
+    available as ``__pypy__.move_to_end`` and, on py3.5,
+    ``OrderedDict.move_to_end()``
+  * remove completely RPython ``space.wrap`` in a major cleanup, differentiate
+    between ``space.newtext`` and ``space.newbytes`` on py3.5
+  * improve shadowstack to where it is now the default in place of asmgcc
+
+* Bug Fixes
+
+  * any uncaught RPython exception in the interpreter is turned into a
+    SystemError (rather than a segfault)
+  * create log files without the executable bit
+  * disable clock_gettime() on OS/X, since we support 10.11 and it was only
+    added in 10.12
+  * support HAVE_FSTATVFS which was unintentionally always false
+  * fix user-created C-API heaptype, issue #2434
+  * fix PyDict_Update is not actually the same as dict.update
+  * assign tp_doc on PyTypeObject and tie it to the app-level __doc__ attribute
+    issue #2446
+  * clean up memory leaks around ``PyObject_GetBuffer``, ``PyMemoryView_GET_BUFFER``,
+    ``PyMemoryView_FromBuffer``, and ``PyBuffer_Release``
+  * improve support for creating c-extension objects from app-level classes,
+    filling more slots especially ``tp_new`` and ``tp_dealloc``
+  * add rstack.stack_almost_full() and use it to avoid stack overflow due to
+    the JIT where possible
+  * fix for ctypes.c_bool returning bool restype issue #2475
+  * fix in corner cases with the GIL and C-API functions
+
+* Performance improvements:
+
+  * clean-ups in the jit optimizeopt
+  * optimize ``if x is not None: return x`` or ``if x != 0: return x``
+  * add ``jit.conditional_call_elidable()``, a way to tell the JIT 
+    "conditonally call this function" returning a result
+  * try harder to propagate ``can_be_None=False`` information
+  * add ``rarithmetic.ovfcheck_int32_add/sub/mul``
+  * add and use ``rgc.may_ignore_finalizer()``: an optimization hint that makes
+    the GC stop tracking the object
+  * replace malloc+memset with a single calloc, useful for large allocations?
+  * linux: try to implement os.urandom() as the syscall getrandom() if available
+  * propagate ``debug.ll_assert_not_none()`` through the JIT to reduce number of
+    guards
+  * improve the performance of ``PyDict_Next``
+  * improve ``dict.pop()``
+  * improve the optimization of branchy Python code by retaining more
+    information across failing guards
+  * add optimized "zero-copy" path for ``io.FileIO.readinto``
+
+Highlights of the PyPy3.5 release (since 5.5 alpha released Oct, 2016)
+=========================================================
+
+Development moved from the py3k branch to the py3.5 branch in the pypy bitbucket repo
+
+* New features
+
+  * this first PyPy3.5 release implements much, but not all, of Python 3.5.3
+  * PEP 456 allowing secure and interchangable hash algorithms
+  * use cryptography_'s cffi backend for SSL
+
+* Bug Fixes
+
+  * implement fixes for some CPython issues that arose since the last release 
+  * solve deadlocks in thread locking mechanism
+
+* Performance improvements:
+
+  * do not create a list whenever descr_new of a bytesobject is called
+  * 
+  * 
+  * 
+
+.. _resolved: whatsnew-pypy2-5.7.0.html
+.. _cryptography: https://cryptography.io
+.. _cppyy: cppyy.html
+
+Please update, and continue to help us make PyPy better.
+
+Cheers
diff --git a/pypy/doc/tool/makecontributor.py b/pypy/doc/tool/makecontributor.py
--- a/pypy/doc/tool/makecontributor.py
+++ b/pypy/doc/tool/makecontributor.py
@@ -75,9 +75,10 @@
     'Spenser Bauman':['Spenser Andrew Bauman'],
     'Raffael Tfirst':['raffael.tfirst at gmail.com'],
     'timo':['timo at eistee.fritz.box'],
-    'Jasper Schulz':['Jasper.Schulz'],
+    'Jasper Schulz':['Jasper.Schulz', 'jbs'],
     'Aaron Gallagher':['"Aaron Gallagher'],
     'Yasir Suhail':['yasirs'],
+    'Squeaky', ['squeaky'],
     }
 
 alias_map = {}
diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst
--- a/pypy/doc/whatsnew-head.rst
+++ b/pypy/doc/whatsnew-head.rst
@@ -1,191 +1,8 @@
 ==========================
-What's new in PyPy2.7 5.6+
+What's new in PyPy2.7 5.8+
 ==========================
 
-.. this is a revision shortly after release-pypy2.7-v5.6
-.. startrev: 7e9787939641
+.. this is a revision shortly after release-pypy2.7-v5.7
+.. startrev: 44f31f6dd39f
 
 
-Since a while now, PyPy preserves the order of dictionaries and sets.
-However, the set literal syntax ``{x, y, z}`` would by mistake build a
-set with the opposite order: ``set([z, y, x])``.  This has been fixed.
-Note that CPython is inconsistent too: in 2.7.12, ``{5, 5.0}`` would be
-``set([5.0])``, but in 2.7.trunk it is ``set([5])``.  PyPy's behavior
-changed in exactly the same way because of this fix.
-
-
-.. branch: rpython-error-to-systemerror
-
-Any uncaught RPython exception (from a PyPy bug) is turned into an
-app-level SystemError.  This should improve the lot of users hitting an
-uncaught RPython error.
-
-.. branch: union-side-effects-2
-
-Try to improve the consistency of RPython annotation unions.
-
-.. branch: pytest-2.9.2
-
-.. branch: clean-exported-state
-
-Clean-ups in the jit optimizeopt
-
-.. branch: conditional_call_value_4
-
-Add jit.conditional_call_elidable(), a way to tell the JIT "conditonally
-call this function" returning a result.
-
-.. branch: desc-specialize
-
-Refactor FunctionDesc.specialize() and related code (RPython annotator).
-
-.. branch: raw-calloc
-
-.. branch: issue2446
-
-Assign ``tp_doc`` to the new TypeObject's type dictionary ``__doc__`` key
-so it will be picked up by app-level objects of that type
-
-.. branch: cling-support
-
-Module cppyy now uses cling as its backend (Reflex has been removed). The
-user-facing interface and main developer tools (genreflex, selection files,
-class loader, etc.) remain the same.  A libcppyy_backend.so library is still
-needed but is now available through PyPI with pip: PyPy-cppyy-backend.
-
-The Cling-backend brings support for modern C++ (11, 14, etc.), dynamic
-template instantations, and improved integration with CFFI for better
-performance.  It also provides interactive C++ (and bindings to that).
-
-.. branch: better-PyDict_Next
-
-Improve the performance of ``PyDict_Next``. When trying ``PyDict_Next`` on a
-typedef dict, the test exposed a problem converting a ``GetSetProperty`` to a
-``PyGetSetDescrObject``. The other direction seem to be fully implemented.
-This branch made a minimal effort to convert the basic fields to avoid
-segfaults, but trying to use the ``PyGetSetDescrObject`` will probably fail.
-
-.. branch: stdlib-2.7.13
-
-Updated the implementation to match CPython 2.7.13 instead of 2.7.13.
-
-.. branch: issue2444
-
-Fix ``PyObject_GetBuffer`` and ``PyMemoryView_GET_BUFFER``, which leaked
-memory and held references. Add a finalizer to CPyBuffer, add a
-PyMemoryViewObject with a PyBuffer attached so that the call to 
-``PyMemoryView_GET_BUFFER`` does not leak a PyBuffer-sized piece of memory.
-Properly call ``bf_releasebuffer`` when not ``NULL``.
-
-.. branch: boehm-rawrefcount
-
-Support translations of cpyext with the Boehm GC (for special cases like
-revdb).
-
-.. branch: strbuf-as-buffer
-
-Implement StringBuffer.get_raw_address (missing feature for the buffer protocol).
-More generally it is now possible to obtain the address of any object (if it
-is readonly) without pinning it.
-
-.. branch: cpyext-cleanup
-.. branch: api_func-refactor
-
-Refactor cpyext initialisation.
-
-.. branch: cpyext-from2
-
-Fix a test failure introduced by strbuf-as-buffer
-
-.. branch: cpyext-FromBuffer
-
-Do not recreate the object in PyMemoryView_FromBuffer, rather pass it to
-the returned PyMemoryViewObject, to take ownership of it. Fixes a ref leak.
-
-.. branch: issue2464
-
-Give (almost?) all GetSetProperties a valid __objclass__.
-
-.. branch: TreeStain/fixed-typo-line-29-mostly-to-most-1484469416419
-.. branch: TreeStain/main-lines-changed-in-l77-l83-made-para-1484471558033
-
-.. branch: missing-tp_new
-
-Improve mixing app-level classes in c-extensions, especially if the app-level
-class has a ``tp_new`` or ``tp_dealloc``. The issue is that c-extensions expect
-all the method slots to be filled with a function pointer, where app-level will
-search up the mro for an appropriate function at runtime. With this branch we
-now fill many more slots in the c-extenion type objects.
-Also fix for c-extension type that calls ``tp_hash`` during initialization
-(str, unicode types), and fix instantiating c-extension types from built-in
-classes by enforcing an order of instaniation.
-
-.. branch: rffi-parser-2
-
-rffi structures in cpyext can now be created by parsing simple C headers.
-Additionally, the cts object that holds the parsed information can act like
-cffi's ffi objects, with the methods cts.cast() and cts.gettype().
-
-.. branch: rpython-hash
-
-Don't freeze hashes in the translated pypy.  In practice, that means
-that we can now translate PyPy with the option --hash=siphash24 and get
-the same hashes as CPython 3.5, which can be randomized (in a
-crypographically good way).  It is the default in PyPy3.  The default of
-PyPy2 remains unchanged: there are user programs out there that depend
-on constant hashes (or even sometimes on specific hash results).
-
-.. branch: dict-move-to-end
-
-Our dicts, which are always ordered, now have an extra "method" for
-Python 3.x which moves an item to first or last position.  In PyPy 3.5
-it is the standard ``OrderedDict.move_to_end()`` method, but the
-behavior is also available on Python 2.x or for the ``dict`` type by
-calling ``__pypy__.move_to_end(dict, key, last=True)``.
-
-
-.. branch optinfo-into-bridges-3
-
-Improve the optimization of branchy Python code by retaining more information
-across failing guards.
-
-
-.. branch: space-newtext
-
-Internal refactoring of ``space.wrap()``, which is now replaced with
-explicitly-typed methods.  Notably, there are now ``space.newbytes()``
-and ``space.newtext()``: these two methods are identical on PyPy 2.7 but
-not on PyPy 3.x.  The latter is used to get an app-level unicode string
-by decoding the RPython string, assumed to be utf-8.
-
-.. branch: space-wrap
-
-.. branch: fix_bool_restype
-
-Fix for ``ctypes.c_bool``-returning ctypes functions
-
-.. branch: fix-cpyext-releasebuffer
-
-Improve handling of the Py3-style buffer slots in cpyext: fix memoryviews
-keeping objects alive forever (missing decref), and make sure that
-bf_releasebuffer is called when it should, e.g. from PyBuffer_Release.
-
-.. branch: fix-global
-
-Fix bug (bad reported info) when asked to translate SyntaxWarning to
-SyntaxError.
-
-.. branch: optinfo-into-bridges-3
-
-Improve the optimization of branchy Python code by retaining more
-information across failing guards. This is done by appending some
-carefully encoded extra information into the resume code.
-
-.. branch: shadowstack-perf-2
-
-Two changes that together bring the performance of shadowstack close to
-asmgcc---close enough that we can now make shadowstack the default even
-on Linux.  This should remove a whole class of rare bugs introduced by
-asmgcc.
-
-.. branch: fniephaus/fix-typo-1488123166752
diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-pypy2-5.7.0.rst
copy from pypy/doc/whatsnew-head.rst
copy to pypy/doc/whatsnew-pypy2-5.7.0.rst
--- a/pypy/doc/whatsnew-head.rst
+++ b/pypy/doc/whatsnew-pypy2-5.7.0.rst
@@ -1,6 +1,6 @@
-==========================
-What's new in PyPy2.7 5.6+
-==========================
+=========================
+What's new in PyPy2.7 5.7
+=========================
 
 .. this is a revision shortly after release-pypy2.7-v5.6
 .. startrev: 7e9787939641
diff --git a/pypy/doc/whatsnew-pypy3-5.7.0.rst b/pypy/doc/whatsnew-pypy3-5.7.0.rst
new file mode 100644
--- /dev/null
+++ b/pypy/doc/whatsnew-pypy3-5.7.0.rst
@@ -0,0 +1,14 @@
+=========================
+What's new in PyPy3 5.7.0
+=========================
+
+.. this is the revision after release-pypy3.3-5.5.x was branched
+.. startrev: c5fb5db3c8ee
+
+.. branch: py3.5-time
+
+.. branch: py3.5-ssl
+
+.. branch: PEP393
+
+Implement some level of compatibility with PEP 393 APIs.
diff --git a/pypy/doc/whatsnew-pypy3-head.rst b/pypy/doc/whatsnew-pypy3-head.rst
new file mode 100644
--- /dev/null
+++ b/pypy/doc/whatsnew-pypy3-head.rst
@@ -0,0 +1,7 @@
+=========================
+What's new in PyPy3 5.7+
+=========================
+
+.. this is the revision after release-pypy3.3-5.7.x was branched
+.. startrev: afbf09453369
+
diff --git a/pypy/module/_multibytecodec/src/cjkcodecs/cjkcodecs.h b/pypy/module/_multibytecodec/src/cjkcodecs/cjkcodecs.h
--- a/pypy/module/_multibytecodec/src/cjkcodecs/cjkcodecs.h
+++ b/pypy/module/_multibytecodec/src/cjkcodecs/cjkcodecs.h
@@ -201,10 +201,13 @@
 
 #define BEGIN_MAPPINGS_LIST /* empty */
 #define MAPPING_ENCONLY(enc)                                            \
+  RPY_EXTERN const struct dbcs_map pypy_cjkmap_##enc;                   \
   const struct dbcs_map pypy_cjkmap_##enc = {#enc, (void*)enc##_encmap, NULL};
 #define MAPPING_DECONLY(enc)                                            \
+  RPY_EXTERN const struct dbcs_map pypy_cjkmap_##enc;                   \
   const struct dbcs_map pypy_cjkmap_##enc = {#enc, NULL, (void*)enc##_decmap};
 #define MAPPING_ENCDEC(enc)                                             \
+  RPY_EXTERN const struct dbcs_map pypy_cjkmap_##enc;                   \
   const struct dbcs_map pypy_cjkmap_##enc = {#enc, (void*)enc##_encmap, \
                                              (void*)enc##_decmap};
 #define END_MAPPINGS_LIST /* empty */
@@ -294,7 +297,7 @@
 
 #ifdef USING_IMPORTED_MAPS
 #define USING_IMPORTED_MAP(charset) \
-  extern const struct dbcs_map pypy_cjkmap_##charset;
+  RPY_EXTERN const struct dbcs_map pypy_cjkmap_##charset;
 
 #define IMPORT_MAP(locale, charset, encmap, decmap)                     \
   importmap(&pypy_cjkmap_##charset, encmap, decmap)
diff --git a/pypy/module/cpyext/api.py b/pypy/module/cpyext/api.py
--- a/pypy/module/cpyext/api.py
+++ b/pypy/module/cpyext/api.py
@@ -609,6 +609,7 @@
     'Py_FrozenFlag', 'Py_TabcheckFlag', 'Py_UnicodeFlag', 'Py_IgnoreEnvironmentFlag',
     'Py_DivisionWarningFlag', 'Py_DontWriteBytecodeFlag', 'Py_NoUserSiteDirectory',
     '_Py_QnewFlag', 'Py_Py3kWarningFlag', 'Py_HashRandomizationFlag', '_Py_PackageContext',
+    '_PyTraceMalloc_Track', '_PyTraceMalloc_Untrack', 'PyMem_Malloc',
 ]
 TYPES = {}
 FORWARD_DECLS = []
diff --git a/pypy/module/cpyext/test/test_typeobject.py b/pypy/module/cpyext/test/test_typeobject.py
--- a/pypy/module/cpyext/test/test_typeobject.py
+++ b/pypy/module/cpyext/test/test_typeobject.py
@@ -1221,3 +1221,25 @@
             pass
         bases = module.foo(C)
         assert bases == (A, B)
+
+    def test_multiple_inheritance_old_style_base(self):
+        module = self.import_extension('foo', [
+           ("foo", "METH_O",
+            '''
+                PyTypeObject *tp;
+                tp = (PyTypeObject*)args;
+                Py_INCREF(tp->tp_bases);
+                return tp->tp_bases;
+            '''
+            )])
+        # used to segfault after some iterations
+        for i in range(11):
+            print i
+            class A(object):
+                pass
+            class B:
+                pass
+            class C(A, B):
+                pass
+            bases = module.foo(C)
+            assert bases == (A, B)
diff --git a/pypy/module/cpyext/typeobject.py b/pypy/module/cpyext/typeobject.py
--- a/pypy/module/cpyext/typeobject.py
+++ b/pypy/module/cpyext/typeobject.py
@@ -931,7 +931,10 @@
     if base:
         inherit_special(space, pto, base)
     for w_base in space.fixedview(from_ref(space, pto.c_tp_bases)):
-        inherit_slots(space, pto, w_base)
+        if isinstance(w_base, W_TypeObject):
+            inherit_slots(space, pto, w_base)
+        #else:
+        #   w_base is a W_ClassObject, ignore it
 
     if not pto.c_tp_setattro:
         from pypy.module.cpyext.object import PyObject_GenericSetAttr
diff --git a/pypy/module/test_lib_pypy/cffi_tests/cffi0/test_parsing.py b/pypy/module/test_lib_pypy/cffi_tests/cffi0/test_parsing.py
--- a/pypy/module/test_lib_pypy/cffi_tests/cffi0/test_parsing.py
+++ b/pypy/module/test_lib_pypy/cffi_tests/cffi0/test_parsing.py
@@ -387,13 +387,14 @@
 def test_enum():
     ffi = FFI()
     ffi.cdef("""
-        enum Enum { POS = +1, TWO = 2, NIL = 0, NEG = -1};
+        enum Enum { POS = +1, TWO = 2, NIL = 0, NEG = -1, OP = (POS+TWO)-1};
         """)
     C = ffi.dlopen(None)
     assert C.POS == 1
     assert C.TWO == 2
     assert C.NIL == 0
     assert C.NEG == -1
+    assert C.OP == 2
 
 def test_stdcall():
     ffi = FFI()
diff --git a/rpython/jit/backend/x86/assembler.py b/rpython/jit/backend/x86/assembler.py
--- a/rpython/jit/backend/x86/assembler.py
+++ b/rpython/jit/backend/x86/assembler.py
@@ -349,15 +349,12 @@
         #
         mc.MOV(eax, heap(self.cpu.pos_exception()))
         mc.TEST_rr(eax.value, eax.value)
-        mc.J_il8(rx86.Conditions['NZ'], 0)
-        jnz_location = mc.get_relative_pos()
+        jnz_location = mc.emit_forward_jump('NZ')
         #
         mc.RET()
         #
         # patch the JNZ above
-        offset = mc.get_relative_pos() - jnz_location
-        assert 0 < offset <= 127
-        mc.overwrite(jnz_location-1, chr(offset))
+        mc.patch_forward_jump(jnz_location)
         # From now on this function is basically "merged" with
         # its caller and so contains DEFAULT_FRAME_BYTES bytes
         # plus my own return address, which we'll ignore next
@@ -834,16 +831,13 @@
         ofs = self.cpu.unpack_fielddescr(descrs.arraydescr.lendescr)
         mc.CMP_bi(ofs, 0xffffff)     # force writing 32 bit
         stack_check_cmp_ofs = mc.get_relative_pos() - 4
-        mc.J_il8(rx86.Conditions['GE'], 0)
-        jg_location = mc.get_relative_pos()
+        jg_location = mc.emit_forward_jump('GE')
         mc.MOV_si(WORD, 0xffffff)     # force writing 32 bit
         ofs2 = mc.get_relative_pos() - 4
         self.push_gcmap(mc, gcmap, store=True)
         mc.CALL(imm(self._frame_realloc_slowpath))
         # patch the JG above
-        offset = mc.get_relative_pos() - jg_location
-        assert 0 < offset <= 127
-        mc.overwrite(jg_location-1, chr(offset))
+        mc.patch_forward_jump(jg_location)
         self.frame_depth_to_patch.append(stack_check_cmp_ofs)
         self.frame_depth_to_patch.append(ofs2)
 
@@ -857,16 +851,13 @@
         ofs = self.cpu.unpack_fielddescr(descrs.arraydescr.lendescr)
         mc.CMP_bi(ofs, 0xffffff)
         stack_check_cmp_ofs = mc.get_relative_pos() - 4
-        mc.J_il8(rx86.Conditions['GE'], 0)
-        jg_location = mc.get_relative_pos()
+        jg_location = mc.emit_forward_jump('GE')
         mc.MOV_rr(edi.value, ebp.value)
         mc.MOV_ri(esi.value, 0xffffff)
         ofs2 = mc.get_relative_pos() - 4
         mc.CALL(imm(self.cpu.realloc_frame_crash))
         # patch the JG above
-        offset = mc.get_relative_pos() - jg_location
-        assert 0 < offset <= 127
-        mc.overwrite(jg_location-1, chr(offset))
+        mc.patch_forward_jump(jg_location)
         self.frame_depth_to_patch.append(stack_check_cmp_ofs)
         self.frame_depth_to_patch.append(ofs2)
 
@@ -1002,13 +993,10 @@
             self.mc.MOV(eax, heap(endaddr))             # MOV eax, [start]
             self.mc.SUB(eax, esp)                       # SUB eax, current
             self.mc.CMP(eax, heap(lengthaddr))          # CMP eax, [length]
-            self.mc.J_il8(rx86.Conditions['BE'], 0)     # JBE .skip
-            jb_location = self.mc.get_relative_pos()
+            jb_location = self.mc.emit_forward_jump('BE')#JBE .skip
             self.mc.CALL(imm(self.stack_check_slowpath))# CALL slowpath
             # patch the JB above                        # .skip:
-            offset = self.mc.get_relative_pos() - jb_location
-            assert 0 < offset <= 127
-            self.mc.overwrite(jb_location-1, chr(offset))
+            self.mc.patch_forward_jump(jb_location)
             #
 
     def _call_footer(self):
@@ -1242,15 +1230,12 @@
         return genop_cmp
 
     def _if_parity_clear_zero_and_carry(self):
-        self.mc.J_il8(rx86.Conditions['NP'], 0)
-        jnp_location = self.mc.get_relative_pos()
+        jnp_location = self.mc.emit_forward_jump('NP')
         # CMP EBP, 0: as EBP cannot be null here, that operation should
         # always clear zero and carry
         self.mc.CMP_ri(ebp.value, 0)
         # patch the JNP above
-        offset = self.mc.get_relative_pos() - jnp_location
-        assert 0 < offset <= 127
-        self.mc.overwrite(jnp_location-1, chr(offset))
+        self.mc.patch_forward_jump(jnp_location)
 
     def _cmpop_float(cond, rev_cond):
         is_ne           = cond == 'NE'
@@ -1728,10 +1713,11 @@
         # jump to jump over this GUARD_NO_EXCEPTION as well, if we can
         if self._find_nearby_operation(-1).getopnum() in (
                 rop.COND_CALL, rop.COND_CALL_VALUE_I, rop.COND_CALL_VALUE_R):
-            jmp_adr = self.previous_cond_call_jcond
-            offset = self.mc.get_relative_pos() - jmp_adr
-            if offset <= 127:
-                self.mc.overwrite(jmp_adr-1, chr(offset))
+            j_location = self.previous_cond_call_jcond
+            try:
+                self.mc.patch_forward_jump(j_location)
+            except codebuf.ShortJumpTooFar:
+                pass    # ignore this case
 
     def genop_guard_guard_not_invalidated(self, guard_op, guard_token,
                                           locs, ign):
@@ -1842,13 +1828,10 @@
     def genop_guard_guard_nonnull_class(self, guard_op, guard_token, locs, ign):
         self.mc.CMP(locs[0], imm1)
         # Patched below
-        self.mc.J_il8(rx86.Conditions['B'], 0)
-        jb_location = self.mc.get_relative_pos()
+        jb_location = self.mc.emit_forward_jump('B')
         self._cmp_guard_class(locs)
         # patch the JB above
-        offset = self.mc.get_relative_pos() - jb_location
-        assert 0 < offset <= 127
-        self.mc.overwrite(jb_location-1, chr(offset))
+        self.mc.patch_forward_jump(jb_location)
         #
         self.guard_success_cc = rx86.Conditions['E']
         self.implement_guard(guard_token)
@@ -2223,19 +2206,15 @@
         ofs = self.cpu.get_ofs_of_frame_field('jf_descr')
         self.mc.CMP(mem(eax, ofs), imm(value))
         # patched later
-        self.mc.J_il8(rx86.Conditions['E'], 0) # goto B if we get 'done_with_this_frame'
-        return self.mc.get_relative_pos()
+        return self.mc.emit_forward_jump('E') # goto B if we get 'done_with_this_frame'
 
     def _call_assembler_patch_je(self, result_loc, je_location):
         if (IS_X86_32 and isinstance(result_loc, FrameLoc) and
             result_loc.type == FLOAT):
             self.mc.FSTPL_b(result_loc.value)
-        self.mc.JMP_l8(0) # jump to done, patched later
-        jmp_location = self.mc.get_relative_pos()
+        jmp_location = self.mc.emit_forward_jump_uncond()   # jump to the end
         #
-        offset = jmp_location - je_location
-        assert 0 < offset <= 127
-        self.mc.overwrite(je_location - 1, chr(offset))
+        self.mc.patch_forward_jump(je_location)
         self.mc.force_frame_size(DEFAULT_FRAME_BYTES)
         #
         return jmp_location
@@ -2255,9 +2234,7 @@
                 self.mc.MOV_rm(eax.value, (eax.value, ofs))
 
     def _call_assembler_patch_jmp(self, jmp_location):
-        offset = self.mc.get_relative_pos() - jmp_location
-        assert 0 <= offset <= 127
-        self.mc.overwrite(jmp_location - 1, chr(offset))
+        self.mc.patch_forward_jump(jmp_location)
 
     # ------------------- END CALL ASSEMBLER -----------------------
 
@@ -2288,16 +2265,14 @@
         else:
             loc = addr_add_const(loc_base, descr.jit_wb_if_flag_byteofs)
         mc.TEST8(loc, imm(mask))
-        mc.J_il8(rx86.Conditions['Z'], 0) # patched later
-        jz_location = mc.get_relative_pos()
+        jz_location = mc.emit_forward_jump('Z')   # patched later
 
         # for cond_call_gc_wb_array, also add another fast path:
         # if GCFLAG_CARDS_SET, then we can just set one bit and be done
         if card_marking:
             # GCFLAG_CARDS_SET is in this byte at 0x80, so this fact can
-            # been checked by the status flags of the previous TEST8
-            mc.J_il8(rx86.Conditions['S'], 0) # patched later
-            js_location = mc.get_relative_pos()
+            # been checked by the sign flags of the previous TEST8
+            js_location = mc.emit_forward_jump('S')   # patched later
         else:
             js_location = 0
 
@@ -2326,13 +2301,10 @@
             # The helper ends again with a check of the flag in the object.
             # So here, we can simply write again a 'JNS', which will be
             # taken if GCFLAG_CARDS_SET is still not set.
-            mc.J_il8(rx86.Conditions['NS'], 0) # patched later
-            jns_location = mc.get_relative_pos()
+            jns_location = mc.emit_forward_jump('NS')   # patched later
             #
             # patch the JS above
-            offset = mc.get_relative_pos() - js_location
-            assert 0 < offset <= 127
-            mc.overwrite(js_location-1, chr(offset))
+            mc.patch_forward_jump(js_location)
             #
             # case GCFLAG_CARDS_SET: emit a few instructions to do
             # directly the card flag setting
@@ -2367,14 +2339,10 @@
                 raise AssertionError("index is neither RegLoc nor ImmedLoc")
             #
             # patch the JNS above
-            offset = mc.get_relative_pos() - jns_location
-            assert 0 < offset <= 127
-            mc.overwrite(jns_location-1, chr(offset))
+            mc.patch_forward_jump(jns_location)
 
         # patch the JZ above
-        offset = mc.get_relative_pos() - jz_location
-        assert 0 < offset <= 127
-        mc.overwrite(jz_location-1, chr(offset))
+        mc.patch_forward_jump(jz_location)
 
     def genop_discard_cond_call_gc_wb(self, op, arglocs):
         self._write_barrier_fastpath(self.mc, op.getdescr(), arglocs)
@@ -2407,9 +2375,8 @@
 
     def cond_call(self, gcmap, imm_func, arglocs, resloc=None):
         assert self.guard_success_cc >= 0
-        self.mc.J_il8(rx86.invert_condition(self.guard_success_cc), 0)
-                                                            # patched later
-        jmp_adr = self.mc.get_relative_pos()
+        j_location = self.mc.emit_forward_jump_cond(
+            rx86.invert_condition(self.guard_success_cc))
         self.guard_success_cc = rx86.cond_none
         #
         self.push_gcmap(self.mc, gcmap, store=True)
@@ -2459,26 +2426,21 @@
             v = gpr_reg_mgr_cls.all_reg_indexes[eax.value]
             self.mc.MOV_rb(eax.value, v * WORD + base_ofs)
         #
-        offset = self.mc.get_relative_pos() - jmp_adr
-        assert 0 < offset <= 127
-        self.mc.overwrite(jmp_adr-1, chr(offset))
+        self.mc.patch_forward_jump(j_location)
         # might be overridden again to skip over the following
         # guard_no_exception too
-        self.previous_cond_call_jcond = jmp_adr
+        self.previous_cond_call_jcond = j_location
 
     def malloc_cond(self, nursery_free_adr, nursery_top_adr, size, gcmap):
         assert size & (WORD-1) == 0     # must be correctly aligned
         self.mc.MOV(ecx, heap(nursery_free_adr))
         self.mc.LEA_rm(edx.value, (ecx.value, size))
         self.mc.CMP(edx, heap(nursery_top_adr))
-        self.mc.J_il8(rx86.Conditions['NA'], 0) # patched later
-        jmp_adr = self.mc.get_relative_pos()
+        jna_location = self.mc.emit_forward_jump('NA')   # patched later
         # save the gcmap
         self.push_gcmap(self.mc, gcmap, store=True)
         self.mc.CALL(imm(follow_jump(self.malloc_slowpath)))
-        offset = self.mc.get_relative_pos() - jmp_adr
-        assert 0 < offset <= 127
-        self.mc.overwrite(jmp_adr-1, chr(offset))
+        self.mc.patch_forward_jump(jna_location)
         self.mc.MOV(heap(nursery_free_adr), edx)
 
     def malloc_cond_varsize_frame(self, nursery_free_adr, nursery_top_adr,
@@ -2492,14 +2454,11 @@
         else:
             self.mc.LEA_ra(edx.value, (ecx.value, sizeloc.value, 0, 0))
         self.mc.CMP(edx, heap(nursery_top_adr))
-        self.mc.J_il8(rx86.Conditions['NA'], 0) # patched later
-        jmp_adr = self.mc.get_relative_pos()
+        jna_location = self.mc.emit_forward_jump('NA')   # patched later
         # save the gcmap
         self.push_gcmap(self.mc, gcmap, store=True)
         self.mc.CALL(imm(follow_jump(self.malloc_slowpath)))
-        offset = self.mc.get_relative_pos() - jmp_adr
-        assert 0 < offset <= 127
-        self.mc.overwrite(jmp_adr-1, chr(offset))
+        self.mc.patch_forward_jump(jna_location)
         self.mc.MOV(heap(nursery_free_adr), edx)
 
     def malloc_cond_varsize(self, kind, nursery_free_adr, nursery_top_adr,
@@ -2517,8 +2476,7 @@
             varsizeloc = edx
 
         self.mc.CMP(varsizeloc, imm(maxlength))
-        self.mc.J_il8(rx86.Conditions['A'], 0) # patched later
-        jmp_adr0 = self.mc.get_relative_pos()
+        ja_location = self.mc.emit_forward_jump('A')   # patched later
 
         self.mc.MOV(ecx, heap(nursery_free_adr))
         if valid_addressing_size(itemsize):
@@ -2542,12 +2500,9 @@
         # now edx contains the total size in bytes, rounded up to a multiple
         # of WORD, plus nursery_free_adr
         self.mc.CMP(edx, heap(nursery_top_adr))
-        self.mc.J_il8(rx86.Conditions['NA'], 0) # patched later
-        jmp_adr1 = self.mc.get_relative_pos()
+        jna_location = self.mc.emit_forward_jump('NA')   # patched later
         #
-        offset = self.mc.get_relative_pos() - jmp_adr0
-        assert 0 < offset <= 127
-        self.mc.overwrite(jmp_adr0-1, chr(offset))
+        self.mc.patch_forward_jump(ja_location)
         # save the gcmap
         self.push_gcmap(self.mc, gcmap, store=True)
         if kind == rewrite.FLAG_ARRAY:
@@ -2563,21 +2518,16 @@
                 addr = self.malloc_slowpath_unicode
             self.mc.MOV(edx, lengthloc)
         self.mc.CALL(imm(follow_jump(addr)))
-        self.mc.JMP_l8(0)      # jump to done, patched later
-        jmp_location = self.mc.get_relative_pos()
+        jmp_location = self.mc.emit_forward_jump_uncond()  # jump to later
         #
-        offset = self.mc.get_relative_pos() - jmp_adr1
-        assert 0 < offset <= 127
-        self.mc.overwrite(jmp_adr1-1, chr(offset))
+        self.mc.patch_forward_jump(jna_location)
         self.mc.force_frame_size(DEFAULT_FRAME_BYTES)
         # write down the tid, but not if it's the result of the CALL
         self.mc.MOV(mem(ecx, 0), imm(arraydescr.tid))
         # while we're at it, this line is not needed if we've done the CALL
         self.mc.MOV(heap(nursery_free_adr), edx)
         #
-        offset = self.mc.get_relative_pos() - jmp_location
-        assert 0 < offset <= 127
-        self.mc.overwrite(jmp_location - 1, chr(offset))
+        self.mc.patch_forward_jump(jmp_location)
 
     def store_force_descr(self, op, fail_locs, frame_depth):
         guard_token = self.implement_guard_recovery(op.opnum,
diff --git a/rpython/jit/backend/x86/callbuilder.py b/rpython/jit/backend/x86/callbuilder.py
--- a/rpython/jit/backend/x86/callbuilder.py
+++ b/rpython/jit/backend/x86/callbuilder.py
@@ -341,25 +341,20 @@
             # thread.  So here we check if the shadowstack pointer
             # is still the same as before we released the GIL (saved
             # in 'ebx'), and if not, we fall back to 'reacqgil_addr'.
-            mc.J_il8(rx86.Conditions['NE'], 0)
-            jne_location = mc.get_relative_pos()
+            jne_location = mc.emit_forward_jump('NE')
             # here, ecx (=old_value) is zero (so rpy_fastgil was in 'released'
             # state before the XCHG, but the XCHG acquired it by writing 1)
             rst = gcrootmap.get_root_stack_top_addr()
             mc = self.mc
             mc.CMP(ebx, heap(rst))
-            mc.J_il8(rx86.Conditions['E'], 0)
-            je_location = mc.get_relative_pos()
+            je_location = mc.emit_forward_jump('E')
             # revert the rpy_fastgil acquired above, so that the
             # general 'reacqgil_addr' below can acquire it again...
             mc.MOV(heap(fastgil), ecx)
             # patch the JNE above
-            offset = mc.get_relative_pos() - jne_location
-            assert 0 < offset <= 127
-            mc.overwrite(jne_location-1, chr(offset))
+            mc.patch_forward_jump(jne_location)
         else:
-            mc.J_il8(rx86.Conditions['E'], 0)
-            je_location = mc.get_relative_pos()
+            je_location = mc.emit_forward_jump('E')
         #
         # Yes, we need to call the reacqgil() function
         if not self.result_value_saved_early:
@@ -374,9 +369,7 @@
             self.restore_result_value(save_edx=False)
         #
         # patch the JE above
-        offset = mc.get_relative_pos() - je_location
-        assert 0 < offset <= 127
-        mc.overwrite(je_location-1, chr(offset))
+        mc.patch_forward_jump(je_location)
         #
         if restore_edx:
             mc.MOV_rs(edx.value, 12)   # restore this
diff --git a/rpython/jit/backend/x86/codebuf.py b/rpython/jit/backend/x86/codebuf.py
--- a/rpython/jit/backend/x86/codebuf.py
+++ b/rpython/jit/backend/x86/codebuf.py
@@ -1,12 +1,13 @@
 from rpython.rtyper.lltypesystem import lltype, rffi
 from rpython.rlib.rarithmetic import intmask
+from rpython.rlib.objectmodel import specialize
 from rpython.rlib.debug import debug_start, debug_print, debug_stop
 from rpython.rlib.debug import have_debug_prints
 from rpython.jit.backend.llsupport.asmmemmgr import BlockBuilderMixin
 from rpython.jit.backend.x86.rx86 import X86_32_CodeBuilder, X86_64_CodeBuilder
 from rpython.jit.backend.x86.regloc import LocationCodeBuilder
 from rpython.jit.backend.x86.arch import IS_X86_32, IS_X86_64, WORD
-from rpython.jit.backend.x86 import valgrind
+from rpython.jit.backend.x86 import rx86, valgrind
 
 # XXX: Seems nasty to change the superclass of MachineCodeBlockWrapper
 # like this
@@ -17,6 +18,9 @@
     codebuilder_cls = X86_64_CodeBuilder
     backend_name = 'x86_64'
 
+class ShortJumpTooFar(Exception):
+    pass
+
 
 class MachineCodeBlockWrapper(BlockBuilderMixin,
                               LocationCodeBuilder,
@@ -53,3 +57,22 @@
                 adr[0] = rffi.cast(rffi.INT, intmask(adr[0]) - p)
         valgrind.discard_translations(addr, self.get_relative_pos())
         self._dump(addr, "jit-backend-dump", backend_name)
+
+    @specialize.arg(1)
+    def emit_forward_jump(self, condition_string):
+        return self.emit_forward_jump_cond(rx86.Conditions[condition_string])
+
+    def emit_forward_jump_cond(self, cond):
+        self.J_il8(cond, 0)
+        return self.get_relative_pos()
+
+    def emit_forward_jump_uncond(self):
+        self.JMP_l8(0)
+        return self.get_relative_pos()
+
+    def patch_forward_jump(self, jcond_location):
+        offset = self.get_relative_pos() - jcond_location
+        assert offset >= 0
+        if offset > 127:
+            raise ShortJumpTooFar
+        self.overwrite(jcond_location-1, chr(offset))
diff --git a/rpython/rlib/rposix.py b/rpython/rlib/rposix.py
--- a/rpython/rlib/rposix.py
+++ b/rpython/rlib/rposix.py
@@ -237,6 +237,8 @@
                 'sys/resource.h',
                 'grp.h', 'dirent.h', 'sys/stat.h', 'fcntl.h',
                 'signal.h', 'sys/utsname.h', _ptyh]
+    if sys.platform.startswith('linux'):
+        includes.append('sys/sysmacros.h')
     if sys.platform.startswith('freebsd'):
         includes.append('sys/ttycom.h')
     libraries = ['util']
diff --git a/rpython/rlib/rsiphash.py b/rpython/rlib/rsiphash.py
--- a/rpython/rlib/rsiphash.py
+++ b/rpython/rlib/rsiphash.py


More information about the pypy-commit mailing list