@@ -1025,7 +1025,7 @@ void Asm2WasmBuilder::processAsm(Ref ast) {
1025
1025
wasm.addGlobal (
1026
1026
builder.makeGlobal (name,
1027
1027
type,
1028
- builder.makeGetGlobal (import ->name , type),
1028
+ builder.makeGlobalGet (import ->name , type),
1029
1029
Builder::Mutable));
1030
1030
}
1031
1031
}
@@ -1262,7 +1262,7 @@ void Asm2WasmBuilder::processAsm(Ref ast) {
1262
1262
// when function pointer casts are emulated.
1263
1263
if (wasm.table .segments .size () == 0 ) {
1264
1264
wasm.table .segments .emplace_back (
1265
- builder.makeGetGlobal (Name (TABLE_BASE), i32 ));
1265
+ builder.makeGlobalGet (Name (TABLE_BASE), i32 ));
1266
1266
}
1267
1267
auto & segment = wasm.table .segments [0 ];
1268
1268
functionTableStarts[name] =
@@ -1290,7 +1290,7 @@ void Asm2WasmBuilder::processAsm(Ref ast) {
1290
1290
IString value = pair[1 ]->getIString ();
1291
1291
if (key == Name (" _emscripten_replace_memory" )) {
1292
1292
// 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 )
1294
1294
assert (!wasm.getFunctionOrNull (value));
1295
1295
continue ;
1296
1296
} else if (key == UDIVMODDI4) {
@@ -1732,7 +1732,7 @@ void Asm2WasmBuilder::processAsm(Ref ast) {
1732
1732
if (curr->is <Return>()) {
1733
1733
curr = curr->cast <Return>()->value ;
1734
1734
}
1735
- auto * get = curr->cast <GetGlobal >();
1735
+ auto * get = curr->cast <GlobalGet >();
1736
1736
tempRet0 = get->name ;
1737
1737
}
1738
1738
// udivmoddi4 receives xl, xh, yl, yl, r, and
@@ -1750,26 +1750,26 @@ void Asm2WasmBuilder::processAsm(Ref ast) {
1750
1750
y64 = Builder::addVar (func, " y64" , i64 );
1751
1751
auto * body = allocator.alloc <Block>();
1752
1752
body->list .push_back (
1753
- builder.makeSetLocal (x64, I64Utilities::recreateI64 (builder, xl, xh)));
1753
+ builder.makeLocalSet (x64, I64Utilities::recreateI64 (builder, xl, xh)));
1754
1754
body->list .push_back (
1755
- builder.makeSetLocal (y64, I64Utilities::recreateI64 (builder, yl, yh)));
1755
+ builder.makeLocalSet (y64, I64Utilities::recreateI64 (builder, yl, yh)));
1756
1756
body->list .push_back (builder.makeIf (
1757
- builder.makeGetLocal (r, i32 ),
1757
+ builder.makeLocalGet (r, i32 ),
1758
1758
builder.makeStore (8 ,
1759
1759
0 ,
1760
1760
8 ,
1761
- builder.makeGetLocal (r, i32 ),
1761
+ builder.makeLocalGet (r, i32 ),
1762
1762
builder.makeBinary (RemUInt64,
1763
- builder.makeGetLocal (x64, i64 ),
1764
- builder.makeGetLocal (y64, i64 )),
1763
+ builder.makeLocalGet (x64, i64 ),
1764
+ builder.makeLocalGet (y64, i64 )),
1765
1765
i64 )));
1766
1766
body->list .push_back (
1767
- builder.makeSetLocal (x64,
1767
+ builder.makeLocalSet (x64,
1768
1768
builder.makeBinary (DivUInt64,
1769
- builder.makeGetLocal (x64, i64 ),
1770
- builder.makeGetLocal (y64, i64 ))));
1769
+ builder.makeLocalGet (x64, i64 ),
1770
+ builder.makeLocalGet (y64, i64 ))));
1771
1771
body->list .push_back (
1772
- builder.makeSetGlobal (tempRet0, I64Utilities::getI64High (builder, x64)));
1772
+ builder.makeGlobalSet (tempRet0, I64Utilities::getI64High (builder, x64)));
1773
1773
body->list .push_back (I64Utilities::getI64Low (builder, x64));
1774
1774
body->finalize ();
1775
1775
func->body = body;
@@ -1855,7 +1855,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
1855
1855
IString name = ast->getIString ();
1856
1856
if (functionVariables.has (name)) {
1857
1857
// var in scope
1858
- auto ret = allocator.alloc <GetLocal >();
1858
+ auto ret = allocator.alloc <LocalGet >();
1859
1859
ret->index = function->getLocalIndex (name);
1860
1860
ret->type = asmToWasmType (asmData.getType (name));
1861
1861
return ret;
@@ -1883,7 +1883,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
1883
1883
? true
1884
1884
: (std::cerr << name.str << ' \n ' , false ));
1885
1885
MappedGlobal& global = mappedGlobals[name];
1886
- return builder.makeGetGlobal (name, global.type );
1886
+ return builder.makeGlobalGet (name, global.type );
1887
1887
}
1888
1888
if (ast->isNumber ()) {
1889
1889
auto ret = allocator.alloc <Const>();
@@ -1902,7 +1902,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
1902
1902
auto * assign = ast->asAssignName ();
1903
1903
IString name = assign->target ();
1904
1904
if (functionVariables.has (name)) {
1905
- auto ret = allocator.alloc <SetLocal >();
1905
+ auto ret = allocator.alloc <LocalSet >();
1906
1906
ret->index = function->getLocalIndex (assign->target ());
1907
1907
ret->value = process (assign->value ());
1908
1908
ret->setTee (false );
@@ -1913,15 +1913,15 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
1913
1913
if (mappedGlobals.find (name) == mappedGlobals.end ()) {
1914
1914
Fatal () << " error: access of a non-existent global var " << name.str ;
1915
1915
}
1916
- auto * ret = builder.makeSetGlobal (name, process (assign->value ()));
1916
+ auto * ret = builder.makeGlobalSet (name, process (assign->value ()));
1917
1917
// global.set does not return; if our value is trivially not used, don't
1918
1918
// emit a load (if nontrivially not used, opts get it later)
1919
1919
auto parent = astStackHelper.getParent ();
1920
1920
if (!parent || parent->isArray (BLOCK) || parent->isArray (IF)) {
1921
1921
return ret;
1922
1922
}
1923
1923
return builder.makeSequence (
1924
- ret, builder.makeGetGlobal (name, ret->value ->type ));
1924
+ ret, builder.makeGlobalGet (name, ret->value ->type ));
1925
1925
}
1926
1926
if (ast->isAssign ()) {
1927
1927
auto * assign = ast->asAssign ();
@@ -2155,13 +2155,13 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
2155
2155
if (value->type == i32 ) {
2156
2156
// No wasm support, so use a temp local
2157
2157
ensureI32Temp ();
2158
- auto set = allocator.alloc <SetLocal >();
2158
+ auto set = allocator.alloc <LocalSet >();
2159
2159
set->index = function->getLocalIndex (I32_TEMP);
2160
2160
set->value = value;
2161
2161
set->setTee (false );
2162
2162
set->finalize ();
2163
2163
auto get = [&]() {
2164
- auto ret = allocator.alloc <GetLocal >();
2164
+ auto ret = allocator.alloc <LocalGet >();
2165
2165
ret->index = function->getLocalIndex (I32_TEMP);
2166
2166
ret->type = i32 ;
2167
2167
return ret;
@@ -2264,9 +2264,9 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
2264
2264
view.bytes ,
2265
2265
0 ,
2266
2266
processUnshifted (ast[2 ][1 ], view.bytes ),
2267
- builder.makeTeeLocal (temp, process (ast[2 ][2 ])),
2267
+ builder.makeLocalTee (temp, process (ast[2 ][2 ])),
2268
2268
type),
2269
- builder.makeGetLocal (temp, type));
2269
+ builder.makeLocalGet (temp, type));
2270
2270
} else if (name == Atomics_exchange) {
2271
2271
return builder.makeAtomicRMW (
2272
2272
AtomicRMWOp::Xchg,
@@ -3092,7 +3092,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
3092
3092
// bits, then we can just look at the lower 32 bits
3093
3093
auto temp = Builder::addVar (function, i64 );
3094
3094
auto * block = builder.makeBlock ();
3095
- block->list .push_back (builder.makeSetLocal (temp, offsetor));
3095
+ block->list .push_back (builder.makeLocalSet (temp, offsetor));
3096
3096
// if high bits, we can break to the default (we'll fill in the name
3097
3097
// later)
3098
3098
breakWhenNotMatching = builder.makeBreak (
@@ -3101,10 +3101,10 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
3101
3101
builder.makeUnary (
3102
3102
UnaryOp::WrapInt64,
3103
3103
builder.makeBinary (BinaryOp::ShrUInt64,
3104
- builder.makeGetLocal (temp, i64 ),
3104
+ builder.makeLocalGet (temp, i64 ),
3105
3105
builder.makeConst (Literal (int64_t (32 ))))));
3106
3106
block->list .push_back (breakWhenNotMatching);
3107
- block->list .push_back (builder.makeGetLocal (temp, i64 ));
3107
+ block->list .push_back (builder.makeLocalGet (temp, i64 ));
3108
3108
block->finalize ();
3109
3109
br->condition = builder.makeUnary (UnaryOp::WrapInt64, block);
3110
3110
}
@@ -3158,7 +3158,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
3158
3158
} else {
3159
3159
// we can't switch, make an if-chain instead of br_table
3160
3160
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 ));
3162
3162
auto * brHolder = top;
3163
3163
If* chain = nullptr ;
3164
3164
If* first = nullptr ;
@@ -3175,7 +3175,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
3175
3175
name = nameMapper.pushLabelName (" switch-case" );
3176
3176
auto * iff = builder.makeIf (
3177
3177
builder.makeBinary (br->condition ->type == i32 ? EqInt32 : EqInt64,
3178
- builder.makeGetLocal (var, br->condition ->type ),
3178
+ builder.makeLocalGet (var, br->condition ->type ),
3179
3179
builder.makeConst (getLiteral (condition))),
3180
3180
builder.makeBreak (name),
3181
3181
chain);
0 commit comments