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

Method for_uop

Tools/cases_generator/stack.py:550–569  ·  view source on GitHub ↗
(stack: Stack, uop: Uop, out: CWriter, check_liveness: bool = True)

Source from the content-addressed store, hash-verified

548
549 @staticmethod
550 def for_uop(stack: Stack, uop: Uop, out: CWriter, check_liveness: bool = True) -> "Storage":
551 inputs: list[Local] = []
552 peeks: list[Local] = []
553 for input in reversed(uop.stack.inputs):
554 local = stack.pop(input, out)
555 if input.peek:
556 peeks.append(local)
557 inputs.append(local)
558 inputs.reverse()
559 peeks.reverse()
560 offset = stack.logical_sp - stack.physical_sp
561 for ouput in uop.stack.outputs:
562 if ouput.is_array() and ouput.used and not ouput.peek:
563 c_offset = offset.to_c()
564 out.emit(f"{ouput.name} = &stack_pointer[{c_offset}];\n")
565 offset = offset.push(ouput)
566 for var in inputs:
567 stack.push(var)
568 outputs = peeks + [ Local.undefined(var) for var in uop.stack.outputs if not var.peek ]
569 return Storage(stack, inputs, outputs, len(peeks), check_liveness)
570
571 @staticmethod
572 def copy_list(arg: list[Local]) -> list[Local]:

Callers 4

write_uopFunction · 0.80
write_uopFunction · 0.80
write_uopFunction · 0.80

Calls 9

StorageClass · 0.85
to_cMethod · 0.80
undefinedMethod · 0.80
popMethod · 0.45
appendMethod · 0.45
reverseMethod · 0.45
is_arrayMethod · 0.45
emitMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected