mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibJS: Make Value::as_cell() return a Cell&
This commit is contained in:
parent
0de954e86b
commit
47a4b2ba9f
Notes:
sideshowbarker
2024-07-18 17:25:04 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/47a4b2ba9f9
3 changed files with 7 additions and 7 deletions
|
@ -92,7 +92,7 @@ void Heap::gather_roots(HashTable<Cell*>& roots)
|
|||
for (auto* list : m_marked_value_lists) {
|
||||
for (auto& value : list->values()) {
|
||||
if (value.is_cell())
|
||||
roots.set(value.as_cell());
|
||||
roots.set(&value.as_cell());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -93,15 +93,15 @@ void VM::gather_roots(HashTable<Cell*>& roots)
|
|||
roots.set(m_exception);
|
||||
|
||||
if (m_last_value.is_cell())
|
||||
roots.set(m_last_value.as_cell());
|
||||
roots.set(&m_last_value.as_cell());
|
||||
|
||||
for (auto& call_frame : m_call_stack) {
|
||||
if (call_frame->this_value.is_cell())
|
||||
roots.set(call_frame->this_value.as_cell());
|
||||
roots.set(&call_frame->this_value.as_cell());
|
||||
roots.set(call_frame->arguments_object);
|
||||
for (auto& argument : call_frame->arguments) {
|
||||
if (argument.is_cell())
|
||||
roots.set(argument.as_cell());
|
||||
roots.set(&argument.as_cell());
|
||||
}
|
||||
roots.set(call_frame->scope);
|
||||
}
|
||||
|
|
|
@ -222,10 +222,10 @@ public:
|
|||
return *m_value.as_symbol;
|
||||
}
|
||||
|
||||
Cell* as_cell()
|
||||
Cell& as_cell()
|
||||
{
|
||||
VERIFY(is_cell());
|
||||
return m_value.as_cell;
|
||||
return *m_value.as_cell;
|
||||
}
|
||||
|
||||
Accessor& as_accessor()
|
||||
|
@ -330,7 +330,7 @@ inline Value js_negative_infinity()
|
|||
inline void Cell::Visitor::visit(Value value)
|
||||
{
|
||||
if (value.is_cell())
|
||||
visit_impl(*value.as_cell());
|
||||
visit_impl(value.as_cell());
|
||||
}
|
||||
|
||||
Value greater_than(GlobalObject&, Value lhs, Value rhs);
|
||||
|
|
Loading…
Reference in a new issue