summaryrefslogtreecommitdiff
path: root/test/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.txt
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-03-04 13:21:39 -0800
committerGitHub <noreply@github.com>2020-03-04 13:21:39 -0800
commit57a81a04f7a49593438dcae4ca8cbad8e465dc2e (patch)
tree02f8732873e8ef2608a94610857e2fb13de813ca /test/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.txt
parent2a0f6a513c6d6a99d16ca31de3e76a63b1490b4c (diff)
downloadbinaryen-57a81a04f7a49593438dcae4ca8cbad8e465dc2e.tar.gz
binaryen-57a81a04f7a49593438dcae4ca8cbad8e465dc2e.tar.bz2
binaryen-57a81a04f7a49593438dcae4ca8cbad8e465dc2e.zip
Expose asyncify state via a getter (#2679)
Normally, a wrapper has to track state separately to know when to unwind/rewind and when to actually call import functions. Exposing Asyncify state can help avoid this duplication and avoid subtle bugs when internal and wrapper state get out of sync. Since this is a tiny function and it's useful for any Asyncify embedder, I've decided to expose it by default rather than hide behind an option.
Diffstat (limited to 'test/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.txt')
-rw-r--r--test/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.txt b/test/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.txt
index 538060f41..ed2870d7c 100644
--- a/test/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.txt
+++ b/test/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.txt
@@ -1,6 +1,7 @@
(module
(type $none_=>_none (func))
(type $i32_=>_none (func (param i32)))
+ (type $none_=>_i32 (func (result i32)))
(import "env" "import" (func $import))
(memory $0 1 2)
(global $__asyncify_state (mut i32) (i32.const 0))
@@ -9,6 +10,7 @@
(export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
(export "asyncify_start_rewind" (func $asyncify_start_rewind))
(export "asyncify_stop_rewind" (func $asyncify_stop_rewind))
+ (export "asyncify_get_state" (func $asyncify_get_state))
(func $foo (; 1 ;)
(call $import)
)
@@ -262,4 +264,7 @@
(unreachable)
)
)
+ (func $asyncify_get_state (; 10 ;) (result i32)
+ (global.get $__asyncify_state)
+ )
)