[pypy-commit] pypy numpypy-nditer: merge default into branch

mattip noreply at buildbot.pypy.org
Sun Apr 6 23:43:06 CEST 2014


Author: Matti Picus <matti.picus at gmail.com>
Branch: numpypy-nditer
Changeset: r70477:ad452a6db3f7
Date: 2014-04-05 22:10 +0300
http://bitbucket.org/pypy/pypy/changeset/ad452a6db3f7/

Log:	merge default into branch

diff too long, truncating to 2000 out of 2232 lines

diff --git a/lib-python/2.7/test/test_argparse.py b/lib-python/2.7/test/test_argparse.py
--- a/lib-python/2.7/test/test_argparse.py
+++ b/lib-python/2.7/test/test_argparse.py
@@ -10,6 +10,7 @@
 import tempfile
 import unittest
 import argparse
+import gc
 
 from StringIO import StringIO
 
@@ -47,7 +48,10 @@
 
     def tearDown(self):
         os.chdir(self.old_dir)
-        shutil.rmtree(self.temp_dir, True)
+        for root, dirs, files in os.walk(self.temp_dir, topdown=False):
+            for name in files:
+                os.chmod(os.path.join(self.temp_dir, name), stat.S_IWRITE)
+        shutil.rmtree(self.temp_dir, True)        
 
     def create_readonly_file(self, filename):
         file_path = os.path.join(self.temp_dir, filename)
diff --git a/lib-python/2.7/test/test_file2k.py b/lib-python/2.7/test/test_file2k.py
--- a/lib-python/2.7/test/test_file2k.py
+++ b/lib-python/2.7/test/test_file2k.py
@@ -162,6 +162,7 @@
         # Remark: Do not perform more than one test per open file,
         # since that does NOT catch the readline error on Windows.
         data = 'xxx'
+        self.f.close()
         for mode in ['w', 'wb', 'a', 'ab']:
             for attr in ['read', 'readline', 'readlines']:
                 self.f = open(TESTFN, mode)
diff --git a/lib_pypy/_ctypes/function.py b/lib_pypy/_ctypes/function.py
--- a/lib_pypy/_ctypes/function.py
+++ b/lib_pypy/_ctypes/function.py
@@ -219,7 +219,6 @@
             if restype is None:
                 import ctypes
                 restype = ctypes.c_int
-            self._argtypes_ = argsl    
             self._ptr = self._getfuncptr_fromaddress(self._argtypes_, restype)
             self._check_argtypes_for_fastpath()
             return
diff --git a/lib_pypy/_ctypes_test.py b/lib_pypy/_ctypes_test.py
--- a/lib_pypy/_ctypes_test.py
+++ b/lib_pypy/_ctypes_test.py
@@ -19,5 +19,5 @@
         fp, filename, description = imp.find_module('_ctypes_test', path=[output_dir])
         imp.load_module('_ctypes_test', fp, filename, description)
     except ImportError:
-        print 'could not find _ctypes_test in',output_dir
+        print('could not find _ctypes_test in %s' % output_dir)
         _pypy_testcapi.compile_shared('_ctypes_test.c', '_ctypes_test', output_dir)
diff --git a/pypy/doc/_ref.txt b/pypy/doc/_ref.txt
--- a/pypy/doc/_ref.txt
+++ b/pypy/doc/_ref.txt
@@ -4,7 +4,6 @@
 .. _`lib-python/2.7/dis.py`: https://bitbucket.org/pypy/pypy/src/default/lib-python/2.7/dis.py
 .. _`lib_pypy/`: https://bitbucket.org/pypy/pypy/src/default/lib_pypy/
 .. _`lib_pypy/greenlet.py`: https://bitbucket.org/pypy/pypy/src/default/lib_pypy/greenlet.py
-.. _`lib_pypy/pypy_test/`: https://bitbucket.org/pypy/pypy/src/default/lib_pypy/pypy_test/
 .. _`lib_pypy/tputil.py`: https://bitbucket.org/pypy/pypy/src/default/lib_pypy/tputil.py
 .. _`pypy/bin/`: https://bitbucket.org/pypy/pypy/src/default/pypy/bin/
 .. _`pypy/bin/pyinteractive.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/bin/pyinteractive.py
@@ -35,7 +34,6 @@
 .. _`pypy/interpreter/gateway.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/gateway.py
 .. _`pypy/interpreter/mixedmodule.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/mixedmodule.py
 .. _`pypy/interpreter/module.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/module.py
-.. _`pypy/interpreter/nestedscope.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/nestedscope.py
 .. _`pypy/interpreter/pyframe.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/pyframe.py
 .. _`pypy/interpreter/pyopcode.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/pyopcode.py
 .. _`pypy/interpreter/pyparser`:
@@ -49,21 +47,21 @@
 .. _`pypy/module`:
 .. _`pypy/module/`: https://bitbucket.org/pypy/pypy/src/default/pypy/module/
 .. _`pypy/module/__builtin__/__init__.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/module/__builtin__/__init__.py
+.. _`pypy/module/cppyy/capi/__init__.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/module/cppyy/capi/__init__.py
+.. _`pypy/module/cppyy/capi/builtin_capi.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/module/cppyy/capi/builtin_capi.py
+.. _`pypy/module/cppyy/include/capi.h`: https://bitbucket.org/pypy/pypy/src/default/pypy/module/cppyy/include/capi.h
+.. _`pypy/module/test_lib_pypy/`: https://bitbucket.org/pypy/pypy/src/default/pypy/module/test_lib_pypy/
 .. _`pypy/objspace/`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/
-.. _`pypy/objspace/flow/`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/flow/
 .. _`pypy/objspace/std`:
 .. _`pypy/objspace/std/`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/
-.. _`pypy/objspace/std/listtype.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/listtype.py
+.. _`pypy/objspace/std/bytesobject.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/bytesobject.py
 .. _`pypy/objspace/std/multimethod.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/multimethod.py
 .. _`pypy/objspace/std/objspace.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/objspace.py
 .. _`pypy/objspace/std/proxy_helpers.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/proxy_helpers.py
 .. _`pypy/objspace/std/proxyobject.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/proxyobject.py
