Browse Source

Add an option to the JIT that enables source maps

jonathanvdc 8 years ago
parent
commit
4e5f6dfa21
1 changed files with 8 additions and 0 deletions
  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