summaryrefslogtreecommitdiff
path: root/test/binaryen.js/kitchen-sink.js
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 /test/binaryen.js/kitchen-sink.js
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 'test/binaryen.js/kitchen-sink.js')
-rw-r--r--test/binaryen.js/kitchen-sink.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js
index a798c4092..38ce32876 100644
--- a/test/binaryen.js/kitchen-sink.js
+++ b/test/binaryen.js/kitchen-sink.js
@@ -81,10 +81,10 @@ function test_ids() {
console.log("BinaryenSwitchId: " + Binaryen.SwitchId);
console.log("BinaryenCallId: " + Binaryen.CallId);
console.log("BinaryenCallIndirectId: " + Binaryen.CallIndirectId);
- console.log("BinaryenGetLocalId: " + Binaryen.GetLocalId);
- console.log("BinaryenSetLocalId: " + Binaryen.SetLocalId);
- console.log("BinaryenGetGlobalId: " + Binaryen.GetGlobalId);
- console.log("BinaryenSetGlobalId: " + Binaryen.SetGlobalId);
+ console.log("BinaryenLocalGetId: " + Binaryen.LocalGetId);
+ console.log("BinaryenLocalSetId: " + Binaryen.LocalSetId);
+ console.log("BinaryenGlobalGetId: " + Binaryen.GlobalGetId);
+ console.log("BinaryenGlobalSetId: " + Binaryen.GlobalSetId);
console.log("BinaryenLoadId: " + Binaryen.LoadId);
console.log("BinaryenStoreId: " + Binaryen.StoreId);
console.log("BinaryenConstId: " + Binaryen.ConstId);
@@ -383,9 +383,9 @@ function test_core() {
module.i32.eqz( // check the output type of the call node
module.callIndirect(makeInt32(2449), [ makeInt32(13), makeInt64(37, 0), makeFloat32(1.3), makeFloat64(3.7) ], "iiIfF")
),
- module.drop(module.getLocal(0, Binaryen.i32)),
- module.setLocal(0, makeInt32(101)),
- module.drop(module.teeLocal(0, makeInt32(102))),
+ module.drop(module.local.get(0, Binaryen.i32)),
+ module.local.set(0, makeInt32(101)),
+ module.drop(module.local.tee(0, makeInt32(102))),
module.i32.load(0, 0, makeInt32(1)),
module.i64.load16_s(2, 1, makeInt32(8)),
module.f32.load(0, 0, makeInt32(2)),
@@ -688,8 +688,8 @@ function test_binaries() {
{ // create a module and write it to binary
module = new Binaryen.Module();
var iii = module.addFunctionType("iii", Binaryen.i32, [ Binaryen.i32, Binaryen.i32 ]);
- var x = module.getLocal(0, Binaryen.i32),
- y = module.getLocal(1, Binaryen.i32);
+ var x = module.local.get(0, Binaryen.i32),
+ y = module.local.get(1, Binaryen.i32);
var add = module.i32.add(x, y);
var adder = module.addFunction("adder", iii, [], add);
var initExpr = module.i32.const(3);
@@ -738,7 +738,7 @@ function test_nonvalid() {
var v = module.addFunctionType("v", Binaryen.None, []);
var func = module.addFunction("func", v, [ Binaryen.i32 ],
- module.setLocal(0, makeInt64(1234, 0)) // wrong type!
+ module.local.set(0, makeInt64(1234, 0)) // wrong type!
);
console.log(module.emitText());
@@ -760,8 +760,8 @@ function test_parsing() {
// create a module and write it to text
module = new Binaryen.Module();
var iii = module.addFunctionType("iii", Binaryen.i32, [ Binaryen.i32, Binaryen.i32 ]);
- var x = module.getLocal(0, Binaryen.i32),
- y = module.getLocal(1, Binaryen.i32);
+ var x = module.local.get(0, Binaryen.i32),
+ y = module.local.get(1, Binaryen.i32);
var add = module.i32.add(x, y);
var adder = module.addFunction("adder", iii, [], add);
var initExpr = module.i32.const(3);