@@ -1099,26 +1099,18 @@ apply_field_attribute_reader(pTHX_ PADNAME *pn, SV *value)
1099
1099
1100
1100
I32 save_ix = block_start (TRUE);
1101
1101
1102
+ subsignature_start ();
1103
+
1102
1104
PADOFFSET padix ;
1103
1105
1104
1106
padix = pad_add_name_pvs ("$self" , 0 , NULL , NULL );
1105
1107
assert (padix == PADIX_SELF );
1106
1108
1109
+ OP * sigop = subsignature_finish ();
1110
+
1107
1111
padix = pad_import_field (pn );
1108
1112
intro_my ();
1109
1113
1110
- OP * argcheckop ;
1111
- {
1112
- struct op_argcheck_aux * aux = (struct op_argcheck_aux * )
1113
- PerlMemShared_malloc (sizeof (* aux ));
1114
-
1115
- aux -> params = 0 ;
1116
- aux -> opt_params = 0 ;
1117
- aux -> slurpy = 0 ;
1118
-
1119
- argcheckop = newUNOP_AUX (OP_ARGCHECK , 0 , NULL , (UNOP_AUX_item * )aux );
1120
- }
1121
-
1122
1114
OP * retop ;
1123
1115
{
1124
1116
OPCODE optype = 0 ;
@@ -1135,7 +1127,7 @@ apply_field_attribute_reader(pTHX_ PADNAME *pn, SV *value)
1135
1127
}
1136
1128
1137
1129
OP * ops = newLISTOPn (OP_LINESEQ , 0 ,
1138
- argcheckop ,
1130
+ sigop ,
1139
1131
retop ,
1140
1132
NULL );
1141
1133
@@ -1149,18 +1141,6 @@ apply_field_attribute_reader(pTHX_ PADNAME *pn, SV *value)
1149
1141
CvIsMETHOD_on (cv );
1150
1142
}
1151
1143
1152
- /* If '@_' is called "snail", then elements of it can be called "slugs"; i.e.
1153
- * snails out of their container. */
1154
- #define newSLUGOP (idx ) S_newSLUGOP(aTHX_ idx)
1155
- static OP *
1156
- S_newSLUGOP (pTHX_ IV idx )
1157
- {
1158
- assert (idx >= 0 && idx <= 255 );
1159
- OP * op = newGVOP (OP_AELEMFAST , 0 , PL_defgv );
1160
- op -> op_private = idx ;
1161
- return op ;
1162
- }
1163
-
1164
1144
static void
1165
1145
apply_field_attribute_writer (pTHX_ PADNAME * pn , SV * value )
1166
1146
{
@@ -1186,36 +1166,35 @@ apply_field_attribute_writer(pTHX_ PADNAME *pn, SV *value)
1186
1166
1187
1167
I32 save_ix = block_start (TRUE);
1188
1168
1169
+ subsignature_start ();
1170
+
1189
1171
PADOFFSET padix ;
1190
1172
1191
1173
padix = pad_add_name_pvs ("$self" , 0 , NULL , NULL );
1192
1174
assert (padix == PADIX_SELF );
1193
1175
1194
- padix = pad_import_field (pn );
1176
+ /* param pad variable doesn't technically need a name, so don't bother as
1177
+ * reusing the field name will provoke a warning */
1178
+ PADOFFSET param_padix = padix = pad_add_name_pvn ("$" , 1 , 0 , NULL , NULL );
1195
1179
intro_my ();
1196
1180
1197
- OP * argcheckop ;
1198
- {
1199
- struct op_argcheck_aux * aux = (struct op_argcheck_aux * )
1200
- PerlMemShared_malloc (sizeof (* aux ));
1181
+ subsignature_append_positional (param_padix , 0 , NULL );
1201
1182
1202
- aux -> params = 1 ;
1203
- aux -> opt_params = 0 ;
1204
- aux -> slurpy = 0 ;
1183
+ OP * sigop = subsignature_finish ();
1205
1184
1206
- argcheckop = newUNOP_AUX ( OP_ARGCHECK , 0 , NULL , ( UNOP_AUX_item * ) aux );
1207
- }
1185
+ padix = pad_import_field ( pn );
1186
+ intro_my ();
1208
1187
1209
1188
OP * assignop = newBINOP (OP_SASSIGN , 0 ,
1210
- newSLUGOP ( 0 ),
1189
+ newPADxVOP ( OP_PADSV , 0 , param_padix ),
1211
1190
newPADxVOP (OP_PADSV , OPf_MOD |OPf_REF , padix ));
1212
1191
1213
1192
OP * retop = newLISTOP (OP_RETURN , 0 ,
1214
1193
newOP (OP_PUSHMARK , 0 ),
1215
1194
newPADxVOP (OP_PADSV , 0 , PADIX_SELF ));
1216
1195
1217
1196
OP * ops = newLISTOPn (OP_LINESEQ , 0 ,
1218
- argcheckop ,
1197
+ sigop ,
1219
1198
assignop ,
1220
1199
retop ,
1221
1200
NULL );
0 commit comments