Author: Gregor Wegberg <[email protected]>
Branch: gc-incminimark-pinning
Changeset: r71850:0c70ca589f85
Date: 2014-05-28 16:01 +0200
http://bitbucket.org/pypy/pypy/changeset/0c70ca589f85/
Log: Merge release-2.3.x into gc-incminimark-pinning
diff --git a/pypy/doc/conf.py b/pypy/doc/conf.py
--- a/pypy/doc/conf.py
+++ b/pypy/doc/conf.py
@@ -47,7 +47,7 @@
# The short X.Y version.
version = '2.3'
# The full version, including alpha/beta/rc tags.
-release = '2.3.0'
+release = '2.3.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/pypy/doc/how-to-release.rst b/pypy/doc/how-to-release.rst
--- a/pypy/doc/how-to-release.rst
+++ b/pypy/doc/how-to-release.rst
@@ -28,11 +28,6 @@
pypy/doc/tool/makecontributor.py generates the list of contributors
* rename pypy/doc/whatsnew_head.rst to whatsnew_VERSION.rst
and create a fresh whatsnew_head.rst after the release
-* merge PYPY_IRC_TOPIC environment variable handling from previous release
- in pypy/doc/getting-started-dev.rst, pypy/doc/man/pypy.1.rst, and
- pypy/interpreter/app_main.py so release versions will not print a random
- IRC topic by default.
-* change the tracker to have a new release tag to file bugs against
* go to pypy/tool/release and run:
force-builds.py <release branch>
* wait for builds to complete, make sure there are no failures
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
@@ -1,19 +1,42 @@
Historical release notes
-------------------------
+========================
+
+Cpython 2.7 compatible versions
+===============================
.. toctree::
+ release-2.3.0.rst
+ release-2.2.1.rst
+ release-2.2.0.rst
+ release-2.1.0.rst
+ release-2.1.0-beta2.rst
+ release-2.1.0-beta1.rst
+ release-2.1.0.rst
+ release-2.0.2.rst
+ release-2.0.1.rst
+ release-2.0.0.rst
+ release-2.0.0-beta2.rst
+ release-2.0.0-beta1.rst
+ release-1.9.0.rst
+ release-1.8.0.rst
+ release-1.7.0.rst
+ release-1.6.0.rst
+ release-1.5.0.rst
+ release-1.4.1.rst
+ release-1.4.0beta.rst
+ release-1.4.0.rst
+ release-1.3.0.rst
+ release-1.2.0.rst
+ release-1.1.0.rst
+ release-1.0.0.rst
+ release-0.99.0.rst
+ release-0.9.0.rst
+ release-0.8.0.rst
+ release-0.7.0.rst
release-0.6
- release-0.7.0.rst
- release-0.8.0.rst
- release-0.9.0.rst
- release-0.99.0.rst
- release-1.0.0.rst
- release-1.1.0.rst
- release-1.2.0.rst
- release-1.3.0.rst
- release-1.4.0.rst
- release-1.4.0beta.rst
- release-1.4.1.rst
- release-1.5.0.rst
- release-1.6.0.rst
+
+Cpython 3.2 compatible versions
+===============================
+.. toctree::
+ release-pypy3-2.1.0-beta1.rst
diff --git a/pypy/doc/index.rst b/pypy/doc/index.rst
--- a/pypy/doc/index.rst
+++ b/pypy/doc/index.rst
@@ -40,7 +40,7 @@
* `FAQ`_: some frequently asked questions.
-* `Release 2.3.0`_: the latest official release
+* `Release 2.3.1`_: the latest official release
* `PyPy Blog`_: news and status info about PyPy
diff --git a/pypy/doc/whatsnew-2.3.1.rst b/pypy/doc/whatsnew-2.3.1.rst
new file mode 100644
--- /dev/null
+++ b/pypy/doc/whatsnew-2.3.1.rst
@@ -0,0 +1,11 @@
+=======================
+What's new since PyPy 2.3?
+=======================
+
+.. this is a revision shortly after release-2.3
+.. startrev: 394146e9bb67
+
+Move builtin ``struct`` module to ``_struct`` to allow ``pypy "-m
idlelib.idle"``
+
+Support compilation with gcc-4.9
+
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,6 +1,12 @@
=======================
-What's new in PyPy 2.3+
+What's new in PyPy 2.4+
=======================
.. this is a revision shortly after release-2.3.x
.. startrev: b2cc67adbaad
+
+Added support for the stdlib gdbm module via cffi
+
+Fixes for issues #1769, #1764, #1762, #1752
+
+Annotator cleanups
diff --git a/pypy/interpreter/app_main.py b/pypy/interpreter/app_main.py
--- a/pypy/interpreter/app_main.py
+++ b/pypy/interpreter/app_main.py
@@ -590,6 +590,11 @@
# handle the case where no command/filename/module is specified
# on the command-line.
+ try:
+ from _ast import PyCF_ACCEPT_NULL_BYTES
+ except ImportError:
+ PyCF_ACCEPT_NULL_BYTES = 0
+
# update sys.path *after* loading site.py, in case there is a
# "site.py" file in the script's directory. Only run this if we're
# executing the interactive prompt, if we're running a script we
@@ -613,7 +618,8 @@
def run_it():
co_python_startup = compile(startup,
python_startup,
- 'exec')
+ 'exec',
+ PyCF_ACCEPT_NULL_BYTES)
exec co_python_startup in mainmodule.__dict__
mainmodule.__file__ = python_startup
run_toplevel(run_it)
@@ -626,7 +632,8 @@
else:
# If not interactive, just read and execute stdin normally.
def run_it():
- co_stdin = compile(sys.stdin.read(), '<stdin>', 'exec')
+ co_stdin = compile(sys.stdin.read(), '<stdin>', 'exec',
+ PyCF_ACCEPT_NULL_BYTES)
exec co_stdin in mainmodule.__dict__
mainmodule.__file__ = '<stdin>'
success = run_toplevel(run_it)
diff --git a/pypy/interpreter/astcompiler/consts.py
b/pypy/interpreter/astcompiler/consts.py
--- a/pypy/interpreter/astcompiler/consts.py
+++ b/pypy/interpreter/astcompiler/consts.py
@@ -22,3 +22,4 @@
PyCF_SOURCE_IS_UTF8 = 0x0100
PyCF_DONT_IMPLY_DEDENT = 0x0200
PyCF_ONLY_AST = 0x0400
+PyCF_ACCEPT_NULL_BYTES = 0x10000000 # PyPy only, for compile()
diff --git a/pypy/module/__builtin__/compiling.py
b/pypy/module/__builtin__/compiling.py
--- a/pypy/module/__builtin__/compiling.py
+++ b/pypy/module/__builtin__/compiling.py
@@ -24,7 +24,8 @@
"""
ec = space.getexecutioncontext()
if flags & ~(ec.compiler.compiler_flags | consts.PyCF_ONLY_AST |
- consts.PyCF_DONT_IMPLY_DEDENT | consts.PyCF_SOURCE_IS_UTF8):
+ consts.PyCF_DONT_IMPLY_DEDENT | consts.PyCF_SOURCE_IS_UTF8 |
+ consts.PyCF_ACCEPT_NULL_BYTES):
raise OperationError(space.w_ValueError,
space.wrap("compile() unrecognized flags"))
@@ -53,9 +54,10 @@
else:
source = space.readbuf_w(w_source).as_str()
- if '\x00' in source:
- raise OperationError(space.w_TypeError, space.wrap(
- "compile() expected string without null bytes"))
+ if not (flags & consts.PyCF_ACCEPT_NULL_BYTES):
+ if '\x00' in source:
+ raise OperationError(space.w_TypeError, space.wrap(
+ "compile() expected string without null bytes"))
if flags & consts.PyCF_ONLY_AST:
code = ec.compiler.compile_to_ast(source, filename, mode, flags)
diff --git a/pypy/module/__builtin__/test/test_builtin.py
b/pypy/module/__builtin__/test/test_builtin.py
--- a/pypy/module/__builtin__/test/test_builtin.py
+++ b/pypy/module/__builtin__/test/test_builtin.py
@@ -610,6 +610,16 @@
firstlineno = co.co_firstlineno
assert firstlineno == 2
+ def test_compile_null_bytes(self):
+ import _ast
+ raises(TypeError, compile, '\x00', 'mymod', 'exec', 0)
+ raises(SyntaxError, compile, '\x00', 'mymod', 'exec',
+ _ast.PyCF_ACCEPT_NULL_BYTES)
+ src = "#abc\x00def\n"
+ raises(TypeError, compile, src, 'mymod', 'exec')
+ raises(TypeError, compile, src, 'mymod', 'exec', 0)
+ compile(src, 'mymod', 'exec', _ast.PyCF_ACCEPT_NULL_BYTES) # works
+
def test_print_function(self):
import __builtin__
import sys
diff --git a/pypy/module/_ast/__init__.py b/pypy/module/_ast/__init__.py
--- a/pypy/module/_ast/__init__.py
+++ b/pypy/module/_ast/__init__.py
@@ -6,6 +6,8 @@
interpleveldefs = {
"PyCF_ONLY_AST" : "space.wrap(%s)" % consts.PyCF_ONLY_AST,
+ "PyCF_ACCEPT_NULL_BYTES":
+ "space.wrap(%s)" % consts.PyCF_ACCEPT_NULL_BYTES,
"__version__" : "space.wrap('82160')", # from CPython's svn.
}
appleveldefs = {}
diff --git a/pypy/module/_file/interp_file.py b/pypy/module/_file/interp_file.py
--- a/pypy/module/_file/interp_file.py
+++ b/pypy/module/_file/interp_file.py
@@ -209,11 +209,13 @@
while size > 0:
# "peeks" on the underlying stream to see how many chars
# we can safely read without reading past an end-of-line
- peeked = stream.peek()
- pn = peeked.find("\n", 0, size)
+ startindex, peeked = stream.peek()
+ assert 0 <= startindex <= len(peeked)
+ endindex = startindex + size
+ pn = peeked.find("\n", startindex, endindex)
if pn < 0:
- pn = min(size-1, len(peeked))
- c = stream.read(pn + 1)
+ pn = min(endindex - 1, len(peeked))
+ c = stream.read(pn - startindex + 1)
if not c:
break
result.append(c)
diff --git a/pypy/module/bz2/interp_bz2.py b/pypy/module/bz2/interp_bz2.py
--- a/pypy/module/bz2/interp_bz2.py
+++ b/pypy/module/bz2/interp_bz2.py
@@ -458,9 +458,7 @@
return result
def peek(self):
- pos = self.pos
- assert pos >= 0
- return self.buffer[pos:]
+ return (self.pos, self.buffer)
def try_to_find_file_descriptor(self):
return self.stream.try_to_find_file_descriptor()
diff --git a/pypy/module/cpyext/include/patchlevel.h
b/pypy/module/cpyext/include/patchlevel.h
--- a/pypy/module/cpyext/include/patchlevel.h
+++ b/pypy/module/cpyext/include/patchlevel.h
@@ -29,7 +29,7 @@
#define PY_VERSION "2.7.6"
/* PyPy version as a string */
-#define PYPY_VERSION "2.3.0"
+#define PYPY_VERSION "2.3.1"
/* Subversion Revision number of this file (not of the repository).
* Empty since Mercurial migration. */
diff --git a/pypy/module/sys/version.py b/pypy/module/sys/version.py
--- a/pypy/module/sys/version.py
+++ b/pypy/module/sys/version.py
@@ -10,7 +10,7 @@
#XXX # sync CPYTHON_VERSION with patchlevel.h, package.py
CPYTHON_API_VERSION = 1013 #XXX # sync with include/modsupport.h
-PYPY_VERSION = (2, 3, 0, "final", 0) #XXX # sync patchlevel.h
+PYPY_VERSION = (2, 3, 1, "final", 0) #XXX # sync patchlevel.h
if platform.name == 'msvc':
COMPILER_INFO = 'MSC v.%d 32 bit' % (platform.version * 10 + 600)
diff --git a/rpython/memory/gc/incminimark.py b/rpython/memory/gc/incminimark.py
--- a/rpython/memory/gc/incminimark.py
+++ b/rpython/memory/gc/incminimark.py
@@ -2058,20 +2058,26 @@
#END MARKING
elif self.gc_state == STATE_SWEEPING:
#
- # Walk all rawmalloced objects and free the ones that don't
- # have the GCFLAG_VISITED flag. Visit at most 'limit' objects.
- limit = self.nursery_size // self.ac.page_size
- remaining = self.free_unvisited_rawmalloc_objects_step(limit)
- #
- # Ask the ArenaCollection to visit a fraction of the objects.
- # Free the ones that have not been visited above, and reset
- # GCFLAG_VISITED on the others. Visit at most '3 * limit'
- # pages minus the number of objects already visited above.
- done = self.ac.mass_free_incremental(self._free_if_unvisited,
- 2 * limit + remaining)
+ if self.raw_malloc_might_sweep.non_empty():
+ # Walk all rawmalloced objects and free the ones that don't
+ # have the GCFLAG_VISITED flag. Visit at most 'limit' objects.
+ # This limit is conservatively high enough to guarantee that
+ # a total object size of at least '3 * nursery_size' bytes
+ # is processed.
+ limit = 3 * self.nursery_size // self.small_request_threshold
+ self.free_unvisited_rawmalloc_objects_step(limit)
+ done = False # the 2nd half below must still be done
+ else:
+ # Ask the ArenaCollection to visit a fraction of the objects.
+ # Free the ones that have not been visited above, and reset
+ # GCFLAG_VISITED on the others. Visit at most '3 *
+ # nursery_size' bytes.
+ limit = 3 * self.nursery_size // self.ac.page_size
+ done = self.ac.mass_free_incremental(self._free_if_unvisited,
+ limit)
# XXX tweak the limits above
#
- if remaining > 0 and done:
+ if done:
self.num_major_collects += 1
#
# We also need to reset the GCFLAG_VISITED on prebuilt GC
objects.
diff --git a/rpython/rlib/rbigint.py b/rpython/rlib/rbigint.py
--- a/rpython/rlib/rbigint.py
+++ b/rpython/rlib/rbigint.py
@@ -177,7 +177,7 @@
if intval < 0:
sign = -1
- ival = r_uint(-intval)
+ ival = -r_uint(intval)
elif intval > 0:
sign = 1
ival = r_uint(intval)
diff --git a/rpython/rlib/streamio.py b/rpython/rlib/streamio.py
--- a/rpython/rlib/streamio.py
+++ b/rpython/rlib/streamio.py
@@ -234,11 +234,12 @@
while True:
# "peeks" on the underlying stream to see how many characters
# we can safely read without reading past an end-of-line
- peeked = self.peek()
- pn = peeked.find("\n")
+ startindex, peeked = self.peek()
+ assert 0 <= startindex <= len(peeked)
+ pn = peeked.find("\n", startindex)
if pn < 0:
pn = len(peeked)
- c = self.read(pn + 1)
+ c = self.read(pn - startindex + 1)
if not c:
break
result.append(c)
@@ -265,7 +266,7 @@
pass
def peek(self):
- return ''
+ return (0, '')
def try_to_find_file_descriptor(self):
return -1
@@ -553,7 +554,7 @@
else:
difpos = offset
if -self.pos <= difpos <= currentsize:
- self.pos += difpos
+ self.pos += intmask(difpos)
return
if whence == 1:
offset -= currentsize
@@ -705,9 +706,7 @@
return "".join(chunks)
def peek(self):
- pos = self.pos
- assert pos >= 0
- return self.buf[pos:]
+ return (self.pos, self.buf)
write = PassThrough("write", flush_buffers=True)
truncate = PassThrough("truncate", flush_buffers=True)
@@ -970,12 +969,13 @@
while True:
# "peeks" on the underlying stream to see how many characters
# we can safely read without reading past an end-of-line
- peeked = self.base.peek()
- pn = peeked.find("\n")
- pr = peeked.find("\r")
+ startindex, peeked = self.base.peek()
+ assert 0 <= startindex <= len(peeked)
+ pn = peeked.find("\n", startindex)
+ pr = peeked.find("\r", startindex)
if pn < 0: pn = len(peeked)
if pr < 0: pr = len(peeked)
- c = self.read(min(pn, pr) + 1)
+ c = self.read(min(pn, pr) - startindex + 1)
if not c:
break
result.append(c)
@@ -1028,7 +1028,7 @@
self.buf = ""
def peek(self):
- return self.buf
+ return (0, self.buf)
write = PassThrough("write", flush_buffers=True)
truncate = PassThrough("truncate", flush_buffers=True)
diff --git a/rpython/translator/c/gcc/trackgcroot.py
b/rpython/translator/c/gcc/trackgcroot.py
--- a/rpython/translator/c/gcc/trackgcroot.py
+++ b/rpython/translator/c/gcc/trackgcroot.py
@@ -522,7 +522,7 @@
# raw data, not GC pointers
'movnt', 'mfence', 'lfence', 'sfence',
# bit manipulations
- 'bextr',
+ 'andn', 'bextr', 'blsi', 'blsmask', 'blsr', 'tzcnt', 'lzcnt',
])
# a partial list is hopefully good enough for now; it's all to support
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit