Re: [v8-users] Clarification on AllowJavascriptExecution
Yes. On Fri, May 11, 2018 at 8:47 PM madana gopalwrote: > 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 completion. Is my understanding right > Jakob? > > Thanks. > > Regards, > Madan > > -- > -- > 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] Clarification on AllowJavascriptExecution
> > 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 completion. Is my understanding right Jakob? Thanks. Regards, Madan -- -- 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] Clarification on AllowJavascriptExecution
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 gopalwrote: > 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 > > v8::internal::GlobalHandles::PendingPhantomCallback::Invoke(v8::internal::Isolate*) > v8::internal::GlobalHandles::DispatchPendingPhantomCallbacks(bool) > v8::internal::GlobalHandles::PostGarbageCollectionProcessing(v8::internal::GarbageCollector, > v8::GCCallbackFlags) > v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, > v8::GCCallbackFlags) > v8::internal::Heap::CollectGarbage(v8::internal::GarbageCollector, char > const*, char const*, v8::GCCallbackFlags) > v8::internal::Factory::CopyFixedArrayAndGrow(v8::internal::Handle, > int, v8::internal::PretenureFlag) > v8::internal::ArrayList::EnsureSpace(v8::internal::Handle, > int) > v8::internal::ArrayList::Add(v8::internal::Handle, > v8::internal::Handle, > v8::internal::Handle, > v8::internal::ArrayList::AddMode) > v8::internal::Heap::AddRetainedMap(v8::internal::Handle) > 0x59d0eda > v8::internal::OptimizedCompileJob::GenerateCode() > *//DisAllowJavascriptExecutionScope > set here* > > v8::internal::Compiler::FinalizeOptimizedCompileJob(v8::internal::OptimizedCompileJob*) > v8::internal::OptimizingCompileDispatcher::InstallOptimizedFunctions() > v8::internal::Runtime_TryInstallOptimizedCode(int, v8::internal::Object**, > v8::internal::Isolate*) > > > We have many number of cleanup objects, for which we have to call JS code > on it being garbage collected. So, we will have cleanup calls for every > object being garbage collected. Could you please point the instant, at > which it will be good to identify this operation is completed (i.e the > point where JS enging completed its garbage collection operation and we are > good to do cleanup). > > Thanks. > > Regards, > Madan > > -- > -- > 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] Clarification on AllowJavascriptExecution
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 v8::internal::GlobalHandles::PendingPhantomCallback::Invoke(v8::internal::Isolate*) v8::internal::GlobalHandles::DispatchPendingPhantomCallbacks(bool) v8::internal::GlobalHandles::PostGarbageCollectionProcessing(v8::internal::GarbageCollector, v8::GCCallbackFlags) v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) v8::internal::Heap::CollectGarbage(v8::internal::GarbageCollector, char const*, char const*, v8::GCCallbackFlags) v8::internal::Factory::CopyFixedArrayAndGrow(v8::internal::Handle, int, v8::internal::PretenureFlag) v8::internal::ArrayList::EnsureSpace(v8::internal::Handle, int) v8::internal::ArrayList::Add(v8::internal::Handle, v8::internal::Handle, v8::internal::Handle, v8::internal::ArrayList::AddMode) v8::internal::Heap::AddRetainedMap(v8::internal::Handle) 0x59d0eda v8::internal::OptimizedCompileJob::GenerateCode() *//DisAllowJavascriptExecutionScope set here* v8::internal::Compiler::FinalizeOptimizedCompileJob(v8::internal::OptimizedCompileJob*) v8::internal::OptimizingCompileDispatcher::InstallOptimizedFunctions() v8::internal::Runtime_TryInstallOptimizedCode(int, v8::internal::Object**, v8::internal::Isolate*) We have many number of cleanup objects, for which we have to call JS code on it being garbage collected. So, we will have cleanup calls for every object being garbage collected. Could you please point the instant, at which it will be good to identify this operation is completed (i.e the point where JS enging completed its garbage collection operation and we are good to do cleanup). Thanks. Regards, Madan -- -- 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] Clarification on AllowJavascriptExecution
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 is garbage collection is initiated from below code, which caused some cleanup calls to be called from our app to javascript. OptimizedCompileJob::Status OptimizedCompileJob::GenerateCode() { DisallowJavascriptExecution no_js(isolate()); { . RegisterWeakObjectsInOptimizedCode() -> it is invoking garbage collection, which landed up to the code in our app .. } } Please clarify, during this time of operation, is it good to call our javascript call with AllowJavaScriptExecutionScope. Will it have any side effects?. Please clarify. Thanks. Regards, Madan -- -- 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.