|
@@ -62,7 +62,27 @@ MISC_INTRINSICS = {
|
|
|
lambda e:
|
|
|
tree_ir.LoadIndexInstruction(
|
|
|
tree_ir.ReadEdgeInstruction(e),
|
|
|
- tree_ir.LiteralInstruction(1))
|
|
|
+ tree_ir.LiteralInstruction(1)),
|
|
|
+ 'is_edge' :
|
|
|
+ lambda e:
|
|
|
+ tree_ir.CreateNodeWithValueInstruction(
|
|
|
+ tree_ir.BinaryInstruction(
|
|
|
+ tree_ir.LoadIndexInstruction(
|
|
|
+ tree_ir.ReadEdgeInstruction(e),
|
|
|
+ tree_ir.LiteralInstruction(0)),
|
|
|
+ 'is not',
|
|
|
+ tree_ir.LiteralInstruction(None))),
|
|
|
+
|
|
|
+ # Dictionary operations
|
|
|
+ 'dict_read' :
|
|
|
+ lambda dict_node, key:
|
|
|
+ tree_ir.ReadDictionaryValueInstruction(
|
|
|
+ dict_node, tree_ir.ReadValueInstruction(key)),
|
|
|
+
|
|
|
+ 'dict_read_edge' :
|
|
|
+ lambda dict_node, key:
|
|
|
+ tree_ir.ReadDictionaryEdgeInstruction(
|
|
|
+ dict_node, tree_ir.ReadValueInstruction(key))
|
|
|
}
|
|
|
|
|
|
def register_intrinsics(target_jit):
|