Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Migrating from the fork
  • Loading branch information
grendello committed Mar 8, 2024
commit 171b2eba0c8ccda8c3dece096db370ad7487417e
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@
path = external/xamarin-android-tools
url = https://github.com/xamarin/xamarin-android-tools
branch = main
[submodule "external/libunwind"]
path = external/libunwind
url = https://github.com/libunwind/libunwind.git
4 changes: 4 additions & 0 deletions Configuration.props
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@
<IgnoreMaxMonoVersion Condition=" '$(IgnoreMaxMonoVersion)' == '' ">True</IgnoreMaxMonoVersion>
<OpenTKSourceDirectory>$(MSBuildThisFileDirectory)external\opentk</OpenTKSourceDirectory>
<SqliteSourceDirectory Condition=" '$(SqliteSourceDirectory)' == '' ">$(MSBuildThisFileDirectory)external\sqlite</SqliteSourceDirectory>
<LibUnwindSourceDirectory Condition=" '$(LibUnwindSourceDirectory)' == '' ">$(MSBuildThisFileDirectory)external\libunwind</LibUnwindSourceDirectory>
<LibUnwindGeneratedHeadersDirectory Condition=" '$(LibUnwindGeneratedHeadersDirectory)' == '' ">$(BootstrapOutputDirectory)\libunwind</LibUnwindGeneratedHeadersDirectory>
<XamarinAndroidSourcePath>$(MSBuildThisFileDirectory)</XamarinAndroidSourcePath>
<ThirdPartySourcePath>$(MSBuildThisFileDirectory)src-ThirdParty\</ThirdPartySourcePath>
<AllSupported32BitTargetAndroidAbis>armeabi-v7a;x86</AllSupported32BitTargetAndroidAbis>
Expand Down Expand Up @@ -144,6 +146,8 @@
<JavaInteropFullPath>$([System.IO.Path]::GetFullPath ('$(JavaInteropSourceDirectory)'))</JavaInteropFullPath>
<MonoSourceFullPath>$([System.IO.Path]::GetFullPath ('$(MonoSourceDirectory)'))</MonoSourceFullPath>
<SqliteSourceFullPath>$([System.IO.Path]::GetFullPath ('$(SqliteSourceDirectory)'))</SqliteSourceFullPath>
<LibUnwindSourceFullPath>$([System.IO.Path]::GetFullPath ('$(LibUnwindSourceDirectory)'))</LibUnwindSourceFullPath>
<LibUnwindGeneratedHeadersFullPath>$([System.IO.Path]::GetFullPath ('$(LibUnwindGeneratedHeadersDirectory)'))</LibUnwindGeneratedHeadersFullPath>
<OpenTKSourceFullPath>$([System.IO.Path]::GetFullPath ('$(OpenTKSourceDirectory)'))</OpenTKSourceFullPath>
<JavaInteropTargetFrameworkVersion>net8.0</JavaInteropTargetFrameworkVersion>
</PropertyGroup>
Expand Down
4 changes: 4 additions & 0 deletions TheoriesToTest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* See if it's a threading issue - add full locking to `get_function_pointer` instead of atomics that we use now
* See if it's an ALC issue - call `get_function_pointer` every time and check the returned pointer value
* Implement Jon's idea to always have the "old" dynamic registration stuff in JCW and only use it when some flag
is set and marshal methods are active.
2 changes: 2 additions & 0 deletions Xamarin.Android.sln
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Java.Interop.Tools.Diagnost
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Java.Interop.Tools.Cecil", "external\Java.Interop\src\Java.Interop.Tools.Cecil\Java.Interop.Tools.Cecil.csproj", "{D48EE8D0-0A0A-4493-AEF5-DAF5F8CF86AD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "libunwind", "src\libunwind-xamarin\libunwind-xamarin.csproj", "{F8E4961B-C427-47F9-92D6-0BEB5B76B3D7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "monodroid", "src\monodroid\monodroid.csproj", "{53EE4C57-1C03-405A-8243-8DA539546C88}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{CAB438D8-B0F5-4AF0-BEBD-9E2ADBD7B483}"
Expand Down
3 changes: 2 additions & 1 deletion build-tools/cmake/xa_macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ function(xa_common_prepare)
-fstack-protector-strong
-fstrict-return
-fno-strict-aliasing
-ffunction-sections
-fno-function-sections
-fno-data-sections
-funswitch-loops
-finline-limit=300
-Wa,-noexecstack
Expand Down
2 changes: 2 additions & 0 deletions build-tools/create-packs/Microsoft.Android.Runtime.proj
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ projects that use the Microsoft.Android framework in .NET 6+.
<_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libmono-android.debug.so" />
<_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libmono-android.release.so" />
<_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxamarin-debug-app-helper.so" />
<_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libmarshal-methods-tracing.a" />
<_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxamarin-native-tracing.so" />
<FrameworkListFileClass Include="@(_AndroidRuntimePackAssemblies->'%(Filename)%(Extension)')" Profile="Android" />
<FrameworkListFileClass Include="@(_AndroidRuntimePackAssets->'%(Filename)%(Extension)')" Profile="Android" />
</ItemGroup>
Expand Down
8 changes: 8 additions & 0 deletions build-tools/installers/create-installers.targets
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,20 @@
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)ManifestOverlays\Timing.xml" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm64\libc.so" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm64\libm.so" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm64\libdl.so" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm64\liblog.so" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm\libc.so" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm\libm.so" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm\libdl.so" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm\liblog.so" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x64\libc.so" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x64\libm.so" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x64\libdl.so" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x64\liblog.so" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x86\libc.so" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x86\libm.so" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x86\libdl.so" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x86\liblog.so" />
</ItemGroup>
<ItemGroup>
<_MSBuildTargetsSrcFiles Include="$(MSBuildTargetsSrcDir)\Xamarin.Android.AvailableItems.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ static class KnownProperties
public const string JavaInteropFullPath = "JavaInteropFullPath";
public const string JavaSdkDirectory = "JavaSdkDirectory";
public const string JdkIncludePath = "JdkIncludePath";
public const string LibUnwindGeneratedHeadersFullPath = nameof (LibUnwindGeneratedHeadersFullPath);
public const string LibUnwindSourceFullPath = nameof (LibUnwindSourceFullPath);
public const string LibZipSourceFullPath = "LibZipSourceFullPath";
public const string ManagedRuntime = "ManagedRuntime";
public const string MicrosoftAndroidSdkOutDir = "MicrosoftAndroidSdkOutDir";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ namespace Xamarin.Android.Prepare
properties.Add (KnownProperties.JavaInteropFullPath, StripQuotes (@"@JavaInteropFullPath@"));
properties.Add (KnownProperties.JavaSdkDirectory, StripQuotes (@"@JavaSdkDirectory@"));
properties.Add (KnownProperties.JdkIncludePath, StripQuotes (@"@JdkIncludePath@"));
properties.Add (KnownProperties.LibUnwindGeneratedHeadersFullPath, StripQuotes (@"@LibUnwindGeneratedHeadersFullPath@"));
properties.Add (KnownProperties.LibUnwindSourceFullPath, StripQuotes (@"@LibUnwindSourceFullPath"));
properties.Add (KnownProperties.LibZipSourceFullPath, StripQuotes (@"@LibZipSourceFullPath@"));
properties.Add (KnownProperties.ManagedRuntime, StripQuotes (@"@ManagedRuntime@"));
properties.Add (KnownProperties.MicrosoftAndroidSdkOutDir, StripQuotes (@"@MicrosoftAndroidSdkOutDir@"));
Expand Down
1 change: 1 addition & 0 deletions build-tools/xaprepare/xaprepare/xaprepare.targets
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
<Replacement Include="@JavaInteropFullPath@=$(JavaInteropFullPath)" />
<Replacement Include="@JavaSdkDirectory@=$(JavaSdkDirectory)" />
<Replacement Include="@JdkIncludePath@=$(JavaIncludePath)" />
<Replacement Include="@LibUnwindSourceFullPath@=$(LibUnwindSourceFullPath)" />
<Replacement Include="@LibZipSourceFullPath@=$(LibZipSourceFullPath)" />
<Replacement Include="@ManagedRuntime@=$(ManagedRuntime)" />
<Replacement Include="@MicrosoftAndroidSdkOutDir@=$(MicrosoftAndroidSdkOutDir)" />
Expand Down
1 change: 1 addition & 0 deletions external/libunwind
Submodule libunwind added at 9cc4d9
213 changes: 213 additions & 0 deletions java.interop-tracing.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
diff --git a/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers/JavaCallableWrapperGenerator.cs b/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers/JavaCallableWrapperGenerator.cs
index 76f2bfc0..7a57f6b2 100644
--- a/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers/JavaCallableWrapperGenerator.cs
+++ b/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers/JavaCallableWrapperGenerator.cs
@@ -133,6 +133,7 @@ namespace Java.Interop.Tools.JavaCallableWrappers {

JavaCallableWrapperGenerator (TypeDefinition type, string? outerType, Action<string, object[]> log, IMetadataResolver resolver, JavaCallableMethodClassifier? methodClassifier = null)
{
+ Console.WriteLine ($"JCWG: processing {type}");
this.methodClassifier = methodClassifier;
this.type = type;
this.log = log;
@@ -224,6 +225,8 @@ namespace Java.Interop.Tools.JavaCallableWrappers {
curCtors = new List<MethodDefinition> ();
AddConstructors (ctorTypes [i], outerType, baseCtors, curCtors, false);
}
+
+ Console.WriteLine ($"JCWG: done processing {type}");
}

static void ExtractJavaNames (string jniName, out string package, out string type)
@@ -285,8 +288,10 @@ namespace Java.Interop.Tools.JavaCallableWrappers {

void AddConstructor (MethodDefinition ctor, TypeDefinition type, string? outerType, List<MethodDefinition>? baseCtors, List<MethodDefinition> curCtors, bool onlyRegisteredOrExportedCtors, bool skipParameterCheck)
{
+ Console.WriteLine ($" JCWG: AddConstructor ({ctor}, {type}, ..., onlyRegisteredOrExportedCtors: {onlyRegisteredOrExportedCtors}, skipParameterCheck: {skipParameterCheck});");
string managedParameters = GetManagedParameters (ctor, outerType);
if (!skipParameterCheck && (managedParameters == null || ctors.Any (c => c.ManagedParameters == managedParameters))) {
+ Console.WriteLine (" JCWG: skip #1");
return;
}

@@ -297,28 +302,38 @@ namespace Java.Interop.Tools.JavaCallableWrappers {
}
ctors.Add (new Signature (ctor, eattr, cache));
curCtors.Add (ctor);
+ Console.WriteLine (" JCWG: add #1");
return;
}

RegisterAttribute rattr = GetMethodRegistrationAttributes (ctor).FirstOrDefault ();
if (rattr != null) {
- if (ctors.Any (c => c.JniSignature == rattr.Signature))
+ if (ctors.Any (c => c.JniSignature == rattr.Signature)) {
+ Console.WriteLine (" JCWG: skip #2");
return;
+ }
ctors.Add (new Signature (ctor, rattr, managedParameters, outerType, cache));
curCtors.Add (ctor);
+ Console.WriteLine (" JCWG: add #2");
return;
}

- if (onlyRegisteredOrExportedCtors)
+ if (onlyRegisteredOrExportedCtors) {
+ Console.WriteLine (" JCWG: skip #1");
return;
+ }

string? jniSignature = GetJniSignature (ctor, cache);

- if (jniSignature == null)
+ if (jniSignature == null) {
+ Console.WriteLine (" JCWG: skip #3");
return;
+ }

- if (ctors.Any (c => c.JniSignature == jniSignature))
+ if (ctors.Any (c => c.JniSignature == jniSignature)) {
+ Console.WriteLine (" JCWG: skip #4");
return;
+ }

if (baseCtors == null) {
throw new InvalidOperationException ("`baseCtors` should not be null!");
@@ -327,11 +342,13 @@ namespace Java.Interop.Tools.JavaCallableWrappers {
if (baseCtors.Any (m => m.Parameters.AreParametersCompatibleWith (ctor.Parameters, cache))) {
ctors.Add (new Signature (".ctor", jniSignature, "", managedParameters, outerType, null));
curCtors.Add (ctor);
+ Console.WriteLine (" JCWG: add #3");
return;
}
if (baseCtors.Any (m => !m.HasParameters)) {
ctors.Add (new Signature (".ctor", jniSignature, "", managedParameters, outerType, ""));
curCtors.Add (ctor);
+ Console.WriteLine (" JCWG: add #4");
return;
}
}
@@ -549,17 +566,17 @@ namespace Java.Interop.Tools.JavaCallableWrappers {
GenerateHeader (writer);

bool needCtor = false;
- if (HasDynamicallyRegisteredMethods) {
+// if (HasDynamicallyRegisteredMethods) {
needCtor = true;
writer.WriteLine ("/** @hide */");
writer.WriteLine ("\tpublic static final String __md_methods;");
- }
+// }

if (children != null) {
for (int i = 0; i < children.Count; i++) {
- if (!children[i].HasDynamicallyRegisteredMethods) {
- continue;
- }
+ // if (!children[i].HasDynamicallyRegisteredMethods) {
+ // continue;
+ // }
needCtor = true;
writer.Write ("\tstatic final String __md_");
writer.Write (i + 1);
@@ -570,9 +587,9 @@ namespace Java.Interop.Tools.JavaCallableWrappers {
if (needCtor) {
writer.WriteLine ("\tstatic {");

- if (HasDynamicallyRegisteredMethods) {
+// if (HasDynamicallyRegisteredMethods) {
GenerateRegisterType (writer, this, "__md_methods");
- }
+// }

if (children != null) {
for (int i = 0; i < children.Count; ++i) {
@@ -687,9 +704,12 @@ namespace Java.Interop.Tools.JavaCallableWrappers {

void GenerateBody (TextWriter sw)
{
+ Console.WriteLine ($" JCWG: GenerateBody for {name} (ctors size: {ctors.Count})");
foreach (Signature ctor in ctors) {
- if (string.IsNullOrEmpty (ctor.Params) && JavaNativeTypeManager.IsApplication (type, cache))
+ if (string.IsNullOrEmpty (ctor.Params) && JavaNativeTypeManager.IsApplication (type, cache)) {
+ Console.WriteLine ($" JCWG: skipping constructor generation; params empty? {string.IsNullOrEmpty (ctor.Params)}; is application? {JavaNativeTypeManager.IsApplication (type, cache)}");
continue;
+ }
GenerateConstructor (ctor, sw);
}

@@ -745,9 +765,9 @@ namespace Java.Interop.Tools.JavaCallableWrappers {

void GenerateRegisterType (TextWriter sw, JavaCallableWrapperGenerator self, string field)
{
- if (!self.HasDynamicallyRegisteredMethods) {
- return;
- }
+ // if (!self.HasDynamicallyRegisteredMethods) {
+ // return;
+ // }

sw.Write ("\t\t");
sw.Write (field);
@@ -818,9 +838,13 @@ namespace Java.Interop.Tools.JavaCallableWrappers {
return jniName.Replace ('/', '.').Replace ('$', '.');
}

- bool CannotRegisterInStaticConstructor (TypeDefinition type)
+ bool CannotRegisterInStaticConstructor (TypeDefinition type, bool dolog = false)
{
- return JavaNativeTypeManager.IsApplication (type, cache) || JavaNativeTypeManager.IsInstrumentation (type, cache);
+ Console.WriteLine ($" JCWG: CannotRegisterInStaticConstructor ({type})");
+ bool ret = JavaNativeTypeManager.IsApplication (type, cache) || JavaNativeTypeManager.IsInstrumentation (type, cache);
+ Console.WriteLine ($" JCWG: CannotRegisterInStaticConstructor for type {type}; ret == {ret}; IsApplication: {JavaNativeTypeManager.IsApplication (type, cache)}; IsInstrumentation: {JavaNativeTypeManager.IsInstrumentation (type, cache)}");
+
+ return ret;
}

class Signature {
@@ -941,6 +965,8 @@ namespace Java.Interop.Tools.JavaCallableWrappers {

void GenerateConstructor (Signature ctor, TextWriter sw)
{
+ Console.WriteLine ($" JCWG: GenerateConstructor for {name}");
+
// TODO: we only generate constructors so that Android types w/ no
// default constructor can be subclasses by our generated code.
//
diff --git a/tools/java-source-utils/.classpath b/tools/java-source-utils/.classpath
index 30230c1c..cbded110 100644
--- a/tools/java-source-utils/.classpath
+++ b/tools/java-source-utils/.classpath
@@ -20,6 +20,12 @@
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
+ <classpathentry kind="src" output="bin/main" path="src/main/resources">
+ <attributes>
+ <attribute name="gradle_scope" value="main"/>
+ <attribute name="gradle_used_by_scope" value="main,test"/>
+ </attributes>
+ </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
diff --git a/tools/java-source-utils/.project b/tools/java-source-utils/.project
index 8337a1c5..613733c8 100644
--- a/tools/java-source-utils/.project
+++ b/tools/java-source-utils/.project
@@ -20,4 +20,15 @@
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
+ <filteredResources>
+ <filter>
+ <id>1682588570543</id>
+ <name></name>
+ <type>30</type>
+ <matcher>
+ <id>org.eclipse.core.resources.regexFilterMatcher</id>
+ <arguments>node_modules|.metadata|archetype-resources|META-INF/maven|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
+ </matcher>
+ </filter>
+ </filteredResources>
</projectDescription>
17 changes: 7 additions & 10 deletions src/Mono.Android/Android.Runtime/AndroidRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,11 @@ public void RegisterNativeMembers (
{
try {
if (methods.IsEmpty) {
if (jniAddNativeMethodRegistrationAttributePresent)
RuntimeNativeMethods.monodroid_log (LogLevel.Info, LogCategories.Assembly, $"RegisterJniNatives: Type {type.FullName} registers no methods");
if (jniAddNativeMethodRegistrationAttributePresent) {
RuntimeNativeMethods.monodroid_log (LogLevel.Info, LogCategories.Assembly, $"RegisterJniNatives: Type {type.FullName} has [AddNativeMethodRegistration] attribute");
base.RegisterNativeMembers (nativeClass, type, methods.ToString ());
}
return;
} else if (FastRegisterNativeMembers (nativeClass, type, methods)) {
return;
Expand Down Expand Up @@ -539,6 +542,7 @@ public void RegisterNativeMembers (
throw new InvalidOperationException (FormattableString.Invariant ($"Specified managed method '{mname.ToString ()}' was not found. Signature: {signature.ToString ()}"));
callback = CreateDynamicCallback (minfo);
needToRegisterNatives = true;
RuntimeNativeMethods.monodroid_log (LogLevel.Info, LogCategories.Assembly, $"RegisterJniNativesMethod: [ ] {type.FullName}: __export__ found for method '{name.ToString ()}'");
} else {
Type callbackDeclaringType = type;
if (!callbackDeclaringTypeString.IsEmpty) {
Expand All @@ -556,27 +560,20 @@ public void RegisterNativeMembers (
if (callback != null) {
needToRegisterNatives = true;
natives [nativesIndex++] = new JniNativeMethodRegistration (name.ToString (), signature.ToString (), callback);
RuntimeNativeMethods.monodroid_log (LogLevel.Info, LogCategories.Assembly, $"RegisterJniNativesMethod: [ ] {type.FullName}.{name.ToString ()}");
}
}

methodsSpan = newLineIndex != -1 ? methodsSpan.Slice (newLineIndex + 1) : default;
}

if (needToRegisterNatives) {
RuntimeNativeMethods.monodroid_log (LogLevel.Info, LogCategories.Assembly, $"RegisterJniNatives: Type {type.FullName} calling JniEnvironment.Types.RegisterNatives");
JniEnvironment.Types.RegisterNatives (nativeClass.PeerReference, natives, nativesIndex);
}
} catch (Exception e) {
JniEnvironment.Runtime.RaisePendingException (e);
}

bool ShouldRegisterDynamically (string callbackTypeName, string callbackString, string typeName, string callbackName)
{
if (String.Compare (typeName, callbackTypeName, StringComparison.Ordinal) != 0) {
return false;
}

return String.Compare (callbackName, callbackString, StringComparison.Ordinal) == 0;
}
}

static int CountMethods (ReadOnlySpan<char> methodsSpan)
Expand Down
Loading