4

I am looking for quite some time a documentation for all the spidermonkey's bytecodes, or at least something that tells me in general what a bytecode's purpose is.

Does anyone can recommend such resource?

Thanks!

TCS
  • 5,790
  • 5
  • 54
  • 86

3 Answers3

5

I know it's not a great story, but the best documentation we have (other than jsopcode.tbl, as Alex K. mentions) is the interpreter implementation (jsinterp.cpp). We've noted on several occasions that it would be helpful to newcomers to have a more formalized document, noting the stack state transitions and describing side effects. I've started one here:

https://developer.mozilla.org/en/SpiderMonkey/Bytecodes

Feel free to drop in on #jsapi on irc.mozilla.org to ask about any that you'd like to see documented specifically!

cdleary
  • 69,512
  • 53
  • 163
  • 191
  • Hmmm, discussion with the other developers seems to have general agreement we should have a nice comment on each case in the interpreter loop -- I'll be migrating the documentation there and will link from the wiki page when that's done. – cdleary Dec 13 '11 at 01:47
  • Thanks for your help. I'll also check the IRC channel :-). Obviously a nice doc for each JSOP would be extremely helpful for newbies! – TCS Dec 13 '11 at 11:44
1

Download the source & look in jsopcode.tbl which will look like this (forked?) version.

Alex K.
  • 171,639
  • 30
  • 264
  • 288
  • I have this file, but it doesn't document the JSOPs. It says a few words on a few OPs, but its not *really* a documentation... – TCS Dec 09 '11 at 12:17
  • Nice answer! Here's the current link: http://mxr.mozilla.org/mozilla/source/js/src/jsopcode.tbl – cdleary Dec 12 '11 at 21:32
0

Many of the links in other answers are broken; here is documentation of the opcodes in the SpiderMonkey embedder docs repository, which is automatically generated from the source code.

ptomato
  • 56,175
  • 13
  • 112
  • 165