Re: [v8-users] Re: V8 snapshots

2017-09-08 Thread Yang Guo
V8's serializer simply does not support serializing handles. You can't have any open handle scopes when you serialize. You can store these handles somewhere on the context before serializing, and retrieve it after deserializing. On Friday, September 8, 2017 at 12:29:33 AM UTC+2, Zac Hansen wrot

Re: [v8-users] Re: V8 snapshots

2017-09-07 Thread Zac Hansen
can you make a special code path just for making the snapshot that releases the persistent/globals then makes the snapshots and then exits? Then you start up the "normal" code pay with the new snapshots that can create the persistent a/globals all it wants. On Thu, Sep 7, 2017 at 1:33 PM Francis

Re: [v8-users] Re: V8 snapshots

2017-09-07 Thread Francisco Moraes
Thanks. I am finding that my main hurdle is that there are several v8::Persistent objects which block creation of the snapshot. Is there any suggested work around for those other than rewriting the code ? On Thursday, September 7, 2017 at 11:16:24 AM UTC-4, Jakob Gruber wrote: > > You can use t

Re: [v8-users] Re: V8 snapshots

2017-09-07 Thread 'Jakob Gruber' via v8-users
You can use the `job` gdb macro (see gdbinit ) to print heap objects. E.g. 'job 0x367b6c023fa9'. On Thu, Sep 7, 2017 at 5:04 PM, Francisco Moraes wrote: > If you know of a way to find more inf

Re: [v8-users] Re: V8 snapshots

2017-09-07 Thread Francisco Moraes
If you know of a way to find more information on what the global handles may be, it may be helpful. Otherwise, I will have to scrub everything until I find something that works. For instance: (gdb) print isolate->global_handles()->Print() Global handles: handle 0x7ffe3af84008 to 0x367b6c023fa9

Re: [v8-users] Re: V8 snapshots

2017-09-06 Thread Zac Hansen
If that doesn't do it, again try to come up with a self contained example and post it. Like I said before often v8 errors mean nothing more than "you screwed up somewhere" so just the error message is rather meaningless--at least to me. On Wed, Sep 6, 2017 at 12:00 PM Zac Hansen wrote: > As far

Re: [v8-users] Re: V8 snapshots

2017-09-06 Thread Zac Hansen
As far as I know they are only the ones you explicitly make to hold on to things outside of the scope of JavaScript. Anything with the term "global" or "persistent" is a likely culprit. Again these are all guesses. I would try taking a snapshot that works creating a global handle and trying ag

Re: [v8-users] Re: V8 snapshots

2017-09-06 Thread Francisco Moraes
What's the best way to find what the Global Handles actually are? I found that I can print the handles but it still doesn't help me find what they actually are. Once I know what they are, I can find the culprit and eliminate it. On Wednesday, September 6, 2017 at 2:32:49 PM UTC-4, Zac Hansen wr

Re: [v8-users] Re: V8 snapshots

2017-09-06 Thread Zac Hansen
Just a guess but how would he system know how to deal with objects held by global handles when making a snapshot? You can't serialize the global handles in such a way that they would be useful in any way? I'm guessing this is just a sanity check to make sure you aren't doing something unintended

Re: [v8-users] Re: V8 snapshots

2017-09-06 Thread Francisco Moraes
After fixing the issue about the handle scope, I can successfully create the snapshot for the test code, but when I tried something more complicated, I ran into this now: Check failed: 0 == isolate->global_handles()->global_handles_count() (0 vs. 4). On Wednesday, September 6, 2017 at 12:27:35

Re: [v8-users] Re: V8 snapshots

2017-09-06 Thread Zac Hansen
https://v8.paulfryzel.com/docs/master/classv8_1_1_snapshot_creator.html#a86b2023acdb88a9bd6eae2695f2b0a8a Created a snapshot data blob. This must not be called from within a handle scope. On Wednesday, September 6, 2017 at 7:20:33 AM UTC-7, Francisco Moraes wrote: > > Here's a simple recreate

Re: [v8-users] Re: V8 snapshots

2017-09-06 Thread Francisco Moraes
Here's a simple recreate that I managed to create: #include #include "v8.h" #include "libplatform/libplatform.h" int main(int argv, char **argc) { const char *v8flags = ""; v8::Platform *platform = v8::platform::CreateDefaultPlatform(); v8::V8::SetFlagsFromString (v8flags, strlen (v

Re: [v8-users] Re: V8 snapshots

2017-09-05 Thread Zac Hansen
That kind of error usually means you either haven't created a context or aren't in a context or haven't created an appropriate handle. Or... Something else :-/. Maybe a lock? V8 errors are very much a "you screwed up somewhere" notification and often nothing more On Tue, Sep 5, 2017 at 9:42 AM F

[v8-users] Re: V8 snapshots

2017-09-05 Thread Francisco Moraes
I will give it a try sometime this week. I tried to remove our initialization JS file but that caused a failure further down the serialization as well, so still investigating. On Saturday, September 2, 2017 at 1:07:28 AM UTC-4, Zac Hansen wrote: > > Can you post a minimal complete example that

[v8-users] Re: V8 snapshots

2017-09-01 Thread Zac Hansen
Can you post a minimal complete example that reproduces your problem? On Friday, September 1, 2017 at 8:57:51 AM UTC-7, Francisco Moraes wrote: > > Hello, > > I am trying to create a snapshot that includes most of code but I ran into > the following assertion: > > CHECK(isolate->handle_scope_im

Re: [v8-users] Re: V8 Snapshots Questions and Clarifications

2014-11-11 Thread Louis Santillan
Thanks for the clarifications, Jakob. On Tue, Nov 11, 2014 at 1:40 AM, Jakob Kummerow wrote: > mksnapshot isn't intended for creating arbitrary snapshots, that's why it's > not exposed or documented. You are of course free to play around with it, > but you're pretty much on your own. > > For the

Re: [v8-users] Re: V8 Snapshots Questions and Clarifications

2014-11-11 Thread Jakob Kummerow
mksnapshot isn't intended for creating arbitrary snapshots, that's why it's not exposed or documented. You are of course free to play around with it, but you're pretty much on your own. For the record, Chrome does not create a Chrome-specific V8 snapshot (AFAIK). Also, bear in mind that putting s

Re: [v8-users] Re: V8 Snapshots Questions and Clarifications

2014-11-10 Thread Louis Santillan
So if I'm reading the qt doc [0] and src/mksnapshot.cc [1] correctly, mksnapshot expects to be run like something like ./mksnapshot [optional v8 engine args] mystartup.js mysnapshot.cc where mystartup.js is a JS file that runs without error. I would expect mystartup.js to be a significant enough

[v8-users] Re: V8 Snapshots Questions and Clarifications

2014-11-10 Thread Flying Jester
Snapshots are enabled all the time unless you expressly disable them with gyp. On Monday, November 10, 2014 4:59:37 PM UTC-9, Chris E wrote: > > Hello all, > > I am trying to use v8 snapshots to improve the start-up time of a v8 > application (like what chrome/chromium does), but I am unable to