[browser] delete unused mono_wasm_* functions (#82767)
authorPavel Savara <pavel.savara@gmail.com>
Wed, 1 Mar 2023 11:13:23 +0000 (12:13 +0100)
committerGitHub <noreply@github.com>
Wed, 1 Mar 2023 11:13:23 +0000 (12:13 +0100)
* delete unused mono_wasm_get_icudt_name
* remove unused mono_wasm_array_length
* remove unused GlobalizationNative_GetICUDTName

src/mono/wasi/mono-include/driver.h
src/mono/wasm/runtime/cwraps.ts
src/mono/wasm/runtime/driver.c
src/mono/wasm/runtime/es6/dotnet.es6.lib.js
src/mono/wasm/runtime/exports-linker.ts
src/mono/wasm/runtime/icu.ts
src/native/libs/System.Globalization.Native/pal_icushim.h
src/native/libs/System.Globalization.Native/pal_icushim_static.c

index 5e1f66825f588a96d6cbe341937f6e45f5e804be..47c72f146f7c19bd65c769bfbf155995b4d14c3a 100644 (file)
@@ -19,7 +19,6 @@ MonoArray* mono_wasm_obj_array_new (int size);
 void mono_wasm_obj_array_set (MonoArray *array, int idx, MonoObject *obj);
 MonoArray* mono_wasm_string_array_new (int size);
 MonoString *mono_wasm_string_from_js (const char *str);
-int mono_wasm_array_length(MonoArray* array);
 char *mono_wasm_string_get_utf8 (MonoString *str);
 
 MonoMethod* lookup_dotnet_method(const char* assembly_name, const char* namespace, const char* type_name, const char* method_name, int num_params);
index 7842d98db70442e8e30ae3cfbd866ba83340e2db..33f864ec39c825b70bf586755f41e47d70b31d4a 100644 (file)
@@ -27,7 +27,6 @@ const fn_signatures: SigLine[] = [
     [true, "mono_background_exec", null, []],
     [true, "mono_set_timeout_exec", null, []],
     [true, "mono_wasm_load_icu_data", "number", ["number"]],
-    [true, "mono_wasm_get_icudt_name", "string", ["string"]],
     [false, "mono_wasm_add_assembly", "number", ["string", "number", "number"]],
     [true, "mono_wasm_add_satellite_assembly", "void", ["string", "string", "number", "number"]],
     [false, "mono_wasm_load_runtime", null, ["string", "number"]],
@@ -47,7 +46,6 @@ const fn_signatures: SigLine[] = [
     [true, "mono_wasm_string_get_utf8", "number", ["number"]],
     [true, "mono_wasm_string_from_utf16_ref", "void", ["number", "number", "number"]],
     [true, "mono_wasm_get_obj_type", "number", ["number"]],
-    [true, "mono_wasm_array_length", "number", ["number"]],
     [true, "mono_wasm_array_length_ref", "number", ["number"]],
     [true, "mono_wasm_array_get", "number", ["number", "number"]],
     [true, "mono_wasm_array_get_ref", "void", ["number", "number", "number"]],
@@ -141,7 +139,6 @@ export interface t_Cwraps {
     mono_background_exec(): void;
     mono_set_timeout_exec(): void;
     mono_wasm_load_icu_data(offset: VoidPtr): number;
-    mono_wasm_get_icudt_name(name: string): string;
     mono_wasm_add_assembly(name: string, data: VoidPtr, size: number): number;
     mono_wasm_add_satellite_assembly(name: string, culture: string, data: VoidPtr, size: number): void;
     mono_wasm_load_runtime(unused: string, debugLevel: number): void;
@@ -166,7 +163,6 @@ export interface t_Cwraps {
      */
     mono_wasm_string_get_utf8(str: MonoString): CharPtr;
     mono_wasm_string_from_utf16_ref(str: CharPtr, len: number, result: MonoObjectRef): void;
-    mono_wasm_array_length(array: MonoArray): number;
 
     mono_wasm_array_length_ref(array: MonoObjectRef): number;
     mono_wasm_array_get_ref(array: MonoObjectRef, idx: number, result: MonoObjectRef): void;
index 9b145963b0d4c5b1d76ec13b156cbe8a83045d54..38f5efd8c9d1bd4eada5a2b35636d12ddbc4ed51 100644 (file)
@@ -1218,13 +1218,6 @@ mono_wasm_try_unbox_primitive_and_get_type_ref (MonoObject **objRef, void *resul
        return retval;
 }
 
-// FIXME: Ref
-EMSCRIPTEN_KEEPALIVE int
-mono_wasm_array_length (MonoArray *array)
-{
-       return mono_array_length (array);
-}
-
 EMSCRIPTEN_KEEPALIVE int
 mono_wasm_array_length_ref (MonoArray **array)
 {
index 28fd1168148ee46d2f5e6b5687eb3433de18d513..281cc1c5a77e0e24f597c7a5c086f2289c519e4b 100644 (file)
@@ -106,7 +106,6 @@ const linked_functions = [
 
     // pal_icushim_static.c
     "mono_wasm_load_icu_data",
-    "mono_wasm_get_icudt_name",
 
     #if USE_PTHREADS
     /// mono-threads-wasm.c
index 733bdd952c3100cd13950cf8787910d533448702..6c1c0c844b183b7b251fa231e5d6a316b080aa73 100644 (file)
@@ -5,7 +5,7 @@ import MonoWasmThreads from "consts:monoWasmThreads";
 import { mono_wasm_fire_debugger_agent_message_with_data, mono_wasm_fire_debugger_agent_message_with_data_to_pause, mono_wasm_debugger_log, mono_wasm_add_dbg_command_received, mono_wasm_set_entrypoint_breakpoint } from "./debug";
 
 import { mono_wasm_release_cs_owned_object } from "./gc-handles";
-import { mono_wasm_load_icu_data, mono_wasm_get_icudt_name } from "./icu";
+import { mono_wasm_load_icu_data } from "./icu";
 import { mono_wasm_bind_cs_function } from "./invoke-cs";
 import { mono_wasm_bind_js_function, mono_wasm_invoke_bound_function, mono_wasm_invoke_import } from "./invoke-js";
 import { mono_interp_tier_prepare_jiterpreter } from "./jiterpreter";
@@ -93,7 +93,6 @@ export function export_linker(): any {
 
         //  pal_icushim_static.c
         mono_wasm_load_icu_data,
-        mono_wasm_get_icudt_name,
 
         // threading exports, if threading is enabled
         ...mono_wasm_threads_exports,
index 27cccaf2f63e57e8c4979abbe87196e76e2ba4af..4648cadbdf351a8b5b7c5145305da347211e38ec 100644 (file)
@@ -16,14 +16,6 @@ export function mono_wasm_load_icu_data(offset: VoidPtr): boolean {
     return ok;
 }
 
-// Get icudt.dat exact filename that matches given culture, examples:
-//   "ja" -> "icudt_CJK.dat"
-//   "en_US" (or "en-US" or just "en") -> "icudt_EFIGS.dat"
-// etc, see "mono_wasm_get_icudt_name" implementation in pal_icushim_static.c
-export function mono_wasm_get_icudt_name(culture: string): string {
-    return cwraps.mono_wasm_get_icudt_name(culture);
-}
-
 // Performs setup for globalization.
 // @globalizationMode is one of "icu", "invariant", or "auto".
 // "auto" will use "icu" if any ICU data archives have been loaded,
index 51e117113de1c21a3ea6a1be6ec9f54b34977cd5..ec4dea95dc1194cd13f3f04eca04c00a19f2d059 100644 (file)
@@ -13,6 +13,4 @@ PALEXPORT int32_t GlobalizationNative_GetICUVersion(void);
 
 PALEXPORT int32_t GlobalizationNative_LoadICUData(const char* path);
 
-PALEXPORT const char* GlobalizationNative_GetICUDTName(const char* culture);
-
 #endif
index 69fcbb03ae31ab6e200f1a0d00c774f20b8fd125..34d49a0be323303ecf281cccabcfc928f470090b 100644 (file)
@@ -50,13 +50,6 @@ static int32_t load_icu_data(const void* pData);
 #ifdef __EMSCRIPTEN__
 #include <emscripten.h>
 
-EMSCRIPTEN_KEEPALIVE const char* mono_wasm_get_icudt_name(const char* culture);
-
-EMSCRIPTEN_KEEPALIVE const char* mono_wasm_get_icudt_name(const char* culture)
-{
-    return GlobalizationNative_GetICUDTName(culture);
-}
-
 EMSCRIPTEN_KEEPALIVE int32_t mono_wasm_load_icu_data(const void* pData);
 
 EMSCRIPTEN_KEEPALIVE int32_t mono_wasm_load_icu_data(const void* pData)
@@ -200,35 +193,6 @@ GlobalizationNative_LoadICUData(const char* path)
     return GlobalizationNative_LoadICU();
 }
 
-const char* GlobalizationNative_GetICUDTName(const char* culture)
-{
-    // Based on https://github.com/dotnet/icu/tree/maint/maint-67/icu-filters
-
-    // Use full one if culture is null or empty
-    if (!culture || strlen(culture) < 2)
-        return "icudt.dat";
-
-    // CJK: starts with "ja", "ko" or "zh"
-    if (!strncasecmp("ja", culture, 2) ||
-        !strncasecmp("ko", culture, 2) ||
-        !strncasecmp("zh", culture, 2))
-        return "icudt_CJK.dat"; // contains "en" as well.
-
-    // EFIGS
-    const char* efigsCultures[15] = {
-        "en-US", "fr-FR", "es-ES", "it-IT", "de-DE",
-        "en_US", "fr_FR", "es_ES", "it_IT", "de_DE",
-        "en",    "fr",    "es",    "it",    "de"
-    };
-
-    for (int i = 0; i < 15; i++)
-        if (!strcasecmp(culture, efigsCultures[i]))
-            return "icudt_EFIGS.dat";
-
-    // full except CJK cultures
-    return "icudt_no_CJK.dat";
-}
-
 int32_t GlobalizationNative_LoadICU(void)
 {
 #if !defined(LOCAL_BUILD)