mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 07:55:07 +00:00
LibJS: Implement bytecode generation for BigInts
This commit is contained in:
parent
0975e08285
commit
50ece3dd1b
5 changed files with 38 additions and 0 deletions
|
@ -208,6 +208,13 @@ Optional<Bytecode::Register> NullLiteral::generate_bytecode(Bytecode::Generator&
|
|||
return dst;
|
||||
}
|
||||
|
||||
Optional<Bytecode::Register> BigIntLiteral::generate_bytecode(Bytecode::Generator& generator) const
|
||||
{
|
||||
auto dst = generator.allocate_register();
|
||||
generator.emit<Bytecode::Op::NewBigInt>(dst, Crypto::SignedBigInteger::from_base10(m_value.substring(0, m_value.length() - 1)));
|
||||
return dst;
|
||||
}
|
||||
|
||||
Optional<Bytecode::Register> StringLiteral::generate_bytecode(Bytecode::Generator& generator) const
|
||||
{
|
||||
auto dst = generator.allocate_register();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue