Commits

Armin Rigo  committed cbb1b76 Merge

hg merge default

  • Participants
  • Parent commits 6a1b904, 1c7011a
  • Branches remove-globals-in-jit

Comments (0)

Files changed (12)

     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

File lib-python/2.7/sre_parse.py

 
 from sre_constants import *
 
+try:
+    from __pypy__ import newdict
+except ImportError:
+    def newdict(tp):
+        return {}
+
 SPECIAL_CHARS = ".\\[{()*+?^$|"
 REPEAT_CHARS = "*+?{"
 
         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

File pypy/doc/index.rst

 .. _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

File pypy/jit/backend/arm/test/test_loop_unroll.py

 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

File pypy/jit/codewriter/call.py

             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:
         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)

File pypy/jit/metainterp/test/test_ajit.py

             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

File pypy/module/README.txt

 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" 

File pypy/module/_sre/interp_sre.py

     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
 # 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

File pypy/module/sys/app.py

     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.

File pypy/tool/option.py

 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()

File pypy/tool/release/make_release.py

-#!/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])
-    

File pypy/tool/release/package.py

     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