I am trying to enable a threaded debug dump in SpiderMonkey, by editing the jsinterp.cpp file. Basically, the things I am trying to do are as follows:
- Catch a JSScript before the main loop of Interpret() begins.
- Open a separate thread.
- In that thread, invoke js_Disassemble with the script to get the machine code.
- Write the machine code to a file.
The reason for trying a threaded version is simply for performance issues. Some addons become "unresponsive" if I run the disassmeble and write the output in the same thread. I can get some output in a single thread but it's way too slow.
I followed the tutorial in https://developer.mozilla.org/en/Making_Cross-Thread_Calls_Using_Runnables for creating threads. But when I built it, I faced 11 "unresolved external symbol error." Again after some googling, I found out about setting XPCOM_GLUE by #define XPCOM_GLUE 1. However, this time I am facing a new problem: "base class nsRunnable not defined". I can't find a solution for this.
Any help would be appreciated. Thanks,