Thu Dec 9 13:58:00 GMT 2004
On Thu, 2004-12-09 at 13:40 +0000, Andrew Haley wrote:
> > I doubt you could get much better results and keep the specified
> > semantics of the iterators. Well, it should be possible to inline the
> > iterator methods directly in the iterator caller but that would involve
> > knowledge of the iterator implementation in the iterator clients which
> > is something I cannot imagine possible in the current gcc codebase.
> > Maybe the linker could help...
> It's not exactly impossible, but it is tricky. I wonder if the
> iterator and all its methods can be final, but still conform to the
> spec? That would, at least, allow all the checkMod() calls to be
If a "final method" means that the method cannot be overriden and if a
"final class" means that the class cannot be subclassed, then, I believe
you could safely make this specific implementation of the Iterator
I fail to see how that would help checkMod to be inlined by the compiler
(as a side note, the java spec seems to say that a "private" method is
implicitely "final") within the Iterator methods but I am no gcc guru
so... I must say that I did not even try to verify whether or not
checkMod was inlined within its callers. I merely verified whether or
not the other iterator methods were inlined within the iterator clients.
More information about the Java