Delete unused mono_unbox_int (#61384)
authorAdeel Mujahid <3840695+am11@users.noreply.github.com>
Wed, 10 Nov 2021 17:22:45 +0000 (19:22 +0200)
committerGitHub <noreply@github.com>
Wed, 10 Nov 2021 17:22:45 +0000 (18:22 +0100)
* Delete unused mono_unbox_int

* Fix gcc step display name

* Match command invocation order

eng/pipelines/coreclr/templates/build-job.yml
src/mono/wasm/runtime/driver.c

index 9aa975a..a8c57ea 100644 (file)
@@ -231,7 +231,7 @@ jobs:
     # Build libs.native, host.native and mono with gcc
     - ${{ if eq(parameters.compilerName, 'gcc') }}:
       - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) libs.native+host.native+mono $(compilerArg) $(crossArg) -arch $(archType) $(osArg) -c $(buildConfig) $(pgoInstrumentArg) $(officialBuildIdArg) -ci
-        displayName: Build clr+mono+libs.native+host.native
+        displayName: Build libs.native+host.native+mono
 
     # Sign and add entitlements to these MacOS binaries
     - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
index a978fc5..6d7bc86 100644 (file)
@@ -1072,41 +1072,6 @@ mono_wasm_try_unbox_primitive_and_get_type (MonoObject *obj, void *result, int r
        return resultType;
 }
 
-// FIXME: This function is retained specifically because runtime-test.js uses it
-EMSCRIPTEN_KEEPALIVE int
-mono_unbox_int (MonoObject *obj)
-{
-       if (!obj)
-               return 0;
-       MonoType *type = mono_class_get_type (mono_object_get_class(obj));
-
-       void *ptr = mono_object_unbox (obj);
-       switch (mono_type_get_type (type)) {
-       case MONO_TYPE_I1:
-       case MONO_TYPE_BOOLEAN:
-               return *(signed char*)ptr;
-       case MONO_TYPE_U1:
-               return *(unsigned char*)ptr;
-       case MONO_TYPE_I2:
-               return *(short*)ptr;
-       case MONO_TYPE_U2:
-               return *(unsigned short*)ptr;
-       case MONO_TYPE_I4:
-       case MONO_TYPE_I:
-               return *(int*)ptr;
-       case MONO_TYPE_U4:
-               return *(unsigned int*)ptr;
-       case MONO_TYPE_CHAR:
-               return *(short*)ptr;
-       // WASM doesn't support returning longs to JS
-       // case MONO_TYPE_I8:
-       // case MONO_TYPE_U8:
-       default:
-               printf ("Invalid type %d to mono_unbox_int\n", mono_type_get_type (type));
-               return 0;
-       }
-}
-
 EMSCRIPTEN_KEEPALIVE int
 mono_wasm_array_length (MonoArray *array)
 {