mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:58:11 +00:00
LibJS: Add the "fast non-local access" optimization to the bytecode VM
The GetVariable bytecode op now caches environment coordinates for fast cross-scope variable lookup.
This commit is contained in:
parent
da98212001
commit
715e7fada8
2 changed files with 24 additions and 3 deletions
|
@ -16,6 +16,7 @@
|
|||
#include <LibJS/Bytecode/StringTable.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
#include <LibJS/Runtime/Environment.h>
|
||||
#include <LibJS/Runtime/EnvironmentCoordinate.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
|
||||
namespace JS::Bytecode::Op {
|
||||
|
@ -310,6 +311,8 @@ public:
|
|||
|
||||
private:
|
||||
IdentifierTableIndex m_identifier;
|
||||
|
||||
Optional<EnvironmentCoordinate> mutable m_cached_environment_coordinate;
|
||||
};
|
||||
|
||||
class GetById final : public Instruction {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue