mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 20:08:13 +00:00
UserspaceEmulator: Inline some very hot functions
This improves the browser's load time on welcome.html by ~2%.
This commit is contained in:
parent
1b9a85e4f1
commit
da413a464a
6 changed files with 33 additions and 34 deletions
|
@ -53,7 +53,14 @@ public:
|
|||
void write32(X86::LogicalAddress, ValueWithShadow<u32>);
|
||||
void write64(X86::LogicalAddress, ValueWithShadow<u64>);
|
||||
|
||||
Region* find_region(X86::LogicalAddress);
|
||||
ALWAYS_INLINE Region* find_region(X86::LogicalAddress address)
|
||||
{
|
||||
if (address.selector() == 0x28)
|
||||
return m_tls_region.ptr();
|
||||
|
||||
size_t page_index = (address.offset() & ~(PAGE_SIZE - 1)) / PAGE_SIZE;
|
||||
return m_page_to_region_map[page_index];
|
||||
}
|
||||
|
||||
void add_region(NonnullOwnPtr<Region>);
|
||||
void remove_region(Region&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue