mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +00:00
UserspaceEmulator: Add a very simple instruction fetch cache
To avoid MMU region lookup on every single instruction fetch, we now cache a raw pointer to the current instruction. This gets automatically invalidated when we jump somewhere, but as long as we're executing sequentially, instruction fetches will hit the cache and bypass all the region lookup stuff. This is about a ~2x speedup. :^)
This commit is contained in:
parent
c8d3f8cdeb
commit
8656835935
5 changed files with 44 additions and 4 deletions
|
@ -45,6 +45,8 @@ public:
|
|||
|
||||
u8* data() { return m_data; }
|
||||
|
||||
virtual u8* cacheable_ptr(u32 offset) override;
|
||||
|
||||
private:
|
||||
u8* m_data { nullptr };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue