Commit 84b55f9d authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[wasm] Add check for table.init table index

At the moment the implementation of LoadElemSegmentImpl is not ready
to support the loading of passive element segments into tables with
index > 0. I added a check so that we notice when somebody starts to
implement it.

R=binji@chromium.org

Bug: v8:9270
Change-Id: I118da434cc379bbdb7bcef4af847216f5124551f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1622105Reviewed-by: 's avatarBen Smith <binji@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61718}
parent 245a5b38
......@@ -1618,6 +1618,13 @@ void InstanceBuilder::InitializeExceptions(
bool LoadElemSegment(Isolate* isolate, Handle<WasmInstanceObject> instance,
uint32_t table_index, uint32_t segment_index, uint32_t dst,
uint32_t src, uint32_t count) {
// This code path is only used for passive element segments with the
// table.init instruction. This instruction was introduced in the
// bulk-memory-operations proposal. At the moment, table.init can only operate
// on table-0. If table.init should work for tables with higher indices, then
// we have to adjust the code in {LoadElemSegmentImpl}. The code there uses
// {IndirectFunctionTableEntry} at the moment, which only works for table-0.
CHECK_EQ(table_index, 0);
auto& elem_segment = instance->module()->elem_segments[segment_index];
return LoadElemSegmentImpl(
isolate, instance,
......
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