mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
LibJS: Make Heap own its own StackInfo instance
While this does mean that we keep one copy of the stack info in the VM, and another in the Heap; keeping a separate instance removes one more instance of coupling between the heap and LibJS specific details.
This commit is contained in:
parent
d199bf60cf
commit
eef9a53eec
Notes:
github-actions[bot]
2024-11-13 10:09:30 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/eef9a53eece Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2284
2 changed files with 3 additions and 2 deletions
|
@ -317,9 +317,8 @@ NO_SANITIZE_ADDRESS void Heap::gather_conservative_roots(HashMap<Cell*, HeapRoot
|
||||||
add_possible_value(possible_pointers, raw_jmp_buf[i], HeapRoot { .type = HeapRoot::Type::RegisterPointer }, min_block_address, max_block_address);
|
add_possible_value(possible_pointers, raw_jmp_buf[i], HeapRoot { .type = HeapRoot::Type::RegisterPointer }, min_block_address, max_block_address);
|
||||||
|
|
||||||
auto stack_reference = bit_cast<FlatPtr>(&dummy);
|
auto stack_reference = bit_cast<FlatPtr>(&dummy);
|
||||||
auto& stack_info = m_vm.stack_info();
|
|
||||||
|
|
||||||
for (FlatPtr stack_address = stack_reference; stack_address < stack_info.top(); stack_address += sizeof(FlatPtr)) {
|
for (FlatPtr stack_address = stack_reference; stack_address < m_stack_info.top(); stack_address += sizeof(FlatPtr)) {
|
||||||
auto data = *reinterpret_cast<FlatPtr*>(stack_address);
|
auto data = *reinterpret_cast<FlatPtr*>(stack_address);
|
||||||
add_possible_value(possible_pointers, data, HeapRoot { .type = HeapRoot::Type::StackPointer }, min_block_address, max_block_address);
|
add_possible_value(possible_pointers, data, HeapRoot { .type = HeapRoot::Type::StackPointer }, min_block_address, max_block_address);
|
||||||
gather_asan_fake_stack_roots(possible_pointers, data, min_block_address, max_block_address);
|
gather_asan_fake_stack_roots(possible_pointers, data, min_block_address, max_block_address);
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include <AK/IntrusiveList.h>
|
#include <AK/IntrusiveList.h>
|
||||||
#include <AK/Noncopyable.h>
|
#include <AK/Noncopyable.h>
|
||||||
#include <AK/NonnullOwnPtr.h>
|
#include <AK/NonnullOwnPtr.h>
|
||||||
|
#include <AK/StackInfo.h>
|
||||||
#include <AK/Types.h>
|
#include <AK/Types.h>
|
||||||
#include <AK/Vector.h>
|
#include <AK/Vector.h>
|
||||||
#include <LibCore/Forward.h>
|
#include <LibCore/Forward.h>
|
||||||
|
@ -155,6 +156,7 @@ private:
|
||||||
bool m_should_gc_when_deferral_ends { false };
|
bool m_should_gc_when_deferral_ends { false };
|
||||||
|
|
||||||
bool m_collecting_garbage { false };
|
bool m_collecting_garbage { false };
|
||||||
|
StackInfo m_stack_info;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void Heap::did_create_handle(Badge<HandleImpl>, HandleImpl& impl)
|
inline void Heap::did_create_handle(Badge<HandleImpl>, HandleImpl& impl)
|
||||||
|
|
Loading…
Reference in a new issue