mirror of
https://github.com/python/cpython.git
synced 2025-10-16 19:57:59 +00:00
GH-111485: Increment next_instr
consistently at the start of the instruction. (GH-111486)
This commit is contained in:
parent
e3353c498d
commit
d27acd4461
11 changed files with 1079 additions and 521 deletions
|
@ -61,6 +61,7 @@ class Instruction:
|
|||
# Computed by constructor
|
||||
always_exits: str # If the block always exits, its last line; else ""
|
||||
has_deopt: bool
|
||||
needs_this_instr: bool
|
||||
cache_offset: int
|
||||
cache_effects: list[parsing.CacheEffect]
|
||||
input_effects: list[StackEffect]
|
||||
|
@ -87,6 +88,7 @@ class Instruction:
|
|||
effect for effect in inst.inputs if isinstance(effect, parsing.CacheEffect)
|
||||
]
|
||||
self.cache_offset = sum(c.size for c in self.cache_effects)
|
||||
self.needs_this_instr = variable_used(self.inst, "this_instr") or any(c.name != UNUSED for c in self.cache_effects)
|
||||
self.input_effects = [
|
||||
effect for effect in inst.inputs if isinstance(effect, StackEffect)
|
||||
]
|
||||
|
@ -164,7 +166,8 @@ class Instruction:
|
|||
func = f"read_u{bits}"
|
||||
if tier == TIER_ONE:
|
||||
out.emit(
|
||||
f"{typ}{ceffect.name} = {func}(&next_instr[{active.offset}].cache);"
|
||||
f"{typ}{ceffect.name} = "
|
||||
f"{func}(&this_instr[{active.offset + 1}].cache);"
|
||||
)
|
||||
else:
|
||||
out.emit(f"{typ}{ceffect.name} = ({typ.strip()})operand;")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue