mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibJS/Bytecode: Store Instruction length as u32
This makes every instruction 8 bytes smaller.
This commit is contained in:
parent
f6aee2b9e8
commit
4cf4ea92a7
Notes:
sideshowbarker
2024-07-17 06:51:10 +09:00
Author: https://github.com/awesomekling
Commit: 4cf4ea92a7
Pull-request: https://github.com/SerenityOS/serenity/pull/24240
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/trflynn89 ✅
2 changed files with 9 additions and 6 deletions
|
@ -10,6 +10,13 @@
|
|||
|
||||
namespace JS::Bytecode {
|
||||
|
||||
Instruction::Instruction(Type type, size_t length)
|
||||
: m_type(type)
|
||||
, m_length(length)
|
||||
{
|
||||
VERIFY(length <= NumericLimits<u32>::max());
|
||||
}
|
||||
|
||||
void Instruction::destroy(Instruction& instruction)
|
||||
{
|
||||
#define __BYTECODE_OP(op) \
|
||||
|
|
|
@ -145,18 +145,14 @@ public:
|
|||
SourceRecord source_record() const { return m_source_record; }
|
||||
|
||||
protected:
|
||||
Instruction(Type type, size_t length)
|
||||
: m_type(type)
|
||||
, m_length(length)
|
||||
{
|
||||
}
|
||||
Instruction(Type, size_t length);
|
||||
|
||||
void visit_labels_impl(Function<void(Label&)>) { }
|
||||
|
||||
private:
|
||||
SourceRecord m_source_record {};
|
||||
Type m_type {};
|
||||
size_t m_length {};
|
||||
u32 m_length {};
|
||||
};
|
||||
|
||||
class InstructionStreamIterator {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue