mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
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.
This commit is contained in:
parent
d2e3e038d6
commit
231171364d
Notes:
sideshowbarker
2024-07-19 00:59:22 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/231171364dc
1 changed files with 2 additions and 5 deletions
|
@ -105,9 +105,7 @@ void VM::gather_roots(HashTable<Cell*>& 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<Cell*>& 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());
|
||||
|
|
Loading…
Reference in a new issue