@@ -169,7 +169,7 @@ impl Frame {
169
169
170
170
match & instruction {
171
171
bytecode:: Instruction :: LoadConst { ref value } => {
172
- let obj = self . unwrap_constant ( vm , value) ;
172
+ let obj = vm . ctx . unwrap_constant ( value) ;
173
173
self . push_value ( obj) ;
174
174
Ok ( None )
175
175
}
@@ -1026,25 +1026,6 @@ impl Frame {
1026
1026
Ok ( None )
1027
1027
}
1028
1028
1029
- fn unwrap_constant ( & self , vm : & VirtualMachine , value : & bytecode:: Constant ) -> PyObjectRef {
1030
- match * value {
1031
- bytecode:: Constant :: Integer { ref value } => vm. ctx . new_int ( value. clone ( ) ) ,
1032
- bytecode:: Constant :: Float { ref value } => vm. ctx . new_float ( * value) ,
1033
- bytecode:: Constant :: Complex { ref value } => vm. ctx . new_complex ( * value) ,
1034
- bytecode:: Constant :: String { ref value } => vm. new_str ( value. clone ( ) ) ,
1035
- bytecode:: Constant :: Bytes { ref value } => vm. ctx . new_bytes ( value. clone ( ) ) ,
1036
- bytecode:: Constant :: Boolean { ref value } => vm. new_bool ( value. clone ( ) ) ,
1037
- bytecode:: Constant :: Code { ref code } => vm. ctx . new_code_object ( code. clone ( ) ) ,
1038
- bytecode:: Constant :: Tuple { ref elements } => vm. ctx . new_tuple (
1039
- elements
1040
- . iter ( )
1041
- . map ( |value| self . unwrap_constant ( vm, value) )
1042
- . collect ( ) ,
1043
- ) ,
1044
- bytecode:: Constant :: None => vm. ctx . none ( ) ,
1045
- }
1046
- }
1047
-
1048
1029
pub fn get_lineno ( & self ) -> ast:: Location {
1049
1030
self . code . locations [ self . lasti ] . clone ( )
1050
1031
}
0 commit comments