diff options
| author | Camille Mougey <camille.mougey@cea.fr> | 2015-10-23 13:37:07 +0200 |
|---|---|---|
| committer | Camille Mougey <camille.mougey@cea.fr> | 2015-10-23 13:37:07 +0200 |
| commit | 7992751b5a77f3e6765f708a8ffc08ad4a93eb47 (patch) | |
| tree | fdaea4d1fabdffc82775751e27c115187d2476b2 | |
| parent | 35faa5125654d69742342be718d29ca259410679 (diff) | |
| download | miasm-7992751b5a77f3e6765f708a8ffc08ad4a93eb47.tar.gz miasm-7992751b5a77f3e6765f708a8ffc08ad4a93eb47.zip | |
BoundedDict: access to the internal dict via property
There is no performance loss (on a 3 minutes execution sample) due to the additionnal function call.
| -rw-r--r-- | miasm2/core/utils.py | 5 | ||||
| -rw-r--r-- | miasm2/jitter/jitcore.py | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/miasm2/core/utils.py b/miasm2/core/utils.py index 75eb3113..30aff7d2 100644 --- a/miasm2/core/utils.py +++ b/miasm2/core/utils.py @@ -119,6 +119,11 @@ class BoundedDict(UserDict.DictMixin): "Return the list of dict's keys" return self._data.keys() + @property + def data(self): + "Return the current instance as a dictionnary" + return self._data + def __getitem__(self, key): # Retrieve data first to raise the proper exception on error data = self._data[key] diff --git a/miasm2/jitter/jitcore.py b/miasm2/jitter/jitcore.py index db994b9e..fd5b02d3 100644 --- a/miasm2/jitter/jitcore.py +++ b/miasm2/jitter/jitcore.py @@ -161,7 +161,7 @@ class JitCore(object): @breakpoints: Dict instance of used breakpoints """ # TODO useless vmmngr - return self.exec_wrapper(label, cpu, self.lbl2jitbloc._data, breakpoints) + return self.exec_wrapper(label, cpu, self.lbl2jitbloc.data, breakpoints) def runbloc(self, cpu, vm, lbl, breakpoints): """Run the bloc starting at lbl. |