Re: [v8-users] ArrayBuffer BackingStore mutex causing high system load

2020-10-20 Thread Andrew Johnston
Hi Ulan, Thanks for the response. I will do that over next couple days. It could be an edge case or could be related to something stupid I am doing when running isolates on threads in the same process (https://github.com/just-js/just/blob/main/just.cc#L2722). When i use separate processes I

Re: [v8-users] ArrayBuffer BackingStore mutex causing high system load

2020-10-20 Thread 'Ulan Degenbaev' via v8-users
Hi Andrew! Could you please file a bug at crbug.com/v8 with steps to reproduce? We will take a look and see if we can optimize this case. Until it is fixed, I think caching the backing store pointer in the internal field would work. Then you'd need to ensure that you keep a handle to ArrayBuffer

[v8-users] ArrayBuffer BackingStore mutex causing high system load

2020-10-17 Thread billywhizz
Hi, I have put some details here on an issue i have come across while doing some benchmarking: https://gist.github.com/billywhizz/ff4c83c37142198d2e70992e438bf045 I have a few questions around this: 1) Do we need a pthread_mutex_lock and pthread_mutex_unlock in every access to

Re: [v8-users] ArrayBuffer size is 0

2019-09-02 Thread Jonathan Doster
Simon, Thank you so much for your answer! That makes perfect sense On Sun, Sep 1, 2019 at 10:31 PM 'Simon Zünd' via v8-users < v8-users@googlegroups.com> wrote: > Hey, > > You are not accessing the "size" property, but treat "args[0]" as if it > were a number (which it is not, it's a

Re: [v8-users] ArrayBuffer size is 0

2019-09-01 Thread 'Simon Zünd' via v8-users
Hey, You are not accessing the "size" property, but treat "args[0]" as if it were a number (which it is not, it's a ArrayBuffer). Since you have established that args[0] is an ArrayBuffer, you can use cast, which would look roughly like this: Local array_buffer = Local::cast(args[0]); size_t

[v8-users] ArrayBuffer size is 0

2019-09-01 Thread Jonathan Doster
Hey everyone! I am trying to pass an ArrayBuffer from JS to C++, and when I debug the "size" variable is 0. I do not understand what I am doing wrong, ultimately my goal is to be able to read and write the buffer, copy, etc. Thank you!! var api = require('../src/public/api') api.Method(new

Re: [v8-users] Arraybuffer

2018-10-01 Thread Michael Hablich
Hi Dan, as already pointed out in this thread and other ones created by you: Please ask blink-related questions on blink-...@chromium.org. A good way to understand how something works is to check existing code as Caitlin already pointed out. Please use cs.chromium.org for this. If *after*

Re: [v8-users] Arraybuffer

2018-09-28 Thread dan Med
I appreciate your help, but still i can't seem to just understand the stack calls and if i do that then i like to understand what thing should i do in the code to get v8 execute those lines, well if my prievous question is out of scope for v8-users how can i understand how they work ? There is no

Re: [v8-users] Arraybuffer and arraybufferbuilde

2018-09-27 Thread dan Med
What i'm looking generally is how to understand the code in general and by this i mean the following So processes in chrome talk to each other via the IPC, other than reading the source code which just scratched the surface i want to understand from the lowest point of the implementation and then

Re: [v8-users] Arraybuffer

2018-09-24 Thread J Decker
On Mon, Sep 24, 2018 at 2:18 PM dan Med wrote: > When is it called ? > It never is; It doesn't even exist in V8. > > On Thu, 20 Sep 2018 at 07:03, dan Med wrote: > >> Ok but then can someone give me a big picture of the directories ? And >> how the code is generally structured ? >> Or how is

Re: [v8-users] Arraybuffer

2018-09-24 Thread dan Med
When is it called ? On Thu, 20 Sep 2018 at 07:03, dan Med wrote: > Ok but then can someone give me a big picture of the directories ? And how > the code is generally structured ? > Or how is ArrayBufferBuilder:append called ? > > On Thu, 20 Sep 2018 at 00:14, Peter Schow wrote: > >> On Wed,

Re: [v8-users] Arraybuffer

2018-09-19 Thread dan Med
Ok but then can someone give me a big picture of the directories ? And how the code is generally structured ? Or how is ArrayBufferBuilder:append called ? On Thu, 20 Sep 2018 at 00:14, Peter Schow wrote: > On Wed, Sep 19, 2018 at 2:36 PM dan Med wrote: > > This is how I see it atm > > Each tab

Re: [v8-users] Arraybuffer

2018-09-19 Thread Peter Schow
On Wed, Sep 19, 2018 at 2:36 PM dan Med wrote: > This is how I see it atm > Each tab is a process that is composed of several threads, this process is > sandboxed with the Windows kernel security ( on Windows ) > Then we have WebKit which is the rendered thread inside of this main tab >

Re: [v8-users] Arraybuffer

2018-09-19 Thread dan Med
This is how I see it atm Each tab is a process that is composed of several threads, this process is sandboxed with the Windows kernel security ( on Windows ) Then we have WebKit which is the rendered thread inside of this main tab (thread) which as the name implies will render the page. When in

Re: [v8-users] Arraybuffer

2018-09-19 Thread dan Med
Ok so when is arraybufferbuilde:append called ? On Wed, 19 Sep 2018 at 12:36, @soylentgraham wrote: > Not sure where to start with this message > > a) Not even vaguely related to the original topic, you should start a new > thread when the topic is wildly different. > b) Do not start a new

Re: [v8-users] Arraybuffer

2018-09-19 Thread @soylentgraham
Not sure where to start with this message a) Not even vaguely related to the original topic, you should start a new thread when the topic is wildly different. b) Do not start a new thread. c) This code is from libav (or actually, maybe ffmpeg). av_XXX are macros, functions and other values. The

