[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Switch/Case statements revisited
- From: David Given <dg@...>
- Date: Fri, 09 Nov 2007 20:36:53 +0000
-----BEGIN PGP SIGNED MESSAGE-----
Mike Pall wrote:
> Jump tables are for AOT compilers. JIT compilers have better ways
> to optimize this, like profile-directed tree-dispatch. And it
> shouldn't matter which control-flow constructs in the source
> language generated the dispatch.
I haven't met those before (most of my compiler experience is with AOT stuff),
but I'd have though that would work very nearly as well as an explicit jump
table in the case where you have a contiguous set of integer indices, and
better in practically every other case. As well as making life easier for the
compiler and users. Does LuaJIT do this? Is there any real point trying to
optimise if...elseif...elseif...end sequences?
> [However I'm amazed to see a glimpse of a thought about semantics
> in the boring bi-monthly discussion on shallow syntax matters.]
Thank you... I think.
One day I'm going to write a Lua->Lua compiler just to give people something
to play with. Apart from anything else, the boring syntax discussions are
*traditional* by now.
âââ ïïïïïïïïïïïïïï âââ http://www.cowlark.com âââââââââââââââââââ
â "They laughed at Newton. They laughed at Einstein. Of course, they also
â laughed at Bozo the Clown." --- Carl Sagan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----