Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,12 @@ public override string ToString()
return _name.ToString();
}
}

public class AddressTakenExternSymbolNode : ExternSymbolNode
{
public AddressTakenExternSymbolNode(Utf8String name)
: base(name) { }

public override int ClassCode => -45645737;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,7 @@ public override IEnumerable<DependencyListEntry> GetStaticDependencies(NodeFacto

factory.MetadataManager.GetDependenciesDueToVirtualMethodReflectability(ref result, factory, _targetMethod);

TargetArchitecture targetArchitecture = factory.Target.Architecture;
if (targetArchitecture == TargetArchitecture.ARM)
{
result.Add(factory.InitialInterfaceDispatchStub, "Initial interface dispatch stub");
}
else
{
result.Add(factory.ExternSymbol("RhpInitialDynamicInterfaceDispatch"), "Initial interface dispatch stub");
}
result.Add(factory.InitialInterfaceDispatchStub, "Initial interface dispatch stub");

// We counter-intuitively ask for a constructed type symbol. This is needed due to IDynamicInterfaceCastable.
// If this dispatch cell is ever used with an object that implements IDynamicIntefaceCastable, user code will
Expand All @@ -81,15 +73,7 @@ public override IEnumerable<DependencyListEntry> GetStaticDependencies(NodeFacto

public override void EncodeData(ref ObjectDataBuilder objData, NodeFactory factory, bool relocsOnly)
{
TargetArchitecture targetArchitecture = factory.Target.Architecture;
if (targetArchitecture == TargetArchitecture.ARM)
{
objData.EmitPointerReloc(factory.InitialInterfaceDispatchStub);
}
else
{
objData.EmitPointerReloc(factory.ExternSymbol("RhpInitialDynamicInterfaceDispatch"));
}
objData.EmitPointerReloc(factory.InitialInterfaceDispatchStub);

// We counter-intuitively ask for a constructed type symbol. This is needed due to IDynamicInterfaceCastable.
// If this dispatch cell is ever used with an object that implements IDynamicIntefaceCastable, user code will
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public NodeFactory(
ObjectDataInterner dataInterner)
{
_target = context.Target;

InitialInterfaceDispatchStub = _target.Architecture == TargetArchitecture.ARM
? new InitialInterfaceDispatchStubNode()
Copy link
Member

Choose a reason for hiding this comment

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

I am wondering whether the special ARM dispatch stub wrapper is still necessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can try to delete that in a different PR and see what the CI says, but I don't have hardware to test it on.

Copy link
Member

Choose a reason for hiding this comment

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

Testing it in CI should be good enough if you would like to give it a try.

I think this was only needed for multi-.dll Windows arm32 support that we do not have anymore.

: new AddressTakenExternSymbolNode("RhpInitialDynamicInterfaceDispatch");

_context = context;
_compilationModuleGroup = compilationModuleGroup;
_vtableSliceProvider = vtableSliceProvider;
Expand Down Expand Up @@ -102,6 +107,11 @@ public NameMangler NameMangler
get;
}

public ISymbolNode InitialInterfaceDispatchStub
{
get;
}

public PreinitializationManager PreinitializationManager
{
get;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ private void EmitObject(string objectFilePath, IReadOnlyCollection<DependencyNod
relocTarget.Offset);

if (_options.HasFlag(ObjectWritingOptions.ControlFlowGuard) &&
relocTarget is IMethodNode or AssemblyStubNode)
relocTarget is IMethodNode or AssemblyStubNode or AddressTakenExternSymbolNode)
{
// For now consider all method symbols address taken.
// We could restrict this in the future to those that are referenced from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@
<Compile Include="Compiler\DependencyAnalysis\StringAllocatorMethodNode.cs" />
<Compile Include="Compiler\DependencyAnalysis\Target_X64\X64ReadyToRunGenericHelperNode.cs" />
<Compile Include="Compiler\DependencyAnalysis\Target_ARM\ARMInitialInterfaceDispatchStubNode.cs" />
<Compile Include="Compiler\DependencyAnalysis\Target_ARM\ARMNodeFactory.cs" />
<Compile Include="Compiler\DependencyAnalysis\VTableSliceNode.cs" />
<Compile Include="Compiler\DependencyAnalysis\EETypeOptionalFieldsNode.cs" />
<Compile Include="Compiler\DependencyAnalysis\EmbeddedObjectNode.cs" />
Expand Down