inline unicode()

Darin Adler khtml-devel@kde.org
Mon, 10 Mar 2003 16:22:22 -0800


On Monday, March 10, 2003, at 04:13 PM, Harri Porten wrote:

> I'm still wondering why JavaScriptCore code replaced usage of the 
> inlined
> UChar function
>
>   unsigned short unicode() const { return uc; }
>
> with direct access to the (previously private) uc member.

It's a simple practical issue. We do our development builds with -O0 so 
with no inlining. The functions that get right at the value of the 
UChar are so hot, that if we leave them calling the inline function, 
it's noticeably slower, and also more annoying to debug.

Since UChar does not provide any abstraction on top of the unicode 
value, I don't find one or the another any more or less elegant. 
There's a big practical day-to-day development advantage for us to have 
this code still be relatively fast when we're working on Safari.

This seems to be a rather nitpicky thing to have different in our two 
source trees, so I'd urge you to consider rolling in these changes 
unless you find them extremely distasteful.

     -- Darin