diff options
| author | serpilliere <serpilliere@users.noreply.github.com> | 2018-06-22 20:48:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-22 20:48:32 +0200 |
| commit | fbf307796f56f68cedaf763563e478155b843b83 (patch) | |
| tree | b05c169e5ff17c800a2692e0d0ddc09bb34fb881 /miasm2/jitter/jitcore_llvm.py | |
| parent | 191a47a37880caecb47f9b47ddf71fede335d1a0 (diff) | |
| parent | c33f2d988bda28a1b6dbe5a2c8bceb5819db9e42 (diff) | |
| download | miasm-fbf307796f56f68cedaf763563e478155b843b83.tar.gz miasm-fbf307796f56f68cedaf763563e478155b843b83.zip | |
Merge pull request #783 from commial/refactor/jitter-cleaning
Refactor/jitter cleaning
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 |