summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2019-10-10 14:50:24 -0700
committerGitHub <noreply@github.com>2019-10-10 14:50:24 -0700
commit9fe79b8c94c0d5224add710781a2419c1feb910a (patch)
tree014013216bd741bf74495296969853b9c9c6fed5 /src
parent1582c525a620b00f9a8c8a1134078e2665e40363 (diff)
downloadbinaryen-9fe79b8c94c0d5224add710781a2419c1feb910a.tar.gz
binaryen-9fe79b8c94c0d5224add710781a2419c1feb910a.tar.bz2
binaryen-9fe79b8c94c0d5224add710781a2419c1feb910a.zip
Add support for reftypes in InstrumentLocals pass (#2375)
This adds support for anyref and exnref types in InstrumentLocals pass.
Diffstat (limited to 'src')
-rw-r--r--src/passes/InstrumentLocals.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/passes/InstrumentLocals.cpp b/src/passes/InstrumentLocals.cpp
index ae1c30836..8fc689222 100644
--- a/src/passes/InstrumentLocals.cpp
+++ b/src/passes/InstrumentLocals.cpp
@@ -57,11 +57,15 @@ Name get_i32("get_i32");
Name get_i64("get_i64");
Name get_f32("get_f32");
Name get_f64("get_f64");
+Name get_anyref("get_anyref");
+Name get_exnref("get_exnref");
Name set_i32("set_i32");
Name set_i64("set_i64");
Name set_f32("set_f32");
Name set_f64("set_f64");
+Name set_anyref("set_anyref");
+Name set_exnref("set_exnref");
struct InstrumentLocals : public WalkerPass<PostWalker<InstrumentLocals>> {
void visitLocalGet(LocalGet* curr) {
@@ -82,9 +86,11 @@ struct InstrumentLocals : public WalkerPass<PostWalker<InstrumentLocals>> {
case v128:
assert(false && "v128 not implemented yet");
case anyref:
- assert(false && "anyref not implemented yet");
+ import = get_anyref;
+ break;
case exnref:
- assert(false && "exnref not implemented yet");
+ import = get_exnref;
+ break;
case none:
WASM_UNREACHABLE();
case unreachable:
@@ -116,9 +122,11 @@ struct InstrumentLocals : public WalkerPass<PostWalker<InstrumentLocals>> {
case v128:
assert(false && "v128 not implemented yet");
case anyref:
- assert(false && "anyref not implemented yet");
+ import = set_anyref;
+ break;
case exnref:
- assert(false && "exnref not implemented yet");
+ import = set_exnref;
+ break;
case unreachable:
return; // nothing to do here
case none:
@@ -137,10 +145,14 @@ struct InstrumentLocals : public WalkerPass<PostWalker<InstrumentLocals>> {
addImport(curr, get_i64, "jiij");
addImport(curr, get_f32, "fiif");
addImport(curr, get_f64, "diid");
+ addImport(curr, get_anyref, "aiia");
+ addImport(curr, get_exnref, "eiie");
addImport(curr, set_i32, "iiii");
addImport(curr, set_i64, "jiij");
addImport(curr, set_f32, "fiif");
addImport(curr, set_f64, "diid");
+ addImport(curr, set_anyref, "aiia");
+ addImport(curr, set_exnref, "eiie");
}
private: