Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing Entry2MethodDesc as it is unnecessary #111756

Merged
merged 3 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/coreclr/vm/callhelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

void AssertMulticoreJitAllowedModule(PCODE pTarget)
{
MethodDesc* pMethod = Entry2MethodDesc(pTarget, NULL);
MethodDesc* pMethod = NonVirtualEntry2MethodDesc(pTarget);

Module * pModule = pMethod->GetModule();

Expand Down
12 changes: 3 additions & 9 deletions src/coreclr/vm/comdelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ extern "C" PCODE QCALLTYPE Delegate_AdjustTarget(QCall::ObjectHandleOnStack targ

MethodTable* pMTTarg = target.Get()->GetMethodTable();

MethodDesc *pMeth = Entry2MethodDesc(method, pMTTarg);
MethodDesc *pMeth = NonVirtualEntry2MethodDesc(method);
_ASSERTE(pMeth);
_ASSERTE(!pMeth->IsStatic());

Expand Down Expand Up @@ -1694,7 +1694,7 @@ extern "C" void QCALLTYPE Delegate_Construct(QCall::ObjectHandleOnStack _this, Q
pMTTarg = target.Get()->GetMethodTable();

MethodTable* pDelMT = refThis->GetMethodTable();
MethodDesc* pMethOrig = Entry2MethodDesc(method, pMTTarg);
MethodDesc* pMethOrig = NonVirtualEntry2MethodDesc(method);
MethodDesc* pMeth = pMethOrig;
_ASSERTE(pMeth != NULL);

Expand Down Expand Up @@ -1878,13 +1878,7 @@ MethodDesc *COMDelegate::GetMethodDesc(OBJECTREF orDelegate)
// Must be a normal delegate
code = thisDel->GetMethodPtr();

OBJECTREF orThis = thisDel->GetTarget();
if (orThis!=NULL)
{
pMT = orThis->GetMethodTable();
}

pMethodHandle = Entry2MethodDesc(code, pMT);
pMethodHandle = NonVirtualEntry2MethodDesc(code);
}
}

Expand Down
26 changes: 0 additions & 26 deletions src/coreclr/vm/method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2291,32 +2291,6 @@ MethodDesc* NonVirtualEntry2MethodDesc(PCODE entryPoint)
}
}

//*******************************************************************************
// convert an entry point into a method desc
MethodDesc* Entry2MethodDesc(PCODE entryPoint, MethodTable *pMT)
{
CONTRACT(MethodDesc*)
{
THROWS;
GC_TRIGGERS;
MODE_ANY;
POSTCONDITION(RETVAL->SanityCheck());
}
CONTRACT_END

MethodDesc* pMD = NonVirtualEntry2MethodDesc(entryPoint);
if (pMD != NULL)
RETURN(pMD);

pMD = VirtualCallStubManagerManager::Entry2MethodDesc(entryPoint, pMT);
if (pMD != NULL)
RETURN(pMD);

// We should never get here
_ASSERTE(!"Entry2MethodDesc failed");
RETURN (NULL);
}

//*******************************************************************************
BOOL MethodDesc::IsPointingToPrestub()
{
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/vm/method.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2371,8 +2371,6 @@ inline MethodDescChunk *MethodDesc::GetMethodDescChunk() const
}

MethodDesc* NonVirtualEntry2MethodDesc(PCODE entryPoint);
// convert an entry point into a MethodDesc
MethodDesc* Entry2MethodDesc(PCODE entryPoint, MethodTable *pMT);


typedef DPTR(class StoredSigMethodDesc) PTR_StoredSigMethodDesc;
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/stubmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1738,7 +1738,7 @@ BOOL ILStubManager::TraceManager(Thread *thread,
PCODE stubIP = GetIP(pContext);
*pRetAddr = (BYTE *)StubManagerHelpers::GetReturnAddress(pContext);

DynamicMethodDesc *pStubMD = Entry2MethodDesc(stubIP, NULL)->AsDynamicMethodDesc();
DynamicMethodDesc *pStubMD = NonVirtualEntry2MethodDesc(stubIP)->AsDynamicMethodDesc();
TADDR arg = StubManagerHelpers::GetHiddenArg(pContext);
Object * pThis = StubManagerHelpers::GetThisPtr(pContext);
LOG((LF_CORDB, LL_INFO1000, "ILSM::TraceManager: Enter: StubMD 0x%p, HiddenArg 0x%p, ThisPtr 0x%p\n",
Expand Down
3 changes: 2 additions & 1 deletion src/tests/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@

<Target Name="GenerateLayout"
DependsOnTargets="CreateTestOverlay"
AfterTargets="ManagedBuild;RestorePackages"

Check failure on line 638 in src/tests/build.proj

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release AllSubsets_Mono_RuntimeTests monointerpreter)

src/tests/build.proj#L638

src/tests/build.proj(638,5): error MSB3073: The command ""/__w/1/s/dotnet.sh" msbuild /__w/1/s/src/tests/build.proj /t:Build "/p:TargetArchitecture=wasm" "/p:Configuration=Release" "/p:LibrariesConfiguration=Release" "/p:TasksConfiguration=Release" "/p:TargetOS=browser" "/p:ToolsOS=" "/p:PackageOS=" "/p:RuntimeFlavor=mono" "/p:RuntimeVariant=monointerpreter" "/p:CLRTestBuildAllTargets=" "/p:UseCodeFlowEnforcement=" "/p:__TestGroupToBuild=1" "/p:__SkipRestorePackages=1" /nodeReuse:false /m:1 /bl:/__w/1/s/artifacts//log/Release/InnerManagedTestBuild.1.binlog" exited with code 137.

Check failure on line 638 in src/tests/build.proj

View check run for this annotation

Azure Pipelines / runtime

src/tests/build.proj#L638

src/tests/build.proj(638,5): error MSB3073: The command ""/__w/1/s/dotnet.sh" msbuild /__w/1/s/src/tests/build.proj /t:Build "/p:TargetArchitecture=wasm" "/p:Configuration=Release" "/p:LibrariesConfiguration=Release" "/p:TasksConfiguration=Release" "/p:TargetOS=browser" "/p:ToolsOS=" "/p:PackageOS=" "/p:RuntimeFlavor=mono" "/p:RuntimeVariant=monointerpreter" "/p:CLRTestBuildAllTargets=" "/p:UseCodeFlowEnforcement=" "/p:__TestGroupToBuild=1" "/p:__SkipRestorePackages=1" /nodeReuse:false /m:1 /bl:/__w/1/s/artifacts//log/Release/InnerManagedTestBuild.1.binlog" exited with code 137.
Condition="'$(__BuildTestWrappersOnly)' != '1' and '$(__CopyNativeTestBinaries)' != '1' and '$(__SkipGenerateLayout)' != '1' and !$(MonoAot) and !$(MonoFullAot)">

<MSBuild
Expand Down Expand Up @@ -679,7 +679,8 @@
<CrossgenCmd Condition="'$(__CompositeBuildMode)' == ''">$(CrossgenCmd) --crossgen2-parallelism 1</CrossgenCmd>

<CrossgenCmd>$(CrossgenCmd) --verify-type-and-field-layout</CrossgenCmd>
<CrossgenCmd>$(CrossgenCmd) --crossgen2-path "$(__BinDir)\$(BuildArchitecture)\crossgen2\crossgen2.dll"</CrossgenCmd>
<CrossgenCmd Condition="'$(RunningOnUnix)' == 'true'">$(CrossgenCmd) --crossgen2-path "$(__BinDir)\$(BuildArchitecture)\crossgen2\crossgen2"</CrossgenCmd>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't the same path work on Windows? Removing the .exe.

<CrossgenCmd Condition="'$(RunningOnUnix)' != 'true'">$(CrossgenCmd) --crossgen2-path "$(__BinDir)\$(BuildArchitecture)\crossgen2\crossgen2.exe"</CrossgenCmd>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another instance of this problem at

value: $(productDirectory)$(dir)$(targetFlavor)$(dir)crossgen2$(dir)crossgen2.dll
- ${{ if ne(parameters.archType, 'x64') }}:
- name: crossgen2location
value: $(productDirectory)$(dir)$(targetFlavor)$(dir)x64$(dir)crossgen2$(dir)crossgen2.dll
that seems to be causing the remaining crossgen outer loop failures.

</PropertyGroup>

<Message Importance="High" Text="$(MsgPrefix)Compiling framework using Crossgen2: $(CrossgenCmd)" />
Expand Down
Loading