Why does the arity check need to be in the caller, and not the callee?

Consider: one function that is called from 10,000 places.

Arity check in the caller: 10,000 copies of the artity check.
Arity check in the callee: one copy of the arity check

Toshi

--- On Wed, 6/10/09, Geoffrey Garen <[email protected]> wrote:

From: Geoffrey Garen <[email protected]>
Subject: Re: [webkit-dev] arm jit
To: "Oliver Hunt" <[email protected]>
Cc: "Toshiyasu Morita" <[email protected]>, "WebKit Development" 
<[email protected]>
Date: Wednesday, June 10, 2009, 9:14 PM

> It could be worth trying a stub function that triggers the compilation of the 
> function should it not be present, but i'm not sure what that would really 
> save as we still need the arity checks inline

A design that I like is a stub function that triggers compilation (so the 
caller can always "just call"), combined with an arity check in the callee, 
which linked calls can skip (by linking to a label past the end of the arity 
check).

I think that could simplify the calling code, while reducing its footprint.

Geoff



      
_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to