[pypy-dev] [pypy-svn] pypy default: port test_intbound_addsub_ge to test_pypy_c_new

Alex Gaynor alex.gaynor at gmail.com
Thu Apr 14 17:15:13 CEST 2011


On Thu, Apr 14, 2011 at 10:56 AM, Antonio Cuni <anto.cuni at gmail.com> wrote:

> On 14/04/11 16:44, Hakan Ardo wrote:
> > Second though, that will recompile on every call, but if we cache the
> > promote functions:
> >
> >     def main(n, promoters={}):
> >         i, a = 0, 0
> >         if n not in promoters:
> >             exec """def promote(n):
> >                         assert n==%d""" % n
> >             promoters[n] = promote
> >         else:
> >             promote = promoters[n]
> >         while i < n:
> >             promote(n)
> >             a += i+5
> >             i += 1
> >         return a
> >
> > we will actualy get rid of the extra ptr_eq and guard_false too...
>
> wow, that's advanced... and without knowing the internals of the JIT, it
> really looks like black magic.
>
> While we are at it and if you have time/feel like, could you please have a
> look to test_zeropadded and test_circular in test_pypy_c_new? It's not
> clear
> to me what they are supposed to check (note that it's fine if you say "they
> just check that the program works correctly" :-)).
>
> _______________________________________________
> pypy-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/pypy-dev
>

The idea of a builtin app level promote is cool, I guess it should be smart
and unbox primitives though.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20110414/63f7b87c/attachment.html>


More information about the Pypy-dev mailing list