Re: [v8-users] Arraybuffer

2018-09-18 Thread dan Med
I was reading this code but i can't figure outwhat av_..._.. stands for is it already opening the connection here? static int tcp_open(URLContext *h, const char *uri, int flags){ struct addrinfo hints = { 0 }, *ai, *cur_ai;int port, fd = -1; TCPContext *s = h->priv_data;const char *p;

Re: [v8-users] Arraybuffer

2018-09-15 Thread dan Med
That’s all. On Fri, 14 Sep 2018 at 21:53, dan Med wrote: > I don’t understand how that code could be helpful to me.. > > On Fri, 14 Sep 2018 at 21:51, dan Med wrote: > >> Technica question, when Arraybufferbuilder:append will be called ? >> >> On Fri, 14 Sep 2018 at 01:14, Peter Schow wrote:

Re: [v8-users] Arraybuffer

2018-09-14 Thread dan Med
Technica question, when Arraybufferbuilder:append will be called ? On Fri, 14 Sep 2018 at 01:14, Peter Schow wrote: > On Thu, Sep 13, 2018 at 10:45 AM dan Med wrote: > > That isn’t my question > > Arraybufferbuilder:append how could I get that to be called. > > What I really need is a

Re: [v8-users] Arraybuffer

2018-09-13 Thread Peter Schow
On Thu, Sep 13, 2018 at 10:45 AM dan Med wrote: > That isn’t my question > Arraybufferbuilder:append how could I get that to be called. > What I really need is a little guidance on how to understand how v8 will > parse my JavaScript script and how it will allocate the data. > Maybe even how

Re: [v8-users] Arraybuffer

2018-09-13 Thread dan Med
That isn’t my question Arraybufferbuilder:append how could I get that to be called. What I really need is a little guidance on how to understand how v8 will parse my JavaScript script and how it will allocate the data. Maybe even how a buffer or if there’s something that describes how buffers

Re: [v8-users] Arraybuffer

2018-09-13 Thread J Decker
On Thu, Sep 13, 2018 at 9:21 AM dan Med wrote: > Still no one ? > I dont know how I could have been more clear about the memory. https://groups.google.com/d/msg/v8-users/MNpTNiRaBmM/Muz5-KHpBgAJ Why do you think there is some magic to the buffer of an arraybuffer? It's just continuous bytes in

Re: [v8-users] Arraybuffer

2018-09-13 Thread dan Med
Still no one ? On Thu, 13 Sep 2018 at 16:31, dan Med wrote: > Okay I will but, how could I be sure when blink on the renderer process > executes arraybufferbuilder ?? > Or one more thing, can u redirect me to checkout how v8 represents data in > memory, how would it handle arraybuffers? > The

Re: [v8-users] Arraybuffer

2018-09-13 Thread dan Med
Okay I will but, how could I be sure when blink on the renderer process executes arraybufferbuilder ?? Or one more thing, can u redirect me to checkout how v8 represents data in memory, how would it handle arraybuffers? The only thing I’ve managed to find ( in the github repo ) was a JavaScript

Re: [v8-users] Arraybuffer

2018-09-13 Thread dan Med
No one is willingly to help me ? On Wed, 12 Sep 2018 at 20:34, dan Med wrote: > Yeah i meant ArrayBuffer*Builder*::Append my bad but when it is > actually called in blink ? > Cause by the name it has to do with Arraybuffers.. > Plus if i build v8 so i can examine the memory layout, where

Re: [v8-users] Arraybuffer

2018-09-12 Thread dan Med
Yeah i meant ArrayBuffer*Builder*::Append my bad but when it is actually called in blink ? Cause by the name it has to do with Arraybuffers.. Plus if i build v8 so i can examine the memory layout, where is the code on how v8 handeles arraybuffer ? Where is the doc or some source where

Re: [v8-users] Arraybuffer

2018-09-12 Thread Jakob Kummerow
On Wed, 12 Sep 2018 at 13:15, dan Med wrote: > But can someone help me understand the arraybuffer part ? How to call > arraybuffer::append and when I create an instance of a arraybuffer it will > create it with maximum size so 37... bytes and will only say that the bytes > used are the one which

Re: [v8-users] Arraybuffer

2018-09-12 Thread dan Med
Oh one more thing, so each tab in chrome is handeled as a single process, but Is the same process sandboxes with the Windows 10 kernel. Security or there’s another process which is sandboxes and then the main tab process the ( renderer ) is executed inside of it ? On Wed, 12 Sep 2018 at 13:15,

Re: [v8-users] Arraybuffer

2018-09-12 Thread dan Med
But can someone help me understand the arraybuffer part ? How to call arraybuffer::append and when I create an instance of a arraybuffer it will create it with maximum size so 37... bytes and will only say that the bytes used are the one which I’ve declared ? On Wed, 12 Sep 2018 at 00:12, Peter

Re: [v8-users] Arraybuffer

2018-09-11 Thread Peter Schow
On Tue, Sep 11, 2018 at 2:09 PM dan Med wrote: > > Would you suggest to build v8 such that I can debug it as I want ? It's difficult to go wrong with this approach if you want to better understand V8 or any large, complex system. -- -- v8-users mailing list v8-users@googlegroups.com

Re: [v8-users] Arraybuffer

2018-09-11 Thread dan Med
Would you suggest to build v8 such that I can debug it as I want ? On Tue, 11 Sep 2018 at 12:44, dan Med wrote: > I've already read that guide and watched those videos, but i'm not > interested at a HIGH level definition, i wan't to see the hole picture > starting from the very buttom or at

Re: [v8-users] Arraybuffer

2018-09-11 Thread dan Med
I've already read that guide and watched those videos, but i'm not interested at a HIGH level definition, i wan't to see the hole picture starting from the very buttom or at least at a low level In those presentation they just give the very top of the iceberg which isn't really helpful Il

Re: [v8-users] Arraybuffer

2018-09-11 Thread dan Med
Ok so to answer the memory side i believe i should build v8 and then debug it and see the memory. But another question arises, how is data/pointers or anything else represented in memory ? There should be i guide i hope ... Il giorno mar 11 set 2018 alle ore 12:41 dan Med ha scritto: > So

Re: [v8-users] Arraybuffer

2018-09-11 Thread dan Med
So the location of the length regarding my allocation is base on which algorithm v8 uses to find the free space it needs? Anyway, i still don't get when arraybuffer::append will be called or can be called One more thing when i create a new instance let's say this example again: Arraybuffer

Re: [v8-users] Arraybuffer

2018-09-11 Thread J Decker
On Tue, Sep 11, 2018 at 12:44 AM dan Med wrote: > First of all, i'd like to say that for me the documentation is really. > useless from a real technical point of view. > So, what i'd like to understand is how v8 would compile a javascript > "file" by that i mean how it would be > represented

Re: [v8-users] Arraybuffer

2018-09-11 Thread dan Med
by doing buffer_->Data() i'm accessing a defined length space somewhere in memory but on the heap since there's the new operator involded.. and where data points to the length of that space is the same as the one declared for example as Arraybuffer a = new arraybuffer(10) so data will point to a

Re: [v8-users] Arraybuffer

