@@ -1061,52 +1061,54 @@ vm_caller_setup_arg_block(const rb_execution_context_t *ec, rb_control_frame_t *
10611061static void vm_adjust_stack_forwarding (const struct rb_execution_context_struct * ec , struct rb_control_frame_struct * cfp , CALL_INFO callers_info , VALUE splat );
10621062
10631063static VALUE
1064- vm_caller_setup_args (const rb_execution_context_t * ec , rb_control_frame_t * reg_cfp ,
1064+ vm_caller_setup_fwd_args (const rb_execution_context_t * ec , rb_control_frame_t * reg_cfp ,
10651065 CALL_DATA * cd , const rb_iseq_t * blockiseq , const int is_super ,
10661066 struct rb_forwarding_call_data * adjusted_cd , struct rb_callinfo * adjusted_ci )
10671067{
10681068 CALL_INFO site_ci = (* cd )-> ci ;
10691069 VALUE bh = Qundef ;
10701070
1071- if (vm_ci_flag (site_ci ) & VM_CALL_FORWARDING ) {
1072- RUBY_ASSERT (ISEQ_BODY (ISEQ_BODY (GET_ISEQ ())-> local_iseq )-> param .flags .forwardable );
1073- CALL_INFO caller_ci = (CALL_INFO )TOPN (0 );
1071+ RUBY_ASSERT (ISEQ_BODY (ISEQ_BODY (GET_ISEQ ())-> local_iseq )-> param .flags .forwardable );
1072+ CALL_INFO caller_ci = (CALL_INFO )TOPN (0 );
10741073
1075- unsigned int forwarding_argc = vm_ci_argc (site_ci );
1076- VALUE splat = Qfalse ;
1074+ unsigned int forwarding_argc = vm_ci_argc (site_ci );
1075+ VALUE splat = Qfalse ;
10771076
1078- if (vm_ci_flag (site_ci ) & VM_CALL_ARGS_SPLAT ) {
1079- // If we're called with args_splat, the top 1 should be an array
1080- splat = TOPN (1 );
1081- forwarding_argc += (RARRAY_LEN (splat ) - 1 );
1082- }
1077+ if (vm_ci_flag (site_ci ) & VM_CALL_ARGS_SPLAT ) {
1078+ // If we're called with args_splat, the top 1 should be an array
1079+ splat = TOPN (1 );
1080+ forwarding_argc += (RARRAY_LEN (splat ) - 1 );
1081+ }
10831082
1084- // Need to setup the block in case of e.g. `super { :block }`
1085- if (is_super && blockiseq ) {
1086- bh = vm_caller_setup_arg_block (ec , GET_CFP (), site_ci , blockiseq , is_super );
1087- }
1088- else {
1089- bh = VM_ENV_BLOCK_HANDLER (GET_LEP ());
1090- }
1083+ // Need to setup the block in case of e.g. `super { :block }`
1084+ if (is_super && blockiseq ) {
1085+ bh = vm_caller_setup_arg_block (ec , GET_CFP (), site_ci , blockiseq , is_super );
1086+ }
1087+ else {
1088+ bh = VM_ENV_BLOCK_HANDLER (GET_LEP ());
1089+ }
10911090
1092- vm_adjust_stack_forwarding (ec , GET_CFP (), caller_ci , splat );
1091+ vm_adjust_stack_forwarding (ec , GET_CFP (), caller_ci , splat );
10931092
1094- * adjusted_ci = VM_CI_ON_STACK (
1093+ * adjusted_ci = VM_CI_ON_STACK (
10951094 vm_ci_mid (site_ci ),
10961095 (vm_ci_flag (caller_ci ) | (vm_ci_flag (site_ci ) & (VM_CALL_FCALL | VM_CALL_FORWARDING ))),
10971096 forwarding_argc + vm_ci_argc (caller_ci ),
10981097 vm_ci_kwarg (caller_ci )
1099- );
1098+ );
11001099
1101- adjusted_cd -> cd .ci = adjusted_ci ;
1102- adjusted_cd -> cd .cc = (* cd )-> cc ;
1103- adjusted_cd -> caller_ci = caller_ci ;
1100+ adjusted_cd -> cd .ci = adjusted_ci ;
1101+ adjusted_cd -> cd .cc = (* cd )-> cc ;
1102+ adjusted_cd -> caller_ci = caller_ci ;
11041103
1105- * cd = & adjusted_cd -> cd ;
1106- }
1107- else {
1108- bh = vm_caller_setup_arg_block (ec , GET_CFP (), site_ci , blockiseq , is_super );
1109- }
1104+ * cd = & adjusted_cd -> cd ;
11101105
11111106 return bh ;
11121107}
1108+
1109+ static VALUE
1110+ vm_caller_setup_args (const rb_execution_context_t * ec , rb_control_frame_t * reg_cfp ,
1111+ CALL_DATA * cd , const rb_iseq_t * blockiseq , const int is_super )
1112+ {
1113+ return vm_caller_setup_arg_block (ec , GET_CFP (), (* cd )-> ci , blockiseq , is_super );
1114+ }
0 commit comments