@@ -105,7 +105,6 @@ where
105105 handler : H ,
106106 pub namespace : Spinlock < Namespace > ,
107107 pub object_token : Spinlock < ObjectToken > ,
108- context_stack : Spinlock < Vec < MethodContext > > ,
109108 dsdt_revision : u8 ,
110109 region_handlers : Spinlock < BTreeMap < RegionSpace , Box < dyn RegionHandler > > > ,
111110
@@ -141,7 +140,6 @@ where
141140 handler,
142141 namespace : Spinlock :: new ( Namespace :: new ( global_lock_mutex) ) ,
143142 object_token : Spinlock :: new ( unsafe { ObjectToken :: create_interpreter_token ( ) } ) ,
144- context_stack : Spinlock :: new ( Vec :: new ( ) ) ,
145143 dsdt_revision,
146144 region_handlers : Spinlock :: new ( BTreeMap :: new ( ) ) ,
147145 global_lock_mutex,
@@ -434,6 +432,8 @@ where
434432 * traditional fast bytecode VM, but also provides enough flexibility to handle the
435433 * quirkier parts of the AML grammar, particularly the left-to-right encoding of operands.
436434 */
435+ let mut context_stack: Vec < MethodContext > = Vec :: new ( ) ;
436+
437437 loop {
438438 /*
439439 * First, see if we've gathered enough arguments to complete some in-flight operations.
@@ -939,7 +939,7 @@ where
939939 let new_context =
940940 MethodContext :: new_from_method ( method. clone ( ) , args, method_scope. clone ( ) ) ?;
941941 let old_context = mem:: replace ( & mut context, new_context) ;
942- self . context_stack . lock ( ) . push ( old_context) ;
942+ context_stack. push ( old_context) ;
943943 context. retire_op ( op) ;
944944 } else if let Object :: NativeMethod { ref f, .. } = * * method {
945945 let result = f ( & args) ?;
@@ -952,7 +952,7 @@ where
952952 extract_args ! ( op => [ Argument :: Object ( object) ] ) ;
953953 let object = object. clone ( ) . unwrap_transparent_reference ( ) ;
954954
955- if let Some ( last) = self . context_stack . lock ( ) . pop ( ) {
955+ if let Some ( last) = context_stack. pop ( ) {
956956 context = last;
957957 context. contribute_arg ( Argument :: Object ( object. clone ( ) ) ) ;
958958 context. retire_op ( op) ;
@@ -1060,7 +1060,7 @@ where
10601060 BlockKind :: Method { method_scope } => {
10611061 self . namespace . lock ( ) . remove_level ( method_scope) ?;
10621062
1063- if let Some ( prev_context) = self . context_stack . lock ( ) . pop ( ) {
1063+ if let Some ( prev_context) = context_stack. pop ( ) {
10641064 context = prev_context;
10651065 continue ;
10661066 } else {
0 commit comments