mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibJS: Remove derivable fields from ExecutionContext
Remove four fields that are trivially derivable from other fields already present in the ExecutionContext: - global_object (from realm) - global_declarative_environment (from realm) - identifier_table (from executable) - property_key_table (from executable) This shrinks ExecutionContext from 192 to 160 bytes (-17%). The asmint's GetGlobal/SetGlobal handlers now load through the realm pointer, taking advantage of the cached declarative environment pointer added in the previous commit.
This commit is contained in:
committed by
Andreas Kling
parent
e70f580e5c
commit
96d02d5249
Notes:
github-actions[bot]
2026-03-11 12:35:42 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/96d02d5249d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8360 Reviewed-by: https://github.com/shannonbooth
@@ -1717,9 +1717,10 @@ end
|
||||
|
||||
# Inline cache fast path for global variable access via the global object.
|
||||
handler GetGlobal
|
||||
# Load global_declarative_environment and global_object
|
||||
load64 t1, [exec_ctx, EXECUTION_CONTEXT_GLOBAL_DECLARATIVE_ENVIRONMENT]
|
||||
load64 t2, [exec_ctx, EXECUTION_CONTEXT_GLOBAL_OBJECT]
|
||||
# Load global_declarative_environment and global_object via realm
|
||||
load64 t0, [exec_ctx, EXECUTION_CONTEXT_REALM]
|
||||
load64 t2, [t0, REALM_GLOBAL_OBJECT]
|
||||
load64 t1, [t0, REALM_GLOBAL_DECLARATIVE_ENVIRONMENT]
|
||||
# Get GlobalVariableCache* (direct pointer from instruction stream)
|
||||
load64 t3, [pb, pc, m_cache]
|
||||
# Check environment_serial_number matches
|
||||
@@ -1774,9 +1775,10 @@ end
|
||||
|
||||
# Inline cache fast path for global variable store via the global object.
|
||||
handler SetGlobal
|
||||
# Load global_declarative_environment and global_object
|
||||
load64 t1, [exec_ctx, EXECUTION_CONTEXT_GLOBAL_DECLARATIVE_ENVIRONMENT]
|
||||
load64 t2, [exec_ctx, EXECUTION_CONTEXT_GLOBAL_OBJECT]
|
||||
# Load global_declarative_environment and global_object via realm
|
||||
load64 t0, [exec_ctx, EXECUTION_CONTEXT_REALM]
|
||||
load64 t2, [t0, REALM_GLOBAL_OBJECT]
|
||||
load64 t1, [t0, REALM_GLOBAL_DECLARATIVE_ENVIRONMENT]
|
||||
# Get GlobalVariableCache* (direct pointer from instruction stream)
|
||||
load64 t3, [pb, pc, m_cache]
|
||||
# Check environment_serial_number matches
|
||||
|
||||
Reference in New Issue
Block a user