Skip to content

Commit

Permalink
wazevo(ssa): load memory bounds directly when shared (#2059)
Browse files Browse the repository at this point in the history
Signed-off-by: Anuraag Agrawal <[email protected]>
  • Loading branch information
anuraaga authored Feb 14, 2024
1 parent 74acc6f commit b839b4e
Show file tree
Hide file tree
Showing 3 changed files with 976 additions and 770 deletions.
25 changes: 16 additions & 9 deletions internal/engine/wazevo/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,21 +606,25 @@ func TestE2E(t *testing.T) {
},
},
{
name: "memory_wait32",
m: testcases.MemoryWait32.Module,
features: api.CoreFeaturesV2 | experimental.CoreFeaturesThreads,
name: "memory_wait32",
m: testcases.MemoryWait32.Module,
features: api.CoreFeaturesV2 | experimental.CoreFeaturesThreads,
skipAMD64: true,
calls: []callCase{
{params: []uint64{0x0, 0xbeef, 0xffffffff}, expResults: []uint64{1}}, // exp not equal, returns 1
{params: []uint64{0x1, 0xbeef, 0xffffffff}, expErr: "unaligned atomic"},
{params: []uint64{0x2, 0xbeef, 0xffffffff}, expErr: "unaligned atomic"},
{params: []uint64{0x3, 0xbeef, 0xffffffff}, expErr: "unaligned atomic"},
{params: []uint64{0x4, 0xbeef, 0xffffffff}, expResults: []uint64{1}}, // exp not equal, returns 1

{params: []uint64{0xffffffff, 0xbeef, 0xffffffff}, expErr: "out of bounds memory access"},
},
},
{
name: "memory_wait64",
m: testcases.MemoryWait64.Module,
features: api.CoreFeaturesV2 | experimental.CoreFeaturesThreads,
name: "memory_wait64",
m: testcases.MemoryWait64.Module,
features: api.CoreFeaturesV2 | experimental.CoreFeaturesThreads,
skipAMD64: true,
calls: []callCase{
{params: []uint64{0x0, 0xbeef, 0xffffffff}, expResults: []uint64{1}}, // exp not equal, returns 1
{params: []uint64{0x1, 0xbeef, 0xffffffff}, expErr: "unaligned atomic"},
Expand All @@ -631,12 +635,15 @@ func TestE2E(t *testing.T) {
{params: []uint64{0x6, 0xbeef, 0xffffffff}, expErr: "unaligned atomic"},
{params: []uint64{0x7, 0xbeef, 0xffffffff}, expErr: "unaligned atomic"},
{params: []uint64{0x8, 0xbeef, 0xffffffff}, expResults: []uint64{1}}, // exp not equal, returns 1

{params: []uint64{0xffffffff, 0xbeef, 0xffffffff}, expErr: "out of bounds memory access"},
},
},
{
name: "memory_notify",
m: testcases.MemoryNotify.Module,
features: api.CoreFeaturesV2 | experimental.CoreFeaturesThreads,
name: "memory_notify",
m: testcases.MemoryNotify.Module,
features: api.CoreFeaturesV2 | experimental.CoreFeaturesThreads,
skipAMD64: true,
calls: []callCase{
{params: []uint64{0x0, 0x1}, expResults: []uint64{0}}, // no waiters, returns 0
{params: []uint64{0x1, 0x1}, expErr: "unaligned atomic"},
Expand Down
Loading

0 comments on commit b839b4e

Please sign in to comment.