Re: [v8-users] proto in dictionary

2015-09-18 Thread Jakob Kummerow
JavaScript objects must always have a prototype. Internal implementation
details like how the properties are stored can't influence that.

On Fri, Sep 18, 2015 at 12:57 PM, dmonji  wrote:

> I understand that when too many properties are added or a property is
> deleted from the object, object representation changes to slow(dictionary)
> mode. In this case, does proto property still exist? If not, how is
> inheritance handled in case of dictionary object representation?
>
> --
> --
> 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 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] proto in dictionary

2015-09-18 Thread dmonji
I understand that when too many properties are added or a property is 
deleted from the object, object representation changes to slow(dictionary) 
mode. In this case, does proto property still exist? If not, how is 
inheritance handled in case of dictionary object representation?

-- 
-- 
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] prooto in dictionary

2015-09-18 Thread dmonji
I understand that when too many properties are added or a property is 
deleted from the object, object representation changes to slow(dictionary) 
mode. In this case, does proto property still exist? If not, how is 
inheritance handled in case of dictionary object representation?

-- 
-- 
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] Property access time in JavaScript programs

2015-09-18 Thread dmonji
Is there any way to measure it? 

I tried to instrument the JavaScript code, and summed up the time between 
"before access" and "after access". But I am not very sure if this is
the right way to measure the time required for property accesses. Any 
thoughts on this?

On Friday, 18 September 2015 16:30:42 UTC+5:30, Jakob Kummerow wrote:
>
> Property access time is not measured separately.
>
> On Fri, Sep 18, 2015 at 12:56 PM, dmonji  > wrote:
>
>> I want to compute the proportion of time spent on property accesses in 
>> JavaScript programs. I am aware of 
>> code.com/svn/branches/bleeding_edge/tools/profviz/profviz.html 
>>  which is a cpu profiler.
>>
>> But it is not clear what exactly does "execution" refer to since "ic 
>> cache" is shown seperately?
>>
>> Does "execution" only include "Access time of properties"?
>>
>> -- 
>> -- 
>> 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.


Re: [v8-users] Property access time in JavaScript programs

2015-09-18 Thread Jakob Kummerow
Property access time is not measured separately.

On Fri, Sep 18, 2015 at 12:56 PM, dmonji  wrote:

> I want to compute the proportion of time spent on property accesses in
> JavaScript programs. I am aware of
> code.com/svn/branches/bleeding_edge/tools/profviz/profviz.html
>  which is a cpu profiler.
>
> But it is not clear what exactly does "execution" refer to since "ic
> cache" is shown seperately?
>
> Does "execution" only include "Access time of properties"?
>
> --
> --
> 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 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] Property access time in JavaScript programs

2015-09-18 Thread dmonji
I want to compute the proportion of time spent on property accesses in 
JavaScript programs. I am aware of 
code.com/svn/branches/bleeding_edge/tools/profviz/profviz.html 
 which is a cpu profiler.

But it is not clear what exactly does "execution" refer to since "ic cache" 
is shown seperately?

Does "execution" only include "Access time of properties"?

-- 
-- 
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] Property access time in JavaScript programs

2015-09-18 Thread Jakob Kummerow
I don't think it's possible to measure property access times directly. One
reason is that a single property access is much, much faster than getting a
timestamp from the operating system.

So your best bet is probably to measure it indirectly: take a long-running
loop, add a single property access in such a way that (1) it can't be
optimized away by the compiler and (2) it doesn't introduce additional
operations, which isn't easy to achieve at the same time, and measure how
much longer the overall loop takes than it did before.

Of course that would be a very artificial micro-benchmark, and would only
measure one very specific situation. In the general case, property accesses
can take *very* different amounts of time, though: in the best case,
they're a single machine instruction; in the worst case, they're thousands
of machine instructions. It all depends on so many things...

I can't think of a way to take an existing program and accurately measure
what fraction of its running time is spent on property accesses.

On Fri, Sep 18, 2015 at 1:13 PM, dmonji  wrote:

> Is there any way to measure it?
>
> I tried to instrument the JavaScript code, and summed up the time between
> "before access" and "after access". But I am not very sure if this is
> the right way to measure the time required for property accesses. Any
> thoughts on this?
>
> On Friday, 18 September 2015 16:30:42 UTC+5:30, Jakob Kummerow wrote:
>>
>> Property access time is not measured separately.
>>
>> On Fri, Sep 18, 2015 at 12:56 PM, dmonji  wrote:
>>
>>> I want to compute the proportion of time spent on property accesses in
>>> JavaScript programs. I am aware of
>>> code.com/svn/branches/bleeding_edge/tools/profviz/profviz.html
>>>  which is a cpu profiler.
>>>
>>> But it is not clear what exactly does "execution" refer to since "ic
>>> cache" is shown seperately?
>>>
>>> Does "execution" only include "Access time of properties"?
>>>
>>> --
>>> --
>>> 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 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] Seeking help with v8::Platform implementation

2015-09-18 Thread Bit Cortex
V8 experts,

I'm having trouble understanding the task scheduling requirements of the 
embedder's v8::Platform implementation. Some questions:

1. Is it a requirement that all foreground tasks for a given isolate be run 
on the same thread?
2. Must foreground tasks be run with the isolate lock held?
3. What are the embedder's responsibilities in terms of task cancellation 
or cleanup? How is cleanup supposed to work in general? For example, 
looking at the 4.6 source code, I see that V8 posts both foreground and 
background tasks that hold pointers to the isolate and/or its internals, 
such as the heap. What if the embedder disposes the isolate before a task 
is executed?

Thank you.

-- 
-- 
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] Seeking help with v8::Platform implementation

2015-09-18 Thread Ben Noordhuis
On Fri, Sep 18, 2015 at 4:01 PM, Bit Cortex  wrote:
> V8 experts,
>
> I'm having trouble understanding the task scheduling requirements of the
> embedder's v8::Platform implementation. Some questions:
>
> 1. Is it a requirement that all foreground tasks for a given isolate be run
> on the same thread?

I don't think that's a hard requirement, but...

> 2. Must foreground tasks be run with the isolate lock held?

...yes, you have to hold the lock.

> 3. What are the embedder's responsibilities in terms of task cancellation or
> cleanup? How is cleanup supposed to work in general? For example, looking at
> the 4.6 source code, I see that V8 posts both foreground and background
> tasks that hold pointers to the isolate and/or its internals, such as the
> heap. What if the embedder disposes the isolate before a task is executed?

I'm not 100% sure about this one but I think it works like this:

1. Only foreground threads are cancellable.
2. You need to hold the isolate lock when running foreground tasks.
3. The only place where threads are cancelled is in Isolate::Dispose().
4. Ergo, there should be no room for race conditions -
Isolate::Dispose() cleans up after itself.

For background tasks, just flush your background task queue.  I'd
probably opt for flushing both queues before you tear down the
isolate, just to be on the safe side.

-- 
-- 
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.