On Dec 9, 2009, at 4:41 AM, Eddy Bruël wrote:

> However, when I trace my plugin, I notice that NPN_IdentifierIsString() 
> always returns true, even if I do an array access. It looks like the array 
> index gets converted to a string before it is passed to any of my callbacks. 
> This doesn't seem right to me, or is it?

I think there are two separate questions here:

    1) Is it legal for the host to send you a string identifier even if it 
happens to be a legal array index? If so, then your plug-in needs to handle the 
case where a string identifier comes in that happens to be an array index. I do 
think this is legal, although I’m not sure.

    2) Is there a performance bug in WebKit where it turns integer identifiers 
into string identifiers in cases where they could instead have remained as 
integers? If so, we could some operations up by fixing this.

I believe that (1) is expected behavior, and not a bug.

I believe that (2) is indeed a possible optimization, and it would be 
relatively simple to change WebKit to optimize this case. We’d have to add an 
overload of RuntimeObjectImp::getOwnPropertySlot to do this. There is a small 
risk that some existing plug-ins might not handle the integer identifiers 
properly.

You could file a bug report about it.

In the opposite direction, with calls from your plug-in to JavaScript, we do 
indeed have an optimized code path for integer identifiers.

    -- Darin

_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to