MCPcopy Index your code
hub / github.com/python/cpython / exit_if_after

Method exit_if_after

Tools/cases_generator/tier2_generator.py:168–190  ·  view source on GitHub ↗
(
        self,
        tkn: Token,
        tkn_iter: TokenIterator,
        uop: CodeSection,
        storage: Storage,
        inst: Instruction | None,
    )

Source from the content-addressed store, hash-verified

166 goto_tier_one = tier2_to_tier2
167
168 def exit_if_after(
169 self,
170 tkn: Token,
171 tkn_iter: TokenIterator,
172 uop: CodeSection,
173 storage: Storage,
174 inst: Instruction | None,
175 ) -> bool:
176 self.out.emit_at("if ", tkn)
177 lparen = next(tkn_iter)
178 self.emit(lparen)
179 first_tkn = tkn_iter.peek()
180 emit_to(self.out, tkn_iter, "RPAREN")
181 next(tkn_iter) # Semi colon
182 self.emit(") {\n")
183 self.emit("UOP_STAT_INC(uopcode, miss);\n")
184 storage = storage.copy()
185 storage.clear_inputs("in AT_END_EXIT_IF")
186 self.cache_items(storage.stack, self.exit_cache_depth, False)
187 storage.flush(self.out)
188 self.emit("JUMP_TO_JUMP_TARGET();\n")
189 self.emit("}\n")
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()

Callers

nothing calls this directly

Calls 9

cache_itemsMethod · 0.95
emit_toFunction · 0.90
always_trueFunction · 0.90
emit_atMethod · 0.80
clear_inputsMethod · 0.80
emitMethod · 0.45
peekMethod · 0.45
copyMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected