v8/test/unittests/wasm
Manos Koukoutos 52f6529634 [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/+/2247657
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68408}
2020-06-18 12:04:08 +00:00
..
control-transfer-unittest.cc [cleanup] Eliminate non-const reference parameters 2019-09-10 11:47:39 +00:00
decoder-unittest.cc Move more relevant files to src/objects 2019-05-23 08:52:30 +00:00
function-body-decoder-unittest.cc [wasm-gc] Change ValueType representation to account for new types 2020-06-18 12:04:08 +00:00
leb-helper-unittest.cc Move more relevant files to src/objects 2019-05-23 08:52:30 +00:00
loop-assignment-analysis-unittest.cc [wasm] Rename {Get,Set,Tee}Local to Local{Get,Set,Tee} 2019-10-08 14:14:40 +00:00
module-decoder-unittest.cc [wasm] Failing tests in module-decoder-unittests print out the error 2020-06-12 14:40:12 +00:00
OWNERS [wasm] Update OWNERS 2020-01-08 14:56:06 +00:00
streaming-decoder-unittest.cc [wasm] Make StreamingDecoder abstract, introduce AsyncStreamingDecoder 2020-05-20 17:24:32 +00:00
subtyping-unittest.cc [wasm-gc] Change ValueType representation to account for new types 2020-06-18 12:04:08 +00:00
trap-handler-posix-unittest.cc [wasm] Implement trap handler on Windows 2018-10-30 10:25:37 +00:00
trap-handler-win-unittest.cc Move utility code to src/utils 2019-05-23 14:13:34 +00:00
trap-handler-x64-unittest.cc [test] Use Fuchsia test runner for unittests 2019-12-05 14:22:01 +00:00
wasm-code-manager-unittest.cc [wasm] Fix performance bottleneck in DisjointAllocationPool 2020-04-22 10:00:05 +00:00
wasm-compiler-unittest.cc [wasm] Rename anyref to externref, anyref flag/feature to reftypes 2020-06-09 17:51:04 +00:00
wasm-gdbserver-unittest.cc [unittests] Convert to the new MOCK_METHOD macro. 2020-06-10 15:50:38 +00:00
wasm-macro-gen-unittest.cc [wasm] Clean up WASM_CALL_INDIRECT macros 2019-11-28 14:44:06 +00:00
wasm-module-builder-unittest.cc Move remaining files in src/ 2019-05-24 18:24:36 +00:00
wasm-module-sourcemap-unittest.cc Add source map support of WasmModule 2019-08-26 15:19:02 +00:00