@@ -268,6 +268,7 @@ impl Frame {
268
268
}
269
269
}
270
270
271
+ #[ cfg_attr( feature = "flame-it" , flame( "Frame" ) ) ]
271
272
pub fn run ( & self , vm : & VirtualMachine ) -> Result < ExecutionResult , PyObjectRef > {
272
273
let filename = & self . code . source_path . to_string ( ) ;
273
274
@@ -334,6 +335,7 @@ impl Frame {
334
335
335
336
/// Execute a single instruction.
336
337
#[ allow( clippy:: cognitive_complexity) ]
338
+ #[ cfg_attr( feature = "flame-it" , flame( "Frame" ) ) ]
337
339
fn execute_instruction ( & self , vm : & VirtualMachine ) -> FrameResult {
338
340
let instruction = self . fetch_instruction ( ) ;
339
341
@@ -891,6 +893,7 @@ impl Frame {
891
893
}
892
894
}
893
895
896
+ #[ cfg_attr( feature = "flame-it" , flame( "Frame" ) ) ]
894
897
fn get_elements (
895
898
& self ,
896
899
vm : & VirtualMachine ,
@@ -912,6 +915,7 @@ impl Frame {
912
915
}
913
916
}
914
917
918
+ #[ cfg_attr( feature = "flame-it" , flame( "Frame" ) ) ]
915
919
fn import (
916
920
& self ,
917
921
vm : & VirtualMachine ,
@@ -938,6 +942,7 @@ impl Frame {
938
942
Ok ( None )
939
943
}
940
944
945
+ #[ cfg_attr( feature = "flame-it" , flame( "Frame" ) ) ]
941
946
fn import_star ( & self , vm : & VirtualMachine , module : & str , level : usize ) -> FrameResult {
942
947
let module = vm. import ( module, & vm. ctx . new_tuple ( vec ! [ ] ) , level) ?;
943
948
@@ -951,6 +956,7 @@ impl Frame {
951
956
}
952
957
953
958
// Unwind all blocks:
959
+ #[ cfg_attr( feature = "flame-it" , flame( "Frame" ) ) ]
954
960
fn unwind_blocks ( & self , vm : & VirtualMachine ) -> Option < PyObjectRef > {
955
961
while let Some ( block) = self . pop_block ( ) {
956
962
match block. typ {
@@ -978,6 +984,7 @@ impl Frame {
978
984
None
979
985
}
980
986
987
+ #[ cfg_attr( feature = "flame-it" , flame( "Frame" ) ) ]
981
988
fn unwind_loop ( & self , vm : & VirtualMachine ) -> Block {
982
989
loop {
983
990
let block = self . current_block ( ) . expect ( "not in a loop" ) ;
@@ -1003,6 +1010,7 @@ impl Frame {
1003
1010
}
1004
1011
}
1005
1012
1013
+ #[ cfg_attr( feature = "flame-it" , flame( "Frame" ) ) ]
1006
1014
fn unwind_exception ( & self , vm : & VirtualMachine , exc : PyObjectRef ) -> Option < PyObjectRef > {
1007
1015
// unwind block stack on exception and find any handlers:
1008
1016
while let Some ( block) = self . pop_block ( ) {
@@ -1105,6 +1113,7 @@ impl Frame {
1105
1113
}
1106
1114
}
1107
1115
1116
+ #[ cfg_attr( feature = "flame-it" , flame( "Frame" ) ) ]
1108
1117
fn load_name (
1109
1118
& self ,
1110
1119
vm : & VirtualMachine ,
@@ -1150,6 +1159,7 @@ impl Frame {
1150
1159
* self . lasti . borrow_mut ( ) = target_pc;
1151
1160
}
1152
1161
1162
+ #[ cfg_attr( feature = "flame-it" , flame( "Frame" ) ) ]
1153
1163
fn execute_binop (
1154
1164
& self ,
1155
1165
vm : & VirtualMachine ,
@@ -1194,6 +1204,7 @@ impl Frame {
1194
1204
Ok ( None )
1195
1205
}
1196
1206
1207
+ #[ cfg_attr( feature = "flame-it" , flame( "Frame" ) ) ]
1197
1208
fn execute_unop ( & self , vm : & VirtualMachine , op : & bytecode:: UnaryOperator ) -> FrameResult {
1198
1209
let a = self . pop_value ( ) ;
1199
1210
let value = match * op {
@@ -1234,6 +1245,7 @@ impl Frame {
1234
1245
Ok ( result)
1235
1246
}
1236
1247
1248
+ #[ cfg_attr( feature = "flame-it" , flame( "Frame" ) ) ]
1237
1249
fn execute_compare (
1238
1250
& self ,
1239
1251
vm : & VirtualMachine ,
@@ -1326,6 +1338,7 @@ impl Frame {
1326
1338
stack[ stack. len ( ) - depth - 1 ] . clone ( )
1327
1339
}
1328
1340
1341
+ #[ cfg_attr( feature = "flame-it" , flame( "Frame" ) ) ]
1329
1342
fn get_exception ( & self , vm : & VirtualMachine , none_allowed : bool ) -> PyResult {
1330
1343
let exception = self . pop_value ( ) ;
1331
1344
if none_allowed && vm. get_none ( ) . is ( & exception)
0 commit comments