[Webkit-unassigned] [Bug 120112] Typed Arrays have no public facing API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 18 06:21:50 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=120112

--- Comment #39 from Dominic Szablewski <dominic.szablewski at gmail.com> ---
(In reply to comment #38)
> I really wish this proposed API included a way to expose data into JS
> without copying it into a new buffer. Memory is still a precious commodity
> in some circumstances, so here's my proposal accomplishing this with the
> following additions:
> 
> typedef void (*JSDataFinalizeCallback)(void*);
> 
> JSDataRef JSDataCreateWithBytes(void*, size_t, _Nullable
> JSDataFinalizeCallback);
> 
> JSObjectRef JSObjectMakeTypedArrayWithData(JSContextRef, JSTypedArrayType,
> JSDataRef, JSValueRef* exception);
> 
> A JSDataRefCF.h could also have some convenience functions for dealing with
> CFDataRef types to make Cocoa integration even easier (just like with
> CFStringRefCF.h).

I like this proposal, but I think it would be ok to implement it subsequently.

Imho it's important to get the basic API implemented sooner rather than later. It's been 3 years now since I started to fork JSC because of the missing Typed Array API. Getting each new version of JSC to compile on iOS/tvOS is a terrifying, herculean task, as there are no targets for these platforms in the project files. As a result, the JSC fork lags behind significantly of what's available on current iOS versions - missing security fixes and performance improvements. I'm not even sure if JSC is still AppStore compatible with Apple's new Bitcode requirements (I doubt LLINT properly compiles to Bitcode?!). We NEED the Typed Array API in JSC to continue our project _at all_. </rant>



I created a patch of my implementation. The "svn-create-patch upload" script silently failed for me (and I'm probably missing a bunch of other steps!?), so I just uploaded the patch here in the hopes that anybody would take a look:

http://phoboslab.org/files/jsc-typed-array-api.patch


The patch includes the API implementation and header files as can be seen here:
https://github.com/phoboslab/JavaScriptCore-iOS/blob/new-typed-array-api/JavaScriptCore/API/JSTypedArray.cpp
https://github.com/phoboslab/JavaScriptCore-iOS/blob/new-typed-array-api/JavaScriptCore/API/JSTypedArray.h

It works for me, but I'm probably miles away from being able to contribute this API to JSC on my own. I'm struggling with the patch tools already and in general have no idea what I'm doing...

If anybody of the JSC contributors could take a look and possibly use my work to build upon, I'd be very grateful and owe you more than one beer!

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20151118/7e13dd40/attachment-0001.html>


More information about the webkit-unassigned mailing list