Skip to content
Draft

testing #124819

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
74 changes: 0 additions & 74 deletions src/libraries/Common/src/Interop/Browser/Interop.Runtime.Mono.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,5 @@ internal static unsafe partial class Runtime

[LibraryImport(Libraries.JavaScriptNative, EntryPoint = "SystemInteropJS_CancelPromise")]
public static partial void CancelPromise(nint gcHandle);

[LibraryImport(Libraries.JavaScriptNative, EntryPoint = "SystemInteropJS_BindAssemblyExports")]
public static partial void BindAssemblyExports(IntPtr assemblyNamePtr);
[LibraryImport(Libraries.JavaScriptNative, EntryPoint = "SystemInteropJS_GetAssemblyExport")]
public static partial void GetAssemblyExport(IntPtr assemblyNamePtr, IntPtr namespacePtr, IntPtr classnamePtr, IntPtr methodNamePtr, int signatureHash, IntPtr* methodHandlePtr);

// TODO-WASM: delete once we switch to CoreCLR only
[LibraryImport(Libraries.JavaScriptNative, EntryPoint = "SystemInteropJS_AssemblyGetEntryPoint")]
public static partial void AssemblyGetEntryPoint(IntPtr assemblyNamePtr, int auto_insert_breakpoint, void** monoMethodPtrPtr);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,20 @@ private static void RejectMainPromise(Exception ex)
SystemJS_RejectMainPromise(message, message.Length, stackTrace, stackTrace.Length);
}

#if MONO
[LibraryImport(Interop.Libraries.SystemBrowserNative)]
#else
[LibraryImport(RuntimeHelpers.QCall)]
#endif
private static unsafe partial void SystemJS_RejectMainPromise(
[MarshalAs(UnmanagedType.LPWStr)] string pMessage, int messageLength,
[MarshalAs(UnmanagedType.LPWStr)] string pStackTrace, int stackTraceLength);

#if MONO
[LibraryImport(Interop.Libraries.SystemBrowserNative)]
#else
[LibraryImport(RuntimeHelpers.QCall)]
#endif
private static partial void SystemJS_ResolveMainPromise(int exitCode);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,7 @@ internal static unsafe void EnsureWorkerRequested()
if (_callbackQueued)
return;
_callbackQueued = true;
#if MONO
MainThreadScheduleBackgroundJob((void*)(delegate* unmanaged<void>)&BackgroundJobHandler);
#else
SystemJS_ScheduleBackgroundJob();
#endif
}

internal static void NotifyWorkItemProgress()
Expand Down Expand Up @@ -124,15 +120,13 @@ private static RegisteredWaitHandle RegisterWaitForSingleObject(


#if MONO
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern unsafe void MainThreadScheduleBackgroundJob(void* callback);
[LibraryImport(Interop.Libraries.SystemBrowserNative)]
#else
[LibraryImport(RuntimeHelpers.QCall)]
private static unsafe partial void SystemJS_ScheduleBackgroundJob();
#endif
private static unsafe partial void SystemJS_ScheduleBackgroundJob();

[UnmanagedCallersOnly(EntryPoint = "SystemJS_ExecuteBackgroundJobCallback")]
// this callback will arrive on the bound thread, called from mono_background_exec
private static void BackgroundJobHandler()
{
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@ private TimerQueue(int _)

// This replaces the current pending setTimeout with shorter one
#if MONO
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern unsafe void MainThreadScheduleTimer(void* callback, int shortestDueTimeMs);
[LibraryImport(Interop.Libraries.SystemBrowserNative)]
#else
[LibraryImport(RuntimeHelpers.QCall)]
private static unsafe partial void SystemJS_ScheduleTimer(int shortestDueTimeMs);
#endif
private static unsafe partial void SystemJS_ScheduleTimer(int shortestDueTimeMs);

[UnmanagedCallersOnly(EntryPoint = "SystemJS_ExecuteTimerCallback")]
// this callback will arrive on the main thread, called from mono_wasm_execute_timer
private static void TimerHandler()
{
try
Expand Down Expand Up @@ -92,11 +90,7 @@ private static unsafe void ReplaceNextTimer(long shortestDueTimeMs, long current
s_shortestDueTimeMs = shortestDueTimeMs;
int shortestWait = Math.Max((int)(shortestDueTimeMs - currentTimeMs), 0);
// this would cancel the previous schedule and create shorter one, it is expensive callback
#if MONO
MainThreadScheduleTimer((void*)(delegate* unmanaged<void>)&TimerHandler, shortestWait);
#else
SystemJS_ScheduleTimer(shortestWait);
#endif
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'browser'">
<Compile Include="$(CommonPath)Interop\Browser\Interop.Runtime.Mono.cs" Link="System\Runtime\InteropServices\JavaScript\Interop\Interop.Runtime.Mono.cs" Condition="'$(RuntimeFlavor)' == 'Mono'" />
<Compile Include="$(CommonPath)Interop\Browser\Interop.Runtime.CoreCLR.cs" Link="System\Runtime\InteropServices\JavaScript\Interop\Interop.Runtime.CoreCLR.cs" Condition="'$(RuntimeFlavor)' == 'CoreCLR'" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs" Link="System\Runtime\InteropServices\JavaScript\Interop\Interop.Libraries.cs" Condition="'$(RuntimeFlavor)' == 'CoreCLR'" />
<Compile Include="$(CommonPath)Interop\Browser\Interop.Runtime.cs" Link="System\Runtime\InteropServices\JavaScript\Interop\Interop.Runtime.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs" Link="System\Runtime\InteropServices\JavaScript\Interop\Interop.Libraries.cs" />
<Compile Include="System\Runtime\InteropServices\JavaScript\Interop\JavaScriptImports.Generated.cs" />
<Compile Include="System\Runtime\InteropServices\JavaScript\Interop\JavaScriptExports.cs" />
<Compile Include="System\Runtime\InteropServices\JavaScript\Interop\JavaScriptExports.Mono.cs" Condition="'$(RuntimeFlavor)' == 'Mono'" />
<Compile Include="System\Runtime\InteropServices\JavaScript\Interop\JavaScriptExports.CoreCLR.cs" Condition="'$(RuntimeFlavor)' == 'CoreCLR'" />

<Compile Include="System\Runtime\InteropServices\JavaScript\JSHost.cs" />
<Compile Include="System\Runtime\InteropServices\JavaScript\JSMarshalerType.cs" />
Expand All @@ -41,8 +40,7 @@
<Compile Include="System\Runtime\InteropServices\JavaScript\JSType.cs" />
<Compile Include="System\Runtime\InteropServices\JavaScript\JSFunctionBinding.cs" />
<Compile Include="System\Runtime\InteropServices\JavaScript\JSHostImplementation.cs" />
<Compile Include="System\Runtime\InteropServices\JavaScript\JSHostImplementation.Mono.cs" Condition="'$(RuntimeFlavor)' == 'Mono'" />
<Compile Include="System\Runtime\InteropServices\JavaScript\JSHostImplementation.CoreCLR.cs" Condition="'$(RuntimeFlavor)' == 'CoreCLR'" />
<Compile Include="System\Runtime\InteropServices\JavaScript\JSHostImplementation.CoreCLR.cs" />
<Compile Include="System\Runtime\InteropServices\JavaScript\JSHostImplementation.Types.cs" />
<Compile Include="System\Runtime\InteropServices\JavaScript\JSMarshalerArgument.cs" />
<Compile Include="System\Runtime\InteropServices\JavaScript\JSException.cs" />
Expand Down
Loading
Loading