2018-09-11 Thread dan Med
First of all, i'd like to say that for me the documentation is really. useless from a real technical point of view. So, what i'd like to understand is how v8 would compile a javascript "file" by that i mean how it would be represented in memory which methods will be called and so on (In

Re: [v8-users] Arraybuffer

2018-09-10 Thread dan Med
ATM I’m writing with my phone, here in EU is almost midnight so I will write u an email tomorrow fully detailed. Btw how do I call append ??? I’m interested in how v8 works and manages JavaScript code that’s all. When I talk about typedarray or anything else I referr to the JavaScript side, so

Re: [v8-users] Arraybuffer

2018-09-10 Thread @soylentgraham
> First, how big is the data member of the object ? As I said before. Capacity is the size of the memory allocated that data points at. > Is it as big as the actual array buffer length which I declare on JavaScript It will be either as big, or bigger. It can grow. bytes_used will be the

Re: [v8-users] Arraybuffer

2018-09-10 Thread dan Med
First, how big is the data member of the object ? Is it as big as the actual array buffer length which I declare on JavaScript and which I can build on top of it a typedarray ? No, I’m just trying to understand how v8 works, I know it is a big thing but at least how it moves then I might read the

Re: [v8-users] Arraybuffer

2018-09-10 Thread dan Med
How big is the offset from buffer to data ? const void* Data

Re: [v8-users] Arraybuffer

2018-09-10 Thread dan Med
Cause i saw the code but didn't find how it handles all the possible javascript i might write into a script file Il giorno lun 10 set 2018 alle ore 23:06 dan Med ha scritto: > But after using it for a little while, I have found v8 in general is > pretty simple. It provides an interface to C

Re: [v8-users] Arraybuffer

2018-09-10 Thread dan Med
But after using it for a little while, I have found v8 in general is pretty simple. It provides an interface to C functions and memory. This is kinda what it's for. so how can i see the memory management ? Il giorno lun 10 set 2018 alle ore 23:06 dan Med ha scritto: > So, the hole length of

Re: [v8-users] Arraybuffer

2018-09-10 Thread dan Med
So, the hole length of this raw memory is set to be Data ? And to use it i should create a view on top of it like with typedarrays? So to call arraybuffer::append i should first, try to make the typed array bigger that action will call the arraybuffer::append ? i didn't ask how memcpy work, i

Re: [v8-users] Arraybuffer

2018-09-10 Thread dan Med
in this snippet for example namespace WTF {// A utility class to build

Re: [v8-users] Arraybuffer

2018-09-10 Thread Jakob Kummerow
On Mon, Sep 10, 2018 at 12:22 PM dan Med wrote: > I don't quite see if this google group is useful or not, everybody keeps > answering me with superficial things, > You said you wanted to read the compiler's source but couldn't find it, so I told you that it's in src/compiler/. If that was not

Re: [v8-users] Arraybuffer

2018-09-10 Thread Jakob Kummerow
On Sun, Sep 9, 2018 at 8:54 AM dan Med wrote: > Oh and one more thing, i've surfed perhaps the entire source code of v8 at > least the interesting parts, but what i came across was just very short > code execpt for some builtins written in javascript i believe, can't find > all of the things

Re: [v8-users] Arraybuffer

2018-09-09 Thread dan Med
I don't have understood this part, let me explain it to you. This is how i get it tell me if i'm wrong at any part. I need to understand how is the structure in memory of the arraybuffer how is it represented and if the data of the array are directly stored at an offset accessed by buffer_ ->

Re: [v8-users] Arraybuffer

2018-09-04 Thread Graham Reeves
> is std::numeric_limits ::max ();

Re: [v8-users] Arraybuffer

2018-09-03 Thread dan Med
Can someone help me out? Il giorno sab 1 set 2018 alle ore 15:30 ha scritto: > array_buffer_builder.cc in src / > third_party /blink > /renderer >

[v8-users] Arraybuffer

2018-09-01 Thread litokis . tarin
array_buffer_builder.cc in src / third_party /blink /renderer /platform

Re: [v8-users] ArrayBuffer::Allocator::Free() length differing from Allocate() length?

2018-03-16 Thread Michael Lippautz
Is that the exact implementation? v8::ArrayBuffer::Allocator is required to be thread-safe [1] as V8 potentially (depends on the platform implementation) offloads the freeing onto a different thread. Cheers, -Michael [1] https://cs.chromium.org/chromium/src/v8/include/v8.h?dr=CSs=4269 On Thu,

[v8-users] ArrayBuffer::Allocator::Free() length differing from Allocate() length?

2018-03-14 Thread 'Kenton Varda' via v8-users
Hi v8-users, We have an ArrayBufferAllocator implementation that counts how much memory has been allocated. It basically looks like this: class AllocatorImpl final: public v8::ArrayBuffer::Allocator { public: AllocatorImpl(): allocated(0) {} ~AllocatorImpl(); inline size_t

[v8-users] ArrayBuffer API triggers unnecessary mark-and-sweep events.

2015-09-01 Thread Mark Logan
If I iterate the following steps: auto contents = buffer->Externalize(); buffer->Neuter(); auto newBuffer = ArrayBuffer::New(isolate, contents.Data(), contents.ByteLength(), v8::ArrayBufferCreationMode::kInternalized); V8 repeatedly triggers full

Re: [v8-users] ArrayBuffer fast access

2012-06-16 Thread Vyacheslav Egorov
I couldn't find any fast access defined in the JIT compiler There are fast paths for typed arrays inside V8, they are just not called typed arrays :-) Look for external arrays instead. For them V8 has both specialized IC stubs (e.g. load stub: