summaryrefslogtreecommitdiff
path: root/src/wasm-interpreter.h
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2020-04-02 10:36:19 -0700
committerGitHub <noreply@github.com>2020-04-02 10:36:19 -0700
commit80c5164e1f50ed26e6fab373a563fd7a84135429 (patch)
treeac944407ac6bf1b26e524d31a3db8c410e4599e7 /src/wasm-interpreter.h
parent702b99508487bc5f56c409d890644b3b9212ae81 (diff)
downloadbinaryen-80c5164e1f50ed26e6fab373a563fd7a84135429.tar.gz
binaryen-80c5164e1f50ed26e6fab373a563fd7a84135429.tar.bz2
binaryen-80c5164e1f50ed26e6fab373a563fd7a84135429.zip
Tuple globals (#2718)
Since it wasn't easy to support tuples in Asyncify's call support using temporary functions, we decided to allow tuple-typed globals after all. This PR adds support for parsing, printing, lowering, and interpreting tuple globals and also adds validation ensuring that imported and exported globals do not have tuple types.
Diffstat (limited to 'src/wasm-interpreter.h')
-rw-r--r--src/wasm-interpreter.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h
index 4765efa0e..ca8041d5a 100644
--- a/src/wasm-interpreter.h
+++ b/src/wasm-interpreter.h
@@ -1432,7 +1432,7 @@ public:
globals[global->name] =
ConstantExpressionRunner<GlobalManager>(globals, maxDepth)
.visit(global->init)
- .getSingleValue();
+ .values;
});
// initialize the rest of the external interface
@@ -1457,10 +1457,10 @@ public:
return callFunction(export_->value, arguments);
}
- Literal callExport(Name name) { return callExport(name, LiteralList()); }
+ Literals callExport(Name name) { return callExport(name, LiteralList()); }
// get an exported global
- Literal getExport(Name name) {
+ Literals getExport(Name name) {
Export* export_ = wasm.getExportOrNull(name);
if (!export_) {
externalInterface->trap("getExport external not found");
@@ -1677,7 +1677,7 @@ private:
}
NOTE_EVAL1(name);
NOTE_EVAL1(flow.getSingleValue());
- instance.globals[name] = flow.getSingleValue();
+ instance.globals[name] = flow.values;
return Flow();
}
@@ -2232,7 +2232,7 @@ protected:
};
// The default ModuleInstance uses a trivial global manager
-using TrivialGlobalManager = std::map<Name, Literal>;
+using TrivialGlobalManager = std::map<Name, Literals>;
class ModuleInstance
: public ModuleInstanceBase<TrivialGlobalManager, ModuleInstance> {
public: