summaryrefslogtreecommitdiff
path: root/src/wasm-interpreter.h
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2019-05-21 13:25:14 -0700
committerGitHub <noreply@github.com>2019-05-21 13:25:14 -0700
commit1a3c1a58cc7e97a846f612baf7f74a370980458f (patch)
treecbe62ea58b2c0dd6d98225265419fea0b829aeab /src/wasm-interpreter.h
parentd78be9ac6c02910bbf8ac71118e68adff4fdc570 (diff)
downloadbinaryen-1a3c1a58cc7e97a846f612baf7f74a370980458f.tar.gz
binaryen-1a3c1a58cc7e97a846f612baf7f74a370980458f.tar.bz2
binaryen-1a3c1a58cc7e97a846f612baf7f74a370980458f.zip
Reflect instruction renaming in code (#2128)
- Reflected new renamed instruction names in code and tests: - `get_local` -> `local.get` - `set_local` -> `local.set` - `tee_local` -> `local.tee` - `get_global` -> `global.get` - `set_global` -> `global.set` - `current_memory` -> `memory.size` - `grow_memory` -> `memory.grow` - Removed APIs related to old instruction names in Binaryen.js and added APIs with new names if they are missing. - Renamed `typedef SortedVector LocalSet` to `SetsOfLocals` to prevent name clashes. - Resolved several TODO renaming items in wasm-binary.h: - `TableSwitch` -> `BrTable` - `I32ConvertI64` -> `I32WrapI64` - `I64STruncI32` -> `I64SExtendI32` - `I64UTruncI32` -> `I64UExtendI32` - `F32ConvertF64` -> `F32DemoteI64` - `F64ConvertF32` -> `F64PromoteF32` - Renamed `BinaryenGetFeatures` and `BinaryenSetFeatures` to `BinaryenModuleGetFeatures` and `BinaryenModuleSetFeatures` for consistency.
Diffstat (limited to 'src/wasm-interpreter.h')
-rw-r--r--src/wasm-interpreter.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h
index 1de216800..85a50163a 100644
--- a/src/wasm-interpreter.h
+++ b/src/wasm-interpreter.h
@@ -1022,9 +1022,9 @@ public:
Flow visitCall(Call*) { WASM_UNREACHABLE(); }
Flow visitCallIndirect(CallIndirect*) { WASM_UNREACHABLE(); }
- Flow visitGetLocal(GetLocal*) { WASM_UNREACHABLE(); }
- Flow visitSetLocal(SetLocal*) { WASM_UNREACHABLE(); }
- Flow visitSetGlobal(SetGlobal*) { WASM_UNREACHABLE(); }
+ Flow visitLocalGet(LocalGet*) { WASM_UNREACHABLE(); }
+ Flow visitLocalSet(LocalSet*) { WASM_UNREACHABLE(); }
+ Flow visitGlobalSet(GlobalSet*) { WASM_UNREACHABLE(); }
Flow visitLoad(Load* curr) { WASM_UNREACHABLE(); }
Flow visitStore(Store* curr) { WASM_UNREACHABLE(); }
Flow visitHost(Host* curr) { WASM_UNREACHABLE(); }
@@ -1049,7 +1049,7 @@ class ConstantExpressionRunner
public:
ConstantExpressionRunner(GlobalManager& globals) : globals(globals) {}
- Flow visitGetGlobal(GetGlobal* curr) { return Flow(globals[curr->name]); }
+ Flow visitGlobalGet(GlobalGet* curr) { return Flow(globals[curr->name]); }
};
//
@@ -1432,15 +1432,15 @@ private:
index, arguments, curr->type, *instance.self());
}
- Flow visitGetLocal(GetLocal* curr) {
- NOTE_ENTER("GetLocal");
+ Flow visitLocalGet(LocalGet* curr) {
+ NOTE_ENTER("LocalGet");
auto index = curr->index;
NOTE_EVAL1(index);
NOTE_EVAL1(scope.locals[index]);
return scope.locals[index];
}
- Flow visitSetLocal(SetLocal* curr) {
- NOTE_ENTER("SetLocal");
+ Flow visitLocalSet(LocalSet* curr) {
+ NOTE_ENTER("LocalSet");
auto index = curr->index;
Flow flow = this->visit(curr->value);
if (flow.breaking()) {
@@ -1453,16 +1453,16 @@ private:
return curr->isTee() ? flow : Flow();
}
- Flow visitGetGlobal(GetGlobal* curr) {
- NOTE_ENTER("GetGlobal");
+ Flow visitGlobalGet(GlobalGet* curr) {
+ NOTE_ENTER("GlobalGet");
auto name = curr->name;
NOTE_EVAL1(name);
assert(instance.globals.find(name) != instance.globals.end());
NOTE_EVAL1(instance.globals[name]);
return instance.globals[name];
}
- Flow visitSetGlobal(SetGlobal* curr) {
- NOTE_ENTER("SetGlobal");
+ Flow visitGlobalSet(GlobalSet* curr) {
+ NOTE_ENTER("GlobalSet");
auto name = curr->name;
Flow flow = this->visit(curr->value);
if (flow.breaking()) {
@@ -1616,9 +1616,9 @@ private:
Flow visitHost(Host* curr) {
NOTE_ENTER("Host");
switch (curr->op) {
- case CurrentMemory:
+ case MemorySize:
return Literal(int32_t(instance.memorySize));
- case GrowMemory: {
+ case MemoryGrow: {
auto fail = Literal(int32_t(-1));
Flow flow = this->visit(curr->operands[0]);
if (flow.breaking()) {