{
if (node.RepresentsIndirectionCell)
{
- // push eax (arbitrary value)
- Builder.EmitByte(0x50);
- // mov eax, [node address]
- Builder.EmitByte(0x8B);
- Builder.EmitByte(0x00 | ((byte)Register.EAX << 3) | 0x5);
- Builder.EmitReloc(node, RelocType.IMAGE_REL_BASED_HIGHLOW);
- // xchg [esp], eax; this also restores the previous value of eax
- Builder.EmitByte(0x87);
- Builder.EmitByte(0x04);
- Builder.EmitByte(0x24);
+ // push [node address]
+ Builder.EmitByte(0xFF);
+ Builder.EmitByte(0x35);
}
else
{
// push <node address>
Builder.EmitByte(0x68);
- Builder.EmitReloc(node, RelocType.IMAGE_REL_BASED_HIGHLOW);
}
+ Builder.EmitReloc(node, RelocType.IMAGE_REL_BASED_HIGHLOW);
}
public void EmitMOV(Register regDst, Register regSrc)
Debug.Assert(method is EcmaMethod);
- if (method.Context.Target.Architecture == TargetArchitecture.X86)
- {
- // X86 architecture does not yet support inline pinvokes
- return false;
- }
-
// If the PInvoke is declared on an external module, we can only compile it if
// that module is part of the version bubble.
if (!_versionBubbleModuleSet.Contains(((EcmaMethod)method).Module))
private bool pInvokeMarshalingRequired(CORINFO_METHOD_STRUCT_* handle, CORINFO_SIG_INFO* callSiteSig)
{
- if (_compilation.NodeFactory.Target.Architecture == TargetArchitecture.X86)
- {
- // TODO-PERF: x86 pinvoke stubs on Unix platforms
- return true;
- }
-
if (handle != null)
{
var method = HandleToObject(handle);