1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:28:11 +00:00

LibJS: Pass argument value vectors as const Vector<Value>&

Now that Interpreter keeps all arguments in the CallFrame stack, we can
just pass a const-reference to the CallFrame's argument vector to each
function handler (instead of copying it.)
This commit is contained in:
Andreas Kling 2020-03-17 16:24:53 +01:00
parent bf9912cc59
commit 0a71533aff
8 changed files with 13 additions and 13 deletions

View file

@ -33,10 +33,10 @@ namespace JS {
class NativeFunction final : public Function {
public:
explicit NativeFunction(AK::Function<Value(Object*, Vector<Value>)>);
explicit NativeFunction(AK::Function<Value(Object*, const Vector<Value>&)>);
virtual ~NativeFunction() override;
virtual Value call(Interpreter&, Vector<Value>) override;
virtual Value call(Interpreter&, const Vector<Value>&) override;
private:
virtual bool is_native_function() const override { return true; }