[webkit-dev] WebCore/platform directory

Darin Adler darin at apple.com
Thu Dec 7 17:30:17 PST 2006


On Dec 7, 2006, at 5:26 PM, Morgan L wrote:

> Virtual functions are more expensive than the "Cheshire Cat"  
> pattern because they add code bloat to each call-site. To call a  
> virtual function the compiler must generate extra code to  
> dereference the object's vtable, whereas with a d-pointer approach  
> that cost exists only once at the site of the implementation.  
> Moreover, the d-pointer approach allows cross-platform code to be  
> more easily shared between the ports. The approach breaks down,  
> however, when header files are heavily #ifdef'd as they are in much  
> of WebCore today. It seems to me that there is a happy middle  
> ground to be had :-)

That sounds right to me.

     -- Darin




More information about the webkit-dev mailing list