mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:37:36 +00:00
LibJS: Remove GlobalObject from execute() and related AST functions
This is a continuation of the previous four commits. Passing a global object here is largely redundant, we definitely need the interpreter but can get the VM and (later) current active realm from there - and also the global object while we still need it, although I'd like to remove Interpreter::global_object() in the future. This now matches the bytecode interpreter's execute_impl() functions.
This commit is contained in:
parent
e992a9f469
commit
5398dcc55e
10 changed files with 409 additions and 357 deletions
|
@ -48,7 +48,7 @@ create_ast_node(SourceRange range, Args&&... args)
|
|||
class ASTNode : public RefCounted<ASTNode> {
|
||||
public:
|
||||
virtual ~ASTNode() = default;
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const = 0;
|
||||
virtual Completion execute(Interpreter&) const = 0;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const;
|
||||
virtual void dump(int indent) const;
|
||||
|
||||
|
@ -111,7 +111,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_labelled_evaluation(Bytecode::Generator&, Vector<FlyString> const&) const;
|
||||
|
@ -143,7 +143,7 @@ class IterationStatement : public Statement {
|
|||
public:
|
||||
using Statement::Statement;
|
||||
|
||||
virtual Completion loop_evaluation(Interpreter&, GlobalObject&, Vector<FlyString> const&) const = 0;
|
||||
virtual Completion loop_evaluation(Interpreter&, Vector<FlyString> const&) const = 0;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_labelled_evaluation(Bytecode::Generator&, Vector<FlyString> const&) const;
|
||||
|
||||
private:
|
||||
|
@ -156,7 +156,7 @@ public:
|
|||
: Statement(source_range)
|
||||
{
|
||||
}
|
||||
Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
Completion execute(Interpreter&) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
};
|
||||
|
||||
|
@ -166,7 +166,7 @@ public:
|
|||
: Statement(source_range)
|
||||
{
|
||||
}
|
||||
Completion execute(Interpreter&, GlobalObject&) const override { return {}; }
|
||||
Completion execute(Interpreter&) const override { return {}; }
|
||||
};
|
||||
|
||||
class ExpressionStatement final : public Statement {
|
||||
|
@ -177,7 +177,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -235,7 +235,7 @@ public:
|
|||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
Completion evaluate_statements(Interpreter& interpreter, GlobalObject& global_object) const;
|
||||
Completion evaluate_statements(Interpreter&) const;
|
||||
|
||||
void add_var_scoped_declaration(NonnullRefPtr<Declaration> variables);
|
||||
void add_lexical_declaration(NonnullRefPtr<Declaration> variables);
|
||||
|
@ -255,7 +255,7 @@ public:
|
|||
ThrowCompletionOr<void> for_each_var_function_declaration_in_reverse_order(ThrowCompletionOrVoidCallback<FunctionDeclaration const&>&& callback) const;
|
||||
ThrowCompletionOr<void> for_each_var_scoped_variable_declaration(ThrowCompletionOrVoidCallback<VariableDeclaration const&>&& callback) const;
|
||||
|
||||
void block_declaration_instantiation(Interpreter&, GlobalObject&, Environment*) const;
|
||||
void block_declaration_instantiation(Interpreter&, Environment*) const;
|
||||
|
||||
ThrowCompletionOr<void> for_each_function_hoistable_with_annexB_extension(ThrowCompletionOrVoidCallback<FunctionDeclaration&>&& callback) const;
|
||||
|
||||
|
@ -336,7 +336,7 @@ public:
|
|||
entry.m_module_request = &m_module_request;
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
|
||||
virtual void dump(int indent) const override;
|
||||
|
||||
|
@ -424,7 +424,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
|
||||
virtual void dump(int indent) const override;
|
||||
|
||||
|
@ -467,7 +467,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
|
||||
bool is_strict_mode() const { return m_is_strict_mode; }
|
||||
void set_strict_mode() { m_is_strict_mode = true; }
|
||||
|
@ -495,7 +495,7 @@ public:
|
|||
bool has_top_level_await() const { return m_has_top_level_await; }
|
||||
void set_has_top_level_await() { m_has_top_level_await = true; }
|
||||
|
||||
ThrowCompletionOr<void> global_declaration_instantiation(Interpreter&, GlobalObject&, GlobalEnvironment&) const;
|
||||
ThrowCompletionOr<void> global_declaration_instantiation(Interpreter&, GlobalEnvironment&) const;
|
||||
|
||||
private:
|
||||
virtual bool is_program() const override { return true; }
|
||||
|
@ -514,7 +514,7 @@ public:
|
|||
: ScopeNode(source_range)
|
||||
{
|
||||
}
|
||||
Completion execute(Interpreter& interpreter, GlobalObject& object) const override;
|
||||
Completion execute(Interpreter&) const override;
|
||||
};
|
||||
|
||||
class FunctionBody final : public ScopeNode {
|
||||
|
@ -528,7 +528,7 @@ public:
|
|||
|
||||
bool in_strict_mode() const { return m_in_strict_mode; }
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
|
||||
private:
|
||||
bool m_in_strict_mode { false };
|
||||
|
@ -540,7 +540,7 @@ public:
|
|||
: ASTNode(source_range)
|
||||
{
|
||||
}
|
||||
virtual ThrowCompletionOr<Reference> to_reference(Interpreter&, GlobalObject&) const;
|
||||
virtual ThrowCompletionOr<Reference> to_reference(Interpreter&) const;
|
||||
};
|
||||
|
||||
class Declaration : public Statement {
|
||||
|
@ -564,7 +564,7 @@ public:
|
|||
: Declaration(source_range)
|
||||
{
|
||||
}
|
||||
Completion execute(Interpreter&, GlobalObject&) const override { return {}; }
|
||||
Completion execute(Interpreter&) const override { return {}; }
|
||||
|
||||
ThrowCompletionOr<void> for_each_bound_name(ThrowCompletionOrVoidCallback<FlyString const&>&&) const override
|
||||
{
|
||||
|
@ -662,7 +662,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -688,14 +688,14 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
bool has_name() const { return !name().is_empty(); }
|
||||
|
||||
Value instantiate_ordinary_function_expression(Interpreter& interpreter, GlobalObject& global_object, FlyString given_name) const;
|
||||
Value instantiate_ordinary_function_expression(Interpreter&, FlyString given_name) const;
|
||||
|
||||
private:
|
||||
virtual bool is_function_expression() const override { return true; }
|
||||
|
@ -708,7 +708,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
Completion execute(Interpreter&, GlobalObject&) const override { return {}; }
|
||||
Completion execute(Interpreter&) const override { return {}; }
|
||||
};
|
||||
|
||||
class YieldExpression final : public Expression {
|
||||
|
@ -723,7 +723,7 @@ public:
|
|||
Expression const* argument() const { return m_argument; }
|
||||
bool is_yield_from() const { return m_is_yield_from; }
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -740,7 +740,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -758,7 +758,7 @@ public:
|
|||
|
||||
Expression const* argument() const { return m_argument; }
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -780,7 +780,7 @@ public:
|
|||
Statement const& consequent() const { return *m_consequent; }
|
||||
Statement const* alternate() const { return m_alternate; }
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -802,8 +802,8 @@ public:
|
|||
Expression const& test() const { return *m_test; }
|
||||
Statement const& body() const { return *m_body; }
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion loop_evaluation(Interpreter&, GlobalObject&, Vector<FlyString> const&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual Completion loop_evaluation(Interpreter&, Vector<FlyString> const&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_labelled_evaluation(Bytecode::Generator&, Vector<FlyString> const&) const override;
|
||||
|
@ -825,8 +825,8 @@ public:
|
|||
Expression const& test() const { return *m_test; }
|
||||
Statement const& body() const { return *m_body; }
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion loop_evaluation(Interpreter&, GlobalObject&, Vector<FlyString> const&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual Completion loop_evaluation(Interpreter&, Vector<FlyString> const&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_labelled_evaluation(Bytecode::Generator&, Vector<FlyString> const&) const override;
|
||||
|
@ -848,7 +848,7 @@ public:
|
|||
Expression const& object() const { return *m_object; }
|
||||
Statement const& body() const { return *m_body; }
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -873,8 +873,8 @@ public:
|
|||
Expression const* update() const { return m_update; }
|
||||
Statement const& body() const { return *m_body; }
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion loop_evaluation(Interpreter&, GlobalObject&, Vector<FlyString> const&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual Completion loop_evaluation(Interpreter&, Vector<FlyString> const&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_labelled_evaluation(Bytecode::Generator&, Vector<FlyString> const&) const override;
|
||||
|
@ -900,10 +900,10 @@ public:
|
|||
Expression const& rhs() const { return *m_rhs; }
|
||||
Statement const& body() const { return *m_body; }
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_labelled_evaluation(Bytecode::Generator&, Vector<FlyString> const&) const override;
|
||||
virtual Completion loop_evaluation(Interpreter&, GlobalObject&, Vector<FlyString> const&) const override;
|
||||
virtual Completion loop_evaluation(Interpreter&, Vector<FlyString> const&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
|
||||
private:
|
||||
|
@ -926,10 +926,10 @@ public:
|
|||
Expression const& rhs() const { return *m_rhs; }
|
||||
Statement const& body() const { return *m_body; }
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_labelled_evaluation(Bytecode::Generator&, Vector<FlyString> const&) const override;
|
||||
virtual Completion loop_evaluation(Interpreter&, GlobalObject&, Vector<FlyString> const&) const override;
|
||||
virtual Completion loop_evaluation(Interpreter&, Vector<FlyString> const&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
|
||||
private:
|
||||
|
@ -948,8 +948,8 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion loop_evaluation(Interpreter&, GlobalObject&, Vector<FlyString> const&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual Completion loop_evaluation(Interpreter&, Vector<FlyString> const&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
|
||||
private:
|
||||
|
@ -993,7 +993,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -1019,7 +1019,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -1048,7 +1048,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -1067,7 +1067,7 @@ public:
|
|||
}
|
||||
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
private:
|
||||
|
@ -1090,7 +1090,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -1106,7 +1106,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -1122,7 +1122,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -1139,7 +1139,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -1160,7 +1160,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
};
|
||||
|
@ -1177,7 +1177,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -1206,9 +1206,9 @@ public:
|
|||
FlyString const& string() const { return m_string; }
|
||||
void set_lexically_bound_function_argument_index(size_t index) { m_lexically_bound_function_argument = index; }
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual ThrowCompletionOr<Reference> to_reference(Interpreter&, GlobalObject&) const override;
|
||||
virtual ThrowCompletionOr<Reference> to_reference(Interpreter&) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
private:
|
||||
|
@ -1229,7 +1229,7 @@ public:
|
|||
|
||||
FlyString const& string() const { return m_string; }
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
|
||||
virtual bool is_private_identifier() const override { return true; }
|
||||
|
@ -1246,7 +1246,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
|
||||
enum class ElementKind {
|
||||
Method,
|
||||
|
@ -1259,7 +1259,7 @@ public:
|
|||
|
||||
// We use the Completion also as a ClassStaticBlockDefinition Record.
|
||||
using ClassValue = Variant<ClassFieldDefinition, Completion, PrivateElement>;
|
||||
virtual ThrowCompletionOr<ClassValue> class_element_evaluation(Interpreter&, GlobalObject&, Object& home_object) const = 0;
|
||||
virtual ThrowCompletionOr<ClassValue> class_element_evaluation(Interpreter&, Object& home_object) const = 0;
|
||||
|
||||
virtual Optional<FlyString> private_bound_identifier() const { return {}; };
|
||||
|
||||
|
@ -1288,7 +1288,7 @@ public:
|
|||
virtual ElementKind class_element_kind() const override { return ElementKind::Method; }
|
||||
|
||||
virtual void dump(int indent) const override;
|
||||
virtual ThrowCompletionOr<ClassValue> class_element_evaluation(Interpreter&, GlobalObject&, Object& home_object) const override;
|
||||
virtual ThrowCompletionOr<ClassValue> class_element_evaluation(Interpreter&, Object& home_object) const override;
|
||||
virtual Optional<FlyString> private_bound_identifier() const override;
|
||||
|
||||
private:
|
||||
|
@ -1315,7 +1315,7 @@ public:
|
|||
virtual ElementKind class_element_kind() const override { return ElementKind::Field; }
|
||||
|
||||
virtual void dump(int indent) const override;
|
||||
virtual ThrowCompletionOr<ClassValue> class_element_evaluation(Interpreter& interpreter, GlobalObject& object, Object& home_object) const override;
|
||||
virtual ThrowCompletionOr<ClassValue> class_element_evaluation(Interpreter&, Object& home_object) const override;
|
||||
virtual Optional<FlyString> private_bound_identifier() const override;
|
||||
|
||||
private:
|
||||
|
@ -1334,7 +1334,7 @@ public:
|
|||
}
|
||||
|
||||
virtual ElementKind class_element_kind() const override { return ElementKind::StaticInitializer; }
|
||||
virtual ThrowCompletionOr<ClassValue> class_element_evaluation(Interpreter&, GlobalObject&, Object& home_object) const override;
|
||||
virtual ThrowCompletionOr<ClassValue> class_element_evaluation(Interpreter&, Object& home_object) const override;
|
||||
|
||||
virtual void dump(int indent) const override;
|
||||
|
||||
|
@ -1350,7 +1350,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
|
||||
virtual bool is_super_expression() const override { return true; }
|
||||
|
@ -1372,13 +1372,13 @@ public:
|
|||
String const& source_text() const { return m_source_text; }
|
||||
RefPtr<FunctionExpression> constructor() const { return m_constructor; }
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
bool has_name() const { return !m_name.is_empty(); }
|
||||
|
||||
ThrowCompletionOr<ECMAScriptFunctionObject*> class_definition_evaluation(Interpreter& interpreter, GlobalObject& global_object, FlyString const& binding_name = {}, FlyString const& class_name = {}) const;
|
||||
ThrowCompletionOr<ECMAScriptFunctionObject*> class_definition_evaluation(Interpreter&, FlyString const& binding_name = {}, FlyString const& class_name = {}) const;
|
||||
|
||||
private:
|
||||
virtual bool is_class_expression() const override { return true; }
|
||||
|
@ -1398,7 +1398,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -1424,7 +1424,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
|
||||
private:
|
||||
|
@ -1437,7 +1437,7 @@ public:
|
|||
: Expression(source_range)
|
||||
{
|
||||
}
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
};
|
||||
|
@ -1456,7 +1456,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -1465,7 +1465,7 @@ public:
|
|||
protected:
|
||||
virtual bool is_call_expression() const override { return true; }
|
||||
|
||||
Completion throw_type_error_for_callee(Interpreter&, GlobalObject&, Value callee_value, StringView call_type) const;
|
||||
Completion throw_type_error_for_callee(Interpreter&, Value callee_value, StringView call_type) const;
|
||||
|
||||
NonnullRefPtr<Expression> m_callee;
|
||||
Vector<Argument> const m_arguments;
|
||||
|
@ -1475,7 +1475,7 @@ private:
|
|||
Value this_value;
|
||||
Value callee;
|
||||
};
|
||||
ThrowCompletionOr<ThisAndCallee> compute_this_and_callee(Interpreter&, GlobalObject&, Reference const&) const;
|
||||
ThrowCompletionOr<ThisAndCallee> compute_this_and_callee(Interpreter&, Reference const&) const;
|
||||
};
|
||||
|
||||
class NewExpression final : public CallExpression {
|
||||
|
@ -1485,7 +1485,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
|
||||
virtual bool is_new_expression() const override { return true; }
|
||||
};
|
||||
|
@ -1514,7 +1514,7 @@ public:
|
|||
VERIFY(is_part_of_synthetic_constructor == IsPartOfSyntheticConstructor::Yes);
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
|
||||
private:
|
||||
|
@ -1559,7 +1559,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -1584,7 +1584,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -1627,7 +1627,7 @@ public:
|
|||
auto& target() const { return m_target; }
|
||||
Expression const* init() const { return m_init; }
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
|
||||
private:
|
||||
|
@ -1646,7 +1646,7 @@ public:
|
|||
|
||||
DeclarationKind declaration_kind() const { return m_declaration_kind; }
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -1695,7 +1695,7 @@ public:
|
|||
bool is_method() const { return m_is_method; }
|
||||
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
|
||||
private:
|
||||
NonnullRefPtr<Expression> m_key;
|
||||
|
@ -1713,7 +1713,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -1736,7 +1736,7 @@ public:
|
|||
|
||||
Vector<RefPtr<Expression>> const& elements() const { return m_elements; }
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -1761,7 +1761,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -1782,11 +1782,11 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
ThrowCompletionOr<Value> get_template_object(Interpreter& interpreter, GlobalObject& global_object) const;
|
||||
ThrowCompletionOr<Value> get_template_object(Interpreter&) const;
|
||||
|
||||
private:
|
||||
NonnullRefPtr<Expression> const m_tag;
|
||||
|
@ -1804,9 +1804,9 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual ThrowCompletionOr<Reference> to_reference(Interpreter&, GlobalObject&) const override;
|
||||
virtual ThrowCompletionOr<Reference> to_reference(Interpreter&) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
bool is_computed() const { return m_computed; }
|
||||
|
@ -1858,8 +1858,8 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter& interpreter, GlobalObject& global_object) const override;
|
||||
virtual ThrowCompletionOr<JS::Reference> to_reference(Interpreter& interpreter, GlobalObject& global_object) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual ThrowCompletionOr<JS::Reference> to_reference(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
|
||||
private:
|
||||
|
@ -1867,7 +1867,7 @@ private:
|
|||
JS::Reference reference;
|
||||
Value value;
|
||||
};
|
||||
ThrowCompletionOr<ReferenceAndValue> to_reference_and_value(Interpreter&, GlobalObject&) const;
|
||||
ThrowCompletionOr<ReferenceAndValue> to_reference_and_value(Interpreter&) const;
|
||||
|
||||
NonnullRefPtr<Expression> m_base;
|
||||
Vector<Reference> m_references;
|
||||
|
@ -1886,7 +1886,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
|
@ -1904,7 +1904,7 @@ public:
|
|||
}
|
||||
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
|
||||
private:
|
||||
virtual bool is_import_call() const override { return true; }
|
||||
|
@ -1924,7 +1924,7 @@ public:
|
|||
}
|
||||
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
private:
|
||||
|
@ -1953,7 +1953,7 @@ public:
|
|||
BlockStatement const& body() const { return m_body; }
|
||||
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
|
||||
private:
|
||||
Variant<FlyString, NonnullRefPtr<BindingPattern>> m_parameter;
|
||||
|
@ -1975,7 +1975,7 @@ public:
|
|||
BlockStatement const* finalizer() const { return m_finalizer; }
|
||||
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
private:
|
||||
|
@ -1995,7 +1995,7 @@ public:
|
|||
Expression const& argument() const { return m_argument; }
|
||||
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
private:
|
||||
|
@ -2013,7 +2013,7 @@ public:
|
|||
Expression const* test() const { return m_test; }
|
||||
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
|
||||
private:
|
||||
RefPtr<Expression> m_test;
|
||||
|
@ -2028,11 +2028,11 @@ public:
|
|||
}
|
||||
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_labelled_evaluation(Bytecode::Generator&, Vector<FlyString> const&) const;
|
||||
|
||||
Completion execute_impl(Interpreter&, GlobalObject&) const;
|
||||
Completion execute_impl(Interpreter&) const;
|
||||
void add_case(NonnullRefPtr<SwitchCase> switch_case) { m_cases.append(move(switch_case)); }
|
||||
|
||||
private:
|
||||
|
@ -2048,7 +2048,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
|
||||
FlyString const& target_label() const { return m_target_label; }
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
@ -2065,7 +2065,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
FlyString const& target_label() const { return m_target_label; }
|
||||
|
@ -2081,7 +2081,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual Completion execute(Interpreter&) const override;
|
||||
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||
};
|
||||
|
||||
|
@ -2094,8 +2094,8 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual Completion execute(Interpreter&, GlobalObject&) const override { return m_value; }
|
||||
virtual ThrowCompletionOr<Reference> to_reference(Interpreter&, GlobalObject&) const override { return m_reference; }
|
||||
virtual Completion execute(Interpreter&) const override { return m_value; }
|
||||
virtual ThrowCompletionOr<Reference> to_reference(Interpreter&) const override { return m_reference; }
|
||||
|
||||
private:
|
||||
Reference m_reference;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue