Skip to content

Commit e7926d6

Browse files
authored
[browser] remove unused methods (#82865)
1 parent 6a218ab commit e7926d6

File tree

3 files changed

+0
-193
lines changed

3 files changed

+0
-193
lines changed

src/mono/wasm/runtime/corebindings.c

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -123,45 +123,3 @@ mono_wasm_typed_array_new_ref (char *arr, int length, int size, int type, PPVOLA
123123
store_volatile((PPVOLATILE(MonoObject))result, (MonoObject *)buffer);
124124
MONO_EXIT_GC_UNSAFE;
125125
}
126-
127-
// TODO: Remove - no longer used? If not, convert to ref
128-
EMSCRIPTEN_KEEPALIVE int
129-
mono_wasm_unbox_enum (PVOLATILE(MonoObject) obj)
130-
{
131-
if (!obj)
132-
return 0;
133-
134-
int result = 0;
135-
MONO_ENTER_GC_UNSAFE;
136-
PVOLATILE(MonoType) type = mono_class_get_type (mono_object_get_class(obj));
137-
138-
PVOLATILE(void) ptr = mono_object_unbox (obj);
139-
switch (mono_type_get_type(mono_type_get_underlying_type (type))) {
140-
case MONO_TYPE_I1:
141-
case MONO_TYPE_U1:
142-
result = *(unsigned char*)ptr;
143-
break;
144-
case MONO_TYPE_I2:
145-
result = *(short*)ptr;
146-
break;
147-
case MONO_TYPE_U2:
148-
result = *(unsigned short*)ptr;
149-
break;
150-
case MONO_TYPE_I4:
151-
result = *(int*)ptr;
152-
break;
153-
case MONO_TYPE_U4:
154-
result = *(unsigned int*)ptr;
155-
break;
156-
// WASM doesn't support returning longs to JS
157-
// case MONO_TYPE_I8:
158-
// case MONO_TYPE_U8:
159-
default:
160-
printf ("Invalid type %d to mono_unbox_enum\n", mono_type_get_type(mono_type_get_underlying_type (type)));
161-
break;
162-
}
163-
MONO_EXIT_GC_UNSAFE;
164-
return result;
165-
}
166-
167-

src/mono/wasm/runtime/cwraps.ts

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const fn_signatures: SigLine[] = [
1616
// MONO
1717
[true, "mono_wasm_register_root", "number", ["number", "number", "string"]],
1818
[true, "mono_wasm_deregister_root", null, ["number"]],
19-
[true, "mono_wasm_string_get_data", null, ["number", "number", "number", "number"]],
2019
[true, "mono_wasm_string_get_data_ref", null, ["number", "number", "number", "number"]],
2120
[true, "mono_wasm_set_is_debugger_attached", "void", ["bool"]],
2221
[true, "mono_wasm_send_dbg_command", "bool", ["number", "number", "number", "number", "number"]],
@@ -41,13 +40,9 @@ const fn_signatures: SigLine[] = [
4140
[true, "mono_wasm_find_corlib_type", "number", ["string", "string"]],
4241
[true, "mono_wasm_assembly_find_type", "number", ["number", "string", "string"]],
4342
[true, "mono_wasm_assembly_find_method", "number", ["number", "string", "number"]],
44-
[true, "mono_wasm_invoke_method", "number", ["number", "number", "number", "number"]],
4543
[false, "mono_wasm_invoke_method_ref", "void", ["number", "number", "number", "number", "number"]],
46-
[true, "mono_wasm_string_get_utf8", "number", ["number"]],
4744
[true, "mono_wasm_string_from_utf16_ref", "void", ["number", "number", "number"]],
48-
[true, "mono_wasm_get_obj_type", "number", ["number"]],
4945
[true, "mono_wasm_array_length_ref", "number", ["number"]],
50-
[true, "mono_wasm_array_get", "number", ["number", "number"]],
5146
[true, "mono_wasm_array_get_ref", "void", ["number", "number", "number"]],
5247
[false, "mono_wasm_obj_array_new", "number", ["number"]],
5348
[false, "mono_wasm_obj_array_new_ref", "void", ["number", "number"]],
@@ -62,7 +57,6 @@ const fn_signatures: SigLine[] = [
6257
[true, "mono_wasm_string_array_new_ref", "void", ["number", "number"]],
6358
[true, "mono_wasm_typed_array_new_ref", "void", ["number", "number", "number", "number", "number"]],
6459
[true, "mono_wasm_class_get_type", "number", ["number"]],
65-
[true, "mono_wasm_type_get_class", "number", ["number"]],
6660
[true, "mono_wasm_get_type_name", "string", ["number"]],
6761
[true, "mono_wasm_get_type_aqn", "string", ["number"]],
6862

@@ -75,9 +69,6 @@ const fn_signatures: SigLine[] = [
7569
[true, "mono_wasm_diagnostic_server_post_resume_runtime", "void", []],
7670
[true, "mono_wasm_diagnostic_server_create_stream", "number", []],
7771

78-
//DOTNET
79-
[true, "mono_wasm_string_from_js", "number", ["string"]],
80-
8172
//INTERNAL
8273
[false, "mono_wasm_exit", "void", ["number"]],
8374
[true, "mono_wasm_getenv", "number", ["string"]],
@@ -146,11 +137,6 @@ export interface t_Cwraps {
146137
mono_wasm_load_runtime(unused: string, debugLevel: number): void;
147138
mono_wasm_change_debugger_log_level(value: number): void;
148139

149-
/**
150-
* @deprecated Not GC or thread safe
151-
*/
152-
mono_wasm_string_get_data(string: MonoString, outChars: CharPtrPtr, outLengthBytes: Int32Ptr, outIsInterned: Int32Ptr): void;
153-
154140
// BINDING
155141
mono_wasm_get_corlib(): MonoAssembly;
156142
mono_wasm_assembly_load(name: string): MonoAssembly;
@@ -160,10 +146,6 @@ export interface t_Cwraps {
160146
mono_wasm_assembly_find_type(assembly: MonoAssembly, namespace: string, name: string): MonoType;
161147
mono_wasm_assembly_find_method(klass: MonoClass, name: string, args: number): MonoMethod;
162148
mono_wasm_invoke_method_ref(method: MonoMethod, this_arg: MonoObjectRef, params: VoidPtr, out_exc: MonoObjectRef, out_result: MonoObjectRef): void;
163-
/**
164-
* @deprecated Not GC or thread safe
165-
*/
166-
mono_wasm_string_get_utf8(str: MonoString): CharPtr;
167149
mono_wasm_string_from_utf16_ref(str: CharPtr, len: number, result: MonoObjectRef): void;
168150

169151
mono_wasm_array_length_ref(array: MonoObjectRef): number;
@@ -178,27 +160,14 @@ export interface t_Cwraps {
178160
mono_wasm_string_array_new_ref(size: number, result: MonoObjectRef): void;
179161
mono_wasm_typed_array_new_ref(arr: VoidPtr, length: number, size: number, type: number, result: MonoObjectRef): void;
180162
mono_wasm_class_get_type(klass: MonoClass): MonoType;
181-
mono_wasm_type_get_class(ty: MonoType): MonoClass;
182163
mono_wasm_get_delegate_invoke_ref(delegate: MonoObjectRef): MonoMethod;
183164
mono_wasm_get_type_name(ty: MonoType): string;
184165
mono_wasm_get_type_aqn(ty: MonoType): string;
185166

186-
/**
187-
* @deprecated Not GC or thread safe
188-
*/
189-
mono_wasm_get_obj_type(str: MonoObject): number;
190-
/**
191-
* @deprecated Not GC or thread safe
192-
*/
193-
mono_wasm_invoke_method(method: MonoMethod, this_arg: MonoObject, params: VoidPtr, out_exc: MonoObjectRef): MonoObject;
194167
/**
195168
* @deprecated Not GC or thread safe
196169
*/
197170
mono_wasm_obj_array_new(size: number): MonoArray;
198-
/**
199-
* @deprecated Not GC or thread safe
200-
*/
201-
mono_wasm_array_get(array: MonoArray, idx: number): MonoObject;
202171
/**
203172
* @deprecated Not GC or thread safe
204173
*/
@@ -213,12 +182,6 @@ export interface t_Cwraps {
213182
mono_wasm_diagnostic_server_post_resume_runtime(): void;
214183
mono_wasm_diagnostic_server_create_stream(): VoidPtr;
215184

216-
//DOTNET
217-
/**
218-
* @deprecated Not GC or thread safe
219-
*/
220-
mono_wasm_string_from_js(str: string): MonoString;
221-
222185
//INTERNAL
223186
mono_wasm_exit(exit_code: number): number;
224187
mono_wasm_getenv(name: string): CharPtr;

src/mono/wasm/runtime/driver.c

Lines changed: 0 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -736,28 +736,6 @@ mono_wasm_invoke_method_ref (MonoMethod *method, MonoObject **this_arg_in, void
736736
MONO_EXIT_GC_UNSAFE;
737737
}
738738

739-
// deprecated
740-
MonoObject*
741-
mono_wasm_invoke_method (MonoMethod *method, MonoObject *this_arg, void *params[], MonoObject **out_exc)
742-
{
743-
PVOLATILE(MonoObject) result = NULL;
744-
mono_wasm_invoke_method_ref (method, &this_arg, params, out_exc, (MonoObject **)&result);
745-
746-
if (result) {
747-
MONO_ENTER_GC_UNSAFE;
748-
MonoMethodSignature *sig = mono_method_signature (method);
749-
MonoType *type = mono_signature_get_return_type (sig);
750-
// If the method return type is void return null
751-
// This gets around a memory access crash when the result return a value when
752-
// a void method is invoked.
753-
if (mono_type_get_type (type) == MONO_TYPE_VOID)
754-
result = NULL;
755-
MONO_EXIT_GC_UNSAFE;
756-
}
757-
758-
return result;
759-
}
760-
761739
EMSCRIPTEN_KEEPALIVE MonoObject*
762740
mono_wasm_invoke_method_bound (MonoMethod *method, void* args)// JSMarshalerArguments
763741
{
@@ -841,28 +819,6 @@ mono_wasm_assembly_get_entry_point (MonoAssembly *assembly, int auto_insert_brea
841819
return method;
842820
}
843821

844-
// TODO: ref
845-
EMSCRIPTEN_KEEPALIVE char *
846-
mono_wasm_string_get_utf8 (MonoString *str)
847-
{
848-
char * result;
849-
MONO_ENTER_GC_UNSAFE;
850-
result = mono_string_to_utf8 (str); //XXX JS is responsible for freeing this
851-
MONO_EXIT_GC_UNSAFE;
852-
return result;
853-
}
854-
855-
EMSCRIPTEN_KEEPALIVE MonoString *
856-
mono_wasm_string_from_js (const char *str)
857-
{
858-
PVOLATILE(MonoString) result = NULL;
859-
MONO_ENTER_GC_UNSAFE;
860-
if (str)
861-
result = mono_string_new (root_domain, str);
862-
MONO_EXIT_GC_UNSAFE;
863-
return result;
864-
}
865-
866822
EMSCRIPTEN_KEEPALIVE void
867823
mono_wasm_string_from_utf16_ref (const mono_unichar2 * chars, int length, MonoString **result)
868824
{
@@ -1025,51 +981,6 @@ _marshal_type_from_mono_type (int mono_type, MonoClass *klass, MonoType *type)
1025981
}
1026982
}
1027983

1028-
// FIXME: Ref
1029-
EMSCRIPTEN_KEEPALIVE MonoClass *
1030-
mono_wasm_get_obj_class (MonoObject *obj)
1031-
{
1032-
if (!obj)
1033-
return NULL;
1034-
1035-
return mono_object_get_class (obj);
1036-
}
1037-
1038-
// This code runs inside a gc unsafe region
1039-
static int
1040-
_wasm_get_obj_type_ref_impl (PPVOLATILE(MonoObject) obj)
1041-
{
1042-
if (!obj || !*obj)
1043-
return 0;
1044-
1045-
/* Process obj before calling into the runtime, class_from_name () can invoke managed code */
1046-
MonoClass *klass = mono_object_get_class (*obj);
1047-
if (!klass)
1048-
return MARSHAL_ERROR_NULL_CLASS_POINTER;
1049-
if ((klass == mono_get_string_class ()) &&
1050-
mono_string_instance_is_interned ((MonoString *)*obj))
1051-
return MARSHAL_TYPE_STRING_INTERNED;
1052-
1053-
MonoType *type = mono_class_get_type (klass);
1054-
if (!type)
1055-
return MARSHAL_ERROR_NULL_TYPE_POINTER;
1056-
1057-
int mono_type = mono_type_get_type (type);
1058-
1059-
return _marshal_type_from_mono_type (mono_type, klass, type);
1060-
}
1061-
1062-
// FIXME: Ref
1063-
EMSCRIPTEN_KEEPALIVE int
1064-
mono_wasm_get_obj_type (MonoObject *obj)
1065-
{
1066-
int result;
1067-
MONO_ENTER_GC_UNSAFE;
1068-
result = _wasm_get_obj_type_ref_impl(&obj);
1069-
MONO_EXIT_GC_UNSAFE;
1070-
return result;
1071-
}
1072-
1073984
// This code runs inside a gc unsafe region
1074985
static int
1075986
_mono_wasm_try_unbox_primitive_and_get_type_ref_impl (PVOLATILE(MonoObject) obj, void *result, int result_capacity) {
@@ -1226,12 +1137,6 @@ mono_wasm_array_length_ref (MonoArray **array)
12261137
return mono_array_length (*array);
12271138
}
12281139

1229-
EMSCRIPTEN_KEEPALIVE MonoObject*
1230-
mono_wasm_array_get (MonoArray *array, int idx)
1231-
{
1232-
return mono_array_get (array, MonoObject*, idx);
1233-
}
1234-
12351140
EMSCRIPTEN_KEEPALIVE void
12361141
mono_wasm_array_get_ref (PPVOLATILE(MonoArray) array, int idx, PPVOLATILE(MonoObject) result)
12371142
{
@@ -1347,13 +1252,6 @@ mono_wasm_string_get_data_ref (
13471252
MONO_EXIT_GC_UNSAFE;
13481253
}
13491254

1350-
EMSCRIPTEN_KEEPALIVE void
1351-
mono_wasm_string_get_data (
1352-
MonoString *string, mono_unichar2 **outChars, int *outLengthBytes, int *outIsInterned
1353-
) {
1354-
mono_wasm_string_get_data_ref(&string, outChars, outLengthBytes, outIsInterned);
1355-
}
1356-
13571255
EMSCRIPTEN_KEEPALIVE MonoType *
13581256
mono_wasm_class_get_type (MonoClass *klass)
13591257
{
@@ -1366,18 +1264,6 @@ mono_wasm_class_get_type (MonoClass *klass)
13661264
return result;
13671265
}
13681266

1369-
EMSCRIPTEN_KEEPALIVE MonoClass *
1370-
mono_wasm_type_get_class (MonoType *type)
1371-
{
1372-
if (!type)
1373-
return NULL;
1374-
MonoClass *result;
1375-
MONO_ENTER_GC_UNSAFE;
1376-
result = mono_type_get_class (type);
1377-
MONO_EXIT_GC_UNSAFE;
1378-
return result;
1379-
}
1380-
13811267
EMSCRIPTEN_KEEPALIVE char *
13821268
mono_wasm_get_type_name (MonoType * typePtr) {
13831269
return mono_type_get_name_full (typePtr, MONO_TYPE_NAME_FORMAT_REFLECTION);

0 commit comments

Comments
 (0)