unbox(type, src) This is similar to a cast, but it also changes to a (potentially) unboxed runtime representation. Only supported for types with an unboxed representation.
| 1183 | |
| 1184 | @final |
| 1185 | class Unbox(RegisterOp): |
| 1186 | """unbox(type, src) |
| 1187 | |
| 1188 | This is similar to a cast, but it also changes to a (potentially) unboxed runtime |
| 1189 | representation. Only supported for types with an unboxed representation. |
| 1190 | """ |
| 1191 | |
| 1192 | def __init__(self, src: Value, typ: RType, line: int) -> None: |
| 1193 | self.src = src |
| 1194 | self.type = typ |
| 1195 | if not typ.error_overlap: |
| 1196 | self.error_kind = ERR_MAGIC |
| 1197 | else: |
| 1198 | self.error_kind = ERR_MAGIC_OVERLAPPING |
| 1199 | super().__init__(line) |
| 1200 | |
| 1201 | def sources(self) -> list[Value]: |
| 1202 | return [self.src] |
| 1203 | |
| 1204 | def set_sources(self, new: list[Value]) -> None: |
| 1205 | (self.src,) = new |
| 1206 | |
| 1207 | def accept(self, visitor: OpVisitor[T]) -> T: |
| 1208 | return visitor.visit_unbox(self) |
| 1209 | |
| 1210 | |
| 1211 | @final |
no outgoing calls
searching dependent graphs…