Browse Source

Don't accidentally enable tracing in the JIT

jonathanvdc 8 years ago
parent
commit
53fb330dbe
1 changed files with 6 additions and 4 deletions
  1. 6 4
      kernel/modelverse_jit/jit.py

+ 6 - 4
kernel/modelverse_jit/jit.py

@@ -389,8 +389,6 @@ class AnalysisState(object):
                 debug_info, = yield [("RD", [instruction_id, "__debug"])]
                 if debug_info is not None:
                     debug_info, = yield [("RV", [debug_info])]
-            else:
-                debug_info = None
 
             try:
                 gen = self.instruction_analyzers[instruction_val](self, instruction_id)
@@ -404,8 +402,12 @@ class AnalysisState(object):
             except primitive_functions.PrimitiveFinished as outer_e:
                 # Check if the instruction has a 'next' instruction.
                 next_instr, = yield [("RD", [instruction_id, "next"])]
-                outer_result = tree_ir.with_debug_info_trace(
-                    outer_e.result, debug_info, self.function_name)
+                if self.jit.tracing_enabled:
+                    outer_result = tree_ir.with_debug_info_trace(
+                        outer_e.result, debug_info, self.function_name)
+                else:
+                    outer_result = outer_e.result
+
                 if next_instr is None:
                     raise primitive_functions.PrimitiveFinished(outer_result)
                 else: