1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 02:47:34 +00:00

LibJS: Always inline Cell::vm() and Cell::heap()

This commit is contained in:
Andreas Kling 2021-03-21 17:20:07 +01:00
parent dc8817638e
commit 1fb50d823d
3 changed files with 11 additions and 10 deletions

View file

@ -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 {

View file

@ -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();
}
}

View file

@ -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();
}
}