| 6339 | } |
| 6340 | |
| 6341 | void BfModule::DoTypeInstanceMethodProcessing(BfTypeInstance* typeInstance) |
| 6342 | { |
| 6343 | if (typeInstance->IsDeleting()) |
| 6344 | { |
| 6345 | BF_ASSERT(typeInstance->IsOnDemand()); |
| 6346 | return; |
| 6347 | } |
| 6348 | |
| 6349 | if (typeInstance->IsSpecializedByAutoCompleteMethod()) |
| 6350 | return; |
| 6351 | |
| 6352 | if (typeInstance->mDefineState == BfTypeDefineState_DefinedAndMethodsSlotting) |
| 6353 | { |
| 6354 | BfLogSysM("DoTypeInstanceMethodProcessing %p re-entrancy exit\n", typeInstance); |
| 6355 | return; |
| 6356 | } |
| 6357 | |
| 6358 | // |
| 6359 | { |
| 6360 | BP_ZONE("DoTypeInstanceMethodProcessing:CheckStack"); |
| 6361 | StackHelper stackHelper; |
| 6362 | if (!stackHelper.CanStackExpand(128 * 1024)) |
| 6363 | { |
| 6364 | if (!stackHelper.Execute([&]() |
| 6365 | { |
| 6366 | DoTypeInstanceMethodProcessing(typeInstance); |
| 6367 | })) |
| 6368 | { |
| 6369 | Fail("Stack exhausted in DoPopulateType", typeInstance->mTypeDef->GetRefNode()); |
| 6370 | } |
| 6371 | return; |
| 6372 | } |
| 6373 | } |
| 6374 | |
| 6375 | BF_ASSERT_REL(typeInstance->mNeedsMethodProcessing); |
| 6376 | BF_ASSERT_REL(typeInstance->mDefineState == BfTypeDefineState_Defined); |
| 6377 | typeInstance->mDefineState = BfTypeDefineState_DefinedAndMethodsSlotting; |
| 6378 | |
| 6379 | BF_ASSERT(typeInstance->mModule == this); |
| 6380 | |
| 6381 | //TODO: This is new, make sure this is in the right place |
| 6382 | /*if (mAwaitingInitFinish) |
| 6383 | FinishInit();*/ |
| 6384 | |
| 6385 | AutoDisallowYield disableYield(mSystem); |
| 6386 | SetAndRestoreValue<BfTypeInstance*> prevTypeInstance(mCurTypeInstance, typeInstance); |
| 6387 | SetAndRestoreValue<BfMethodInstance*> prevMethodInstance(mCurMethodInstance, NULL); |
| 6388 | |
| 6389 | BfLogSysM("DoTypeInstanceMethodProcessing: %p %s Revision:%d DefineState:%d\n", typeInstance, TypeToString(typeInstance).c_str(), typeInstance->mRevision, typeInstance->mDefineState); |
| 6390 | |
| 6391 | auto typeDef = typeInstance->mTypeDef; |
| 6392 | |
| 6393 | BfTypeOptions* typeOptions = NULL; |
| 6394 | if (typeInstance->mTypeOptionsIdx >= 0) |
| 6395 | typeOptions = mSystem->GetTypeOptions(typeInstance->mTypeOptionsIdx); |
| 6396 | |
| 6397 | BfMethodDef* defaultCtor = NULL; |
| 6398 | bool hasExplicitCtors = false; |
nothing calls this directly
no test coverage detected