From 231171364dce088c2e1cac6cb9ecff482b8cdf6d Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 8 Dec 2020 16:06:05 +0100 Subject: [PATCH] LibJS: Remove some unnecessary null checks It's okay to add nullptr to the conservative roots set. We'll just ignore it later on anyway. --- Libraries/LibJS/Runtime/VM.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Libraries/LibJS/Runtime/VM.cpp b/Libraries/LibJS/Runtime/VM.cpp index 29fad69f4b0..ee5c96f38ee 100644 --- a/Libraries/LibJS/Runtime/VM.cpp +++ b/Libraries/LibJS/Runtime/VM.cpp @@ -105,9 +105,7 @@ void VM::gather_roots(HashTable& roots) roots.set(string); roots.set(m_scope_object_shape); - - if (m_exception) - roots.set(m_exception); + roots.set(m_exception); if (m_last_value.is_cell()) roots.set(m_last_value.as_cell()); @@ -115,8 +113,7 @@ void VM::gather_roots(HashTable& roots) for (auto& call_frame : m_call_stack) { if (call_frame->this_value.is_cell()) roots.set(call_frame->this_value.as_cell()); - if (call_frame->arguments_object) - roots.set(call_frame->arguments_object); + roots.set(call_frame->arguments_object); for (auto& argument : call_frame->arguments) { if (argument.is_cell()) roots.set(argument.as_cell());