diff options
Diffstat (limited to 'miasm2/jitter/jitcore_llvm.py')
| -rw-r--r-- | miasm2/jitter/jitcore_llvm.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/miasm2/jitter/jitcore_llvm.py b/miasm2/jitter/jitcore_llvm.py index 5152cf9e..bc921569 100644 --- a/miasm2/jitter/jitcore_llvm.py +++ b/miasm2/jitter/jitcore_llvm.py @@ -8,7 +8,6 @@ import Jitllvm class JitCore_LLVM(jitcore.JitCore): - "JiT management, using LLVM as backend" # Architecture dependant libraries @@ -20,8 +19,8 @@ class JitCore_LLVM(jitcore.JitCore): "ppc32": "JitCore_ppc32.so", } - def __init__(self, ir_arch, bs=None): - super(JitCore_LLVM, self).__init__(ir_arch, bs) + def __init__(self, ir_arch, bin_stream): + super(JitCore_LLVM, self).__init__(ir_arch, bin_stream) self.options.update({"safe_mode": True, # Verify each function "optimise": True, # Optimise functions @@ -29,7 +28,7 @@ class JitCore_LLVM(jitcore.JitCore): "log_assembly": False, # Print assembly executed }) - self.exec_wrapper = Jitllvm.llvm_exec_bloc + self.exec_wrapper = Jitllvm.llvm_exec_block self.ir_arch = ir_arch # Cache temporary dir @@ -74,7 +73,7 @@ class JitCore_LLVM(jitcore.JitCore): # Enable caching self.context.enable_cache() - def add_bloc(self, block): + def add_block(self, block): """Add a block to JiT and JiT it. @block: the block to add """ @@ -84,7 +83,7 @@ class JitCore_LLVM(jitcore.JitCore): if not os.access(fname_out, os.R_OK): # Build a function in the context - func = LLVMFunction(self.context, block.loc_key) + func = LLVMFunction(self.context, self.FUNCNAME) # Set log level func.log_regs = self.log_regs @@ -115,9 +114,9 @@ class JitCore_LLVM(jitcore.JitCore): else: # The cache file exists: function can be loaded from cache - ptr = self.context.get_ptr_from_cache(fname_out, block.loc_key) + ptr = self.context.get_ptr_from_cache(fname_out, self.FUNCNAME) # Store a pointer on the function jitted code loc_key = block.loc_key offset = self.ir_arch.symbol_pool.loc_key_to_offset(loc_key) - self.loc_key_to_jit_block[offset] = ptr + self.offset_to_jitted_func[offset] = ptr |