JSFunction.u.i.names

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

JSFunction.u.i.names

maddy-15
Hi
  JSFunction.u.i.names contains the arguments and variables of a
JavaScript function. Where is this names variable filled when parsing
and interpreting a .js file? One of the names variable seems to go
rogue for me. I would like to print the address of all the names array
members. I am looking for the place where they are parsed/allocated
and filled?

Madhavan
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine
Reply | Threaded
Open this post in threaded view
|

Re: JSFunction.u.i.names

Jim Blandy-3
On 04/19/2011 04:55 AM, maddy wrote:
> Hi
>    JSFunction.u.i.names contains the arguments and variables of a
> JavaScript function. Where is this names variable filled when parsing
> and interpreting a .js file? One of the names variable seems to go
> rogue for me. I would like to print the address of all the names array
> members. I am looking for the place where they are parsed/allocated
> and filled?

I don't remember exactly where, but I think it's in some jsfun.cpp
function called from jsemit.cpp. The way to answer questions like this
is to run the shell under the debugger, set a watchpoint on the value
before it's filled in (say, before the call to js_EmitTree) and see
where it gets set.


_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine
Reply | Threaded
Open this post in threaded view
|

Re: JSFunction.u.i.names

maddy-15
Hi
  I am facing a curious problem. In Weave.js, AboutWeaveLog function
there is a variable 'ch' defined. The address of this string seems to
be from the data segment of my process. Basically any single or two
character string seems to be stored in the data segment which I
verified by printing the address. Any string longer than 2 characters
seems to be a malloced address. Is there any specific handling in
jsemit or jsfun for single or two character strings? Apart from
jsval.h where __attribute__(aligned(8)) is specified for 64 bit
alignment is there any other file that needs to be ported for proper
alignment?

Madhavan

On Apr 19, 8:39 pm, Jim Blandy <[hidden email]> wrote:

> On 04/19/2011 04:55 AM, maddy wrote:
>
> > Hi
> >    JSFunction.u.i.names contains the arguments and variables of a
> > JavaScript function. Where is this names variable filled when parsing
> > and interpreting a .js file? One of the names variable seems to go
> > rogue for me. I would like to print the address of all the names array
> > members. I am looking for the place where they are parsed/allocated
> > and filled?
>
> I don't remember exactly where, but I think it's in some jsfun.cpp
> function called from jsemit.cpp. The way to answer questions like this
> is to run the shell under the debugger, set a watchpoint on the value
> before it's filled in (say, before the call to js_EmitTree) and see
> where it gets set.

_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine
Reply | Threaded
Open this post in threaded view
|

Re: JSFunction.u.i.names

Boris Zbarsky
On 4/25/11 10:47 AM, maddy wrote:
> Is there any specific handling in
> jsemit or jsfun for single or two character strings?

There's general specific handling for short strings in JS.  See the
declarations of JSAtom::length2StaticTable and JSAtom::unitStaticTable
in jsstr.cpp.

-Boris
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine