Re: [v8-users] Re: What is the purpose of isolated source group

2018-10-03 Thread Mingwei Zhang
Thank you. That solves my question.

On Wednesday, October 3, 2018 at 8:08:06 PM UTC-7, Jakob Kummerow wrote:
>
> The purpose of d8's --isolate flag is to make it possible to test that 
> scripts in different isolates can indeed run without interference from each 
> other. Such scripts cannot communicate with each other (as the name 
> "isolate" implies).
>
> On Wed, Oct 3, 2018 at 6:44 PM Mingwei Zhang  > wrote:
>
>> I realize that I made a mistake. So d8 API does provide support for 
>> Worker and I suspect developers could use postMessage to talk with each 
>> other?
>>
>> But still, I think my question remains. For a command like:
>>
>> ./d8 a.js --isolate b.js
>>
>>
>> How does a.js talk with b.js. In Worker example, a.js could to b.js 
>> because a.js launches b.js, but in this case, a.js does not even know b.js 
>> exists.
>>
>>
>> Thanks. 
>>
>> On Wednesday, October 3, 2018 at 11:45:30 AM UTC-7, Mingwei Zhang wrote:
>>>
>>> Hi,
>>>
>>> I am wondering what is the purpose of the options "--isolate" for the 
>>> stand-alone binary d8. It is pretty interesting that the option '--isolate' 
>>> could be used to launch multiple JavaScripts and runtime them truly in 
>>> parallel. However, since JavaScript is single-threaded by design. This 
>>> puzzles to me that one JavaScript file may not talk to the other one.
>>>
>>> So my purpose is to run two JS files, say a.js and b.js. Now I use this 
>>> command:
>>>
>>> ./d8 a.js --isolate b.js
>>>
>>>
>>> Now, my question is could I make a.js be able to talk to b.js in some 
>>> way?
>>>
>>> Thanks. 
>>>
>> -- 
>> -- 
>> v8-users mailing list
>> v8-u...@googlegroups.com 
>> http://groups.google.com/group/v8-users
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "v8-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to v8-users+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Re: What is the purpose of isolated source group

2018-10-03 Thread Mingwei Zhang
I realize that I made a mistake. So d8 API does provide support for Worker 
and I suspect developers could use postMessage to talk with each other?

But still, I think my question remains. For a command like:

./d8 a.js --isolate b.js


How does a.js talk with b.js. In Worker example, a.js could to b.js because 
a.js launches b.js, but in this case, a.js does not even know b.js exists.


Thanks. 

On Wednesday, October 3, 2018 at 11:45:30 AM UTC-7, Mingwei Zhang wrote:
>
> Hi,
>
> I am wondering what is the purpose of the options "--isolate" for the 
> stand-alone binary d8. It is pretty interesting that the option '--isolate' 
> could be used to launch multiple JavaScripts and runtime them truly in 
> parallel. However, since JavaScript is single-threaded by design. This 
> puzzles to me that one JavaScript file may not talk to the other one.
>
> So my purpose is to run two JS files, say a.js and b.js. Now I use this 
> command:
>
> ./d8 a.js --isolate b.js
>
>
> Now, my question is could I make a.js be able to talk to b.js in some way?
>
> Thanks. 
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] What is the purpose of isolated source group

2018-10-03 Thread Mingwei Zhang
Hi,

I am wondering what is the purpose of the options "--isolate" for the 
stand-alone binary d8. It is pretty interesting that the option '--isolate' 
could be used to launch multiple JavaScripts and runtime them truly in 
parallel. However, since JavaScript is single-threaded by design. This 
puzzles to me that one JavaScript file may not talk to the other one.

So my purpose is to run two JS files, say a.js and b.js. Now I use this 
command:

./d8 a.js --isolate b.js


Now, my question is could I make a.js be able to talk to b.js in some way?

Thanks. 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] How to build d8 with no dependencies against libv8 or libv8_*.so

2018-09-07 Thread Mingwei Zhang
I checked recently. Looks like gn allows you to build d8 as one executable 
without dependencies on libv8*.so.

Just adding "is_component_build = false" into your args.gn file before 
compiling should work.

Using "ldd d8" will output:

linux-vdso.so.1 =>  (0x7ffc542bb000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
(0x7f2ae4515000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x7f2ae430d000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 
(0x7f2ae3f85000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x7f2ae3c7c000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x7f2ae38b5000)
/lib64/ld-linux-x86-64.so.2 (0x559dec15b000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x7f2ae369c000)



On Thursday, August 23, 2018 at 9:38:26 PM UTC-7, Mingwei Zhang wrote:
>
> Well, I remember in previous version it was a binary that has all 
> libv8*.so included. So "ldd" should look like:
>
> linux-vdso.so.1 =>  (0x7fffc45d5000)
> libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x7f6c0aec6000)
> /lib64/ld-linux-x86-64.so.2 (0x7f6c0b29)
> libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
> (0x7f540f451000)
>
> Anyway, it is also understandable if V8 developers just want to make d8 a 
> small wrapper binary.
>
> Thanks.
>
> On Wednesday, August 22, 2018 at 10:16:59 AM UTC-7, Peter Schow wrote:
>>
>> On Tue, Aug 21, 2018 at 2:26 PM Mingwei Zhang  
>> wrote: 
>> > 
>> > No necessary. Since d8 with lots of dependencies generates issues for 
>> me on debugging, I am just wondering if there is any options generating a 
>> self contained d8 instead of a thin wrapper d8. 
>>
>> I guess I do not understand the question. 
>>
>> d8 is a consumer of libv8, llibv8_libbase, and libv8_platform.  On my 
>> X64 platform, it looks like this: 
>>
>> % ldd ./d8 
>> libv8.so => /home/work/v8/v8/out/x64.debug/././libv8.so 
>> (0x7fc509698000) 
>> libv8_libbase.so => 
>> /home/work/v8/v8/out/x64.debug/././libv8_libbase.so 
>> (0x7fc50bd12000) 
>> libv8_libplatform.so => 
>> /home/work/v8/v8/out/x64.debug/././libv8_libplatform.so 
>> (0x7fc50bccf000) 
>> . 
>> . 
>> . 
>>
>> What do you want it to look like? 
>>
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] How to build d8 with no dependencies against libv8 or libv8_*.so

2018-08-23 Thread Mingwei Zhang
Well, I remember in previous version it was a binary that has all libv8*.so 
included. So "ldd" should look like:

linux-vdso.so.1 =>  (0x7fffc45d5000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x7f6c0aec6000)
/lib64/ld-linux-x86-64.so.2 (0x7f6c0b29)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
(0x7f540f451000)

Anyway, it is also understandable if V8 developers just want to make d8 a 
small wrapper binary.

Thanks.

On Wednesday, August 22, 2018 at 10:16:59 AM UTC-7, Peter Schow wrote:
>
> On Tue, Aug 21, 2018 at 2:26 PM Mingwei Zhang  > wrote: 
> > 
> > No necessary. Since d8 with lots of dependencies generates issues for me 
> on debugging, I am just wondering if there is any options generating a self 
> contained d8 instead of a thin wrapper d8. 
>
> I guess I do not understand the question. 
>
> d8 is a consumer of libv8, llibv8_libbase, and libv8_platform.  On my 
> X64 platform, it looks like this: 
>
> % ldd ./d8 
> libv8.so => /home/work/v8/v8/out/x64.debug/././libv8.so 
> (0x7fc509698000) 
> libv8_libbase.so => 
> /home/work/v8/v8/out/x64.debug/././libv8_libbase.so 
> (0x7fc50bd12000) 
> libv8_libplatform.so => 
> /home/work/v8/v8/out/x64.debug/././libv8_libplatform.so 
> (0x7fc50bccf000) 
> . 
> . 
> . 
>
> What do you want it to look like? 
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] How to build d8 with no dependencies against libv8 or libv8_*.so

2018-08-21 Thread Mingwei Zhang
No necessary. Since d8 with lots of dependencies generates issues for me on 
debugging, I am just wondering if there is any options generating a self 
contained d8 instead of a thin wrapper d8.

On Tuesday, August 21, 2018 at 11:57:41 AM UTC-7, Peter Schow wrote:
>
> On Tue, Aug 21, 2018 at 12:28 PM Mingwei Zhang  > wrote: 
> > 
> > Hi, 
> > 
> > I try to compile V8 5.9.21 and some other version of V8 from source 
> code. My question is how to make d8 more self contained such that no 
> dependencies like libv8*.so are required to run the executable? 
>
> Are you asking about how to build d8 as a static executable? 
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] How to build d8 with no dependencies against libv8 or libv8_*.so

2018-08-21 Thread Mingwei Zhang
Hi,

I try to compile V8 5.9.21 and some other version of V8 from source code. 
My question is how to make d8 more self contained such that no dependencies 
like libv8*.so are required to run the executable?

Appreciate your help.
-Mingwei

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] __jit_debug_register_code was not invoked in debug build

2018-06-18 Thread Mingwei Zhang
Hi Ben,

The problem is that I don't get any breakpoint hit notification in gdb. The 
program just execute and exited normally, regardless of whether i set the 
breakpoint or not in __jit_debug_register_code.

