Matti Picus avatar Matti Picus committed 395db26 Merge

basic tests pass, translation fails

Comments (0)

Files changed (358)

 ^pypy/module/cpyext/test/.+\.obj$
 ^pypy/module/cpyext/test/.+\.manifest$
 ^pypy/module/test_lib_pypy/ctypes_tests/.+\.o$
+^pypy/module/cppyy/src/.+\.o$
+^pypy/module/cppyy/bench/.+\.so$
+^pypy/module/cppyy/bench/.+\.root$
+^pypy/module/cppyy/bench/.+\.d$
+^pypy/module/cppyy/src/.+\.errors$
+^pypy/module/cppyy/test/.+_rflx\.cpp$
+^pypy/module/cppyy/test/.+\.so$
+^pypy/module/cppyy/test/.+\.rootmap$
+^pypy/module/cppyy/test/.+\.exe$
+^pypy/module/cppyy/test/.+_cint.h$
 ^pypy/doc/.+\.html$
 ^pypy/doc/config/.+\.rst$
 ^pypy/doc/basicblock\.asc$
     DFKI GmbH, Germany 
     Impara, Germany
     Change Maker, Sweden 
+    University of California Berkeley, USA
 
 The PyPy Logo as used by http://speed.pypy.org and others was created
 by Samuel Reis and is distributed on terms of Creative Commons Share Alike
Add a comment to this file

lib-python/2.7/test/test_bool.py

File contents unchanged.

Add a comment to this file

lib_pypy/_ctypes/function.py

File contents unchanged.

lib_pypy/_ctypes/primitive.py

                 self._buffer[0] = value
             result.value = property(_getvalue, _setvalue)
 
+        elif tp == '?':  # regular bool
+            def _getvalue(self):
+                return bool(self._buffer[0])
+            def _setvalue(self, value):
+                self._buffer[0] = bool(value)
+            result.value = property(_getvalue, _setvalue)
+
         elif tp == 'v': # VARIANT_BOOL type
             def _getvalue(self):
                 return bool(self._buffer[0])
Add a comment to this file

lib_pypy/_ctypes/structure.py

File contents unchanged.

lib_pypy/numpypy/core/fromnumeric.py

     raise NotImplementedError('Waiting on interp level method')
 
 
-def argmax(a, axis=None):
+def argmax(a, axis=None, out=None):
     """
     Indices of the maximum values along an axis.
 
     1
 
     """
-    assert axis is None
     if not hasattr(a, 'argmax'):
         a = numpypy.array(a)
-    return a.argmax()
-
-
-def argmin(a, axis=None):
+    return a.argmax(axis=axis, out=out)
+
+
+def argmin(a, axis=None, out=None):
     """
     Return the indices of the minimum values along an axis.
 
         documentation.
 
     """
-    assert axis is None
     if not hasattr(a, 'argmin'):
         a = numpypy.array(a)
-    return a.argmin()
+    return a.argmin(axis=axis, out=out)
 
 
 def searchsorted(a, v, side='left'):
Add a comment to this file

pypy/config/pypyoption.py

File contents unchanged.

File contents unchanged.

Add a comment to this file

