Browse Source

Patched return in JIT

Yentl Van Tendeloo 7 years ago
parent
commit
81ab62cbdf
2 changed files with 3 additions and 8 deletions
  1. 2 3
      kernel/modelverse_kernel/main.py
  2. 1 5
      wrappers/modelverse_SCCD.py

+ 2 - 3
kernel/modelverse_kernel/main.py

@@ -236,9 +236,9 @@ class ModelverseKernel(object):
             value, = yield [("RD", [inst, "value"])]
             if value:
                 (prev_value, instruction_value), = yield [("CALL_ARGS", [self.print_instruction, (value, 0, indent)])]
-                instruction = prev_value + "  " * indent + "return %s\n" % instruction_value
+                instruction = prev_value + "  " * indent + "raise PrimitiveFinished(%s)\n" % instruction_value
             else:
-                instruction = "  " * indent + "return\n"
+                instruction = "  " * indent + "raise PrimitiveFinished(None)\n"
 
         elif inst_type["value"] == "declare":
             instruction = ""
@@ -352,7 +352,6 @@ class ModelverseKernel(object):
             name = self.jit.get_global_name(inst)
             compiled_func, = yield [("CALL_ARGS", [self.read_function, (inst,)])]
             exec(str(compiled_func), self.jit.jit_globals)
-            print(self.jit.jit_globals)
             compiled_func = self.jit.jit_globals[name]
             self.jit.register_compiled(inst, compiled_func, name)
 

+ 1 - 5
wrappers/modelverse_SCCD.py

@@ -1,11 +1,7 @@
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
-<<<<<<< HEAD
-Date:   Thu Apr  5 14:36:50 2018
-=======
-Date:   Thu Apr  5 16:51:38 2018
->>>>>>> testing
+Date:   Fri Apr  6 07:12:11 2018
 
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server