-.. _`pypy/objspace/std/stringtype.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/stringtype.py
+.. _`pypy/objspace/std/strbufobject.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/strbufobject.py
 .. _`pypy/objspace/std/transparent.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/transparent.py
-.. _`pypy/objspace/std/tupleobject.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/tupleobject.py
-.. _`pypy/objspace/std/tupletype.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/tupletype.py
 .. _`pypy/tool/`: https://bitbucket.org/pypy/pypy/src/default/pypy/tool/
-.. _`pypy/tool/algo/`: https://bitbucket.org/pypy/pypy/src/default/pypy/tool/algo/
 .. _`pypy/tool/pytest/`: https://bitbucket.org/pypy/pypy/src/default/pypy/tool/pytest/
 .. _`rpython/annotator`:
 .. _`rpython/annotator/`: https://bitbucket.org/pypy/pypy/src/default/rpython/annotator/
@@ -75,6 +73,11 @@
 .. _`rpython/config/translationoption.py`: https://bitbucket.org/pypy/pypy/src/default/rpython/config/translationoption.py
 .. _`rpython/flowspace/`: https://bitbucket.org/pypy/pypy/src/default/rpython/flowspace/
 .. _`rpython/flowspace/model.py`: https://bitbucket.org/pypy/pypy/src/default/rpython/flowspace/model.py
+.. _`rpython/memory/`: https://bitbucket.org/pypy/pypy/src/default/rpython/memory/
+.. _`rpython/memory/gc/generation.py`: https://bitbucket.org/pypy/pypy/src/default/rpython/memory/gc/generation.py
+.. _`rpython/memory/gc/hybrid.py`: https://bitbucket.org/pypy/pypy/src/default/rpython/memory/gc/hybrid.py
+.. _`rpython/memory/gc/minimarkpage.py`: https://bitbucket.org/pypy/pypy/src/default/rpython/memory/gc/minimarkpage.py
+.. _`rpython/memory/gc/semispace.py`: https://bitbucket.org/pypy/pypy/src/default/rpython/memory/gc/semispace.py
 .. _`rpython/rlib`:
 .. _`rpython/rlib/`: https://bitbucket.org/pypy/pypy/src/default/rpython/rlib/
 .. _`rpython/rlib/listsort.py`: https://bitbucket.org/pypy/pypy/src/default/rpython/rlib/listsort.py
@@ -93,16 +96,12 @@
 .. _`rpython/rtyper/`: https://bitbucket.org/pypy/pypy/src/default/rpython/rtyper/
 .. _`rpython/rtyper/lltypesystem/`: https://bitbucket.org/pypy/pypy/src/default/rpython/rtyper/lltypesystem/
 .. _`rpython/rtyper/lltypesystem/lltype.py`: https://bitbucket.org/pypy/pypy/src/default/rpython/rtyper/lltypesystem/lltype.py
-.. _`rpython/rtyper/memory/`: https://bitbucket.org/pypy/pypy/src/default/rpython/rtyper/memory/
-.. _`rpython/rtyper/memory/gc/generation.py`: https://bitbucket.org/pypy/pypy/src/default/rpython/rtyper/memory/gc/generation.py
-.. _`rpython/rtyper/memory/gc/hybrid.py`: https://bitbucket.org/pypy/pypy/src/default/rpython/rtyper/memory/gc/hybrid.py
-.. _`rpython/rtyper/memory/gc/minimarkpage.py`: https://bitbucket.org/pypy/pypy/src/default/rpython/rtyper/memory/gc/minimarkpage.py
-.. _`rpython/rtyper/memory/gc/semispace.py`: https://bitbucket.org/pypy/pypy/src/default/rpython/rtyper/memory/gc/semispace.py
 .. _`rpython/rtyper/rint.py`: https://bitbucket.org/pypy/pypy/src/default/rpython/rtyper/rint.py
 .. _`rpython/rtyper/rlist.py`: https://bitbucket.org/pypy/pypy/src/default/rpython/rtyper/rlist.py
 .. _`rpython/rtyper/rmodel.py`: https://bitbucket.org/pypy/pypy/src/default/rpython/rtyper/rmodel.py
 .. _`rpython/rtyper/rtyper.py`: https://bitbucket.org/pypy/pypy/src/default/rpython/rtyper/rtyper.py
 .. _`rpython/rtyper/test/test_llinterp.py`: https://bitbucket.org/pypy/pypy/src/default/rpython/rtyper/test/test_llinterp.py
+.. _`rpython/tool/algo/`: https://bitbucket.org/pypy/pypy/src/default/rpython/tool/algo/
 .. _`rpython/translator`:
 .. _`rpython/translator/`: https://bitbucket.org/pypy/pypy/src/default/rpython/translator/
 .. _`rpython/translator/backendopt/`: https://bitbucket.org/pypy/pypy/src/default/rpython/translator/backendopt/
diff --git a/pypy/doc/cleanup.rst b/pypy/doc/cleanup.rst
--- a/pypy/doc/cleanup.rst
+++ b/pypy/doc/cleanup.rst
@@ -9,9 +9,3 @@
 
    distribution.rst
 
-   dot-net.rst
-
-
-
-
-
diff --git a/pypy/doc/coding-guide.rst b/pypy/doc/coding-guide.rst
--- a/pypy/doc/coding-guide.rst
+++ b/pypy/doc/coding-guide.rst
@@ -742,9 +742,9 @@
 Testing modules in ``lib_pypy/``
 --------------------------------
 
-You can go to the `lib_pypy/pypy_test/`_ directory and invoke the testing tool
+You can go to the `pypy/module/test_lib_pypy/`_ directory and invoke the testing tool
 ("py.test" or "python ../../pypy/test_all.py") to run tests against the
-lib_pypy hierarchy.  Note, that tests in `lib_pypy/pypy_test/`_ are allowed
+lib_pypy hierarchy.  Note, that tests in `pypy/module/test_lib_pypy/`_ are allowed
 and encouraged to let their tests run at interpreter level although
 `lib_pypy/`_ modules eventually live at PyPy's application level.
 This allows us to quickly test our python-coded reimplementations
@@ -835,15 +835,6 @@
 web interface.
 
 .. _`development tracker`: https://bugs.pypy.org/
-
-use your codespeak login or register
-------------------------------------
-
-If you have an existing codespeak account, you can use it to login within the
-tracker. Else, you can `register with the tracker`_ easily.
-
-
-.. _`register with the tracker`: https://bugs.pypy.org/user?@template=register
 .. _`roundup`: http://roundup.sourceforge.net/
 
 
diff --git a/pypy/doc/config/opt.rst b/pypy/doc/config/opt.rst
--- a/pypy/doc/config/opt.rst
+++ b/pypy/doc/config/opt.rst
@@ -46,5 +46,5 @@
 The default level is `2`.
 
 
-.. _`Boehm-Demers-Weiser garbage collector`: http://www.hpl.hp.com/personal/Hans_Boehm/gc/
+.. _`Boehm-Demers-Weiser garbage collector`: http://hboehm.info/gc/
 .. _`custom garbage collectors`: ../garbage_collection.html
diff --git a/pypy/doc/config/translation.backendopt.txt b/pypy/doc/config/translation.backendopt.txt
--- a/pypy/doc/config/translation.backendopt.txt
+++ b/pypy/doc/config/translation.backendopt.txt
@@ -1,5 +1,5 @@
 This group contains options about various backend optimization passes. Most of
 them are described in the `EU report about optimization`_
 
-.. _`EU report about optimization`: http://codespeak.net/pypy/extradoc/eu-report/D07.1_Massive_Parallelism_and_Translation_Aspects-2007-02-28.pdf
+.. _`EU report about optimization`: https://bitbucket.org/pypy/extradoc/raw/tip/eu-report/D07.1_Massive_Parallelism_and_Translation_Aspects-2007-02-28.pdf
 
diff --git a/pypy/doc/cppyy_backend.rst b/pypy/doc/cppyy_backend.rst
--- a/pypy/doc/cppyy_backend.rst
+++ b/pypy/doc/cppyy_backend.rst
@@ -51,3 +51,6 @@
 to ``PATH``).
 In case of the former, include files are expected under ``$ROOTSYS/include``
 and libraries under ``$ROOTSYS/lib``.
+
+
+.. include:: _ref.txt
diff --git a/pypy/doc/dir-reference.rst b/pypy/doc/dir-reference.rst
--- a/pypy/doc/dir-reference.rst
+++ b/pypy/doc/dir-reference.rst
@@ -47,7 +47,7 @@
 `pypy/tool/`_                      various utilities and hacks used
                                    from various places
 
-`pypy/tool/algo/`_                 general-purpose algorithmic and mathematic
+`rpython/tool/algo/`_              general-purpose algorithmic and mathematic
                                    tools
 
 `pypy/tool/pytest/`_               support code for our `testing methods`_
@@ -129,3 +129,4 @@
 .. _Mono: http://www.mono-project.com/
 .. _`"standard library"`: rlib.html
 .. _`graph viewer`: getting-started-dev.html#try-out-the-translator
+.. include:: _ref.txt
diff --git a/pypy/doc/discussions.rst b/pypy/doc/discussions.rst
--- a/pypy/doc/discussions.rst
+++ b/pypy/doc/discussions.rst
@@ -11,7 +11,5 @@
 	discussion/finalizer-order.rst
 	discussion/howtoimplementpickling.rst
 	discussion/improve-rpython.rst
-	discussion/outline-external-ootype.rst
-	discussion/VM-integration.rst
 
 
diff --git a/pypy/doc/distribution.rst b/pypy/doc/distribution.rst
--- a/pypy/doc/distribution.rst
+++ b/pypy/doc/distribution.rst
@@ -1,5 +1,3 @@
-.. include:: needswork.txt
-
 =============================
 lib_pypy/distributed features
 =============================
diff --git a/pypy/doc/embedding.rst b/pypy/doc/embedding.rst
--- a/pypy/doc/embedding.rst
+++ b/pypy/doc/embedding.rst
@@ -51,6 +51,8 @@
 
 .. function:: int pypy_execute_source_ptr(char* source, void* ptr);
 
+   .. note:: Not available in PyPy <= 2.2.1
+   
    Just like the above, except it registers a magic argument in the source
    scope as ``c_argument``, where ``void*`` is encoded as Python int.
 
@@ -100,9 +102,29 @@
 
 Worked!
 
+.. note:: If the compilation fails because of missing PyPy.h header file,
+          you are running PyPy <= 2.2.1, please see the section `Missing PyPy.h`_.
+
+Missing PyPy.h
+--------------
+
+.. note:: PyPy.h is in the nightly builds and goes to new PyPy releases (>2.2.1).
+
+For PyPy <= 2.2.1, you can download PyPy.h from PyPy repository (it has been added in commit c4cd6ec):
+
+.. code-block:: bash
+
+    cd /opt/pypy/include
+    wget https://bitbucket.org/pypy/pypy/raw/c4cd6eca9358066571500ac82aaacfdaa3889e8c/include/PyPy.h
+
+
 More advanced example
 ---------------------
 
+.. note:: This example depends on pypy_execute_source_ptr which is not available
+          in PyPy <= 2.2.1. You might want to see the alternative example
+          below.
+
 Typically we need something more to do than simply execute source. The following
 is a fully fledged example, please consult cffi documentation for details.
 It's a bit longish, but it captures a gist what can be done with the PyPy
@@ -161,6 +183,97 @@
 is that we would pass a struct full of callbacks to ``pypy_execute_source_ptr``
 and fill the structure from Python side for the future use.
 
+Alternative example
+-------------------
+
+As ``pypy_execute_source_ptr`` is not available in PyPy 2.2.1, you might want to try 
+an alternative approach which relies on -export-dynamic flag to the GNU linker. 
+The downside to this approach is that it is platform dependent.
+
+.. code-block:: c
+
+    #include "include/PyPy.h"
+    #include <stdio.h>
+
+    char source[] = "from cffi import FFI\n\
+    ffi = FFI()\n\
+    @ffi.callback('int(int)')\n\
+    def func(a):\n\
+        print 'Got from C %d' % a\n\
+        return a * 2\n\
+    ffi.cdef('int callback(int (*func)(int));')\n\
+    lib = ffi.verify('int callback(int (*func)(int));')\n\
+    lib.callback(func)\n\
+    print 'finished the Python part'\n\
+    ";
+
+    int callback(int (*func)(int))
+    {
+        printf("Calling to Python, result: %d\n", func(3));
+    }
+
+    int main()
+    {
+        int res;
+        void *lib, *func;
+
+        rpython_startup_code();
+        res = pypy_setup_home("/opt/pypy/bin/libpypy-c.so", 1);
+        if (res) {
+            printf("Error setting pypy home!\n");
+            return 1;
+        }
+        res = pypy_execute_source(source);
+        if (res) {
+            printf("Error calling pypy_execute_source!\n");
+        }
+        return res;
+    }
+
+
+Make sure to pass -export-dynamic flag when compiling::
+
+   $ gcc -g -o x x.c -lpypy-c -L. -export-dynamic
+   $ LD_LIBRARY_PATH=. ./x
+   Got from C 3
+   Calling to Python, result: 6
+   finished the Python part
+
+Finding pypy_home
+-----------------
+
+Function pypy_setup_home takes one parameter - the path to libpypy. There's 
+currently no "clean" way (pkg-config comes to mind) how to find this path. You 
+can try the following (GNU-specific) hack (don't forget to link against *dl*):
+
+.. code-block:: c
+
+    #if !(_GNU_SOURCE)
+    #define _GNU_SOURCE
+    #endif
+
+    #include <dlfcn.h>
+    #include <limits.h>
+    #include <stdlib.h>
+
+    // caller should free returned pointer to avoid memleaks
+    // returns NULL on error
+    char* guess_pypyhome() {
+        // glibc-only (dladdr is why we #define _GNU_SOURCE)
+        Dl_info info;
+        void *_rpython_startup_code = dlsym(0,"rpython_startup_code");
+        if (_rpython_startup_code == 0) {
+            return 0;
+        }
+        if (dladdr(_rpython_startup_code, &info) != 0) {
+            const char* lib_path = info.dli_fname;
+            char* lib_realpath = realpath(lib_path, 0);
+            return lib_realpath;
+        }
+        return 0;
+    }
+
+
 Threading
 ---------
 
diff --git a/pypy/doc/eventhistory.rst b/pypy/doc/eventhistory.rst
--- a/pypy/doc/eventhistory.rst
+++ b/pypy/doc/eventhistory.rst
@@ -17,7 +17,7 @@
 
 Read more in the `EuroPython 2006 sprint report`_.
 
-.. _`EuroPython 2006 sprint report`: http://codespeak.net/pypy/extradoc/sprintinfo/post-ep2006/report.txt
+.. _`EuroPython 2006 sprint report`: https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/post-ep2006/report.txt
 
 PyPy at XP 2006 and Agile 2006
 ==================================================================
@@ -41,8 +41,8 @@
 Read more in `the sprint announcement`_, see who is  planning to attend
 on the `people page`_.
 
-.. _`the sprint announcement`: http://codespeak.net/pypy/extradoc/sprintinfo/ddorf2006/announce.html
-.. _`people page`: http://codespeak.net/pypy/extradoc/sprintinfo/ddorf2006/people.html
+.. _`the sprint announcement`: https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/ddorf2006/announce.html
+.. _`people page`: https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/ddorf2006/people.txt
 
 PyPy sprint at Akihabara (Tokyo, Japan)
 ==================================================================
@@ -84,8 +84,8 @@
 
 Read the report_ and the original announcement_.
 
-.. _report: http://codespeak.net/pypy/extradoc/sprintinfo/louvain-la-neuve-2006/report.html
-.. _announcement: http://codespeak.net/pypy/extradoc/sprintinfo/louvain-la-neuve-2006/sprint-announcement.html
+.. _report: https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/louvain-la-neuve-2006/report.txt
+.. _announcement: https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/louvain-la-neuve-2006/sprint-announcement.txt
 
 PyCon Sprint 2006 (Dallas, Texas, USA)
 ==================================================================
@@ -114,7 +114,7 @@
 said they were interested in the outcome and would keep an eye on its
 progress. Read the `talk slides`_.
 
-.. _`talk slides`: http://codespeak.net/pypy/extradoc/talk/solutions-linux-paris-2006.html
+.. _`talk slides`: https://bitbucket.org/pypy/extradoc/raw/tip/talk/solutions-linux-paris-2006.html
 
 
 PyPy Sprint in Palma De Mallorca 23rd - 29th January 2006
@@ -129,9 +129,9 @@
 for the first three days and `one for the rest of the sprint`_.
 
 
-.. _`the announcement`: http://codespeak.net/pypy/extradoc/sprintinfo/mallorca/sprint-announcement.html
-.. _`sprint report`: http://codespeak.net/pipermail/pypy-dev/2006q1/002746.html 
-.. _`one for the rest of the sprint`: http://codespeak.net/pipermail/pypy-dev/2006q1/002749.html 
+.. _`the announcement`: https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/mallorca/sprint-announcement.txt
+.. _`sprint report`: https://mail.python.org/pipermail/pypy-dev/2006-January/002746.html
+.. _`one for the rest of the sprint`: https://mail.python.org/pipermail/pypy-dev/2006-January/002749.html
 
 Preliminary EU reports released
 ===============================
@@ -155,8 +155,8 @@
 Michael and Carl have written a `report about the first half`_ and `one about
 the second half`_ of the sprint.  *(12/18/2005)*
 
-.. _`report about the first half`: http://codespeak.net/pipermail/pypy-dev/2005q4/002656.html
-.. _`one about the second half`: http://codespeak.net/pipermail/pypy-dev/2005q4/002660.html
+.. _`report about the first half`: https://mail.python.org/pipermail/pypy-dev/2005-December/002656.html
+.. _`one about the second half`: https://mail.python.org/pipermail/pypy-dev/2005-December/002660.html
 
 PyPy release 0.8.0
 =================== 
@@ -187,12 +187,12 @@
 way back.
 *(10/18/2005)*
 
-.. _`Logilab offices in Paris`: http://codespeak.net/pypy/extradoc/sprintinfo/paris-2005-sprint.html 
+.. _`Logilab offices in Paris`: https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/paris-2005-sprint.txt 
 .. _JIT: http://en.wikipedia.org/wiki/Just-in-time_compilation
 .. _`continuation-passing`: http://en.wikipedia.org/wiki/Continuation_passing_style
-.. _`report about day one`: http://codespeak.net/pipermail/pypy-dev/2005q4/002510.html
-.. _`one about day two and three`: http://codespeak.net/pipermail/pypy-dev/2005q4/002512.html
-.. _`the rest of the sprint`: http://codespeak.net/pipermail/pypy-dev/2005q4/002514.html
+.. _`report about day one`: https://mail.python.org/pipermail/pypy-dev/2005-October/002510.html
+.. _`one about day two and three`: https://mail.python.org/pipermail/pypy-dev/2005-October/002512.html
+.. _`the rest of the sprint`: https://mail.python.org/pipermail/pypy-dev/2005-October/002514.html
 
 PyPy release 0.7.0
 =================== 
@@ -217,15 +217,13 @@
 Its main focus is translation of the whole PyPy interpreter 
 to a low level language and reaching 2.4.1 Python compliance.
 The goal of the sprint is to release a first self-contained
-PyPy-0.7 version.  Carl has written a report about `day 1 - 3`_, 
-there are `some pictures`_ online and a `heidelberg summary report`_
-detailing some of the works that led to the successful release 
-of `pypy-0.7.0`_! 
+PyPy-0.7 version.  Carl has written a report about `day 1 - 3`_
+and a `heidelberg summary report`_ detailing some of the works
+that led to the successful release of `pypy-0.7.0`_! 
 
-.. _`heidelberg summary report`: http://codespeak.net/pypy/extradoc/sprintinfo/Heidelberg-report.html 
-.. _`PyPy sprint`: http://codespeak.net/pypy/extradoc/sprintinfo/Heidelberg-sprint.html
-.. _`day 1 - 3`: http://codespeak.net/pipermail/pypy-dev/2005q3/002287.html
-.. _`some pictures`: http://codespeak.net/~hpk/heidelberg-sprint/
+.. _`heidelberg summary report`: https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/Heidelberg-report.txt
+.. _`PyPy sprint`: https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/Heidelberg-sprint.txt
+.. _`day 1 - 3`: https://mail.python.org/pipermail/pypy-dev/2005-August/002287.html
 
 PyPy Hildesheim2 finished: first self-contained PyPy run! 
 ===========================================================
@@ -233,20 +231,16 @@
 Up until 31st August we were in a PyPy sprint at `Trillke-Gut`_. 
 Carl has written a `report about day 1`_, Holger 
 about `day 2 and day 3`_ and Carl again about `day 4 and day 5`_, 
-On `day 6`_ Holger reports the `breakthrough`_: PyPy runs 
-on its own! Hurray_!.  And Carl finally reports about the winding
+On `day 6`_ Holger reports the breakthrough: PyPy runs 
+on its own! Hurray!.  And Carl finally reports about the winding
 down of `day 7`_ which saw us relaxing, discussing and generally 
-having a good time.   You might want to look at the selected 
-`pictures from the sprint`_. 
+having a good time.
 
-.. _`report about day 1`: http://codespeak.net/pipermail/pypy-dev/2005q3/002217.html 
-.. _`day 2 and day 3`: http://codespeak.net/pipermail/pypy-dev/2005q3/002220.html
-.. _`day 4 and day 5`: http://codespeak.net/pipermail/pypy-dev/2005q3/002234.html
-.. _`day 6`: http://codespeak.net/pipermail/pypy-dev/2005q3/002239.html
-.. _`day 7`: http://codespeak.net/pipermail/pypy-dev/2005q3/002245.html
-.. _`breakthrough`: http://codespeak.net/~hpk/hildesheim2-sprint-www/hildesheim2-sprint-www-Thumbnails/36.jpg
-.. _`hurray`: http://codespeak.net/~hpk/hildesheim2-sprint-www/hildesheim2-sprint-www-Pages/Image37.html
-.. _`pictures from the sprint`: http://codespeak.net/~hpk/hildesheim2-sprint-www/ 
+.. _`report about day 1`: https://mail.python.org/pipermail/pypy-dev/2005-July/002217.html
+.. _`day 2 and day 3`: https://mail.python.org/pipermail/pypy-dev/2005-July/002220.html
+.. _`day 4 and day 5`: https://mail.python.org/pipermail/pypy-dev/2005-July/002234.html
+.. _`day 6`: https://mail.python.org/pipermail/pypy-dev/2005-July/002239.html
+.. _`day 7`: https://mail.python.org/pipermail/pypy-dev/2005-August/002245.html
 .. _`Trillke-Gut`: http://www.trillke.net
 
 EuroPython 2005 sprints finished 
@@ -264,15 +258,15 @@
 the LLVM backends and type inference in general.  
 *(07/13/2005)* 
 
-.. _`day 1`: http://codespeak.net/pipermail/pypy-dev/2005q2/002169.html
-.. _`day 2`: http://codespeak.net/pipermail/pypy-dev/2005q2/002171.html
-.. _`day 3`: http://codespeak.net/pipermail/pypy-dev/2005q2/002172.html
-.. _`pypy-dev`: http://mail.python.org/mailman/listinfo/pypy-dev
+.. _`day 1`: https://mail.python.org/pipermail/pypy-dev/2005-June/002169.html
+.. _`day 2`: https://mail.python.org/pipermail/pypy-dev/2005-June/002171.html
+.. _`day 3`: https://mail.python.org/pipermail/pypy-dev/2005-June/002172.html
+.. _`pypy-dev`: https://mail.python.org/mailman/listinfo/pypy-dev
 
 .. _EuroPython: http://europython.org 
 .. _`translation`: translation.html 
-.. _`sprint announcement`: http://codespeak.net/pypy/extradoc/sprintinfo/EP2005-announcement.html
-.. _`list of people coming`: http://codespeak.net/pypy/extradoc/sprintinfo/EP2005-people.html
+.. _`sprint announcement`: https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/EP2005-announcement.html
+.. _`list of people coming`: https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/EP2005-people.html
 
 Duesseldorf PyPy sprint 2-9 June 2006
 ==================================================================
@@ -285,8 +279,8 @@
 Read more in `the sprint announcement`_, see who is  planning to attend
 on the `people page`_.
 
-.. _`the sprint announcement`: http://codespeak.net/pypy/extradoc/sprintinfo/ddorf2006/announce.html
-.. _`people page`: http://codespeak.net/pypy/extradoc/sprintinfo/ddorf2006/people.html
+.. _`the sprint announcement`: https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/ddorf2006/announce.txt
+.. _`people page`: https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/ddorf2006/people.txt
 
 
 PyPy at XP 2006 and Agile 2006
diff --git a/pypy/doc/extradoc.rst b/pypy/doc/extradoc.rst
--- a/pypy/doc/extradoc.rst
+++ b/pypy/doc/extradoc.rst
@@ -79,7 +79,7 @@
 .. _`Tracing the Meta-Level: PyPy's Tracing JIT Compiler`: https://bitbucket.org/pypy/extradoc/raw/tip/talk/icooolps2009/bolz-tracing-jit.pdf
 .. _`Faster than C#: Efficient Implementation of Dynamic Languages on .NET`: https://bitbucket.org/pypy/extradoc/raw/tip/talk/icooolps2009-dotnet/cli-jit.pdf
 .. _`Automatic JIT Compiler Generation with Runtime Partial Evaluation`: http://wwwold.cobra.cs.uni-duesseldorf.de/thesis/final-master.pdf
