diff options
| author | Ajax <commial@gmail.com> | 2017-01-05 17:23:51 +0100 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2017-01-05 17:23:51 +0100 |
| commit | 7cb0c04aa97356200cf90001bfe04f8b32c84d34 (patch) | |
| tree | 4d5d0d39a68031c3888efb9252138ae715342dfb | |
| parent | 776c25a65eec254b057ea7eddf39431c4e5d1916 (diff) | |
| download | miasm-7cb0c04aa97356200cf90001bfe04f8b32c84d34.tar.gz miasm-7cb0c04aa97356200cf90001bfe04f8b32c84d34.zip | |
Jitter: remove useless VmMngr argument
| -rw-r--r-- | miasm2/jitter/jitcore.py | 9 | ||||
| -rw-r--r-- | miasm2/jitter/jitcore_python.py | 10 | ||||
| -rw-r--r-- | miasm2/jitter/jitload.py | 2 |
3 files changed, 10 insertions, 11 deletions
diff --git a/miasm2/jitter/jitcore.py b/miasm2/jitter/jitcore.py index f3a79bee..4a7cd9ca 100644 --- a/miasm2/jitter/jitcore.py +++ b/miasm2/jitter/jitcore.py @@ -165,7 +165,7 @@ class JitCore(object): # Update jitcode mem range self.add_bloc_to_mem_interval(vm, cur_bloc) - def jit_call(self, label, cpu, _vmmngr, breakpoints): + def jit_call(self, label, cpu, breakpoints): """Call the function label with cpu and vmmngr states @label: function's label @cpu: JitCpu instance @@ -174,10 +174,9 @@ class JitCore(object): return self.exec_wrapper(label, cpu, self.lbl2jitbloc.data, breakpoints, self.options["max_exec_per_call"]) - def runbloc(self, cpu, vm, lbl, breakpoints): + def runbloc(self, cpu, lbl, breakpoints): """Run the bloc starting at lbl. @cpu: JitCpu instance - @vm: VmMngr instance @lbl: target label """ @@ -186,10 +185,10 @@ class JitCore(object): if not lbl in self.lbl2jitbloc: # Need to JiT the bloc - self.disbloc(lbl, vm) + self.disbloc(lbl, cpu.vmmngr) # Run the bloc and update cpu/vmmngr state - ret = self.jit_call(lbl, cpu, vm, breakpoints) + ret = self.jit_call(lbl, cpu, breakpoints) return ret diff --git a/miasm2/jitter/jitcore_python.py b/miasm2/jitter/jitcore_python.py index 87259f71..98ee25a8 100644 --- a/miasm2/jitter/jitcore_python.py +++ b/miasm2/jitter/jitcore_python.py @@ -38,11 +38,12 @@ class JitCore_Python(jitcore.JitCore): @irblocs: a gorup of irblocs """ - def myfunc(cpu, vmmngr): + def myfunc(cpu): """Execute the function according to cpu and vmmngr states @cpu: JitCpu instance - @vm: VmMngr instance """ + # Get virtual memory handler + vmmngr = cpu.vmmngr # Keep current location in irblocs cur_label = label @@ -125,15 +126,14 @@ class JitCore_Python(jitcore.JitCore): # Associate myfunc with current label self.lbl2jitbloc[label.offset] = myfunc - def jit_call(self, label, cpu, vmmngr, _breakpoints): + def jit_call(self, label, cpu, _breakpoints): """Call the function label with cpu and vmmngr states @label: function's label @cpu: JitCpu instance - @vm: VmMngr instance """ # Get Python function corresponding to @label fc_ptr = self.lbl2jitbloc[label] # Execute the function - return fc_ptr(cpu, vmmngr) + return fc_ptr(cpu) diff --git a/miasm2/jitter/jitload.py b/miasm2/jitter/jitload.py index b2416fd5..27f26c36 100644 --- a/miasm2/jitter/jitload.py +++ b/miasm2/jitter/jitload.py @@ -297,7 +297,7 @@ class jitter: """Wrapper on JiT backend. Run the code at PC and return the next PC. @pc: address of code to run""" - return self.jit.runbloc(self.cpu, self.vm, pc, self.breakpoints_handler.callbacks) + return self.jit.runbloc(self.cpu, pc, self.breakpoints_handler.callbacks) def runiter_once(self, pc): """Iterator on callbacks results on code running from PC. |