[pypy-commit] pypy value-profiling: merge default
cfbolz
noreply at buildbot.pypy.org
Wed Sep 16 18:58:44 CEST 2015
Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: value-profiling
Changeset: r79659:eac19bbcfe06
Date: 2015-09-16 18:58 +0200
http://bitbucket.org/pypy/pypy/changeset/eac19bbcfe06/
Log: merge default
diff too long, truncating to 2000 out of 51112 lines
diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -15,3 +15,4 @@
e03971291f3a0729ecd3ee7fae7ddb0bb82d476c release-2.6.0
e03971291f3a0729ecd3ee7fae7ddb0bb82d476c release-2.6.0
295ee98b69288471b0fcf2e0ede82ce5209eb90b release-2.6.0
+f3ad1e1e1d6215e20d34bb65ab85ff9188c9f559 release-2.6.1
diff --git a/LICENSE b/LICENSE
--- a/LICENSE
+++ b/LICENSE
@@ -168,7 +168,6 @@
Michael Twomey
Lucian Branescu Mihaila
Yichao Yu
- Anton Gulenko
Gabriel Lavoie
Olivier Dormond
Jared Grubb
@@ -215,6 +214,7 @@
Carl Meyer
Karl Ramm
Pieter Zieschang
+ Anton Gulenko
Gabriel
Lukas Vacek
Andrew Dalke
@@ -247,6 +247,7 @@
Toni Mattis
Lucas Stadler
Julian Berman
+ Markus Holtermann
roberto at goyle
Yury V. Zaytsev
Anna Katrina Dominguez
@@ -352,8 +353,7 @@
Except when otherwise stated (look for LICENSE files or copyright/license
information at the beginning of each file) the files in the 'lib-python/2.7'
directory are all copyrighted by the Python Software Foundation and licensed
-under the Python Software License of which you can find a copy here:
-http://www.python.org/doc/Copyright.html
+under the terms that you can find here: https://docs.python.org/2/license.html
License for 'pypy/module/unicodedata/'
======================================
@@ -430,9 +430,9 @@
gdbm module, provided in the file lib_pypy/gdbm.py, is redistributed
under the terms of the GPL license as well.
-License for 'pypy/module/_vmprof/src'
+License for 'rpython/rlib/rvmprof/src'
--------------------------------------
The code is based on gperftools. You may see a copy of the License for it at
- https://code.google.com/p/gperftools/source/browse/COPYING
+ https://github.com/gperftools/gperftools/blob/master/COPYING
diff --git a/lib-python/conftest.py b/lib-python/conftest.py
--- a/lib-python/conftest.py
+++ b/lib-python/conftest.py
@@ -303,7 +303,7 @@
RegrTest('test_memoryio.py'),
RegrTest('test_memoryview.py'),
RegrTest('test_md5.py'),
- RegrTest('test_mhlib.py'),
+ RegrTest('test_mhlib.py', usemodules='binascii struct'),
RegrTest('test_mimetools.py'),
RegrTest('test_mimetypes.py'),
RegrTest('test_MimeWriter.py', core=False, usemodules='binascii'),
diff --git a/lib_pypy/_curses.py b/lib_pypy/_curses.py
--- a/lib_pypy/_curses.py
+++ b/lib_pypy/_curses.py
@@ -1026,16 +1026,22 @@
def tigetflag(capname):
_ensure_initialised_setupterm()
+ if isinstance(capname, unicode):
+ capname = capname.encode('ascii')
return lib.tigetflag(capname)
def tigetnum(capname):
_ensure_initialised_setupterm()
+ if isinstance(capname, unicode):
+ capname = capname.encode('ascii')
return lib.tigetnum(capname)
def tigetstr(capname):
_ensure_initialised_setupterm()
+ if isinstance(capname, unicode):
+ capname = capname.encode('ascii')
val = lib.tigetstr(capname)
if int(ffi.cast("intptr_t", val)) in (0, -1):
return None
diff --git a/lib_pypy/cffi.egg-info/PKG-INFO b/lib_pypy/cffi.egg-info/PKG-INFO
--- a/lib_pypy/cffi.egg-info/PKG-INFO
+++ b/lib_pypy/cffi.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: cffi
-Version: 1.2.0
+Version: 1.3.0
Summary: Foreign Function Interface for Python calling C code.
Home-page: http://cffi.readthedocs.org
Author: Armin Rigo, Maciej Fijalkowski
diff --git a/lib_pypy/cffi/__init__.py b/lib_pypy/cffi/__init__.py
--- a/lib_pypy/cffi/__init__.py
+++ b/lib_pypy/cffi/__init__.py
@@ -4,8 +4,8 @@
from .api import FFI, CDefError, FFIError
from .ffiplatform import VerificationError, VerificationMissing
-__version__ = "1.2.0"
-__version_info__ = (1, 2, 0)
+__version__ = "1.3.0"
+__version_info__ = (1, 3, 0)
# The verifier module file names are based on the CRC32 of a string that
# contains the following version number. It may be older than __version__
diff --git a/lib_pypy/cffi/_cffi_include.h b/lib_pypy/cffi/_cffi_include.h
--- a/lib_pypy/cffi/_cffi_include.h
+++ b/lib_pypy/cffi/_cffi_include.h
@@ -46,7 +46,7 @@
# endif
#else
# include <stdint.h>
-# if (defined (__SVR4) && defined (__sun)) || defined(_AIX)
+# if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux)
# include <alloca.h>
# endif
#endif
@@ -214,6 +214,12 @@
(size) == 8 ? ((sign) ? _CFFI_PRIM_INT64 : _CFFI_PRIM_UINT64) : \
_CFFI__UNKNOWN_PRIM)
+#define _cffi_prim_float(size) \
+ ((size) == sizeof(float) ? _CFFI_PRIM_FLOAT : \
+ (size) == sizeof(double) ? _CFFI_PRIM_DOUBLE : \
+ (size) == sizeof(long double) ? _CFFI__UNKNOWN_LONG_DOUBLE : \
+ _CFFI__UNKNOWN_FLOAT_PRIM)
+
#define _cffi_check_int(got, got_nonpos, expected) \
((got_nonpos) == (expected <= 0) && \
(got) == (unsigned long long)expected)
diff --git a/lib_pypy/cffi/cffi_opcode.py b/lib_pypy/cffi/cffi_opcode.py
--- a/lib_pypy/cffi/cffi_opcode.py
+++ b/lib_pypy/cffi/cffi_opcode.py
@@ -106,7 +106,9 @@
PRIM_UINTMAX = 47
_NUM_PRIM = 48
-_UNKNOWN_PRIM = -1
+_UNKNOWN_PRIM = -1
+_UNKNOWN_FLOAT_PRIM = -2
+_UNKNOWN_LONG_DOUBLE = -3
PRIMITIVE_TO_INDEX = {
'char': PRIM_CHAR,
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
@@ -15,9 +15,11 @@
except ImportError:
lock = None
-_r_comment = re.compile(r"/\*.*?\*/|//.*?$", re.DOTALL | re.MULTILINE)
-_r_define = re.compile(r"^\s*#\s*define\s+([A-Za-z_][A-Za-z_0-9]*)\s+(.*?)$",
- re.MULTILINE)
+_r_comment = re.compile(r"/\*.*?\*/|//([^\n\\]|\\.)*?$",
+ re.DOTALL | re.MULTILINE)
+_r_define = re.compile(r"^\s*#\s*define\s+([A-Za-z_][A-Za-z_0-9]*)"
+ r"\b((?:[^\n\\]|\\.)*?)$",
+ re.DOTALL | re.MULTILINE)
_r_partial_enum = re.compile(r"=\s*\.\.\.\s*[,}]|\.\.\.\s*\}")
_r_enum_dotdotdot = re.compile(r"__dotdotdot\d+__$")
_r_partial_array = re.compile(r"\[\s*\.\.\.\s*\]")
@@ -39,6 +41,7 @@
macros = {}
for match in _r_define.finditer(csource):
macroname, macrovalue = match.groups()
+ macrovalue = macrovalue.replace('\\\n', '').strip()
macros[macroname] = macrovalue
csource = _r_define.sub('', csource)
# Replace "[...]" with "[__dotdotdotarray__]"
@@ -423,13 +426,10 @@
raise api.CDefError(
"%s: a function with only '(...)' as argument"
" is not correct C" % (funcname or 'in expression'))
- elif (len(params) == 1 and
- isinstance(params[0].type, pycparser.c_ast.TypeDecl) and
- isinstance(params[0].type.type, pycparser.c_ast.IdentifierType)
- and list(params[0].type.type.names) == ['void']):
- del params[0]
args = [self._as_func_arg(self._get_type(argdeclnode.type))
for argdeclnode in params]
+ if not ellipsis and args == [model.void_type]:
+ args = []
result = self._get_type(typenode.type)
return model.RawFunctionType(tuple(args), result, ellipsis)
@@ -648,10 +648,21 @@
assert typenames[-1] == '__dotdotdot__'
if len(typenames) == 1:
return model.unknown_type(decl.name)
- for t in typenames[:-1]:
- if t not in ['int', 'short', 'long', 'signed', 'unsigned', 'char']:
- raise api.FFIError(':%d: bad usage of "..."' % decl.coord.line)
+
+ if (typenames[:-1] == ['float'] or
+ typenames[:-1] == ['double']):
+ # not for 'long double' so far
+ result = model.UnknownFloatType(decl.name)
+ else:
+ for t in typenames[:-1]:
+ if t not in ['int', 'short', 'long', 'signed',
+ 'unsigned', 'char']:
+ raise api.FFIError(':%d: bad usage of "..."' %
+ decl.coord.line)
+ result = model.UnknownIntegerType(decl.name)
+
if self._uses_new_feature is None:
self._uses_new_feature = "'typedef %s... %s'" % (
' '.join(typenames[:-1]), decl.name)
- return model.UnknownIntegerType(decl.name)
+
+ return result
diff --git a/lib_pypy/cffi/model.py b/lib_pypy/cffi/model.py
--- a/lib_pypy/cffi/model.py
+++ b/lib_pypy/cffi/model.py
@@ -158,12 +158,23 @@
self.c_name_with_marker = name + '&'
def is_integer_type(self):
- return True # for now
+ return True
def build_backend_type(self, ffi, finishlist):
raise NotImplementedError("integer type '%s' can only be used after "
"compilation" % self.name)
+class UnknownFloatType(BasePrimitiveType):
+ _attrs_ = ('name', )
+
+ def __init__(self, name):
+ self.name = name
+ self.c_name_with_marker = name + '&'
+
+ def build_backend_type(self, ffi, finishlist):
+ raise NotImplementedError("float type '%s' can only be used after "
+ "compilation" % self.name)
+
class BaseFunctionType(BaseType):
_attrs_ = ('args', 'result', 'ellipsis')
diff --git a/lib_pypy/cffi/parse_c_type.h b/lib_pypy/cffi/parse_c_type.h
--- a/lib_pypy/cffi/parse_c_type.h
+++ b/lib_pypy/cffi/parse_c_type.h
@@ -79,7 +79,9 @@
#define _CFFI_PRIM_UINTMAX 47
#define _CFFI__NUM_PRIM 48
-#define _CFFI__UNKNOWN_PRIM (-1)
+#define _CFFI__UNKNOWN_PRIM (-1)
+#define _CFFI__UNKNOWN_FLOAT_PRIM (-2)
+#define _CFFI__UNKNOWN_LONG_DOUBLE (-3)
struct _cffi_global_s {
diff --git a/lib_pypy/cffi/recompiler.py b/lib_pypy/cffi/recompiler.py
--- a/lib_pypy/cffi/recompiler.py
+++ b/lib_pypy/cffi/recompiler.py
@@ -4,11 +4,6 @@
VERSION = "0x2601"
-try:
- int_type = (int, long)
-except NameError: # Python 3
- int_type = int
-
class GlobalExpr:
def __init__(self, name, address, type_op, size=0, check_value=0):
@@ -473,6 +468,10 @@
if tp.is_integer_type() and tp.name != '_Bool':
converter = '_cffi_to_c_int'
extraarg = ', %s' % tp.name
+ elif isinstance(tp, model.UnknownFloatType):
+ # don't check with is_float_type(): it may be a 'long
+ # double' here, and _cffi_to_c_double would loose precision
+ converter = '(%s)_cffi_to_c_double' % (tp.get_c_name(''),)
else:
converter = '(%s)_cffi_to_c_%s' % (tp.get_c_name(''),
tp.name.replace(' ', '_'))
@@ -527,6 +526,8 @@
if isinstance(tp, model.BasePrimitiveType):
if tp.is_integer_type():
return '_cffi_from_c_int(%s, %s)' % (var, tp.name)
+ elif isinstance(tp, model.UnknownFloatType):
+ return '_cffi_from_c_double(%s)' % (var,)
elif tp.name != 'long double':
return '_cffi_from_c_%s(%s)' % (tp.name.replace(' ', '_'), var)
else:
@@ -1112,6 +1113,12 @@
' ) <= 0)' % (tp.name, tp.name, tp.name))
self.cffi_types[index] = CffiOp(OP_PRIMITIVE, s)
+ def _emit_bytecode_UnknownFloatType(self, tp, index):
+ s = ('_cffi_prim_float(sizeof(%s) *\n'
+ ' (((%s)1) / 2) * 2 /* integer => 0, float => 1 */\n'
+ ' )' % (tp.name, tp.name))
+ self.cffi_types[index] = CffiOp(OP_PRIMITIVE, s)
+
def _emit_bytecode_RawFunctionType(self, tp, index):
self.cffi_types[index] = CffiOp(OP_FUNCTION, self._typesdict[tp.result])
index += 1
diff --git a/lib_pypy/cffi/setuptools_ext.py b/lib_pypy/cffi/setuptools_ext.py
--- a/lib_pypy/cffi/setuptools_ext.py
+++ b/lib_pypy/cffi/setuptools_ext.py
@@ -81,10 +81,16 @@
allsources.extend(kwds.pop('sources', []))
ext = Extension(name=module_name, sources=allsources, **kwds)
- def make_mod(tmpdir):
+ def make_mod(tmpdir, pre_run=None):
c_file = os.path.join(tmpdir, module_name + source_extension)
log.info("generating cffi module %r" % c_file)
mkpath(tmpdir)
+ # a setuptools-only, API-only hook: called with the "ext" and "ffi"
+ # arguments just before we turn the ffi into C code. To use it,
+ # subclass the 'distutils.command.build_ext.build_ext' class and
+ # add a method 'def pre_run(self, ext, ffi)'.
+ if pre_run is not None:
+ pre_run(ext, ffi)
updated = recompiler.make_c_source(ffi, module_name, source, c_file)
if not updated:
log.info("already up-to-date")
@@ -98,7 +104,8 @@
class build_ext_make_mod(base_class):
def run(self):
if ext.sources[0] == '$PLACEHOLDER':
- ext.sources[0] = make_mod(self.build_temp)
+ pre_run = getattr(self, 'pre_run', None)
+ ext.sources[0] = make_mod(self.build_temp, pre_run)
base_class.run(self)
dist.cmdclass['build_ext'] = build_ext_make_mod
# NB. multiple runs here will create multiple 'build_ext_make_mod'
diff --git a/lib_pypy/ctypes_support.py b/lib_pypy/ctypes_support.py
--- a/lib_pypy/ctypes_support.py
+++ b/lib_pypy/ctypes_support.py
@@ -28,7 +28,7 @@
def _where_is_errno():
return standard_c_lib.__errno_location()
-elif sys.platform in ('darwin', 'freebsd7', 'freebsd8', 'freebsd9'):
+elif sys.platform == 'darwin' or sys.platform.startswith('freebsd'):
standard_c_lib.__error.restype = ctypes.POINTER(ctypes.c_int)
standard_c_lib.__error.argtypes = None
def _where_is_errno():
diff --git a/lib_pypy/greenlet.egg-info b/lib_pypy/greenlet.egg-info
--- a/lib_pypy/greenlet.egg-info
+++ b/lib_pypy/greenlet.egg-info
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: greenlet
-Version: 0.4.7
+Version: 0.4.9
Summary: Lightweight in-process concurrent programming
Home-page: https://github.com/python-greenlet/greenlet
Author: Ralf Schmitt (for CPython), PyPy team
diff --git a/lib_pypy/greenlet.py b/lib_pypy/greenlet.py
--- a/lib_pypy/greenlet.py
+++ b/lib_pypy/greenlet.py
@@ -1,7 +1,7 @@
import sys
import _continuation
-__version__ = "0.4.7"
+__version__ = "0.4.9"
# ____________________________________________________________
# Exceptions
diff --git a/pypy/config/pypyoption.py b/pypy/config/pypyoption.py
--- a/pypy/config/pypyoption.py
+++ b/pypy/config/pypyoption.py
@@ -39,7 +39,8 @@
"_csv", "cppyy", "_pypyjson"
])
-if sys.platform.startswith('linux') and os.uname()[4] == 'x86_64':
+if (sys.platform.startswith('linux') and os.uname()[4] == 'x86_64'
+ and sys.maxint > 2**32): # it's not enough that we get x86_64
working_modules.add('_vmprof')
translation_modules = default_modules.copy()
diff --git a/pypy/doc/conf.py b/pypy/doc/conf.py
--- a/pypy/doc/conf.py
+++ b/pypy/doc/conf.py
@@ -67,7 +67,7 @@
# The short X.Y version.
version = '2.6'
# The full version, including alpha/beta/rc tags.
-release = '2.6.0'
+release = '2.6.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/pypy/doc/contributor.rst b/pypy/doc/contributor.rst
--- a/pypy/doc/contributor.rst
+++ b/pypy/doc/contributor.rst
@@ -32,6 +32,7 @@
Lukas Diekmann
Sven Hager
Anders Lehmann
+ Richard Plangger
Aurelien Campeas
Remi Meier
Niklaus Haldimann
@@ -57,7 +58,6 @@
Ludovic Aubry
Jacob Hallen
Jason Creighton
- Richard Plangger
Alex Martelli
Michal Bendowski
stian
@@ -138,7 +138,6 @@
Michael Twomey
Lucian Branescu Mihaila
Yichao Yu
- Anton Gulenko
Gabriel Lavoie
Olivier Dormond
Jared Grubb
@@ -185,6 +184,7 @@
Carl Meyer
Karl Ramm
Pieter Zieschang
+ Anton Gulenko
Gabriel
Lukas Vacek
Andrew Dalke
@@ -217,6 +217,7 @@
Toni Mattis
Lucas Stadler
Julian Berman
+ Markus Holtermann
roberto at goyle
Yury V. Zaytsev
Anna Katrina Dominguez
@@ -252,6 +253,7 @@
shoma hosaka
Daniel Neuhäuser
Ben Mather
+ Niclas Olofsson
halgari
Boglarka Vezer
Chris Pressey
diff --git a/pypy/doc/embedding.rst b/pypy/doc/embedding.rst
--- a/pypy/doc/embedding.rst
+++ b/pypy/doc/embedding.rst
@@ -20,10 +20,6 @@
It initializes the RPython/PyPy GC and does a bunch of necessary startup
code. This function cannot fail.
-.. function:: void pypy_init_threads(void);
-
- Initialize threads. Only need to be called if there are any threads involved
-
.. function:: int pypy_setup_home(char* home, int verbose);
This function searches the PyPy standard library starting from the given
@@ -38,6 +34,11 @@
Function returns 0 on success or -1 on failure, can be called multiple times
until the library is found.
+.. function:: void pypy_init_threads(void);
+
+ Initialize threads. Only need to be called if there are any threads involved.
+ *Must be called after pypy_setup_home()*
+
.. function:: int pypy_execute_source(char* source);
Execute the Python source code given in the ``source`` argument. In case of
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
@@ -31,15 +31,14 @@
and add the new file to pypy/doc/index-of-whatsnew.rst
* go to pypy/tool/release and run
``force-builds.py <release branch>``
- The following binaries should be built, however, we need more buildbots
- - JIT: windows, linux, os/x, armhf, armel
- - no JIT: windows, linux, os/x
- - sandbox: linux, os/x
+ The following JIT binaries should be built, however, we need more buildbots
+ windows, linux-32, linux-64, osx64, armhf-raring, armhf-raspberrian, armel,
+ freebsd64
* wait for builds to complete, make sure there are no failures
* download the builds, repackage binaries. Tag the release version
and download and repackage source from bitbucket. You may find it
- convenient to use the ``repackage.sh`` script in pypy/tools to do this.
+ convenient to use the ``repackage.sh`` script in pypy/tool/release to do this.
Otherwise repackage and upload source "-src.tar.bz2" to bitbucket
and to cobra, as some packagers prefer a clearly labeled source package
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-2.6.1.rst
release-2.6.0.rst
release-2.5.1.rst
release-2.5.0.rst
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-2.6.1.rst
whatsnew-2.6.0.rst
whatsnew-2.5.1.rst
whatsnew-2.5.0.rst
diff --git a/pypy/doc/release-2.6.1.rst b/pypy/doc/release-2.6.1.rst
new file mode 100644
--- /dev/null
+++ b/pypy/doc/release-2.6.1.rst
@@ -0,0 +1,129 @@
+==========
+PyPy 2.6.1
+==========
+
+We're pleased to announce PyPy 2.6.1, an update to PyPy 2.6.0 released June 1.
+We have updated stdlib to 2.7.10, `cffi`_ to version 1.3, extended support for
+the new vmprof_ statistical profiler for multiple threads, and increased
+functionality of numpy.
+
+You can download the PyPy 2.6.1 release here:
+
+ http://pypy.org/download.html
+
+We would like to thank our donors for the continued support of the PyPy
+project, and our volunteers and contributors.
+
+.. _`cffi`: https://cffi.readthedocs.org
+
+We would also like to 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.
+
+.. _`PyPy`: http://doc.pypy.org
+.. _`RPython`: https://rpython.readthedocs.org
+.. _`modules`: http://doc.pypy.org/en/latest/project-ideas.html#make-more-python-modules-pypy-friendly
+.. _`help`: http://doc.pypy.org/en/latest/project-ideas.html
+
+What is PyPy?
+=============
+
+PyPy is a very compliant Python interpreter, almost a drop-in replacement for
+CPython 2.7. It's fast (`pypy and cpython 2.7.x`_ performance comparison)
+due to its integrated tracing JIT compiler.
+
+This release supports **x86** machines on most common operating systems
+(Linux 32/64, Mac OS X 64, Windows 32, OpenBSD_, freebsd_),
+as well as newer **ARM** hardware (ARMv6 or ARMv7, with VFPv3) running Linux.
+
+We also welcome developers of other
+`dynamic languages`_ to see what RPython can do for them.
+
+.. _`pypy and cpython 2.7.x`: http://speed.pypy.org
+.. _OpenBSD: http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/lang/pypy
+.. _freebsd: https://svnweb.freebsd.org/ports/head/lang/pypy/
+.. _`dynamic languages`: http://pypyjs.org
+
+Highlights
+===========
+
+* Bug Fixes
+
+ * Revive non-SSE2 support
+
+ * Fixes for detaching _io.Buffer*
+
+ * On Windows, close (and flush) all open sockets on exiting
+
+ * Drop support for ancient macOS v10.4 and before
+
+ * Clear up contention in the garbage collector between trace-me-later and pinning
+
+ * Issues reported with our previous release were resolved_ after reports from users on
+ our issue tracker at https://bitbucket.org/pypy/pypy/issues or on IRC at
+ #pypy.
+
+* New features:
+
+ * cffi was updated to version 1.3
+
+ * The python stdlib was updated to 2.7.10 from 2.7.9
+
+ * vmprof now supports multiple threads and OS X
+
+ * The translation process builds cffi import libraries for some stdlib
+ packages, which should prevent confusion when package.py is not used
+
+ * better support for gdb debugging
+
+ * freebsd should be able to translate PyPy "out of the box" with no patches
+
+* Numpy:
+
+ * Better support for record dtypes, including the ``align`` keyword
+
+ * Implement casting and create output arrays accordingly (still missing some corner cases)
+
+ * Support creation of unicode ndarrays
+
+ * Better support ndarray.flags
+
+ * Support ``axis`` argument in more functions
+
+ * Refactor array indexing to support ellipses
+
+ * Allow the docstrings of built-in numpy objects to be set at run-time
+
+ * Support the ``buffered`` nditer creation keyword
+
+* Performance improvements:
+
+ * Delay recursive calls to make them non-recursive
+
+ * Skip loop unrolling if it compiles too much code
+
+ * Tweak the heapcache
+
+ * Add a list strategy for lists that store both floats and 32-bit integers.
+ The latter are encoded as nonstandard NaNs. Benchmarks show that the speed
+ of such lists is now very close to the speed of purely-int or purely-float
+ lists.
+
+ * Simplify implementation of ffi.gc() to avoid most weakrefs
+
+ * Massively improve the performance of map() with more than
+ one sequence argument
+
+.. _`vmprof`: https://vmprof.readthedocs.org
+.. _resolved: http://doc.pypy.org/en/latest/whatsnew-2.6.1.html
+
+Please try it out and let us know what you think. We welcome
+success stories, `experiments`_, or `benchmarks`_, we know you are using PyPy, please tell us about it!
+
+Cheers
+
+The PyPy Team
+
+.. _`experiments`: https://morepypy.blogspot.com/2015/02/experiments-in-pyrlang-with-rpython.html
+.. _`benchmarks`: https://mithrandi.net/blog/2015/03/axiom-benchmark-results-on-pypy-2-5-0
diff --git a/pypy/doc/whatsnew-2.6.1.rst b/pypy/doc/whatsnew-2.6.1.rst
new file mode 100644
--- /dev/null
+++ b/pypy/doc/whatsnew-2.6.1.rst
@@ -0,0 +1,76 @@
+========================
+What's new in PyPy 2.6.1
+========================
+
+.. this is a revision shortly after release-2.6.0
+.. startrev: 91904d5c5188
+
+.. branch: use_min_scalar
+Correctly resolve the output dtype of ufunc(array, scalar) calls.
+
+.. branch: stdlib-2.7.10
+
+Update stdlib to version 2.7.10
+
+.. branch: issue2062
+
+.. branch: disable-unroll-for-short-loops
+The JIT no longer performs loop unrolling if the loop compiles to too much code.
+
+.. branch: run-create_cffi_imports
+
+Build cffi import libraries as part of translation by monkey-patching an
+additional task into translation
+
+.. branch: int-float-list-strategy
+
+Use a compact strategy for Python lists that mix integers and floats,
+at least if the integers fit inside 32 bits. These lists are now
+stored as an array of floats, like lists that contain only floats; the
+difference is that integers are stored as tagged NaNs. (This should
+have no visible effect! After ``lst = [42, 42.5]``, the value of
+``lst[0]`` is still *not* the float ``42.0`` but the integer ``42``.)
+
+.. branch: cffi-callback-onerror
+Part of cffi 1.2.
+
+.. branch: cffi-new-allocator
+Part of cffi 1.2.
+
+.. branch: unicode-dtype
+
+Partial implementation of unicode dtype and unicode scalars.
+
+.. branch: dtypes-compatability
+
+Improve compatibility with numpy dtypes; handle offsets to create unions,
+fix str() and repr(), allow specifying itemsize, metadata and titles, add flags,
+allow subclassing dtype
+
+.. branch: indexing
+
+Refactor array indexing to support ellipses.
+
+.. branch: numpy-docstrings
+
+Allow the docstrings of built-in numpy objects to be set at run-time.
+
+.. branch: nditer-revisited
+
+Implement nditer 'buffered' flag and fix some edge cases
+
+.. branch: ufunc-reduce
+
+Allow multiple axes in ufunc.reduce()
+
+.. branch: fix-tinylang-goals
+
+Update tinylang goals to match current rpython
+
+.. branch: vmprof-review
+
+Clean up of vmprof, notably to handle correctly multiple threads
+
+.. branch: no_boehm_dl
+
+Remove extra link library from Boehm GC
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
@@ -2,68 +2,22 @@
What's new in PyPy 2.6+
=======================
-.. this is a revision shortly after release-2.6.0
-.. startrev: 91904d5c5188
+.. this is a revision shortly after release-2.6.1
+.. startrev: 07769be4057b
-.. branch: use_min_scalar
-Correctly resolve the output dtype of ufunc(array, scalar) calls.
+.. branch: keys_with_hash
+Improve the performance of dict.update() and a bunch of methods from
+sets, by reusing the hash value stored in one dict when inspecting
+or changing another dict with that key.
-.. branch: stdlib-2.7.10
+.. branch: optresult-unroll
+A major refactoring of the ResOperations that kills Box. Also rewrote
+unrolling to enable future enhancements. Should improve warmup time
+by 20% or so.
-Update stdlib to version 2.7.10
+.. branch: optimize-cond-call
+Optimize common sequences of operations like
+``int_lt/cond_call`` in the JIT backends
-.. branch: issue2062
-
-.. branch: disable-unroll-for-short-loops
-The JIT no longer performs loop unrolling if the loop compiles to too much code.
-
-.. branch: run-create_cffi_imports
-
-Build cffi import libraries as part of translation by monkey-patching an
-additional task into translation
-
-.. branch: int-float-list-strategy
-
-Use a compact strategy for Python lists that mix integers and floats,
-at least if the integers fit inside 32 bits. These lists are now
-stored as an array of floats, like lists that contain only floats; the
-difference is that integers are stored as tagged NaNs. (This should
-have no visible effect! After ``lst = [42, 42.5]``, the value of
-``lst[0]`` is still *not* the float ``42.0`` but the integer ``42``.)
-
-.. branch: cffi-callback-onerror
-.. branch: cffi-new-allocator
-
-.. branch: unicode-dtype
-
-Partial implementation of unicode dtype and unicode scalars.
-
-.. branch: dtypes-compatability
-
-Improve compatibility with numpy dtypes; handle offsets to create unions,
-fix str() and repr(), allow specifying itemsize, metadata and titles, add flags,
-allow subclassing dtype
-
-.. branch: indexing
-
-Refactor array indexing to support ellipses.
-
-.. branch: numpy-docstrings
-
-Allow the docstrings of built-in numpy objects to be set at run-time.
-
-.. branch: nditer-revisited
-
-Implement nditer 'buffered' flag and fix some edge cases
-
-.. branch: ufunc-reduce
-
-Allow multiple axes in ufunc.reduce()
-
-.. branch: fix-tinylang-goals
-
-Update tinylang goals to match current rpython
-
-.. branch: vmprof-review
-
-Clean up of vmprof, notably to handle correctly multiple threads
+.. branch: missing_openssl_include
+Fix for missing headers in OpenBSD, already applied in downstream ports
diff --git a/pypy/goal/targetpypystandalone.py b/pypy/goal/targetpypystandalone.py
--- a/pypy/goal/targetpypystandalone.py
+++ b/pypy/goal/targetpypystandalone.py
@@ -341,8 +341,8 @@
def jitpolicy(self, driver):
from pypy.module.pypyjit.policy import PyPyJitPolicy
- from pypy.module.pypyjit.hooks import pypy_hooks
- return PyPyJitPolicy(pypy_hooks)
+ #from pypy.module.pypyjit.hooks import pypy_hooks
+ return PyPyJitPolicy()#pypy_hooks)
def get_entry_point(self, config):
from pypy.tool.lib_pypy import import_from_lib_pypy
diff --git a/pypy/interpreter/miscutils.py b/pypy/interpreter/miscutils.py
--- a/pypy/interpreter/miscutils.py
+++ b/pypy/interpreter/miscutils.py
@@ -9,6 +9,7 @@
implementation for this feature, and patches 'space.threadlocals' when
'thread' is initialized.
"""
+ _immutable_fields_ = ['_value?']
_value = None
def get_ec(self):
diff --git a/pypy/module/__pypy__/__init__.py b/pypy/module/__pypy__/__init__.py
--- a/pypy/module/__pypy__/__init__.py
+++ b/pypy/module/__pypy__/__init__.py
@@ -111,7 +111,6 @@
'interp_magic.mapdict_cache_counter')
PYC_MAGIC = get_pyc_magic(self.space)
self.extra_interpdef('PYC_MAGIC', 'space.wrap(%d)' % PYC_MAGIC)
- #
try:
from rpython.jit.backend import detect_cpu
model = detect_cpu.autodetect()
@@ -121,7 +120,7 @@
raise
else:
pass # ok fine to ignore in this case
- #
+
if self.space.config.translation.jit:
features = detect_cpu.getcpufeatures(model)
self.extra_interpdef('jit_backend_features',
diff --git a/pypy/module/_cffi_backend/__init__.py b/pypy/module/_cffi_backend/__init__.py
--- a/pypy/module/_cffi_backend/__init__.py
+++ b/pypy/module/_cffi_backend/__init__.py
@@ -2,7 +2,7 @@
from pypy.interpreter.mixedmodule import MixedModule
from rpython.rlib import rdynload
-VERSION = "1.2.0"
+VERSION = "1.3.0"
class Module(MixedModule):
diff --git a/pypy/module/_cffi_backend/ccallback.py b/pypy/module/_cffi_backend/ccallback.py
--- a/pypy/module/_cffi_backend/ccallback.py
+++ b/pypy/module/_cffi_backend/ccallback.py
@@ -19,13 +19,27 @@
# ____________________________________________________________
+class Closure(object):
+ """This small class is here to have a __del__ outside any cycle."""
+
+ ll_error = lltype.nullptr(rffi.CCHARP.TO) # set manually
+
+ def __init__(self, ptr):
+ self.ptr = ptr
+
+ def __del__(self):
+ clibffi.closureHeap.free(rffi.cast(clibffi.FFI_CLOSUREP, self.ptr))
+ if self.ll_error:
+ lltype.free(self.ll_error, flavor='raw')
+
+
class W_CDataCallback(W_CData):
#_immutable_fields_ = ...
- ll_error = lltype.nullptr(rffi.CCHARP.TO)
w_onerror = None
def __init__(self, space, ctype, w_callable, w_error, w_onerror):
raw_closure = rffi.cast(rffi.CCHARP, clibffi.closureHeap.alloc())
+ self._closure = Closure(raw_closure)
W_CData.__init__(self, space, raw_closure, ctype)
#
if not space.is_true(space.callable(w_callable)):
@@ -44,10 +58,11 @@
if size > 0:
if fresult.is_primitive_integer and size < SIZE_OF_FFI_ARG:
size = SIZE_OF_FFI_ARG
- self.ll_error = lltype.malloc(rffi.CCHARP.TO, size, flavor='raw',
- zero=True)
+ self._closure.ll_error = lltype.malloc(rffi.CCHARP.TO, size,
+ flavor='raw', zero=True)
if not space.is_none(w_error):
- convert_from_object_fficallback(fresult, self.ll_error, w_error)
+ convert_from_object_fficallback(fresult, self._closure.ll_error,
+ w_error)
#
self.unique_id = compute_unique_id(self)
global_callback_mapping.set(self.unique_id, self)
@@ -74,12 +89,6 @@
from pypy.module.thread.os_thread import setup_threads
setup_threads(space)
- #@rgc.must_be_light_finalizer
- def __del__(self):
- clibffi.closureHeap.free(rffi.cast(clibffi.FFI_CLOSUREP, self._ptr))
- if self.ll_error:
- lltype.free(self.ll_error, flavor='raw')
-
def _repr_extra(self):
space = self.space
return 'calling ' + space.str_w(space.repr(self.w_callable))
@@ -114,8 +123,8 @@
def write_error_return_value(self, ll_res):
fresult = self.getfunctype().ctitem
if fresult.size > 0:
- misc._raw_memcopy(self.ll_error, ll_res, fresult.size)
- keepalive_until_here(self) # to keep self.ll_error alive
+ misc._raw_memcopy(self._closure.ll_error, ll_res, fresult.size)
+ keepalive_until_here(self) # to keep self._closure.ll_error alive
global_callback_mapping = rweakref.RWeakValueDictionary(int, W_CDataCallback)
diff --git a/pypy/module/_cffi_backend/cffi_opcode.py b/pypy/module/_cffi_backend/cffi_opcode.py
--- a/pypy/module/_cffi_backend/cffi_opcode.py
+++ b/pypy/module/_cffi_backend/cffi_opcode.py
@@ -9,16 +9,16 @@
assert isinstance(self.arg, str)
return '(_cffi_opcode_t)(%s)' % (self.arg,)
classname = CLASS_NAME[self.op]
- return '_CFFI_OP(_CFFI_OP_%s, %d)' % (classname, self.arg)
+ return '_CFFI_OP(_CFFI_OP_%s, %s)' % (classname, self.arg)
def as_python_bytes(self):
- if self.op is None:
- if self.arg.isdigit():
- value = int(self.arg) # non-negative: '-' not in self.arg
- if value >= 2**31:
- raise OverflowError("cannot emit %r: limited to 2**31-1"
- % (self.arg,))
- return format_four_bytes(value)
+ if self.op is None and self.arg.isdigit():
+ value = int(self.arg) # non-negative: '-' not in self.arg
+ if value >= 2**31:
+ raise OverflowError("cannot emit %r: limited to 2**31-1"
+ % (self.arg,))
+ return format_four_bytes(value)
+ if isinstance(self.arg, str):
from .ffiplatform import VerificationError
raise VerificationError("cannot emit to Python: %r" % (self.arg,))
return format_four_bytes((self.arg << 8) | self.op)
@@ -106,7 +106,9 @@
PRIM_UINTMAX = 47
_NUM_PRIM = 48
-_UNKNOWN_PRIM = -1
+_UNKNOWN_PRIM = -1
+_UNKNOWN_FLOAT_PRIM = -2
+_UNKNOWN_LONG_DOUBLE = -3
PRIMITIVE_TO_INDEX = {
'char': PRIM_CHAR,
diff --git a/pypy/module/_cffi_backend/realize_c_type.py b/pypy/module/_cffi_backend/realize_c_type.py
--- a/pypy/module/_cffi_backend/realize_c_type.py
+++ b/pypy/module/_cffi_backend/realize_c_type.py
@@ -81,6 +81,13 @@
if num == cffi_opcode._UNKNOWN_PRIM:
raise oefmt(ffi.w_FFIError, "primitive integer type with an "
"unexpected size (or not an integer type at all)")
+ elif num == cffi_opcode._UNKNOWN_FLOAT_PRIM:
+ raise oefmt(ffi.w_FFIError, "primitive floating-point type with an "
+ "unexpected size (or not a float type at all)")
+ elif num == cffi_opcode._UNKNOWN_LONG_DOUBLE:
+ raise oefmt(ffi.w_FFIError, "primitive floating-point type is "
+ "'long double', not supported for now with "
+ "the syntax 'typedef double... xxx;'")
else:
raise oefmt(space.w_NotImplementedError, "prim=%d", num)
realize_cache = space.fromcache(RealizeCache)
diff --git a/pypy/module/_cffi_backend/test/_backend_test_c.py b/pypy/module/_cffi_backend/test/_backend_test_c.py
--- a/pypy/module/_cffi_backend/test/_backend_test_c.py
+++ b/pypy/module/_cffi_backend/test/_backend_test_c.py
@@ -1,6 +1,9 @@
# ____________________________________________________________
import sys
+assert __version__ == "1.3.0", ("This test_c.py file is for testing a version"
+ " of cffi that differs from the one that we"
+ " get from 'import _cffi_backend'")
if sys.version_info < (3,):
type_or_class = "type"
mandatory_b_prefix = ''
@@ -3424,7 +3427,3 @@
"be 'foo *', but the types are different (check "
"that you are not e.g. mixing up different ffi "
"instances)")
-
-def test_version():
- # this test is here mostly for PyPy
- assert __version__ == "1.2.0"
diff --git a/pypy/module/_multiprocessing/test/test_memory.py b/pypy/module/_multiprocessing/test/test_memory.py
--- a/pypy/module/_multiprocessing/test/test_memory.py
+++ b/pypy/module/_multiprocessing/test/test_memory.py
@@ -1,8 +1,12 @@
+import sys
+
class AppTestMemory:
spaceconfig = dict(usemodules=('_multiprocessing', 'mmap',
'_rawffi', 'itertools',
- 'signal', 'select', 'fcntl',
+ 'signal', 'select',
'binascii'))
+ if sys.platform != 'win32':
+ spaceconfig['usemodules'] += ('fcntl',)
def test_address_of(self):
import _multiprocessing
diff --git a/pypy/module/_multiprocessing/test/test_semaphore.py b/pypy/module/_multiprocessing/test/test_semaphore.py
--- a/pypy/module/_multiprocessing/test/test_semaphore.py
+++ b/pypy/module/_multiprocessing/test/test_semaphore.py
@@ -1,12 +1,19 @@
+import sys
+
from pypy.module._multiprocessing.interp_semaphore import (
RECURSIVE_MUTEX, SEMAPHORE)
class AppTestSemaphore:
spaceconfig = dict(usemodules=('_multiprocessing', 'thread',
- 'signal', 'select', 'fcntl',
+ 'signal', 'select',
'binascii', 'struct'))
+ if sys.platform == 'win32':
+ spaceconfig['usemodules'] += ('_rawffi',)
+ else:
+ spaceconfig['usemodules'] += ('fcntl',)
+
def setup_class(cls):
cls.w_SEMAPHORE = cls.space.wrap(SEMAPHORE)
cls.w_RECURSIVE = cls.space.wrap(RECURSIVE_MUTEX)
diff --git a/pypy/module/cpyext/include/object.h b/pypy/module/cpyext/include/object.h
--- a/pypy/module/cpyext/include/object.h
+++ b/pypy/module/cpyext/include/object.h
@@ -379,6 +379,8 @@
PyObject *ht_name, *ht_slots;
} PyHeapTypeObject;
+#define PyObject_Bytes PyObject_Str
+
/* Flag bits for printing: */
#define Py_PRINT_RAW 1 /* No string quotes etc. */
diff --git a/pypy/module/itertools/interp_itertools.py b/pypy/module/itertools/interp_itertools.py
--- a/pypy/module/itertools/interp_itertools.py
+++ b/pypy/module/itertools/interp_itertools.py
@@ -2,6 +2,7 @@
from pypy.interpreter.error import OperationError
from pypy.interpreter.typedef import TypeDef, make_weakref_descr
from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault
+from rpython.rlib import jit
class W_Count(W_Root):
@@ -322,6 +323,11 @@
""")
+islice_ignore_items_driver = jit.JitDriver(name='islice_ignore_items',
+ greens=['tp'],
+ reds=['num', 'w_islice',
+ 'w_iterator'])
+
class W_ISlice(W_Root):
def __init__(self, space, w_iterable, w_startstop, args_w):
self.iterable = space.iter(w_iterable)
@@ -407,11 +413,18 @@
raise
def _ignore_items(self, num):
- if self.iterable is None:
+ w_iterator = self.iterable
+ if w_iterator is None:
raise OperationError(self.space.w_StopIteration, self.space.w_None)
+
+ tp = self.space.type(w_iterator)
while True:
+ islice_ignore_items_driver.jit_merge_point(tp=tp,
+ num=num,
+ w_islice=self,
+ w_iterator=w_iterator)
try:
- self.space.next(self.iterable)
+ self.space.next(w_iterator)
except OperationError as e:
if e.match(self.space, self.space.w_StopIteration):
self.iterable = None
diff --git a/pypy/module/itertools/test/test_itertools.py b/pypy/module/itertools/test/test_itertools.py
--- a/pypy/module/itertools/test/test_itertools.py
+++ b/pypy/module/itertools/test/test_itertools.py
@@ -1085,3 +1085,18 @@
assert list(itertools.islice(c2, 3)) == expected
c3 = pickle.loads(pickle.dumps(c))
assert list(itertools.islice(c3, 3)) == expected
+
+ def test_islice_attack(self):
+ import itertools
+ class Iterator(object):
+ first = True
+ def __iter__(self):
+ return self
+ def next(self):
+ if self.first:
+ self.first = False
+ list(islice)
+ return 52
+ myiter = Iterator()
+ islice = itertools.islice(myiter, 5, 8)
+ raises(StopIteration, islice.next)
diff --git a/pypy/module/pypyjit/__init__.py b/pypy/module/pypyjit/__init__.py
--- a/pypy/module/pypyjit/__init__.py
+++ b/pypy/module/pypyjit/__init__.py
@@ -8,16 +8,16 @@
'set_param': 'interp_jit.set_param',
'residual_call': 'interp_jit.residual_call',
'not_from_assembler': 'interp_jit.W_NotFromAssembler',
- 'set_compile_hook': 'interp_resop.set_compile_hook',
- 'set_optimize_hook': 'interp_resop.set_optimize_hook',
- 'set_abort_hook': 'interp_resop.set_abort_hook',
- 'get_stats_snapshot': 'interp_resop.get_stats_snapshot',
- 'enable_debug': 'interp_resop.enable_debug',
- 'disable_debug': 'interp_resop.disable_debug',
- 'ResOperation': 'interp_resop.WrappedOp',
- 'DebugMergePoint': 'interp_resop.DebugMergePoint',
- 'JitLoopInfo': 'interp_resop.W_JitLoopInfo',
- 'Box': 'interp_resop.WrappedBox',
+ #'set_compile_hook': 'interp_resop.set_compile_hook',
+ #'set_optimize_hook': 'interp_resop.set_optimize_hook',
+ #'set_abort_hook': 'interp_resop.set_abort_hook',
+ #'get_stats_snapshot': 'interp_resop.get_stats_snapshot',
+ #'enable_debug': 'interp_resop.enable_debug',
+ #'disable_debug': 'interp_resop.disable_debug',
+ #'ResOperation': 'interp_resop.WrappedOp',
+ #'DebugMergePoint': 'interp_resop.DebugMergePoint',
+ #'JitLoopInfo': 'interp_resop.W_JitLoopInfo',
+ #'Box': 'interp_resop.WrappedBox',
'PARAMETER_DOCS': 'space.wrap(rpython.rlib.jit.PARAMETER_DOCS)',
}
diff --git a/pypy/module/pypyjit/interp_resop.py b/pypy/module/pypyjit/interp_resop.py
--- a/pypy/module/pypyjit/interp_resop.py
+++ b/pypy/module/pypyjit/interp_resop.py
@@ -8,7 +8,7 @@
from rpython.rtyper.lltypesystem import lltype
from rpython.rtyper.annlowlevel import cast_base_ptr_to_instance, hlstr
from rpython.rtyper.rclass import OBJECT
-from rpython.jit.metainterp.resoperation import rop
+#from rpython.jit.metainterp.resoperation import rop
from rpython.rlib.nonconst import NonConstant
from rpython.rlib import jit_hooks
from rpython.rlib.jit import Counters
diff --git a/pypy/module/pypyjit/test_pypy_c/model.py b/pypy/module/pypyjit/test_pypy_c/model.py
--- a/pypy/module/pypyjit/test_pypy_c/model.py
+++ b/pypy/module/pypyjit/test_pypy_c/model.py
@@ -326,7 +326,7 @@
# to repeat it every time
ticker_check = """
guard_not_invalidated?
- ticker0 = getfield_raw(#, descr=<FieldS pypysig_long_struct.c_value .*>)
+ ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
"""
@@ -335,7 +335,7 @@
# this is the ticker check generated if we have threads
thread_ticker_check = """
guard_not_invalidated?
- ticker0 = getfield_raw(#, descr=<FieldS pypysig_long_struct.c_value .*>)
+ ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct.c_value .*>)
ticker1 = int_sub(ticker0, #)
setfield_raw(#, ticker1, descr=<FieldS pypysig_long_struct.c_value .*>)
ticker_cond0 = int_lt(ticker1, 0)
@@ -345,7 +345,7 @@
#
# this is the ticker check generated in PyFrame.handle_operation_error
exc_ticker_check = """
- ticker2 = getfield_raw(#, descr=<FieldS pypysig_long_struct.c_value .*>)
+ ticker2 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct.c_value .*>)
ticker_cond1 = int_lt(ticker2, 0)
guard_false(ticker_cond1, descr=...)
"""
diff --git a/pypy/module/pypyjit/test_pypy_c/test_00_model.py b/pypy/module/pypyjit/test_pypy_c/test_00_model.py
--- a/pypy/module/pypyjit/test_pypy_c/test_00_model.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_00_model.py
@@ -76,7 +76,7 @@
stdout = stdout.splitlines(True)[-1]
#
# parse the JIT log
- rawlog = logparser.parse_log_file(str(logfile))
+ rawlog = logparser.parse_log_file(str(logfile), verbose=False)
rawtraces = logparser.extract_category(rawlog, 'jit-log-opt-')
log = Log(rawtraces)
log.result = eval(stdout)
@@ -471,7 +471,7 @@
# this is the actual loop
'int_lt', 'guard_true', 'int_add',
# this is the signal checking stuff
- 'guard_not_invalidated', 'getfield_raw', 'int_lt', 'guard_false',
+ 'guard_not_invalidated', 'getfield_raw_i', 'int_lt', 'guard_false',
'jump'
]
@@ -536,7 +536,7 @@
# this is the actual loop
'int_lt', 'guard_true', 'force_token', 'int_add',
# this is the signal checking stuff
- 'guard_not_invalidated', 'getfield_raw', 'int_lt', 'guard_false',
+ 'guard_not_invalidated', 'getfield_raw_i', 'int_lt', 'guard_false',
'jump'
]
@@ -555,7 +555,7 @@
i8 = int_add(i4, 1)
# signal checking stuff
guard_not_invalidated(descr=...)
- i10 = getfield_raw(..., descr=<.* pypysig_long_struct.c_value .*>)
+ i10 = getfield_raw_i(..., descr=<.* pypysig_long_struct.c_value .*>)
i14 = int_lt(i10, 0)
guard_false(i14, descr=...)
jump(..., descr=...)
@@ -609,13 +609,13 @@
log = self.run(f, import_site=True)
loop, = log.loops_by_id('ntohs')
assert loop.match_by_id('ntohs', """
- p12 = call(ConstClass(ntohs), 1, descr=...)
+ i12 = call_i(ConstClass(ntohs), 1, descr=...)
guard_no_exception(descr=...)
""",
include_guard_not_invalidated=False)
#
py.test.raises(InvalidMatch, loop.match_by_id, 'ntohs', """
guard_not_invalidated(descr=...)
- p12 = call(ConstClass(foobar), 1, descr=...)
+ i12 = call_i(ConstClass(foobar), 1, descr=...)
guard_no_exception(descr=...)
""")
diff --git a/pypy/module/pypyjit/test_pypy_c/test_array.py b/pypy/module/pypyjit/test_pypy_c/test_array.py
--- a/pypy/module/pypyjit/test_pypy_c/test_array.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_array.py
@@ -42,7 +42,7 @@
guard_not_invalidated?
i13 = int_lt(i7, i9)
guard_true(i13, descr=...)
- i15 = getarrayitem_raw(i10, i7, descr=<ArrayS .>)
+ i15 = getarrayitem_raw_i(i10, i7, descr=<ArrayS .>)
i16 = int_add_ovf(i8, i15)
guard_no_overflow(descr=...)
i18 = int_add(i7, 1)
@@ -74,12 +74,12 @@
guard_true(i13, descr=...)
guard_not_invalidated(descr=...)
# the bound check guard on img has been killed (thanks to the asserts)
- i14 = getarrayitem_raw(i10, i8, descr=<ArrayS .>)
+ i14 = getarrayitem_raw_i(i10, i8, descr=<ArrayS .>)
i15 = int_add_ovf(i9, i14)
guard_no_overflow(descr=...)
i17 = int_sub(i8, 640)
# the bound check guard on intimg has been killed (thanks to the asserts)
- i18 = getarrayitem_raw(i11, i17, descr=<ArrayS .>)
+ i18 = getarrayitem_raw_i(i11, i17, descr=<ArrayS .>)
i19 = int_add_ovf(i18, i15)
guard_no_overflow(descr=...)
setarrayitem_raw(i11, i8, _, descr=<ArrayS .>)
@@ -93,7 +93,7 @@
guard_true(i13, descr=...)
guard_not_invalidated(descr=...)
# the bound check guard on img has been killed (thanks to the asserts)
- i14 = getarrayitem_raw(i10, i8, descr=<ArrayS .>)
+ i14 = getarrayitem_raw_i(i10, i8, descr=<ArrayS .>)
# advanced: the following int_add cannot overflow, because:
# - i14 fits inside 32 bits
# - i9 fits inside 33 bits, because:
@@ -107,7 +107,7 @@
i15 = int_add(i9, i14)
i17 = int_sub(i8, 640)
# the bound check guard on intimg has been killed (thanks to the asserts)
- i18 = getarrayitem_raw(i11, i17, descr=<ArrayS .>)
+ i18 = getarrayitem_raw_i(i11, i17, descr=<ArrayS .>)
i19 = int_add(i18, i15)
# guard checking that i19 actually fits into 32bit
i20 = int_signext(i19, 4)
@@ -139,10 +139,10 @@
guard_true(i10, descr=...)
i11 = int_lt(i6, i7)
guard_true(i11, descr=...)
- f13 = getarrayitem_raw(i8, i6, descr=<ArrayF 8>)
+ f13 = getarrayitem_raw_f(i8, i6, descr=<ArrayF 8>)
f15 = float_add(f13, 20.500000)
setarrayitem_raw(i8, i6, f15, descr=<ArrayF 8>)
- f16 = getarrayitem_raw(i8, i6, descr=<ArrayF 8>)
+ f16 = getarrayitem_raw_f(i8, i6, descr=<ArrayF 8>)
i18 = float_eq(f16, 42.000000)
guard_true(i18, descr=...)
i20 = int_add(i6, 1)
@@ -175,12 +175,12 @@
guard_true(i10, descr=...)
i11 = int_lt(i6, i7)
guard_true(i11, descr=...)
- i13 = getarrayitem_raw(i8, i6, descr=<Array. 4>)
+ i13 = getarrayitem_raw_i(i8, i6, descr=<Array. 4>)
f14 = cast_singlefloat_to_float(i13)
f16 = float_add(f14, 20.500000)
i17 = cast_float_to_singlefloat(f16)
setarrayitem_raw(i8, i6,i17, descr=<Array. 4>)
- i18 = getarrayitem_raw(i8, i6, descr=<Array. 4>)
+ i18 = getarrayitem_raw_i(i8, i6, descr=<Array. 4>)
f19 = cast_singlefloat_to_float(i18)
i21 = float_eq(f19, 42.000000)
guard_true(i21, descr=...)
@@ -225,23 +225,23 @@
...
i20 = int_ge(i18, i8)
guard_false(i20, descr=...)
- f21 = getarrayitem_raw(i13, i18, descr=...)
+ f21 = getarrayitem_raw_f(i13, i18, descr=...)
i14 = int_sub(i6, 1)
i15 = int_ge(i14, i8)
guard_false(i15, descr=...)
- f23 = getarrayitem_raw(i13, i14, descr=...)
+ f23 = getarrayitem_raw_f(i13, i14, descr=...)
f24 = float_add(f21, f23)
- f26 = getarrayitem_raw(i13, i6, descr=...)
+ f26 = getarrayitem_raw_f(i13, i6, descr=...)
f27 = float_add(f24, f26)
i29 = int_add(i6, 1)
i31 = int_ge(i29, i8)
guard_false(i31, descr=...)
- f33 = getarrayitem_raw(i13, i29, descr=...)
+ f33 = getarrayitem_raw_f(i13, i29, descr=...)
f34 = float_add(f27, f33)
i36 = int_add(i6, 2)
i38 = int_ge(i36, i8)
guard_false(i38, descr=...)
- f39 = getarrayitem_raw(i13, i36, descr=...)
+ f39 = getarrayitem_raw_f(i13, i36, descr=...)
...
""")
@@ -276,20 +276,20 @@
expected_src="""
...
i17 = int_and(i14, 255)
- f18 = getarrayitem_raw(i8, i17, descr=...)
+ f18 = getarrayitem_raw_f(i8, i17, descr=...)
i19s = int_sub_ovf(i6, 1)
guard_no_overflow(descr=...)
i22s = int_and(i19s, 255)
- f20 = getarrayitem_raw(i8, i22s, descr=...)
+ f20 = getarrayitem_raw_f(i8, i22s, descr=...)
f21 = float_add(f18, f20)
- f23 = getarrayitem_raw(i8, i10, descr=...)
+ f23 = getarrayitem_raw_f(i8, i10, descr=...)
f24 = float_add(f21, f23)
i26 = int_add(i6, 1)
i29 = int_and(i26, 255)
- f30 = getarrayitem_raw(i8, i29, descr=...)
+ f30 = getarrayitem_raw_f(i8, i29, descr=...)
f31 = float_add(f24, f30)
i33 = int_add(i6, 2)
i36 = int_and(i33, 255)
- f37 = getarrayitem_raw(i8, i36, descr=...)
+ f37 = getarrayitem_raw_f(i8, i36, descr=...)
...
""")
diff --git a/pypy/module/pypyjit/test_pypy_c/test_buffers.py b/pypy/module/pypyjit/test_pypy_c/test_buffers.py
--- a/pypy/module/pypyjit/test_pypy_c/test_buffers.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_buffers.py
@@ -18,7 +18,7 @@
loop, = log.loops_by_filename(self.filepath)
assert loop.match_by_id('match', """
guard_not_invalidated(descr=...)
- i65 = getfield_gc(p18, descr=...)
+ i65 = getfield_gc_i(p18, descr=...)
i67 = int_gt(0, i65)
guard_false(i67, descr=...)
i69 = int_gt(#, i65)
@@ -42,7 +42,7 @@
assert loop.match_by_id('unpack', """
guard_not_invalidated(descr=...)
p90 = newstr(4)
- call(ConstClass(copy_raw_to_string), i55, p90, 0, 4, descr=<Callv 0 irii EF=5>)
+ call_n(ConstClass(copy_raw_to_string), i55, p90, 0, 4, descr=<Callv 0 irii EF=5>)
guard_no_exception(descr=...)
i91 = strgetitem(p90, 0)
i92 = strgetitem(p90, 1)
@@ -56,7 +56,7 @@
guard_false(i99, descr=...)
i100 = int_lshift(i98, 24)
i101 = int_or(i97, i100)
- i102 = getfield_raw(#, descr=<FieldS pypysig_long_struct.c_value 0>)
+ i102 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct.c_value 0>)
i103 = int_lt(i102, 0)
guard_false(i103, descr=...)
""")
diff --git a/pypy/module/pypyjit/test_pypy_c/test_call.py b/pypy/module/pypyjit/test_pypy_c/test_call.py
--- a/pypy/module/pypyjit/test_pypy_c/test_call.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_call.py
@@ -31,7 +31,7 @@
functrace, loop = log.loops_by_filename(self.filepath)
assert loop.match_by_id('call_rec', """
...
- p53 = call_assembler(..., descr=...)
+ p53 = call_assembler_r(..., descr=...)
guard_not_forced(descr=...)
keepalive(...)
guard_no_exception(descr=...)
@@ -73,7 +73,7 @@
ops = entry_bridge.ops_by_id('cond', opcode='LOAD_GLOBAL')
assert log.opnames(ops) == ["guard_value",
"guard_value",
- "getfield_gc", "guard_value",
+ "getfield_gc_r", "guard_value",
"guard_not_invalidated"]
ops = entry_bridge.ops_by_id('add', opcode='LOAD_GLOBAL')
assert log.opnames(ops) == []
@@ -82,12 +82,12 @@
assert log.opnames(ops) == []
#
assert entry_bridge.match_by_id('call', """
- p38 = call(ConstClass(_ll_1_threadlocalref_get__Ptr_GcStruct_objectLlT_Signed), #, descr=<Callr . i EF=1 OS=5>)
- p39 = getfield_gc(p38, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_topframeref .*>)
+ p38 = call_r(ConstClass(_ll_1_threadlocalref_get__Ptr_GcStruct_objectLlT_Signed), #, descr=<Callr . i EF=1 OS=5>)
+ p39 = getfield_gc_r(p38, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_topframeref .*>)
i40 = force_token()
- p41 = getfield_gc_pure(p38, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_w_tracefunc .*>)
+ p41 = getfield_gc_pure_r(p38, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_w_tracefunc .*>)
guard_value(p41, ConstPtr(ptr42), descr=...)
- i42 = getfield_gc_pure(p38, descr=<FieldU pypy.interpreter.executioncontext.ExecutionContext.inst_profilefunc .*>)
+ i42 = getfield_gc_pure_i(p38, descr=<FieldU pypy.interpreter.executioncontext.ExecutionContext.inst_profilefunc .*>)
i43 = int_is_zero(i42)
guard_true(i43, descr=...)
i50 = force_token()
@@ -130,7 +130,8 @@
# -------------------------------
entry_bridge, = log.loops_by_filename(self.filepath, is_entry_bridge=True)
ops = entry_bridge.ops_by_id('meth1', opcode='LOOKUP_METHOD')
- assert log.opnames(ops) == ['guard_value', 'getfield_gc', 'guard_value',
+ assert log.opnames(ops) == ['guard_value', 'getfield_gc_r',
+ 'guard_value',
'guard_not_invalidated']
# the second LOOKUP_METHOD is folded away
assert list(entry_bridge.ops_by_id('meth2', opcode='LOOKUP_METHOD')) == []
@@ -349,15 +350,13 @@
# the int strategy is used here
assert loop.match_by_id('append', """
guard_not_invalidated?
- i13 = getfield_gc(p8, descr=<FieldS list.length .*>)
i15 = int_add(i13, 1)
- p15 = getfield_gc(p8, descr=<FieldP list.items .*>)
i17 = arraylen_gc(p15, descr=<ArrayS .>)
i18 = int_lt(i17, i15)
# a cond call to _ll_list_resize_hint_really_look_inside_iff
cond_call(i18, _, p8, i15, 1, descr=<Callv 0 rii EF=5>)
guard_no_exception(descr=...)
- p17 = getfield_gc(p8, descr=<FieldP list.items .*>)
+ p17 = getfield_gc_r(p8, descr=<FieldP list.items .*>)
setarrayitem_gc(p17, i13, i12, descr=<ArrayS .>)
""")
@@ -381,9 +380,9 @@
# make sure that the "block" is not allocated
...
p20 = force_token()
- p22 = new_with_vtable(...)
+ p22 = new_with_vtable(descr=<SizeDescr .*>)
p24 = new_array_clear(1, descr=<ArrayP .>)
- p26 = new_with_vtable(ConstClass(W_ListObject))
+ p26 = new_with_vtable(descr=<SizeDescr .*>)
{{{
setfield_gc(p0, p20, descr=<FieldP .*PyFrame.vable_token .*>)
setfield_gc(p22, ConstPtr(null), descr=<FieldP pypy.interpreter.argument.Arguments.inst_keywords_w .*>)
@@ -395,7 +394,7 @@
setarrayitem_gc(p24, 0, p26, descr=<ArrayP .>)
setfield_gc(p22, p24, descr=<FieldP .*Arguments.inst_arguments_w .*>)
}}}
- p32 = call_may_force(_, p18, p22, descr=<Callr . rr EF=7>)
+ p32 = call_may_force_r(_, p18, p22, descr=<Callr . rr EF=7>)
...
""")
@@ -436,24 +435,24 @@
guard_isnull(p5, descr=...)
guard_nonnull_class(p12, ConstClass(W_IntObject), descr=...)
guard_value(p2, ConstPtr(ptr21), descr=...)
- i22 = getfield_gc_pure(p12, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval .*>)
+ i22 = getfield_gc_pure_i(p12, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval .*>)
i24 = int_lt(i22, 5000)
guard_true(i24, descr=...)
guard_value(p7, ConstPtr(ptr25), descr=...)
- p26 = getfield_gc(p7, descr=<FieldP pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_strategy .*>)
+ p26 = getfield_gc_r(p7, descr=<FieldP pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_strategy .*>)
guard_value(p26, ConstPtr(ptr27), descr=...)
guard_not_invalidated(descr=...)
- p29 = call(ConstClass(_ll_1_threadlocalref_get__Ptr_GcStruct_objectLlT_Signed), #, descr=<Callr . i EF=1 OS=5>)
- p30 = getfield_gc(p29, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_topframeref .*>)
+ p29 = call_r(ConstClass(_ll_1_threadlocalref_get__Ptr_GcStruct_objectLlT_Signed), #, descr=<Callr . i EF=1 OS=5>)
+ p30 = getfield_gc_r(p29, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_topframeref .*>)
p31 = force_token()
- p32 = getfield_gc_pure(p29, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_w_tracefunc .*>)
+ p32 = getfield_gc_pure_r(p29, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_w_tracefunc .*>)
guard_value(p32, ConstPtr(ptr33), descr=...)
- i34 = getfield_gc_pure(p29, descr=<FieldU pypy.interpreter.executioncontext.ExecutionContext.inst_profilefunc .*>)
+ i34 = getfield_gc_pure_i(p29, descr=<FieldU pypy.interpreter.executioncontext.ExecutionContext.inst_profilefunc .*>)
i35 = int_is_zero(i34)
guard_true(i35, descr=...)
- p37 = getfield_gc(ConstPtr(ptr36), descr=<FieldP pypy.interpreter.nestedscope.Cell.inst_w_value .*>)
+ p37 = getfield_gc_r(ConstPtr(ptr36), descr=<FieldP pypy.interpreter.nestedscope.Cell.inst_w_value .*>)
guard_nonnull_class(p37, ConstClass(W_IntObject), descr=...)
- i39 = getfield_gc_pure(p37, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval .*>)
+ i39 = getfield_gc_pure_i(p37, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval .*>)
i40 = int_add_ovf(i22, i39)
guard_no_overflow(descr=...)
--TICK--
@@ -470,13 +469,13 @@
""", [])
loop, = log.loops_by_id('call')
assert loop.match("""
- i8 = getfield_gc_pure(p6, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval .*>)
+ i8 = getfield_gc_pure_i(p6, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval .*>)
i10 = int_lt(i8, 5000)
guard_true(i10, descr=...)
i11 = force_token()
i13 = int_add(i8, 1)
--TICK--
- p22 = new_with_vtable(ConstClass(W_IntObject))
+ p22 = new_with_vtable(descr=<SizeDescr .*>)
setfield_gc(p22, i13, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval .*>)
setfield_gc(p4, p22, descr=<FieldP pypy.interpreter.nestedscope.Cell.inst_w_value .*>)
jump(..., descr=...)
@@ -576,8 +575,8 @@
allops = loop.allops()
calls = [op for op in allops if op.name.startswith('call')]
assert OpMatcher(calls).match('''
- p93 = call(ConstClass(view_as_kwargs), p35, p12, descr=<.*>)
- i103 = call(ConstClass(_match_keywords), ConstPtr(ptr52), 0, 0, p94, p98, 0, descr=<.*>)
+ p93 = call_r(ConstClass(view_as_kwargs), p35, p12, descr=<.*>)
+ i103 = call_i(ConstClass(_match_keywords), ConstPtr(ptr52), 0, 0, p94, p98, 0, descr=<.*>)
''')
assert len([op for op in allops if op.name.startswith('new')]) == 1
# 1 alloc
diff --git a/pypy/module/pypyjit/test_pypy_c/test_containers.py b/pypy/module/pypyjit/test_pypy_c/test_containers.py
--- a/pypy/module/pypyjit/test_pypy_c/test_containers.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_containers.py
@@ -43,9 +43,9 @@
# can't change ;)
assert loop.match_by_id("getitem", """
...
- i26 = call(ConstClass(ll_call_lookup_function), p18, p6, i25, 0, descr=...)
+ i26 = call_i(ConstClass(ll_call_lookup_function), p18, p6, i25, 0, descr=...)
...
- p33 = getinteriorfield_gc(p31, i26, descr=<InteriorFieldDescr <FieldP odictentry.value .*>>)
+ p33 = getinteriorfield_gc_r(p31, i26, descr=<InteriorFieldDescr <FieldP odictentry.value .*>>)
...
""")
@@ -64,9 +64,9 @@
i8 = int_lt(i5, i7)
guard_true(i8, descr=...)
guard_not_invalidated(descr=...)
- p10 = call(ConstClass(ll_str__IntegerR_SignedConst_Signed), i5, descr=<Callr . i EF=3>)
+ p10 = call_r(ConstClass(ll_str__IntegerR_SignedConst_Signed), i5, descr=<Callr . i EF=3>)
guard_no_exception(descr=...)
- i12 = call(ConstClass(ll_strhash), p10, descr=<Calli . r EF=0>)
+ i12 = call_i(ConstClass(ll_strhash), p10, descr=<Calli . r EF=0>)
p13 = new(descr=...)
p15 = new_array_clear(16, descr=<ArrayU 1>)
{{{
@@ -74,25 +74,25 @@
setfield_gc(p13, p15, descr=<FieldP dicttable.indexes .+>)
setfield_gc(p13, ConstPtr(0), descr=<FieldP dicttable.entries .+>)
}}}
- i17 = call(ConstClass(ll_dict_lookup_trampoline), p13, p10, i12, 1, descr=<Calli . rrii EF=5 OS=4>)
+ i17 = call_i(ConstClass(ll_dict_lookup_trampoline), p13, p10, i12, 1, descr=<Calli . rrii EF=5 OS=4>)
{{{
setfield_gc(p13, 0, descr=<FieldS dicttable.lookup_function_no .+>)
setfield_gc(p13, 0, descr=<FieldS dicttable.num_live_items .+>)
setfield_gc(p13, 32, descr=<FieldS dicttable.resize_counter .+>)
}}}
guard_no_exception(descr=...)
- p20 = new_with_vtable(ConstClass(W_IntObject))
- call(ConstClass(_ll_dict_setitem_lookup_done_trampoline), p13, p10, p20, i12, i17, descr=<Callv 0 rrrii EF=5>)
+ p20 = new_with_vtable(descr=...)
+ call_n(ConstClass(_ll_dict_setitem_lookup_done_trampoline), p13, p10, p20, i12, i17, descr=<Callv 0 rrrii EF=5>)
setfield_gc(p20, i5, descr=<FieldS .*W_IntObject.inst_intval .*>)
guard_no_exception(descr=...)
- i23 = call(ConstClass(ll_call_lookup_function), p13, p10, i12, 0, descr=<Calli . rrii EF=5 OS=4>)
+ i23 = call_i(ConstClass(ll_call_lookup_function), p13, p10, i12, 0, descr=<Calli . rrii EF=5 OS=4>)
guard_no_exception(descr=...)
i27 = int_lt(i23, 0)
guard_false(i27, descr=...)
- p28 = getfield_gc(p13, descr=<FieldP dicttable.entries .*>)
- p29 = getinteriorfield_gc(p28, i23, descr=<InteriorFieldDescr <FieldP odictentry.value .*>>)
+ p28 = getfield_gc_r(p13, descr=<FieldP dicttable.entries .*>)
+ p29 = getinteriorfield_gc_r(p28, i23, descr=<InteriorFieldDescr <FieldP odictentry.value .*>>)
guard_nonnull_class(p29, ConstClass(W_IntObject), descr=...)
- i31 = getfield_gc_pure(p29, descr=<FieldS .*W_IntObject.inst_intval .*>)
+ i31 = getfield_gc_pure_i(p29, descr=<FieldS .*W_IntObject.inst_intval .*>)
i32 = int_sub_ovf(i31, i5)
guard_no_overflow(descr=...)
i34 = int_add_ovf(i32, 1)
diff --git a/pypy/module/pypyjit/test_pypy_c/test_cprofile.py b/pypy/module/pypyjit/test_pypy_c/test_cprofile.py
--- a/pypy/module/pypyjit/test_pypy_c/test_cprofile.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_cprofile.py
@@ -31,7 +31,7 @@
# but all calls can be special-cased by the backend if
# supported. On 64-bit there is only the two calls to
# read_timestamp.
- r = re.compile(r" call[(]ConstClass[(](.+?)[)]")
+ r = re.compile(r" call_\w[(]ConstClass[(](.+?)[)]")
calls = r.findall(repr(loop.ops_by_id(method)))
if sys.maxint == 2147483647:
assert len(calls) == 6
diff --git a/pypy/module/pypyjit/test_pypy_c/test_ffi.py b/pypy/module/pypyjit/test_pypy_c/test_ffi.py
--- a/pypy/module/pypyjit/test_pypy_c/test_ffi.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_ffi.py
@@ -163,7 +163,7 @@
loop, = log.loops_by_filename(self.filepath)
assert loop.match_by_id('getfield', """
guard_not_invalidated(descr=...)
- i57 = getfield_raw(i46, descr=<FieldS dynamic 0>)
+ i57 = getfield_raw_i(i46, descr=<FieldS dynamic 0>)
""")
assert loop.match_by_id('setfield', """
setfield_raw(i44, i57, descr=<FieldS dynamic 0>)
@@ -202,7 +202,7 @@
assert loop.match_by_id('cfficall', """
p96 = force_token()
setfield_gc(p0, p96, descr=<FieldP pypy.interpreter.pyframe.PyFrame.vable_token .>)
- f97 = call_release_gil(91, i59, 1.0, 3, descr=<Callf 8 fi EF=7 OS=62>)
+ f97 = call_release_gil_f(91, i59, 1.0, 3, descr=<Callf 8 fi EF=7 OS=62>)
guard_not_forced(descr=...)
guard_no_exception(descr=...)
""", ignore_ops=['guard_not_invalidated'])
@@ -244,7 +244,7 @@
assert loop.match_by_id('cfficall', """
p96 = force_token()
setfield_gc(p0, p96, descr=<FieldP pypy.interpreter.pyframe.PyFrame.vable_token .>)
- i97 = call_release_gil(91, i59, i50, descr=<Calli 4 i EF=7 OS=62>)
+ i97 = call_release_gil_i(91, i59, i50, descr=<Calli 4 i EF=7 OS=62>)
guard_not_forced(descr=...)
guard_no_exception(descr=...)
%s
@@ -288,10 +288,10 @@
assert loop.match_by_id('cfficall', """
p96 = force_token()
setfield_gc(p0, p96, descr=<FieldP pypy.interpreter.pyframe.PyFrame.vable_token .>)
- i97 = call_release_gil(91, i59, i10, i12, 1, descr=<Calli . iii EF=7 OS=62>)
+ i97 = call_release_gil_i(91, i59, i10, i12, 1, descr=<Calli . iii EF=7 OS=62>)
guard_not_forced(descr=...)
guard_no_exception(descr=...)
- p98 = call(ConstClass(fromrarith_int__r_uint), i97, descr=<Callr . i EF=4>)
+ p98 = call_r(ConstClass(fromrarith_int__r_uint), i97, descr=<Callr . i EF=4>)
guard_no_exception(descr=...)
""", ignore_ops=['guard_not_invalidated'])
@@ -354,7 +354,7 @@
loop, = log.loops_by_id('cfficall')
assert loop.match_by_id('cfficall', """
...
- f1 = call_release_gil(..., descr=<Calli 4 ii EF=7 OS=62>)
+ i1 = call_release_gil_i(..., descr=<Calli 4 ii EF=7 OS=62>)
...
""")
@@ -414,11 +414,7 @@
guard_not_invalidated(descr=...)
p163 = force_token()
p164 = force_token()
- p165 = getarrayitem_gc(p67, 0, descr=<ArrayP .>)
- guard_value(p165, ConstPtr(ptr70), descr=...)
- p166 = getfield_gc(p165, descr=<FieldP pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_strategy .+>)
- guard_value(p166, ConstPtr(ptr72), descr=...)
- p167 = call(ConstClass(_ll_0_alloc_with_del___), descr=<Callr . EF=5>)
+ p167 = call_r(ConstClass(_ll_0_alloc_with_del___), descr=<Callr . EF=5>)
guard_no_exception(descr=...)
i112 = int_signext(i160, 2)
setfield_gc(p167, ConstPtr(ptr85), descr=<FieldP pypy.module._cffi_backend.cdataobj.W_CData.inst_ctype .+>)
@@ -426,7 +422,7 @@
i114 = int_ne(i160, i112)
guard_false(i114, descr=...)
--TICK--
- i119 = call(ConstClass(_ll_1_raw_malloc_varsize__Signed), 6, descr=<Calli . i EF=5 OS=110>)
+ i119 = call_i(ConstClass(_ll_1_raw_malloc_varsize__Signed), 6, descr=<Calli . i EF=5 OS=110>)
raw_store(i119, 0, i160, descr=<ArrayS 2>)
raw_store(i119, 2, i160, descr=<ArrayS 2>)
raw_store(i119, 4, i160, descr=<ArrayS 2>)
diff --git a/pypy/module/pypyjit/test_pypy_c/test_generators.py b/pypy/module/pypyjit/test_pypy_c/test_generators.py
--- a/pypy/module/pypyjit/test_pypy_c/test_generators.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_generators.py
@@ -21,10 +21,10 @@
assert loop.match_by_id("generator", """
cond_call(..., descr=...)
i16 = force_token()
- p45 = new_with_vtable(ConstClass(W_IntObject))
+ p45 = new_with_vtable(descr=<.*>)
+ ifoo = arraylen_gc(p8, descr=<ArrayP .*>)
setfield_gc(p45, i29, descr=<FieldS .*>)
setarrayitem_gc(p8, 0, p45, descr=<ArrayP .>)
- i47 = arraylen_gc(p8, descr=<ArrayP .>) # Should be removed by backend
jump(..., descr=...)
""")
assert loop.match_by_id("subtract", """
@@ -50,10 +50,10 @@
assert loop.match_by_id("generator", """
cond_call(..., descr=...)
i16 = force_token()
- p45 = new_with_vtable(ConstClass(W_IntObject))
+ p45 = new_with_vtable(descr=<.*>)
+ i47 = arraylen_gc(p8, descr=<ArrayP .>) # Should be removed by backend
setfield_gc(p45, i29, descr=<FieldS .*>)
setarrayitem_gc(p8, 0, p45, descr=<ArrayP .>)
- i47 = arraylen_gc(p8, descr=<ArrayP .>) # Should be removed by backend
jump(..., descr=...)
""")
assert loop.match_by_id("subtract", """
diff --git a/pypy/module/pypyjit/test_pypy_c/test_globals.py b/pypy/module/pypyjit/test_pypy_c/test_globals.py
--- a/pypy/module/pypyjit/test_pypy_c/test_globals.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_globals.py
@@ -16,9 +16,9 @@
assert log.result == 500
loop, = log.loops_by_filename(self.filepath)
assert loop.match_by_id("loadglobal", """
- p12 = getfield_gc(p10, descr=<FieldP .*W_DictMultiObject.inst_strategy .*>)
+ p12 = getfield_gc_r(p10, descr=<FieldP .*W_DictMultiObject.inst_strategy .*>)
guard_value(p12, ConstPtr(ptr13), descr=...)
guard_not_invalidated(descr=...)
- p19 = getfield_gc(ConstPtr(p17), descr=<FieldP .*W_DictMultiObject.inst_strategy .*>)
+ p19 = getfield_gc_r(ConstPtr(p17), descr=<FieldP .*W_DictMultiObject.inst_strategy .*>)
guard_value(p19, ConstPtr(ptr20), descr=...)
""")
diff --git a/pypy/module/pypyjit/test_pypy_c/test_instance.py b/pypy/module/pypyjit/test_pypy_c/test_instance.py
--- a/pypy/module/pypyjit/test_pypy_c/test_instance.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_instance.py
@@ -106,7 +106,7 @@
entry_bridge, = log.loops_by_filename(self.filepath, is_entry_bridge=True)
ops = entry_bridge.ops_by_id('mutate', opcode='LOAD_ATTR')
assert log.opnames(ops) == ['guard_value', 'guard_not_invalidated',
- 'getfield_gc']
+ 'getfield_gc_i']
# the STORE_ATTR is folded away
assert list(entry_bridge.ops_by_id('meth1', opcode='STORE_ATTR')) == []
#
@@ -120,11 +120,11 @@
i59 = int_add_ovf(i57, 1)
guard_no_overflow(descr=...)
p60 = force_token()
- i61 = getfield_raw(..., descr=...)
+ i61 = getfield_raw_i(..., descr=...)
setfield_gc(ConstPtr(ptr39), i59, descr=...)
i62 = int_lt(i61, 0)
guard_false(i62, descr=...)
- jump(p0, p1, p3, p6, p7, p12, i59, p18, i31, i59, descr=...)
+ jump(p0, p1, p3, p6, p7, p12, i59, p18, i31, i59, p100, descr=...)
""")
def test_mutate_class(self):
@@ -154,8 +154,8 @@
entry_bridge, = log.loops_by_filename(self.filepath, is_entry_bridge=True)
ops = entry_bridge.ops_by_id('mutate', opcode='LOAD_ATTR')
assert log.opnames(ops) == ['guard_value', 'guard_not_invalidated',
- 'getfield_gc', 'guard_nonnull_class',
- 'getfield_gc', 'guard_value', # type check on the attribute
+ 'getfield_gc_r', 'guard_nonnull_class',
+ 'getfield_gc_r', 'guard_value', # type check on the attribute
]
# the STORE_ATTR is folded away
assert list(entry_bridge.ops_by_id('meth1', opcode='STORE_ATTR')) == []
@@ -167,15 +167,15 @@
i70 = int_lt(i58, i33)
guard_true(i70, descr=...)
guard_not_invalidated(descr=...)
- p71 = getfield_gc(p64, descr=...)
+ p71 = getfield_gc_r(p64, descr=...)
guard_value(p71, ConstPtr(ptr42), descr=...)
p72 = force_token()
p73 = force_token()
i74 = int_add(i58, 1)
- i75 = getfield_raw(..., descr=...)
+ i75 = getfield_raw_i(..., descr=...)
i76 = int_lt(i75, 0)
guard_false(i76, descr=...)
- p77 = new_with_vtable(...)
+ p77 = new_with_vtable(descr=...)
setfield_gc(p77, p64, descr=...)
setfield_gc(p77, ConstPtr(null), descr=...)
setfield_gc(p77, ConstPtr(null), descr=...)
@@ -183,7 +183,7 @@
setfield_gc(p77, ConstPtr(null), descr=...)
setfield_gc(p77, ConstPtr(ptr42), descr=...)
setfield_gc(ConstPtr(ptr69), p77, descr=...)
- jump(p0, p1, p3, p6, p7, p12, i74, p20, p26, i33, p77, descr=...)
+ jump(p0, p1, p3, p6, p7, p12, i74, p20, p26, i33, p77, p100, descr=...)
""")
@@ -209,11 +209,11 @@
assert loop.match_by_id('loadattr1',
'''
guard_not_invalidated(descr=...)
- i19 = call(ConstClass(ll_call_lookup_function), _, _, _, 0, descr=...)
+ i19 = call_i(ConstClass(ll_call_lookup_function), _, _, _, 0, descr=...)
guard_no_exception(descr=...)
i22 = int_lt(i19, 0)
guard_true(i22, descr=...)
- i26 = call(ConstClass(ll_call_lookup_function), _, _, _, 0, descr=...)
+ i26 = call_i(ConstClass(ll_call_lookup_function), _, _, _, 0, descr=...)
guard_no_exception(descr=...)
i29 = int_lt(i26, 0)
guard_true(i29, descr=...)
diff --git a/pypy/module/pypyjit/test_pypy_c/test_math.py b/pypy/module/pypyjit/test_pypy_c/test_math.py
--- a/pypy/module/pypyjit/test_pypy_c/test_math.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_math.py
@@ -23,8 +23,8 @@
f1 = cast_int_to_float(i0)
i3 = float_le(f1, 0.0)
guard_false(i3, descr=...)
- f2 = call(ConstClass(log), f1, descr=<Callf . f EF=2>)
- f3 = call(ConstClass(log10), f1, descr=<Callf . f EF=2>)
+ f2 = call_f(ConstClass(log), f1, descr=<Callf . f EF=2>)
+ f3 = call_f(ConstClass(log10), f1, descr=<Callf . f EF=2>)
f4 = float_sub(f2, f3)
f5 = float_add(f0, f4)
i4 = int_add(i0, 1)
@@ -52,8 +52,8 @@
f1 = cast_int_to_float(i0)
i6 = --ISINF--(f1)
guard_false(i6, descr=...)
- f2 = call(ConstClass(sin), f1, descr=<Callf . f EF=0>)
- f3 = call(ConstClass(cos), f1, descr=<Callf . f EF=0>)
+ f2 = call_f(ConstClass(sin), f1, descr=<Callf . f EF=0>)
+ f3 = call_f(ConstClass(cos), f1, descr=<Callf . f EF=0>)
f4 = float_sub(f2, f3)
f5 = float_add(f0, f4)
i7 = int_add(i0, 1)
diff --git a/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py b/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py
--- a/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py
@@ -15,36 +15,36 @@
loop = log._filter(log.loops[0])
assert loop.match("""
guard_class(p1, #, descr=...)
- p4 = getfield_gc_pure(p1, descr=<FieldP pypy.module.micronumpy.iterators.ArrayIter.inst_array \d+>)
- i5 = getfield_gc(p0, descr=<FieldS pypy.module.micronumpy.iterators.IterState.inst_offset \d+>)
- p6 = getfield_gc_pure(p4, descr=<FieldP pypy.module.micronumpy.concrete.BaseConcreteArray.inst_dtype \d+>)
- p7 = getfield_gc_pure(p6, descr=<FieldP pypy.module.micronumpy.descriptor.W_Dtype.inst_itemtype \d+>)
+ p4 = getfield_gc_pure_r(p1, descr=<FieldP pypy.module.micronumpy.iterators.ArrayIter.inst_array \d+>)
+ i5 = getfield_gc_i(p0, descr=<FieldS pypy.module.micronumpy.iterators.IterState.inst_offset \d+>)
+ p6 = getfield_gc_pure_r(p4, descr=<FieldP pypy.module.micronumpy.concrete.BaseConcreteArray.inst_dtype \d+>)
+ p7 = getfield_gc_pure_r(p6, descr=<FieldP pypy.module.micronumpy.descriptor.W_Dtype.inst_itemtype \d+>)
guard_class(p7, ConstClass(Float64), descr=...)
- i9 = getfield_gc_pure(p4, descr=<FieldU pypy.module.micronumpy.concrete.BaseConcreteArray.inst_storage \d+>)
- i10 = getfield_gc_pure(p6, descr=<FieldU pypy.module.micronumpy.descriptor.W_Dtype.inst_byteorder \d+>)
+ i9 = getfield_gc_pure_i(p4, descr=<FieldU pypy.module.micronumpy.concrete.BaseConcreteArray.inst_storage \d+>)
+ i10 = getfield_gc_pure_i(p6, descr=<FieldU pypy.module.micronumpy.descriptor.W_Dtype.inst_byteorder \d+>)
i12 = int_eq(i10, 61)
i14 = int_eq(i10, 60)
i15 = int_or(i12, i14)
- f16 = raw_load(i9, i5, descr=<ArrayF \d+>)
+ f16 = raw_load_f(i9, i5, descr=<ArrayF \d+>)
guard_true(i15, descr=...)
guard_not_invalidated(descr=...)
i18 = float_ne(f16, 0.000000)
guard_true(i18, descr=...)
guard_nonnull_class(p2, ConstClass(W_BoolBox), descr=...)
- i20 = getfield_gc_pure(p2, descr=<FieldU pypy.module.micronumpy.boxes.W_BoolBox.inst_value \d+>)
+ i20 = getfield_gc_pure_i(p2, descr=<FieldU pypy.module.micronumpy.boxes.W_BoolBox.inst_value \d+>)
i21 = int_is_true(i20)
guard_false(i21, descr=...)
- i22 = getfield_gc(p0, descr=<FieldS pypy.module.micronumpy.iterators.IterState.inst_index \d+>)
- i23 = getfield_gc_pure(p1, descr=<FieldU pypy.module.micronumpy.iterators.ArrayIter.inst_track_index \d+>)
+ i22 = getfield_gc_i(p0, descr=<FieldS pypy.module.micronumpy.iterators.IterState.inst_index \d+>)
+ i23 = getfield_gc_pure_i(p1, descr=<FieldU pypy.module.micronumpy.iterators.ArrayIter.inst_track_index \d+>)
guard_true(i23, descr=...)
i25 = int_add(i22, 1)
- p26 = getfield_gc_pure(p0, descr=<FieldP pypy.module.micronumpy.iterators.IterState.inst__indices \d+>)
- i27 = getfield_gc_pure(p1, descr=<FieldS pypy.module.micronumpy.iterators.ArrayIter.inst_contiguous \d+>)
+ p26 = getfield_gc_pure_r(p0, descr=<FieldP pypy.module.micronumpy.iterators.IterState.inst__indices \d+>)
+ i27 = getfield_gc_pure_i(p1, descr=<FieldS pypy.module.micronumpy.iterators.ArrayIter.inst_contiguous \d+>)
i28 = int_is_true(i27)
guard_true(i28, descr=...)
- i29 = getfield_gc_pure(p6, descr=<FieldS pypy.module.micronumpy.descriptor.W_Dtype.inst_elsize \d+>)
+ i29 = getfield_gc_pure_i(p6, descr=<FieldS pypy.module.micronumpy.descriptor.W_Dtype.inst_elsize \d+>)
i30 = int_add(i5, i29)
- i31 = getfield_gc_pure(p1, descr=<FieldS pypy.module.micronumpy.iterators.ArrayIter.inst_size \d+>)
+ i31 = getfield_gc_pure_i(p1, descr=<FieldS pypy.module.micronumpy.iterators.ArrayIter.inst_size \d+>)
i32 = int_ge(i25, i31)
guard_false(i32, descr=...)
p34 = new_with_vtable(#)
@@ -68,13 +68,13 @@
assert len(log.loops) == 1
loop = log._filter(log.loops[0])
assert loop.match("""
- f31 = raw_load(i9, i29, descr=<ArrayF 8>)
+ f31 = raw_load_f(i9, i29, descr=<ArrayF 8>)
guard_not_invalidated(descr=...)
i32 = float_ne(f31, 0.000000)
guard_true(i32, descr=...)
- i34 = getarrayitem_raw(#, #, descr=<ArrayU 1>) # XXX what are these?
+ i34 = getarrayitem_raw_i(#, #, descr=<ArrayU 1>) # XXX what are these?
guard_value(i34, #, descr=...) # XXX don't appear in
- i35 = getarrayitem_raw(#, #, descr=<ArrayU 1>) # XXX equiv test_zjit
+ i35 = getarrayitem_raw_i(#, #, descr=<ArrayU 1>) # XXX equiv test_zjit
i36 = int_add(i24, 1)
i37 = int_add(i29, i28)
i38 = int_ge(i36, i30)
@@ -112,7 +112,7 @@
i78 = int_mul(i71, i61)
i79 = int_add(i55, i78)
""" + alignment_check + """
- f80 = raw_load(i67, i79, descr=<ArrayF 8>)
+ f80 = raw_load_f(i67, i79, descr=<ArrayF 8>)
i81 = int_add(i71, 1)
--TICK--
jump(..., descr=...)
@@ -149,7 +149,7 @@
i83 = int_mul(i76, i64)
i84 = int_add(i58, i83)
""" + alignment_check + """
- f85 = raw_load(i70, i84, descr=<ArrayF 8>)
+ f85 = raw_load_f(i70, i84, descr=<ArrayF 8>)
guard_not_invalidated(descr=...)
f86 = float_add(f74, f85)
i87 = int_add(i76, 1)
@@ -176,11 +176,11 @@
guard_not_invalidated(descr=...)
i88 = int_ge(i87, i59)
guard_false(i88, descr=...)
- f90 = raw_load(i67, i89, descr=<ArrayF 8>)
+ f90 = raw_load_f(i67, i89, descr=<ArrayF 8>)
i91 = int_add(i87, 1)
i93 = int_add(i89, i76)
i94 = int_add(i79, 1)
- i95 = getfield_raw(#, descr=<FieldS pypysig_long_struct.c_value 0>)
+ i95 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct.c_value 0>)
setfield_gc(p97, i91, descr=<FieldS pypy.module.micronumpy.iterators.IterState.inst_index .+>)
setfield_gc(p97, i93, descr=<FieldS pypy.module.micronumpy.iterators.IterState.inst_offset .+>)
i96 = int_lt(i95, 0)
@@ -208,11 +208,11 @@
guard_true(i126, descr=...)
i128 = int_mul(i117, i59)
i129 = int_add(i55, i128)
- f149 = raw_load(i100, i129, descr=<ArrayF 8>)
+ f149 = raw_load_f(i100, i129, descr=<ArrayF 8>)
i151 = int_add(i117, 1)
+ setfield_gc(p156, i55, descr=<FieldS pypy.module.micronumpy.iterators.IterState.inst_offset .+>)
setarrayitem_gc(p150, 1, 0, descr=<ArrayS .+>)
setarrayitem_gc(p150, 0, 0, descr=<ArrayS .+>)
- setfield_gc(p156, i55, descr=<FieldS pypy.module.micronumpy.iterators.IterState.inst_offset .+>)
--TICK--
jump(..., descr=...)
""")
@@ -240,10 +240,10 @@
guard_not_invalidated(descr=...)
More information about the pypy-commit
mailing list