mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:47:46 +00:00
LibJS: Support basic function calls in the bytecode world :^)
This patch adds the Call bytecode instruction which is emitted for the CallExpression AST node. It's pretty barebones and doesn't handle 'this' values properly, etc. But it can perform basic function calls! :^) Note that the called function will *not* execute as bytecode, but will simply fall back into the old codepath and use the AST interpreter.
This commit is contained in:
parent
1eafaf67fe
commit
dc63958478
4 changed files with 85 additions and 0 deletions
|
@ -272,6 +272,7 @@ public:
|
|||
|
||||
virtual Value execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Optional<Bytecode::Register> generate_bytecode(Bytecode::Generator&) const override;
|
||||
};
|
||||
|
||||
class FunctionExpression final
|
||||
|
@ -849,6 +850,7 @@ public:
|
|||
|
||||
virtual Value execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Optional<Bytecode::Register> generate_bytecode(Bytecode::Generator&) const override;
|
||||
|
||||
private:
|
||||
struct ThisAndCallee {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue