|
@@ -510,6 +510,9 @@ NOP_MACRO_NAME = 'nop'
|
|
|
READ_DICT_KEYS_MACRO_NAME = 'read_dict_keys'
|
|
|
"""The name of the macro that reads all keys from a dictionary."""
|
|
|
|
|
|
+READ_OUTGOING_EDGES_MACRO_NAME = 'read_outgoing_edges'
|
|
|
+"""The name of the macro that reads a node's outgoing edges as a list."""
|
|
|
+
|
|
|
REVERSE_LIST_MACRO_NAME = 'reverse_list'
|
|
|
"""The name of the list reversal macro."""
|
|
|
|
|
@@ -939,6 +942,14 @@ def create_pure_simple_call(target_name, argument):
|
|
|
calling_convention=SIMPLE_POSITIONAL_CALLING_CONVENTION,
|
|
|
has_value=True, has_side_effects=False)
|
|
|
|
|
|
+def create_read_outgoing_edges(source_node):
|
|
|
+ """Creates a call that reads all of the given source node's outgoing edges."""
|
|
|
+ return DirectFunctionCall(
|
|
|
+ READ_OUTGOING_EDGES_MACRO_NAME,
|
|
|
+ [('source_node', source_node)],
|
|
|
+ calling_convention=MACRO_POSITIONAL_CALLING_CONVENTION,
|
|
|
+ has_value=True, has_side_effects=False)
|
|
|
+
|
|
|
def create_gc_protect(protected_value, root):
|
|
|
"""Creates a value that protects the first from the GC by drawing an
|
|
|
edge between it and the given root."""
|