diff options
author | Heejin Ahn <aheejin@gmail.com> | 2019-05-21 13:25:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-21 13:25:14 -0700 |
commit | 1a3c1a58cc7e97a846f612baf7f74a370980458f (patch) | |
tree | cbe62ea58b2c0dd6d98225265419fea0b829aeab /scripts | |
parent | d78be9ac6c02910bbf8ac71118e68adff4fdc570 (diff) | |
download | binaryen-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 'scripts')
-rwxr-xr-x | scripts/fuzz_relooper.py | 6 | ||||
-rwxr-xr-x | scripts/gen-s-parser.py | 14 |
2 files changed, 10 insertions, 10 deletions
diff --git a/scripts/fuzz_relooper.py b/scripts/fuzz_relooper.py index 62db2a3c5..3b14ed2cd 100755 --- a/scripts/fuzz_relooper.py +++ b/scripts/fuzz_relooper.py @@ -216,7 +216,7 @@ int main() { }; BinaryenExpressionRef list[] = { BinaryenCall(module, "print", args, 1, BinaryenTypeNone()), - BinaryenSetLocal(module, 0, BinaryenCall(module, "check", NULL, 0, + BinaryenLocalSet(module, 0, BinaryenCall(module, "check", NULL, 0, BinaryenTypeInt32())) }; ''' % (i, printed_ids[i]) @@ -226,7 +226,7 @@ int main() { BinaryenBlock(module, NULL, list, 2, BinaryenTypeNone()), BinaryenBinary(module, BinaryenRemUInt32(), - BinaryenGetLocal(module, 0, BinaryenTypeInt32()), + BinaryenLocalGet(module, 0, BinaryenTypeInt32()), BinaryenConst(module, BinaryenLiteralInt32(%d)) ) ); @@ -279,7 +279,7 @@ int main() { BinaryenEqInt32(), BinaryenBinary(module, BinaryenRemUInt32(), - BinaryenGetLocal(module, 0, BinaryenTypeInt32()), + BinaryenLocalGet(module, 0, BinaryenTypeInt32()), BinaryenConst(module, BinaryenLiteralInt32(%d)) ), BinaryenConst(module, BinaryenLiteralInt32(%d)) diff --git a/scripts/gen-s-parser.py b/scripts/gen-s-parser.py index 9dcfb3dd3..5e5ec494f 100755 --- a/scripts/gen-s-parser.py +++ b/scripts/gen-s-parser.py @@ -32,11 +32,11 @@ instructions = [ ("call_indirect", "makeCallIndirect(s)"), ("drop", "makeDrop(s)"), ("select", "makeSelect(s)"), - ("local.get", "makeGetLocal(s)"), - ("local.set", "makeSetLocal(s)"), - ("local.tee", "makeTeeLocal(s)"), - ("global.get", "makeGetGlobal(s)"), - ("global.set", "makeSetGlobal(s)"), + ("local.get", "makeLocalGet(s)"), + ("local.set", "makeLocalSet(s)"), + ("local.tee", "makeLocalTee(s)"), + ("global.get", "makeGlobalGet(s)"), + ("global.set", "makeGlobalSet(s)"), ("memory.init", "makeMemoryInit(s)"), ("data.drop", "makeDataDrop(s)"), ("memory.copy", "makeMemoryCopy(s)"), @@ -64,8 +64,8 @@ instructions = [ ("i64.store8", "makeStore(s, i64, /*isAtomic=*/false)"), ("i64.store16", "makeStore(s, i64, /*isAtomic=*/false)"), ("i64.store32", "makeStore(s, i64, /*isAtomic=*/false)"), - ("current_memory", "makeHost(s, HostOp::CurrentMemory)"), - ("grow_memory", "makeHost(s, HostOp::GrowMemory)"), + ("memory.size", "makeHost(s, HostOp::MemorySize)"), + ("memory.grow", "makeHost(s, HostOp::MemoryGrow)"), ("i32.const", "makeConst(s, i32)"), ("i64.const", "makeConst(s, i64)"), ("f32.const", "makeConst(s, f32)"), |