Skip to content

Commit

Permalink
Merge branch 'hotfix/8.5.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabii committed Jun 7, 2023
2 parents e48c511 + 8884acc commit c2db218
Show file tree
Hide file tree
Showing 4 changed files with 1,186 additions and 348 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/IKVM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ name: IKVM
on:
push:
branches:
- main
- hotfix/*
- develop
- hotfix/*
- release/*
pull_request:
branches:
- main
- develop
release:
types:
- created

jobs:
build-openjdk:
Expand Down Expand Up @@ -155,11 +157,11 @@ jobs:
version: "15.0"
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.15
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: 5.x
- name: Execute GitVersion
uses: gittools/actions/gitversion/execute@v0.9.15
uses: gittools/actions/gitversion/execute@v0
with:
targetPath: ${{ env.WORKPATH }}\ikvm
useConfigFile: true
Expand Down Expand Up @@ -213,7 +215,7 @@ jobs:
/p:AssemblyVersion=${env:GitVersion_AssemblySemVer} `
/p:InformationalVersion=${env:GitVersion_InformationalVersion} `
/p:FileVersion=${env:GitVersion_AssemblySemFileVer} `
/p:PackageVersion=${env:GitVersion_NuGetVersionV2} `
/p:PackageVersion=${env:GitVersion_FullSemVer} `
/p:RepositoryUrl="${env:GITHUB_SERVER_URL}/${env:GITHUB_REPOSITORY}.git" `
/p:PackageProjectUrl="${env:GITHUB_SERVER_URL}/${env:GITHUB_REPOSITORY}" `
/p:BuildInParallel=true `
Expand Down Expand Up @@ -456,7 +458,6 @@ jobs:
path: ${{ env.TMPDIR }}/TestResults.tar.gz
release:
name: Release
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/hotfix/')
needs:
- test
runs-on: ubuntu-latest
Expand All @@ -473,12 +474,12 @@ jobs:
with:
dotnet-version: 7.0.x
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.15
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: 5.x
- name: Execute GitVersion
id: GitVersion
uses: gittools/actions/gitversion/execute@v0.9.15
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
- name: Download NuGet Packages
Expand Down Expand Up @@ -523,13 +524,13 @@ jobs:
shell: pwsh
run: cd dist && gi image/*/* | %{ $tfm = $_.Parent.Name; $rid = $_.Name; Push-Location "image/$tfm/$rid"; zip -r "../../IKVM-${env:GitVersion_SemVer}-image-$tfm-$rid.zip" .; tar czvf "../../IKVM-${env:GitVersion_SemVer}-image-$tfm-$rid.tar.gz" .; Pop-Location }
- name: Create Release
if: github.ref == 'refs/heads/main' || github.event.head_commit.message == '+push'
if: github.ref_type == 'tag'
uses: ncipollo/[email protected]
with:
tag: ${{ steps.GitVersion.outputs.semVer }}
tag: ${{ github.ref_name }}
allowUpdates: true
artifacts: dist/nuget/*.nupkg,dist/bin/*.zip,dist/bin/*.tar.gz,dist/image/*.zip,dist/image/*.tar.gz,dist/tools/*.zip,dist/tools/*.tar.gz
generateReleaseNotes: true
prerelease: ${{ github.ref == 'refs/heads/develop' }}
draft: false
token: ${{ secrets.GITHUB_TOKEN }}
- name: Push NuGet (GitHub)
shell: pwsh
Expand All @@ -538,7 +539,7 @@ jobs:
GITHUB_REPOS: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push NuGet
if: github.ref == 'refs/heads/main' || github.event.head_commit.message == '+push'
if: github.ref_type == 'tag'
shell: pwsh
run: dotnet nuget push dist/nuget/*.nupkg --source $env:NUGET_REPOS --api-key $env:NUGET_TOKEN --skip-duplicate
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Jeroen Frijters
*/
using System;
using System.Reflection;
using System.Threading;

using IKVM.Internal;

Expand Down Expand Up @@ -402,38 +403,72 @@ public static int getMembers(global::java.lang.Class defc, string matchName, str
#endif
}

/// <summary>
/// Implements the native method 'objectFieldOffset'.
/// </summary>
/// <param name="self"></param>
/// <returns></returns>
/// <exception cref="global::java.lang.IllegalArgumentException"></exception>
public static long objectFieldOffset(global::java.lang.invoke.MemberName self)
{
#if FIRST_PASS
throw new NotImplementedException();
#else
var fw = TypeWrapper.FromClass(self.getDeclaringClass()).GetFieldWrapper(self.getName(), self.getSignature().Replace('/', '.'));
if (fw.IsStatic)
throw new global::java.lang.IllegalArgumentException();

return (long)fw.Cookie;
#endif
}

/// <summary>
/// Implements the native method 'staticFieldOffset'.
/// </summary>
/// <param name="self"></param>
/// <returns></returns>
/// <exception cref="global::java.lang.IllegalArgumentException"></exception>
public static long staticFieldOffset(global::java.lang.invoke.MemberName self)
{
#if FIRST_PASS
throw new NotImplementedException();
#else
var fw = TypeWrapper.FromClass(self.getDeclaringClass()).GetFieldWrapper(self.getName(), self.getSignature().Replace('/', '.'));
if (fw.IsStatic == false)
throw new global::java.lang.IllegalArgumentException();

return (long)fw.Cookie;
#endif
}

/// <summary>
/// Implements the native method 'staticFieldBase'.
/// </summary>
/// <param name="self"></param>
/// <returns></returns>
/// <exception cref="global::java.lang.IllegalArgumentException"></exception>
public static object staticFieldBase(global::java.lang.invoke.MemberName self)
{
return null;
#if FIRST_PASS
throw new NotImplementedException();
#else
var fw = TypeWrapper.FromClass(self.getDeclaringClass()).GetFieldWrapper(self.getName(), self.getSignature().Replace('/', '.'));
if (fw.IsStatic == false)
throw new global::java.lang.IllegalArgumentException();

return fw.DeclaringType;
#endif
}

#if !FIRST_PASS
#if FIRST_PASS == false

internal static void InitializeCallSite(global::java.lang.invoke.CallSite site)
{
Type type = typeof(IKVM.Runtime.IndyCallSite<>).MakeGenericType(MethodHandleUtil.GetDelegateTypeForInvokeExact(site.type()));
IKVM.Runtime.IIndyCallSite ics = (IKVM.Runtime.IIndyCallSite)Activator.CreateInstance(type, true);
global::System.Threading.Interlocked.CompareExchange(ref site.ics, ics, null);
var type = typeof(IKVM.Runtime.IndyCallSite<>).MakeGenericType(MethodHandleUtil.GetDelegateTypeForInvokeExact(site.type()));
var ics = (IKVM.Runtime.IIndyCallSite)Activator.CreateInstance(type, true);
Interlocked.CompareExchange(ref site.ics, ics, null);
}

#endif

public static void setCallSiteTargetNormal(global::java.lang.invoke.CallSite site, global::java.lang.invoke.MethodHandle target)
Expand Down
Loading

0 comments on commit c2db218

Please sign in to comment.