-.. _`RPython: A Step towards Reconciling Dynamically and Statically Typed OO Languages`: http://www.disi.unige.it/person/AnconaD/papers/Recent_abstracts.html#AACM-DLS07
+.. _`RPython: A Step towards Reconciling Dynamically and Statically Typed OO Languages`: http://www.disi.unige.it/person/AnconaD/papers/DynamicLanguages_abstracts.html#AACM-DLS07
 .. _`EU Reports`: index-report.html
 .. _`Hardware Transactional Memory Support for Lightweight Dynamic Language Evolution`: http://sabi.net/nriley/pubs/dls6-riley.pdf
 .. _`PyGirl: Generating Whole-System VMs from High-Level Prototypes using PyPy`: http://scg.unibe.ch/archive/papers/Brun09cPyGirl.pdf
@@ -356,8 +356,6 @@
 .. _`transparent dynamic optimization`: http://www.hpl.hp.com/techreports/1999/HPL-1999-77.pdf
 .. _Dynamo: http://www.hpl.hp.com/techreports/1999/HPL-1999-78.pdf
 .. _testdesign: coding-guide.html#test-design
-.. _feasible: http://codespeak.net/pipermail/pypy-dev/2004q2/001289.html
-.. _rock: http://codespeak.net/pipermail/pypy-dev/2004q1/001255.html
 .. _LLVM: http://llvm.org/
 .. _IronPython: http://ironpython.codeplex.com/
 .. _`Dynamic Native Optimization of Native Interpreters`: http://people.csail.mit.edu/gregs/dynamorio.html
diff --git a/pypy/doc/faq.rst b/pypy/doc/faq.rst
--- a/pypy/doc/faq.rst
+++ b/pypy/doc/faq.rst
@@ -429,12 +429,27 @@
 Could we use LLVM?
 ------------------
 
-There is a (static) translation backend using LLVM in the branch
-``llvm-translation-backend``.  It can translate PyPy with or without the JIT on
-Linux.
+In theory yes.  But we tried to use it 5 or 6 times already, as a
+translation backend or as a JIT backend --- and failed each time.
 
-Using LLVM as our JIT backend looks interesting as well -- we made an attempt,
-but it failed: LLVM has no way to patch the generated machine code.
+In more details: using LLVM as a (static) translation backend is
+pointless nowadays because you can generate C code and compile it with
+clang.  (Note that compiling PyPy with clang gives a result that is not
+faster than compiling it with gcc.)  We might in theory get extra
+benefits from LLVM's GC integration, but this requires more work on the
+LLVM side before it would be remotely useful.  Anyway, it could be
+interfaced via a custom primitive in the C code.  (The latest such
+experimental backend is in the branch ``llvm-translation-backend``,
+which can translate PyPy with or without the JIT on Linux.)
+
+On the other hand, using LLVM as our JIT backend looks interesting as
+well --- but again we made an attempt, and it failed: LLVM has no way to
+patch the generated machine code.
+
+So the position of the core PyPy developers is that if anyone wants to
+make an N+1'th attempt with LLVM, they are welcome, and will be happy to
+provide help in the IRC channel, but they are left with the burden of proof
+that (a) it works and (b) it gives important benefits.
 
 ----------------------
 How do I compile PyPy?
diff --git a/pypy/doc/getting-started-dev.rst b/pypy/doc/getting-started-dev.rst
--- a/pypy/doc/getting-started-dev.rst
+++ b/pypy/doc/getting-started-dev.rst
@@ -222,7 +222,7 @@
 
 PyPy development always was and is still thoroughly test-driven.
 We use the flexible `py.test testing tool`_ which you can `install independently
-<http://pytest.org/getting-started.html>`_ and use for other projects.
+<http://pytest.org/latest/getting-started.html#getstarted>`_ and use for other projects.
 
 The PyPy source tree comes with an inlined version of ``py.test``
 which you can invoke by typing::
@@ -264,7 +264,7 @@
 interpreter.
 
 .. _`py.test testing tool`: http://pytest.org
-.. _`py.test usage and invocations`: http://pytest.org/usage.html#usage
+.. _`py.test usage and invocations`: http://pytest.org/latest/usage.html#usage
 
 Special Introspection Features of the Untranslated Python Interpreter
 ---------------------------------------------------------------------
diff --git a/pypy/doc/glossary.rst b/pypy/doc/glossary.rst
--- a/pypy/doc/glossary.rst
+++ b/pypy/doc/glossary.rst
@@ -1,5 +1,3 @@
-.. include:: needswork.txt
-
 .. _glossary:
 
 ********
diff --git a/pypy/doc/interpreter.rst b/pypy/doc/interpreter.rst
--- a/pypy/doc/interpreter.rst
+++ b/pypy/doc/interpreter.rst
@@ -256,7 +256,7 @@
 example and the higher level `chapter on Modules in the coding
 guide`_.
 
-.. _`__builtin__ module`: https://bitbucket.org/pypy/pypy/src/tip/pypy/module/__builtin__/
+.. _`__builtin__ module`: https://bitbucket.org/pypy/pypy/src/default/pypy/module/__builtin__/
 .. _`chapter on Modules in the coding guide`: coding-guide.html#modules
 
 .. _`Gateway classes`:
