[pypy-commit] pypy stmgc-c7: Kill what remains of the previous approach to abort_info

arigo noreply at buildbot.pypy.org
Wed Apr 16 17:40:11 CEST 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c7
Changeset: r70663:de599561d2a5
Date: 2014-04-16 17:32 +0200
http://bitbucket.org/pypy/pypy/changeset/de599561d2a5/

Log:	Kill what remains of the previous approach to abort_info

diff --git a/pypy/interpreter/executioncontext.py b/pypy/interpreter/executioncontext.py
--- a/pypy/interpreter/executioncontext.py
+++ b/pypy/interpreter/executioncontext.py
@@ -56,10 +56,6 @@
         return frame
 
     def enter(self, frame):
-        if self.space.config.translation.stm:
-          if not self.space.config.translation.jit:  # XXX
-            from pypy.module.thread.stm import enter_frame
-            enter_frame(self, frame)
         frame.f_backref = self.topframeref
         self.topframeref = jit.virtual_ref(frame)
 
@@ -81,11 +77,6 @@
                 frame_vref()
             jit.virtual_ref_finish(frame_vref, frame)
 
-        if self.space.config.translation.stm:
-          if not self.space.config.translation.jit:  # XXX
-            from pypy.module.thread.stm import leave_frame
-            leave_frame(self, frame)
-
     # ________________________________________________________________
 
     def c_call_trace(self, frame, w_func, args=None):
diff --git a/pypy/module/thread/stm.py b/pypy/module/thread/stm.py
--- a/pypy/module/thread/stm.py
+++ b/pypy/module/thread/stm.py
@@ -41,21 +41,6 @@
     if not we_are_translated() and not hasattr(ec, '_thread_local_dicts'):
         initialize_execution_context(ec)
 
- at jit.dont_look_inside # XXX: handle abort_info_push in JIT
-def enter_frame(ec, frame):
-    """Called from ExecutionContext.enter()."""
-    if frame.hide():
-        return
-    rstm.abort_info_push(frame.pycode, ('[', 'co_filename', 'co_name',
-                                        'co_firstlineno', 'co_lnotab'))
-    rstm.abort_info_push(frame, ('last_instr', ']'))
-
-def leave_frame(ec, frame):
-    """Called from ExecutionContext.leave()."""
-    if frame.hide():
-        return
-    rstm.abort_info_pop(2)
-
 
 class STMThreadLocals(BaseThreadLocals):
 
diff --git a/rpython/rlib/rstm.py b/rpython/rlib/rstm.py
--- a/rpython/rlib/rstm.py
+++ b/rpython/rlib/rstm.py
@@ -80,18 +80,6 @@
 def is_atomic():
     return llop.stm_get_atomic(lltype.Signed)
 
-def abort_info_push(instance, fieldnames):
-    "Special-cased below."
-
- at dont_look_inside
-def abort_info_pop(count):
-    if we_are_translated():
-        llop.stm_abort_info_pop(lltype.Void, count)
-
- at dont_look_inside
-def charp_inspect_abort_info():
-    return llop.stm_inspect_abort_info(rffi.CCHARP)
-
 @dont_look_inside
 def abort_and_retry():
     llop.stm_abort_and_retry(lltype.Void)
@@ -161,58 +149,6 @@
 
 # ____________________________________________________________
 
-class AbortInfoPush(ExtRegistryEntry):
-    _about_ = abort_info_push
-
-    def compute_result_annotation(self, s_instance, s_fieldnames):
-        from rpython.annotator.model import SomeInstance
-        assert isinstance(s_instance, SomeInstance)
-        assert s_fieldnames.is_constant()
-        assert isinstance(s_fieldnames.const, tuple)  # tuple of names
-
-    def specialize_call(self, hop):
-        fieldnames = hop.args_s[1].const
-        lst = []
-        v_instance = hop.inputarg(hop.args_r[0], arg=0)
-        for fieldname in fieldnames:
-            if fieldname == '[':
-                lst.append(-2)    # start of sublist
-                continue
-            if fieldname == ']':
-                lst.append(-1)    # end of sublist
-                continue
-            fieldname = 'inst_' + fieldname
-            extraofs = None
-            STRUCT = v_instance.concretetype.TO
-            while not hasattr(STRUCT, fieldname):
-                STRUCT = STRUCT.super
-            TYPE = getattr(STRUCT, fieldname)
-            if TYPE == lltype.Signed:
-                kind = 1
-            elif TYPE == lltype.Unsigned:
-                kind = 2
-            elif TYPE == lltype.Ptr(rstr.STR):
-                kind = 3
-                extraofs = llmemory.offsetof(rstr.STR, 'chars')
-            else:
-                raise NotImplementedError(
-                    "abort_info_push(%s, %r): field of type %r"
-                    % (STRUCT.__name__, fieldname, TYPE))
-            lst.append(kind)
-            lst.append(llmemory.offsetof(STRUCT, fieldname))
-            if extraofs is not None:
-                lst.append(extraofs)
-        lst.append(0)
-        ARRAY = rffi.CArray(lltype.Signed)
-        array = lltype.malloc(ARRAY, len(lst), flavor='raw', immortal=True)
-        for i in range(len(lst)):
-            array[i] = lst[i]
-        c_array = hop.inputconst(lltype.Ptr(ARRAY), array)
-        hop.exception_cannot_occur()
-        hop.genop('stm_abort_info_push', [v_instance, c_array])
-
-# ____________________________________________________________
-
 class ThreadLocalReference(object):
     _COUNT = 1
 


More information about the pypy-commit mailing list