summaryrefslogtreecommitdiff
path: root/src/wasm-binary.h
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2017-06-27 14:24:21 -0700
committerGitHub <noreply@github.com>2017-06-27 14:24:21 -0700
commit21e08eeef1ccc489cd06495e4370e1dffccfe088 (patch)
treecf10711c6eb26acf378da8cdcc4d7e961ef582bf /src/wasm-binary.h
parentbf37733de319b5e0f0b6b0205c1745c5214fea1e (diff)
downloadbinaryen-21e08eeef1ccc489cd06495e4370e1dffccfe088.tar.gz
binaryen-21e08eeef1ccc489cd06495e4370e1dffccfe088.tar.bz2
binaryen-21e08eeef1ccc489cd06495e4370e1dffccfe088.zip
Add shared memories (#1069)
Begin to implement wasm threading proposal in https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md This PR just has shared memory attribute with wast and binary support.
Diffstat (limited to 'src/wasm-binary.h')
-rw-r--r--src/wasm-binary.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index 889a3aa6c..9e75d6501 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -515,6 +515,11 @@ enum MemoryAccess {
NaturalAlignment = 0
};
+enum MemoryFlags {
+ HasMaximum = 1 << 0,
+ IsShared = 1 << 1
+};
+
} // namespace BinaryConsts
@@ -560,7 +565,7 @@ public:
void write();
void writeHeader();
int32_t writeU32LEBPlaceholder();
- void writeResizableLimits(Address initial, Address maximum, bool hasMaximum);
+ void writeResizableLimits(Address initial, Address maximum, bool hasMaximum, bool shared);
int32_t startSection(BinaryConsts::Section code);
void finishSection(int32_t start);
int32_t startSubsection(BinaryConsts::UserSections::Subsection code);
@@ -712,7 +717,7 @@ public:
// gets a name in the combined function import+defined function space
Name getFunctionIndexName(Index i);
- void getResizableLimits(Address& initial, Address& max, Address defaultIfNoMax);
+ void getResizableLimits(Address& initial, Address& max, bool& shared, Address defaultIfNoMax);
void readImports();
std::vector<FunctionType*> functionTypes; // types of defined functions