diff --git a/pypy/doc/objspace-proxies.rst b/pypy/doc/objspace-proxies.rst
--- a/pypy/doc/objspace-proxies.rst
+++ b/pypy/doc/objspace-proxies.rst
@@ -185,6 +185,6 @@
 .. _`standard object space`: objspace.html#the-standard-object-space
 
 .. [D12.1] `High-Level Backends and Interpreter Feature Prototypes`, PyPy
-           EU-Report, 2007, http://codespeak.net/pypy/extradoc/eu-report/D12.1_H-L-Backends_and_Feature_Prototypes-2007-03-22.pdf
+           EU-Report, 2007, https://bitbucket.org/pypy/extradoc/raw/tip/eu-report/D12.1_H-L-Backends_and_Feature_Prototypes-2007-03-22.pdf
 
 .. include:: _ref.txt
diff --git a/pypy/doc/objspace.rst b/pypy/doc/objspace.rst
--- a/pypy/doc/objspace.rst
+++ b/pypy/doc/objspace.rst
@@ -339,44 +339,35 @@
 Object types
 ------------
 
-The larger part of the `pypy/objspace/std/`_ package defines and implements the
-library of Python's standard built-in object types.  Each type (int, float,
-list, tuple, str, type, etc.) is typically implemented by two modules:
+The larger part of the `pypy/objspace/std/`_ package defines and
+implements the library of Python's standard built-in object types.  Each
+type ``xxx`` (int, float, list, tuple, str, type, etc.) is typically
+implemented in the module ``xxxobject.py``.
 
-* the *type specification* module, which for a type ``xxx`` is called ``xxxtype.py``;
+The ``W_AbstractXxxObject`` class, when present, is the abstract base
+class, which mainly defines what appears on the Python-level type
+object.  There are then actual implementations as subclasses, which are
+called ``W_XxxObject`` or some variant for the cases where we have
+several different implementations.  For example,
+`pypy/objspace/std/bytesobject.py`_ defines ``W_AbstractBytesObject``,
+which contains everything needed to build the ``str`` app-level type;
+and there are subclasses ``W_BytesObject`` (the usual string) and
+``W_StringBufferObject`` (a special implementation tweaked for repeated
+additions, in `pypy/objspace/std/strbufobject.py`_).  For mutable data
+types like lists and dictionaries, we have a single class
+``W_ListObject`` or ``W_DictMultiObject`` which has an indirection to
+the real data and a strategy; the strategy can change as the content of
+the object changes.
 
-* the *implementation* module, called ``xxxobject.py``.
-
-The ``xxxtype.py`` module basically defines the type object itself.  For
-example, `pypy/objspace/std/listtype.py`_ contains the specification of the object you get when
-you type ``list`` in a PyPy prompt.  `pypy/objspace/std/listtype.py`_ enumerates the methods
-specific to lists, like ``append()``.
-
-A particular method implemented by all types is the ``__new__()`` special
-method, which in Python's new-style-classes world is responsible for creating
-an instance of the type.  In PyPy, ``__new__()`` locates and imports the module
-implementing *instances* of the type, and creates such an instance based on the
-arguments the user supplied to the constructor.  For example, `pypy/objspace/std/tupletype.py`_
-defines ``__new__()`` to import the class ``W_TupleObject`` from
-`pypy/objspace/std/tupleobject.py`_ and instantiate it.  The `pypy/objspace/std/tupleobject.py`_ then contains a
-"real" implementation of tuples: the way the data is stored in the
-``W_TupleObject`` class, how the operations work, etc.
-
-The goal of the above module layout is to cleanly separate the Python
-type object, visible to the user, and the actual implementation of its
-instances.  It is possible to provide *several* implementations of the
-instances of the same Python type, by writing several ``W_XxxObject``
-classes.  Every place that instantiates a new object of that Python type
-can decide which ``W_XxxObject`` class to instantiate.
-
-From the user's point of view, the multiple internal ``W_XxxObject``
-classes are not visible: they are still all instances of exactly the
-same Python type.  PyPy knows that (e.g.) the application-level type of
-its interpreter-level ``W_StringObject`` instances is str because
-there is a ``typedef`` class attribute in ``W_StringObject`` which
-points back to the string type specification from `pypy/objspace/std/stringtype.py`_; all
-other implementations of strings use the same ``typedef`` from
-`pypy/objspace/std/stringtype.py`_.
+From the user's point of view, even when there are several
+``W_AbstractXxxObject`` subclasses, this is not visible: at the
+app-level, they are still all instances of exactly the same Python type.
+PyPy knows that (e.g.) the application-level type of its
+interpreter-level ``W_BytesObject`` instances is str because there is a
+``typedef`` class attribute in ``W_BytesObject`` which points back to
+the string type specification from `pypy/objspace/std/bytesobject.py`_;
+all other implementations of strings use the same ``typedef`` from
+`pypy/objspace/std/bytesobject.py`_.
 
 For other examples of multiple implementations of the same Python type,
 see `Standard Interpreter Optimizations`_.
@@ -387,6 +378,9 @@
 Multimethods
 ------------
 
+*Note: multimethods are on the way out.  Although they look cool,
+they failed to provide enough benefits.*
+
 The Standard Object Space allows multiple object implementations per
 Python type - this is based on multimethods_.  For a description of the
 multimethod variant that we implemented and which features it supports,
@@ -491,7 +485,7 @@
 Introduction
 ------------
 
-The task of the FlowObjSpace (the source is at `pypy/objspace/flow/`_) is to generate a control-flow graph from a
+The task of the FlowObjSpace (the source is at `rpython/flowspace/`_) is to generate a control-flow graph from a
 function.  This graph will also contain a trace of the individual operations, so
 that it is actually just an alternate representation for the function.
 
diff --git a/pypy/doc/rffi.rst b/pypy/doc/rffi.rst
--- a/pypy/doc/rffi.rst
+++ b/pypy/doc/rffi.rst
@@ -43,7 +43,7 @@
 See cbuild_ for more info on ExternalCompilationInfo.
 
 .. _`low level types`: rtyper.html#low-level-type
-.. _cbuild: https://bitbucket.org/pypy/pypy/src/tip/rpython/translator/tool/cbuild.py
+.. _cbuild: https://bitbucket.org/pypy/pypy/src/default/rpython/translator/tool/cbuild.py
 
 
 Types
@@ -56,7 +56,7 @@
 flavor='raw'. There are several helpers like string -> char*
 converter, refer to the source for details.
 
-.. _rffi: https://bitbucket.org/pypy/pypy/src/tip/pypy/rpython/lltypesystem/rffi.py
+.. _rffi: https://bitbucket.org/pypy/pypy/src/default/rpython/rtyper/lltypesystem/rffi.py
 
 Registering function as external
 ---------------------------------
@@ -68,4 +68,4 @@
 functions, passing llimpl as an argument and eventually llfakeimpl
 as a fake low-level implementation for tests performed by an llinterp.
 
-.. _`extfunc.py`: https://bitbucket.org/pypy/pypy/src/tip/pypy/rpython/extfunc.py
+.. _`extfunc.py`: https://bitbucket.org/pypy/pypy/src/default/rpython/rtyper/extfunc.py
diff --git a/pypy/doc/sprint-reports.rst b/pypy/doc/sprint-reports.rst
--- a/pypy/doc/sprint-reports.rst
+++ b/pypy/doc/sprint-reports.rst
@@ -42,30 +42,30 @@
   * `CERN (July 2010)`_
   * `Düsseldorf (October 2010)`_
 
-    .. _Hildesheim (Feb 2003): http://codespeak.net/pypy/extradoc/sprintinfo/HildesheimReport.html
-    .. _Gothenburg (May 2003): http://codespeak.net/pypy/extradoc/sprintinfo/gothenburg-2003-sprintreport.txt
-    .. _LovainLaNeuve (June 2003): http://codespeak.net/pypy/extradoc/sprintinfo/LouvainLaNeuveReport.txt
-    .. _Berlin (Sept 2003): http://codespeak.net/pypy/extradoc/sprintinfo/BerlinReport.txt
-    .. _Amsterdam (Dec 2003): http://codespeak.net/pypy/extradoc/sprintinfo/AmsterdamReport.txt
-    .. _Vilnius (Nov 2004): http://codespeak.net/pypy/extradoc/sprintinfo/vilnius-2004-sprintreport.txt
-    .. _Leysin (Jan 2005): http://codespeak.net/pypy/extradoc/sprintinfo/LeysinReport.txt
-    .. _PyCon/Washington (March  2005): http://codespeak.net/pypy/extradoc/sprintinfo/pycon_sprint_report.txt
-    .. _Europython/Gothenburg (June 2005): http://codespeak.net/pypy/extradoc/sprintinfo/ep2005-sprintreport.txt
-    .. _Hildesheim (July 2005): http://codespeak.net/pypy/extradoc/sprintinfo/hildesheim2005-sprintreport.txt
-    .. _Heidelberg (Aug 2005): http://codespeak.net/pypy/extradoc/sprintinfo/Heidelberg-report.txt
-    .. _Paris (Oct 2005): http://codespeak.net/pypy/extradoc/sprintinfo/paris/paris-report.txt
-    .. _Gothenburg (Dec 2005): http://codespeak.net/pypy/extradoc/sprintinfo/gothenburg-2005/gothenburg-dec2005-sprintreport.txt
-    .. _Mallorca (Jan 2006): http://codespeak.net/pypy/extradoc/sprintinfo/mallorca/mallorca-sprintreport.txt
-    .. _LouvainLaNeuve (March 2006): http://codespeak.net/pypy/extradoc/sprintinfo/louvain-la-neuve-2006/report.txt
-    .. _Leysin (April 2006): http://codespeak.net/pypy/extradoc/sprintinfo/leysin-winter-2006-sprintreport.txt
-    .. _Tokyo (April 2006): http://codespeak.net/pypy/extradoc/sprintinfo/tokyo/sprint-report.txt
-    .. _Düsseldorf (June 2006): http://codespeak.net/pypy/extradoc/sprintinfo/ddorf2006/report1.txt
-    .. _Europython/Geneva (July 2006): http://codespeak.net/pypy/extradoc/sprintinfo/post-ep2006/report.txt
-    .. _Düsseldorf (October 2006): http://codespeak.net/pypy/extradoc/sprintinfo/ddorf2006b/report.txt
-    .. _`Leysin (January 2007)`: http://codespeak.net/pypy/extradoc/sprintinfo/leysin-winter-2007/report.txt
-    .. _Hildesheim (Feb 2007): http://codespeak.net/pypy/extradoc/sprintinfo/trillke-2007/sprint-report.txt
-    .. _`EU report writing sprint`: http://codespeak.net/pypy/extradoc/sprintinfo/trillke-2007/eu-report-sprint-report.txt
-    .. _`PyCon/Dallas (Feb 2006)`: http://codespeak.net/pypy/extradoc/sprintinfo/pycon06/sprint-report.txt
+    .. _Hildesheim (Feb 2003): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/HildesheimReport.txt
+    .. _Gothenburg (May 2003): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/gothenburg-2003-sprintreport.txt
+    .. _LovainLaNeuve (June 2003): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/LouvainLaNeuveReport.txt
+    .. _Berlin (Sept 2003): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/BerlinReport.txt
+    .. _Amsterdam (Dec 2003): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/AmsterdamReport.txt
+    .. _Vilnius (Nov 2004): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/vilnius-2004-sprintreport.txt
+    .. _Leysin (Jan 2005): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/LeysinReport.txt
+    .. _PyCon/Washington (March  2005): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/pycon_sprint_report.txt
+    .. _Europython/Gothenburg (June 2005): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/ep2005-sprintreport.txt
+    .. _Hildesheim (July 2005): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/hildesheim2005-sprintreport.txt
+    .. _Heidelberg (Aug 2005): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/Heidelberg-report.txt
+    .. _Paris (Oct 2005): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/paris/paris-report.txt
+    .. _Gothenburg (Dec 2005): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/gothenburg-2005/gothenburg-dec2005-sprintreport.txt
+    .. _Mallorca (Jan 2006): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/mallorca/mallorca-sprintreport.txt
+    .. _LouvainLaNeuve (March 2006): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/louvain-la-neuve-2006/report.txt
+    .. _Leysin (April 2006): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/leysin-winter-2006-sprintreport.txt
+    .. _Tokyo (April 2006): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/tokyo/sprint-report.txt
+    .. _Düsseldorf (June 2006): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/ddorf2006/report1.txt
+    .. _Europython/Geneva (July 2006): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/post-ep2006/report.txt
+    .. _Düsseldorf (October 2006): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/ddorf2006b/report.txt
+    .. _`Leysin (January 2007)`: https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/leysin-winter-2007/report.txt
+    .. _Hildesheim (Feb 2007): https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/trillke-2007/sprint-report.txt
+    .. _`EU report writing sprint`: https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/trillke-2007/eu-report-sprint-report.txt
+    .. _`PyCon/Dallas (Feb 2006)`: https://bitbucket.org/pypy/extradoc/raw/tip/sprintinfo/pycon06/sprint-report.txt
     .. _`Göteborg (November 2007)`: http://morepypy.blogspot.com/2007_11_01_archive.html
     .. _`Leysin (January 2008)`: http://morepypy.blogspot.com/2008/01/leysin-winter-sport-sprint-started.html
     .. _`Berlin (May 2008)`: http://morepypy.blogspot.com/2008_05_01_archive.html
diff --git a/pypy/doc/statistic/index.rst b/pypy/doc/statistic/index.rst
--- a/pypy/doc/statistic/index.rst
+++ b/pypy/doc/statistic/index.rst
@@ -1,3 +1,7 @@
+.. warning::
+
+   This page is no longer updated, of historical interest only.
+
 =======================
 PyPy Project Statistics
 =======================
diff --git a/pypy/doc/stm.rst b/pypy/doc/stm.rst
new file mode 100644
--- /dev/null
+++ b/pypy/doc/stm.rst
@@ -0,0 +1,284 @@
+======================
+Transactional Memory
+======================
+
+.. contents::
+
+
+This page is about ``pypy-stm``, a special in-development version of
+PyPy which can run multiple independent CPU-hungry threads in the same
+process in parallel.  It is side-stepping what is known in the Python
+world as the "global interpreter lock (GIL)" problem.
+
+"STM" stands for Software Transactional Memory, the technique used
+internally.  This page describes ``pypy-stm`` from the perspective of a
+user, describes work in progress, and finally gives references to more
+implementation details.
+
+This work was done by Remi Meier and Armin Rigo.  Thanks to all donors
+for crowd-funding the work so far!  Please have a look at the 2nd call
+for donation (*not ready yet*)
+
+.. .. _`2nd call for donation`: http://pypy.org/tmdonate2.html
+
+
+Introduction
+============
+
+``pypy-stm`` is a variant of the regular PyPy interpreter.  With caveats
+listed below, it should be in theory within 25%-50% of the speed of a
+regular PyPy, comparing the JITting version in both cases.  It is called
+STM for Software Transactional Memory, which is the internal technique
+used (see `Reference to implementation details`_).
+
+What you get in exchange for this slow-down is that ``pypy-stm`` runs
+any multithreaded Python program on multiple CPUs at once.  Programs
+running two threads or more in parallel should ideally run faster than
+in a regular PyPy, either now or soon as issues are fixed.  In one way,
+that's all there is to it: this is a GIL-less Python, feel free to
+`download and try it`__.  However, the deeper idea behind the
+``pypy-stm`` project is to improve what is so far the state-of-the-art
+for using multiple CPUs, which for cases where separate processes don't
+work is done by writing explicitly multi-threaded programs.  Instead,
+``pypy-stm`` is flushing forward an approach to *hide* the threads, as
+described below in `atomic sections`_.
+
+
+.. __:
+
+Current status
+==============
+
+**pypy-stm requires 64-bit Linux for now.**
+
+Development is done in the branch `stmgc-c7`_.  If you are only
+interested in trying it out, you can download a Ubuntu 12.04 binary
+here__ (``pypy-2.2.x-stm*.tar.bz2``; this version is a release mode,
+but not stripped of debug symbols).  The current version supports four
+"segments", which means that it will run up to four threads in parallel
+(in other words, you get a GIL effect again, but only if trying to
+execute more than 4 threads).
+
+To build a version from sources, you first need to compile a custom
+version of clang; we recommend downloading `llvm and clang like
+described here`__, but at revision 201645 (use ``svn co -r 201645 ...``
+for all checkouts).  Then apply all the patches in `this directory`__:
+they are fixes for the very extensive usage that pypy-stm does of a
+clang-only feature (without them, you get crashes of clang).  Then get
+the branch `stmgc-c7`_ of PyPy and run::
+
+   rpython/bin/rpython -Ojit --stm pypy/goal/targetpypystandalone.py
+
+.. _`stmgc-c7`: https://bitbucket.org/pypy/pypy/src/stmgc-c7/
+.. __: http://cobra.cs.uni-duesseldorf.de/~buildmaster/misc/
+.. __: http://clang.llvm.org/get_started.html
+.. __: https://bitbucket.org/pypy/stmgc/src/default/c7/llvmfix/
+
+
+Caveats:
+
+* So far, small examples work fine, but there are still a number of
+  bugs.  We're busy fixing them.
+
+* Currently limited to 1.5 GB of RAM (this is just a parameter in
+  `core.h`__).  Memory overflows are not detected correctly, so may
+  cause segmentation faults.
+
+* The JIT warm-up time is abysmal (as opposed to the regular PyPy's,
+  which is "only" bad).  Moreover, you should run it with a command like
+  ``pypy-stm --jit trace_limit=60000 args...``; the default value of
+  6000 for ``trace_limit`` is currently too low (6000 should become
+  reasonable again as we improve).  Also, in order to produce machine
+  code, the JIT needs to enter a special single-threaded mode for now.
+  This all means that you *will* get very bad performance results if
+  your program doesn't run for *many* seconds for now.
+
+* The GC is new; although clearly inspired by PyPy's regular GC, it
+  misses a number of optimizations for now.  Programs allocating large
+  numbers of small objects that don't immediately die, as well as
+  programs that modify large lists or dicts, suffer from these missing
+  optimizations.
+
+* The GC has no support for destructors: the ``__del__`` method is never
+  called (including on file objects, which won't be closed for you).
+  This is of course temporary.  Also, weakrefs might appear to work a
+  bit strangely for now (staying alive even though ``gc.collect()``, or
+  even dying but then un-dying for a short time before dying again).
+
+* The STM system is based on very efficient read/write barriers, which
+  are mostly done (their placement could be improved a bit in
+  JIT-generated machine code).  But the overall bookkeeping logic could
+  see more improvements (see Statistics_ below).
+
+* You can use `atomic sections`_, but the most visible missing thing is
+  that you don't get reports about the "conflicts" you get.  This would
+  be the first thing that you need in order to start using atomic
+  sections more extensively.  Also, for now: for better results, try to
+  explicitly force a transaction break just before (and possibly after)
+  each large atomic section, with ``time.sleep(0)``.
+
+* Forking the process is slow because the complete memory needs to be
+  copied manually right now.
+
+* Very long-running processes should eventually crash on an assertion
+  error because of a non-implemented overflow of an internal 29-bit
+  number, but this requires at the very least ten hours --- more
+  probably, several days or more.
+
+.. _`report bugs`: https://bugs.pypy.org/
+.. __: https://bitbucket.org/pypy/pypy/raw/stmgc-c7/rpython/translator/stm/src_stm/stm/core.h
+
+
+
+Statistics
+==========
+
+When a non-main thread finishes, you get statistics printed to stderr,
+looking like that::
+
+      thread 0x7f73377fe600:
+          outside transaction          42182  0.506 s
+          run current                  85466  0.000 s
+          run committed                34262  3.178 s
+          run aborted write write       6982  0.083 s
+          run aborted write read         550  0.005 s
+          run aborted inevitable         388  0.010 s
+          run aborted other                0  0.000 s
+          wait free segment                0  0.000 s
+          wait write read                 78  0.027 s
+          wait inevitable                887  0.490 s
+          wait other                       0  0.000 s
+          bookkeeping                  51418  0.606 s
+          minor gc                    162970  1.135 s
+          major gc                         1  0.019 s
+          sync pause                   59173  1.738 s
+          spin loop                   129512  0.094 s
+
+The first number is a counter; the second number gives the associated
+time (the amount of real time that the thread was in this state; the sum
+of all the times should be equal to the total time between the thread's
+start and the thread's end).  The most important points are "run
+committed", which gives the amount of useful work, and "outside
+transaction", which should give the time spent e.g. in library calls
+(right now it seems to be a bit larger than that; to investigate).
+Everything else is overhead of various forms.  (Short-, medium- and
+long-term future work involves reducing this overhead :-)
+
+These statistics are not printed out for the main thread, for now.
+
+
+Atomic sections
+===============
+
+While one of the goal of pypy-stm is to give a GIL-free but otherwise
+unmodified Python, the other goal is to push for a better way to use
+multithreading.  For this, you (as the Python programmer) get an API
+in the ``__pypy__.thread`` submodule:
+
+* ``__pypy__.thread.atomic``: a context manager (i.e. you use it in
+  a ``with __pypy__.thread.atomic:`` statement).  It runs the whole
+  block of code without breaking the current transaction --- from
+  the point of view of a regular CPython/PyPy, this is equivalent to
+  saying that the GIL will not be released at all between the start and
+  the end of this block of code.
+
+The obvious usage is to use atomic blocks in the same way as one would
+use locks: to protect changes to some shared data, you do them in a
+``with atomic`` block, just like you would otherwise do them in a ``with
+mylock`` block after ``mylock = thread.allocate_lock()``.  This allows
+you not to care about acquiring the correct locks in the correct order;
+it is equivalent to having only one global lock.  This is how
+transactional memory is `generally described`__: as a way to efficiently
+execute such atomic blocks, running them in parallel while giving the
+illusion that they run in some serial order.
+
+.. __: http://en.wikipedia.org/wiki/Transactional_memory
+
+However, the less obvious intended usage of atomic sections is as a
+wide-ranging replacement of explicit threads.  You can turn a program
+that is not multi-threaded at all into a program that uses threads
+internally, together with large atomic sections to keep the behavior
+unchanged.  This capability can be hidden in a library or in the
+framework you use; the end user's code does not need to be explicitly
+aware of using threads.  For a simple example of this, see
+`transaction.py`_ in ``lib_pypy``.  The idea is that if you have a
+program where the function ``f(key, value)`` runs on every item of some
+big dictionary, you can replace the loop with::
+
+    for key, value in bigdict.items():
+        transaction.add(f, key, value)
+    transaction.run()
+
+This code runs the various calls to ``f(key, value)`` using a thread
+pool, but every single call is done in an atomic section.  The end
+result is that the behavior should be exactly equivalent: you don't get
+any extra multithreading issue.
+
+This approach hides the notion of threads from the end programmer,
+including all the hard multithreading-related issues.  This is not the
+first alternative approach to explicit threads; for example, OpenMP_ is
+one.  However, it is one of the first ones which does not require the
+code to be organized in a particular fashion.  Instead, it works on any
+Python program which has got latent, imperfect parallelism.  Ideally, it
+only requires that the end programmer identifies where this parallelism
+is likely to be found, and communicates it to the system, using for
+example the ``transaction.add()`` scheme.
+
+.. _`transaction.py`: https://bitbucket.org/pypy/pypy/raw/stmgc-c7/lib_pypy/transaction.py
+.. _OpenMP: http://en.wikipedia.org/wiki/OpenMP
+
+==================
+
+Other APIs in pypy-stm:
+
+* ``__pypy__.thread.getsegmentlimit()``: return the number of "segments"
+  in this pypy-stm.  This is the limit above which more threads will not
+  be able to execute on more cores.  (Right now it is limited to 4 due
+  to inter-segment overhead, but should be increased in the future.  It
+  should also be settable, and the default value should depend on the
+  number of actual CPUs.)
+
+* ``__pypy__.thread.exclusive_atomic``: same as ``atomic``, but
+  raises an exception if you attempt to nest it inside another
+  ``atomic``.
+
+* ``__pypy__.thread.signals_enabled``: a context manager that runs
+  its block with signals enabled.  By default, signals are only
+  enabled in the main thread; a non-main thread will not receive
+  signals (this is like CPython).  Enabling signals in non-main threads
+  is useful for libraries where threads are hidden and the end user is
+  not expecting his code to run elsewhere than in the main thread.
+
+Note that all of this API is (or will be) implemented in a regular PyPy
+too: for example, ``with atomic`` will simply mean "don't release the
+GIL" and ``getsegmentlimit()`` will return 1.
+
+==================
+
+
+Reference to implementation details
+===================================
+
+The core of the implementation is in a separate C library called stmgc_,
+in the c7_ subdirectory.  Please see the `README.txt`_ for more
+information.  In particular, the notion of segment is discussed there.
+
+.. _stmgc: https://bitbucket.org/pypy/stmgc/src/default/
+.. _c7: https://bitbucket.org/pypy/stmgc/src/default/c7/
+.. _`README.txt`: https://bitbucket.org/pypy/stmgc/raw/default/c7/README.txt
+
+PyPy itself adds on top of it the automatic placement of read__ and write__
+barriers and of `"becomes-inevitable-now" barriers`__, the logic to
+`start/stop transactions as an RPython transformation`__ and as
+`supporting`__ `C code`__, and the support in the JIT (mostly as a
+`transformation step on the trace`__ and generation of custom assembler
+in `assembler.py`__).
+
+.. __: https://bitbucket.org/pypy/pypy/raw/stmgc-c7/rpython/translator/stm/readbarrier.py
+.. __: https://bitbucket.org/pypy/pypy/raw/stmgc-c7/rpython/memory/gctransform/stmframework.py
+.. __: https://bitbucket.org/pypy/pypy/raw/stmgc-c7/rpython/translator/stm/inevitable.py
+.. __: https://bitbucket.org/pypy/pypy/raw/stmgc-c7/rpython/translator/stm/jitdriver.py
+.. __: https://bitbucket.org/pypy/pypy/raw/stmgc-c7/rpython/translator/stm/src_stm/stmgcintf.h
+.. __: https://bitbucket.org/pypy/pypy/raw/stmgc-c7/rpython/translator/stm/src_stm/stmgcintf.c
+.. __: https://bitbucket.org/pypy/pypy/raw/stmgc-c7/rpython/jit/backend/llsupport/stmrewrite.py
+.. __: https://bitbucket.org/pypy/pypy/raw/stmgc-c7/rpython/jit/backend/x86/assembler.py
diff --git a/pypy/doc/translation.rst b/pypy/doc/translation.rst
--- a/pypy/doc/translation.rst
+++ b/pypy/doc/translation.rst
@@ -380,7 +380,7 @@
 The RPython Typer
 =================
 
-https://bitbucket.org/pypy/pypy/src/default/pypy/rpython/
+https://bitbucket.org/pypy/pypy/src/default/rpython/rtyper/
 
 The RTyper is the first place where the choice of backend makes a
 difference; as outlined above we are assuming that ANSI C is the target.
@@ -603,7 +603,7 @@
  - using the `Boehm-Demers-Weiser conservative garbage collector`_
  - using one of our custom `exact GCs implemented in RPython`_
 
-.. _`Boehm-Demers-Weiser conservative garbage collector`: http://www.hpl.hp.com/personal/Hans_Boehm/gc/
+.. _`Boehm-Demers-Weiser conservative garbage collector`: http://hboehm.info/gc/
 .. _`exact GCs implemented in RPython`: garbage_collection.html
 
 Almost all application-level Python code allocates objects at a very fast
@@ -621,7 +621,7 @@
 The C Back-End
 ==============
 
-https://bitbucket.org/pypy/pypy/src/default/pypy/translator/c/
+https://bitbucket.org/pypy/pypy/src/default/rpython/translator/c/
 
 GenC is usually the most actively maintained backend -- everyone working on
 PyPy has a C compiler, for one thing -- and is usually where new features are
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
@@ -127,3 +127,10 @@
 
 .. branch: win32-fixes4
 fix more tests for win32
+
+.. branch: latest-improve-doc
+Fix broken links in documentation
+
+.. branch: ast-issue1673
+fix ast classes __dict__ are always empty problem and fix the ast deepcopy issue when 
+there is missing field
\ No newline at end of file
diff --git a/pypy/doc/windows.rst b/pypy/doc/windows.rst
--- a/pypy/doc/windows.rst
+++ b/pypy/doc/windows.rst
@@ -86,7 +86,7 @@
 option (this is the default at some optimization levels like ``-O1``,
 but unneeded for high-performance translations like ``-O2``).
 You may get it at
-http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.1.tar.gz
+http://hboehm.info/gc/gc_source/gc-7.1.tar.gz
 
 Versions 7.0 and 7.1 are known to work; the 6.x series won't work with
 pypy. Unpack this folder in the base directory.  Then open a command
diff --git a/pypy/interpreter/app_main.py b/pypy/interpreter/app_main.py
--- a/pypy/interpreter/app_main.py
+++ b/pypy/interpreter/app_main.py
@@ -690,7 +690,7 @@
 
 def setup_bootstrap_path(executable):
     """
-    Try to to as little as possible and to have the stdlib in sys.path. In
+    Try to do as little as possible and to have the stdlib in sys.path. In
     particular, we cannot use any unicode at this point, because lots of
     unicode operations require to be able to import encodings.
     """
diff --git a/pypy/interpreter/astcompiler/ast.py b/pypy/interpreter/astcompiler/ast.py
--- a/pypy/interpreter/astcompiler/ast.py
+++ b/pypy/interpreter/astcompiler/ast.py
@@ -49,13 +49,19 @@
         w_type = space.type(self)
         w_fields = w_type.getdictvalue(space, "_fields")
         for w_name in space.fixedview(w_fields):
-            space.setitem(w_dict, w_name,
+            try:
+                space.setitem(w_dict, w_name,
                           space.getattr(self, w_name))
+            except OperationError:
+                pass
         w_attrs = space.findattr(w_type, space.wrap("_attributes"))
         if w_attrs:
             for w_name in space.fixedview(w_attrs):
-                space.setitem(w_dict, w_name,
+                try:
+                    space.setitem(w_dict, w_name,
                               space.getattr(self, w_name))
+                except OperationError:
+                    pass
         return space.newtuple([space.type(self),
                                space.newtuple([]),
                                w_dict])
@@ -3011,7 +3017,8 @@
         w_self.setdictvalue(space, 'lineno', w_new_value)
         w_self.initialization_state &= ~1
         return
-    w_self.deldictvalue(space, 'lineno')
+    # need to save the original object too
+    w_self.setdictvalue(space, 'lineno', w_new_value)
     w_self.initialization_state |= 1
 
 def stmt_del_lineno(space, w_self):
@@ -3038,7 +3045,8 @@
         w_self.setdictvalue(space, 'col_offset', w_new_value)
         w_self.initialization_state &= ~2
         return
-    w_self.deldictvalue(space, 'col_offset')
+    # need to save the original object too
+    w_self.setdictvalue(space, 'col_offset', w_new_value)
     w_self.initialization_state |= 2
 
 def stmt_del_col_offset(space, w_self):
@@ -3074,7 +3082,8 @@
         w_self.setdictvalue(space, 'name', w_new_value)
         w_self.initialization_state &= ~4
         return
-    w_self.deldictvalue(space, 'name')
+    # need to save the original object too
+    w_self.setdictvalue(space, 'name', w_new_value)
     w_self.initialization_state |= 4
 
 def FunctionDef_del_name(space, w_self):
@@ -3201,7 +3210,8 @@
         w_self.setdictvalue(space, 'name', w_new_value)
         w_self.initialization_state &= ~4
         return
-    w_self.deldictvalue(space, 'name')
+    # need to save the original object too
+    w_self.setdictvalue(space, 'name', w_new_value)
     w_self.initialization_state |= 4
 
 def ClassDef_del_name(space, w_self):
@@ -3665,7 +3675,8 @@
         w_self.setdictvalue(space, 'nl', w_new_value)
         w_self.initialization_state &= ~16
         return
-    w_self.deldictvalue(space, 'nl')
+    # need to save the original object too
+    w_self.setdictvalue(space, 'nl', w_new_value)
     w_self.initialization_state |= 16
 
 def Print_del_nl(space, w_self):
@@ -4571,7 +4582,8 @@
         w_self.setdictvalue(space, 'module', w_new_value)
         w_self.initialization_state &= ~4
         return
-    w_self.deldictvalue(space, 'module')
+    # need to save the original object too
+    w_self.setdictvalue(space, 'module', w_new_value)
     w_self.initialization_state |= 4
 
 def ImportFrom_del_module(space, w_self):
@@ -4620,7 +4632,8 @@
         w_self.setdictvalue(space, 'level', w_new_value)
         w_self.initialization_state &= ~16
         return
-    w_self.deldictvalue(space, 'level')
+    # need to save the original object too
+    w_self.setdictvalue(space, 'level', w_new_value)
     w_self.initialization_state |= 16
 
 def ImportFrom_del_level(space, w_self):
@@ -4938,7 +4951,8 @@
         w_self.setdictvalue(space, 'lineno', w_new_value)
         w_self.initialization_state &= ~1
         return
-    w_self.deldictvalue(space, 'lineno')
+    # need to save the original object too
+    w_self.setdictvalue(space, 'lineno', w_new_value)
     w_self.initialization_state |= 1
 
 def expr_del_lineno(space, w_self):
@@ -4965,7 +4979,8 @@
         w_self.setdictvalue(space, 'col_offset', w_new_value)
         w_self.initialization_state &= ~2
         return
-    w_self.deldictvalue(space, 'col_offset')
+    # need to save the original object too
+    w_self.setdictvalue(space, 'col_offset', w_new_value)
     w_self.initialization_state |= 2
 
 def expr_del_col_offset(space, w_self):
@@ -6292,7 +6307,8 @@
         w_self.setdictvalue(space, 'n', w_new_value)
         w_self.initialization_state &= ~4
         return
-    w_self.deldictvalue(space, 'n')
+    # need to save the original object too
+    w_self.setdictvalue(space, 'n', w_new_value)
     w_self.initialization_state |= 4
 
 def Num_del_n(space, w_self):
@@ -6343,7 +6359,8 @@
         w_self.setdictvalue(space, 's', w_new_value)
         w_self.initialization_state &= ~4
         return
-    w_self.deldictvalue(space, 's')
+    # need to save the original object too
+    w_self.setdictvalue(space, 's', w_new_value)
     w_self.initialization_state |= 4
 
 def Str_del_s(space, w_self):
@@ -6423,7 +6440,8 @@
         w_self.setdictvalue(space, 'attr', w_new_value)
         w_self.initialization_state &= ~8
         return
-    w_self.deldictvalue(space, 'attr')
+    # need to save the original object too
+    w_self.setdictvalue(space, 'attr', w_new_value)
     w_self.initialization_state |= 8
 
 def Attribute_del_attr(space, w_self):
@@ -6618,7 +6636,8 @@
         w_self.setdictvalue(space, 'id', w_new_value)
         w_self.initialization_state &= ~4
         return
-    w_self.deldictvalue(space, 'id')
+    # need to save the original object too
+    w_self.setdictvalue(space, 'id', w_new_value)
     w_self.initialization_state |= 4
 
 def Name_del_id(space, w_self):
@@ -6853,7 +6872,8 @@
         w_self.setdictvalue(space, 'value', w_new_value)
         w_self.initialization_state &= ~4
         return
-    w_self.deldictvalue(space, 'value')
+    # need to save the original object too
+    w_self.setdictvalue(space, 'value', w_new_value)
     w_self.initialization_state |= 4
 
 def Const_del_value(space, w_self):
@@ -7521,7 +7541,8 @@
         w_self.setdictvalue(space, 'lineno', w_new_value)
         w_self.initialization_state &= ~1
         return
-    w_self.deldictvalue(space, 'lineno')
+    # need to save the original object too
+    w_self.setdictvalue(space, 'lineno', w_new_value)
     w_self.initialization_state |= 1
 
 def excepthandler_del_lineno(space, w_self):
@@ -7548,7 +7569,8 @@
         w_self.setdictvalue(space, 'col_offset', w_new_value)
         w_self.initialization_state &= ~2
         return
-    w_self.deldictvalue(space, 'col_offset')
+    # need to save the original object too
+    w_self.setdictvalue(space, 'col_offset', w_new_value)
     w_self.initialization_state |= 2
 
 def excepthandler_del_col_offset(space, w_self):
@@ -7716,7 +7738,8 @@
         w_self.setdictvalue(space, 'vararg', w_new_value)
         w_self.initialization_state &= ~2
         return
-    w_self.deldictvalue(space, 'vararg')
+    # need to save the original object too
+    w_self.setdictvalue(space, 'vararg', w_new_value)
     w_self.initialization_state |= 2
 
 def arguments_del_vararg(space, w_self):
@@ -7746,7 +7769,8 @@
         w_self.setdictvalue(space, 'kwarg', w_new_value)
         w_self.initialization_state &= ~4
         return
-    w_self.deldictvalue(space, 'kwarg')
+    # need to save the original object too
+    w_self.setdictvalue(space, 'kwarg', w_new_value)
     w_self.initialization_state |= 4
 
 def arguments_del_kwarg(space, w_self):
@@ -7824,7 +7848,8 @@
         w_self.setdictvalue(space, 'arg', w_new_value)
         w_self.initialization_state &= ~1
         return
-    w_self.deldictvalue(space, 'arg')
+    # need to save the original object too
+    w_self.setdictvalue(space, 'arg', w_new_value)
     w_self.initialization_state |= 1
 
 def keyword_del_arg(space, w_self):
@@ -7905,7 +7930,8 @@
         w_self.setdictvalue(space, 'name', w_new_value)
         w_self.initialization_state &= ~1
         return
-    w_self.deldictvalue(space, 'name')
+    # need to save the original object too
+    w_self.setdictvalue(space, 'name', w_new_value)
     w_self.initialization_state |= 1
 
 def alias_del_name(space, w_self):
@@ -7935,7 +7961,8 @@
         w_self.setdictvalue(space, 'asname', w_new_value)
         w_self.initialization_state &= ~2
         return
-    w_self.deldictvalue(space, 'asname')
+    # need to save the original object too
+    w_self.setdictvalue(space, 'asname', w_new_value)
     w_self.initialization_state |= 2
 
 def alias_del_asname(space, w_self):
diff --git a/pypy/interpreter/astcompiler/tools/asdl_py.py b/pypy/interpreter/astcompiler/tools/asdl_py.py
--- a/pypy/interpreter/astcompiler/tools/asdl_py.py
+++ b/pypy/interpreter/astcompiler/tools/asdl_py.py
@@ -459,6 +459,7 @@
                         self.emit("raise OperationError(space.w_TypeError, "
                                   "space.w_None)", 3)
             else:
+                save_original_object = True
                 level = 2
                 if field.opt and field.type.value != "int":
                     self.emit("if space.is_w(w_new_value, space.w_None):", 2)
@@ -596,13 +597,19 @@
         w_type = space.type(self)
         w_fields = w_type.getdictvalue(space, "_fields")
         for w_name in space.fixedview(w_fields):
-            space.setitem(w_dict, w_name,
+            try:
+                space.setitem(w_dict, w_name,
                           space.getattr(self, w_name))
+            except OperationError:
+                pass
         w_attrs = space.findattr(w_type, space.wrap("_attributes"))
         if w_attrs:
             for w_name in space.fixedview(w_attrs):
-                space.setitem(w_dict, w_name,
+                try:
+                    space.setitem(w_dict, w_name,
                               space.getattr(self, w_name))
+                except OperationError:
+                    pass
         return space.newtuple([space.type(self),
                                space.newtuple([]),
                                w_dict])
diff --git a/pypy/module/_ast/test/test_ast.py b/pypy/module/_ast/test/test_ast.py
--- a/pypy/module/_ast/test/test_ast.py
+++ b/pypy/module/_ast/test/test_ast.py
@@ -387,3 +387,40 @@
         mod.body[0].body[0].handlers[0].lineno = 7
         mod.body[0].body[0].handlers[1].lineno = 6
         code = compile(mod, "<test>", "exec")
+
+    def test_dict_astNode(self):
+        import ast
+        num_node = ast.Num(n=2, lineno=2, col_offset=3)
+        dict_res = num_node.__dict__
+        
+        assert dict_res == {'n':2, 'lineno':2, 'col_offset':3}
+    
+    def test_issue1673_Num_notfullinit(self):
+        import ast
+        import copy
+        num_node = ast.Num(n=2,lineno=2)
+        assert num_node.n == 2
+        assert num_node.lineno == 2
+        num_node2 = copy.deepcopy(num_node)
+    
+    def test_issue1673_Num_fullinit(self):
+        import ast
+        import copy 
+        num_node = ast.Num(n=2,lineno=2,col_offset=3)
+        num_node2 = copy.deepcopy(num_node)
+        assert num_node.n == num_node2.n
+        assert num_node.lineno == num_node2.lineno
+        assert num_node.col_offset == num_node2.col_offset
+        dict_res = num_node2.__dict__
+        assert dict_res == {'n':2, 'lineno':2, 'col_offset':3}
+          
+    def test_issue1673_Str(self):
+        import ast
+        import copy
+        str_node = ast.Str(n=2,lineno=2)
+        assert str_node.n == 2
+        assert str_node.lineno == 2
+        str_node2 = copy.deepcopy(str_node)
+        dict_res = str_node2.__dict__
+        assert dict_res == {'n':2, 'lineno':2}
+    
\ No newline at end of file
diff --git a/pypy/module/_file/test/test_file_extra.py b/pypy/module/_file/test/test_file_extra.py
--- a/pypy/module/_file/test/test_file_extra.py
+++ b/pypy/module/_file/test/test_file_extra.py
@@ -528,7 +528,7 @@
         f = open(fn)
         exc = raises(EnvironmentError, f.truncate, 3)
         if sys.platform == 'win32':
-            assert exc.value.winerror == 5 # ERROR_ACCESS_DENIED
+            assert exc.value.errno == 5 # ERROR_ACCESS_DENIED
         else:
             # CPython explicitely checks the file mode
             # PyPy relies on the libc to raise the error
diff --git a/rpython/config/test/test_translationoption.py b/rpython/config/test/test_translationoption.py
--- a/rpython/config/test/test_translationoption.py
+++ b/rpython/config/test/test_translationoption.py
@@ -1,10 +1,17 @@
 import py
 from rpython.config.translationoption import get_combined_translation_config
 from rpython.config.translationoption import set_opt_level
-from rpython.config.config import ConflictConfigError
+from rpython.config.config import ConflictConfigError, ConfigError
+from rpython.translator.platform import platform as compiler
 
 
 def test_no_gcrootfinder_with_boehm():
     config = get_combined_translation_config()
     config.translation.gcrootfinder = "shadowstack"
     py.test.raises(ConflictConfigError, set_opt_level, config, '0')
+
+if compiler.name == 'msvc':
+    def test_no_asmgcrot_on_msvc():
+        config = get_combined_translation_config()
+        py.test.raises(ConfigError, config.translation.setoption, 
+                                        'gcrootfinder', 'asmgcc', 'user') 
diff --git a/rpython/config/translationoption.py b/rpython/config/translationoption.py
--- a/rpython/config/translationoption.py
+++ b/rpython/config/translationoption.py
@@ -1,9 +1,10 @@
 import sys
 import os
 from rpython.config.config import OptionDescription, BoolOption, IntOption, ArbitraryOption, FloatOption
-from rpython.config.config import ChoiceOption, StrOption, Config
+from rpython.config.config import ChoiceOption, StrOption, Config, ConflictConfigError
 from rpython.config.config import ConfigError
 from rpython.config.support import detect_number_of_processors
+from rpython.translator.platform import platform as compiler
 
 DEFL_INLINE_THRESHOLD = 32.4    # just enough to inline add__Int_Int()
 # and just small enough to prevend inlining of some rlist functions.
@@ -16,8 +17,13 @@
 
 if sys.platform.startswith("linux"):
     DEFL_ROOTFINDER_WITHJIT = "asmgcc"
+    ROOTFINDERS = ["n/a", "shadowstack", "asmgcc"]
+elif compiler.name == 'msvc':    
+    DEFL_ROOTFINDER_WITHJIT = "shadowstack"
+    ROOTFINDERS = ["n/a", "shadowstack"]
 else:
     DEFL_ROOTFINDER_WITHJIT = "shadowstack"
+    ROOTFINDERS = ["n/a", "shadowstack", "asmgcc"]
 
 IS_64_BITS = sys.maxint > 2147483647
 
@@ -85,7 +91,7 @@
                default=IS_64_BITS, cmdline="--gcremovetypeptr"),
     ChoiceOption("gcrootfinder",
                  "Strategy for finding GC Roots (framework GCs only)",
-                 ["n/a", "shadowstack", "asmgcc"],
+                 ROOTFINDERS,
                  "shadowstack",
                  cmdline="--gcrootfinder",
                  requires={
diff --git a/rpython/flowspace/specialcase.py b/rpython/flowspace/specialcase.py
--- a/rpython/flowspace/specialcase.py
+++ b/rpython/flowspace/specialcase.py
@@ -49,6 +49,11 @@
     from rpython.rlib.rfile import create_file
     return ctx.appcall(create_file, *args_w)
 
+ at register_flow_sc(os.fdopen)
+def sc_os_fdopen(ctx, *args_w):
+    from rpython.rlib.rfile import create_fdopen_rfile
+    return ctx.appcall(create_fdopen_rfile, *args_w)
+
 @register_flow_sc(os.tmpfile)
 def sc_os_tmpfile(ctx):
     from rpython.rlib.rfile import create_temp_rfile
diff --git a/rpython/flowspace/test/test_unroll.py b/rpython/flowspace/test/test_unroll.py
--- a/rpython/flowspace/test/test_unroll.py
+++ b/rpython/flowspace/test/test_unroll.py
@@ -1,23 +1,10 @@
 import operator
+
 from rpython.flowspace.test.test_objspace import Base
-from rpython.rlib.unroll import unrolling_zero, unrolling_iterable
+from rpython.rlib.unroll import unrolling_iterable
+
 
 class TestUnroll(Base):
-
-    def test_unrolling_int(self):
-        l = range(10)
-        def f(tot):
-            i = unrolling_zero
-            while i < len(l):
-                tot += l[i]
-                i = i + 1
-            return tot*2
-        assert f(0) == sum(l)*2
-
-        graph = self.codetest(f)
-        ops = self.all_operations(graph)
-        assert ops == {'inplace_add': 10, 'mul': 1}
-
     def test_unroller(self):
         l = unrolling_iterable(range(10))
         def f(tot):
diff --git a/rpython/jit/backend/x86/test/test_zrpy_gcasmgcc.py b/rpython/jit/backend/x86/test/test_zrpy_gcasmgcc.py
--- a/rpython/jit/backend/x86/test/test_zrpy_gcasmgcc.py
+++ b/rpython/jit/backend/x86/test/test_zrpy_gcasmgcc.py
@@ -1,4 +1,9 @@
+import py
 from rpython.jit.backend.llsupport.test.zrpy_gc_test import CompileFrameworkTests
+from rpython.translator.platform import platform as compiler
+
+if compiler.name == 'msvc':
+    py.test.skip('asmgcc buggy on msvc')
 
 class TestAsmGcc(CompileFrameworkTests):
     gcrootfinder = "asmgcc"
diff --git a/rpython/jit/metainterp/compile.py b/rpython/jit/metainterp/compile.py
--- a/rpython/jit/metainterp/compile.py
+++ b/rpython/jit/metainterp/compile.py
@@ -567,7 +567,8 @@
             # common case: this is not a guard_value, and we are not
             # already busy tracing.  The rest of self.status stores a
             # valid per-guard index in the jitcounter.
-            hash = self.status & self.ST_SHIFT_MASK
+            hash = self.status
+            assert hash == (self.status & self.ST_SHIFT_MASK)
         #
         # do we have the BUSY flag?  If so, we're tracing right now, e.g. in an
         # outer invocation of the same function, so don't trace again for now.
diff --git a/rpython/jit/metainterp/test/test_intbound.py b/rpython/jit/metainterp/optimizeopt/test/test_intbound.py
rename from rpython/jit/metainterp/test/test_intbound.py
rename to rpython/jit/metainterp/optimizeopt/test/test_intbound.py
--- a/rpython/jit/metainterp/test/test_intbound.py
+++ b/rpython/jit/metainterp/optimizeopt/test/test_intbound.py
@@ -1,5 +1,7 @@
 from rpython.jit.metainterp.optimizeopt.intutils import IntBound, IntUpperBound, \
      IntLowerBound, IntUnbounded
+from rpython.jit.metainterp.optimizeopt.intbounds import next_pow2_m1
+
 from copy import copy
 import sys
 from rpython.rlib.rarithmetic import LONG_BIT
@@ -235,8 +237,8 @@
         for shift_count_bound in (IntBound(7, LONG_BIT), IntBound(-7, 7)):
             #assert not b.lshift_bound(shift_count_bound).has_upper
             assert not b.rshift_bound(shift_count_bound).has_upper
-        
-    
+
+
 def test_div_bound():
     for _, _, b1 in some_bounds():
         for _, _, b2 in some_bounds():
@@ -258,7 +260,6 @@
     assert a.contains(0)
 
 
-
 def test_sub_bound():
     for _, _, b1 in some_bounds():
         for _, _, b2 in some_bounds():
@@ -271,3 +272,14 @@
     a=bound(2, 4).sub_bound(bound(1, 2))
     assert not a.contains(-1)
     assert not a.contains(4)
+
+
+def test_next_pow2_m1():
+    assert next_pow2_m1(0) == 0
+    assert next_pow2_m1(1) == 1
+    assert next_pow2_m1(7) == 7
+    assert next_pow2_m1(256) == 511
+    assert next_pow2_m1(255) == 255
+    assert next_pow2_m1(80) == 127
+    assert next_pow2_m1((1 << 32) - 5) == (1 << 32) - 1
+    assert next_pow2_m1((1 << 64) - 1) == (1 << 64) - 1
diff --git a/rpython/jit/metainterp/optimizeopt/test/test_intbounds.py b/rpython/jit/metainterp/optimizeopt/test/test_intbounds.py
deleted file mode 100644
--- a/rpython/jit/metainterp/optimizeopt/test/test_intbounds.py
+++ /dev/null
@@ -1,12 +0,0 @@
-from rpython.jit.metainterp.optimizeopt.intbounds import next_pow2_m1
-
-
-def test_next_pow2_m1():
-    assert next_pow2_m1(0) == 0
-    assert next_pow2_m1(1) == 1
-    assert next_pow2_m1(7) == 7
-    assert next_pow2_m1(256) == 511
-    assert next_pow2_m1(255) == 255
-    assert next_pow2_m1(80) == 127
-    assert next_pow2_m1((1 << 32) - 5) == (1 << 32) - 1
-    assert next_pow2_m1((1 << 64) - 1) == (1 << 64) - 1
diff --git a/rpython/jit/metainterp/test/test_virtualstate.py b/rpython/jit/metainterp/optimizeopt/test/test_virtualstate.py
rename from rpython/jit/metainterp/test/test_virtualstate.py
rename to rpython/jit/metainterp/optimizeopt/test/test_virtualstate.py
--- a/rpython/jit/metainterp/test/test_virtualstate.py
+++ b/rpython/jit/metainterp/optimizeopt/test/test_virtualstate.py
@@ -89,6 +89,11 @@
         assert isgeneral(OptValue(ConstPtr(fooref)),
                          OptValue(ConstPtr(fooref)))
 
+        value1 = OptValue(BoxPtr())
+        value1.make_nonnull(None)
+        value2 = OptValue(ConstPtr(LLtypeMixin.nullptr))
+        assert not isgeneral(value1, value2)
+
     def test_field_matching_generalization(self):
         const1 = NotVirtualStateInfo(OptValue(ConstInt(1)))
         const2 = NotVirtualStateInfo(OptValue(ConstInt(2)))
@@ -202,6 +207,17 @@
         """
         self.compare(guards, expected, [box])
 
+    def test_known_value(self):
+        value1 = OptValue(self.nodebox)
+        value1.make_constant(ConstInt(1))
+        box = self.nodebox
+        guards = value1.make_guards(box)
+        expected = """
+        [i0]
+        guard_value(i0, 1) []
+        """
+        self.compare(guards, expected, [box])
+
     def test_equal_inputargs(self):
         value = OptValue(self.nodebox)        
         classbox = self.cpu.ts.cls_of_box(self.nodebox)
diff --git a/rpython/jit/metainterp/optimizeopt/unroll.py b/rpython/jit/metainterp/optimizeopt/unroll.py
--- a/rpython/jit/metainterp/optimizeopt/unroll.py
+++ b/rpython/jit/metainterp/optimizeopt/unroll.py
@@ -296,7 +296,7 @@
             i += 1
             newoperations = self.optimizer.get_newoperations()
         self.short.append(ResOperation(rop.JUMP, short_jumpargs, None, descr=start_label.getdescr()))
-        self.finilize_short_preamble(start_label)
+        self.finalize_short_preamble(start_label)
 
     def close_loop(self, start_label, jumpop):
         virtual_state = self.initial_virtual_state
@@ -403,9 +403,9 @@
             assert isinstance(target_token, TargetToken)
             target_token.targeting_jitcell_token.retraced_count = sys.maxint
 
-        self.finilize_short_preamble(start_label)
+        self.finalize_short_preamble(start_label)
 
-    def finilize_short_preamble(self, start_label):
+    def finalize_short_preamble(self, start_label):
         short = self.short
         assert short[-1].getopnum() == rop.JUMP
         target_token = start_label.getdescr()
diff --git a/rpython/jit/metainterp/optimizeopt/virtualstate.py b/rpython/jit/metainterp/optimizeopt/virtualstate.py
--- a/rpython/jit/metainterp/optimizeopt/virtualstate.py
+++ b/rpython/jit/metainterp/optimizeopt/virtualstate.py
@@ -18,7 +18,15 @@
     position = -1
 
     def generalization_of(self, other, renum, bad):
-        raise NotImplementedError
+        assert self.position != -1
+        if self.position in renum:
+            result = renum[self.position] == other.position
+        else:
+            renum[self.position] = other.position
+            result = self.generalization_of_renumbering_done(other, renum, bad)
+        if not result:
+            bad[self] = bad[other] = None
+        return result
 
     def generate_guards(self, other, box, cpu, extra_guards, renum):
         if self.generalization_of(other, renum, {}):
@@ -67,37 +75,21 @@
     def __init__(self, fielddescrs):
         self.fielddescrs = fielddescrs
 
-    def generalization_of(self, other, renum, bad):
-        assert self.position != -1
-        if self.position in renum:
-            if renum[self.position] == other.position:
-                return True
-            bad[self] = None
-            bad[other] = None
-            return False
-        renum[self.position] = other.position
+    def generalization_of_renumbering_done(self, other, renum, bad):
         if not self._generalization_of(other):
-            bad[self] = None
-            bad[other] = None
             return False
 
         assert isinstance(other, AbstractVirtualStructStateInfo)
         assert len(self.fielddescrs) == len(self.fieldstate)
         assert len(other.fielddescrs) == len(other.fieldstate)
         if len(self.fielddescrs) != len(other.fielddescrs):
-            bad[self] = None
-            bad[other] = None
             return False
 
         for i in range(len(self.fielddescrs)):
             if other.fielddescrs[i] is not self.fielddescrs[i]:
-                bad[self] = None
-                bad[other] = None
                 return False
             if not self.fieldstate[i].generalization_of(other.fieldstate[i],
                                                         renum, bad):
-                bad[self] = None
-                bad[other] = None
                 return False
 
         return True
@@ -130,11 +122,8 @@
         self.known_class = known_class
 
     def _generalization_of(self, other):
-        if not isinstance(other, VirtualStateInfo):
-            return False
-        if not self.known_class.same_constant(other.known_class):
-            return False
-        return True
+        return (isinstance(other, VirtualStateInfo) and
+                self.known_class.same_constant(other.known_class))
 
     def debug_header(self, indent):
         debug_print(indent + 'VirtualStateInfo(%d):' % self.position)
@@ -146,11 +135,8 @@
         self.typedescr = typedescr
 
     def _generalization_of(self, other):
-        if not isinstance(other, VStructStateInfo):
-            return False
-        if self.typedescr is not other.typedescr:
-            return False
-        return True
+        return (isinstance(other, VStructStateInfo) and
+                self.typedescr is other.typedescr)
 
     def debug_header(self, indent):
         debug_print(indent + 'VStructStateInfo(%d):' % self.position)
@@ -165,28 +151,14 @@
         return (isinstance(other, VArrayStateInfo) and
             self.arraydescr is other.arraydescr)
 
-    def generalization_of(self, other, renum, bad):
-        assert self.position != -1
-        if self.position in renum:
-            if renum[self.position] == other.position:
-                return True
-            bad[self] = None
-            bad[other] = None
-            return False
-        renum[self.position] = other.position
+    def generalization_of_renumbering_done(self, other, renum, bad):
         if not self._generalization_of(other):
-            bad[self] = None
-            bad[other] = None
             return False
         if len(self.fieldstate) != len(other.fieldstate):
-            bad[self] = None
-            bad[other] = None
             return False
         for i in range(len(self.fieldstate)):
             if not self.fieldstate[i].generalization_of(other.fieldstate[i],
                                                         renum, bad):
-                bad[self] = None
-                bad[other] = None
                 return False
         return True
 
@@ -216,41 +188,23 @@
         self.arraydescr = arraydescr
         self.fielddescrs = fielddescrs
 
-    def generalization_of(self, other, renum, bad):
-        assert self.position != -1
-        if self.position in renum:
-            if renum[self.position] == other.position:
-                return True
-            bad[self] = None
-            bad[other] = None
-            return False
-        renum[self.position] = other.position
+    def generalization_of_renumbering_done(self, other, renum, bad):
         if not self._generalization_of(other):
-            bad[self] = None
-            bad[other] = None
             return False
 
         assert isinstance(other, VArrayStructStateInfo)
         if len(self.fielddescrs) != len(other.fielddescrs):
-            bad[self] = None
-            bad[other] = None
             return False
 
         p = 0
         for i in range(len(self.fielddescrs)):
             if len(self.fielddescrs[i]) != len(other.fielddescrs[i]):
-                bad[self] = None
-                bad[other] = None
                 return False
             for j in range(len(self.fielddescrs[i])):
                 if self.fielddescrs[i][j] is not other.fielddescrs[i][j]:
-                    bad[self] = None
-                    bad[other] = None
                     return False
                 if not self.fieldstate[p].generalization_of(other.fieldstate[p],
                                                             renum, bad):
-                    bad[self] = None
-                    bad[other] = None
                     return False
                 p += 1
         return True
@@ -302,49 +256,31 @@
         self.position_in_notvirtuals = -1
         self.lenbound = value.lenbound
 
-    def generalization_of(self, other, renum, bad):
+    def generalization_of_renumbering_done(self, other, renum, bad):
         # XXX This will always retrace instead of forcing anything which
         # might be what we want sometimes?
-        assert self.position != -1
-        if self.position in renum:
-            if renum[self.position] == other.position:
-                return True
-            bad[self] = None
-            bad[other] = None
-            return False
-        renum[self.position] = other.position
         if not isinstance(other, NotVirtualStateInfo):
-            bad[self] = None
-            bad[other] = None
             return False
         if other.level < self.level:
-            bad[self] = None
-            bad[other] = None
             return False
         if self.level == LEVEL_CONSTANT:
             if not self.constbox.same_constant(other.constbox):
-                bad[self] = None
-                bad[other] = None
                 return False
         elif self.level == LEVEL_KNOWNCLASS:
             if not self.known_class.same_constant(other.known_class):
-                bad[self] = None
-                bad[other] = None
                 return False
+        elif self.level == LEVEL_NONNULL:
+            if other.constbox and not other.constbox.nonnull():
+                return False
+
         if not self.intbound.contains_bound(other.intbound):
-            bad[self] = None
-            bad[other] = None
             return False
         if self.lenbound and other.lenbound:
             if self.lenbound.mode != other.lenbound.mode or \
                self.lenbound.descr != other.lenbound.descr or \
                not self.lenbound.bound.contains_bound(other.lenbound.bound):
-                bad[self] = None
-                bad[other] = None
                 return False
         elif self.lenbound:
-            bad[self] = None
-            bad[other] = None


More information about the pypy-commit mailing list