diff options
| author | Mark Rowe <mark@vector35.com> | 2026-02-25 19:45:00 -0800 |
|---|---|---|
| committer | Mark Rowe <mark@vector35.com> | 2026-03-16 15:47:00 -0700 |
| commit | 25213a836b1423cbc1aeef1f23aebc2167154e56 (patch) | |
| tree | 84bf36f1ba46de9419cfbd1411712192c1d3fb12 /mediumlevelilinstruction.h | |
| parent | 8f6762f742ed48d7d8400f2d1b4bf4774d7b0fd1 (diff) | |
Represent operand lists and label maps more efficiently within IL instructions
Rather than using chains of `UNDEF` instructions, the contents of these
lists are in a vector alongside the instructions. The instruction itself
stores the entry count and offset into this second vector at which the
associated items can be found.
This improves analysis performance by around 2% and decreases memory
usage by around 5%.
Diffstat (limited to 'mediumlevelilinstruction.h')
| -rw-r--r-- | mediumlevelilinstruction.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mediumlevelilinstruction.h b/mediumlevelilinstruction.h index 2b495010..bbc8f432 100644 --- a/mediumlevelilinstruction.h +++ b/mediumlevelilinstruction.h @@ -247,8 +247,8 @@ namespace BinaryNinja #else Ref<MediumLevelILFunction> function; #endif - BNMediumLevelILInstruction instr; - size_t operand, count; + const uint64_t* cur; + size_t count; bool operator==(const ListIterator& a) const; bool operator!=(const ListIterator& a) const; @@ -263,7 +263,7 @@ namespace BinaryNinja public: typedef ListIterator const_iterator; - MediumLevelILIntegerList(MediumLevelILFunction* func, const BNMediumLevelILInstruction& instr, size_t count); + MediumLevelILIntegerList(MediumLevelILFunction* func, size_t offset, size_t count); const_iterator begin() const; const_iterator end() const; @@ -303,7 +303,7 @@ namespace BinaryNinja public: typedef ListIterator const_iterator; - MediumLevelILIndexList(MediumLevelILFunction* func, const BNMediumLevelILInstruction& instr, size_t count); + MediumLevelILIndexList(MediumLevelILFunction* func, size_t offset, size_t count); const_iterator begin() const; const_iterator end() const; @@ -344,7 +344,7 @@ namespace BinaryNinja public: typedef ListIterator const_iterator; - MediumLevelILIndexMap(MediumLevelILFunction* func, const BNMediumLevelILInstruction& instr, size_t count); + MediumLevelILIndexMap(MediumLevelILFunction* func, size_t offset, size_t count); const_iterator begin() const; const_iterator end() const; @@ -384,7 +384,7 @@ namespace BinaryNinja public: typedef ListIterator const_iterator; - MediumLevelILVariableList(MediumLevelILFunction* func, const BNMediumLevelILInstruction& instr, size_t count); + MediumLevelILVariableList(MediumLevelILFunction* func, size_t offset, size_t count); const_iterator begin() const; const_iterator end() const; @@ -426,7 +426,7 @@ namespace BinaryNinja typedef ListIterator const_iterator; MediumLevelILSSAVariableList( - MediumLevelILFunction* func, const BNMediumLevelILInstruction& instr, size_t count); + MediumLevelILFunction* func, size_t offset, size_t count); const_iterator begin() const; const_iterator end() const; @@ -468,7 +468,7 @@ namespace BinaryNinja public: typedef ListIterator const_iterator; - MediumLevelILInstructionList(MediumLevelILFunction* func, const BNMediumLevelILInstruction& instr, size_t count, + MediumLevelILInstructionList(MediumLevelILFunction* func, size_t offset, size_t count, size_t instructionIndex); const_iterator begin() const; |
