Re: [v8-users] Any way to reset global object for context after context is created?

2018-05-11 Thread Jane Chen
Thanks Ben. I want to re-use my context for performance reasons, but some JavaScript programs have constant global variables that cannot be re-defined, such as those declared with let or const. To work around this, I thought I could just evaluate each program in a closure by artificially

Re: [v8-users] Clarification on AllowJavascriptExecution

2018-05-11 Thread madana gopal
> > Thanks, ok. let me go through and update. We have both Script.Run() calls and vm.runScript() calls in our project. So, we have to make sure, we are not making any JS calls, when either Run() or vm.runScript() going on (as they will involve in code compilation) and need to wait for its

Re: [v8-users] Clarification on AllowJavascriptExecution

2018-05-11 Thread Jakob Kummerow
It's not about the garbage collection operation being completed. Presumably you have a call to v8::Script::Run() somewhere? When that call returns, you can safely execute other scripts. On Fri, May 11, 2018 at 5:01 PM madana gopal wrote: > Thanks Jakob. > > Below is

Re: [v8-users] Clarification on AllowJavascriptExecution

2018-05-11 Thread madana gopal
Thanks Jakob. Below is the backtrace. Here how can I identify, when I came out of event loop. Because, we want cleanup calls to get called quickly. *Backtrace:* V8_Fatal 0x5ac3ec3 v8::Function::NewInstance(v8::Local, int, v8::Local*) const* // calling javascript function here* // app code

Re: [v8-users] Concurrently locking isolate + entering exiting persistent context

2018-05-11 Thread Jérôme Gravel-Niquet
On May 11, 2018 at 4:36:12 PM, Ben Noordhuis (i...@bnoordhuis.nl) wrote: On Fri, May 11, 2018 at 10:05 PM, wrote: > Yea, that makes sense. They do match up, but the function I use to get the > context handle may be called more than once at the same time. I mean, the > same

Re: [v8-users] Concurrently locking isolate + entering exiting persistent context

2018-05-11 Thread Ben Noordhuis
On Fri, May 11, 2018 at 10:05 PM, wrote: > Yea, that makes sense. They do match up, but the function I use to get the > context handle may be called more than once at the same time. I mean, the > same context may be entered multiple times concurrently and exited at > different

Re: [v8-users] Concurrently locking isolate + entering exiting persistent context

2018-05-11 Thread jerome
On Friday, May 11, 2018 at 2:45:06 PM UTC-4, Ben Noordhuis wrote: > > On Fri, May 11, 2018 at 7:36 PM, wrote: > > I've been wondering if it's possible to concurrently use v8::Locker. > > > > I'm binding to v8 from a single-threaded language that uses fibers for > >

Re: [v8-users] Concurrently locking isolate + entering exiting persistent context

2018-05-11 Thread Ben Noordhuis
On Fri, May 11, 2018 at 7:36 PM, wrote: > I've been wondering if it's possible to concurrently use v8::Locker. > > I'm binding to v8 from a single-threaded language that uses fibers for > concurrency (Crystal.) Since it's a single thread, v8::Locker is always > instantly

[v8-users] Concurrently locking isolate + entering exiting persistent context

2018-05-11 Thread jerome
I've been wondering if it's possible to concurrently use v8::Locker. I'm binding to v8 from a single-threaded language that uses fibers for concurrency (Crystal.) Since it's a single thread, v8::Locker is always instantly available. This seems fine, the bigger issue if with Context::Scope.

[v8-users] Clarification on AllowJavascriptExecution

2018-05-11 Thread madana gopal
Hi Team, We are using using node v6.9.0. We faced a crash, when there is a javascript call being made from our app c++ code. Crash is happening because, call is made within the DisallowJavascriptExecutionScope. This scope is set in OptimizedCompileJob::GenerateCode() in compiler.cc. Scenario

Re: [v8-users] Any way to reset global object for context after context is created?

2018-05-11 Thread Ben Noordhuis
On Thu, May 10, 2018 at 10:24 PM, Jane Chen wrote: > Embedding v8 v5.3. > > Is there any way to reset global object for a context so that the context > can be re-used? > > How is Context::DetachGlobal() is meant to be used? > > Thanks, > Jane You can't reset a context but you

Re: [v8-users] Re: Debugging wrapped C++ object

2018-05-11 Thread Ben Noordhuis
On Thu, May 10, 2018 at 11:18 AM, Anoop R. S. wrote: > Thank you for the reply, Ben. >> >> Instead of v8::IndexedPropertyHandlerConfiguration, you may >> want to use v8::NamedPropertyHandlerConfiguration. > > I am already using it. What I noticed is that, when I run the code