| ... | @@ -866,6 +866,7 @@ pub const Context = struct { | ... | @@ -866,6 +866,7 @@ pub const Context = struct { |
| 866 | .struct_field_ptr_index_1 => self.airStructFieldPtrIndex(inst, 1), | 866 | .struct_field_ptr_index_1 => self.airStructFieldPtrIndex(inst, 1), |
| 867 | .struct_field_ptr_index_2 => self.airStructFieldPtrIndex(inst, 2), | 867 | .struct_field_ptr_index_2 => self.airStructFieldPtrIndex(inst, 2), |
| 868 | .struct_field_ptr_index_3 => self.airStructFieldPtrIndex(inst, 3), | 868 | .struct_field_ptr_index_3 => self.airStructFieldPtrIndex(inst, 3), |
| | 869 | .struct_field_val => self.airStructFieldVal(inst), |
| 869 | .switch_br => self.airSwitchBr(inst), | 870 | .switch_br => self.airSwitchBr(inst), |
| 870 | .unreach => self.airUnreachable(inst), | 871 | .unreach => self.airUnreachable(inst), |
| 871 | .wrap_optional => self.airWrapOptional(inst), | 872 | .wrap_optional => self.airWrapOptional(inst), |
| ... | @@ -1456,6 +1457,15 @@ pub const Context = struct { | ... | @@ -1456,6 +1457,15 @@ pub const Context = struct { |
| 1456 | return WValue{ .local = struct_ptr.multi_value.index + index }; | 1457 | return WValue{ .local = struct_ptr.multi_value.index + index }; |
| 1457 | } | 1458 | } |
| 1458 | | 1459 | |
| | 1460 | fn airStructFieldVal(self: *Context, inst: Air.Inst.Index) InnerError!WValue { |
| | 1461 | if (self.liveness.isUnused(inst)) return WValue.none; |
| | 1462 | |
| | 1463 | const ty_pl = self.air.instructions.items(.data)[inst].ty_pl; |
| | 1464 | const extra = self.air.extraData(Air.StructField, ty_pl.payload).data; |
| | 1465 | const struct_multivalue = self.resolveInst(extra.struct_operand).multi_value; |
| | 1466 | return WValue{ .local = struct_multivalue.index + extra.field_index }; |
| | 1467 | } |
| | 1468 | |
| 1459 | fn airSwitchBr(self: *Context, inst: Air.Inst.Index) InnerError!WValue { | 1469 | fn airSwitchBr(self: *Context, inst: Air.Inst.Index) InnerError!WValue { |
| 1460 | // result type is always 'noreturn' | 1470 | // result type is always 'noreturn' |
| 1461 | const blocktype = wasm.block_empty; | 1471 | const blocktype = wasm.block_empty; |