IsAboutToBeFinalized takes cx to access the runtime and get the associated gcCurrentCompartment. Howerever, the runtime can be accessed from the cpmpartment for the thing making the cx parameter unnecessary.
Do you also want to change the JS_IsAboutToBeFinalized function? Whats the procedure to change an API function?
Created attachment 535871 [details] [diff] [review]
Here is the patch that removes the unneeded cx parameter.
(In reply to comment #1)
> Do you also want to change the JS_IsAboutToBeFinalized function?
Thanks for remainding about it! I will update the patch to always call IsAboutToBeFinalized from xpconnect. After that we would not have JS_IsAboutToBeFinalized calls in the browser and we can wait with any changes to JS_IsAboutToBeFinalized until we have a generational GC or something like that that disrupts the GC logic significantly.
> Whats the
> procedure to change an API function?
Some discussion on internal and public mail lists is in due.
Created attachment 595170 [details] [diff] [review]
The patch removes the cx from all internal and public API - per resent discussion on the mailing list this is OK and desirable.
Created attachment 595186 [details] [diff] [review]
Here is the right patch!
Comment on attachment 595186 [details] [diff] [review]
>- return IsAboutToBeFinalized(cx, (gc::Cell *)thing);
>+ gc::Cell * t = static_cast<gc::Cell *>(thing);
Space around *?