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

Function apply_stack_effect

Tools/cases_generator/stack.py:417–429  ·  view source on GitHub ↗
(stack: Stack, effect: StackEffect)

Source from the content-addressed store, hash-verified

415
416
417def apply_stack_effect(stack: Stack, effect: StackEffect) -> None:
418 locals: dict[str, Local] = {}
419 null = CWriter.null()
420 for var in reversed(effect.inputs):
421 local = stack.pop(var, null)
422 if var.name != "unused":
423 locals[local.name] = local
424 for var in effect.outputs:
425 if var.name in locals:
426 local = locals[var.name]
427 else:
428 local = Local.unused(var, None)
429 stack.push(local)
430
431
432def get_stack_effect(inst: Instruction | PseudoInstruction) -> Stack:

Callers 1

get_stack_effectFunction · 0.85

Calls 4

unusedMethod · 0.80
nullMethod · 0.45
popMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…