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
6 changes: 6 additions & 0 deletions src/coreclr/jit/fgwasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,12 @@ class Scc
headerNumber++;
}

// All entry flow now passes through the try header before reaching the dispatcher.
if (tryHeader != nullptr)
{
tryHeader->setBBProfileWeight(TotalEntryWeight());
}

// Create the dispatch switch... really there should be no default but for now we'll have one.
//
JITDUMP("\nDispatch header is " FMT_BB "; %u cases\n", dispatcher->bbNum, numHeaders);
Expand Down
63 changes: 63 additions & 0 deletions src/tests/JIT/Regression/JitBlue/Runtime_133120/Runtime_133120.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections.Generic;
using System.Runtime.ExceptionServices;
using System.Threading;
using System.Threading.Tasks;
using Xunit;

public class Runtime_133120
{
private static readonly Dictionary<int, Func<CancellationToken, Task>> s_validators = new()
{
[0] = static _ => Task.CompletedTask,
};

[Fact]
public static void TestEntryPoint()
{
ValidateAsync().GetAwaiter().GetResult();
}

private static async Task ValidateAsync(CancellationToken cancellationToken = default)
{
List<Exception>? exceptions = null;

foreach (Func<CancellationToken, Task> validator in s_validators.Values)
{
try
{
await validator(cancellationToken).ConfigureAwait(false);
}
catch (InvalidOperationException ex)
{
exceptions ??= new();
exceptions.Add(ex);
}
catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested)
{
throw;
}
catch (Exception ex)
{
(exceptions ??= new()).Add(ex);
break;
}
}

if (exceptions is not null)
{
if (exceptions.Count == 1)
{
ExceptionDispatchInfo.Capture(exceptions[0]).Throw();
}

if (exceptions.Count > 1)
{
throw new AggregateException(exceptions);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Optimize>true</Optimize>
<AlwaysUseCrossGen2 Condition="'$(TargetOS)' == 'browser'">true</AlwaysUseCrossGen2>
Comment thread
AndyAyersMS marked this conversation as resolved.
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
<PropertyGroup Condition="'$(TargetOS)' == 'browser'">
<CrossGen2TestExtraArguments>$(CrossGen2TestExtraArguments) --codegenopt:JitSynthesizeCounts=1</CrossGen2TestExtraArguments>
</PropertyGroup>
</Project>
Loading