[pypy-commit] pypy stmgc-c7: merge heads

arigo noreply at buildbot.pypy.org
Sat Apr 19 18:57:10 CEST 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c7
Changeset: r70778:75b8ab07c126
Date: 2014-04-19 18:47 +0200
http://bitbucket.org/pypy/pypy/changeset/75b8ab07c126/

Log:	merge heads

diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py
--- a/pypy/interpreter/pyopcode.py
+++ b/pypy/interpreter/pyopcode.py
@@ -79,8 +79,9 @@
                     # only used for no-jit. The jit-jitdriver is
                     # in interp_jit.py
                     stmonly_jitdriver.jit_merge_point(
-                        self=self, co_code=co_code,
-                        next_instr=next_instr, ec=ec)
+                        frame=self, pycode=co_code,
+                        next_instr=next_instr, ec=ec,
+                        is_being_profiled=self.is_being_profiled)
                 next_instr = self.handle_bytecode(co_code, next_instr, ec)
                 rstm.update_marker_num(intmask(next_instr) * 2 + 1)
         except ExitFrame:
diff --git a/rpython/jit/codewriter/jtransform.py b/rpython/jit/codewriter/jtransform.py
--- a/rpython/jit/codewriter/jtransform.py
+++ b/rpython/jit/codewriter/jtransform.py
@@ -1887,6 +1887,13 @@
                              None)
         return [op0, op1]
 
+    def rewrite_op_stm_push_marker(self, op):
+        return []
+    def rewrite_op_stm_update_marker_num(self, op):
+        return []
+    def rewrite_op_stm_pop_marker(self, op):
+        return []
+
 # ____________________________________________________________
 
 class NotSupported(Exception):
diff --git a/rpython/translator/stm/funcgen.py b/rpython/translator/stm/funcgen.py
--- a/rpython/translator/stm/funcgen.py
+++ b/rpython/translator/stm/funcgen.py
@@ -225,12 +225,17 @@
 
 def stm_setup_expand_marker_for_pypy(funcgen, op):
     # hack hack hack
-    node = funcgen.db.gettypedefnode(op.args[0].concretetype.TO)
-    typename = funcgen.db.gettype(op.args[0].concretetype.TO)
-    names = [''.join(arg.value.chars) for arg in op.args[1:]]
-    names = [node.c_struct_field_name('inst_' + name) for name in names]
-    offsets = ['offsetof(%s, %s)' % (cdecl(typename, ''), name)
-               for name in names]
+    offsets = []
+    for arg in op.args[1:]:
+        name = 'inst_' + ''.join(arg.value.chars)
+        S = op.args[0].concretetype.TO
+        while True:
+            node = funcgen.db.gettypedefnode(S)
+            if name in node.fieldnames:
+                break
+            S = S.super
+        name = node.c_struct_field_name(name)
+        offsets.append('offsetof(struct %s, %s)' % (node.name, name))
     assert len(offsets) == 4
     return 'pypy_stm_setup_expand_marker(%s, %s, %s, %s);' % (
         offsets[0], offsets[1], offsets[2], offsets[3])
diff --git a/rpython/translator/stm/test/test_ztranslated.py b/rpython/translator/stm/test/test_ztranslated.py
--- a/rpython/translator/stm/test/test_ztranslated.py
+++ b/rpython/translator/stm/test/test_ztranslated.py
@@ -495,7 +495,9 @@
         assert '-1298\n' in data
 
     def test_pypy_marker(self):
-        class PyCode(object):
+        class Code(object):
+            pass
+        class PyCode(Code):
             def __init__(self, co_filename, co_name,
                          co_firstlineno, co_lnotab):
                 self.co_filename = co_filename
@@ -520,6 +522,7 @@
                 "/tmp/some/where/very/very/long/path/bla/br/project/foobaz.py",
                 "some_extremely_longish_and_boring_function_name",
                 80, "\x00\x01\x04\x02")
+            Code().co_name = "moved up"
             llop.stm_setup_expand_marker_for_pypy(
                 lltype.Void, pycode1,
                 "co_filename", "co_name", "co_firstlineno", "co_lnotab")


More information about the pypy-commit mailing list