def ll_str(self, i): if lltype.cast_ptr_to_int(i) & 1: from pypy.rpython.lltypesystem import rstr from pypy.rpython.rint import signed_repr llstr1 = signed_repr.ll_str(ll_unboxed_to_int(i)) return rstr.ll_strconcat( rstr.unboxed_instance_str_prefix, rstr.ll_strconcat(llstr1, rstr.unboxed_instance_str_suffix)) else: return InstanceRepr.ll_str(self, i)
def ll_str(self, i): if lltype.cast_ptr_to_int(i) & 1: from pypy.rpython.lltypesystem import rstr from pypy.rpython.rint import signed_repr llstr1 = signed_repr.ll_str(ll_unboxed_to_int(i)) return rstr.ll_strconcat(rstr.unboxed_instance_str_prefix, rstr.ll_strconcat(llstr1, rstr.unboxed_instance_str_suffix)) else: return InstanceRepr.ll_str(self, i)
def ll_str(self, i): # doesn't work for non-gc classes! from pypy.rpython.lltypesystem import rstr from pypy.rpython.lltypesystem.ll_str import ll_int2hex from pypy.rlib.rarithmetic import r_uint if not i: return rstr.null_str instance = cast_pointer(OBJECTPTR, i) uid = r_uint(cast_ptr_to_int(i)) nameLen = len(instance.typeptr.name) nameString = rstr.mallocstr(nameLen - 1) i = 0 while i < nameLen - 1: nameString.chars[i] = instance.typeptr.name[i] i += 1 res = rstr.instance_str_prefix res = rstr.ll_strconcat(res, nameString) res = rstr.ll_strconcat(res, rstr.instance_str_infix) res = rstr.ll_strconcat(res, ll_int2hex(uid, False)) res = rstr.ll_strconcat(res, rstr.instance_str_suffix) return res
def ll_str(self, i): # doesn't work for non-gc classes! from pypy.rpython.lltypesystem import rstr from pypy.rpython.lltypesystem.ll_str import ll_int2hex from pypy.rlib.rarithmetic import r_uint if not i: return rstr.null_str instance = cast_pointer(OBJECTPTR, i) uid = r_uint(cast_ptr_to_int(i)) nameLen = len(instance.typeptr.name) nameString = rstr.mallocstr(nameLen-1) i = 0 while i < nameLen - 1: nameString.chars[i] = instance.typeptr.name[i] i += 1 res = rstr.instance_str_prefix res = rstr.ll_strconcat(res, nameString) res = rstr.ll_strconcat(res, rstr.instance_str_infix) res = rstr.ll_strconcat(res, ll_int2hex(uid, False)) res = rstr.ll_strconcat(res, rstr.instance_str_suffix) return res