v8/src/snapshot
mtrofin b4dc310aab [wasm] reuse the first compiled module.
This change avoids needing to keep around an unused compiled
module. Instead, the result of compiling the wasm bytes is
given to the first instance. The module object and that instance object
point to the same compiled module. Instances are, then, cloned from
the compiled module the module object points to. When an instance is
collected, we make sure that the module object still has a clone
available, and, if the last instance is GC-ed, we also reset the compiled
module so that it does not reference its heap, so that it (==heap) may
be collected.

This is achieved by linking the clones in a double-linked list and
registering a finalizer for each. When we create an instance, we tie it
in the front of the list, making the module object point to it (O(1)). When
the finalizer is called, we relink the list over the dying object (O(1)). The
costliest operation is finalizing the last instance, since we need to visit
all wasm functions and reset heap references.

BUG=v8:5316

Committed: https://crrev.com/01f5af515728aebe6c5246f4f7dd6c573e8748af
Review-Url: https://codereview.chromium.org/2305903002
Cr-Original-Commit-Position: refs/heads/master@{#39153}
Cr-Commit-Position: refs/heads/master@{#39361}
2016-09-12 23:13:19 +00:00
..
code-serializer.cc [wasm] reuse the first compiled module. 2016-09-12 23:13:19 +00:00
code-serializer.h [wasm] reuse the first compiled module. 2016-09-12 23:13:19 +00:00
DEPS
deserializer.cc PPC/s390: [wasm] adding case for kAttachedReference in Serializer/Deseriealizer 2016-08-22 15:07:34 +00:00
deserializer.h [serializer] reserve maps one by one to avoid fragmentation. 2016-08-10 06:31:31 +00:00
mksnapshot.cc [icu] Support loading data file from default location 2016-06-08 12:11:34 +00:00
natives-common.cc [serializer] do not cache resource data pointer for native source. 2016-05-19 12:28:55 +00:00
natives-external.cc
natives.h [serializer] do not cache resource data pointer for native source. 2016-05-19 12:28:55 +00:00
OWNERS
partial-serializer.cc [serializer] encode recent long-encoded root list items as hot objects. 2016-06-24 06:57:32 +00:00
partial-serializer.h [snapshot] support multiple contexts in the same snapshot. 2016-06-15 15:39:06 +00:00
serializer-common.cc Disable CFI on a few methods. 2016-08-19 16:31:46 +00:00
serializer-common.h [serializer] reserve maps one by one to avoid fragmentation. 2016-08-10 06:31:31 +00:00
serializer.cc Move kMaxRegularHeapObjectSize into globals 2016-09-06 12:59:37 +00:00
serializer.h [serializer] reserve maps one by one to avoid fragmentation. 2016-08-10 06:31:31 +00:00
snapshot-common.cc [heap,snapshot] Replace first page size from snapshots with page trimming 2016-09-06 11:03:03 +00:00
snapshot-empty.cc
snapshot-external.cc
snapshot-source-sink.cc
snapshot-source-sink.h [snapshot] pass arguments as pointers, not references. 2016-06-10 10:59:04 +00:00
snapshot.h [heap,snapshot] Replace first page size from snapshots with page trimming 2016-09-06 11:03:03 +00:00
startup-serializer.cc [serializer] encode recent long-encoded root list items as hot objects. 2016-06-24 06:57:32 +00:00
startup-serializer.h [snapshot] support multiple contexts in the same snapshot. 2016-06-15 15:39:06 +00:00