@@ -1187,40 +1187,15 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr
1187
1187
methodSlot = ip[3 ];
1188
1188
1189
1189
MethodTable *pClass = (MethodTable*)pMethod->pDataItems [ip[4 ]];
1190
- // FIXME: Duplicated code from CALL_INTERP_SLOT
1191
- size_t targetMethod = (size_t )pMethod->pDataItems [methodSlot];
1192
- MethodDesc *pMD = nullptr ;
1193
- if (targetMethod & INTERP_METHOD_HANDLE_TAG)
1194
- {
1195
- pMD = (MethodDesc*)(targetMethod & ~INTERP_METHOD_HANDLE_TAG);
1196
- }
1190
+ OBJECTREF objRef = AllocateObject (pClass);
1197
1191
1198
- // If we are constructing a type with a component size (i.e. a string) its constructor is a special
1199
- // fcall that is basically a static method that returns the new instance.
1200
- if (pMD && pClass->HasComponentSize ())
1201
- {
1202
- // Get the address of the fcall that implements the ctor
1203
- PCODE code = pMD->TryGetMultiCallableAddrOfCode (CORINFO_ACCESS_ANY);
1204
- assert (code);
1205
-
1206
- // callArgsOffset points to the ctor arguments, which are what the fcall expects.
1207
- // returnOffset points to where the new instance goes, and the fcall will write it there.
1208
- InvokeCompiledMethod (pMD, stack + callArgsOffset, stack + returnOffset, code);
1209
- ip += 5 ;
1210
- break ;
1211
- }
1212
- else
1213
- {
1214
- OBJECTREF objRef = AllocateObject (pClass);
1215
-
1216
- // This is return value
1217
- LOCAL_VAR (returnOffset, OBJECTREF) = objRef;
1218
- // Set `this` arg for ctor call
1219
- LOCAL_VAR (callArgsOffset, OBJECTREF) = objRef;
1220
- ip += 5 ;
1192
+ // This is return value
1193
+ LOCAL_VAR (returnOffset, OBJECTREF) = objRef;
1194
+ // Set `this` arg for ctor call
1195
+ LOCAL_VAR (callArgsOffset, OBJECTREF) = objRef;
1196
+ ip += 5 ;
1221
1197
1222
- goto CALL_INTERP_SLOT;
1223
- }
1198
+ goto CALL_INTERP_SLOT;
1224
1199
}
1225
1200
case INTOP_NEWOBJ_VT:
1226
1201
{
@@ -1239,6 +1214,32 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr
1239
1214
ip += 5 ;
1240
1215
goto CALL_INTERP_SLOT;
1241
1216
}
1217
+ case INTOP_NEWOBJ_VAROBJSIZE:
1218
+ {
1219
+ returnOffset = ip[1 ];
1220
+ callArgsOffset = ip[2 ];
1221
+ methodSlot = ip[3 ];
1222
+
1223
+ // FIXME: Duplicated code from CALL_INTERP_SLOT
1224
+ size_t targetMethod = (size_t )pMethod->pDataItems [methodSlot];
1225
+ MethodDesc *pMD = nullptr ;
1226
+ if (targetMethod & INTERP_METHOD_HANDLE_TAG)
1227
+ {
1228
+ pMD = (MethodDesc*)(targetMethod & ~INTERP_METHOD_HANDLE_TAG);
1229
+ }
1230
+
1231
+ // If we are constructing a type with a component size (i.e. a string) its constructor is a special
1232
+ // fcall that is basically a static method that returns the new instance.
1233
+ // Get the address of the fcall that implements the ctor
1234
+ PCODE code = pMD->TryGetMultiCallableAddrOfCode (CORINFO_ACCESS_ANY);
1235
+ assert (code);
1236
+
1237
+ // callArgsOffset points to the ctor arguments, which are what the fcall expects.
1238
+ // returnOffset points to where the new instance goes, and the fcall will write it there.
1239
+ InvokeCompiledMethod (pMD, stack + callArgsOffset, stack + returnOffset, code);
1240
+ ip += 5 ;
1241
+ break ;
1242
+ }
1242
1243
case INTOP_ZEROBLK_IMM:
1243
1244
memset (LOCAL_VAR (ip[1 ], void *), 0 , ip[2 ]);
1244
1245
ip += 3 ;
0 commit comments