mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +00:00
LibJS/Bytecode: Cache realm, global object, and more in interpreter
Instead of looking these up in the VM execution context stack whenever we need them, we now just cache them in the interpreter when entering a new call frame.
This commit is contained in:
parent
01e9eee7dd
commit
953573565c
3 changed files with 11 additions and 10 deletions
|
@ -183,10 +183,8 @@ inline ThrowCompletionOr<Value> get_by_value(VM& vm, Value base_value, Value pro
|
|||
inline ThrowCompletionOr<Value> get_global(Bytecode::Interpreter& interpreter, DeprecatedFlyString const& identifier, GlobalVariableCache& cache)
|
||||
{
|
||||
auto& vm = interpreter.vm();
|
||||
auto& realm = *vm.current_realm();
|
||||
|
||||
auto& binding_object = realm.global_environment().object_record().binding_object();
|
||||
auto& declarative_record = realm.global_environment().declarative_record();
|
||||
auto& binding_object = interpreter.global_object();
|
||||
auto& declarative_record = interpreter.global_declarative_environment();
|
||||
|
||||
// OPTIMIZATION: If the shape of the object hasn't changed, we can use the cached property offset.
|
||||
auto& shape = binding_object.shape();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue