v8/test/cctest/wasm
Mircea Trofin b29bfffdf9 [wasm] Initialize parallel jobs with less memory.
Avoid constructing zones and large zone objects when initializing
WasmCompilationUnit. The main reason we did that is so we can cache
the CEntryStub node, which requires a code object, obtainable only
on the main thread. We need that value, however, on background threads,
which is also where we need the aforementioned large objects. We only
need that for the WasmCompilationUnits being currently compiled, which
is a number proportional to the number of background threads provided
by the embedder. Specifically, one zone is needed only for the duration
of the background compilation, while the second zone needs to survive 
past that, so the compilation results may be committed to the GC heap
as Code objects.

The problem with these large objects is that the first allocation
in a Zone is at minimum 8KB. We used to allocate 2 zones. For
modules with 200K functions, that means 3.2GB of memory pre-allocated
before any of it is actually needed.

This change attaches a Handle to the CEntryStub on the WasmCompilationUnits,
and delays zone creation to when needed. The change also adds a way to 
cache CEntryStubs in a JSGraph from a given Code handle - limited to the
scenario needed by wasm (and removable once we get wasm off the GC heap,
which subsumes removing this dependency on CEntryStubs)

An additional constraint for this change is that we want it to be easily 
back-mergeable to address chromium:723899.

For the wasm payload in question, collecting the max memory used by d8
using /usr/bin/time --format='(%Xtext+%Ddata %Mmax)', we get the 
following numbers (in KB):

- unchanged: 3307480
- patch 1: 1807140 (45% reduction)
- patch 3: 1230320 (62% reduction from first)
- patch 5/6: 519368 (84% reduction from first)

Bug: chomium:732010, chromium:723899
Change-Id: I45b96792daf8a9c8dc47d45fb52da75945a41401
Reviewed-on: https://chromium-review.googlesource.com/530193
Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45880}
2017-06-12 18:29:36 +00:00
..
OWNERS Add COMPONENT tags to OWNERS files where appropriate 2017-05-22 10:15:28 +00:00
test-run-wasm-64.cc [wasm] [cleanup] Always use macros for memory operations 2017-04-26 11:49:50 +00:00
test-run-wasm-asmjs.cc [wasm] Move wasm-macro-gen.h to test/common/wasm 2017-04-25 11:59:48 +00:00
test-run-wasm-interpreter.cc [wasm] Reduce test-specific code 2017-04-28 09:00:32 +00:00
test-run-wasm-js.cc [wasm] Move wasm-macro-gen.h to test/common/wasm 2017-04-25 11:59:48 +00:00
test-run-wasm-module.cc [wasm] [cleanup] Remove CompileInstantiateWasmModuleForTesting 2017-06-12 11:52:13 +00:00
test-run-wasm-relocation.cc [wasm] Move wasm-macro-gen.h to test/common/wasm 2017-04-25 11:59:48 +00:00
test-run-wasm-simd.cc [wasm] [cleanup] Avoid shouting WASM 2017-06-09 16:24:19 +00:00
test-run-wasm.cc [wasm] Make prototype flags experimental 2017-05-31 14:18:08 +00:00
test-wasm-breakpoints.cc [wasm] [cleanup] Introduce WireBytesRef struct 2017-06-12 12:57:21 +00:00
test-wasm-interpreter-entry.cc [wasm] Move wasm-macro-gen.h to test/common/wasm 2017-04-25 11:59:48 +00:00
test-wasm-stack.cc [wasm] [cleanup] Avoid shouting WASM 2017-06-09 16:24:19 +00:00
test-wasm-trap-position.cc [wasm] Move wasm-macro-gen.h to test/common/wasm 2017-04-25 11:59:48 +00:00
wasm-run-utils.h [wasm] Initialize parallel jobs with less memory. 2017-06-12 18:29:36 +00:00