From 1fb50d823d17933a2488c888b7ebb8b340d50a91 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 21 Mar 2021 17:20:07 +0100 Subject: [PATCH] LibJS: Always inline Cell::vm() and Cell::heap() --- Userland/Libraries/LibJS/Heap/Handle.cpp | 1 + Userland/Libraries/LibJS/Runtime/Cell.cpp | 10 ---------- Userland/Libraries/LibJS/Runtime/VM.h | 10 ++++++++++ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Userland/Libraries/LibJS/Heap/Handle.cpp b/Userland/Libraries/LibJS/Heap/Handle.cpp index c1758ee429..7916fdffa5 100644 --- a/Userland/Libraries/LibJS/Heap/Handle.cpp +++ b/Userland/Libraries/LibJS/Heap/Handle.cpp @@ -27,6 +27,7 @@ #include #include #include +#include namespace JS { diff --git a/Userland/Libraries/LibJS/Runtime/Cell.cpp b/Userland/Libraries/LibJS/Runtime/Cell.cpp index 57543adc6c..929826fd23 100644 --- a/Userland/Libraries/LibJS/Runtime/Cell.cpp +++ b/Userland/Libraries/LibJS/Runtime/Cell.cpp @@ -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(); -} - } diff --git a/Userland/Libraries/LibJS/Runtime/VM.h b/Userland/Libraries/LibJS/Runtime/VM.h index 025d83e25e..ad8fc88db9 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.h +++ b/Userland/Libraries/LibJS/Runtime/VM.h @@ -284,4 +284,14 @@ template<> template<> [[nodiscard]] ALWAYS_INLINE Value VM::call(Function& function, Value this_value) { return call(function, this_value, Optional {}); } +ALWAYS_INLINE Heap& Cell::heap() const +{ + return HeapBlock::from_cell(this)->heap(); +} + +ALWAYS_INLINE VM& Cell::vm() const +{ + return heap().vm(); +} + }