ソースを参照

Add an option to the JIT that enables source maps

jonathanvdc 8 年 前
コミット
4e5f6dfa21
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.direct_calls_allowed = True
         self.tracing_enabled = False
+        self.source_maps_enabled = True
         self.input_function_enabled = False
         self.nop_insertion_enabled = True
         self.thunks_enabled = True
@@ -152,6 +153,13 @@ class ModelverseJit(object):
         """Enables or disables tracing for jitted code."""
         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):
         """Enables or disables nop insertion for jitted code. If enabled, the JIT will
            insert nops at loop back-edges. Inserting nops sacrifices performance to