Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ string GenerateStubLlvmIr (string abi)
return header + """
%struct.TypeMap = type { i32, i32, ptr, ptr }
%struct.TypeMapManagedTypeInfo = type { i64, i32, i32 }
%struct.TypeMapAssembly = type { i64 }
%struct.TypeMapAssembly = type { [16 x i8], i64, i64 }

@type_map = dso_local constant %struct.TypeMap zeroinitializer, align 8
@typemap_use_hashes = dso_local constant i8 1, align 1
Expand All @@ -84,7 +84,7 @@ string GenerateStubLlvmIr (string abi)
@managed_to_java_map_module_count = dso_local constant i32 0, align 4
@managed_to_java_map = dso_local constant [0 x i8] zeroinitializer, align 8
@java_to_managed_map = dso_local constant [0 x i8] zeroinitializer, align 8
@java_to_managed_hashes = dso_local constant [0 x i64] zeroinitializer, align 8
@java_to_managed_hashes = dso_local constant [0 x i32] zeroinitializer, align 4
@modules_map_data = dso_local constant [0 x i8] zeroinitializer, align 8
@modules_duplicates_data = dso_local constant [0 x i8] zeroinitializer, align 8
@java_type_count = dso_local constant i32 0, align 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public sealed class ApplicationConfig_CoreCLR : IApplicationConfig
public uint number_of_assemblies_in_apk;
public uint bundled_assembly_name_width;
public uint number_of_dso_cache_entries;
public uint number_of_aot_cache_entries;
public uint number_of_shared_libraries;
public uint android_runtime_jnienv_class_token;
public uint jnienv_initialize_method_token;
Expand All @@ -64,7 +63,7 @@ public sealed class ApplicationConfig_CoreCLR : IApplicationConfig
public bool managed_marshal_methods_lookup_enabled;
}

const uint ApplicationConfigFieldCount_CoreCLR = 20;
const uint ApplicationConfigFieldCount_CoreCLR = 19;

// This must be identical to the ApplicationConfig structure in src/native/mono/xamarin-app-stub/xamarin-app.hh
public sealed class ApplicationConfig_MonoVM : IApplicationConfig
Expand Down Expand Up @@ -103,7 +102,7 @@ public sealed class DSOCacheEntry64
{
// Hardcoded, by design - we want to know if there are any changes in the
// native assembly layout.
public const uint NativeSize_CoreCLR = 32;
public const uint NativeSize_CoreCLR = 24;
public const uint NativeSize_MonoVM = 40;

public ulong hash;
Expand Down Expand Up @@ -186,8 +185,6 @@ public sealed class JniPreloads
"java_type_count",
"managed_to_java_map",
"managed_to_java_map_module_count",
"runtime_properties",
"runtime_properties_data",
AppEnvironmentVariableContentsSymbolName,
AppEnvironmentVariablesSymbolName,
ApplicationConfigSymbolName,
Expand Down Expand Up @@ -363,47 +360,42 @@ static IApplicationConfig ReadApplicationConfig_CoreCLR (EnvironmentFile envFile
ret.number_of_dso_cache_entries = ConvertFieldToUInt32 ("number_of_dso_cache_entries", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]);
break;

case 11: // number_of_aot_cache_entries: uint32_t / .word | .long
Assert.IsTrue (expectedUInt32Types.Contains (field [0]), $"Unexpected uint32_t field type in '{envFile.Path}:{item.LineNumber}': {field [0]}");
ret.number_of_aot_cache_entries = ConvertFieldToUInt32 ("number_of_aot_cache_entries", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]);
break;

case 12: // number_of_shared_libraries: uint32_t / .word | .long
case 11: // number_of_shared_libraries: uint32_t / .word | .long
Assert.IsTrue (expectedUInt32Types.Contains (field [0]), $"Unexpected uint32_t field type in '{envFile.Path}:{item.LineNumber}': {field [0]}");
ret.number_of_shared_libraries = ConvertFieldToUInt32 ("number_of_shared_libraries", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]);
break;

case 13: // android_runtime_jnienv_class_token: uint32_t / .word | .long
case 12: // android_runtime_jnienv_class_token: uint32_t / .word | .long
Assert.IsTrue (expectedUInt32Types.Contains (field [0]), $"Unexpected uint32_t field type in '{envFile.Path}:{item.LineNumber}': {field [0]}");
ret.android_runtime_jnienv_class_token = ConvertFieldToUInt32 ("android_runtime_jnienv_class_token", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]);
break;

case 14: // jnienv_initialize_method_token: uint32_t / .word | .long
case 13: // jnienv_initialize_method_token: uint32_t / .word | .long
Assert.IsTrue (expectedUInt32Types.Contains (field [0]), $"Unexpected uint32_t field type in '{envFile.Path}:{item.LineNumber}': {field [0]}");
ret.jnienv_initialize_method_token = ConvertFieldToUInt32 ("jnienv_initialize_method_token", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]);
break;

case 15: // jnienv_registerjninatives_method_token: uint32_t / .word | .long
case 14: // jnienv_registerjninatives_method_token: uint32_t / .word | .long
Assert.IsTrue (expectedUInt32Types.Contains (field [0]), $"Unexpected uint32_t field type in '{envFile.Path}:{item.LineNumber}': {field [0]}");
ret.jnienv_registerjninatives_method_token = ConvertFieldToUInt32 ("jnienv_registerjninatives_method_token", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]);
break;

case 16: // jni_remapping_replacement_type_count: uint32_t / .word | .long
case 15: // jni_remapping_replacement_type_count: uint32_t / .word | .long
Assert.IsTrue (expectedUInt32Types.Contains (field [0]), $"Unexpected uint32_t field type in '{envFile.Path}:{item.LineNumber}': {field [0]}");
ret.jni_remapping_replacement_type_count = ConvertFieldToUInt32 ("jni_remapping_replacement_type_count", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]);
break;

case 17: // jni_remapping_replacement_method_index_entry_count: uint32_t / .word | .long
case 16: // jni_remapping_replacement_method_index_entry_count: uint32_t / .word | .long
Assert.IsTrue (expectedUInt32Types.Contains (field [0]), $"Unexpected uint32_t field type in '{envFile.Path}:{item.LineNumber}': {field [0]}");
ret.jni_remapping_replacement_method_index_entry_count = ConvertFieldToUInt32 ("jni_remapping_replacement_method_index_entry_count", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]);
break;

case 18: // android_package_name: string / [pointer type]
case 17: // android_package_name: string / [pointer type]
Assert.IsTrue (expectedPointerTypes.Contains (field [0]), $"Unexpected pointer field type in '{envFile.Path}:{item.LineNumber}': {field [0]}");
pointers.Add (field [1].Trim ());
break;

case 19: // managed_marshal_methods_lookup_enabled: bool / .byte
case 18: // managed_marshal_methods_lookup_enabled: bool / .byte
AssertFieldType (envFile.Path, parser.SourceFilePath, ".byte", field [0], item.LineNumber);
ret.managed_marshal_methods_lookup_enabled = ConvertFieldToBool ("managed_marshal_methods_lookup_enabled", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]);
break;
Expand Down Expand Up @@ -1135,13 +1127,13 @@ static List<DSOCacheEntry64> ReadDsoCache64_CoreCLR (EnvironmentFile envFile, Na
string value;
int index = i;

// uint64_t hash
(lineNumber, value) = ReadNextArrayIndex (envFile, parser, dsoCache, index++, expectedUInt64Types);
ulong hash = ConvertFieldToUInt64 ("hash", envFile.Path, parser.SourceFilePath, lineNumber, value);
// uint32_t hash
(lineNumber, value) = ReadNextArrayIndex (envFile, parser, dsoCache, index++, expectedUInt32Types);
ulong hash = ConvertFieldToUInt32 ("hash", envFile.Path, parser.SourceFilePath, lineNumber, value);

// uint64_t real_name_hash
(lineNumber, value) = ReadNextArrayIndex (envFile, parser, dsoCache, index++, expectedUInt64Types);
ulong real_name_hash = ConvertFieldToUInt64 ("real_name_hash", envFile.Path, parser.SourceFilePath, lineNumber, value);
// uint32_t real_name_hash
(lineNumber, value) = ReadNextArrayIndex (envFile, parser, dsoCache, index++, expectedUInt32Types);
ulong real_name_hash = ConvertFieldToUInt32 ("real_name_hash", envFile.Path, parser.SourceFilePath, lineNumber, value);

// bool ignore
(lineNumber, value) = ReadNextArrayIndex (envFile, parser, dsoCache, index++, ".byte");
Expand Down Expand Up @@ -1313,20 +1305,24 @@ static byte ConvertFieldToByte (string fieldName, string llvmAssemblerEnvFile, s
return fv;
}

// Integers are parsed as signed, since llc will always output signed integers.
// llc usually emits signed decimal integers, but large unsigned fields can also be emitted as
// decimal values above Int32.MaxValue. Accept both forms.
static bool TryParseInteger (string value, out uint fv)
{
if (value.StartsWith ("0x", StringComparison.Ordinal)) {
return UInt32.TryParse (value.Substring (2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture, out fv);
}

fv = 0;
if (!Int32.TryParse (value, out int signedFV)) {
return false;
if (UInt32.TryParse (value, NumberStyles.None, CultureInfo.InvariantCulture, out fv)) {
return true;
}

fv = (uint)signedFV;
return true;
if (Int32.TryParse (value, NumberStyles.None, CultureInfo.InvariantCulture, out int signedFV)) {
fv = (uint)signedFV;
return true;
}

return false;
}

static bool TryParseInteger (string value, out ulong fv)
Expand All @@ -1335,13 +1331,16 @@ static bool TryParseInteger (string value, out ulong fv)
return UInt64.TryParse (value.Substring (2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture, out fv);
}

fv = 0;
if (!Int64.TryParse (value, out long signedFV)) {
return false;
if (UInt64.TryParse (value, NumberStyles.None, CultureInfo.InvariantCulture, out fv)) {
return true;
}

if (Int64.TryParse (value, NumberStyles.None, CultureInfo.InvariantCulture, out long signedFV)) {
fv = (ulong)signedFV;
return true;
}

fv = (ulong)signedFV;
return true;
return false;
}

static bool TryParseInteger (string value, out byte fv)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@
"Size": 3036
},
"classes.dex": {
"Size": 402352
"Size": 402852
},
"lib/arm64-v8a/libassembly-store.so": {
"Size": 2717688
"Size": 2724560
},
"lib/arm64-v8a/libclrjit.so": {
"Size": 2835128
"Size": 2757816
},
"lib/arm64-v8a/libcoreclr.so": {
"Size": 4891056
"Size": 4837240
},
"lib/arm64-v8a/libmonodroid.so": {
"Size": 1324320
"Size": 1252840
},
"lib/arm64-v8a/libSystem.Globalization.Native.so": {
"Size": 72112
},
"lib/arm64-v8a/libSystem.IO.Compression.Native.so": {
"Size": 1262888
"Size": 1258776
},
"lib/arm64-v8a/libSystem.Native.so": {
"Size": 101888
"Size": 99664
},
"lib/arm64-v8a/libSystem.Security.Cryptography.Native.Android.so": {
"Size": 168080
"Size": 163936
},
"lib/arm64-v8a/libxamarin-app.so": {
"Size": 20968
"Size": 17896
},
"res/drawable-hdpi-v4/icon.png": {
"Size": 2178
Expand All @@ -59,5 +59,5 @@
"Size": 1904
}
},
"PackageSize": 7271867
"PackageSize": 7235003
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"Size": 9413828
},
"classes2.dex": {
"Size": 158204
"Size": 157836
},
"kotlin/annotation/annotation.kotlin_builtins": {
"Size": 928
Expand All @@ -32,31 +32,31 @@
"Size": 2396
},
"lib/arm64-v8a/libassembly-store.so": {
"Size": 11658648
"Size": 11696200
},
"lib/arm64-v8a/libclrjit.so": {
"Size": 2824392
"Size": 2757816
},
"lib/arm64-v8a/libcoreclr.so": {
"Size": 4890432
"Size": 4837240
},
"lib/arm64-v8a/libmonodroid.so": {
"Size": 1265504
"Size": 1252416
},
"lib/arm64-v8a/libSystem.Globalization.Native.so": {
"Size": 72112
},
"lib/arm64-v8a/libSystem.IO.Compression.Native.so": {
"Size": 1262888
"Size": 1258776
},
"lib/arm64-v8a/libSystem.Native.so": {
"Size": 101888
"Size": 99664
},
"lib/arm64-v8a/libSystem.Security.Cryptography.Native.Android.so": {
"Size": 168080
"Size": 163936
},
"lib/arm64-v8a/libxamarin-app.so": {
"Size": 147824
"Size": 159496
},
"META-INF/androidx.activity_activity.version": {
"Size": 6
Expand Down Expand Up @@ -2234,5 +2234,5 @@
"Size": 794696
}
},
"PackageSize": 20786765
"PackageSize": 20782669
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ sealed class ApplicationConfigCLR
public uint number_of_assemblies_in_apk;
public uint bundled_assembly_name_width;
public uint number_of_dso_cache_entries;
public uint number_of_aot_cache_entries;
public uint number_of_shared_libraries;

[NativeAssembler (NumberFormat = LLVMIR.LlvmIrVariableNumberFormat.Hexadecimal)]
Expand Down
Loading
Loading