[pypy-dev] Number of constants in a jitted rpython interpreter

Amaury Forgeot d'Arc amauryfa at gmail.com
Thu Sep 22 15:09:14 CEST 2011


2011/9/22 Zariko Taba <zariko.taba at gmail.com>

> [translation:ERROR]  ValueError: character code not in range(256)
>
> With this snippet of code :
>
> self.constants_dict[key] = 256 - len(constants)
>
> If len(constants) is 257,
> then self.constants_dict[key] is -1
> and chr(-1) raise the ValueError.
>
> I attached a (really) stupid example to reproduce.
> When I browse pypy sources in rpython, I can't believe there is less than
> 256 constants of type 'ref'.
>
> What do you think ? Did I miss something ?
>

There are many string constants in your function.
Did you try something like
   raise Exception("Opcode not implemented : %d" % opcode)

-- 
Amaury Forgeot d'Arc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20110922/3f5e843f/attachment.html>


More information about the pypy-dev mailing list