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

Symbols API #601

Open
wants to merge 54 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
61c0d2a
Fix up some bugs.
wasabii Sep 13, 2024
4119fcb
Builder infrastructure mostly in place.
wasabii Sep 15, 2024
947bb0e
Replace underlying stuff when completing a type.
wasabii Sep 15, 2024
635ca5f
Fixes.
wasabii Sep 16, 2024
5eeefa0
!
wasabii Sep 16, 2024
cc52708
Rebuild.
wasabii Sep 18, 2024
434f8b5
Use safe method.
wasabii Sep 18, 2024
41fdc5f
Reintroduced IKVM Reflection.
wasabii Sep 18, 2024
149ddcd
More replacement.
wasabii Sep 19, 2024
6425e9b
Rebuild.
wasabii Sep 20, 2024
1da941c
Fix array length.
wasabii Sep 21, 2024
ae381ec
It builds.
wasabii Sep 22, 2024
2f8e098
Almost.
wasabii Sep 26, 2024
64ae586
Put IsMissing back.
wasabii Sep 27, 2024
ef32c62
Weee.
wasabii Sep 27, 2024
1e14f73
More.
wasabii Sep 28, 2024
a9a3232
111
wasabii Sep 28, 2024
28f1c03
Restore MakeArray, since it doesn't do multidims.
wasabii Sep 28, 2024
a0331c9
Turn off skiperrors.
wasabii Sep 28, 2024
1cbbd11
Unify System.Reflection version.
wasabii Oct 1, 2024
0c0660d
Almost.....
wasabii Oct 2, 2024
991bfbc
Formatting.
wasabii Oct 3, 2024
5b464a5
Formatting.
wasabii Oct 3, 2024
c6f5b09
Remove debug stuff.
wasabii Oct 3, 2024
672d456
Allow GetMethods when incomplete.
wasabii Oct 4, 2024
0f1f1be
Remove invoking base generic type definition for delegate invoke meth…
wasabii Oct 4, 2024
dc36f8c
Implment few more.
wasabii Oct 4, 2024
6667f5f
Revert.
wasabii Oct 4, 2024
326cd18
Assert. Allow fileName to be null.
wasabii Oct 5, 2024
d3e8520
Rename AssemblyNameInfo to Assemblyidentity. Fix up some equality stuff.
wasabii Oct 5, 2024
9fa2ff9
Add EmitSymbols to RuntimeContextOptions instead of JVM.
wasabii Oct 6, 2024
cfa237a
Annotations need actual live attribute types.
wasabii Oct 6, 2024
6130049
No need to use open generic, since GetMethod now works against closed…
wasabii Oct 6, 2024
6ccacea
For GetConstructors, same deal, no need to check for TypeBuilders.
wasabii Oct 7, 2024
14a06b0
Complete parameters on first access. Enumeratingn them on type comple…
wasabii Oct 7, 2024
9222bb5
Fix.
wasabii Oct 7, 2024
36f2f2c
Hmm.
wasabii Oct 7, 2024
8a8fa19
Hmm
wasabii Oct 7, 2024
c597e1c
Emit properties. The idea here is that a given symbol might need to b…
wasabii Oct 8, 2024
d715c0e
Pick proper emit type.
wasabii Oct 8, 2024
73e95bc
Return null on tail.
wasabii Oct 8, 2024
4f9e569
public
wasabii Oct 9, 2024
d4eab6a
Add IncompleteMethods back in.
wasabii Oct 9, 2024
2daab5a
,
wasabii Oct 9, 2024
b7b2716
.
wasabii Oct 13, 2024
b743767
Fix.
wasabii Oct 18, 2024
dbf2cd8
use runtime types
wasabii Oct 19, 2024
5eda2a6
Implement GetParameters and ReturnType.
wasabii Oct 20, 2024
3931113
More.
wasabii Oct 21, 2024
f86b12a
Space.
wasabii Oct 22, 2024
542c29b
Hmm
wasabii Oct 26, 2024
6d06fdb
Hmmm
wasabii Oct 29, 2024
11d5e01
Merge in develop.
wasabii Oct 30, 2024
9b46927
Merge branch 'develop' into symbols2
wasabii Nov 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<SupportedImageRuntimes>win-x64;win-x86;win-arm64;linux-x64;linux-arm;linux-arm64;linux-musl-x64;linux-musl-arm;linux-musl-arm64;osx-x64;osx-arm64</SupportedImageRuntimes>
<EnabledImageRuntimes Condition=" '$(EnabledImageRuntimes)' == '' ">$(SupportedImageRuntimes)</EnabledImageRuntimes>

<EnabledRuntimes>win-x64;win-x86</EnabledRuntimes>
<EnabledToolRuntimes>win-x64;win-x86</EnabledToolRuntimes>
<EnabledImageRuntimes>win-x64;win-x86</EnabledImageRuntimes>

<_SupportedRuntimes>;$(SupportedRuntimes);</_SupportedRuntimes>
<_EnabledRuntimes>;$(EnabledRuntimes);</_EnabledRuntimes>
<_SupportedToolRuntimes>;$(SupportedToolRuntimes);</_SupportedToolRuntimes>
Expand Down
1 change: 1 addition & 0 deletions IKVM.deps.targets
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<Reference Include="System.Security" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.7.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
Expand Down
3 changes: 2 additions & 1 deletion src/IKVM.ConsoleApp/IKVM.ConsoleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net481;net6.0;net8.0</TargetFrameworks>
<LangVersion>11</LangVersion>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\IKVM.Java.Extensions\IKVM.Java.Extensions.csproj" />
<ProjectReference Include="..\IKVM.Image\IKVM.Image.csproj" />
<ProjectReference Include="..\IKVM.JTReg.TestAdapter.Core\IKVM.JTReg.TestAdapter.Core.csproj" />
<ProjectReference Include="..\IKVM.JTReg.TestAdapter\IKVM.JTReg.TestAdapter.csproj" />
</ItemGroup>

<Import Project="$(MSBuildThisFileDirectory)..\..\IKVM.deps.targets" />
Expand Down
33 changes: 21 additions & 12 deletions src/IKVM.ConsoleApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
using System;
using System.Diagnostics.Tracing;
using System.Threading;

using IKVM.JTReg.TestAdapter.Core;

namespace IKVM.ConsoleApp
{

public class Program
{

public static void Main(string[] args)
class MyDiscoverycontext : IJTRegDiscoveryContext
{
var l = new Listener();
var o = new java.lang.Object();
java.lang.System.loadLibrary("hi");
}

}
public JTRegTestOptions Options => new JTRegTestOptions()
{

class Listener : EventListener
{
};

public void SendMessage(JTRegTestMessageLevel level, string message)
{

protected override void OnEventWritten(EventWrittenEventArgs eventData)
}

public void SendTestCase(JTRegTestCase testCase)
{

}

}

public static void Main(string[] args)
{
Console.WriteLine(eventData);
JTRegTestManager.Instance.DiscoverTests(@"D:\ikvm\src\IKVM.JTReg.TestAdapter.Tests\bin\Debug\net478\IKVM.JTReg.TestAdapter.Tests.dll", new MyDiscoverycontext(), CancellationToken.None);
}

}
Expand Down
116 changes: 116 additions & 0 deletions src/IKVM.CoreLib.Tests/Collections/IndexRangeDictionaryTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
using FluentAssertions;

using IKVM.CoreLib.Collections;

using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace IKVM.CoreLib.Tests.Collections
{

[TestClass]
public class IndexRangeDictionaryTests
{

[TestMethod]
public void AlignTowardsInfinity()
{
IndexRangeDictionary<string>.AlignTowardsInfinity(0).Should().Be(0);
IndexRangeDictionary<string>.AlignTowardsInfinity(1).Should().Be(8);
IndexRangeDictionary<string>.AlignTowardsInfinity(7).Should().Be(8);
IndexRangeDictionary<string>.AlignTowardsInfinity(8).Should().Be(8);
IndexRangeDictionary<string>.AlignTowardsInfinity(9).Should().Be(16);

IndexRangeDictionary<string>.AlignTowardsInfinity(-0).Should().Be(-0);
IndexRangeDictionary<string>.AlignTowardsInfinity(-1).Should().Be(-8);
IndexRangeDictionary<string>.AlignTowardsInfinity(-7).Should().Be(-8);
IndexRangeDictionary<string>.AlignTowardsInfinity(-8).Should().Be(-8);
IndexRangeDictionary<string>.AlignTowardsInfinity(-9).Should().Be(-16);
}

[TestMethod]
public void AlignTowardsZero()
{
IndexRangeDictionary<string>.AlignTowardsZero(0).Should().Be(0);
IndexRangeDictionary<string>.AlignTowardsZero(1).Should().Be(0);
IndexRangeDictionary<string>.AlignTowardsZero(7).Should().Be(0);
IndexRangeDictionary<string>.AlignTowardsZero(8).Should().Be(8);
IndexRangeDictionary<string>.AlignTowardsZero(9).Should().Be(8);

IndexRangeDictionary<string>.AlignTowardsZero(-0).Should().Be(-0);
IndexRangeDictionary<string>.AlignTowardsZero(-1).Should().Be(-0);
IndexRangeDictionary<string>.AlignTowardsZero(-7).Should().Be(-0);
IndexRangeDictionary<string>.AlignTowardsZero(-8).Should().Be(-8);
IndexRangeDictionary<string>.AlignTowardsZero(-9).Should().Be(-8);
}

[TestMethod]
public void CanAddBasicItem()
{
var d = new IndexRangeDictionary<string>();
d[0] = "Item1";
d[0].Should().Be("Item1");
d._minKey.Should().Be(0);
d._maxKey.Should().Be(0);
d._items.Length.Should().Be(8);
}

[TestMethod]
public void CanAddOffsetItem()
{
var d = new IndexRangeDictionary<string>();
d[10] = "Item1";
d[10].Should().Be("Item1");
d._minKey.Should().Be(8);
d._maxKey.Should().Be(16);
d._items.Length.Should().Be(16);
}

[TestMethod]
public void CanAddSparseRange()
{
var d = new IndexRangeDictionary<string>();
d[10] = "Item1";
d[10].Should().Be("Item1");
d._minKey.Should().Be(8);
d._maxKey.Should().Be(16);
d._items.Length.Should().Be(16);
d[20] = "Item2";
d[10].Should().Be("Item1");
d[20].Should().Be("Item2");
d._minKey.Should().Be(8);
d._maxKey.Should().Be(24);
d._items.Length.Should().Be(32);
d[5].Should().BeNull();
d[10].Should().Be("Item1");
d[15].Should().BeNull();
d[19].Should().BeNull();
d[20].Should().Be("Item2");
d[21].Should().BeNull();
}

[TestMethod]
public void CanAddMaxBeforeMin()
{
var d = new IndexRangeDictionary<string>();
d[20] = "Item1";
d[20].Should().Be("Item1");
d[10] = "Item2";
d[10].Should().Be("Item2");
d[20] = "Item1";
d[20].Should().Be("Item1");
}

[TestMethod]
public void ShiftShouldBeEmpty()
{
var d = new IndexRangeDictionary<string>();
d[2] = "Item2";
d[2].Should().Be("Item2");
d[0] = "Item0";
d[0].Should().Be("Item0");
d[1].Should().BeNull();
}

}

}
Loading
Loading