Re: Missing js::SharedArrayRawBufferRefs::~SharedArrayRawBufferRefs symbol in spidermonkey 68

[email protected] Wed, 10 Jun 2020 00:24:06 -0700 (PDT)
Newsgroups gmane.comp.mozilla.devel.jseng
Message-ID <[email protected]>
On Wednesday, June 10, 2020 at 12:12:56 AM UTC+2, Steve Fink wrote:
> On 6/6/20 2:09 PM, [email protected] wrote:
> > BTW, I would be satisfied just to understand how to move data between contexts. Using stringify it's too limiting (missing Map, Regex, etc..).
> 
> Just to be sure I understand what you mean by "move data between 
> contexts": do you have multiple threads, each with their own runtime? 
> These days, there's only one context and runtime per thread, so moving 
> data between contexts is rare.

Yes, that's the case. The application I am porting to SM 68 ( 0ad https://trac.wildfiregames.com/) uses multiple Runtimes/Threads in distinct threads. 

> Structured clone preserves more information than stringify, but it is 
> still very lossy -- it preserves neither an object's identity nor its 
> prototype, for example. (Its semantics are defined in the HTML spec: 
> https://html.spec.whatwg.org/multipage/structured-data.html#safe-passing-of-structured-data 
> ). I don't think we have any way to share data between runtimes that 
> isn't some form of lossy serialization/deserialization.
> 
> js::SharedArrayRawBufferRefs is not marked JS_PUBLIC_API. It is a member 
> of JSStructuredCloneData, which *is* marked JS_PUBLIC_API. It looks like 
> an omission to me. I filed 
> https://bugzilla.mozilla.org/show_bug.cgi?id=1644600

Yes, I am aware that using StructuredClone might still produce a loss of information. However it is sufficient for me :)

Thanks for opening the ticket!