pypy/doc/config/commandline.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.allworkingmodules.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.disable_call_speedhacks.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.geninterp.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.honor__builtins__.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.logbytecodes.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.lonepycfiles.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.name.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.nofaking.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.opcodes.CALL_METHOD.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.opcodes.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.soabi.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.builtinshortcut.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.getattributeshortcut.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.logspaceoptypes.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.methodcachesizeexp.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.multimethods.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.mutable_builtintypes.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.newshortcut.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.optimized_comparison_op.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.optimized_int_add.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.optimized_list_getitem.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.prebuiltintfrom.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.prebuiltintto.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.sharesmallstr.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withcelldict.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withmapdict.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withmethodcache.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withmethodcachecounter.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withprebuiltchar.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withprebuiltint.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withrangelist.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withrope.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withropeunicode.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withsmallint.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withstrbuf.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withstrjoin.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withstrslice.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withtproxy.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withtypeversion.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.timing.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.translationmodules.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.__builtin__.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.__pypy__.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._ast.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._bisect.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._codecs.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._continuation.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._demo.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._ffi.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._file.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._locale.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._lsprof.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._minimal_curses.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._pickle_support.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._random.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._rawffi.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._socket.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._sre.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._ssl.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._testing.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._weakref.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._winreg.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.array.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.binascii.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.bz2.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.cStringIO.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.clr.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.cpyext.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.crypt.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.errno.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.exceptions.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.fcntl.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.gc.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.imp.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.itertools.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.marshal.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.math.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.micronumpy.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.mmap.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.operator.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.oracle.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.parser.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.posix.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.pyexpat.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.pypyjit.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.rbench.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.rctime.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.select.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.signal.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.struct.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.symbol.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.sys.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.termios.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.thread.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.time.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.token.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.unicodedata.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.zipimport.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.zlib.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usepycfiles.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backend.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.clever_malloc_removal.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.clever_malloc_removal_heuristic.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.clever_malloc_removal_threshold.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.constfold.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.inline.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.inline_heuristic.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.inline_threshold.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.mallocs.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.merge_if_blocks.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.none.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.print_statistics.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.profile_based_inline.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.profile_based_inline_heuristic.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.profile_based_inline_threshold.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.raisingop2direct_call.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.really_remove_asserts.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.remove_asserts.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.stack_optimization.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.storesink.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.builtins_can_raise_exceptions.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.cc.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.cli.exception_transformer.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.cli.trace_calls.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.cli.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.compilerflags.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.continuation.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.countmallocs.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.debug.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.dump_static_data_info.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.fork_before.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.gc.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.gcremovetypeptr.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.gcrootfinder.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.gctransformer.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.insist.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.instrument.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.instrumentctl.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.jit.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.jit_backend.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.jit_ffi.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.jit_profiler.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.linkerflags.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.list_comprehension_operations.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.log.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.make_jobs.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.no__thread.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.noprofopt.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.ootype.mangle.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.ootype.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.output.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.platform.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.profopt.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.rweakref.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.sandbox.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.secondaryentrypoints.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.shared.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.simplifying.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.taggedpointers.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.thread.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.type_system.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.vanilla.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.verbose.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.withsmallfuncsets.txt

File contents unchanged.

pypy/doc/cppyy.rst

 The cppyy module provides C++ bindings for PyPy by using the reflection
 information extracted from C++ header files by means of the
 `Reflex package`_.
-For this to work, you have to both install Reflex and build PyPy from the
-reflex-support branch.
+For this to work, you have to both install Reflex and build PyPy from source,
+as the cppyy module is not enabled by default.
+Note that the development version of cppyy lives in the reflex-support
+branch.
 As indicated by this being a branch, support for Reflex is still
 experimental.
 However, it is functional enough to put it in the hands of those who want
 .. _`recent snapshot`: http://cern.ch/wlav/reflex-2012-05-02.tar.bz2
 .. _`gccxml`: http://www.gccxml.org
 
-Next, get the `PyPy sources`_, select the reflex-support branch, and build.
+Next, get the `PyPy sources`_, optionally select the reflex-support branch,
+and build it.
 For the build to succeed, the ``$ROOTSYS`` environment variable must point to
 the location of your ROOT (or standalone Reflex) installation, or the
 ``root-config`` utility must be accessible through ``PATH`` (e.g. by adding
 
     $ hg clone https://bitbucket.org/pypy/pypy
     $ cd pypy
-    $ hg up reflex-support
+    $ hg up reflex-support         # optional
     $ cd pypy/translator/goal
     $ python translate.py -O jit --gcrootfinder=shadowstack targetpypystandalone.py --withmod-cppyy
 
   The C++ side will not see any overridden methods on the python side, as
   cross-inheritance is planned but not yet supported.
 
+* **memory**: C++ instances created by calling their constructor from python
+  are owned by python.
+  You can check/change the ownership with the _python_owns flag that every
+  bound instance carries.
+
 * **methods**: Are represented as python methods and work as expected.
   They are first class objects and can be bound to an instance.
   Virtual C++ methods work as expected.

pypy/doc/extending.rst

 
 * Write them in RPython as mixedmodule_, using *rffi* as bindings.
 
-* Write them in C++ and bind them through Reflex_ (EXPERIMENTAL)
+* Write them in C++ and bind them through Reflex_
 
 .. _ctypes: #CTypes
 .. _\_ffi: #LibFFI

File contents unchanged.

Add a comment to this file

pypy/doc/project-ideas.rst

File contents unchanged.

pypy/doc/release-1.9.0.rst

 JitViewer
 =========
 
-There is a corresponding 1.9 release of JitViewer which is guaranteed to work
-with PyPy 1.9. See the `JitViewer docs`_ for details.
+There will be a corresponding 1.9 release of JitViewer which is guaranteed
+to work with PyPy 1.9. See the `JitViewer docs`_ for details.
 
 .. _`JitViewer docs`: http://bitbucket.org/pypy/jitviewer
 

File contents unchanged.

pypy/doc/whatsnew-head.rst

 .. branch: default
 .. branch: app_main-refactor
 .. branch: win-ordinal
+.. branch: reflex-support
+Provides cppyy module (disabled by default) for access to C++ through Reflex.
+See doc/cppyy.rst for full details and functionality.
 
 
 .. "uninteresting" branches that we should just ignore for the whatsnew:
Add a comment to this file

pypy/interpreter/baseobjspace.py

File contents unchanged.

pypy/interpreter/buffer.py

         # May be overridden.  No bounds checks.
         return ''.join([self.getitem(i) for i in range(start, stop, step)])
 
+    def get_raw_address(self):
+        raise ValueError("no raw buffer")
+
     # __________ app-level support __________
 
     def descr_len(self, space):
Add a comment to this file

pypy/interpreter/executioncontext.py

File contents unchanged.

Add a comment to this file

pypy/interpreter/function.py

File contents unchanged.

Add a comment to this file

pypy/interpreter/gateway.py

File contents unchanged.

Add a comment to this file

pypy/interpreter/pyparser/parsestring.py

File contents unchanged.

Add a comment to this file

pypy/jit/backend/llgraph/test/test_llgraph.py

File contents unchanged.

pypy/jit/backend/llsupport/gc.py

 
     def _check_valid_gc(self):
         # we need the hybrid or minimark GC for rgc._make_sure_does_not_move()
-        # to work
-        if self.gcdescr.config.translation.gc not in ('hybrid', 'minimark'):
+        # to work.  Additionally, 'hybrid' is missing some stuff like
+        # jit_remember_young_pointer() for now.
+        if self.gcdescr.config.translation.gc not in ('minimark',):
             raise NotImplementedError("--gc=%s not implemented with the JIT" %
-                                      (gcdescr.config.translation.gc,))
+                                      (self.gcdescr.config.translation.gc,))
 
     def _make_gcrootmap(self):
         # to find roots in the assembler, make a GcRootMap

pypy/jit/backend/llsupport/test/test_gc.py

 
 
 class TestFramework(object):
-    gc = 'hybrid'
+    gc = 'minimark'
 
     def setup_method(self, meth):
         class config_(object):

pypy/jit/backend/llsupport/test/test_rewrite.py

     def setup_method(self, meth):
         class config_(object):
             class translation(object):
-                gc = 'hybrid'
+                gc = 'minimark'
                 gcrootfinder = 'asmgcc'
                 gctransformer = 'framework'
                 gcremovetypeptr = False
Add a comment to this file

pypy/jit/backend/test/runner_test.py

File contents unchanged.

Add a comment to this file

pypy/jit/backend/test/test_random.py

File contents unchanged.

Add a comment to this file

pypy/jit/backend/x86/assembler.py

File contents unchanged.

Add a comment to this file

pypy/jit/backend/x86/regalloc.py

File contents unchanged.

Add a comment to this file

pypy/jit/codewriter/effectinfo.py

File contents unchanged.

Add a comment to this file

pypy/jit/codewriter/jtransform.py

File contents unchanged.

Add a comment to this file

pypy/jit/codewriter/support.py

File contents unchanged.

Add a comment to this file

pypy/jit/codewriter/test/test_effectinfo.py

File contents unchanged.

Add a comment to this file

pypy/jit/codewriter/test/test_flatten.py

File contents unchanged.

Add a comment to this file

pypy/jit/metainterp/blackhole.py

File contents unchanged.

pypy/jit/metainterp/optimizeopt/fficall.py

     optimize_CALL_MAY_FORCE = optimize_CALL
 
     def optimize_FORCE_TOKEN(self, op):
-        # The handling of force_token needs a bit of exaplanation.
+        # The handling of force_token needs a bit of explanation.
         # The original trace which is getting optimized looks like this:
         #    i1 = force_token()
         #    setfield_gc(p0, i1, ...)
Add a comment to this file

pypy/jit/metainterp/optimizeopt/heap.py

File contents unchanged.

Add a comment to this file

pypy/jit/metainterp/pyjitpl.py

File contents unchanged.

Add a comment to this file

pypy/jit/metainterp/resoperation.py

File contents unchanged.

Add a comment to this file

pypy/jit/metainterp/test/support.py

File contents unchanged.

Add a comment to this file

pypy/jit/metainterp/test/test_ajit.py

File contents unchanged.

Add a comment to this file

pypy/jit/metainterp/warmspot.py

File contents unchanged.

pypy/jit/tl/pypyjit.py

 config.objspace.usemodules._lsprof = False
 #
 config.objspace.usemodules._ffi = True
+#config.objspace.usemodules.cppyy = True
 config.objspace.usemodules.micronumpy = False
 #
 set_pypy_opt_level(config, level='jit')
Add a comment to this file

pypy/jit/tl/pypyjit_child.py

File contents unchanged.

Add a comment to this file

pypy/jit/tl/pypyjit_demo.py

File contents unchanged.

Add a comment to this file

pypy/module/_rawffi/interp_rawffi.py

File contents unchanged.

pypy/module/_ssl/test/test_ztranslation.py

+from pypy.objspace.fake.checkmodule import checkmodule
+
+def test__ffi_translates():
+    checkmodule('_ssl')

pypy/module/_ssl/thread_lock.py

 
 eci = ExternalCompilationInfo(
     separate_module_sources=[separate_module_source],
+    post_include_bits=[
+        "int _PyPy_SSL_SetupThreads(void);"],
     export_symbols=['_PyPy_SSL_SetupThreads'],
 )
 

pypy/module/array/interp_array.py

         data[index] = char
         array._charbuf_stop()
 
+    def get_raw_address(self):
+        return self.array._charbuf_start()
 
 def make_array(mytype):
     W_ArrayBase = globals()['W_ArrayBase']
Add a comment to this file

pypy/module/array/test/test_array.py

File contents unchanged.

pypy/module/cppyy/__init__.py

+from pypy.interpreter.mixedmodule import MixedModule
+
+class Module(MixedModule):
+    """    """
+
+    interpleveldefs = {
+        '_load_dictionary'       : 'interp_cppyy.load_dictionary',
+        '_resolve_name'          : 'interp_cppyy.resolve_name',
+        '_scope_byname'          : 'interp_cppyy.scope_byname',
+        '_template_byname'       : 'interp_cppyy.template_byname',
+        '_set_class_generator'   : 'interp_cppyy.set_class_generator',
+        '_register_class'        : 'interp_cppyy.register_class',
+        'CPPInstance'            : 'interp_cppyy.W_CPPInstance',
+        'addressof'              : 'interp_cppyy.addressof',
+        'bind_object'            : 'interp_cppyy.bind_object',
+    }
+
+    appleveldefs = {
+        'gbl'                    : 'pythonify.gbl',
+        'load_reflection_info'   : 'pythonify.load_reflection_info',
+        'add_pythonization'      : 'pythonify.add_pythonization',
+    }

pypy/module/cppyy/bench/Makefile

+all: bench02Dict_reflex.so
+
+ROOTSYS := ${ROOTSYS}
+
+ifeq ($(ROOTSYS),)
+  genreflex=genreflex
+  cppflags=
+else
+  genreflex=$(ROOTSYS)/bin/genreflex
+  cppflags=-I$(ROOTSYS)/include -L$(ROOTSYS)/lib
+endif
+
+PLATFORM := $(shell uname -s)
+ifeq ($(PLATFORM),Darwin)
+  cppflags+=-dynamiclib -single_module -arch x86_64
+endif
+
+ifeq ($(shell $(genreflex) --help | grep -- --with-methptrgetter),)
+  genreflexflags=
+  cppflags2=-O3 -fPIC
+else
+  genreflexflags=--with-methptrgetter
+  cppflags2=-Wno-pmf-conversions -O3 -fPIC
+endif
+
+
+bench02Dict_reflex.so: bench02.h bench02.cxx bench02.xml
+	$(genreflex) bench02.h $(genreflexflags) --selection=bench02.xml -I$(ROOTSYS)/include
+	g++ -o $@ bench02.cxx bench02_rflx.cpp -I$(ROOTSYS)/include -shared -lReflex -lHistPainter `root-config --libs` $(cppflags) $(cppflags2)

pypy/module/cppyy/bench/bench02.cxx

+#include "bench02.h"
+
+#include "TROOT.h"
+#include "TApplication.h"
+#include "TDirectory.h"
+#include "TInterpreter.h"
+#include "TSystem.h"
+#include "TBenchmark.h"
+#include "TStyle.h"
+#include "TError.h"
+#include "Getline.h"
+#include "TVirtualX.h"
+
+#include "Api.h"
+
+#include <iostream>
+
+TClass *TClass::GetClass(const char*, Bool_t, Bool_t) {
+    static TClass* dummy = new TClass("__dummy__", kTRUE);
+    return dummy;  // is deleted by gROOT at shutdown
+}
+
+class TTestApplication : public TApplication {
+public:
+    TTestApplication(
+        const char* acn, Int_t* argc, char** argv, Bool_t bLoadLibs = kTRUE);
+    virtual ~TTestApplication();
+};
+
+TTestApplication::TTestApplication(
+        const char* acn, int* argc, char** argv, bool do_load) : TApplication(acn, argc, argv) {
+    if (do_load) {
+        // follow TRint to minimize differences with CINT
+        ProcessLine("#include <iostream>", kTRUE);
+        ProcessLine("#include <_string>",  kTRUE); // for std::string iostream.
+        ProcessLine("#include <vector>",   kTRUE); // needed because they're used within the
+        ProcessLine("#include <pair>",     kTRUE); //  core ROOT dicts and CINT won't be able
+                                                   //  to properly unload these files
+    }
+
+    // save current interpreter context
+    gInterpreter->SaveContext();
+    gInterpreter->SaveGlobalsContext();
+
+    // prevent crashes on accessing history
+    Gl_histinit((char*)"-");
+
+    // prevent ROOT from exiting python
+    SetReturnFromRun(kTRUE);
+}
+
+TTestApplication::~TTestApplication() {}
+
+static const char* appname = "pypy-cppyy";
+
+Bench02RootApp::Bench02RootApp() {
+    gROOT->SetBatch(kTRUE);
+    if (!gApplication) {
+        int argc = 1;
+        char* argv[1]; argv[0] = (char*)appname;
+        gApplication = new TTestApplication(appname, &argc, argv, kFALSE);
+    }
+}
+
+Bench02RootApp::~Bench02RootApp() {
+    // TODO: ROOT globals cleanup ... (?)
+}
+
+void Bench02RootApp::report() {
+    std::cout << "gROOT is: " << gROOT << std::endl;
+    std::cout << "gApplication is: " << gApplication << std::endl;
+}
+
+void Bench02RootApp::close_file(TFile* f) {
+    std::cout << "closing file " << f->GetName() << " ... " << std::endl;
+    f->Write();
+    f->Close();
+    std::cout << "... file closed" << std::endl;
+}

pypy/module/cppyy/bench/bench02.h

+#include "TString.h"
+
+#include "TCanvas.h"
+#include "TFile.h"
+#include "TProfile.h"
+#include "TNtuple.h"
+#include "TH1F.h"
+#include "TH2F.h"
+#include "TRandom.h"
+#include "TRandom3.h"
+
+#include "TROOT.h"
+#include "TApplication.h"
+#include "TSystem.h"
+
+#include "TArchiveFile.h"
+#include "TBasket.h"
+#include "TBenchmark.h"
+#include "TBox.h"
+#include "TBranchRef.h"
+#include "TBrowser.h"
+#include "TClassGenerator.h"
+#include "TClassRef.h"
+#include "TClassStreamer.h"
+#include "TContextMenu.h"
+#include "TEntryList.h"
+#include "TEventList.h"
+#include "TF1.h"
+#include "TFileCacheRead.h"
+#include "TFileCacheWrite.h"
+#include "TFileMergeInfo.h"
+#include "TFitResult.h"
+#include "TFolder.h"
+//#include "TFormulaPrimitive.h"
+#include "TFunction.h"
+#include "TFrame.h"
+#include "TGlobal.h"
+#include "THashList.h"
+#include "TInetAddress.h"
+#include "TInterpreter.h"
+#include "TKey.h"
+#include "TLegend.h"
+#include "TMethodCall.h"
+#include "TPluginManager.h"
+#include "TProcessUUID.h"
+#include "TSchemaRuleSet.h"
+#include "TStyle.h"
+#include "TSysEvtHandler.h"
+#include "TTimer.h"
+#include "TView.h"
+//#include "TVirtualCollectionProxy.h"
+#include "TVirtualFFT.h"
+#include "TVirtualHistPainter.h"
+#include "TVirtualIndex.h"
+#include "TVirtualIsAProxy.h"
+#include "TVirtualPadPainter.h"
+#include "TVirtualRefProxy.h"
+#include "TVirtualStreamerInfo.h"
+#include "TVirtualViewer3D.h"
+
+#include <typeinfo>
+#include <ostream>
+
+
+class Bench02RootApp {
+public:
+   Bench02RootApp();
+   ~Bench02RootApp();
+
+   void report();
+   void close_file(TFile* f);
+};

pypy/module/cppyy/bench/bench02.xml

+<lcgdict>
+
+  <selection>
+
+     <!-- ROOT classes -->
+     <class pattern="T[A-Z]*" />
+     <class pattern="ROOT::T[A-Z]*" />
+     <class pattern="ROOT::Fit::*" />
+
+     <!-- ROOT globals -->
+     <variable name="gROOT" />
+     <variable name="gSystem" />
+     <variable name="gRandom" />
+
+     <!-- STL classes actually used -->
+     <class name="std::string" />
+     <class name="std::ostream" />
+     <class name="std::type_info" />
+     <class pattern="std::vector<*>" />
+     <class pattern="std::_Vector_base<*>" />
+
+     <!-- helper -->
+     <class name="Bench02RootApp" />
+
+  </selection>
+
+  <exclusion>
+
+     <struct pattern="TString::*" />
+     <class name="TString" >
+         <field name="fRep" transient="true"/>
+     </class>
+
+     <class name="TUUID::uuid_time_t" />
+
+     <class name="TClass::TNameMapNode" />
+     <class name="TFileOpenHandle" />
+
+  </exclusion>
+
+</lcgdict>

pypy/module/cppyy/bench/hsimple.C

+#include <TFile.h>
+#include <TNtuple.h>
+#include <TH2.h>
+#include <TProfile.h>
+#include <TCanvas.h>
+#include <TFrame.h>
+#include <TROOT.h>
+#include <TSystem.h>
+#include <TRandom3.h>
+#include <TBenchmark.h>
+#include <TInterpreter.h>
+
+TFile *hsimple(Int_t get=0)
+{
+//  This program creates :
+//    - a one dimensional histogram
+//    - a two dimensional histogram
+//    - a profile histogram
+//    - a memory-resident ntuple
+//
+//  These objects are filled with some random numbers and saved on a file.
+//  If get=1 the macro returns a pointer to the TFile of "hsimple.root"
+//          if this file exists, otherwise it is created.
+//  The file "hsimple.root" is created in $ROOTSYS/tutorials if the caller has
+//  write access to this directory, otherwise the file is created in $PWD
+
+   TString filename = "hsimple.root";
+   TString dir = gSystem->UnixPathName(gInterpreter->GetCurrentMacroName());
+   dir.ReplaceAll("hsimple.C","");
+   dir.ReplaceAll("/./","/");
+   TFile *hfile = 0;
+   if (get) {
+      // if the argument get =1 return the file "hsimple.root"
+      // if the file does not exist, it is created
+      TString fullPath = dir+"hsimple.root";
+      if (!gSystem->AccessPathName(fullPath,kFileExists)) {
+	 hfile = TFile::Open(fullPath); //in $ROOTSYS/tutorials
+         if (hfile) return hfile;
+      }
+      //otherwise try $PWD/hsimple.root
+      if (!gSystem->AccessPathName("hsimple.root",kFileExists)) {
+         hfile = TFile::Open("hsimple.root"); //in current dir
+         if (hfile) return hfile;
+      }
+   }
+   //no hsimple.root file found. Must generate it !
+   //generate hsimple.root in $ROOTSYS/tutorials if we have write access
+   if (!gSystem->AccessPathName(dir,kWritePermission)) {
+      filename = dir+"hsimple.root";
+   } else if (!gSystem->AccessPathName(".",kWritePermission)) {
+      //otherwise generate hsimple.root in the current directory
+   } else {
+      printf("you must run the script in a directory with write access\n");
+      return 0;
+   }
+   hfile = (TFile*)gROOT->FindObject(filename); if (hfile) hfile->Close();
+   hfile = new TFile(filename,"RECREATE","Demo ROOT file with histograms");
+
+   // Create some histograms, a profile histogram and an ntuple
+   TH1F *hpx = new TH1F("hpx","This is the px distribution",100,-4,4);
+   hpx->SetFillColor(48);
+   TH2F *hpxpy = new TH2F("hpxpy","py vs px",40,-4,4,40,-4,4);
+   TProfile *hprof = new TProfile("hprof","Profile of pz versus px",100,-4,4,0,20);
+   TNtuple *ntuple = new TNtuple("ntuple","Demo ntuple","px:py:pz:random:i");
+
+   gBenchmark->Start("hsimple");
+  
+   // Create a new canvas.
+   TCanvas *c1 = new TCanvas("c1","Dynamic Filling Example",200,10,700,500);
+   c1->SetFillColor(42);
+   c1->GetFrame()->SetFillColor(21);
+   c1->GetFrame()->SetBorderSize(6);
+   c1->GetFrame()->SetBorderMode(-1);
+
+
+   // Fill histograms randomly
+   TRandom3 random;
+   Float_t px, py, pz;
+   const Int_t kUPDATE = 1000;
+   for (Int_t i = 0; i < 50000; i++) {
+   //      random.Rannor(px,py);
+      px = random.Gaus(0, 1);
+      py = random.Gaus(0, 1);
+      pz = px*px + py*py;
+      Float_t rnd = random.Rndm(1);
+      hpx->Fill(px);
+      hpxpy->Fill(px,py);
+      hprof->Fill(px,pz);
+      ntuple->Fill(px,py,pz,rnd,i);
+      if (i && (i%kUPDATE) == 0) {
+         if (i == kUPDATE) hpx->Draw();
+         c1->Modified();
+         c1->Update();
+         if (gSystem->ProcessEvents())
+            break;
+      }
+   }
+   gBenchmark->Show("hsimple");
+
+   // Save all objects in this file
+   hpx->SetFillColor(0);
+   hfile->Write();
+   hpx->SetFillColor(48);
+   c1->Modified();
+   return hfile;
+  
+// Note that the file is automatically close when application terminates
+// or when the file destructor is called.
+}

pypy/module/cppyy/bench/hsimple.py

+#*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
+#*-*
+#*-*  This program creates :
+#*-*    - a one dimensional histogram
+#*-*    - a two dimensional histogram
+#*-*    - a profile histogram
+#*-*    - a memory-resident ntuple
+#*-*
+#*-*  These objects are filled with some random numbers and saved on a file.
+#*-*
+#*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
+
+_reflex = True     # to keep things equal, set to False for full macro
+
+try:
+    import cppyy, random
+
+    if not hasattr(cppyy.gbl, 'gROOT'):
+        cppyy.load_reflection_info('bench02Dict_reflex.so')
+        _reflex = True
+
+    TCanvas  = cppyy.gbl.TCanvas
+    TFile    = cppyy.gbl.TFile
+    TProfile = cppyy.gbl.TProfile
+    TNtuple  = cppyy.gbl.TNtuple
+    TH1F     = cppyy.gbl.TH1F
+    TH2F     = cppyy.gbl.TH2F
+    TRandom3 = cppyy.gbl.TRandom3
+
+    gROOT      = cppyy.gbl.gROOT
+    gBenchmark = cppyy.gbl.TBenchmark()
+    gSystem    = cppyy.gbl.gSystem
+
+except ImportError:
+    from ROOT import TCanvas, TFile, TProfile, TNtuple, TH1F, TH2F, TRandom3
+    from ROOT import gROOT, gBenchmark, gSystem
+    import random
+
+if _reflex:
+   gROOT.SetBatch(True)