Re: [v8-users] Is V8::JSON::Parse really needed against JSON inputs?

2017-03-16 Thread Abhishek Singh
Is there a way to expose a custom encoded data(flatbuffer encoded probably, it’s cpu footprint looks good) to JS world and access fields from it - i.e. args passed to OnUpdate->Call() could be stringified flatbuffer encoded data and then somehow we could access fields in flatb

[v8-users] Is V8::JSON::Parse really needed against JSON inputs?

2017-03-16 Thread Abhishek Singh
Hi, I'm trying to send JSON data to user supplied JS code, which is executed by V8. What I've realised is even if user data is JSON marshalled, I've to explicitly do V8::JSON::Parse on it, so that value received in JS world is native JS JSON. Is that really necessary? Performance penalty becaus

Re: [v8-users] V8 JSON Debugging Protocol, Breakpoints not being set

2016-10-16 Thread Abhishek Singh
Maybe this standalone example for V8 JS Debugger might help - https://gist.github.com/abhi-bit/20b8569bc5d655659b51d425564eb49d . I didn’t try it on windows before, but should work there as well. > On 17-Oct-2016, at 04:02, 'WI

Re: [v8-users] JavaScript heap out of memory issue

2016-09-26 Thread Abhishek Singh
Hi Ben, It turned out to be memory leak in my C++ wrapper on top of V8 - fixed it. Thanks for the suggestion around using v8::HeapProfiler::TakeHeapSnapshot(). > On 24-Sep-2016, at 00:08, Ben Noordhuis wrote: > > On Fri, Sep 23, 2016 at 12:54 PM, Abhishek Singh > wrote: >

[v8-users] JavaScript heap out of memory issue

