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