Re: [v8-users] Accessing block scoped variables via the V8 API

2017-04-04 Thread Ian Bull
Thanks everyone. That makes sense, since these variables are "block 
scoped", so having them available outside the scope wouldn't work.

Cheers,
Ian

On Tuesday, 4 April 2017 00:08:27 UTC-7, Ben Noordhuis wrote:
>
> On Tue, Apr 4, 2017 at 5:02 AM, Ian Bull > 
> wrote: 
> > Can we access these blocked scoped (ES6) variables using the V8 
> > API? I would like to expose this to users of the J2V8 bindings. 
>
> You can through the inspector API but it's a debugger, it kills 
> performance. 
>

-- 
-- 
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] Re: Have the no snapshot startup times gotten significantly longer in the last 6-12 months? 3s => 20s+

2017-04-04 Thread Jakob Kummerow
Yes, just to confirm:

Starting without snapshot, especially in Debug mode, has become much
slower, because more work is being done there (mostly compilation of
builtins and bytecode handlers).

This is working as intended. I.e. it's not considered a bug/problem, will
not be improved over time, in fact it could get even slower and we wouldn't
care.

The officially supported/recommended thing to do is to build with snapshot.


On Tue, Apr 4, 2017 at 1:24 AM, Zac Hansen  wrote:

> Got some info on IRC -- apparently there is now a "code stub assembler"
> that does a bunch of work on startup.
>
> I stopped the program a few times during startup and it was confirmed,
> looking at the stack traces, that that was in fact what was going on.
>
> Moral of this story:  use snapshots.
>
> On Monday, April 3, 2017 at 12:48:52 AM UTC-7, Zac Hansen wrote:
>
>> I just updated my v8 build and noticed a dramatic slowdown in startup
>> times.
>>
>> I'd always used no snapshots for convenience because the startup penalty
>> was insignificant (maybe around 3s?) but ever since I updated it's up
>> around 20s now.
>>
>> Is this a known behavior or am I doing something else wrong maybe?
>>
>> 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.
>

-- 
-- 
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] Re: Interceptors running under "with"

2017-04-04 Thread Zac Hansen
from the docs:

http://v8.paulfryzel.com/docs/master/namespacev8.html#ac135beae5f0c8b290255accb438f990e

 Returns a non-empty handle if the interceptor intercepts the request

so make sure you are returning an empty handle for properties your object
shouldn't respond to.

On Tue, Apr 4, 2017 at 1:10 AM, Danny Dorfman 
wrote:

> I just implemented all the callbacks, and I see that for "with" there are
> calls to QueryProperty, which are not present in the no-with scenario.
> Maybe I can take it from there. Thanks for the idea!
>
> On Tuesday, April 4, 2017 at 9:05:11 AM UTC+3, Zac Hansen wrote:
>>
>> I don't know for sure, but if you don't tell the interceptor that a isn't
>> a property on CONS, then it thinks it is and then it finds cons_object.a
>> but then you don't have a value for it, so it returns undefined.
>>
>> Have you fully implemented all 5 of the callbacks for 
>> setnamedpropertyhandler?
>>  maybe even just put some print statements in them to see which are called
>> when and for what property names.
>>
>> On Mon, Apr 3, 2017 at 11:01 PM, Danny Dorfman 
>> wrote:
>>
>>> Yes, I use SetNamedPropertyHandler. However, I'd like to make the
>>> following distinction:
>>> If I am *not* inside "using", the handler for "a" should return
>>> v8::Undefined (or some other preset value).
>>> If I *am* inside "using", the handler should not return anything at
>>> all, and let V8 determine the value.
>>> Is that possible?
>>>
>>>
>>> On Monday, April 3, 2017 at 10:51:57 PM UTC+3, Zac Hansen wrote:

 Are you using the objecttemplate's setnamedpropertyhandler call?  if
 so, are you implementing all the callbacks to say that your CONS object
 doesn't have a property a?

 On Monday, April 3, 2017 at 7:25:25 AM UTC-7, Danny Dorfman wrote:
>
> Hello there,
>
> Is there a way for my interceptor to know that it's running under
> "with", as in this example:
>
> var a = 10;
> with (new CONS()) { do_something(a); }
>
> The problem is, that 'a' is intercepted by the new object, and is
> rendered undefined. I would like it to use the external 'a' instead.
>
> Regards,
> Danny
>
 --
>>> --
>>> v8-users mailing list
>>> v8-u...@googlegroups.com
>>> http://groups.google.com/group/v8-users
>>> ---
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "v8-users" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>>> pic/v8-users/dJLWr6EF8kc/unsubscribe.
>>> To unsubscribe from this group and all its topics, 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 a topic in the
> Google Groups "v8-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/v8-users/dJLWr6EF8kc/unsubscribe.
> To unsubscribe from this group and all its topics, 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.


Re: [v8-users] Re: Interceptors running under "with"

2017-04-04 Thread Danny Dorfman
I just implemented all the callbacks, and I see that for "with" there are 
calls to QueryProperty, which are not present in the no-with scenario.
Maybe I can take it from there. Thanks for the idea!

On Tuesday, April 4, 2017 at 9:05:11 AM UTC+3, Zac Hansen wrote:
>
> I don't know for sure, but if you don't tell the interceptor that a isn't 
> a property on CONS, then it thinks it is and then it finds cons_object.a 
> but then you don't have a value for it, so it returns undefined.   
>
> Have you fully implemented all 5 of the callbacks for 
> setnamedpropertyhandler? 
>  maybe even just put some print statements in them to see which are called 
> when and for what property names.  
>
> On Mon, Apr 3, 2017 at 11:01 PM, Danny Dorfman  > wrote:
>
>> Yes, I use SetNamedPropertyHandler. However, I'd like to make the 
>> following distinction:
>> If I am *not* inside "using", the handler for "a" should return 
>> v8::Undefined (or some other preset value).
>> If I *am* inside "using", the handler should not return anything at all, 
>> and let V8 determine the value.
>> Is that possible?
>>
>>
>> On Monday, April 3, 2017 at 10:51:57 PM UTC+3, Zac Hansen wrote:
>>>
>>> Are you using the objecttemplate's setnamedpropertyhandler call?  if so, 
>>> are you implementing all the callbacks to say that your CONS object doesn't 
>>> have a property a?
>>>
>>> On Monday, April 3, 2017 at 7:25:25 AM UTC-7, Danny Dorfman wrote:

 Hello there,

 Is there a way for my interceptor to know that it's running under 
 "with", as in this example:

 var a = 10;
 with (new CONS()) { do_something(a); }

 The problem is, that 'a' is intercepted by the new object, and is 
 rendered undefined. I would like it to use the external 'a' instead.

 Regards,
 Danny

>>> -- 
>> -- 
>> v8-users mailing list
>> v8-u...@googlegroups.com 
>> http://groups.google.com/group/v8-users
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "v8-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/v8-users/dJLWr6EF8kc/unsubscribe.
>> To unsubscribe from this group and all its topics, 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] Accessing block scoped variables via the V8 API

2017-04-04 Thread Ben Noordhuis
On Tue, Apr 4, 2017 at 5:02 AM, Ian Bull  wrote:
> Can we access these blocked scoped (ES6) variables using the V8
> API? I would like to expose this to users of the J2V8 bindings.

You can through the inspector API but it's a debugger, it kills performance.

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