Commits

Armin Rigo committed b30caa3

kill these two C functions.

Comments (0)

Files changed (2)

pypy/translator/stm/src_stm/et.c

 #endif
 }
 
-void stm_descriptor_init_and_being_inevitable_transaction(void)
-{
-  int was_not_started = (thread_descriptor == NULL);
-  stm_descriptor_init();
-  if (was_not_started)
-    stm_begin_inevitable_transaction();
-}
-
-void stm_commit_transaction_and_descriptor_done(void)
-{
-  if (thread_descriptor->init_counter == 1)
-    stm_commit_transaction();
-  stm_descriptor_done();
-}
-
 // XXX little-endian only!
 void stm_write_partial_word(int fieldsize, char *base, long offset,
                             unsigned long nval)

pypy/translator/stm/transform.py

 
     def add_descriptor_init_stuff(self, graph, main=False):
         if main:
-            f_init = _rffi_stm.descriptor_init_and_being_inevitable_transaction
-            f_done = _rffi_stm.commit_transaction_and_descriptor_done
-        else:
-            f_init = _rffi_stm.descriptor_init
-            f_done = _rffi_stm.descriptor_done
+            self._add_calls_around(graph,
+                                   _rffi_stm.begin_inevitable_transaction,
+                                   _rffi_stm.commit_transaction)
+        self._add_calls_around(graph,
+                               _rffi_stm.descriptor_init,
+                               _rffi_stm.descriptor_done)
+
+    def _add_calls_around(self, graph, f_init, f_done):
         c_init = Constant(f_init, lltype.typeOf(f_init))
         c_done = Constant(f_done, lltype.typeOf(f_done))
         #