|
@@ -180,6 +180,19 @@ class ModelverseKernel(object):
|
|
getattr(source, function_names[i]),
|
|
getattr(source, function_names[i]),
|
|
function_names[i])
|
|
function_names[i])
|
|
|
|
|
|
|
|
+ def read_function(self, inst):
|
|
|
|
+ initial_instruction = inst
|
|
|
|
+ suggested_name = self.jit.get_global_name(inst)
|
|
|
|
+
|
|
|
|
+ (_, _, is_mutable), = yield [("CALL_ARGS", [self.jit.jit_signature, (inst,)])]
|
|
|
|
+ if suggested_name is None or is_mutable:
|
|
|
|
+ print("Ignoring mutable or unreadable: %s" % suggested_name)
|
|
|
|
+ raise jit.JitCompilationFailedException("FAIL")
|
|
|
|
+
|
|
|
|
+ print("Reading function: %s" % suggested_name)
|
|
|
|
+ inst_type, = yield [("RV", [inst])]
|
|
|
|
+ print(" %s (%s)" % (inst, inst_type["value"]))
|
|
|
|
+
|
|
def jit_compile(self, task_root, inst):
|
|
def jit_compile(self, task_root, inst):
|
|
# Try to retrieve the suggested name.
|
|
# Try to retrieve the suggested name.
|
|
suggested_name = self.jit.get_global_name(inst)
|
|
suggested_name = self.jit.get_global_name(inst)
|
|
@@ -201,6 +214,9 @@ class ModelverseKernel(object):
|
|
print("KWARGS: " + str(kwargs))
|
|
print("KWARGS: " + str(kwargs))
|
|
#raise primitive_functions.PrimitiveFinished(None)
|
|
#raise primitive_functions.PrimitiveFinished(None)
|
|
"""
|
|
"""
|
|
|
|
+
|
|
|
|
+ yield [("CALL_ARGS", [self.read_function, (inst,)])]
|
|
|
|
+
|
|
raise jit.JitCompilationFailedException("FAIL")
|
|
raise jit.JitCompilationFailedException("FAIL")
|
|
|
|
|
|
raise primitive_functions.PrimitiveFinished(func)
|
|
raise primitive_functions.PrimitiveFinished(func)
|