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 do

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

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 ArrayBuffer

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 size

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* consu

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 d

Re: [v8-users] Arraybuffer

2018-09-28 Thread Caitlin Potter
That question is probably out of scope for v8-users. The good news is, cs.chromium.org is very good at finding when things are called, how they’re used, etc. -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you

Re: [v8-users] Arraybuffer

2018-09-28 Thread dan Med
as far as i know for me to get the method FileReaderLoader::OnReceivedData called which will call the ArraybufferBuilder::Append this stack call has to happen : BlobReaderClientInterceptorForTesting::OnCalculatedSize --> call --> OnCalculatedSize --> call --> OnDataPipeReadable --> call --> OnRecei

Re: [v8-users] Arraybuffer

2018-09-28 Thread dan Med
Yes, i was looking at something like this ^^ Il giorno ven 28 set 2018 alle ore 07:06 Caitlin Potter ha scritto: > You can find places where ArrayBufferBuilder::Append is called, by looking > for the ArrayBufferBuilder symbol on cs.chromium.org. > > For example, here’s one use of it: > https://c

Re: [v8-users] Arraybuffer

2018-09-27 Thread Caitlin Potter
You can find places where ArrayBufferBuilder::Append is called, by looking for the ArrayBufferBuilder symbol on cs.chromium.org. For example, here’s one use of it: https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/fileapi/file_reader_loader.cc?type=cs&g=0&l=260 I don’t have a

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 n

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 Ar

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, Sep

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 > (thread)

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 the

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 threa

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;c

Re: [v8-users] Arraybuffer

2018-09-18 Thread dan Med
I know that i might have written the same thing over and over again but i didn't get an answer (which i really need) When is ArrayBufferBuilder::Append called ? Thank you Il giorno sab 15 set 2018 alle ore 12:34 dan Med ha scritto: > That’s all. > > On Fri, 14 Sep 2018 at 21:53, dan Med wrote:

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
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: > >> On Thu, Sep 13, 2018 at 10:45 AM dan Med wrote: >> > That isn’t

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 littl

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 a

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 a

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 on

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 fil

Re: [v8-users] Arraybuffer

2018-09-13 Thread @soylentgraham
You seem to be purposely ignoring the responses to your questions. If you still want help, build v8, build a program, breakpoint the function you want to see is called, debug it (this alone answers all your questions), then come back if you still have a VERY SPECIFIC question. On Thursday, 13

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 there's

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, dan

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 Sc

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 http://gro

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 lea

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 gio

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 th

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 fo

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 sp

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 the

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 cr

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 size

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 th

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 d

Re: [v8-users] Arraybuffer

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

Re: [v8-users] Arraybuffer

2018-09-10 Thread dan Med
i already did that and btw it is under the WTF/webkit . I'm interested how v8 handles javascript into every detail if u can guide me... Tell me which repository are being used by v8 on the related topic that would help me really much. By when it is called i mean, which javascript code will enable

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 t

Re: [v8-users] Arraybuffer

2018-09-10 Thread dan Med
You call foo() 100 times Il giorno lun 10 set 2018 alle ore 21:21 dan Med ha scritto: > I don't quite see if this google group is useful or not, everybody keeps > answering me with superficial things, i don't care about the trminology > like tell me which allocator it uses when and why or at lea

Re: [v8-users] Arraybuffer

2018-09-10 Thread dan Med
I don't quite see if this google group is useful or not, everybody keeps answering me with superficial things, i don't care about the trminology like tell me which allocator it uses when and why or at least if there's something i can read to understand. I'm surprised u don't know what a JIT pag

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 i've

Re: [v8-users] Arraybuffer

2018-09-09 Thread dan Med
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 i've found on the documentation such as the interpreter and

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_ -> data

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 >

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&l=4269 On Thu,

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: https://github.com/v8/v8/blob/master/src/ia32/stu

Re: [v8-users] ArrayBuffer fast access

2012-06-16 Thread Jakob Kummerow
Accessing TypedArrays is at least as fast as accessing regular JSArrays, since they never contain holes and the optimizing compiler knows what types to expect from their elements. Basically the recently introduced special handling of SMI arrays without holes is an attempt to get them closer to Type