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

Method exit_if

Tools/cases_generator/tier2_generator.py:82–103  ·  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

80 return "JUMP_TO_ERROR();"
81
82 def exit_if(
83 self,
84 tkn: Token,
85 tkn_iter: TokenIterator,
86 uop: CodeSection,
87 storage: Storage,
88 inst: Instruction | None,
89 ) -> bool:
90 self.out.emit_at("if ", tkn)
91 lparen = next(tkn_iter)
92 self.emit(lparen)
93 first_tkn = tkn_iter.peek()
94 emit_to(self.out, tkn_iter, "RPAREN")
95 next(tkn_iter) # Semi colon
96 self.emit(") {\n")
97 self.emit("UOP_STAT_INC(uopcode, miss);\n")
98 storage = storage.copy()
99 self.cache_items(storage.stack, self.exit_cache_depth, False)
100 storage.stack.flush(self.out)
101 self.emit("JUMP_TO_JUMP_TARGET();\n")
102 self.emit("}\n")
103 return not always_true(first_tkn)
104
105 periodic_if = deopt_if = exit_if
106

Callers 1

exit_if_afterMethod · 0.80

Calls 8

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

Tested by

no test coverage detected