[pypy-commit] pypy stmgc-c8-hashtable: Pass the extra arg to stm_hashtable_tracefn(). Add some casts somewhere

arigo noreply at buildbot.pypy.org
Thu Mar 12 17:56:39 CET 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c8-hashtable
Changeset: r76357:9e912907fe1c
Date: 2015-03-12 17:56 +0100
http://bitbucket.org/pypy/pypy/changeset/9e912907fe1c/

Log:	Pass the extra arg to stm_hashtable_tracefn(). Add some casts
	somewhere else in funcgen.py to silence warnings.

diff --git a/rpython/rlib/rstm.py b/rpython/rlib/rstm.py
--- a/rpython/rlib/rstm.py
+++ b/rpython/rlib/rstm.py
@@ -262,7 +262,7 @@
     from rpython.memory.gctransform.stmframework import get_visit_function
     visit_fn = get_visit_function(callback, arg)
     addr = obj + llmemory.offsetof(_HASHTABLE_OBJ, 'll_raw_hashtable')
-    llop.stm_hashtable_tracefn(lltype.Void, addr.address[0], visit_fn)
+    llop.stm_hashtable_tracefn(lltype.Void, obj, addr.address[0], visit_fn)
 lambda_hashtable_trace = lambda: _ll_hashtable_trace
 
 def _ll_hashtable_finalizer(h):
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
@@ -334,8 +334,9 @@
     arg1 = funcgen.expr(op.args[1])
     arg2 = funcgen.expr(op.args[2])
     result = funcgen.expr(op.result)
-    return '%s = stm_hashtable_lookup((object_t *)%s, %s, %s);' % (
-        result, arg0, arg1, arg2)
+    typename = cdecl(funcgen.lltypename(op.result), '')
+    return '%s = (%s)stm_hashtable_lookup((object_t *)%s, %s, %s);' % (
+        result, typename, arg0, arg1, arg2)
 
 def stm_hashtable_length_upper_bound(funcgen, op):
     arg0 = funcgen.expr(op.args[0])
@@ -348,10 +349,12 @@
     arg1 = funcgen.expr(op.args[1])
     arg2 = funcgen.expr(op.args[2])
     result = funcgen.expr(op.result)
-    return '%s = stm_hashtable_list((object_t *)%s, %s, %s);' % (
-        result, arg0, arg1, arg2)
+    return ('%s = stm_hashtable_list((object_t *)%s, %s, '
+            '(stm_hashtable_entry_t **)%s);' % (result, arg0, arg1, arg2))
 
 def stm_hashtable_tracefn(funcgen, op):
     arg0 = funcgen.expr(op.args[0])
     arg1 = funcgen.expr(op.args[1])
-    return 'stm_hashtable_tracefn((stm_hashtable_t *)%s, %s);' % (arg0, arg1)
+    arg2 = funcgen.expr(op.args[2])
+    return ('stm_hashtable_tracefn(%s, (stm_hashtable_t *)%s, '
+            ' (void(*)(object_t**))%s);' % (arg0, arg1, arg2))


More information about the pypy-commit mailing list