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 /lowlevelilinstruction.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 'lowlevelilinstruction.h')
| -rw-r--r-- | lowlevelilinstruction.h | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/lowlevelilinstruction.h b/lowlevelilinstruction.h index 6decedd8..5feef433 100644 --- a/lowlevelilinstruction.h +++ b/lowlevelilinstruction.h @@ -382,12 +382,11 @@ namespace BinaryNinja #ifdef BINARYNINJACORE_LIBRARY LowLevelILFunction* function; - const BNLowLevelILInstruction* instr; #else Ref<LowLevelILFunction> function; - BNLowLevelILInstruction instr; #endif - size_t operand, count; + const uint64_t* cur; + size_t count; bool operator==(const ListIterator& a) const; bool operator!=(const ListIterator& a) const; @@ -402,7 +401,7 @@ namespace BinaryNinja public: typedef ListIterator const_iterator; - LowLevelILIntegerList(LowLevelILFunction* func, const BNLowLevelILInstruction& instr, size_t count); + LowLevelILIntegerList(LowLevelILFunction* func, size_t offset, size_t count); const_iterator begin() const; const_iterator end() const; @@ -442,7 +441,7 @@ namespace BinaryNinja public: typedef ListIterator const_iterator; - LowLevelILIndexList(LowLevelILFunction* func, const BNLowLevelILInstruction& instr, size_t count); + LowLevelILIndexList(LowLevelILFunction* func, size_t offset, size_t count); const_iterator begin() const; const_iterator end() const; @@ -483,7 +482,7 @@ namespace BinaryNinja public: typedef ListIterator const_iterator; - LowLevelILIndexMap(LowLevelILFunction* func, const BNLowLevelILInstruction& instr, size_t count); + LowLevelILIndexMap(LowLevelILFunction* func, size_t offset, size_t count); const_iterator begin() const; const_iterator end() const; @@ -526,7 +525,7 @@ namespace BinaryNinja typedef ListIterator const_iterator; LowLevelILInstructionList( - LowLevelILFunction* func, const BNLowLevelILInstruction& instr, size_t count, size_t instrIndex); + LowLevelILFunction* func, size_t offset, size_t count, size_t instrIndex); const_iterator begin() const; const_iterator end() const; @@ -566,7 +565,7 @@ namespace BinaryNinja public: typedef ListIterator const_iterator; - LowLevelILRegisterOrFlagList(LowLevelILFunction* func, const BNLowLevelILInstruction& instr, size_t count); + LowLevelILRegisterOrFlagList(LowLevelILFunction* func, size_t offset, size_t count); const_iterator begin() const; const_iterator end() const; @@ -607,7 +606,7 @@ namespace BinaryNinja public: typedef ListIterator const_iterator; - LowLevelILSSARegisterList(LowLevelILFunction* func, const BNLowLevelILInstruction& instr, size_t count); + LowLevelILSSARegisterList(LowLevelILFunction* func, size_t offset, size_t count); const_iterator begin() const; const_iterator end() const; @@ -648,7 +647,7 @@ namespace BinaryNinja public: typedef ListIterator const_iterator; - LowLevelILSSARegisterStackList(LowLevelILFunction* func, const BNLowLevelILInstruction& instr, size_t count); + LowLevelILSSARegisterStackList(LowLevelILFunction* func, size_t offset, size_t count); const_iterator begin() const; const_iterator end() const; @@ -689,7 +688,7 @@ namespace BinaryNinja public: typedef ListIterator const_iterator; - LowLevelILSSAFlagList(LowLevelILFunction* func, const BNLowLevelILInstruction& instr, size_t count); + LowLevelILSSAFlagList(LowLevelILFunction* func, size_t offset, size_t count); const_iterator begin() const; const_iterator end() const; @@ -730,7 +729,7 @@ namespace BinaryNinja public: typedef ListIterator const_iterator; - LowLevelILSSARegisterOrFlagList(LowLevelILFunction* func, const BNLowLevelILInstruction& instr, size_t count); + LowLevelILSSARegisterOrFlagList(LowLevelILFunction* func, size_t offset, size_t count); const_iterator begin() const; const_iterator end() const; |
