ProfK
ProfK

Reputation: 51064

Where can I find technical detail on JavaScript internal structures?

I would like to examine the structure of pieces of JavaScript, i.e. once an object has been interpreted, what is the structure of the memory space the interpreted parts occupy, e.g. it has an 'array' of members, probably a header record, etc. Pretty much like I can present a simple C function as assembly code, or vice versa.

I have never come across any such information? Is this highly proprietary for the various interpretors, is it some secret understood by nobody, is it a big tree of string values and string metadata? Where can I see this kind of thing?

Upvotes: 2

Views: 214

Answers (4)

dstnbrkr
dstnbrkr

Reputation: 4335

Check out the source of Rhino...

Upvotes: 1

John Gietzen
John Gietzen

Reputation: 49544

It is highly proprietary for various interpreters.

Here is some info on how V8 works (the chrome engine):

http://code.google.com/p/v8/

You may also like to take a look at the source code to SquirrelFish (WebKit/Safari)...

info:http://trac.webkit.org/wiki/SquirrelFish

... and TraceMonkey (FF3.1+) as they are both available.

info:https://wiki.mozilla.org/JavaScript:TraceMonkey

Upvotes: 4

Varkhan
Varkhan

Reputation: 16761

Well, since Firefox is open source, you could have a look at the code... But I am pretty sure the information you are looking for would take a while to extract from the code.

Upvotes: 1

Scott Evernden
Scott Evernden

Reputation: 39926

I think this very much depends on who's Javascript engine you're talking about. A good place to start tho might be a look at Google Chrome's Javascript engine called V8. That link will lead you to some videos on YouTube that give some information about how it was engineered

Upvotes: 1

Related Questions