FW: Bug 722749 - Javascript engine and ccdump tool modification

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

FW: Bug 722749 - Javascript engine and ccdump tool modification

Varadarajan S
Dear All,

To have a simple tool for Firefox browsers which can give us the leaking objects and its corresponding file name and line number, I referred to Bug 722749 and changed the files in the Mozilla-central repository ( locally )

Objective: To use ccdump tool to get object address and its filename and line number
Files changed: Find attached
Output: Find attached


Query: I am able to get the file name and line number only for GCThing which are function objects (js::IsFunctionObject(obj)) and not any objects or kinds. Kindly suggest a way for this tool that would help the developers to identify the leak with ease


Regards,
Varada
_______________________________________________
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: FW: Bug 722749 - Javascript engine and ccdump tool modification

Jim Blandy-3
On 11/27/2013 12:16 AM, Varadarajan S wrote:
> Query: I am able to get the file name and line number only for GCThing which are function objects (js::IsFunctionObject(obj)) and not any objects or kinds. Kindly suggest a way for this tool that would help the developers to identify the leak with ease

Hi, Varada. Thanks for writing us about this.

Since bug 722749 was created, bhackett has added some very nice hooks to
the JS engine which should help us attach all sorts of interesting
information to objects when they are allocated. That work was done in
bug 850026.

We haven't yet written code to take proper advantage of this metadata
hook, however. Doing so will require a solid understanding of
SpiderMonkey's JavaScript object representation, and the shape tree in
particular. Heap debugging is one of Mozilla's Developer Tools Team's
current projects, though, so I hope we'll be able to make progress on
this in the next few months.

If you're curious about the details, see the following functions, in
js/src/jsfriendapi.cpp:

js::SetObjectMetadataCallback
js::SetObjectMetadata
js::GetObjectMetadata

An embedding (for example, a browser or a xulrunner app) can call
SetObjectMetadataCallback to provide a C++ function for SpiderMonkey to
call each time an object is allocated in the given compartment. If you
would like to see these functions in action, you can run this test:

js/src/jit-test/tests/basic/metadata-hook.js

That test is written in JS, and uses the testing function defined in
js/src/builtin/TestingFunctions.cpp, which uses the callback described
above.


Note that the Mozilla mailing lists seem to remove attachements to email
messages, at least in my recent experience. So it's probably best to
simply include text you'd like to show people in the message directly.

(Also: most Mozilla employees in the U.S., including myself, will be on
vacation until Monday, for Thanksgiving.)

_______________________________________________
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: FW: Bug 722749 - Javascript engine and ccdump tool modification

Jim Blandy-3
Varada, note that if you create a Bugzilla account and add yourself to
the 'CC' list of bug 722749, then you'll automatically get notified of
any new discussion in that bug. Others have done the same, so discussing
these ideas in the bug itself is actually probably the best way to get
the attention of people who are interested.
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine