mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:37:35 +00:00
LibJS: Always inline Cell::vm() and Cell::heap()
This commit is contained in:
parent
dc8817638e
commit
1fb50d823d
3 changed files with 11 additions and 10 deletions
|
@ -27,6 +27,7 @@
|
|||
#include <LibJS/Heap/Handle.h>
|
||||
#include <LibJS/Heap/Heap.h>
|
||||
#include <LibJS/Runtime/Cell.h>
|
||||
#include <LibJS/Runtime/VM.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
|
|
|
@ -43,14 +43,4 @@ void Cell::Visitor::visit(Value value)
|
|||
visit_impl(value.as_cell());
|
||||
}
|
||||
|
||||
Heap& Cell::heap() const
|
||||
{
|
||||
return HeapBlock::from_cell(this)->heap();
|
||||
}
|
||||
|
||||
VM& Cell::vm() const
|
||||
{
|
||||
return heap().vm();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -284,4 +284,14 @@ template<>
|
|||
template<>
|
||||
[[nodiscard]] ALWAYS_INLINE Value VM::call(Function& function, Value this_value) { return call(function, this_value, Optional<MarkedValueList> {}); }
|
||||
|
||||
ALWAYS_INLINE Heap& Cell::heap() const
|
||||
{
|
||||
return HeapBlock::from_cell(this)->heap();
|
||||
}
|
||||
|
||||
ALWAYS_INLINE VM& Cell::vm() const
|
||||
{
|
||||
return heap().vm();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue