Commit 9125fc35 authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[wasm][bulk-memory] Adjust table.init to recent spec changes

R=binji@chromium.org

Change-Id: Idaac0f782f70f881d0a4e60e3c32671f386f0b41
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1706474
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: 's avatarBen Smith <binji@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62779}
parent 5b239cce
...@@ -1869,6 +1869,8 @@ bool WasmInstanceObject::InitTableEntries(Isolate* isolate, ...@@ -1869,6 +1869,8 @@ bool WasmInstanceObject::InitTableEntries(Isolate* isolate,
uint32_t table_index, uint32_t table_index,
uint32_t segment_index, uint32_t dst, uint32_t segment_index, uint32_t dst,
uint32_t src, uint32_t count) { uint32_t src, uint32_t count) {
// Copying 0 elements is a no-op.
if (count == 0) return true;
// Note that this implementation just calls through to module instantiation. // Note that this implementation just calls through to module instantiation.
// This is intentional, so that the runtime only depends on the object // This is intentional, so that the runtime only depends on the object
// methods, and not the module instantiation logic. // methods, and not the module instantiation logic.
......
...@@ -543,9 +543,9 @@ void TestTableInitOob(ExecutionTier execution_tier, int table_index) { ...@@ -543,9 +543,9 @@ void TestTableInitOob(ExecutionTier execution_tier, int table_index) {
r.CheckCallViaJS(0xDEADBEEF, 0, 3, 3); r.CheckCallViaJS(0xDEADBEEF, 0, 3, 3);
CheckTableCall(isolate, table, r, call_index, 3, 4, null, 0, 1); CheckTableCall(isolate, table, r, call_index, 3, 4, null, 0, 1);
// 0-count is oob. // 0-count is never oob.
r.CheckCallViaJS(0xDEADBEEF, kTableSize + 1, 0, 0); r.CheckCallViaJS(0, kTableSize + 1, 0, 0);
r.CheckCallViaJS(0xDEADBEEF, 0, kTableSize + 1, 0); r.CheckCallViaJS(0, 0, kTableSize + 1, 0);
r.CheckCallViaJS(0xDEADBEEF, 0, 0, 6); r.CheckCallViaJS(0xDEADBEEF, 0, 0, 6);
r.CheckCallViaJS(0xDEADBEEF, 0, 1, 5); r.CheckCallViaJS(0xDEADBEEF, 0, 1, 5);
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
'tests/proposals/bulk-memory-operations/elem': [FAIL], 'tests/proposals/bulk-memory-operations/elem': [FAIL],
'tests/proposals/bulk-memory-operations/memory_copy': [FAIL], 'tests/proposals/bulk-memory-operations/memory_copy': [FAIL],
'tests/proposals/bulk-memory-operations/table_copy': [FAIL], 'tests/proposals/bulk-memory-operations/table_copy': [FAIL],
'tests/proposals/bulk-memory-operations/table_init': [FAIL],
'tests/proposals/bulk-memory-operations/memory_init': [FAIL], 'tests/proposals/bulk-memory-operations/memory_init': [FAIL],
'tests/proposals/bulk-memory-operations/memory_fill': [FAIL], 'tests/proposals/bulk-memory-operations/memory_fill': [FAIL],
'tests/proposals/bulk-memory-operations/bulk': [FAIL], 'tests/proposals/bulk-memory-operations/bulk': [FAIL],
......
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