瀏覽代碼

Don't accidentally enable tracing in the JIT

jonathanvdc 8 年之前
父節點
當前提交
53fb330dbe
共有 1 個文件被更改,包括 6 次插入4 次删除
  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: