mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-02 16:33:13 +00:00
LibJS: Generate bytecode in basic blocks instead of one big block
This limits the size of each block (currently set to 1K), and gets us closer to a canonical, more easily analysable bytecode format. As a result of this, "Labels" are now simply entries to basic blocks. Since there is no more 'conditional' jump (as all jumps are always taken), JumpIf{True,False} are unified to JumpConditional, and JumpIfNullish is renamed to JumpNullish. Also fixes #7914 as a result of reimplementing the loop logic.
This commit is contained in:
parent
d7a25cdb82
commit
01e8f0889a
Notes:
sideshowbarker
2024-07-18 12:35:35 +09:00
Author: https://github.com/alimpfard
Commit: 01e8f0889a
Pull-request: https://github.com/SerenityOS/serenity/pull/7934
Issue: https://github.com/SerenityOS/serenity/issues/7914
16 changed files with 392 additions and 174 deletions
|
@ -7,6 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibJS/AST.h>
|
||||
#include <LibJS/Bytecode/Generator.h>
|
||||
#include <LibJS/Runtime/Function.h>
|
||||
|
||||
namespace JS {
|
||||
|
@ -47,7 +48,7 @@ private:
|
|||
FlyString m_name;
|
||||
NonnullRefPtr<Statement> m_body;
|
||||
const Vector<FunctionNode::Parameter> m_parameters;
|
||||
OwnPtr<Bytecode::Block> m_bytecode_block;
|
||||
Optional<Bytecode::ExecutionUnit> m_bytecode_execution_unit;
|
||||
ScopeObject* m_parent_scope { nullptr };
|
||||
i32 m_function_length { 0 };
|
||||
bool m_is_strict { false };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue