|
@@ -19,6 +19,7 @@
|
|
|
#include <LibJS/Bytecode/Executable.h>
|
|
|
#include <LibJS/Bytecode/IdentifierTable.h>
|
|
|
#include <LibJS/Bytecode/Operand.h>
|
|
|
+#include <LibJS/Bytecode/ScopedOperand.h>
|
|
|
#include <LibJS/Forward.h>
|
|
|
#include <LibJS/Heap/Handle.h>
|
|
|
#include <LibJS/Runtime/ClassFieldDefinition.h>
|
|
@@ -55,7 +56,7 @@ public:
|
|
|
// NOTE: This is here to stop ASAN complaining about mismatch between new/delete sizes in ASTNodeWithTailArray.
|
|
|
void operator delete(void* ptr) { ::operator delete(ptr); }
|
|
|
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const;
|
|
|
virtual void dump(int indent) const;
|
|
|
|
|
|
[[nodiscard]] SourceRange source_range() const;
|
|
@@ -175,8 +176,8 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_labelled_evaluation(Bytecode::Generator&, Vector<DeprecatedFlyString> const&, Optional<Bytecode::Operand> preferred_dst = {}) const;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_labelled_evaluation(Bytecode::Generator&, Vector<DeprecatedFlyString> const&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const;
|
|
|
|
|
|
DeprecatedFlyString const& label() const { return m_label; }
|
|
|
DeprecatedFlyString& label() { return m_label; }
|
|
@@ -204,7 +205,7 @@ class IterationStatement : public Statement {
|
|
|
public:
|
|
|
using Statement::Statement;
|
|
|
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_labelled_evaluation(Bytecode::Generator&, Vector<DeprecatedFlyString> const&, Optional<Bytecode::Operand> preferred_dst = {}) const;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_labelled_evaluation(Bytecode::Generator&, Vector<DeprecatedFlyString> const&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const;
|
|
|
|
|
|
private:
|
|
|
virtual bool is_iteration_statement() const final { return true; }
|
|
@@ -216,7 +217,7 @@ public:
|
|
|
: Statement(move(source_range))
|
|
|
{
|
|
|
}
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
};
|
|
|
|
|
|
class ErrorStatement final : public Statement {
|
|
@@ -236,7 +237,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
Expression const& expression() const { return m_expression; }
|
|
|
|
|
@@ -299,7 +300,7 @@ public:
|
|
|
|
|
|
Vector<NonnullRefPtr<Statement const>> const& children() const { return m_children; }
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
void add_var_scoped_declaration(NonnullRefPtr<Declaration const> variables);
|
|
|
void add_lexical_declaration(NonnullRefPtr<Declaration const> variables);
|
|
@@ -387,7 +388,7 @@ public:
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
bool has_bound_name(DeprecatedFlyString const& name) const;
|
|
|
Vector<ImportEntry> const& entries() const { return m_entries; }
|
|
@@ -484,7 +485,7 @@ public:
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
bool has_export(DeprecatedFlyString const& export_name) const;
|
|
|
|
|
@@ -671,7 +672,7 @@ public:
|
|
|
void set_is_global() { m_is_global = true; }
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
virtual bool is_identifier() const override { return true; }
|
|
@@ -761,7 +762,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
ThrowCompletionOr<void> for_each_bound_identifier(ThrowCompletionOrVoidCallback<Identifier const&>&&) const override;
|
|
|
|
|
@@ -787,8 +788,8 @@ public:
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode_with_lhs_name(Bytecode::Generator&, Optional<Bytecode::IdentifierTableIndex> lhs_name, Optional<Bytecode::Operand> preferred_dst = {}) const;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode_with_lhs_name(Bytecode::Generator&, Optional<Bytecode::IdentifierTableIndex> lhs_name, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const;
|
|
|
|
|
|
bool has_name() const { return !name().is_empty(); }
|
|
|
|
|
@@ -819,7 +820,7 @@ public:
|
|
|
bool is_yield_from() const { return m_is_yield_from; }
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
RefPtr<Expression const> m_argument;
|
|
@@ -835,7 +836,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
NonnullRefPtr<Expression const> m_argument;
|
|
@@ -852,7 +853,7 @@ public:
|
|
|
Expression const* argument() const { return m_argument; }
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
RefPtr<Expression const> m_argument;
|
|
@@ -873,7 +874,7 @@ public:
|
|
|
Statement const* alternate() const { return m_alternate; }
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
NonnullRefPtr<Expression const> m_predicate;
|
|
@@ -894,8 +895,8 @@ public:
|
|
|
Statement const& body() const { return *m_body; }
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_labelled_evaluation(Bytecode::Generator&, Vector<DeprecatedFlyString> const&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_labelled_evaluation(Bytecode::Generator&, Vector<DeprecatedFlyString> const&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
NonnullRefPtr<Expression const> m_test;
|
|
@@ -915,8 +916,8 @@ public:
|
|
|
Statement const& body() const { return *m_body; }
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_labelled_evaluation(Bytecode::Generator&, Vector<DeprecatedFlyString> const&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_labelled_evaluation(Bytecode::Generator&, Vector<DeprecatedFlyString> const&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
NonnullRefPtr<Expression const> m_test;
|
|
@@ -936,7 +937,7 @@ public:
|
|
|
Statement const& body() const { return *m_body; }
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
NonnullRefPtr<Expression const> m_object;
|
|
@@ -960,8 +961,8 @@ public:
|
|
|
Statement const& body() const { return *m_body; }
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_labelled_evaluation(Bytecode::Generator&, Vector<DeprecatedFlyString> const&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_labelled_evaluation(Bytecode::Generator&, Vector<DeprecatedFlyString> const&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
RefPtr<ASTNode const> m_init;
|
|
@@ -984,8 +985,8 @@ public:
|
|
|
Expression const& rhs() const { return *m_rhs; }
|
|
|
Statement const& body() const { return *m_body; }
|
|
|
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_labelled_evaluation(Bytecode::Generator&, Vector<DeprecatedFlyString> const&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_labelled_evaluation(Bytecode::Generator&, Vector<DeprecatedFlyString> const&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
virtual void dump(int indent) const override;
|
|
|
|
|
|
private:
|
|
@@ -1008,8 +1009,8 @@ public:
|
|
|
Expression const& rhs() const { return *m_rhs; }
|
|
|
Statement const& body() const { return *m_body; }
|
|
|
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_labelled_evaluation(Bytecode::Generator&, Vector<DeprecatedFlyString> const&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_labelled_evaluation(Bytecode::Generator&, Vector<DeprecatedFlyString> const&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
virtual void dump(int indent) const override;
|
|
|
|
|
|
private:
|
|
@@ -1028,8 +1029,8 @@ public:
|
|
|
{
|
|
|
}
|
|
|
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_labelled_evaluation(Bytecode::Generator&, Vector<DeprecatedFlyString> const&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_labelled_evaluation(Bytecode::Generator&, Vector<DeprecatedFlyString> const&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
virtual void dump(int indent) const override;
|
|
|
|
|
|
private:
|
|
@@ -1074,7 +1075,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
BinaryOp m_op;
|
|
@@ -1099,7 +1100,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
LogicalOp m_op;
|
|
@@ -1127,7 +1128,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
UnaryOp m_op;
|
|
@@ -1144,7 +1145,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
Vector<NonnullRefPtr<Expression const>> m_expressions;
|
|
@@ -1170,7 +1171,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
virtual Value value() const override { return Value(m_value); }
|
|
|
|
|
@@ -1187,7 +1188,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
virtual Value value() const override { return m_value; }
|
|
|
|
|
@@ -1206,7 +1207,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
ByteString m_value;
|
|
@@ -1221,7 +1222,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
ByteString const& value() const { return m_value; }
|
|
|
|
|
@@ -1239,7 +1240,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
virtual Value value() const override { return js_null(); }
|
|
|
};
|
|
@@ -1257,7 +1258,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
regex::Parser::Result const& parsed_regex() const { return m_parsed_regex; }
|
|
|
ByteString const& parsed_pattern() const { return m_parsed_pattern; }
|
|
@@ -1402,7 +1403,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
virtual bool is_super_expression() const override { return true; }
|
|
|
};
|
|
@@ -1425,8 +1426,8 @@ public:
|
|
|
RefPtr<FunctionExpression const> constructor() const { return m_constructor; }
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode_with_lhs_name(Bytecode::Generator&, Optional<Bytecode::IdentifierTableIndex> lhs_name, Optional<Bytecode::Operand> preferred_dst = {}) const;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode_with_lhs_name(Bytecode::Generator&, Optional<Bytecode::IdentifierTableIndex> lhs_name, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const;
|
|
|
|
|
|
bool has_name() const { return m_name; }
|
|
|
|
|
@@ -1454,7 +1455,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
ThrowCompletionOr<void> for_each_bound_identifier(ThrowCompletionOrVoidCallback<Identifier const&>&&) const override;
|
|
|
|
|
@@ -1482,7 +1483,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
NonnullRefPtr<Expression const> m_expression;
|
|
@@ -1498,7 +1499,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
NonnullRefPtr<Expression const> m_target;
|
|
@@ -1511,7 +1512,7 @@ public:
|
|
|
{
|
|
|
}
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
};
|
|
|
|
|
|
struct CallExpressionArgument {
|
|
@@ -1541,7 +1542,7 @@ public:
|
|
|
static NonnullRefPtr<CallExpression> create(SourceRange, NonnullRefPtr<Expression const> callee, ReadonlySpan<Argument> arguments, InvocationStyleEnum invocation_style, InsideParenthesesEnum inside_parens);
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
Expression const& callee() const { return m_callee; }
|
|
|
|
|
@@ -1609,7 +1610,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
Vector<CallExpression::Argument> const m_arguments;
|
|
@@ -1654,7 +1655,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
AssignmentOp m_op;
|
|
@@ -1678,7 +1679,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
virtual bool is_update_expression() const override { return true; }
|
|
@@ -1738,7 +1739,7 @@ public:
|
|
|
DeclarationKind declaration_kind() const { return m_declaration_kind; }
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
Vector<NonnullRefPtr<VariableDeclarator const>> const& declarations() const { return m_declarations; }
|
|
|
|
|
@@ -1824,7 +1825,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
virtual bool is_object_expression() const override { return true; }
|
|
@@ -1843,7 +1844,7 @@ public:
|
|
|
Vector<RefPtr<Expression const>> const& elements() const { return m_elements; }
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
virtual bool is_array_expression() const override { return true; }
|
|
@@ -1867,7 +1868,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
Vector<NonnullRefPtr<Expression const>> const& expressions() const { return m_expressions; }
|
|
|
Vector<NonnullRefPtr<Expression const>> const& raw_strings() const { return m_raw_strings; }
|
|
@@ -1887,7 +1888,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
NonnullRefPtr<Expression const> const m_tag;
|
|
@@ -1905,7 +1906,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
bool is_computed() const { return m_computed; }
|
|
|
Expression const& object() const { return *m_object; }
|
|
@@ -1957,7 +1958,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
Expression const& base() const { return *m_base; }
|
|
|
Vector<Reference> const& references() const { return m_references; }
|
|
@@ -1981,7 +1982,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
Type m_type;
|
|
@@ -1997,7 +1998,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
virtual bool is_import_call() const override { return true; }
|
|
@@ -2017,7 +2018,7 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
NonnullRefPtr<Expression const> m_test;
|
|
@@ -2066,7 +2067,7 @@ public:
|
|
|
BlockStatement const* finalizer() const { return m_finalizer; }
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
NonnullRefPtr<BlockStatement const> m_block;
|
|
@@ -2085,7 +2086,7 @@ public:
|
|
|
Expression const& argument() const { return m_argument; }
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
NonnullRefPtr<Expression const> m_argument;
|
|
@@ -2116,8 +2117,8 @@ public:
|
|
|
}
|
|
|
|
|
|
virtual void dump(int indent) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_labelled_evaluation(Bytecode::Generator&, Vector<DeprecatedFlyString> const&, Optional<Bytecode::Operand> preferred_dst = {}) const;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_labelled_evaluation(Bytecode::Generator&, Vector<DeprecatedFlyString> const&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const;
|
|
|
|
|
|
void add_case(NonnullRefPtr<SwitchCase const> switch_case) { m_cases.append(move(switch_case)); }
|
|
|
|
|
@@ -2135,7 +2136,7 @@ public:
|
|
|
}
|
|
|
|
|
|
Optional<DeprecatedFlyString> const& target_label() const { return m_target_label; }
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
private:
|
|
|
Optional<DeprecatedFlyString> m_target_label;
|
|
@@ -2149,7 +2150,7 @@ public:
|
|
|
{
|
|
|
}
|
|
|
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
|
|
|
Optional<DeprecatedFlyString> const& target_label() const { return m_target_label; }
|
|
|
|
|
@@ -2164,7 +2165,7 @@ public:
|
|
|
{
|
|
|
}
|
|
|
|
|
|
- virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::Operand> preferred_dst = {}) const override;
|
|
|
+ virtual Bytecode::CodeGenerationErrorOr<Optional<Bytecode::ScopedOperand>> generate_bytecode(Bytecode::Generator&, Optional<Bytecode::ScopedOperand> preferred_dst = {}) const override;
|
|
|
};
|
|
|
|
|
|
class SyntheticReferenceExpression final : public Expression {
|