The snapshot used by V8 in this case is only for builtin objects such as
Math or Date. The current version of V8 has something called "V8 extras"
that can be used to add additional scripts to the snapshot, but I'm not
aware of anybody using that for node.

On Wed, Jan 6, 2016 at 9:22 PM Hugh Fitzpatrick <hugh.fitzpatr...@gmail.com>
wrote:

>
> Folks,
>
> I'm trying to understand how to use the 'snapshot' feature in v8.
>
> I am currently using node-v0.12.7 ... a little old - but should be ok.
>
> I have modified 'node.gyp' to enable snapshots.
>
> I can convert my sample 'foo.js' to 'snapshot.cc' via *mksnapshot* and
> see that v8::NewContextFromSnapshot() is being called.
>
> So it seems that my snapshot is compiled-in, and being deserialized when I
> run .node'.
>
> 'foo.js'  contained a function called "sayHello()".
>
> I cannot call this function by v8-script-compile-run means or using the
> REPL from node.
>
> Question - What am I doing wrong ?
>
> Is there a simple step-by-step example anywhere ?
>
> Thanks in advance.
>
> - Hugh
>
>
> --
> --
> 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.

Reply via email to