LibJS: Let bytecode instructions know whether they are in strict mode

This commits puts the strict mode flag in the header of every bytecode
instruction. This allows us to check for strict mode without looking at
the currently running execution context.
This commit is contained in:
Andreas Kling 2025-10-28 20:25:12 +01:00 committed by Andreas Kling
parent 3fb678b376
commit fb05063dde
Notes: github-actions[bot] 2025-10-29 20:22:27 +00:00
16 changed files with 183 additions and 227 deletions

View file

@ -25,7 +25,7 @@ Executable::Executable(
size_t number_of_property_lookup_caches,
size_t number_of_global_variable_caches,
size_t number_of_registers,
bool is_strict_mode)
Strict strict)
: bytecode(move(bytecode))
, string_table(move(string_table))
, identifier_table(move(identifier_table))
@ -33,7 +33,7 @@ Executable::Executable(
, constants(move(constants))
, source_code(move(source_code))
, number_of_registers(number_of_registers)
, is_strict_mode(is_strict_mode)
, is_strict_mode(strict == Strict::Yes)
{
property_lookup_caches.resize(number_of_property_lookup_caches);
global_variable_caches.resize(number_of_global_variable_caches);