Commits

Daniel Roberts  committed c455e9b

Implement version for llinterp.

  • Participants
  • Parent commits b2db2a3
  • Branches ootype-rerased

Comments (0)

Files changed (2)

File pypy/rpython/ootypesystem/ooopimpl.py

 # ____________________________________________________________
 # Implementation of the 'canfold' oo operations
 
-
 def op_ooupcast(INST, inst):
     return ootype.ooupcast(INST, inst)
 op_ooupcast.need_result_type = True

File pypy/rpython/ootypesystem/ootype.py

     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.