浏览代码

Add an option to the JIT that enables source maps

jonathanvdc 8 年之前
父节点
当前提交
1a81e0a6fe
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      kernel/modelverse_jit/jit.py

+ 8 - 0
kernel/modelverse_jit/jit.py

@@ -129,6 +129,7 @@ class ModelverseJit(object):
         self.jit_enabled = True
         self.jit_enabled = True
         self.direct_calls_allowed = True
         self.direct_calls_allowed = True
         self.tracing_enabled = False
         self.tracing_enabled = False
+        self.source_maps_enabled = True
         self.input_function_enabled = False
         self.input_function_enabled = False
         self.nop_insertion_enabled = True
         self.nop_insertion_enabled = True
         self.thunks_enabled = True
         self.thunks_enabled = True
@@ -152,6 +153,13 @@ class ModelverseJit(object):
         """Enables or disables tracing for jitted code."""
         """Enables or disables tracing for jitted code."""
         self.tracing_enabled = is_enabled
         self.tracing_enabled = is_enabled
 
 
+    def enable_source_maps(self, is_enabled=True):
+        """Enables or disables the creation of source maps for jitted code. Source maps
+           convert lines in the generated code to debug information.
+
+           Source maps are enabled by default."""
+        self.source_maps_enabled = is_enabled
+
     def enable_nop_insertion(self, is_enabled=True):
     def enable_nop_insertion(self, is_enabled=True):
         """Enables or disables nop insertion for jitted code. If enabled, the JIT will
         """Enables or disables nop insertion for jitted code. If enabled, the JIT will
            insert nops at loop back-edges. Inserting nops sacrifices performance to
            insert nops at loop back-edges. Inserting nops sacrifices performance to