summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/AST.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-06-06 13:33:02 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-07 18:11:59 +0200
commit4bdfe738955c8de70c6266ab58addec7ef41b31e (patch)
treedfe019f65d9b298021a4c973956e73e135429099 /Userland/Libraries/LibJS/AST.h
parent79eac08f5bc9850749a3280d517649a1d0c9933a (diff)
downloadserenity-4bdfe738955c8de70c6266ab58addec7ef41b31e.zip
LibJS: Add basic support for "continue" in the bytecode VM
Unlike the convoluted unwind-until-scope-type mechanism in the AST interpreter, "continue" maps to a simple Bytecode::Op::Jump here. :^) We know where to jump based on a stack of "continuable scopes" that we now maintain on the Bytecode::Generator as we go. Note that this only supports bare "continue", not continue-with-label.
Diffstat (limited to 'Userland/Libraries/LibJS/AST.h')
-rw-r--r--Userland/Libraries/LibJS/AST.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/AST.h b/Userland/Libraries/LibJS/AST.h
index 5dc8e73911..b1f5332600 100644
--- a/Userland/Libraries/LibJS/AST.h
+++ b/Userland/Libraries/LibJS/AST.h
@@ -1300,6 +1300,7 @@ public:
}
virtual Value execute(Interpreter&, GlobalObject&) const override;
+ virtual Optional<Bytecode::Register> generate_bytecode(Bytecode::Generator&) const override;
const FlyString& target_label() const { return m_target_label; }