summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-04-18 16:00:12 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-04-18 16:00:12 -0700
commitf0f98a3480394495a11d73c74ea81808bea44530 (patch)
tree517e90169cd633cb2d34991296a8fde72626852b /src
parent0b5d70e43b4b984ed7a25cf16ee2ccece3812dbf (diff)
downloadbinaryen-f0f98a3480394495a11d73c74ea81808bea44530.tar.gz
binaryen-f0f98a3480394495a11d73c74ea81808bea44530.tar.bz2
binaryen-f0f98a3480394495a11d73c74ea81808bea44530.zip
update MemorySize => CurrentMemory
Diffstat (limited to 'src')
-rw-r--r--src/passes/Print.cpp2
-rw-r--r--src/s2wasm.h2
-rw-r--r--src/wasm-binary.h10
-rw-r--r--src/wasm-interpreter.h2
-rw-r--r--src/wasm-s-parser.h6
-rw-r--r--src/wasm.h4
6 files changed, 11 insertions, 15 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index aa533849f..ddeec3dce 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -383,7 +383,7 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
void visitHost(Host *curr) {
switch (curr->op) {
case PageSize: printOpening(o, "pagesize") << ')'; break;
- case MemorySize: printOpening(o, "memory_size") << ')'; break;
+ case CurrentMemory: printOpening(o, "current_memory") << ')'; break;
case GrowMemory: {
printOpening(o, "grow_memory");
incIndent();
diff --git a/src/s2wasm.h b/src/s2wasm.h
index ff3c1f29f..d0dbe8c6a 100644
--- a/src/s2wasm.h
+++ b/src/s2wasm.h
@@ -1066,7 +1066,7 @@ class S2WasmBuilder {
} else if (match("unreachable")) {
addToBlock(allocator.alloc<Unreachable>());
} else if (match("memory_size")) {
- makeHost(MemorySize);
+ makeHost(CurrentMemory);
} else if (match("grow_memory")) {
makeHost1(GrowMemory);
} else if (match(".Lfunc_end")) {
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index db2c0d71d..08dafc563 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -237,7 +237,7 @@ enum FunctionEntry {
};
enum ASTNodes {
- MemorySize = 0x3b,
+ CurrentMemory = 0x3b,
GrowMemory = 0x39,
I32Add = 0x40,
I32Sub = 0x41,
@@ -1097,8 +1097,8 @@ public:
void visitHost(Host *curr) {
if (debug) std::cerr << "zz node: Host" << std::endl;
switch (curr->op) {
- case MemorySize: {
- o << int8_t(BinaryConsts::MemorySize);
+ case CurrentMemory: {
+ o << int8_t(BinaryConsts::CurrentMemory);
break;
}
case GrowMemory: {
@@ -1943,8 +1943,8 @@ public:
}
bool maybeVisitImpl(Host *curr, uint8_t code) {
switch (code) {
- case BinaryConsts::MemorySize: {
- curr->op = MemorySize;
+ case BinaryConsts::CurrentMemory: {
+ curr->op = CurrentMemory;
curr->type = i32;
break;
}
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h
index c57c764e4..61b67958f 100644
--- a/src/wasm-interpreter.h
+++ b/src/wasm-interpreter.h
@@ -604,7 +604,7 @@ private:
NOTE_ENTER("Host");
switch (curr->op) {
case PageSize: return Literal((int32_t)Memory::kPageSize);
- case MemorySize: return Literal(int32_t(instance.memorySize * Memory::kPageSize));
+ case CurrentMemory: return Literal(int32_t(instance.memorySize * Memory::kPageSize));
case GrowMemory: {
Flow flow = visit(curr->operands[0]);
if (flow.breaking()) return flow;
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h
index c1a1162e1..be3263312 100644
--- a/src/wasm-s-parser.h
+++ b/src/wasm-s-parser.h
@@ -623,7 +623,7 @@ public:
if (id == CALL) return makeCall(s);
if (id == CALL_IMPORT) return makeCallImport(s);
if (id == CALL_INDIRECT) return makeCallIndirect(s);
- }
+ } else if (str[1] == 'u') return makeHost(s, HostOp::CurrentMemory);
abort_on(str);
}
case 'e': {
@@ -647,10 +647,6 @@ public:
if (str[1] == 'o') return makeLoop(s);
abort_on(str);
}
- case 'm': {
- if (str[1] == 'e') return makeHost(s, HostOp::MemorySize);
- abort_on(str);
- }
case 'n': {
if (str[1] == 'o') return allocator.alloc<Nop>();
abort_on(str);
diff --git a/src/wasm.h b/src/wasm.h
index 93c9d8709..ee2f27388 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -709,7 +709,7 @@ enum BinaryOp {
};
enum HostOp {
- PageSize, MemorySize, GrowMemory, HasFeature
+ PageSize, CurrentMemory, GrowMemory, HasFeature
};
//
@@ -1041,7 +1041,7 @@ public:
void finalize() {
switch (op) {
- case PageSize: case MemorySize: case HasFeature: {
+ case PageSize: case CurrentMemory: case HasFeature: {
type = i32;
break;
}