diff options
author | Sam Clegg <sbc@chromium.org> | 2022-02-15 08:49:03 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-15 08:49:03 -0800 |
commit | 60050a9525dd076e63de1bb314190b42d6731abb (patch) | |
tree | 0e5c3e6c755fe4bac261a3582b190656c8a34442 /src/test-interp.cc | |
parent | 30fe5551cf983eb9bd194117caa3f0f4f2bbe865 (diff) | |
download | wabt-60050a9525dd076e63de1bb314190b42d6731abb.tar.gz wabt-60050a9525dd076e63de1bb314190b42d6731abb.tar.bz2 wabt-60050a9525dd076e63de1bb314190b42d6731abb.zip |
Initial implementation of extended-const proposal. (#1824)
The primary changes here are to the interpreter and how it handles
initializer expressions. With this change we model these are normal
function that we run during module initialization.
I imagine we could optimize this further by creating one long function
and encoding the `global.set`/`memory.init`/`table.init` into the
function itself, but this change seems like a good first step to make
the current tests pass.
Diffstat (limited to 'src/test-interp.cc')
-rw-r--r-- | src/test-interp.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/test-interp.cc b/src/test-interp.cc index 1ba6b0b1..93a524c6 100644 --- a/src/test-interp.cc +++ b/src/test-interp.cc @@ -680,11 +680,13 @@ TEST_F(InterpGCTest, Collect_InstanceExport) { }); Instantiate(); auto after_new = store_.object_count(); - EXPECT_EQ(before_new + 6, after_new); // module, instance, f, t, m, g + EXPECT_EQ(before_new + 7, + after_new); // module, instance, f, t, m, g, g-init-func - // Instance keeps all exports alive. + // Instance keeps all exports alive, except the init func which can be + // collected once its has been run store_.Collect(); - EXPECT_EQ(after_new, store_.object_count()); + EXPECT_EQ(after_new - 1, store_.object_count()); } // TODO: Test for Thread keeping references alive as locals/params/stack values. |