Since [ http://trac.webkit.org/changeset/35917 ], calling JSGlobalContextRelease always triggers a GC heap collection (if not a full destroy). As per 35917's changelog "This is only really necessary when the (JSGlobalObject's) last reference is released, but there is no way to determine that, and no harm in collecting slightly more often." Well, we now know of cases of API clients who are harmed by the performance penalty of collecting too often, so it's time to add a way to determine whether a call to JSGlobalContextRelease is removing the last protect from it's global object. If further protects are retaining the global object (likely from other JSGlobalContextRefs), then don't trigger a GC collection.
Created attachment 51481 [details] The patch
Comment on attachment 51481 [details] The patch r=me
landed in r56435
+ // * If there are more references remaining the the global object, then do nothing + // (specifically that is more protects, which we assume come from other JSGlobalContextRefs). Typo: "the the".