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 @@ -17,7 +17,7 @@
"Size": 4843864
},
"lib/arm64-v8a/libmonodroid.so": {
"Size": 1184800
"Size": 1094848
},
"lib/arm64-v8a/libSystem.Globalization.Native.so": {
"Size": 72432
Expand Down Expand Up @@ -59,5 +59,5 @@
"Size": 1904
}
},
"PackageSize": 7058875
"PackageSize": 7034299
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"Size": 4843864
},
"lib/arm64-v8a/libmonodroid.so": {
"Size": 1184800
"Size": 1094848
},
"lib/arm64-v8a/libSystem.Globalization.Native.so": {
"Size": 72432
Expand Down Expand Up @@ -59,5 +59,5 @@
"Size": 1904
}
},
"PackageSize": 7058875
"PackageSize": 7034299
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"Size": 4843864
},
"lib/arm64-v8a/libmonodroid.so": {
"Size": 1184800
"Size": 1094848
},
"lib/arm64-v8a/libSystem.Globalization.Native.so": {
"Size": 72432
Expand Down Expand Up @@ -2231,5 +2231,5 @@
"Size": 794696
}
},
"PackageSize": 16346643
"PackageSize": 16317971
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"Size": 4843864
},
"lib/arm64-v8a/libmonodroid.so": {
"Size": 1184800
"Size": 1094848
},
"lib/arm64-v8a/libSystem.Globalization.Native.so": {
"Size": 72432
Expand Down Expand Up @@ -2234,5 +2234,5 @@
"Size": 794696
}
},
"PackageSize": 18730573
"PackageSize": 18468429
}
20 changes: 3 additions & 17 deletions src/native/clr/host/assembly-store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -589,11 +589,7 @@ auto AssemblyStore::get_assembly_data (AssemblyStoreSingleAssemblyRuntimeData co

if (FastTiming::enabled ()) [[unlikely]] {
internal_timing.end_event (true /* uses_more_info */);

dynamic_local_string<SENSIBLE_TYPE_NAME_LENGTH> msg;
msg.append (name);
msg.append (" (decompressed in another thread)"sv);
internal_timing.add_more_info (msg);
internal_timing.add_more_info (name, " (decompressed in another thread)"sv);
}
return {assembly_data, assembly_data_size};
}
Expand Down Expand Up @@ -660,13 +656,7 @@ auto AssemblyStore::get_assembly_data (AssemblyStoreSingleAssemblyRuntimeData co
__atomic_store_n (&cad.loaded, true, __ATOMIC_RELEASE);
if (FastTiming::enabled ()) [[unlikely]] {
internal_timing.end_event (true /* uses_more_info */);

dynamic_local_string<SENSIBLE_TYPE_NAME_LENGTH> msg;
msg.append (name);
if (loaded_from_cache) {
msg.append (" (decompressed cache hit)"sv);
}
internal_timing.add_more_info (msg);
internal_timing.add_more_info (name, loaded_from_cache ? " (decompressed cache hit)"sv : ""sv);
}
}

Expand All @@ -690,11 +680,7 @@ auto AssemblyStore::get_assembly_data (AssemblyStoreSingleAssemblyRuntimeData co

if (FastTiming::enabled ()) [[unlikely]] {
internal_timing.end_event (true /* uses more info */);

dynamic_local_string<SENSIBLE_TYPE_NAME_LENGTH> msg;
msg.append (name);
msg.append (" (memcpy to r/w area, part of assembly load time)"sv);
internal_timing.add_more_info (msg);
internal_timing.add_more_info (name, " (memcpy to r/w area, part of assembly load time)"sv);
}

set_assembly_data_and_size (rw_pointer, e.descriptor->data_size, assembly_data, assembly_data_size);
Expand Down
9 changes: 2 additions & 7 deletions src/native/clr/host/host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,8 @@ void Host::Java_mono_android_Runtime_register (JNIEnv *env, jstring managedType,
int methods_len = env->GetStringLength (methods);
const jchar *methods_ptr = env->GetStringChars (methods, nullptr);

dynamic_local_string<SENSIBLE_TYPE_NAME_LENGTH> managed_type_name;
const char *mt_ptr = env->GetStringUTFChars (managedType, nullptr);
managed_type_name.assign (mt_ptr, strlen (mt_ptr));
log_debug (LOG_ASSEMBLY, "Registering type: '{}'"sv, managed_type_name.get ());
log_debug (LOG_ASSEMBLY, "Registering type: '{}'"sv, mt_ptr);
env->ReleaseStringUTFChars (managedType, mt_ptr);

// TODO: must attach thread to the runtime here
Expand All @@ -541,12 +539,9 @@ void Host::Java_mono_android_Runtime_register (JNIEnv *env, jstring managedType,
if (FastTiming::enabled ()) [[unlikely]] {
internal_timing.end_event (true /* uses_more_info */);

dynamic_local_string<SENSIBLE_TYPE_NAME_LENGTH> type;
mt_ptr = env->GetStringUTFChars (managedType, nullptr);
type.assign (mt_ptr, strlen (mt_ptr));
internal_timing.add_more_info (mt_ptr);
env->ReleaseStringUTFChars (managedType, mt_ptr);

internal_timing.add_more_info (type);
}
}

Expand Down
1 change: 0 additions & 1 deletion src/native/clr/include/host/assembly-store.hh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <tuple>

#include <xamarin-app.hh>
#include <runtime-base/strings.hh>

namespace xamarin::android {
class AssemblyStore
Expand Down
19 changes: 19 additions & 0 deletions src/native/clr/include/runtime-base/android-system.hh
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,25 @@ namespace xamarin::android {
}

static auto monodroid_get_system_property (std::string_view const& name, dynamic_local_property_string &value) noexcept -> int;

template<size_t Size>
static auto monodroid_get_system_property (std::string_view const& name, char (&value)[Size]) noexcept -> int
{
dynamic_local_property_string property_value;
int result = monodroid_get_system_property (name, property_value);
if (result > 0) {
if (property_value.length () >= Size) {
value [0] = '\0';
return -1;
}
memcpy (value, property_value.get (), property_value.length ());
value [property_value.length ()] = '\0';
} else {
value [0] = '\0';
}
return result;
}

static void detect_embedded_dso_mode (jstring_array_wrapper& appDirs) noexcept;
static void setup_environment () noexcept;
static void setup_app_library_directories (jstring_array_wrapper& runtimeApks, jstring_array_wrapper& appDirs, bool have_split_apks) noexcept;
Expand Down
Loading