mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:07:35 +00:00
LibJS: Add bytecode support for regexp literals
This commit is contained in:
parent
3ccf4dc7ad
commit
df65ff8a1e
5 changed files with 41 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue