Author: Armin Rigo <[email protected]>
Branch: remove-globals-in-jit
Changeset: r59719:cbb1b76ebfa1
Date: 2013-01-05 13:51 +0100
http://bitbucket.org/pypy/pypy/changeset/cbb1b76ebfa1/
Log: hg merge default
diff --git a/LICENSE b/LICENSE
--- a/LICENSE
+++ b/LICENSE
@@ -28,7 +28,7 @@
DEALINGS IN THE SOFTWARE.
-PyPy Copyright holders 2003-2012
+PyPy Copyright holders 2003-2013
-----------------------------------
Except when otherwise stated (look for LICENSE files or information at
diff --git a/lib-python/2.7/sre_parse.py b/lib-python/2.7/sre_parse.py
--- a/lib-python/2.7/sre_parse.py
+++ b/lib-python/2.7/sre_parse.py
@@ -16,6 +16,12 @@
from sre_constants import *
+try:
+ from __pypy__ import newdict
+except ImportError:
+ def newdict(tp):
+ return {}
+
SPECIAL_CHARS = ".\\[{()*+?^$|"
REPEAT_CHARS = "*+?{"
@@ -68,7 +74,7 @@
self.flags = 0
self.open = []
self.groups = 1
- self.groupdict = {}
+ self.groupdict = newdict("module")
def opengroup(self, name=None):
gid = self.groups
self.groups = gid + 1
diff --git a/pypy/doc/index.rst b/pypy/doc/index.rst
--- a/pypy/doc/index.rst
+++ b/pypy/doc/index.rst
@@ -67,7 +67,7 @@
.. _Python: http://docs.python.org/index.html
.. _`more...`: architecture.html#mission-statement
.. _`PyPy blog`: http://morepypy.blogspot.com/
-.. _`development bug/feature tracker`: https://codespeak.net/issue/pypy-dev/
+.. _`development bug/feature tracker`: https://bugs.pypy.org
.. _here: http://tismerysoft.de/pypy/irc-logs/pypy
.. _`Mercurial commit mailing list`:
http://python.org/mailman/listinfo/pypy-commit
.. _`development mailing list`: http://python.org/mailman/listinfo/pypy-dev
diff --git a/pypy/jit/backend/arm/test/test_loop_unroll.py
b/pypy/jit/backend/arm/test/test_loop_unroll.py
--- a/pypy/jit/backend/arm/test/test_loop_unroll.py
+++ b/pypy/jit/backend/arm/test/test_loop_unroll.py
@@ -1,8 +1,8 @@
import py
-from pypy.jit.backend.x86.test.test_basic import Jit386Mixin
+from pypy.jit.backend.arm.test.support import JitARMMixin
from pypy.jit.metainterp.test import test_loop_unroll
-class TestLoopSpec(Jit386Mixin, test_loop_unroll.LoopUnrollTest):
+class TestLoopSpec(JitARMMixin, test_loop_unroll.LoopUnrollTest):
# for the individual tests see
# ====> ../../../metainterp/test/test_loop.py
pass
diff --git a/pypy/jit/codewriter/call.py b/pypy/jit/codewriter/call.py
--- a/pypy/jit/codewriter/call.py
+++ b/pypy/jit/codewriter/call.py
@@ -134,9 +134,14 @@
if getattr(funcobj, 'graph', None) is None:
return 'residual'
targetgraph = funcobj.graph
- if (hasattr(targetgraph, 'func') and
- hasattr(targetgraph.func, 'oopspec')):
- return 'builtin'
+ if hasattr(targetgraph, 'func'):
+ # must never produce JitCode for a function with
+ # _gctransformer_hint_close_stack_ set!
+ if getattr(targetgraph.func,
+ '_gctransformer_hint_close_stack_', False):
+ return 'residual'
+ if hasattr(targetgraph.func, 'oopspec'):
+ return 'builtin'
elif op.opname == 'oosend':
SELFTYPE, methname, opargs = support.decompose_oosend(op)
if SELFTYPE.oopspec_name is not None:
@@ -164,6 +169,13 @@
try:
return self.jitcodes[graph]
except KeyError:
+ # must never produce JitCode for a function with
+ # _gctransformer_hint_close_stack_ set!
+ if hasattr(graph, 'func') and getattr(graph.func,
+ '_gctransformer_hint_close_stack_', False):
+ raise AssertionError(
+ '%s has _gctransformer_hint_close_stack_' % (graph,))
+ #
fnaddr, calldescr = self.get_jitcode_calldescr(graph)
jitcode = JitCode(graph.name, fnaddr, calldescr,
called_from=called_from)
diff --git a/pypy/jit/metainterp/test/test_ajit.py
b/pypy/jit/metainterp/test/test_ajit.py
--- a/pypy/jit/metainterp/test/test_ajit.py
+++ b/pypy/jit/metainterp/test/test_ajit.py
@@ -3979,5 +3979,35 @@
rgc.add_memory_pressure(1234)
return 3
- self.interp_operations(f, [])
+ def test_external_call(self):
+ from pypy.rlib.objectmodel import invoke_around_extcall
+ T = rffi.CArrayPtr(rffi.TIME_T)
+ external = rffi.llexternal("time", [T], rffi.TIME_T)
+
+ class Oups(Exception):
+ pass
+ class State:
+ pass
+ state = State()
+
+ def before():
+ if we_are_jitted():
+ raise Oups
+ state.l.append("before")
+
+ def after():
+ if we_are_jitted():
+ raise Oups
+ state.l.append("after")
+
+ def f():
+ state.l = []
+ invoke_around_extcall(before, after)
+ external(lltype.nullptr(T.TO))
+ return len(state.l)
+
+ res = self.interp_operations(f, [])
+ assert res == 2
+ res = self.interp_operations(f, [])
+ assert res == 2
diff --git a/pypy/module/README.txt b/pypy/module/README.txt
--- a/pypy/module/README.txt
+++ b/pypy/module/README.txt
@@ -3,7 +3,7 @@
that require access to interpreter level. See here
for more information:
- http://codespeak.net/pypy/dist/pypy/doc/coding-guide.html#modules-in-pypy
+ http://doc.pypy.org/en/latest/coding-guide.html#modules-in-pypy
ATTENTION: don't put any '.py' files directly into pypy/module
because you can easily get import mixups on e.g. "import sys"
diff --git a/pypy/module/_sre/interp_sre.py b/pypy/module/_sre/interp_sre.py
--- a/pypy/module/_sre/interp_sre.py
+++ b/pypy/module/_sre/interp_sre.py
@@ -54,7 +54,7 @@
result = [-1] * (2 * num_groups)
mark = ctx.match_marks
while mark is not None:
- index = mark.gid
+ index = jit.promote(mark.gid)
if result[index] == -1:
result[index] = mark.position
mark = mark.prev
@@ -90,7 +90,7 @@
# SRE_Pattern class
class W_SRE_Pattern(Wrappable):
- _immutable_fields_ = ["code", "flags", "num_groups"]
+ _immutable_fields_ = ["code", "flags", "num_groups", "w_groupindex"]
def cannot_copy_w(self):
space = self.space
diff --git a/pypy/module/sys/app.py b/pypy/module/sys/app.py
--- a/pypy/module/sys/app.py
+++ b/pypy/module/sys/app.py
@@ -66,11 +66,11 @@
return None
copyright_str = """
-Copyright 2003-2012 PyPy development team.
+Copyright 2003-2013 PyPy development team.
All Rights Reserved.
For further information, see <http://pypy.org>
-Portions Copyright (c) 2001-2012 Python Software Foundation.
+Portions Copyright (c) 2001-2013 Python Software Foundation.
All Rights Reserved.
Portions Copyright (c) 2000 BeOpen.com.
diff --git a/pypy/tool/option.py b/pypy/tool/option.py
--- a/pypy/tool/option.py
+++ b/pypy/tool/option.py
@@ -6,7 +6,7 @@
import optparse
extra_useage = """For detailed descriptions of all the options see
-http://codespeak.net/pypy/dist/pypy/doc/config/commandline.html"""
+http://doc.pypy.org/en/latest/config/commandline.html"""
def get_standard_options():
config = get_pypy_config()
diff --git a/pypy/tool/release/make_release.py
b/pypy/tool/release/make_release.py
deleted file mode 100755
--- a/pypy/tool/release/make_release.py
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/usr/bin/env python
-
-""" A tool to download correct pypy-c's from nightly build run and package them
-into release packages. Note: you must run apropriate buildbots first and
-make sure there are no failures. Use force-builds.py from the same directory.
-
-Usage: make_release.py <branchname> <version>
- e.g.: make_release.py release-1.4.1 1.4.1
-"""
-
-import autopath
-import sys
-import urllib2
-from xml.dom import minidom
-import re
-import py
-from pypy.tool.udir import udir
-from pypy.tool.release.package import package
-import tarfile
-import os
-import shutil
-
-BASEURL = 'http://buildbot.pypy.org/nightly/'
-PAUSE = False
-
-def browse_nightly(branch,
- baseurl=BASEURL,
- override_xml=None):
- if override_xml is None:
- url = baseurl + branch + '/'
- xml = urllib2.urlopen(url).read()
- else:
- xml = override_xml
- dom = minidom.parseString(xml)
- refs = [node.getAttribute('href') for node in dom.getElementsByTagName('a')
- if 'pypy' in node.getAttribute('href')]
- # all refs are of form: pypy-c-{type}-{revnum}-{hghash}-{platform}.tar.bz2
- r = re.compile('pypy-c-([\w\d]+)-(\d+)-([0-9a-f]+)-([\w\d]+).tar.bz2$')
- d = {}
- for ref in refs:
- kind, revnum, hghash, platform = r.match(ref).groups()
- rev = int(revnum)
- try:
- lastrev, _ = d[(kind, platform)]
- except KeyError:
- lastrev = -1
- if rev > lastrev:
- d[(kind, platform)] = rev, ref
- return d
-
-def main(branch, release):
- to_download = browse_nightly(branch)
- tmpdir = udir.join('download')
- tmpdir.ensure(dir=True)
- alltars = []
- olddir = os.getcwd()
- try:
- os.chdir(str(tmpdir))
- print 'Using tmpdir', str(tmpdir)
- for (kind, platform), (rev, name) in to_download.iteritems():
- if platform == 'win32':
- print 'Ignoring %s, windows unsupported' % name
- else:
- print "Downloading %s at rev %d" % (name, rev)
- url = BASEURL + branch + "/" + name
- data = urllib2.urlopen(url).read()
- tmpdir.join(name).write(data, mode="wb")
- t = tarfile.open(str(tmpdir.join(name)))
- dirname = t.getmembers()[0].name
- t.extractall(path=str(tmpdir))
- if kind == 'jit':
- kind = ''
- else:
- kind = '-' + kind
- topdirname = 'pypy-%s-%s%s' % (release, platform, kind)
- os.system('mv %s %s' % (str(tmpdir.join(dirname)),
- str(tmpdir.join(topdirname))))
- if PAUSE:
- print 'Pausing, press Enter...'
- raw_input()
- name = '%s.tar.bz2' % topdirname
- print "Building %s" % name
- t = tarfile.open(name, 'w:bz2')
- t.add(topdirname)
- alltars.append(name)
- t.close()
- shutil.rmtree(str(tmpdir.join(topdirname)))
- for name in alltars:
- print "Uploading %s" % name
- os.system('scp %s codespeak.net:/www/pypy.org/htdocs/download' %
name)
- finally:
- os.chdir(olddir)
-
-if __name__ == '__main__':
- if len(sys.argv) != 3:
- print __doc__
- sys.exit(1)
- main(sys.argv[1], release=sys.argv[2])
-
diff --git a/pypy/tool/release/package.py b/pypy/tool/release/package.py
--- a/pypy/tool/release/package.py
+++ b/pypy/tool/release/package.py
@@ -122,7 +122,7 @@
try:
os.chdir(str(builddir))
#
- # 'strip' fun: see https://codespeak.net/issue/pypy-dev/issue587
+ # 'strip' fun: see issue #587
for source, target in binaries:
if sys.platform == 'win32':
pass
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit