| 
									
										
										
										
											2020-03-18 20:21:06 +01:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2021-04-22 01:24:48 -07:00
										 |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							| 
									
										
										
										
											2020-03-18 20:21:06 +01:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-17 19:50:20 +02:00
										 |  |  | #include <LibJS/Heap/Cell.h>
 | 
					
						
							| 
									
										
										
										
											2020-03-18 20:03:17 +01:00
										 |  |  | #include <LibJS/Heap/Handle.h>
 | 
					
						
							|  |  |  | #include <LibJS/Heap/Heap.h>
 | 
					
						
							| 
									
										
										
										
											2021-03-21 17:20:07 +01:00
										 |  |  | #include <LibJS/Runtime/VM.h>
 | 
					
						
							| 
									
										
										
										
											2020-03-18 20:03:17 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace JS { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | HandleImpl::HandleImpl(Cell* cell) | 
					
						
							|  |  |  |     : m_cell(cell) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_cell->heap().did_create_handle({}, *this); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | HandleImpl::~HandleImpl() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_cell->heap().did_destroy_handle({}, *this); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |