v8/test/common/wasm
Manos Koukoutos 55ddbaa054 [wasm][refactor] Rework immediate-argument abstractions
Motivation:
The immediate-argument classes defined in function-body-decoder.h were
often adding an offset to the provided pc. This was inconsistent,
bug-prone, and counterintuitive. This CL imposes that all immediates
are passed as pc the start of the immediate argument they are parsing.
Some other smaller inconsistencies are fixed as well.

Changes:

src/wasm/:
- Enforce that all Immediates are passed the pc at the start of the
  argument they are parsing. Adapt all call sites.
- Remove unneeded offset arguments from two SIMD related immediates.
- Add a pc argument to all Validate functions for immediates instead
  of using the Decoder's current pc.
- Remove the (unused) pc argument from all Complete functions for
  immediates.
- Introduce Validate() for BranchOnExceptionImmediate.
- In WasmDecoder::Decode(), make sure len is updated before breaking out
  of the loop in case of a Validate() failure.
- Change the default prefix_len of DecodeLoadMem/DecodeStoreMem to 1.

wasm-interpreter.cc:
- Change the default prefix_len of ExecuteLoad/Store to 1.
- Adapt offsets in calls to Immediates.
- Remove redundant opcode_length argument from ExecuteSimdOp, use len
  in its place.

function-body-decoder-unittest.cc
- Adapt offsets in calls to Immediates.
- Introduce and use EXPECT_OK, as is done in other tests.

Change-Id: I534606c0e238af309804d4a7c8cec75b1e49c6ad
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2267381
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68559}
2020-06-26 13:29:42 +00:00
..
flag-utils.h [wasm] Refactor WasmFeatures 2019-11-26 17:36:11 +00:00
OWNERS Use relative paths to OWNERS files 2019-08-12 13:52:52 +00:00
test-signatures.h [wasm-gc] Establish HeapType shorthands, rework signatures. 2020-06-19 08:43:44 +00:00
wasm-interpreter.cc [wasm][refactor] Rework immediate-argument abstractions 2020-06-26 13:29:42 +00:00
wasm-interpreter.h [wasm][interpreter] Remove RaiseException 2020-06-25 10:30:22 +00:00
wasm-macro-gen.h [wasm-gc] Introduce HeapTypeImmediate 2020-06-24 18:12:59 +00:00
wasm-module-runner.cc [wasm] Remove dead code from test utils 2020-06-25 10:22:52 +00:00
wasm-module-runner.h [wasm] Remove dead code from test utils 2020-06-25 10:22:52 +00:00