From 7cb0c04aa97356200cf90001bfe04f8b32c84d34 Mon Sep 17 00:00:00 2001 From: Ajax Date: Thu, 5 Jan 2017 17:23:51 +0100 Subject: Jitter: remove useless VmMngr argument --- miasm2/jitter/jitcore_python.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'miasm2/jitter/jitcore_python.py') 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) -- cgit 1.4.1 From 143ecd6768224acd109f5680e52175fcf9b0e945 Mon Sep 17 00:00:00 2001 From: Ajax Date: Thu, 5 Jan 2017 17:29:39 +0100 Subject: Remove useless jit_call wrapper --- miasm2/jitter/jitcore.py | 14 ++------------ miasm2/jitter/jitcore_python.py | 5 +++-- 2 files changed, 5 insertions(+), 14 deletions(-) (limited to 'miasm2/jitter/jitcore_python.py') diff --git a/miasm2/jitter/jitcore.py b/miasm2/jitter/jitcore.py index 7b519c2e..7e831280 100644 --- a/miasm2/jitter/jitcore.py +++ b/miasm2/jitter/jitcore.py @@ -165,15 +165,6 @@ class JitCore(object): # Update jitcode mem range self.add_bloc_to_mem_interval(vm, cur_bloc) - def jit_call(self, label, cpu, breakpoints): - """Call the function label with cpu and vmmngr states - @label: function's label - @cpu: JitCpu instance - @breakpoints: Dict instance of used breakpoints - """ - return self.exec_wrapper(label, cpu, self.lbl2jitbloc.data, breakpoints, - self.options["max_exec_per_call"]) - def runbloc(self, cpu, lbl, breakpoints): """Run the bloc starting at lbl. @cpu: JitCpu instance @@ -188,9 +179,8 @@ class JitCore(object): self.disbloc(lbl, cpu.vmmngr) # Run the bloc and update cpu/vmmngr state - ret = self.jit_call(lbl, cpu, breakpoints) - - return ret + return self.exec_wrapper(lbl, cpu, self.lbl2jitbloc.data, breakpoints, + self.options["max_exec_per_call"]) def blocs2memrange(self, blocs): """Return an interval instance standing for blocs addresses diff --git a/miasm2/jitter/jitcore_python.py b/miasm2/jitter/jitcore_python.py index 98ee25a8..27666ab4 100644 --- a/miasm2/jitter/jitcore_python.py +++ b/miasm2/jitter/jitcore_python.py @@ -126,8 +126,9 @@ class JitCore_Python(jitcore.JitCore): # Associate myfunc with current label self.lbl2jitbloc[label.offset] = myfunc - def jit_call(self, label, cpu, _breakpoints): - """Call the function label with cpu and vmmngr states + def exec_wrapper(self, label, cpu, _lbl2jitbloc, _breakpoints, + _max_exec_per_call): + """Call the function @label with @cpu @label: function's label @cpu: JitCpu instance """ -- cgit 1.4.1