@@ -1025,7 +1025,7 @@ void Asm2WasmBuilder::processAsm(Ref ast) {
10251025 wasm.addGlobal (
10261026 builder.makeGlobal (name,
10271027 type,
1028- builder.makeGetGlobal (import ->name , type),
1028+ builder.makeGlobalGet (import ->name , type),
10291029 Builder::Mutable));
10301030 }
10311031 }
@@ -1262,7 +1262,7 @@ void Asm2WasmBuilder::processAsm(Ref ast) {
12621262 // when function pointer casts are emulated.
12631263 if (wasm.table .segments .size () == 0 ) {
12641264 wasm.table .segments .emplace_back (
1265- builder.makeGetGlobal (Name (TABLE_BASE), i32 ));
1265+ builder.makeGlobalGet (Name (TABLE_BASE), i32 ));
12661266 }
12671267 auto & segment = wasm.table .segments [0 ];
12681268 functionTableStarts[name] =
@@ -1290,7 +1290,7 @@ void Asm2WasmBuilder::processAsm(Ref ast) {
12901290 IString value = pair[1 ]->getIString ();
12911291 if (key == Name (" _emscripten_replace_memory" )) {
12921292 // asm.js memory growth provides this special non-asm function,
1293- // which we don't need (we use grow_memory )
1293+ // which we don't need (we use memory.grow )
12941294 assert (!wasm.getFunctionOrNull (value));
12951295 continue ;
12961296 } else if (key == UDIVMODDI4) {
@@ -1732,7 +1732,7 @@ void Asm2WasmBuilder::processAsm(Ref ast) {
17321732 if (curr->is <Return>()) {
17331733 curr = curr->cast <Return>()->value ;
17341734 }
1735- auto * get = curr->cast <GetGlobal >();
1735+ auto * get = curr->cast <GlobalGet >();
17361736 tempRet0 = get->name ;
17371737 }
17381738 // udivmoddi4 receives xl, xh, yl, yl, r, and
@@ -1750,26 +1750,26 @@ void Asm2WasmBuilder::processAsm(Ref ast) {
17501750 y64 = Builder::addVar (func, " y64" , i64 );
17511751 auto * body = allocator.alloc <Block>();
17521752 body->list .push_back (
1753- builder.makeSetLocal (x64, I64Utilities::recreateI64 (builder, xl, xh)));
1753+ builder.makeLocalSet (x64, I64Utilities::recreateI64 (builder, xl, xh)));
17541754 body->list .push_back (
1755- builder.makeSetLocal (y64, I64Utilities::recreateI64 (builder, yl, yh)));
1755+ builder.makeLocalSet (y64, I64Utilities::recreateI64 (builder, yl, yh)));
17561756 body->list .push_back (builder.makeIf (
1757- builder.makeGetLocal (r, i32 ),
1757+ builder.makeLocalGet (r, i32 ),
17581758 builder.makeStore (8 ,
17591759 0 ,
17601760 8 ,
1761- builder.makeGetLocal (r, i32 ),
1761+ builder.makeLocalGet (r, i32 ),
17621762 builder.makeBinary (RemUInt64,
1763- builder.makeGetLocal (x64, i64 ),
1764- builder.makeGetLocal (y64, i64 )),
1763+ builder.makeLocalGet (x64, i64 ),
1764+ builder.makeLocalGet (y64, i64 )),
17651765 i64 )));
17661766 body->list .push_back (
1767- builder.makeSetLocal (x64,
1767+ builder.makeLocalSet (x64,
17681768 builder.makeBinary (DivUInt64,
1769- builder.makeGetLocal (x64, i64 ),
1770- builder.makeGetLocal (y64, i64 ))));
1769+ builder.makeLocalGet (x64, i64 ),
1770+ builder.makeLocalGet (y64, i64 ))));
17711771 body->list .push_back (
1772- builder.makeSetGlobal (tempRet0, I64Utilities::getI64High (builder, x64)));
1772+ builder.makeGlobalSet (tempRet0, I64Utilities::getI64High (builder, x64)));
17731773 body->list .push_back (I64Utilities::getI64Low (builder, x64));
17741774 body->finalize ();
17751775 func->body = body;
@@ -1855,7 +1855,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
18551855 IString name = ast->getIString ();
18561856 if (functionVariables.has (name)) {
18571857 // var in scope
1858- auto ret = allocator.alloc <GetLocal >();
1858+ auto ret = allocator.alloc <LocalGet >();
18591859 ret->index = function->getLocalIndex (name);
18601860 ret->type = asmToWasmType (asmData.getType (name));
18611861 return ret;
@@ -1883,7 +1883,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
18831883 ? true
18841884 : (std::cerr << name.str << ' \n ' , false ));
18851885 MappedGlobal& global = mappedGlobals[name];
1886- return builder.makeGetGlobal (name, global.type );
1886+ return builder.makeGlobalGet (name, global.type );
18871887 }
18881888 if (ast->isNumber ()) {
18891889 auto ret = allocator.alloc <Const>();
@@ -1902,7 +1902,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
19021902 auto * assign = ast->asAssignName ();
19031903 IString name = assign->target ();
19041904 if (functionVariables.has (name)) {
1905- auto ret = allocator.alloc <SetLocal >();
1905+ auto ret = allocator.alloc <LocalSet >();
19061906 ret->index = function->getLocalIndex (assign->target ());
19071907 ret->value = process (assign->value ());
19081908 ret->setTee (false );
@@ -1913,15 +1913,15 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
19131913 if (mappedGlobals.find (name) == mappedGlobals.end ()) {
19141914 Fatal () << " error: access of a non-existent global var " << name.str ;
19151915 }
1916- auto * ret = builder.makeSetGlobal (name, process (assign->value ()));
1916+ auto * ret = builder.makeGlobalSet (name, process (assign->value ()));
19171917 // global.set does not return; if our value is trivially not used, don't
19181918 // emit a load (if nontrivially not used, opts get it later)
19191919 auto parent = astStackHelper.getParent ();
19201920 if (!parent || parent->isArray (BLOCK) || parent->isArray (IF)) {
19211921 return ret;
19221922 }
19231923 return builder.makeSequence (
1924- ret, builder.makeGetGlobal (name, ret->value ->type ));
1924+ ret, builder.makeGlobalGet (name, ret->value ->type ));
19251925 }
19261926 if (ast->isAssign ()) {
19271927 auto * assign = ast->asAssign ();
@@ -2155,13 +2155,13 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
21552155 if (value->type == i32 ) {
21562156 // No wasm support, so use a temp local
21572157 ensureI32Temp ();
2158- auto set = allocator.alloc <SetLocal >();
2158+ auto set = allocator.alloc <LocalSet >();
21592159 set->index = function->getLocalIndex (I32_TEMP);
21602160 set->value = value;
21612161 set->setTee (false );
21622162 set->finalize ();
21632163 auto get = [&]() {
2164- auto ret = allocator.alloc <GetLocal >();
2164+ auto ret = allocator.alloc <LocalGet >();
21652165 ret->index = function->getLocalIndex (I32_TEMP);
21662166 ret->type = i32 ;
21672167 return ret;
@@ -2264,9 +2264,9 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
22642264 view.bytes ,
22652265 0 ,
22662266 processUnshifted (ast[2 ][1 ], view.bytes ),
2267- builder.makeTeeLocal (temp, process (ast[2 ][2 ])),
2267+ builder.makeLocalTee (temp, process (ast[2 ][2 ])),
22682268 type),
2269- builder.makeGetLocal (temp, type));
2269+ builder.makeLocalGet (temp, type));
22702270 } else if (name == Atomics_exchange) {
22712271 return builder.makeAtomicRMW (
22722272 AtomicRMWOp::Xchg,
@@ -3092,7 +3092,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
30923092 // bits, then we can just look at the lower 32 bits
30933093 auto temp = Builder::addVar (function, i64 );
30943094 auto * block = builder.makeBlock ();
3095- block->list .push_back (builder.makeSetLocal (temp, offsetor));
3095+ block->list .push_back (builder.makeLocalSet (temp, offsetor));
30963096 // if high bits, we can break to the default (we'll fill in the name
30973097 // later)
30983098 breakWhenNotMatching = builder.makeBreak (
@@ -3101,10 +3101,10 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
31013101 builder.makeUnary (
31023102 UnaryOp::WrapInt64,
31033103 builder.makeBinary (BinaryOp::ShrUInt64,
3104- builder.makeGetLocal (temp, i64 ),
3104+ builder.makeLocalGet (temp, i64 ),
31053105 builder.makeConst (Literal (int64_t (32 ))))));
31063106 block->list .push_back (breakWhenNotMatching);
3107- block->list .push_back (builder.makeGetLocal (temp, i64 ));
3107+ block->list .push_back (builder.makeLocalGet (temp, i64 ));
31083108 block->finalize ();
31093109 br->condition = builder.makeUnary (UnaryOp::WrapInt64, block);
31103110 }
@@ -3158,7 +3158,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
31583158 } else {
31593159 // we can't switch, make an if-chain instead of br_table
31603160 auto var = Builder::addVar (function, br->condition ->type );
3161- top->list .push_back (builder.makeSetLocal (var, br->condition ));
3161+ top->list .push_back (builder.makeLocalSet (var, br->condition ));
31623162 auto * brHolder = top;
31633163 If* chain = nullptr ;
31643164 If* first = nullptr ;
@@ -3175,7 +3175,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
31753175 name = nameMapper.pushLabelName (" switch-case" );
31763176 auto * iff = builder.makeIf (
31773177 builder.makeBinary (br->condition ->type == i32 ? EqInt32 : EqInt64,
3178- builder.makeGetLocal (var, br->condition ->type ),
3178+ builder.makeLocalGet (var, br->condition ->type ),
31793179 builder.makeConst (getLiteral (condition))),
31803180 builder.makeBreak (name),
31813181 chain);
0 commit comments