-
Notifications
You must be signed in to change notification settings - Fork 25
[CRC] add docstring for opcode executor #212
Conversation
Thanks for your contribution! |
@@ -205,9 +283,18 @@ def inner(self: OpcodeExecutorBase, instr: Instruction): | |||
|
|||
|
|||
def jump_break_graph_decorator(normal_jump): | |||
"""breakoff graph when meet jump.""" | |||
""" | |||
A decorator function that breaks off the graph when a jump instruction is encountered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A decorator function that breaks off the graph when a jump instruction is encountered. | |
A decorator function that breaks off the graph when a JUMP-related instruction is encountered. |
def decorate(call_fn): | ||
def call_break_graph_decorator(push_n: int): | ||
""" | ||
A decorator function that breaks off the graph when a function call instruction is encountered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A decorator function that breaks off the graph when a function call instruction is encountered. | |
A decorator function that breaks off the graph when a function CALL instruction is encountered. |
|
||
The OpcodeExecutorBase class provides methods and functionality to execute opcode instructions. | ||
|
||
If you want to learn more about Python instructions, you can visit https://docs.python.org/3/library/dis.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to learn more about Python instructions, you can visit https://docs.python.org/3/library/dis.html | |
If you want to learn more about Python instructions, see https://docs.python.org/3/library/dis.html for details. |
raise NotImplementedError() | ||
|
||
def transform(self): | ||
""" | ||
Transforms the executor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Transforms the executor. | |
Abstract method need to be implemented to symbolic translate each instruction. |
self, origin_stack: list[VariableBase], instr: Instruction, push_n: int | ||
): | ||
""" | ||
Break the graph at a call instruction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Break the graph at a call instruction. | |
Break the graph at a CALL instruction. |
def _break_graph_in_jump(self, result, instr): | ||
def _break_graph_in_jump(self, result: VariableBase, instr: Instruction): | ||
""" | ||
Break the graph at a jump instruction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Break the graph at a jump instruction. | |
Break the graph at a JUMP instruction. |
def _break_graph_in_jump(self, result, instr): | ||
def _break_graph_in_jump(self, result, instr: Instruction): | ||
""" | ||
Breaks the graph in jump instructions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaks the graph in jump instructions. | |
Breaks the graph in JUMP instructions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,已全部修改
Co-authored-by: Nyakku Shigure <sigure.qaq@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM~
No description provided.