On 02/24/2015 07:10 AM, obastemur wrote:
When an Object is created on the JS land, it doesn't have a private slot. I'm 
adding an extra object property on the native side and managing the private 
slot for these objects.

Are these your own objects, for which you have or could have your own JSClass? Or (as you seem to be saying) is this something that can be added to any object?

Is it possible to have below list of features;

Add/Enable private slot for a JS land object or an object without a private 
slot.
- JS_Add/EnablePrivateSlot

I'm not saying this is a good idea, but you could always store it as a plain property using a PrivateValue (nonenumerable, nonconfigurable, etc.)

Give indexed access to JS side object from given memory address.

- JS_SetExternalArrayDataIndex(JSObject, void *memory, int byte_size or 
enumaration also works, int length)


Above 2 items could help a lot with the jxcore buffer support. The current 
implementation also works (I did a very ugly hack for that) but the performance 
is a pain.. especially when someone is accessing to the buffer.

I don't really know anything about Buffers, though I just skimmed <http://nodejs.org/api/buffer.html>. It almost seems like you could polyfill buffers using DataView + ArrayBuffer. (ArrayBuffers can accept external data pointers via JSAPI, if that's needed.) It's true that we don't really JIT accelerate DataViews much, as compared to eg typed arrays. (But you can always create a typed array view.)

_______________________________________________
dev-tech-js-engine-internals mailing list
dev-tech-js-engine-internals@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to