2016-09-23 Thread Abhishek Singh
Hi, I noticed a V8 crash with following message: <--- Last few GCs ---> 251206 ms: Mark-sweep 1400.2 (1456.1) -> 1400.2 (1456.1) MB, 3688.5 / 0.0 ms [allocation failure] [GC in old space requested]. 254854 ms: Mark-sweep 1400.2 (1456.1) -> 1400.2 (1456.1) MB, 3648.2 / 0.0 ms [allocation f

Re: [v8-users] V8 Debugger - Evaluate request

2016-09-09 Thread Abhishek Singh
Thank you. My bad, should have recognised that “global” actually refers to the scope. > On 09-Sep-2016, at 1:28 PM, Ben Noordhuis wrote: > > On Thu, Sep 8, 2016 at 11:54 AM, Abhishek Singh > wrote: >> Hi, >> >> I’m seeing a problem with the way “Evaluat

[v8-users] V8 Debugger - Evaluate request

2016-09-08 Thread Abhishek Singh
Hi, I’m seeing a problem with the way “Evaluate” request works with V8 Debug protocol. Have a sample standalone simulation of the problem, will appreciate inputs on what I might be missing. Link: https://gist.github.com/abhi-bit/20b8569bc5d655659b51d425564eb49d#file-v8_debug_testing-cc

Re: [v8-users] How do I include a javascript function inside of embedded v8?

2016-09-06 Thread Abhishek Singh
Before compilation of user supplied JS code(assuming you’re storing it as std::string), append the helper functions to it(which you might be reading from a file sitting in some predefined location) and finally compile the resultant std::string(in below snippet assuming “src” stores the resultant

Re: [v8-users] Is is required to grab v8::Locker when using V8 Debugger?

2016-08-22 Thread Abhishek Singh
nvm, solved it. Thanks for help thus far. > On 22-Aug-2016, at 11:23 AM, Abhishek Singh > wrote: > > Modified the test program, link > https://gist.github.com/abhi-bit/20b8569bc5d655659b51d425564eb49d - debug > calls are now executing without grabbing Locker. > > Pro

Re: [v8-users] Is is required to grab v8::Locker when using V8 Debugger?

2016-08-21 Thread Abhishek Singh
de execution being stuck at breakpoint. Suggestions please? > On 17-Aug-2016, at 11:09 PM, Ben Noordhuis wrote: > > On Wed, Aug 17, 2016 at 4:51 PM, Abhishek Singh > wrote: >> Hi Ben, >> >>> On 17-Aug-2016, at 5:43 PM, Ben Noordhuis wrote: >>>

Re: [v8-users] Is is required to grab v8::Locker when using V8 Debugger?

2016-08-17 Thread Abhishek Singh
Hi Ben, > On 17-Aug-2016, at 5:43 PM, Ben Noordhuis wrote: > > On Tue, Aug 16, 2016 at 6:22 PM, Abhishek Singh > wrote: >> Hi Ben, >> >> In sample example I shared, I was trying to simulate a behaviour similar to >> what my application(based on top of

Re: [v8-users] Is is required to grab v8::Locker when using V8 Debugger?

2016-08-16 Thread Abhishek Singh
t;:1,"sourceColumn":4,"sourceLineText":" if (doc.type === \"json\") {","script":{"id":33,"name":null,"lineOffset":0,"columnOffset":0,"lineCount":6},"breakpoints":[1]}} 10 debugger.c

[v8-users] Is is required to grab v8::Locker when using V8 Debugger?

2016-08-16 Thread Abhishek Singh
Hi, I’m using V8 Debugger, but facing an issue. https://gist.github.com/abhi-bit/20b8569bc5d655659b51d425564eb49d - this is link to standalone code simulating the same problem. In short, what this code does is: * Main thread

Re: [v8-users] Sample code illustrating working V8 debugger

2016-08-12 Thread Abhishek Singh
04-Aug-2016, at 3:59 PM, Ben Noordhuis wrote: > > On Thu, Aug 4, 2016 at 12:01 PM, Abhishek Singh > wrote: >> Appreciate your help so far. >> >> Sample user JS code[0] looks like this now: >> >> {code} >> function OnUpdate(doc, meta) { >>

Re: [v8-users] Sample code illustrating working V8 debugger

2016-08-04 Thread Abhishek Singh
e I can fix things much sooner on my end using your help via IRC communication than email :) Else I could continue using this thread. [0] https://github.com/abhi-bit/eventing/blob/master/go_eventing/handle_event.js [1] https://github.com/abhi-bit/eventing/blob/master/worker/binding/worker.cc#L990 >

Re: [v8-users] Sample code illustrating working V8 debugger

2016-08-03 Thread Abhishek Singh
> On 03-Aug-2016, at 8:13 PM, Ben Noordhuis wrote: > > Quick sanity check: what does Debug.showBreakPoints() print for that > function after setting the breakpoint? Just to confirm, is below the right way to leverage JS Debug API in a user supplied JS code? (I tried setting up breakpoint again

Re: [v8-users] Sample code illustrating working V8 debugger

2016-08-03 Thread Abhishek Singh
> On 03-Aug-2016, at 3:48 PM, Ben Noordhuis wrote: > > On Wed, Aug 3, 2016 at 11:40 AM, Abhishek Singh > wrote: >> Hi Ben, >> >> Apologies for not providing the background. I’m trying to leverage C++ API >> to drive V8 JSON debugger for embedded V8 use cas

Re: [v8-users] Sample code illustrating working V8 debugger

2016-08-03 Thread Abhishek Singh
pis to handle user requests to enforce breakpoints/continue/evaluate etc. So I was hoping if anyone could share sample standalone code on top of C++ V8 debugger api(if they have it lying somewhere around). > On 03-Aug-2016, at 1:41 PM, Ben Noordhuis wrote: > > On Wed, Aug 3, 2016 at 8:

[v8-users] Sample code illustrating working V8 debugger

2016-08-02 Thread Abhishek Singh
Hi, Sorry to bother again about V8 JSON protocol debugger. I’ve looked through debug_agent.cc/.h and _debug_agent.js implementation in node.js in order to understand to understand correct way to enable breakpoints(and fire other different types of requests). But even after reading though node.j

Re: [v8-users] Exposing nested maps from C++ into JS world

2016-07-29 Thread Abhishek Singh
Thanks much, now things work as expected. Looking back, I think if I were thinking bit more openly it would have been an easy pattern to figure out. > On 29-Jul-2016, at 12:04 PM, Jochen Eisinger wrote: > > I commented on the example > > On Thu, Jul 28, 2016 at 2:14 PM

[v8-users] V8 Debugging protocol

2016-07-28 Thread Abhishek Singh
Hi, I’m trying to hook in V8 JSON based debugger into a project. I was able to setup a breakpoint(line: 2 column: 0) against a OnUpdate function, sample function looks like this: ``` function OnUpdate(doc, meta) { log("doc meta id: ", meta.key); if (meta.type === "json" && doc.ssn) { log(

Re: [v8-users] Exposing nested maps from C++ into JS world

2016-07-28 Thread Abhishek Singh
script. > On 28-Jul-2016, at 4:05 PM, Abhishek Singh > wrote: > > I believe this is the change you wanted me to do: > > Local HTTPBody::WrapHTTPBodyMap() { > EscapableHandleScope handle_scope(GetIsolate()); > > Local body_map_template = > FunctionTemplate::New(

Re: [v8-users] Exposing nested maps from C++ into JS world

2016-07-28 Thread Abhishek Singh
alFieldCount(1); > result = body_map_template->GetFunction()->NewInstance(); > > On Wed, Jul 27, 2016 at 4:27 PM Abhishek Singh <mailto:singhabhishek@gmail.com>> wrote: > Hi Jochen, > > Full code of relevant file available - http://pastebin.com/fZJENvSi > &l

Re: [v8-users] Exposing nested maps from C++ into JS world

2016-07-27 Thread Abhishek Singh
; > Can you provide a complete example? I suspect that WrapHTTPBodyMap doesn't do > what you expect it does > > On Tue, Jul 26, 2016 at 1:04 PM Abhishek Singh <mailto:singhabhishek@gmail.com>> wrote: > Would you mind guiding me a bit here? For now just trying

Re: [v8-users] Exposing nested maps from C++ into JS world

2016-07-26 Thread Abhishek Singh
doing something wrong here. > On 25-Jul-2016, at 10:00 PM, Jochen Eisinger wrote: > > To create dynamic nested maps from C++, the outter object (response) would > have to return another intercepted object (e.g. body) that then returns the > actual values on access. >

Re: [v8-users] Exposing nested maps from C++ into JS world

2016-07-25 Thread Abhishek Singh
> On Fri, Jul 22, 2016 at 8:12 AM Abhishek Singh <mailto:singhabhishek@gmail.com>> wrote: > Hi, > > I’m wondering if there is a way to expose map > > into JS world from C++? Exposing map looks straightforward > and I’m doing for some C++ objects using Name

[v8-users] Exposing nested maps from C++ into JS world

2016-07-21 Thread Abhishek Singh
Hi, I’m wondering if there is a way to expose map > into JS world from C++? Exposing map looks straightforward and I’m doing for some C++ objects using NamedPropertyConfigurationHandler. I’ll just show sample JS code that I would like to have and where C++ map > will come into picture: functio

Re: [v8-users] How do I attach a debugger to the run-time?

2016-07-21 Thread Abhishek Singh
Any tentative timeline around when v8-inspector support is going to be available within V8? We are embedding V8 into server side JS programming against a DB and intend to provide remote debugger support for JS code, rough idea about debuggability support from V8 would be useful to know. > On 21

Re: [v8-users] Do all interceptor function need to be static?

2016-07-08 Thread Abhishek Singh
Thanks again Ben, this looks promising - will give it a shot. > On 08-Jul-2016, at 12:46 PM, Ben Noordhuis wrote: > > On Fri, Jul 8, 2016 at 7:56 AM, Abhishek Singh > mailto:singhabhishek@gmail.com>> wrote: >> Is it a requirement that all interce

[v8-users] Do all interceptor function need to be static?

2016-07-07 Thread Abhishek Singh
I had to make it static for things to work. But in this model, I can't connect to multiple databases because each DB needs a unique connection handle - so Ideally I would require non-static, object specific connection handle. Any suggestion on how to overcome this limitation? -- Thanks, Abhishek

Re: [v8-users] Stack variable substitution in JS code using V8

2016-07-01 Thread Abhishek Singh
Thanks Ben, tagged template literals would solve my problem is a portable manner. > On 01-Jul-2016, at 3:23 PM, Ben Noordhuis wrote: > > On Fri, Jul 1, 2016 at 5:16 AM, Abhishek Singh > mailto:singhabhishek@gmail.com>> wrote: >> Hi, >> >> As part

[v8-users] Stack variable substitution in JS code using V8

2016-06-30 Thread Abhishek Singh
beer-sample.city= BLR" Please suggest if there is a way to do this currently using v8, else I suppose I would require to convert JS source to AST and after replacing variables appropriately I would need to convert AST to valid JS source. -- Thanks, Abhishek Singh -- -- v8-users mailing li

[v8-users] [v8-embedding] - Exposing result-set as an array in javascript

2016-06-28 Thread Abhishek Singh
Result.length; for (var i = 0; i < resultLength; i++) { //Do some computation and bookkeeping on each row log(queryResult[i]); } ``` So queryResult needs to of type PropertyCallbackInfo type and I'm not sure correct way to do this. What would be the recommended to achi