| 17 | |
| 18 | @dataclass |
| 19 | class Properties: |
| 20 | escaping_calls: dict[SimpleStmt, EscapingCall] |
| 21 | escapes: bool |
| 22 | error_with_pop: bool |
| 23 | error_without_pop: bool |
| 24 | deopts: bool |
| 25 | deopts_periodic: bool |
| 26 | oparg: bool |
| 27 | jumps: bool |
| 28 | eval_breaker: bool |
| 29 | needs_this: bool |
| 30 | always_exits: bool |
| 31 | sync_sp: bool |
| 32 | uses_co_consts: bool |
| 33 | uses_co_names: bool |
| 34 | uses_locals: bool |
| 35 | has_free: bool |
| 36 | side_exit: bool |
| 37 | side_exit_at_end: bool |
| 38 | pure: bool |
| 39 | uses_opcode: bool |
| 40 | needs_guard_ip: bool |
| 41 | unpredictable_jump: bool |
| 42 | records_value: bool |
| 43 | tier: int | None = None |
| 44 | const_oparg: int = -1 |
| 45 | needs_prev: bool = False |
| 46 | no_save_ip: bool = False |
| 47 | |
| 48 | def dump(self, indent: str) -> None: |
| 49 | simple_properties = self.__dict__.copy() |
| 50 | del simple_properties["escaping_calls"] |
| 51 | text = "escaping_calls:\n" |
| 52 | for tkns in self.escaping_calls.values(): |
| 53 | text += f"{indent} {tkns}\n" |
| 54 | text += ", ".join([f"{key}: {value}" for (key, value) in simple_properties.items()]) |
| 55 | print(indent, text, sep="") |
| 56 | |
| 57 | @staticmethod |
| 58 | def from_list(properties: list["Properties"]) -> "Properties": |
| 59 | escaping_calls: dict[SimpleStmt, EscapingCall] = {} |
| 60 | for p in properties: |
| 61 | escaping_calls.update(p.escaping_calls) |
| 62 | return Properties( |
| 63 | escaping_calls=escaping_calls, |
| 64 | escapes = any(p.escapes for p in properties), |
| 65 | error_with_pop=any(p.error_with_pop for p in properties), |
| 66 | error_without_pop=any(p.error_without_pop for p in properties), |
| 67 | deopts=any(p.deopts for p in properties), |
| 68 | deopts_periodic=any(p.deopts_periodic for p in properties), |
| 69 | oparg=any(p.oparg for p in properties), |
| 70 | jumps=any(p.jumps for p in properties), |
| 71 | eval_breaker=any(p.eval_breaker for p in properties), |
| 72 | needs_this=any(p.needs_this for p in properties), |
| 73 | always_exits=any(p.always_exits for p in properties), |
| 74 | sync_sp=any(p.sync_sp for p in properties), |
| 75 | uses_co_consts=any(p.uses_co_consts for p in properties), |
| 76 | uses_co_names=any(p.uses_co_names for p in properties), |
no outgoing calls
no test coverage detected
searching dependent graphs…