@@ -212,7 +212,7 @@ class X64Visitor : public WASMDecoder<X64Visitor>,
212
212
213
213
void visit_GlobalGet (uint32_t globalidx) {
214
214
std::string loc = " global_" + std::to_string (globalidx);
215
- std::string var_type = var_type_to_string[ globals[globalidx].type ] ;
215
+ std::string var_type = vt2s ( globals[globalidx].type ) ;
216
216
217
217
X64Reg base = X64Reg::rbx;
218
218
m_a.asm_mov_r64_label (X64Reg::rbx, loc);
@@ -235,7 +235,7 @@ class X64Visitor : public WASMDecoder<X64Visitor>,
235
235
}
236
236
237
237
std::string loc = " global_" + std::to_string (globalidx);
238
- std::string var_type = var_type_to_string[ globals[globalidx].type ] ;
238
+ std::string var_type = vt2s ( globals[globalidx].type ) ;
239
239
240
240
X64Reg base = X64Reg::rbx;
241
241
m_a.asm_mov_r64_label (X64Reg::rbx, loc);
@@ -257,7 +257,7 @@ class X64Visitor : public WASMDecoder<X64Visitor>,
257
257
auto cur_func_param_type = func_types[type_indices[cur_func_idx]];
258
258
int no_of_params = (int )cur_func_param_type.param_types .size ();
259
259
if ((int )localidx < no_of_params) {
260
- std::string var_type = var_type_to_string[ cur_func_param_type.param_types [localidx]] ;
260
+ std::string var_type = vt2s ( cur_func_param_type.param_types [localidx]) ;
261
261
if (var_type == " i32" || var_type == " i64" ) {
262
262
m_a.asm_mov_r64_m64 (X64Reg::rax, &base, nullptr , 1 , 8 * (2 + no_of_params - (int )localidx - 1 ));
263
263
m_a.asm_push_r64 (X64Reg::rax);
@@ -271,7 +271,7 @@ class X64Visitor : public WASMDecoder<X64Visitor>,
271
271
}
272
272
} else {
273
273
localidx -= no_of_params;
274
- std::string var_type = var_type_to_string[ codes[cur_func_idx].locals [localidx].type ] ;
274
+ std::string var_type = vt2s ( codes[cur_func_idx].locals [localidx].type ) ;
275
275
if (var_type == " i32" || var_type == " i64" ) {
276
276
m_a.asm_mov_r64_m64 (X64Reg::rax, &base, nullptr , 1 , -8 * (1 + (int )localidx));
277
277
m_a.asm_push_r64 (X64Reg::rax);
@@ -291,7 +291,7 @@ class X64Visitor : public WASMDecoder<X64Visitor>,
291
291
auto cur_func_param_type = func_types[type_indices[cur_func_idx]];
292
292
int no_of_params = (int )cur_func_param_type.param_types .size ();
293
293
if ((int )localidx < no_of_params) {
294
- std::string var_type = var_type_to_string[ cur_func_param_type.param_types [localidx]] ;
294
+ std::string var_type = vt2s ( cur_func_param_type.param_types [localidx]) ;
295
295
if (var_type == " i32" || var_type == " i64" ) {
296
296
m_a.asm_pop_r64 (X64Reg::rax);
297
297
m_a.asm_mov_m64_r64 (&base, nullptr , 1 , 8 * (2 + no_of_params - (int )localidx - 1 ), X64Reg::rax);
@@ -305,7 +305,7 @@ class X64Visitor : public WASMDecoder<X64Visitor>,
305
305
}
306
306
} else {
307
307
localidx -= no_of_params;
308
- std::string var_type = var_type_to_string[ codes[cur_func_idx].locals [localidx].type ] ;
308
+ std::string var_type = vt2s ( codes[cur_func_idx].locals [localidx].type ) ;
309
309
if (var_type == " i32" || var_type == " i64" ) {
310
310
m_a.asm_pop_r64 (X64Reg::rax);
311
311
m_a.asm_mov_m64_r64 (&base, nullptr , 1 , -8 * (1 + (int )localidx), X64Reg::rax);
0 commit comments