[webkit-dev] arm jit

Oliver Hunt oliver at apple.com
Thu Jun 11 11:01:55 PDT 2009


On Jun 11, 2009, at 9:59 AM, Toshiyasu Morita wrote:

> --- On Wed, 6/10/09, Gavin Barraclough <barraclough at apple.com> wrote:
>
> >  If you consider calling a JS function with too few arguments as  
> being akin to =
> > invoking a C++ method with some defaulted parameters not-provided,  
> then it is
> > also the responsibility of code generated for the call to such a  
> method to ensure
> > that values for all declared parameters are passed.)
>
> Thanks for the long explanation.
>
> Can the arity check be performed at compile time as in C++?
>
> Toshi
>

Alas no because you can't really guarantee exactly what function will  
be called (except in a few relatively uncommon cases), eg.

function g() {
     for (var i = 0; i < 100; i++)
          f(a*i);
}
g();

So if we look at the call to f(a*i) we need to ask "what is the arity  
of f?", so the issues we need to deal with to answer this question  
statically are
* the object f may not be defined or it may not be a function at  
compile time -- at runtime f may have become a function, or it may not
* any function call may result in f being changed and function calls  
may occur during arithmetic if you cannot guarantee the input types

These two things together mean it's not reasonably possible to  
guarantee the same function will be called every time, let alone have  
the same arity.

--Oliver

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090611/ebf2ee43/attachment.html>


More information about the webkit-dev mailing list