| ... | ... | @@ -235,7 +235,6 @@ const Op = enum { |
| 235 | 235 | br_table, |
| 236 | 236 | @"return", |
| 237 | 237 | call, |
| 238 | | call_indirect, |
| 239 | 238 | drop, |
| 240 | 239 | select, |
| 241 | 240 | global_get, |
| ... | ... | @@ -313,7 +312,6 @@ fn buildOpcode(args: OpcodeBuildArguments) std.wasm.Opcode { |
| 313 | 312 | .br_table => unreachable, |
| 314 | 313 | .@"return" => unreachable, |
| 315 | 314 | .call => unreachable, |
| 316 | | .call_indirect => unreachable, |
| 317 | 315 | .drop => unreachable, |
| 318 | 316 | .select => unreachable, |
| 319 | 317 | .global_get => unreachable, |
| ... | ... | @@ -873,6 +871,10 @@ fn addLocal(cg: *CodeGen, tag: Mir.Inst.Tag, local: u32) error{OutOfMemory}!void |
| 873 | 871 | try cg.addInst(.{ .tag = tag, .data = .{ .local = local } }); |
| 874 | 872 | } |
| 875 | 873 | |
| 874 | fn addFuncTy(cg: *CodeGen, tag: Mir.Inst.Tag, i: Wasm.FunctionType.Index) error{OutOfMemory}!void { |
| 875 | try cg.addInst(.{ .tag = tag, .data = .{ .func_ty = i } }); |
| 876 | } |
| 877 | |
| 876 | 878 | /// Accepts an unsigned 32bit integer rather than a signed integer to |
| 877 | 879 | /// prevent us from having to bitcast multiple times as most values |
| 878 | 880 | /// within codegen are represented as unsigned rather than signed. |
| ... | ... | @@ -2211,7 +2213,7 @@ fn airCall(cg: *CodeGen, inst: Air.Inst.Index, modifier: std.builtin.CallModifie |
| 2211 | 2213 | try cg.emitWValue(operand); |
| 2212 | 2214 | |
| 2213 | 2215 | const fn_type_index = try wasm.internFunctionType(fn_info.cc, fn_info.param_types.get(ip), .fromInterned(fn_info.return_type), cg.target); |
| 2214 | | try cg.addLabel(.call_indirect, @intFromEnum(fn_type_index)); |
| 2216 | try cg.addFuncTy(.call_indirect, fn_type_index); |
| 2215 | 2217 | } |
| 2216 | 2218 | |
| 2217 | 2219 | const result_value = result_value: { |