@@ -252,19 +252,23 @@ def to_a
252
252
dumped_options = argument_options . dup
253
253
dumped_options [ :opt ] . map! ( &:name ) if dumped_options [ :opt ]
254
254
255
+ metadata = {
256
+ arg_size : argument_size ,
257
+ local_size : local_table . size ,
258
+ stack_max : stack . maximum_size ,
259
+ node_id : -1 ,
260
+ node_ids : [ -1 ] * insns . length ,
261
+ }
262
+
263
+ metadata [ :parser ] = :prism if RUBY_VERSION >= "3.3"
264
+
255
265
# Next, return the instruction sequence as an array.
256
266
[
257
267
MAGIC ,
258
268
versions [ 0 ] ,
259
269
versions [ 1 ] ,
260
270
1 ,
261
- {
262
- arg_size : argument_size ,
263
- local_size : local_table . size ,
264
- stack_max : stack . maximum_size ,
265
- node_id : -1 ,
266
- node_ids : [ -1 ] * insns . length
267
- } ,
271
+ metadata ,
268
272
name ,
269
273
file ,
270
274
"<compiled>" ,
@@ -689,6 +693,10 @@ def concatstrings(number)
689
693
push ( ConcatStrings . new ( number ) )
690
694
end
691
695
696
+ def concattoarray ( object )
697
+ push ( ConcatToArray . new ( object ) )
698
+ end
699
+
692
700
def defineclass ( name , class_iseq , flags )
693
701
push ( DefineClass . new ( name , class_iseq , flags ) )
694
702
end
@@ -897,6 +905,14 @@ def pop
897
905
push ( Pop . new )
898
906
end
899
907
908
+ def pushtoarraykwsplat
909
+ push ( PushToArrayKwSplat . new )
910
+ end
911
+
912
+ def putchilledstring ( object )
913
+ push ( PutChilledString . new ( object ) )
914
+ end
915
+
900
916
def putnil
901
917
push ( PutNil . new )
902
918
end
@@ -1079,6 +1095,8 @@ def self.from(source, options = Compiler::Options.new, parent_iseq = nil)
1079
1095
iseq . concatarray
1080
1096
when :concatstrings
1081
1097
iseq . concatstrings ( opnds [ 0 ] )
1098
+ when :concattoarray
1099
+ iseq . concattoarray ( opnds [ 0 ] )
1082
1100
when :defineclass
1083
1101
iseq . defineclass ( opnds [ 0 ] , from ( opnds [ 1 ] , options , iseq ) , opnds [ 2 ] )
1084
1102
when :defined
@@ -1191,8 +1209,13 @@ def self.from(source, options = Compiler::Options.new, parent_iseq = nil)
1191
1209
iseq . newarray ( opnds [ 0 ] )
1192
1210
iseq . send ( YARV . calldata ( :min ) )
1193
1211
when :opt_newarray_send
1212
+ mid = opnds [ 1 ]
1213
+ if RUBY_VERSION >= "3.4"
1214
+ mid = %i[ max min hash pack pack_buffer include? ] [ mid - 1 ]
1215
+ end
1216
+
1194
1217
iseq . newarray ( opnds [ 0 ] )
1195
- iseq . send ( CallData . new ( opnds [ 1 ] ) )
1218
+ iseq . send ( CallData . new ( mid ) )
1196
1219
when :opt_neq
1197
1220
iseq . push (
1198
1221
OptNEq . new ( CallData . from ( opnds [ 0 ] ) , CallData . from ( opnds [ 1 ] ) )
@@ -1207,6 +1230,10 @@ def self.from(source, options = Compiler::Options.new, parent_iseq = nil)
1207
1230
iseq . send ( YARV . calldata ( :-@ ) )
1208
1231
when :pop
1209
1232
iseq . pop
1233
+ when :pushtoarraykwsplat
1234
+ iseq . pushtoarraykwsplat
1235
+ when :putchilledstring
1236
+ iseq . putchilledstring ( opnds [ 0 ] )
1210
1237
when :putnil
1211
1238
iseq . putnil
1212
1239
when :putobject
0 commit comments