Handle.cpp 462 B

12345678910111213141516171819202122232425
  1. /*
  2. * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibJS/Heap/Cell.h>
  7. #include <LibJS/Heap/Handle.h>
  8. #include <LibJS/Runtime/VM.h>
  9. namespace JS {
  10. HandleImpl::HandleImpl(Cell* cell, SourceLocation location)
  11. : m_cell(cell)
  12. , m_location(location)
  13. {
  14. m_cell->heap().did_create_handle({}, *this);
  15. }
  16. HandleImpl::~HandleImpl()
  17. {
  18. m_cell->heap().did_destroy_handle({}, *this);
  19. }
  20. }