mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibJS/Bytecode: Rename Call and SuperCall to &WithArgumentArray
Forcing every function call to allocate a new Array just to accommodate spread parameters is not very nice, so let's start moving towards making this a special case rather than the general (and only) case.
This commit is contained in:
@@ -770,17 +770,16 @@ public:
|
||||
DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const;
|
||||
};
|
||||
|
||||
// NOTE: This instruction is variable-width depending on the number of arguments!
|
||||
class Call final : public Instruction {
|
||||
public:
|
||||
enum class CallType {
|
||||
Call,
|
||||
Construct,
|
||||
DirectEval,
|
||||
};
|
||||
enum class CallType {
|
||||
Call,
|
||||
Construct,
|
||||
DirectEval,
|
||||
};
|
||||
|
||||
Call(CallType type, Register callee, Register this_value, Optional<StringTableIndex> expression_string = {})
|
||||
: Instruction(Type::Call)
|
||||
class CallWithArgumentArray final : public Instruction {
|
||||
public:
|
||||
CallWithArgumentArray(CallType type, Register callee, Register this_value, Optional<StringTableIndex> expression_string = {})
|
||||
: Instruction(Type::CallWithArgumentArray)
|
||||
, m_callee(callee)
|
||||
, m_this_value(this_value)
|
||||
, m_type(type)
|
||||
@@ -802,11 +801,10 @@ private:
|
||||
Optional<StringTableIndex> m_expression_string;
|
||||
};
|
||||
|
||||
// NOTE: This instruction is variable-width depending on the number of arguments!
|
||||
class SuperCall : public Instruction {
|
||||
class SuperCallWithArgumentArray : public Instruction {
|
||||
public:
|
||||
explicit SuperCall(bool is_synthetic)
|
||||
: Instruction(Type::SuperCall)
|
||||
explicit SuperCallWithArgumentArray(bool is_synthetic)
|
||||
: Instruction(Type::SuperCallWithArgumentArray)
|
||||
, m_is_synthetic(is_synthetic)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user