LibJS+LibWeb: Calculate count of regs+consts+locals before EC allocation

This is a preparation step before joining arguments vector into vector
of registers+constants+locals.
This commit is contained in:
Aliaksandr Kalenik 2025-04-22 21:49:41 +02:00 committed by Andreas Kling
commit 80a8040794
Notes: github-actions[bot] 2025-04-24 08:32:54 +00:00
14 changed files with 144 additions and 107 deletions

View file

@ -32,7 +32,7 @@ struct CachedSourceRange : public RefCounted<CachedSourceRange> {
// 9.4 Execution Contexts, https://tc39.es/ecma262/#sec-execution-contexts
struct ExecutionContext {
static NonnullOwnPtr<ExecutionContext> create();
static NonnullOwnPtr<ExecutionContext> create(u32);
[[nodiscard]] NonnullOwnPtr<ExecutionContext> copy() const;
~ExecutionContext();
@ -86,7 +86,12 @@ public:
bool is_strict_mode { false };
Vector<Value> arguments;
private:
friend class Bytecode::Interpreter;
Vector<Value> registers_and_constants_and_locals;
public:
Vector<Bytecode::UnwindInfo> unwind_contexts;
Vector<Optional<size_t>> previously_scheduled_jumps;
Vector<GC::Ptr<Environment>> saved_lexical_environments;