[pypy-commit] pypy non-null-app-dict: fix tests

fijal noreply at buildbot.pypy.org
Tue Jun 28 14:06:40 CEST 2011


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: non-null-app-dict
Changeset: r45156:2c00e62c8317
Date: 2011-06-28 14:12 +0200
http://bitbucket.org/pypy/pypy/changeset/2c00e62c8317/

Log:	fix tests

diff --git a/pypy/annotation/builtin.py b/pypy/annotation/builtin.py
--- a/pypy/annotation/builtin.py
+++ b/pypy/annotation/builtin.py
@@ -311,10 +311,14 @@
 def robjmodel_we_are_translated():
     return immutablevalue(True)
 
-def robjmodel_r_dict(s_eqfn, s_hashfn, s_force_non_null):
-    assert s_force_non_null.is_constant()
+def robjmodel_r_dict(s_eqfn, s_hashfn, s_force_non_null=None):
+    if s_force_non_null is None:
+        force_non_null = False
+    else:
+        assert s_force_non_null.is_constant()
+        force_non_null = s_force_non_null.const
     dictdef = getbookkeeper().getdictdef(is_r_dict=True,
-                                         force_non_null=s_force_non_null.const)
+                                         force_non_null=force_non_null)
     dictdef.dictkey.update_rdict_annotations(s_eqfn, s_hashfn)
     return SomeDict(dictdef)
 
diff --git a/pypy/rpython/lltypesystem/rdict.py b/pypy/rpython/lltypesystem/rdict.py
--- a/pypy/rpython/lltypesystem/rdict.py
+++ b/pypy/rpython/lltypesystem/rdict.py
@@ -649,13 +649,15 @@
     pass
 
 
-def rtype_r_dict(hop, i_force_non_null=-1):
+def rtype_r_dict(hop, i_force_non_null=None):
     r_dict = hop.r_result
     if not r_dict.custom_eq_hash:
         raise TyperError("r_dict() call does not return an r_dict instance")
-    v_eqfn, v_hashfn, _ = hop.inputargs(r_dict.r_rdict_eqfn,
-                                        r_dict.r_rdict_hashfn,
-                                        lltype.Void)
+    v_eqfn = hop.inputarg(r_dict.r_rdict_eqfn, arg=0)
+    v_hashfn = hop.inputarg(r_dict.r_rdict_hashfn, arg=1)
+    if i_force_non_null is not None:
+        assert i_force_non_null == 2
+        hop.inputarg(lltype.Void, arg=2)
     cDICT = hop.inputconst(lltype.Void, r_dict.DICT)
     hop.exception_cannot_occur()
     v_result = hop.gendirectcall(ll_newdict, cDICT)


More information about the pypy-commit mailing list