Re: [v8-users] Re: Function names in CpuProfileNode.

2015-10-31 Thread Jane Chen
Okay, you were right. I don't know what I was missing. But ForceSet does work as before. Tested against 4.7.0. However, with ForceSet and setting the accessor to 0, the last property name associated with the accessor callback still shows up in the profile for the function being ForceSet to g

Re: [v8-users] Re: Function names in CpuProfileNode.

2015-10-31 Thread Alex Kodat
FWIW, ForceSet seems to work for me for the exact same purpose you're using it for. I'm running 4.8.194 at the moment and I traced my accessor for a constructor that I then replaced with the actual constructor using ForceSet and the accessor was only entered once for the constructor property re

Re: [v8-users] Re: Function names in CpuProfileNode.

2015-10-31 Thread Jane Chen
I'm not doing anything fancy like dynamically loading or compiling. Purely for performance sake. See this: https://groups.google.com/forum/#!topic/v8-users/oSb33KvbURY On Saturday, October 31, 2015 at 3:56:50 PM UTC-7, Alex Kodat wrote: > > Sorry, you're right -- I should have researched the h

Re: [v8-users] Re: Function names in CpuProfileNode.

2015-10-31 Thread Jane Chen
ForceSet worked in 3.24. It is not working in 4.6.88. So I do not have a way to override an accessor once it is set. I am showing read and print for simplicity to demonstrate the issue using v8 shell.cc. In my embedding app, before using accessors, creating a context used to take ~2.9ms; aft

Re: [v8-users] Re: Function names in CpuProfileNode.

2015-10-31 Thread Alex Kodat
Sorry, you're right -- I should have researched the history and behavior of CreateDataProperty and DefineOwnProperty. And, in fact, it does appear that they will not replace an exisiting object property. Given that, it seems like you have no choice other than to use ForceSet (until CreateDataPr

Re: [v8-users] Re: Function names in CpuProfileNode.

2015-10-31 Thread Jane Chen
Yes, the first time the property is accessed, it gets the correct native function. In my accessor before I return, I have: global->SetAccessor(context,property,0); global->CreateDataProperty(context,property,obj); Then the property becomes undefined the second time on. On Saturday, Oc

Re: [v8-users] Re: Function names in CpuProfileNode.

2015-10-31 Thread Alex Kodat
CreateDataProperty or DefineOwnProperty should work. Of course, you have to make sure that the first time the function is accessed via the accessor when you do your override, you have to return the function from the accessor. But I assume you're doing that? On Friday, October 30, 2015 at 3:03:2

Re: [v8-users] Re: Function names in CpuProfileNode.

2015-10-30 Thread Jane Chen
Is there anyway to use something like CreateDataProperty to override the accessor so that the actual function is associated with the property, albeit lazily created? I tried to use CreateDataProperty in place of ForceSet, since ForceSet is deprecated, but that didn't do it, and my property beco

Re: [v8-users] Re: Function names in CpuProfileNode.

2015-10-30 Thread Jakob Kummerow
Well, the profile tells you which function was executed. It doesn't know or care what name you used to refer to this function -- it can't, as it's a sampling profiler. Pure-JS example: function f() { /* long-running stuff */ } var g = f; g(); // Shows up as "f" in the profile. In your example, t

[v8-users] Re: Function names in CpuProfileNode.

2015-10-29 Thread Jane Chen
A test case to demonstrate the issue can be found at: https://code.google.com/p/v8/issues/detail?id=4527 On Thursday, October 29, 2015 at 3:46:21 PM UTC-7, Jane Chen wrote: > > Testing profiling against v8 4.6.88. > > I have functions that are exposed through accessor callbacks. If a native > f