[LLVMdev] Iterator protocols

Dan Gohman gohman at apple.com
Tue May 13 15:28:55 PDT 2008


On May 12, 2008, at 6:49 PM, Talin wrote:
> So the question is, what's the trade-off. In most languages that  
> support
> exceptions, you tend to think of exceptions as expensive operations  
> that
> should only be thrown if something truly "exceptional" happens. OTOH,
> the Java case is also made worse by the fact that a large part of the
> time you'll be using the more expensive interface dispatching, rather
> than simple vtable dispatching.

How dynamic is your language? Is it possible that the resolution of
the hasNext method could change as the loop executes? If not, it
would be neat to find a way to resolve the hasNext callee once,
before the loop, and then just make a simple call on each iteration.

Dan




More information about the llvm-dev mailing list