https://chromium.googlesource.com/v8/v8.git/+/52f6529634f7f48bcc3862a42339d8fd58bb7f8ecommit 52f6529634f7f48bcc3862a42339d8fd58bb7f8e
Author: Manos Koukoutos <
mano...@chromium.org>
Date: Thu Jun 18 12:04:08 2020
[wasm-gc] Change ValueType representation to account for new types
Motivation:
Changes to the typed function references and gc proposals solidified
the notion of heap type, clarified nullable vs. non-nullable reference
types, and introduced rtts, which contain an integer depth field in
addition to a heap type. This required us to overhaul our ValueType
representation, which results in extensive changes.
To keep this CL "small", we do not try to implement the binary encoding
as described in the proposals, but rather devise a simpler one of our
own (see below). Also, we do not try to implement additional
functionality for the new types.
Changes:
- Introduce HeapType. Move heap types from ValueType to HeapType.
- Introduce Nullability for reference types.
- Rework ValueType helper methods.
- Introduce rtts in ValueType with an integer depth field. Include depth
in the ValueType encoding.
- Make the constructor of ValueType private, instead expose static
functions which explicitly state what they create.
- Change every switch statement on ValueType::Kind. Sometimes, we need
nested switches.
- Introduce temporary constants in ValueTypeCode for nullable types,
use them for decoding.
- In WasmGlobalObject, split 'flags' into 'raw_type' and 'is_mutable'.
- Change IsSubtypeOfRef to IsSubtypeOfHeap and implement changes in
subtyping.
- kWasmFuncRef initializers are now non-nullable. Initializers are
only required to be subtypes of the declared global type.
- Change tests and fuzzers as needed.
Bug: v8:7748
Change-Id: If41f783bd4128443b07e94188cea7dd53ab0bfa5
Reviewed-on:
https://chromium-review.googlesource.com/c/v8/v8/+/2247657Commit-Queue: Manos Koukoutos <
mano...@chromium.org>
Reviewed-by: Clemens Backes <
clem...@chromium.org>
Reviewed-by: Jakob Kummerow <
jkum...@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68408}
[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/api/api.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/builtins/wasm.tq[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/compiler/wasm-compiler.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/diagnostics/objects-printer.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/objects/debug-objects.tq[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/objects/objects-body-descriptors-inl.h[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/baseline/liftoff-compiler.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/baseline/x64/liftoff-assembler-x64.h[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/c-api.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/function-body-decoder-impl.h[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/graph-builder-interface.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/local-decl-encoder.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/module-decoder.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/module-instantiate.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/value-type.h[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/wasm-constants.h[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/wasm-debug.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/wasm-interpreter.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/wasm-js.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/wasm-module-builder.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/wasm-module.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/wasm-module.h[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/wasm-objects-inl.h[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/wasm-objects.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/wasm-objects.h[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/wasm-objects.tq[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/wasm-subtyping.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/src/wasm/wasm-subtyping.h[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/test/cctest/wasm/test-gc.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/test/cctest/wasm/test-run-wasm-module.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/test/cctest/wasm/test-wasm-debug-evaluate.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/test/common/wasm/wasm-macro-gen.h[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/test/common/wasm/wasm-module-runner.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/test/fuzzer/wasm-compile.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/test/fuzzer/wasm-fuzzer-common.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/test/unittests/wasm/function-body-decoder-unittest.cc[modify]
https://crrev.com/52f6529634f7f48bcc3862a42339d8fd58bb7f8e/test/unittests/wasm/subtyping-unittest.cc