Commit 073ff8b4 authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

[wasm] Fix Liftoff code for element dropping

Use 1-byte store to overwrite a uint8_t.

Fixed: chromium:1149115
Change-Id: I52018c2062ca8b89e5b4436ea84f97ce1d7d50e7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2563881
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71502}
parent ea750ba6
......@@ -3706,20 +3706,21 @@ class LiftoffCompiler {
void ElemDrop(FullDecoder* decoder, const ElemDropImmediate<validate>& imm) {
LiftoffRegList pinned;
Register seg_size_array =
Register dropped_elem_segments =
pinned.set(__ GetUnusedRegister(kGpReg, pinned)).gp();
LOAD_INSTANCE_FIELD(seg_size_array, DroppedElemSegments,
LOAD_INSTANCE_FIELD(dropped_elem_segments, DroppedElemSegments,
kSystemPointerSize);
LiftoffRegister seg_index =
pinned.set(__ GetUnusedRegister(kGpReg, pinned));
__ LoadConstant(seg_index, WasmValue(imm.index));
// Set the length of the segment to '0' to drop it.
// Mark the segment as dropped by setting its value in the dropped
// segments list to 1.
LiftoffRegister one_reg = pinned.set(__ GetUnusedRegister(kGpReg, pinned));
__ LoadConstant(one_reg, WasmValue(1));
__ Store(seg_size_array, seg_index.gp(), 0, one_reg, StoreType::kI32Store,
pinned);
__ Store(dropped_elem_segments, seg_index.gp(), 0, one_reg,
StoreType::kI32Store8, pinned);
}
void TableCopy(FullDecoder* decoder, const TableCopyImmediate<validate>& imm,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment