1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:37:35 +00:00

LibJS/JIT: Add fast path for cached GetVariable accesses

We can now stay in machine code for environment variable read accesses
as long as they are cached and initialized.

20% speed-up on Octane/zlib.js :^)
This commit is contained in:
Andreas Kling 2023-11-06 15:23:49 +01:00
parent 7826c006c1
commit 1d8ec677a3
6 changed files with 147 additions and 3 deletions

View file

@ -15,6 +15,9 @@ struct EnvironmentCoordinate {
u32 hops { invalid_marker };
u32 index { invalid_marker };
static FlatPtr hops_offset() { return OFFSET_OF(EnvironmentCoordinate, hops); }
static FlatPtr index_offset() { return OFFSET_OF(EnvironmentCoordinate, index); }
bool is_valid() const { return hops != invalid_marker && index != invalid_marker; }
static constexpr u32 invalid_marker = 0xfffffffe;