Commits

mattip  committed 19b73fa Merge

merge heads

  • Participants
  • Parent commits f01c89b, 50c910e

Comments (0)

Files changed (12)

File pypy/doc/Makefile

 	-rm -rf $(BUILDDIR)/*
 
 html:
-	python config/generate.py
+	# python config/generate.py #readthedocs will not run this Makefile
 	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
 	@echo
 	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
 
 dirhtml:
-	python config/generate.py
+	# python config/generate.py #readthedocs will not run this Makefile
 	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
 	@echo
 	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
 
 pickle:
-	python config/generate.py
+	# python config/generate.py #readthedocs will not run this Makefile
 	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
 	@echo
 	@echo "Build finished; now you can process the pickle files."
 
 json:
-	python config/generate.py
+	# python config/generate.py #readthedocs will not run this Makefile
 	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
 	@echo
 	@echo "Build finished; now you can process the JSON files."
 
 htmlhelp:
-	python config/generate.py
+	# python config/generate.py #readthedocs will not run this Makefile
 	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
 	@echo
 	@echo "Build finished; now you can run HTML Help Workshop with the" \
 	      ".hhp project file in $(BUILDDIR)/htmlhelp."
 
 qthelp:
-	python config/generate.py
+	# python config/generate.py #readthedocs will not run this Makefile
 	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
 	@echo
 	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
 	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PyPy.qhc"
 
 latex:
-	python config/generate.py
+	# python config/generate.py #readthedocs will not run this Makefile
 	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
 	@echo
 	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
 	      "run these through (pdf)latex."
 
 man:
-	python config/generate.py
+	# python config/generate.py #readthedocs will not run this Makefile
 	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
 	@echo
 	@echo "Build finished. The manual pages are in $(BUILDDIR)/man"
 
 changes:
-	python config/generate.py
+	# python config/generate.py #readthedocs will not run this Makefile
 	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
 	@echo
 	@echo "The overview file is in $(BUILDDIR)/changes."
 
 linkcheck:
-	python config/generate.py
+	# python config/generate.py #readthedocs will not run this Makefile
 	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
 	@echo
 	@echo "Link check complete; look for any errors in the above output " \
 	      "or in $(BUILDDIR)/linkcheck/output.txt."
 
 doctest:
-	python config/generate.py
+	# python config/generate.py #readthedocs will not run this Makefile
 	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
 	@echo "Testing of doctests in the sources finished, look at the " \
 	      "results in $(BUILDDIR)/doctest/output.txt."

File pypy/doc/config/generate.py

File contents unchanged.

File pypy/doc/config/translation.no__thread.txt

 Don't use gcc __thread attribute for fast thread local storage
-implementation . Increases the chance that moving the resulting
+implementation. Increases the chance that moving the resulting
 executable to another same processor Linux machine will work.

File pypy/doc/pypyconfig.py

 def setup(app):
     import sys, os
     sys.path.insert(0, os.path.abspath("../../"))
+
+    #Autmatically calls make_cmdlline_overview
+    from pypy.doc.config import generate 
+
     from pypy.config import makerestdoc
     import py
     role = makerestdoc.register_config_role(py.path.local())

File pypy/doc/whatsnew-head.rst

 .. this is a revision shortly after release-2.0-beta1
 .. startrev: 0e6161a009c6
 
+.. branch: callback-jit
+Callbacks from C are now better JITted
+
+.. branch: remove-globals-in-jit
+
 .. branch: length-hint
 Implement __lenght_hint__ according to PEP 424
 

File pypy/interpreter/typedef.py

 # typical usage (case 1 is the most common kind of app-level subclasses;
 # case 2 is the memory-saving kind defined with __slots__).
 #
+#  +----------------------------------------------------------------+
+#  | NOTE: if withmapdict is enabled, the following doesn't apply!  |
+#  | Map dicts can flexibly allow any slots/__dict__/__weakref__ to |
+#  | show up only when needed.  In particular there is no way with  |
+#  | mapdict to prevent some objects from being weakrefable.        |
+#  +----------------------------------------------------------------+
+#
 #     dict   slots   del   weakrefable
 #
 # 1.    Y      N      N         Y          UserDictWeakref

File pypy/jit/backend/llgraph/runner.py

         #
         assembler_helper_ptr = jd.assembler_helper_adr.ptr  # fish
         try:
-            return assembler_helper_ptr(pframe, vable)
+            result = assembler_helper_ptr(pframe, vable)
         except LLException, lle:
             assert self.last_exception is None, "exception left behind"
             self.last_exception = lle
             # fish op
             op = self.current_op
             return op.result and op.result.value
+        if isinstance(result, float):
+            result = support.cast_to_floatstorage(result)
+        return result
 
     def execute_same_as(self, _, x):
         return x

File pypy/module/_weakref/test/test_weakref.py

         class A(object):
             def __eq__(self, other):
                 return True
+            def __ne__(self, other):
+                return False
         a1 = A()
         a2 = A()
         ref1 = _weakref.ref(a1)
         ref2 = _weakref.ref(a2)
         assert ref1 == ref2
+        assert not (ref1 != ref2)
+        assert not (ref1 == [])
+        assert ref1 != []
         del a1
         gc.collect()
         assert not ref1 == ref2
         assert ref1 != ref2
+        assert not (ref1 == [])
+        assert ref1 != []
         del a2
         gc.collect()
         assert not ref1 == ref2
         assert ref1 != ref2
+        assert not (ref1 == [])
+        assert ref1 != []
 
     def test_getweakrefs(self):
         import _weakref, gc
         if seen_callback:
             assert seen_callback == [True, True, True]
 
+    def test_type_weakrefable(self):
+        import _weakref, gc
+        w = _weakref.ref(list)
+        assert w() is list
+        gc.collect()
+        assert w() is list
+
 
 class AppTestProxy(object):
     spaceconfig = dict(usemodules=('_weakref',))
         class A(object):
             def __eq__(self, other):
                 return True
+            def __ne__(self, other):
+                return False
 
         a = A()
         assert _weakref.ref(a) == a

File pypy/rpython/lltypesystem/rffi.py

     args = ', '.join(['a%d' % i for i in range(len(TP.TO.ARGS))])
     source = py.code.Source(r"""
         def inner_wrapper(%(args)s):
-            callback_hook = aroundstate.callback_hook
-            if callback_hook:
-                callback_hook(llstr("%(callable_name_descr)s"))
+            if aroundstate is not None:
+                callback_hook = aroundstate.callback_hook
+                if callback_hook:
+                    callback_hook(llstr("%(callable_name_descr)s"))
             return callable(%(args)s)
         inner_wrapper._never_inline_ = True
         

File pypy/rpython/memory/gc/minimark.py

                     (obj + offset).address[0] = llmemory.NULL
                     continue    # no need to remember this weakref any longer
             #
+            elif self.header(pointing_to).tid & GCFLAG_NO_HEAP_PTRS:
+                # see test_weakref_to_prebuilt: it's not useful to put
+                # weakrefs into 'old_objects_with_weakrefs' if they point
+                # to a prebuilt object (they are immortal).  If moreover
+                # the 'pointing_to' prebuilt object still has the
+                # GCFLAG_NO_HEAP_PTRS flag, then it's even wrong, because
+                # 'pointing_to' will not get the GCFLAG_VISITED during
+                # the next major collection.  Solve this by not registering
+                # the weakref into 'old_objects_with_weakrefs'.
+                continue
+            #
             self.old_objects_with_weakrefs.append(obj)
 
     def invalidate_old_weakrefs(self):
                 continue # weakref itself dies
             offset = self.weakpointer_offset(self.get_type_id(obj))
             pointing_to = (obj + offset).address[0]
+            ll_assert((self.header(pointing_to).tid & GCFLAG_NO_HEAP_PTRS)
+                      == 0, "registered old weakref should not "
+                            "point to a NO_HEAP_PTRS obj")
             if self.header(pointing_to).tid & GCFLAG_VISITED:
                 new_with_weakref.append(obj)
             else:

File pypy/rpython/memory/test/test_gc.py

         res = self.interpret(f, [20])  # for GenerationGC, enough for a minor collection
         assert res == True
 
+    def test_weakref_to_prebuilt(self):
+        import weakref
+        class A:
+            pass
+        a = A()
+        def f(x):
+            ref = weakref.ref(a)
+            assert ref() is a
+            llop.gc__collect(lltype.Void)
+            return ref() is a
+        res = self.interpret(f, [20])  # for GenerationGC, enough for a minor collection
+        assert res == True
+
     def test_many_weakrefs(self):
         # test for the case where allocating the weakref itself triggers
         # a collection

File pypy/translator/platform/linux.py

         # places where we need to look for libffi.a
         # XXX obscuuure!  only look for libffi.a if run with translate.py
         if 'translate' in sys.modules:
-            return self.library_dirs_for_libffi() + ['/usr/lib']
+            if sys.maxint > 2**32:
+                host = 'x86_64'
+            else:
+                host = 'x86'
+            return self.library_dirs_for_libffi() + [
+                '/usr/lib',
+                '/usr/lib/%s-linux-gnu/' % host]
         else:
             return []