Snapshot blob includes java script code with comments

29 views
Skip to first unread message

Oleg Beletski

unread,
Sep 3, 2019, 7:23:47 AM9/3/19
to v8-users

I viewed content of the custom generated snapshot and was surprised to see that  it contains almost unmodified blocks of java script with comments in it.


Is that normal behavior? Is there away to get more efficient processing of java script before snapshot created?  Our snapshot creation code is similar code in mksnapshot.


Thanks,

Oleg

Jakob Kummerow

unread,
Sep 3, 2019, 7:39:27 AM9/3/19
to v8-users
The snapshot will typically contain both the original JavaScript source and the bytecode for functions. Function.prototype.toString needs the source, so not including that in the snapshot would be a spec violation.

--
--
v8-users mailing list
v8-u...@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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-users/544f718d-70dc-494c-9e92-7b4eb0ece0d8%40googlegroups.com.

Jakob Gruber

unread,
Sep 3, 2019, 7:43:31 AM9/3/19
to v8-u...@googlegroups.com
On Tue, Sep 3, 2019 at 1:39 PM Jakob Kummerow <jkum...@chromium.org> wrote:
The snapshot will typically contain both the original JavaScript source and the bytecode for functions. Function.prototype.toString needs the source, so not including that in the snapshot would be a spec violation.

Bytecode is usually also cleared (and later compiled lazily at runtime) unless FunctionCodeHandling::kKeep is passed.
 

On Tue, Sep 3, 2019 at 1:23 PM Oleg Beletski <oleg.b...@gmail.com> wrote:

I viewed content of the custom generated snapshot and was surprised to see that  it contains almost unmodified blocks of java script with comments in it.


Is that normal behavior? Is there away to get more efficient processing of java script before snapshot created?  Our snapshot creation code is similar code in mksnapshot.


You could minify manually and/or use FunctionCodeHandling::kKeep.
 


Thanks,

Oleg

--
--
v8-users mailing list
v8-u...@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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-users/544f718d-70dc-494c-9e92-7b4eb0ece0d8%40googlegroups.com.

--
--
v8-users mailing list
v8-u...@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+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages