Author: Daniel Roberts <[email protected]>
Branch: ootype-rerased
Changeset: r45730:c455e9b2ae16
Date: 2011-07-18 14:28 -0700
http://bitbucket.org/pypy/pypy/changeset/c455e9b2ae16/

Log:    Implement version for llinterp.

diff --git a/pypy/rpython/ootypesystem/ooopimpl.py 
b/pypy/rpython/ootypesystem/ooopimpl.py
--- a/pypy/rpython/ootypesystem/ooopimpl.py
+++ b/pypy/rpython/ootypesystem/ooopimpl.py
@@ -3,7 +3,6 @@
 # ____________________________________________________________
 # Implementation of the 'canfold' oo operations
 
-
 def op_ooupcast(INST, inst):
     return ootype.ooupcast(INST, inst)
 op_ooupcast.need_result_type = True
diff --git a/pypy/rpython/ootypesystem/ootype.py 
b/pypy/rpython/ootypesystem/ootype.py
--- a/pypy/rpython/ootypesystem/ootype.py
+++ b/pypy/rpython/ootypesystem/ootype.py
@@ -1928,6 +1928,19 @@
     assert typeOf(obj) is Object
     return obj._cast_to(EXPECTED_TYPE)
 
+class Box(_object):
+    def __init__(self, i):
+        self._TYPE = Object
+        self.i = i
+
+def oobox_int(i):
+    return Box(i)
+oobox_int.need_result_type = True
+
+def oounbox_int(x):
+    return x.i
+oounbox_int.need_result_type = True
+
 def oostring(obj, base):
     """
     Convert char, int, float, instances and str to str.
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to