[webkit-dev] Function & Property Names

Geoffrey Garen ggaren at apple.com
Tue May 4 10:56:48 PDT 2010


CodeBlock::m_numParameters counts a function's expected parameter count.

Geoff

On May 3, 2010, at 9:21 PM, Nyx wrote:

> 
> Is there any way to get the number of parameters a function has declared from
> a JSFunction object?
> 
> I'm asking because I want to get the argument values a function is receiving
> in an op_call (in the interpreter). I copied this snipper of code for the
> case where a host function is called:
> 
> Register* thisRegister = callFrame->registers() -
> RegisterFile::CallFrameHeaderSize - argCount;
> ArgList args(thisRegister + 1, argCount - 1);
> 
> The problem is that argCount is the number of arguments passed, and so, if
> the function takes 5 arguments and 3 are passed, I'm not getting the first
> 2, only the last 3, two of which show up as "undefined". Hence I believe I
> would need the number of arguments the function declares takes to properly
> compute the register offset.
> 
> -- 
> View this message in context: http://old.nabble.com/Function---Property-Names-tp28394250p28442878.html
> Sent from the Webkit mailing list archive at Nabble.com.
> 
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev



More information about the webkit-dev mailing list