Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r66778:31deb9a89134
Date: 2013-09-03 09:31 +0200
http://bitbucket.org/pypy/pypy/changeset/31deb9a89134/

Log:    Kill the 'gc_thread_prepare' llop, which is anyway turned to nothing

diff --git a/pypy/module/cpyext/pystate.py b/pypy/module/cpyext/pystate.py
--- a/pypy/module/cpyext/pystate.py
+++ b/pypy/module/cpyext/pystate.py
@@ -241,7 +241,6 @@
     it is necessary to serialize calls to this function."""
     if not space.config.translation.thread:
         raise NoThreads
-    rthread.gc_thread_prepare()
     # PyThreadState_Get will allocate a new execution context,
     # we need to protect gc and other globals with the GIL.
     rffi.aroundstate.after()
diff --git a/pypy/module/thread/os_thread.py b/pypy/module/thread/os_thread.py
--- a/pypy/module/thread/os_thread.py
+++ b/pypy/module/thread/os_thread.py
@@ -182,7 +182,6 @@
     bootstrapper.acquire(space, w_callable, args)
     try:
         try:
-            rthread.gc_thread_prepare()     # (this has no effect any more)
             ident = rthread.start_new_thread(bootstrapper.bootstrap, ())
         except Exception:
             bootstrapper.release()     # normally called by the new thread
diff --git a/pypy/module/thread/test/test_gil.py 
b/pypy/module/thread/test/test_gil.py
--- a/pypy/module/thread/test/test_gil.py
+++ b/pypy/module/thread/test/test_gil.py
@@ -72,7 +72,6 @@
             state.datalen4 = 0
             state.threadlocals = gil.GILThreadLocals()
             state.threadlocals.setup_threads(space)
-            thread.gc_thread_prepare()
             subident = thread.start_new_thread(bootstrap, ())
             mainident = thread.get_ident()
             runme(True)
diff --git a/rpython/memory/gctransform/framework.py 
b/rpython/memory/gctransform/framework.py
--- a/rpython/memory/gctransform/framework.py
+++ b/rpython/memory/gctransform/framework.py
@@ -974,9 +974,6 @@
                                   self.c_const_gc,
                                   v_size])
 
-    def gct_gc_thread_prepare(self, hop):
-        pass   # no effect any more
-
     def gct_gc_thread_run(self, hop):
         assert self.translator.config.translation.thread
         if hasattr(self.root_walker, 'thread_run_ptr'):
diff --git a/rpython/rlib/rthread.py b/rpython/rlib/rthread.py
--- a/rpython/rlib/rthread.py
+++ b/rpython/rlib/rthread.py
@@ -205,18 +205,7 @@
 # ____________________________________________________________
 #
 # Thread integration.
-# These are six completely ad-hoc operations at the moment.
-
[email protected]_look_inside
-def gc_thread_prepare():
-    """To call just before thread.start_new_thread().  This
-    allocates a new shadow stack to be used by the future
-    thread.  If memory runs out, this raises a MemoryError
-    (which can be handled by the caller instead of just getting
-    ignored if it was raised in the newly starting thread).
-    """
-    if we_are_translated():
-        llop.gc_thread_prepare(lltype.Void)
+# These are five completely ad-hoc operations at the moment.
 
 @jit.dont_look_inside
 def gc_thread_run():
diff --git a/rpython/rlib/test/test_rthread.py 
b/rpython/rlib/test/test_rthread.py
--- a/rpython/rlib/test/test_rthread.py
+++ b/rpython/rlib/test/test_rthread.py
@@ -117,7 +117,6 @@
         def g(i, j):
             state.bootstrapping.acquire(True)
             state.z = Z(i, j)
-            gc_thread_prepare()
             start_new_thread(bootstrap, ())
 
         def f():
diff --git a/rpython/rtyper/llinterp.py b/rpython/rtyper/llinterp.py
--- a/rpython/rtyper/llinterp.py
+++ b/rpython/rtyper/llinterp.py
@@ -784,9 +784,6 @@
         addr = llmemory.cast_ptr_to_adr(ptr)
         return self.heap.can_move(addr)
 
-    def op_gc_thread_prepare(self):
-        self.heap.thread_prepare()
-
     def op_gc_thread_run(self):
         self.heap.thread_run()
 
diff --git a/rpython/rtyper/lltypesystem/llheap.py 
b/rpython/rtyper/lltypesystem/llheap.py
--- a/rpython/rtyper/lltypesystem/llheap.py
+++ b/rpython/rtyper/lltypesystem/llheap.py
@@ -24,9 +24,6 @@
     return False
 
 
-def thread_prepare():
-    pass
-
 def thread_run():
     pass
 
diff --git a/rpython/rtyper/lltypesystem/lloperation.py 
b/rpython/rtyper/lltypesystem/lloperation.py
--- a/rpython/rtyper/lltypesystem/lloperation.py
+++ b/rpython/rtyper/lltypesystem/lloperation.py
@@ -471,7 +471,6 @@
     'gc_obtain_free_space': LLOp(),
     'gc_set_max_heap_size': LLOp(),
     'gc_can_move'         : LLOp(sideeffects=False),
-    'gc_thread_prepare'   : LLOp(canmallocgc=True),
     'gc_thread_run'       : LLOp(),
     'gc_thread_start'     : LLOp(),
     'gc_thread_die'       : LLOp(),
diff --git a/rpython/translator/c/test/test_standalone.py 
b/rpython/translator/c/test/test_standalone.py
--- a/rpython/translator/c/test/test_standalone.py
+++ b/rpython/translator/c/test/test_standalone.py
@@ -1070,7 +1070,6 @@
             rthread.gc_thread_die()
 
         def new_thread():
-            rthread.gc_thread_prepare()
             ident = rthread.start_new_thread(bootstrap, ())
             time.sleep(0.5)    # enough time to start, hopefully
             return ident
@@ -1198,7 +1197,6 @@
             rthread.gc_thread_die()
 
         def new_thread():
-            rthread.gc_thread_prepare()
             ident = rthread.start_new_thread(bootstrap, ())
             time.sleep(0.5)    # enough time to start, hopefully
             return ident
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to