[pypy-svn] pypy 32ptr-on-64bit: Support for ll_str().
arigo
commits-noreply at bitbucket.org
Sat Apr 16 22:11:55 CEST 2011
Author: Armin Rigo <arigo at tunes.org>
Branch: 32ptr-on-64bit
Changeset: r43404:55e7d6c9094e
Date: 2011-04-16 09:59 -0700
http://bitbucket.org/pypy/pypy/changeset/55e7d6c9094e/
Log: Support for ll_str().
diff --git a/pypy/rpython/lltypesystem/rcompressed.py b/pypy/rpython/lltypesystem/rcompressed.py
--- a/pypy/rpython/lltypesystem/rcompressed.py
+++ b/pypy/rpython/lltypesystem/rcompressed.py
@@ -4,6 +4,7 @@
from pypy.rpython.rmodel import Repr, inputconst
from pypy.rpython.lltypesystem import lltype, llmemory, rffi
from pypy.rpython.lltypesystem.lloperation import llop
+from pypy.rpython.lltypesystem.rstr import string_repr
from pypy.rpython.error import TyperError
@@ -99,6 +100,11 @@
def get_ll_dummyval_obj(self, rtyper, s_value):
return DummyValueBuilder(rtyper)
+ def ll_str(self, i):
+ return hiddengcref32_str
+
+hiddengcref32_str = string_repr.convert_const("<HiddenGcRef32>")
+
class DummyValueBuilder(object):
TYPE = llmemory.HiddenGcRef32
diff --git a/pypy/rpython/test/test_rcompressed.py b/pypy/rpython/test/test_rcompressed.py
--- a/pypy/rpython/test/test_rcompressed.py
+++ b/pypy/rpython/test/test_rcompressed.py
@@ -223,3 +223,11 @@
assert res == True
res = self.interpret(fn, [5, 6, 8])
assert res == False
+
+ def test_str(self):
+ class A:
+ pass
+ def fn():
+ return str([A()])
+ res = self.interpret(fn, [])
+ assert 'HiddenGcRef32' in self.ll_to_string(res)
More information about the Pypy-commit
mailing list