@@ -11,7 +11,7 @@ use crate::{
1111 scripts_and_modules:: source_code:: SourceCode ,
1212 types:: { OrdinaryObject , String , Value } ,
1313 } ,
14- engine:: HeapAllocatedBytecode ,
14+ engine:: Executable ,
1515 heap:: element_array:: ElementsVector ,
1616} ;
1717
@@ -66,7 +66,7 @@ pub struct BuiltinConstructorHeapData {
6666 /// Base.
6767 pub ( crate ) is_derived : bool ,
6868 /// Stores the compiled bytecode of class field initializers.
69- pub ( crate ) compiled_initializer_bytecode : Option < HeapAllocatedBytecode > ,
69+ pub ( crate ) compiled_initializer_bytecode : Option < Executable > ,
7070 /// ### \[\[Environment]]
7171 ///
7272 /// This is required for class field initializers.
@@ -85,38 +85,14 @@ pub struct BuiltinConstructorHeapData {
8585 pub ( crate ) source_code : SourceCode ,
8686}
8787
88- // SAFETY: We promise not to ever mutate the Executable, especially not from
89- // foreign threads.
90- unsafe impl Send for BuiltinConstructorHeapData { }
91-
92- impl Drop for BuiltinConstructorHeapData {
93- fn drop ( & mut self ) {
94- if let Some ( exe) = self . compiled_initializer_bytecode . take ( ) {
95- // SAFETY: No references to this compiled bytecode should exist as
96- // otherwise we should not have been garbage collected.
97- unsafe { exe. drop ( ) } ;
98- }
99- }
100- }
101-
10288#[ derive( Debug ) ]
10389pub struct ECMAScriptFunctionHeapData {
10490 pub ( crate ) object_index : Option < OrdinaryObject > ,
10591 pub ( crate ) length : u8 ,
10692 pub ( crate ) ecmascript_function : ECMAScriptFunctionObjectHeapData ,
10793 /// Stores the compiled bytecode of an ECMAScript function.
108- pub ( crate ) compiled_bytecode : Option < HeapAllocatedBytecode > ,
94+ pub ( crate ) compiled_bytecode : Option < Executable > ,
10995 pub ( crate ) name : Option < String > ,
11096}
11197
11298unsafe impl Send for ECMAScriptFunctionHeapData { }
113-
114- impl Drop for ECMAScriptFunctionHeapData {
115- fn drop ( & mut self ) {
116- if let Some ( exe) = self . compiled_bytecode . take ( ) {
117- // SAFETY: No references to this compiled bytecode should exist as
118- // otherwise we should not have been garbage collected.
119- unsafe { exe. drop ( ) } ;
120- }
121- }
122- }
0 commit comments