소스 검색

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.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