mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:07:34 +00:00
LibJS: Implement bytecode generation for BreakStatement
This commit is contained in:
parent
73cf16f643
commit
a0412e0d5e
4 changed files with 31 additions and 3 deletions
|
@ -57,8 +57,11 @@ public:
|
|||
|
||||
void begin_continuable_scope(Label continue_target);
|
||||
void end_continuable_scope();
|
||||
void begin_breakable_scope(Label breakable_target);
|
||||
void end_breakable_scope();
|
||||
|
||||
[[nodiscard]] Label nearest_continuable_scope() const;
|
||||
[[nodiscard]] Label nearest_breakable_scope() const;
|
||||
|
||||
void switch_to_basic_block(BasicBlock& block)
|
||||
{
|
||||
|
@ -97,6 +100,7 @@ private:
|
|||
u32 m_next_register { 1 };
|
||||
u32 m_next_block { 1 };
|
||||
Vector<Label> m_continuable_scopes;
|
||||
Vector<Label> m_breakable_scopes;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue