Commits

Armin Rigo committed 31deb9a

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

Comments (0)

Files changed (10)

pypy/module/cpyext/pystate.py

     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()

pypy/module/thread/os_thread.py

     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

pypy/module/thread/test/test_gil.py

             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)

rpython/memory/gctransform/framework.py

                                   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'):

rpython/rlib/rthread.py

 # ____________________________________________________________
 #
 # Thread integration.
-# These are six completely ad-hoc operations at the moment.
-
-@jit.dont_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():

rpython/rlib/test/test_rthread.py

         def g(i, j):
             state.bootstrapping.acquire(True)
             state.z = Z(i, j)
-            gc_thread_prepare()
             start_new_thread(bootstrap, ())
 
         def f():

rpython/rtyper/llinterp.py

         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()
 

rpython/rtyper/lltypesystem/llheap.py

     return False
 
 
-def thread_prepare():
-    pass
-
 def thread_run():
     pass
 

rpython/rtyper/lltypesystem/lloperation.py

     '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(),

rpython/translator/c/test/test_standalone.py

             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
             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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.