2020-03-18 16:21:06 -03:00
|
|
|
/*
|
2024-10-04 08:19:50 -03:00
|
|
|
* Copyright (c) 2020, Andreas Kling <andreas@ladybird.org>
|
2020-03-18 16:21:06 -03:00
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-03-18 16:21:06 -03:00
|
|
|
*/
|
|
|
|
|
|
2024-11-14 04:22:33 -03:00
|
|
|
#include <LibJS/Heap/CellImpl.h>
|
2020-03-18 16:03:17 -03:00
|
|
|
#include <LibJS/Heap/Handle.h>
|
2024-08-18 20:51:04 -03:00
|
|
|
#include <LibJS/Heap/Heap.h>
|
2020-03-18 16:03:17 -03:00
|
|
|
|
|
|
|
|
namespace JS {
|
|
|
|
|
|
2024-11-14 04:22:33 -03:00
|
|
|
HandleImpl::HandleImpl(CellImpl* cell, SourceLocation location)
|
2020-03-18 16:03:17 -03:00
|
|
|
: m_cell(cell)
|
2023-09-21 21:04:16 -03:00
|
|
|
, m_location(location)
|
2020-03-18 16:03:17 -03:00
|
|
|
{
|
|
|
|
|
m_cell->heap().did_create_handle({}, *this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HandleImpl::~HandleImpl()
|
|
|
|
|
{
|
|
|
|
|
m_cell->heap().did_destroy_handle({}, *this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|