1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:17:36 +00:00

LibJS: Add bytecode support for regexp literals

This commit is contained in:
Matthew Olsson 2021-06-19 17:17:40 -07:00 committed by Andreas Kling
parent 3ccf4dc7ad
commit df65ff8a1e
5 changed files with 41 additions and 0 deletions

View file

@ -162,6 +162,24 @@ public:
void replace_references_impl(BasicBlock const&, BasicBlock const&) { }
};
class NewRegExp final : public Instruction {
public:
NewRegExp(StringTableIndex source_index, StringTableIndex flags_index)
: Instruction(Type::NewRegExp)
, m_source_index(source_index)
, m_flags_index(flags_index)
{
}
void execute_impl(Bytecode::Interpreter&) const;
String to_string_impl(Bytecode::Executable const&) const;
void replace_references_impl(BasicBlock const&, BasicBlock const&) { }
private:
StringTableIndex m_source_index;
StringTableIndex m_flags_index;
};
// NOTE: This instruction is variable-width depending on the number of excluded names
class CopyObjectExcludingProperties final : public Instruction {
public: