Kaynağa Gözat

Make fast-jit insert nops at function entry points

jonathanvdc 8 yıl önce
ebeveyn
işleme
892eefdd30
1 değiştirilmiş dosya ile 6 ekleme ve 0 silme
  1. 6 0
      kernel/modelverse_jit/bytecode_to_cfg.py

+ 6 - 0
kernel/modelverse_jit/bytecode_to_cfg.py

@@ -46,6 +46,9 @@ class AnalysisState(object):
         #         $_ = store $param_1, $arg_1
         #         ...
         #
+        #         static if self.jit.nop_insertion_enabled:
+        #             $_ = direct-call ('macro-io', void) nop()
+        #
         # We also want to store '$jit_locals' in an attribute, so we can
         # use it to shield locals from the GC.
         if self.jit.source_maps_enabled:
@@ -72,6 +75,9 @@ class AnalysisState(object):
             arg_i = self.current_block.append_definition(cfg_ir.FunctionParameter(name))
             self.current_block.append_definition(cfg_ir.StoreAtPointer(param_i, arg_i))
 
+        if self.jit.nop_insertion_enabled:
+            self.current_block.append_definition(cfg_ir.create_nop())
+
     def analyze(self, instruction):
         """Analyzes the given instruction as a basic block."""
         if instruction in self.analyzed_instructions: