On 08/21/2014 02:49 AM, Josip Maras wrote:
To do this, I would like to assign a unique ID to each object created during script execution. I've tried extending JsObject, ObjectImpl with an additional ID property, but this always fails - it takes me down a rabbit hole filled with compiler errors, assertion fails, and runtime errors (this is most likely due to my inexperience with such advanced c++ code).
Simple question, why not using the address of the object as a unique identifier and disabling moving GCs? Another approach would to track when objects are moved.
Also, maybe you can make use of some internal function that we use for debugging such as DumpHeapComplete[1].
Also note, that adding such API would not be acceptable if directly accessible from the language, and you will also be analyzing the analyzing code. Make would be better fitted under the Debugger API [2]. This API might also be a way to implement such analysis.
[1] https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Hacking_Tips#Dumping_the_JavaScript_heap
[2] https://developer.mozilla.org/en-US/docs/Tools/Debugger-API -- Nicolas B. Pierron _______________________________________________ dev-tech-js-engine-internals mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

