(self, stack: Stack, cached_items: int, zero_regs: bool)
| 190 | return not always_true(first_tkn) |
| 191 | |
| 192 | def cache_items(self, stack: Stack, cached_items: int, zero_regs: bool) -> None: |
| 193 | self.out.start_line() |
| 194 | i = cached_items |
| 195 | while i > 0: |
| 196 | self.out.start_line() |
| 197 | item = StackItem(f"_tos_cache{i-1}", "", False, True) |
| 198 | stack.pop(item, self.out) |
| 199 | i -= 1 |
| 200 | if zero_regs: |
| 201 | # TO DO -- For compilers that support it, |
| 202 | # replace this with a "clobber" to tell |
| 203 | # the compiler that these values are unused |
| 204 | # without having to emit any code. |
| 205 | for i in range(cached_items, MAX_CACHED_REGISTER): |
| 206 | self.out.emit(f"_tos_cache{i} = PyStackRef_ZERO_BITS;\n") |
| 207 | self.emit(f"SET_CURRENT_CACHED_VALUES({cached_items});\n") |
| 208 | |
| 209 | |
| 210 | def write_uop(uop: Uop, emitter: Tier2Emitter, stack: Stack, cached_items: int = 0) -> tuple[bool, Stack]: |
no test coverage detected