[webkit-dev] [JavaScriptCore] When to JSValueProtect?

Oliver Hunt oliver at apple.com
Mon Dec 9 08:52:57 PST 2013


On Dec 7, 2013, at 12:15 PM, Alexei Sholik <alcosholik at gmail.com> wrote:

> The garbage collector scans the C stack.
> 
> Hm, let me make sure I understand this correctly.
> ...
> I'm asking because I've never previously dealt with a library that scans the host application's stack. So it sounds pretty incredible to me.

Every JSC vm will do a full conservative scan of the in use portion of the stack for every thread in your application whenever it needs to GC.  Anything that looks like it could be a pointer to a gc value is treated as though it is _definitely_ a GC value and marked accordingly.

> 
> Thanks!
>    
> 
> 
> On Sat, Dec 7, 2013 at 9:37 PM, Geoffrey Garen <ggaren at apple.com> wrote:
> > At this point, the code is not inside the JS stack, so is it possible for an object to be collected between the calls to JSObjectMake and JSObjectCallAsFunction?
> 
> The garbage collector scans the C stack.
> 
> Geoff
> 
> 
> 
> -- 
> Best regards
> Alexei Sholik
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-dev/attachments/20131209/bbe1a761/attachment.html>


More information about the webkit-dev mailing list