I double checked in instructions that when I am using gm.py with target 
x64.debug, it does use the option ENABLE_GDB_JIT_INTERFACE.

So, then I am very confused why I don't get breakpoint hit in gdb.

Appreciate your help.

On Monday, June 18, 2018 at 3:20:44 PM UTC-7, Ben Noordhuis wrote:
>
> On Sun, Jun 17, 2018 at 11:15 PM, Mingwei Zhang  > wrote: 
> > Dear V8 developer, 
> > 
> > I recently tried to use the debugging interface for gdb on JIT code. 
> When I 
> > tried building a debug build of V8 and following the instructions in: 
> > 
> > https://github.com/v8/v8/wiki/GDB-JIT-Interface 
> > 
> > I launched my program using the following command: 
> > 
> >> gdb --args ./d8 --gdbjit helloworld.js 
> > 
> > 
> > In the gdb prompt, I setup a breakpoint in __jit_debug_register_code 
> before 
> > launch my program, but looks like the hook was never invoked. 
> > 
> > I am using gdb 7.11 in Ubuntu 16.04. 
> > d8 version 6.7.0 (candidate) 
> > 
> > My helloworld.js is very simple like this: 
> >>> 
> >>> function func() { 
> >>> 
> >>> console.log('hello'); 
> >>> 
> >>> } 
> >>> 
> >>> 
> >>> func() 
> >> 
> >> 
> > 
> > Thanks. 
>
> You don't have to set a breakpoint in __jit_debug_register_code, gdb 
> does that for you.  It's a magic method that gdb recognizes, see 
> https://sourceware.org/gdb/onlinedocs/gdb/Declarations.html for 
> details. 
>
> That said, the gdbjit code is unmaintained - or at least not regularly 
> tested - and quite possibly broken.  YMMV. 
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] __jit_debug_register_code was not invoked in debug build

2018-06-17 Thread Mingwei Zhang
Dear V8 developer,

I recently tried to use the debugging interface for gdb on JIT code. When I 
tried building a debug build of V8 and following the instructions in:

https://github.com/v8/v8/wiki/GDB-JIT-Interface

I launched my program using the following command:

gdb --args ./d8 --gdbjit helloworld.js
>

In the gdb prompt, I setup a breakpoint in __jit_debug_register_code before 
launch my program, but looks like the hook was never invoked.

I am using gdb 7.11 in Ubuntu 16.04.
d8 version 6.7.0 (candidate)

My helloworld.js is very simple like this:

> function func() {
>
> console.log('hello');
>
> }
>
>
>> func()
>
>
>
Thanks.

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] What is the memory layout of a code object in V8?

2018-04-19 Thread Mingwei Zhang
Hi,

I used gdb with the gdbinit script provided by V8. So I used the command 
called "jco" with an argument of a JIT code address. So I have two 
questions listed below:

1) what is the header of each JIT code function?
2) where is the RelocInfo located for each JIT code function?



For 1), I find that before the real code content, there is data structure 
in size of 0x60 bytes as I use gdb command to see:

0x2d88b5f04300: 0x0ccaef902889 0x2a97d2182a09
0x2d88b5f04310: 0x2a97d2182241 0x2a97d2182241
0x2d88b5f04320: 0x2a97d2182619 0x0804
0x2d88b5f04330: 0x2a97d21822d1 0x00060147
0x2d88b5f04340: 0x0001 0x
0x2d88b5f04350: 0x 0x

Looks like the above byte pattern already exist prior to each code chunk. 

0x2d88b5f04301: [Code]
kind = STUB
major_key = CEntryStub
compiler = unknown
Instructions (size = 327)
0x2d88b5f04360 0  55 push rbp
0x2d88b5f04361 1  4889e5 REX.W movq rbp,rsp
0x2d88b5f04364 4  6a06   push 0x6
0x2d88b5f04366 6  6a00   push 0x0
0x2d88b5f04368 8  49ba0143f0b5882d REX.W movq r10,0x2d88b5f04301
;; object: 0x2d88b5f04301 
0x2d88b5f0437212  4152   push r10
..
RelocInfo (size = 29)
0x2d88b5f0436a  embedded object  (0x2d88b5f04301 )
0x2d88b5f04379  external reference (Isolate::c_entry_fp_address)  
(0x42a21a8)
0x2d88b5f04386  external reference (Isolate::context_address)  (0x42a2138)
0x2d88b5f04393  external reference (Isolate::c_function_address)  
(0x42a21b8)
..

For 2), looks like the above info does not exist in JIT code page. 

Thanks.

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.