From 86e22918b72bbaf5345c31626eff8e979667e660 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 4 Apr 2025 16:32:17 +0100 Subject: [PATCH 001/209] Add some checks for wasm64 --- src/mono/CMakeLists.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index 834c4881aac512..7941c4a6911239 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -144,6 +144,9 @@ if(NOT AOT_TARGET_TRIPLE STREQUAL "") elseif(AOT_TARGET_TRIPLE STREQUAL "wasm32-unknown-none") set(TARGET_SYSTEM_NAME "emscripten") set(TARGET_ARCH "wasm") + elseif(AOT_TARGET_TRIPLE STREQUAL "wasm64-unknown-none") + set(TARGET_SYSTEM_NAME "emscripten") + set(TARGET_ARCH "wasm64") elseif(AOT_TARGET_TRIPLE STREQUAL "wasm32-unknown-wasip2") set(TARGET_SYSTEM_NAME "wasi") set(TARGET_ARCH "wasm") @@ -403,7 +406,7 @@ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64") set(HOST_RISCV64 1) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "s390x") set(HOST_S390X 1) -elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "wasm" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "wasm32") +elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "wasm" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "wasm32" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "wasm64") set(HOST_WASM 1) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le") set(HOST_POWERPC 1) @@ -486,6 +489,11 @@ elseif(TARGET_ARCH STREQUAL "wasm" OR TARGET_ARCH STREQUAL "wasm32") set(MONO_ARCHITECTURE "\"wasm\"") set(TARGET_SIZEOF_VOID_P 4) set(SIZEOF_REGISTER 4) +elseif(TARGET_ARCH STREQUAL "wasm64" ) + set(TARGET_WASM 1) + set(MONO_ARCHITECTURE "\"wasm\"") + set(TARGET_SIZEOF_VOID_P 8) + set(SIZEOF_REGISTER 8) elseif(TARGET_ARCH STREQUAL "ppc64le") set(TARGET_POWERPC 1) set(TARGET_POWERPC64 1) @@ -587,6 +595,8 @@ if(LLVM_PREFIX) set(llvm_codegen_libs "armcodegen") elseif(TARGET_ARCH STREQUAL "wasm") set(llvm_codegen_libs "") + elseif(TARGET_ARCH STREQUAL "wasm64") + set(llvm_codegen_libs "") else() message(FATAL_ERROR "FIXME: ${TARGET_ARCH}") endif() @@ -657,7 +667,7 @@ if(LLVM_PREFIX) # Check codegen libs and add needed libraries. set(llvm_extra ${MONO_llvm_extra_libs_${llvm_codegen_libs}}) - if("${llvm_extra}" STREQUAL "" AND NOT "${TARGET_ARCH}" STREQUAL "wasm") + if("${llvm_extra}" STREQUAL "" AND NOT "${TARGET_ARCH}" STREQUAL "wasm" AND NOT "${TARGET_ARCH}" STREQUAL "wasm64" ) message(FATAL_ERROR "FIXME: ${TARGET_ARCH}") endif() From 03faf049e10c37f72ffe9f2ae00a0b11dbf1d176 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 9 Apr 2025 10:11:07 +0100 Subject: [PATCH 002/209] Initial changes for wasm64 build, minus logging --- src/mono/browser/browser.proj | 3 ++- src/mono/browser/emscripten-version.txt | 2 +- src/mono/cmake/configure.cmake | 2 ++ src/mono/mono.proj | 15 ++++++++++++++- src/mono/wasm/build/WasmApp.Common.targets | 1 + .../external/zlib-ng/cmake/detect-arch.cmake | 11 ++++++++++- 6 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/mono/browser/browser.proj b/src/mono/browser/browser.proj index 642c727fd00a20..cfa2ad2d40f743 100644 --- a/src/mono/browser/browser.proj +++ b/src/mono/browser/browser.proj @@ -285,6 +285,7 @@ <_EmccLinkFlags Condition="'$(WasmEnableThreads)' == 'true'" Include="-Wno-pthreads-mem-growth" /> <_EmccLinkFlags Condition="'$(WasmEnableThreads)' == 'true'" Include="-s PTHREAD_POOL_SIZE=0" /> <_EmccLinkFlags Condition="'$(WasmEnableThreads)' == 'true'" Include="-s PTHREAD_POOL_SIZE_STRICT=0" /> + <_EmccLinkFlags Condition="'$(WasmEnableMemory64)' == 'true'" Include="-s MEMORY64=1 -s MAXIMUM_MEMORY=16GB" /> <_EmccLinkFlags Include="-s ALLOW_MEMORY_GROWTH=1" /> <_EmccLinkFlags Include="-s ALLOW_TABLE_GROWTH=1" /> @@ -305,7 +306,7 @@ - + <_EmccLinkFlags Include="-s TEXTDECODER=0"/> diff --git a/src/mono/browser/emscripten-version.txt b/src/mono/browser/emscripten-version.txt index 4a8bd23c1443d4..8b2dd6c36f448b 100644 --- a/src/mono/browser/emscripten-version.txt +++ b/src/mono/browser/emscripten-version.txt @@ -1 +1 @@ -3.1.56 \ No newline at end of file +4.0.5 \ No newline at end of file diff --git a/src/mono/cmake/configure.cmake b/src/mono/cmake/configure.cmake index b5cf1c625e4bb3..69e791b814f8cb 100644 --- a/src/mono/cmake/configure.cmake +++ b/src/mono/cmake/configure.cmake @@ -226,6 +226,8 @@ check_type_size("long" SIZEOF_LONG) check_type_size("long long" SIZEOF_LONG_LONG) check_type_size("size_t" SIZEOF_SIZE_T) +message("MRH_LOGGING: PROCESSOR_ARCHITECTURE : ${PROCESSOR_ARCHITECTURE}") +message("MRH_LOGGING: SIZEOF_VOID_P is set to ${SIZEOF_VOID_P}") # # Override checks # diff --git a/src/mono/mono.proj b/src/mono/mono.proj index f6f1f65dba779f..a4ff3b461e1dad 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -559,6 +559,9 @@ JS_ENGINES = [NODE_JS] <_MonoMinimal Condition="'$(Configuration)' == 'Release' and '$(MonoEnableAssertMessages)' != 'true'">$(_MonoMinimal),assert_messages <_MonoMinimal Condition="'$(WasmEnableThreads)' != 'true'">$(_MonoMinimal),threads + + wasm64-unknown-none + <_MonoCMakeArgs Include="-DENABLE_MINIMAL=jit,sgen_major_marksweep_conc,sgen_split_nursery,sgen_gc_bridge,sgen_toggleref,sgen_debug_helpers,sgen_binary_protocol,logging,interpreter,qcalls$(_MonoMinimal)"/> <_MonoCMakeArgs Include="-DENABLE_INTERP_LIB=1"/> @@ -566,11 +569,20 @@ JS_ENGINES = [NODE_JS] <_MonoCMakeArgs Include="-DENABLE_ICALL_EXPORT=1"/> <_MonoCMakeArgs Include="-DENABLE_LAZY_GC_THREAD_CREATION=1"/> <_MonoCMakeArgs Include="-DENABLE_WEBCIL=1"/> + <_MonoCMakeArgs Include="-DAOT_TARGET_TRIPLE=$(MonoAotAbi)"/> <_MonoCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread"/> <_MonoCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-D_GNU_SOURCE=1" /> + <_MonoCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64" /> + <_MonoCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="--target=wasm64" /> <_MonoCXXFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread"/> <_MonoCXXFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-D_GNU_SOURCE=1" /> + <_MonoCXXFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64" /> + <_MonoCXXFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="--target=wasm64" /> + <_MonoBuildEnv Condition="'$(WasmEnableMemory64)' == 'true'" Include="TARGET_BUILD_ARCH=wasm64" /> + + + <_MonoCMakeArgs Include="-DENABLE_LLVM_RUNTIME=1"/> @@ -859,7 +871,8 @@ JS_ENGINES = [NODE_JS] - wasm32-unknown-none + wasm32-unknown-none + wasm64-unknown-none wasm32-unknown-wasip2 <_ForceRelease Condition="$([MSBuild]::IsOSPlatform('Windows')) and '$(TargetArchitecture)' == 'wasm' and '$(Configuration)' == 'Debug'">true diff --git a/src/mono/wasm/build/WasmApp.Common.targets b/src/mono/wasm/build/WasmApp.Common.targets index 4a1b5f4356f8f5..7308f8a806a972 100644 --- a/src/mono/wasm/build/WasmApp.Common.targets +++ b/src/mono/wasm/build/WasmApp.Common.targets @@ -842,6 +842,7 @@ <_WasmCompileArguments Include=""@$(_WasmDefaultFlagsRsp)"" Condition="'$(_WasmDefaultFlagsRsp)' != ''" /> <_WasmCompileArguments Include="$(_WasmDefaultFlags)" Condition="'$(_WasmDefaultFlags)' != ''" /> <_WasmCompileArguments Include=""@$(_WasmCompileBitcodeRsp)"" Condition="'$(_WasmCompileBitcodeRsp)' != ''" /> + <_WasmCompileArguments Include="-s MEMORY64=1" Condition="'$(WasmEnableMemory64)' == 'true'" /> Date: Thu, 10 Apr 2025 09:43:30 +0100 Subject: [PATCH 003/209] add DISABLE_JITERPRETER flag Add flags to try to get mono cross to build wasm64 - this time --target=wasm64 is not recognised. --- src/mono/cmake/config.h.in | 3 +++ src/mono/mono.proj | 20 ++++++++++++++++++-- src/mono/mono/mini/CMakeLists.txt | 16 ++++++++++------ 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/src/mono/cmake/config.h.in b/src/mono/cmake/config.h.in index 8ac0c0f7c3c290..7b2c1b75615dc1 100644 --- a/src/mono/cmake/config.h.in +++ b/src/mono/cmake/config.h.in @@ -221,6 +221,9 @@ /* Disable the interpreter. */ #cmakedefine DISABLE_INTERPRETER 1 +/* Disable the JITERPRETER. */ +#cmakedefine DISABLE_JITERPRETER 1 + /* Disable SIMD intrinsics related optimizations. */ #cmakedefine DISABLE_SIMD 1 diff --git a/src/mono/mono.proj b/src/mono/mono.proj index a4ff3b461e1dad..234bff6c0318fb 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -568,7 +568,8 @@ JS_ENGINES = [NODE_JS] <_MonoCMakeArgs Include="-DDISABLE_ICALL_TABLES=1"/> <_MonoCMakeArgs Include="-DENABLE_ICALL_EXPORT=1"/> <_MonoCMakeArgs Include="-DENABLE_LAZY_GC_THREAD_CREATION=1"/> - <_MonoCMakeArgs Include="-DENABLE_WEBCIL=1"/> + <_MonoCMakeArgs Include="-DENABLE_WEBCIL=1"/> + <_MonoCMakeArgs Include="-DDISABLE_JITERPRETER=1"/> <_MonoCMakeArgs Include="-DAOT_TARGET_TRIPLE=$(MonoAotAbi)"/> <_MonoCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread"/> <_MonoCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-D_GNU_SOURCE=1" /> @@ -800,7 +801,8 @@ JS_ENGINES = [NODE_JS] - + + $(BuildArchitecture) @@ -877,6 +879,20 @@ JS_ENGINES = [NODE_JS] <_ForceRelease Condition="$([MSBuild]::IsOSPlatform('Windows')) and '$(TargetArchitecture)' == 'wasm' and '$(Configuration)' == 'Debug'">true + + <_MonoAOTCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread -D_GNU_SOURCE=1" /> + <_MonoAOTCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="--target=wasm64 -DMEMORY64" /> + <_MonoAOTCPPFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread -D_GNU_SOURCE=1"/> + <_MonoAOTCPPFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64 --target=wasm64" /> + <_MonoAOTCXXFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread -D_GNU_SOURCE=1"/> + <_MonoAOTCXXFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64 --target=wasm64" /> + + + + + + + <_MonoAOTCPPFLAGS Include="-DHOST_WIN32" /> diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index a2b3bdae9a72c0..3d4acd1fedf9ee 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -244,19 +244,23 @@ set(interp_sources interp/transform.c interp/transform-opt.c interp/tiering.h - interp/tiering.c - interp/jiterpreter.c + interp/tiering.c interp/interp-pgo.c) set(interp_simd_sources interp/interp-simd.c) set(interp_stub_sources interp-stubs.c) +set(jiterp_sources + interp/jiterpreter.c) if(NOT DISABLE_INTERPRETER) - if(HOST_WASM) - set(mini_interp_sources ${interp_sources}) - else() - set(mini_interp_sources ${interp_sources} ${interp_simd_sources}) + if(HOST_WASM) + set(mini_interp_sources ${interp_sources}) + else() + set(mini_interp_sources ${interp_sources} ${interp_simd_sources}) + endif() + if(NOT DISABLE_JITERPRETER) + list(APPEND mini_interp_sources ${jiterp_sources}) endif() else() set(mini_interp_sources ${interp_stub_sources}) From ed5b41f60957162f70e0e7e72dd2612cf935b4b0 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 10 Apr 2025 09:44:03 +0100 Subject: [PATCH 004/209] Cast to int to remove warning/error --- src/mono/mono/mini/mini-llvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/mini/mini-llvm.c b/src/mono/mono/mini/mini-llvm.c index 8aa11b4868dfc9..4116d886d93b18 100644 --- a/src/mono/mono/mini/mini-llvm.c +++ b/src/mono/mono/mini/mini-llvm.c @@ -10386,7 +10386,7 @@ MONO_RESTORE_WARNING } case OP_WASM_SIMD_CONV_R8_TO_I4_ZERO: { LLVMValueRef args [] = { lhs }; - LLVMValueRef val = call_intrins (ctx, ins->inst_c0, args, ""); + LLVMValueRef val = call_intrins (ctx, (int)ins->inst_c0, args, ""); values [ins->dreg] = LLVMBuildShuffleVector (builder, val, LLVMConstNull(v64_i4_t), create_const_vector_4_i32 (0, 1, 2, 3), ""); break; } From d8edba1b65e03099a15f1f7b4e18277bb5b1a22e Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 10 Apr 2025 16:29:15 +0100 Subject: [PATCH 005/209] build-native with MEMORY64. some extraneous stuff to pull out later --- src/mono/browser/browser.proj | 2 +- src/native/external/zlib-ng.cmake | 6 ++++++ src/native/libs/CMakeLists.txt | 7 +++++++ src/native/libs/build-native.cmd | 8 +++++++- src/native/libs/build-native.proj | 14 +++++++++++--- 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/mono/browser/browser.proj b/src/mono/browser/browser.proj index cfa2ad2d40f743..2373a42e5466f4 100644 --- a/src/mono/browser/browser.proj +++ b/src/mono/browser/browser.proj @@ -386,7 +386,7 @@ $(ArtifactsObjDir)wasm/pinvoke-table.h $(ArtifactsObjDir)wasm/wasm_m2n_invoke.g.h - -g -Os -DDEBUG=1 -DENABLE_AOT_PROFILER=1 -DENABLE_BROWSER_PROFILER=1 -DENABLE_LOG_PROFILER=1 + -g -Os -DDEBUG=1 -DENABLE_AOT_PROFILER=1 -DENABLE_BROWSER_PROFILER=1 -DENABLE_LOG_PROFILER=1 -DMEMORY64 -Oz $(CMakeConfigurationEmccFlags) -s ASSERTIONS=1 diff --git a/src/native/external/zlib-ng.cmake b/src/native/external/zlib-ng.cmake index b2338d682e1459..23d47d549a7fd6 100644 --- a/src/native/external/zlib-ng.cmake +++ b/src/native/external/zlib-ng.cmake @@ -29,6 +29,12 @@ if (CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) add_compile_options(-pthread) add_linker_flag(-pthread) endif() + + message(STATUS "MRH_LOGGING: setting MEMORY64 in zlib-ng.make") + add_definitions(-DMEMORY64) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMEMORY64") + add_compile_options(-DMEMORY64=1) + endif() set(BUILD_SHARED_LIBS OFF) # Shared libraries aren't supported in wasm diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index c90e9b8a45ddc5..48f6b67e3db40d 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -122,6 +122,13 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) if (MONO_WASM_MT) add_definitions(-DMONO_WASM_MT) endif() + if (MEMORY64) + + message(STATUS "MRH_LOGGING: setting MEMORY64 in CMakeLists.txt") + add_definitions(-DMEMORY64) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMEMORY64") + add_compile_options(-DMEMORY64=1) + endif() if (CMAKE_C_COMPILER_ID MATCHES "Clang") add_compile_options(-Weverything) diff --git a/src/native/libs/build-native.cmd b/src/native/libs/build-native.cmd index 1ccb8814be1576..b9b772ce1e9f3c 100644 --- a/src/native/libs/build-native.cmd +++ b/src/native/libs/build-native.cmd @@ -1,5 +1,5 @@ @if not defined _echo @echo off -setlocal +setlocal enabledelayedexpansion :SetupArgs :: Initialize the args that will be passed to cmake @@ -20,6 +20,7 @@ set CMAKE_BUILD_TYPE=Debug set __Ninja=1 set __icuDir="" set __usePThreads=0 +set __useMemory64=0 set __ExtraCmakeParams= :Arg_Loop @@ -47,6 +48,7 @@ if /i [%1] == [msbuild] ( set __Ninja=0&&shift&goto Arg_Loop) if /i [%1] == [icudir] ( set __icuDir=%2&&shift&&shift&goto Arg_Loop) if /i [%1] == [usepthreads] ( set __usePThreads=1&&shift&goto Arg_Loop) +if /i [%1] == [useMemory64] ( set __useMemory64=1&&shift&goto Arg_Loop) if /i [%1] == [-fsanitize] ( set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCLR_CMAKE_ENABLE_SANITIZERS=$2"&&shift&&shift&goto Arg_Loop) if /i [%1] == [-cmakeargs] ( set __ExtraCmakeParams=%__ExtraCmakeParams% %2&&shift&&shift&goto Arg_Loop) @@ -79,6 +81,10 @@ if NOT %__icuDir% == "" ( ) set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_USE_PTHREADS=%__usePThreads%" +if %__useMemory64% == 1 ( + set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_USE_MEMORY64=1" + echo "MRH_LOGGING_CMD: set -DCMAKE_USE_MEMORY64, params now: !__ExtraCmakeParams!"" +) if [%__outConfig%] == [] set __outConfig=%__TargetOS%-%__BuildArch%-%CMAKE_BUILD_TYPE% diff --git a/src/native/libs/build-native.proj b/src/native/libs/build-native.proj index 9351fc27427231..370354fda66b0d 100644 --- a/src/native/libs/build-native.proj +++ b/src/native/libs/build-native.proj @@ -39,7 +39,7 @@ + Condition="!$([MSBuild]::IsOsPlatform(Windows))"> <_BuildNativeArgs Condition="'$(Ninja)' == 'true'">$(_BuildNativeArgs) ninja From 6b9cff6af055bf524281fbf3469bb14dad2a874c Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 10 Apr 2025 16:29:39 +0100 Subject: [PATCH 006/209] logging only --- src/mono/CMakeLists.txt | 7 +++++-- src/mono/cmake/configure.cmake | 4 ++++ src/mono/mono.proj | 15 +++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index 7941c4a6911239..1265054cd8343d 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -121,7 +121,7 @@ endif() ###################################### # AOT CROSS COMPILER SUPPORT ###################################### - +message("MRH_LOGGING: AOT_TARGET_TRIPLE IS '${AOT_TARGET_TRIPLE}'") if(NOT AOT_TARGET_TRIPLE STREQUAL "") set(MONO_CROSS_COMPILE 1) if(NOT AOT_OFFSETS_FILE STREQUAL "") @@ -172,7 +172,7 @@ if(NOT AOT_TARGET_TRIPLE STREQUAL "") message(FATAL_ERROR "AOT target '${AOT_TARGET_TRIPLE}' not supported.") endif() endif() - +message("MRH_LOGGING: TARGET_ARCH IS '${TARGET_ARCH}'") ###################################### # HOST OS CHECKS ###################################### @@ -485,14 +485,17 @@ elseif(TARGET_ARCH STREQUAL "s390x") set(TARGET_SIZEOF_VOID_P 8) set(SIZEOF_REGISTER 8) elseif(TARGET_ARCH STREQUAL "wasm" OR TARGET_ARCH STREQUAL "wasm32") + message ("MRH_LOGGING: setting wasm32!") set(TARGET_WASM 1) set(MONO_ARCHITECTURE "\"wasm\"") set(TARGET_SIZEOF_VOID_P 4) set(SIZEOF_REGISTER 4) elseif(TARGET_ARCH STREQUAL "wasm64" ) + message ("MRH_LOGGING: setting wasm64!") set(TARGET_WASM 1) set(MONO_ARCHITECTURE "\"wasm\"") set(TARGET_SIZEOF_VOID_P 8) + #set(SIZEOF_VOID_P 8) set(SIZEOF_REGISTER 8) elseif(TARGET_ARCH STREQUAL "ppc64le") set(TARGET_POWERPC 1) diff --git a/src/mono/cmake/configure.cmake b/src/mono/cmake/configure.cmake index 69e791b814f8cb..f8759ecf44f748 100644 --- a/src/mono/cmake/configure.cmake +++ b/src/mono/cmake/configure.cmake @@ -228,6 +228,10 @@ check_type_size("size_t" SIZEOF_SIZE_T) message("MRH_LOGGING: PROCESSOR_ARCHITECTURE : ${PROCESSOR_ARCHITECTURE}") message("MRH_LOGGING: SIZEOF_VOID_P is set to ${SIZEOF_VOID_P}") +message("MRH_LOGGING: HAVE_SIZEOF_VOID_P: ${HAVE_SIZEOF_VOID_P}") +message("MRH_LOGGING: SIZEOF_VOID_P: ${SIZEOF_VOID_P}") +message("MRH_LOGGING: SIZEOF_VOID_P_CODE: ${SIZEOF_VOID_P_CODE}") + # # Override checks # diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 234bff6c0318fb..517a98c4b1783a 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -406,11 +406,24 @@ JS_ENGINES = [NODE_JS] + + + + + + + + <_MonoLLVMTargetArchitecture Condition="'$(TargetArchitecture)' == 'wasm'">$(BuildArchitecture) <_MonoLLVMTargetArchitecture Condition="'$(TargetArchitecture)' != 'wasm'">$(TargetArchitecture) <_MonoLLVMHostArchitecture Condition="'$(AotHostArchitecture)' != ''">$(AotHostArchitecture) + + + + + <_MonoCMakeArgs Condition="'$(_MonoUseNinja)' == 'true'" Include="-G Ninja"/> <_MonoCMakeArgs Include="-DCMAKE_INSTALL_PREFIX="$(MonoObjDir.Replace('\','/'))out""/> @@ -562,6 +575,8 @@ JS_ENGINES = [NODE_JS] wasm64-unknown-none + + <_MonoCMakeArgs Include="-DENABLE_MINIMAL=jit,sgen_major_marksweep_conc,sgen_split_nursery,sgen_gc_bridge,sgen_toggleref,sgen_debug_helpers,sgen_binary_protocol,logging,interpreter,qcalls$(_MonoMinimal)"/> <_MonoCMakeArgs Include="-DENABLE_INTERP_LIB=1"/> From 808aa30e0b6eb762650f031ac434e23d3bc068a9 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 11 Apr 2025 11:37:55 +0100 Subject: [PATCH 007/209] replace integer handles with a typedef depending on void pointer size --- src/mono/browser/runtime/corebindings.c | 30 +++++++++++++++---------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/mono/browser/runtime/corebindings.c b/src/mono/browser/runtime/corebindings.c index 29db5546f09948..7bb175a4363d60 100644 --- a/src/mono/browser/runtime/corebindings.c +++ b/src/mono/browser/runtime/corebindings.c @@ -20,14 +20,20 @@ #include "wasm-config.h" #include "gc-common.h" +#if SIZEOF_VOID_P == 4 +typedef int32_t cb_handle; +#else +typedef int64_t cb_handle; +#endif + //JS funcs -extern void mono_wasm_release_cs_owned_object (int js_handle); +extern void mono_wasm_release_cs_owned_object (cb_handle js_handle); extern void mono_wasm_resolve_or_reject_promise (void *args); -extern void mono_wasm_cancel_promise (int task_holder_gc_handle); +extern void mono_wasm_cancel_promise (cb_handle task_holder_gc_handle); extern void mono_wasm_console_clear (); extern void mono_wasm_set_entrypoint_breakpoint (int entry_point_metadata_token); extern void mono_wasm_trace_logger (const char *log_domain, const char *log_level, const char *message, mono_bool fatal, void *user_data); -extern void mono_wasm_invoke_js_function (int function_js_handle, void *args); +extern void mono_wasm_invoke_js_function (cb_handle function_js_handle, void *args); extern int mono_runtime_run_module_cctor (MonoImage *image, MonoError *error); @@ -39,17 +45,17 @@ void mono_wasm_assembly_get_entry_point (char *assembly_name, int auto_insert_br void mono_wasm_get_assembly_export (char *assembly_name, char *namespace, char *classname, char *methodname, int signature_hash, MonoMethod **method_out); #ifndef DISABLE_THREADS -void mono_wasm_release_cs_owned_object_post (pthread_t target_tid, int js_handle); +void mono_wasm_release_cs_owned_object_post (pthread_t target_tid, cb_handle js_handle); void mono_wasm_resolve_or_reject_promise_post (pthread_t target_tid, void *args); -void mono_wasm_cancel_promise_post (pthread_t target_tid, int task_holder_gc_handle); +void mono_wasm_cancel_promise_post (pthread_t target_tid, cb_handle task_holder_gc_handle); -extern void mono_wasm_install_js_worker_interop (int context_gc_handle); -void mono_wasm_install_js_worker_interop_wrapper (int context_gc_handle, void* beforeSyncJSImport, void* afterSyncJSImport, void* pumpHandler); +extern void mono_wasm_install_js_worker_interop (cb_handle context_gc_handle); +void mono_wasm_install_js_worker_interop_wrapper (cb_handle context_gc_handle, void* beforeSyncJSImport, void* afterSyncJSImport, void* pumpHandler); extern void mono_wasm_uninstall_js_worker_interop (); extern void mono_wasm_invoke_jsimport_MT (void* signature, void* args); void mono_wasm_invoke_jsimport_async_post (pthread_t target_tid, void* signature, void* args); void mono_wasm_invoke_jsimport_sync_send (pthread_t target_tid, void* signature, void* args); -void mono_wasm_invoke_js_function_send (pthread_t target_tid, int function_js_handle, void *args); +void mono_wasm_invoke_js_function_send (pthread_t target_tid, cb_handle function_js_handle, void *args); extern void mono_threads_wasm_async_run_in_target_thread_vi (pthread_t target_thread, void (*func) (gpointer), gpointer user_data1); extern void mono_threads_wasm_async_run_in_target_thread_vii (pthread_t target_thread, void (*func) (gpointer, gpointer), gpointer user_data1, gpointer user_data2); extern void mono_threads_wasm_sync_run_in_target_thread_vii (pthread_t target_thread, void (*func) (gpointer, gpointer), gpointer user_data1, gpointer args); @@ -251,7 +257,7 @@ void* before_sync_js_import; void* after_sync_js_import; void* synchronization_context_pump_handler; -void mono_wasm_install_js_worker_interop_wrapper (int context_gc_handle, void* beforeSyncJSImport, void* afterSyncJSImport, void* pumpHandler) +void mono_wasm_install_js_worker_interop_wrapper (cb_handle context_gc_handle, void* beforeSyncJSImport, void* afterSyncJSImport, void* pumpHandler) { before_sync_js_import = beforeSyncJSImport; after_sync_js_import = afterSyncJSImport; @@ -260,7 +266,7 @@ void mono_wasm_install_js_worker_interop_wrapper (int context_gc_handle, void* b } // async -void mono_wasm_release_cs_owned_object_post (pthread_t target_tid, int js_handle) +void mono_wasm_release_cs_owned_object_post (pthread_t target_tid, cb_handle js_handle) { mono_threads_wasm_async_run_in_target_thread_vi (target_tid, (void (*) (gpointer))mono_wasm_release_cs_owned_object, (gpointer)js_handle); } @@ -272,7 +278,7 @@ void mono_wasm_resolve_or_reject_promise_post (pthread_t target_tid, void* args) } // async -void mono_wasm_cancel_promise_post (pthread_t target_tid, int task_holder_gc_handle) +void mono_wasm_cancel_promise_post (pthread_t target_tid, cb_handle task_holder_gc_handle) { mono_threads_wasm_async_run_in_target_thread_vi (target_tid, (void (*) (gpointer))mono_wasm_cancel_promise, (gpointer)task_holder_gc_handle); } @@ -290,7 +296,7 @@ void mono_wasm_invoke_jsimport_sync_send (pthread_t target_tid, void* signature, } // sync -void mono_wasm_invoke_js_function_send (pthread_t target_tid, int function_js_handle, void *args) +void mono_wasm_invoke_js_function_send (pthread_t target_tid, cb_handle function_js_handle, void *args) { mono_threads_wasm_sync_run_in_target_thread_vii (target_tid, (void (*) (gpointer, gpointer))mono_wasm_invoke_js_function, (gpointer)function_js_handle, (gpointer)args); } From 93c9c001bdb5ad9adf99ac8cc05dec677b43cbfb Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 11 Apr 2025 11:42:02 +0100 Subject: [PATCH 008/209] Conditional addition of MEMORY64 and wasm64 flags --- src/mono/browser/browser.proj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mono/browser/browser.proj b/src/mono/browser/browser.proj index 2373a42e5466f4..591f47cb58a59b 100644 --- a/src/mono/browser/browser.proj +++ b/src/mono/browser/browser.proj @@ -386,12 +386,13 @@ $(ArtifactsObjDir)wasm/pinvoke-table.h $(ArtifactsObjDir)wasm/wasm_m2n_invoke.g.h - -g -Os -DDEBUG=1 -DENABLE_AOT_PROFILER=1 -DENABLE_BROWSER_PROFILER=1 -DENABLE_LOG_PROFILER=1 -DMEMORY64 + -g -Os -DDEBUG=1 -DENABLE_AOT_PROFILER=1 -DENABLE_BROWSER_PROFILER=1 -DENABLE_LOG_PROFILER=1 -Oz + $(CMakeConfigurationLinkFlags) -DMEMORY64 --target=wasm64 $(CMakeConfigurationEmccFlags) -s ASSERTIONS=1 -O2 - + $(CMakeConfigurationLinkFlags) -s EXPORT_ES6=1 -lexports.js $(CMakeConfigurationLinkFlags) -msimd128 From 0571b8785cd42f5dbf5ad8337681bf6cbbb22c34 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 11 Apr 2025 12:06:51 +0100 Subject: [PATCH 009/209] int handle replacement --- src/mono/browser/runtime/driver.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/mono/browser/runtime/driver.c b/src/mono/browser/runtime/driver.c index bad04b732caa48..f2741b050772ca 100644 --- a/src/mono/browser/runtime/driver.c +++ b/src/mono/browser/runtime/driver.c @@ -74,7 +74,14 @@ wasm_trace_logger (const char *log_domain, const char *log_level, const char *me exit (1); } +#if SIZEOF_VOID_P == 4 typedef uint32_t target_mword; +typedef int32_t d_handle; +#else +typedef uint64_t target_mword; +typedef int64_t d_handle; +#endif + typedef target_mword SgenDescriptor; typedef SgenDescriptor MonoGCDescriptor; MONO_API int mono_gc_register_root (char *start, size_t size, MonoGCDescriptor descr, MonoGCRootSource source, void *key, const char *msg); @@ -367,10 +374,10 @@ mono_wasm_set_main_args (int argc, char* argv[]) mono_runtime_set_main_args (argc, argv); } -EMSCRIPTEN_KEEPALIVE int +EMSCRIPTEN_KEEPALIVE d_handle mono_wasm_strdup (const char *s) { - return (int)strdup (s); + return (d_handle)strdup (s); } EMSCRIPTEN_KEEPALIVE void @@ -599,4 +606,4 @@ mono_wasm_read_as_bool_or_null_unsafe (PVOLATILE(MonoObject) obj) { end: MONO_EXIT_GC_UNSAFE; return result; -} \ No newline at end of file +} From 6fa382cff5a28b7147cedf10ad0967147f21a5ba Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 14 Apr 2025 12:35:02 +0100 Subject: [PATCH 010/209] Convert mono-threads-wasm.S to wasm64 and hard code compile to wasm6 --- src/mono/mono/utils/CMakeLists.txt | 5 +++++ src/mono/mono/utils/mono-threads-wasm.S | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/mono/mono/utils/CMakeLists.txt b/src/mono/mono/utils/CMakeLists.txt index 8c124a1aaa952f..1d67663fe8706f 100644 --- a/src/mono/mono/utils/CMakeLists.txt +++ b/src/mono/mono/utils/CMakeLists.txt @@ -36,6 +36,11 @@ else() set(utils_platform_sources ${utils_unix_sources}) endif() +if(HOST_WASM) + set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -DMEMORY64 --target=wasm64") + message(STATUS "MRH_LOGGING_UTILS: Set CMAKE_ASM_FLAGS to: '${CMAKE_ASM_FLAGS}'") +endif() + set(utils_common_sources mono-sha1.c mono-logger.c diff --git a/src/mono/mono/utils/mono-threads-wasm.S b/src/mono/mono/utils/mono-threads-wasm.S index 8752b03f124b78..225e287d4c6083 100644 --- a/src/mono/mono/utils/mono-threads-wasm.S +++ b/src/mono/mono/utils/mono-threads-wasm.S @@ -1,6 +1,22 @@ .globl get_wasm_stack_low .globl get_wasm_stack_high +#ifdef __wasm64__ +get_wasm_stack_low: + .functype get_wasm_stack_low () -> (i64) + global.get __stack_low@GOT + // align up to 16 bytes + i64.const 0xF + i64.add + i64.const -0x10 + i64.and + end_function + +get_wasm_stack_high: + .functype get_wasm_stack_high () -> (i64) + global.get __stack_high@GOT + end_function +#else get_wasm_stack_low: .functype get_wasm_stack_low () -> (i32) global.get __stack_low@GOT @@ -15,3 +31,5 @@ get_wasm_stack_high: .functype get_wasm_stack_high () -> (i32) global.get __stack_high@GOT end_function +#endif + From bb1bd4c665aedb1d60b4851b615a3e02ed2be77e Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 14 Apr 2025 12:35:30 +0100 Subject: [PATCH 011/209] remove libicu --- src/mono/browser/runtime/CMakeLists.txt | 4 ++-- src/native/libs/build-native.proj | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mono/browser/runtime/CMakeLists.txt b/src/mono/browser/runtime/CMakeLists.txt index 95938c2e425100..43bf137937aa6f 100644 --- a/src/mono/browser/runtime/CMakeLists.txt +++ b/src/mono/browser/runtime/CMakeLists.txt @@ -15,8 +15,8 @@ set_target_properties(dotnet.native PROPERTIES COMPILE_FLAGS ${CONFIGURATION_EMC target_link_libraries(dotnet.native PRIVATE - ${ICU_LIB_DIR}/libicuuc.a - ${ICU_LIB_DIR}/libicui18n.a + #${ICU_LIB_DIR}/libicuuc.a + #${ICU_LIB_DIR}/libicui18n.a ${MONO_ARTIFACTS_DIR}/libmono-component-hot_reload-static.a ${MONO_ARTIFACTS_DIR}/libmono-component-debugger-static.a ${MONO_ARTIFACTS_DIR}/libmono-component-diagnostics_tracing-stub-static.a diff --git a/src/native/libs/build-native.proj b/src/native/libs/build-native.proj index 370354fda66b0d..b3ead3bbcd3d24 100644 --- a/src/native/libs/build-native.proj +++ b/src/native/libs/build-native.proj @@ -19,6 +19,9 @@ <_IcuDir Condition="'$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)' != ''">$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)/runtimes/$(TargetOS)-$(TargetArchitecture)$(_RuntimeVariant)/native <_IcuDirArg Condition="'$(_IcuDir)' != ''"> icudir "$(_IcuDir)" + + <_IcuDir Condition="'$(WasmEnableThreads)' == 'true'">"" + <_BuildNativeArgs>$(_BuildNativeArgs)$(_IcuDirArg)$(_UsePThreads) From 44edcf74e0af457c12544f3883790bafec91bcac Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 14 Apr 2025 12:36:12 +0100 Subject: [PATCH 012/209] remove libicu continued and compile timezone files with wasm64 (will need conditional) --- src/mono/browser/browser.proj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mono/browser/browser.proj b/src/mono/browser/browser.proj index 591f47cb58a59b..20eb1f343826f5 100644 --- a/src/mono/browser/browser.proj +++ b/src/mono/browser/browser.proj @@ -116,7 +116,7 @@ Overwrite="true" Lines="@(_WasmBundleTimezonesSources, ' ')" WriteOnlyWhenDifferent="true" /> - - + $(ArtifactsObjDir)wasm/pinvoke-table.h $(ArtifactsObjDir)wasm/wasm_m2n_invoke.g.h From dc4a2926b4b1695dd85bf5920f34be4a562099a9 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 14 Apr 2025 14:21:16 +0100 Subject: [PATCH 013/209] set wasm64 target for System.Native. will need to come back and tidy this (conditional, check which of these wasm64's can be removed) --- src/native/libs/CMakeLists.txt | 4 ++-- src/native/libs/System.Native/CMakeLists.txt | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index 48f6b67e3db40d..d18370b577d259 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -122,11 +122,11 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) if (MONO_WASM_MT) add_definitions(-DMONO_WASM_MT) endif() - if (MEMORY64) - + if (MEMORY64) message(STATUS "MRH_LOGGING: setting MEMORY64 in CMakeLists.txt") add_definitions(-DMEMORY64) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMEMORY64") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --target=wasm64") add_compile_options(-DMEMORY64=1) endif() diff --git a/src/native/libs/System.Native/CMakeLists.txt b/src/native/libs/System.Native/CMakeLists.txt index 7712f255602028..f7fde288243659 100644 --- a/src/native/libs/System.Native/CMakeLists.txt +++ b/src/native/libs/System.Native/CMakeLists.txt @@ -130,6 +130,11 @@ if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TA set(NATIVE_SOURCES ${NATIVE_SOURCES} entrypoints.c) endif() +if (CMAKE_USE_MEMORY64) + message("MRH_LOGGING: Building native libs with MEMORY64 enabled") + add_compile_options(--target=wasm64) +endif() + add_library(System.Native-Static STATIC ${NATIVE_SOURCES} From 0d1f3f5ea13b28e2acc9b8a9bef398e2a6f86e6b Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 15 Apr 2025 10:13:08 +0100 Subject: [PATCH 014/209] add wasm64 target to more files --- src/native/external/zlib-ng/CMakeLists.txt | 16 ++++++++++++++++ .../System.Globalization.Native/CMakeLists.txt | 5 +++++ .../System.IO.Compression.Native/CMakeLists.txt | 5 +++++ 3 files changed, 26 insertions(+) diff --git a/src/native/external/zlib-ng/CMakeLists.txt b/src/native/external/zlib-ng/CMakeLists.txt index 86e54f858bf6e1..c1a9817e640d68 100644 --- a/src/native/external/zlib-ng/CMakeLists.txt +++ b/src/native/external/zlib-ng/CMakeLists.txt @@ -1185,6 +1185,22 @@ foreach(ZLIB_INSTALL_LIBRARY ${ZLIB_INSTALL_LIBRARIES}) "$") endforeach() +function(dump_cmake_variables) + get_cmake_property(_variableNames VARIABLES) + list (SORT _variableNames) + foreach (_variableName ${_variableNames}) + message(STATUS "${_variableName}=${${_variableName}}") + endforeach() +endfunction() + +if (EMSCRIPTEN AND "${CMAKE_C_FLAGS}" MATCHES "MEMORY64") + message("MRH_LOGGING: Building native ZLIB-NG with MEMORY64") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --target=wasm64") +else() + message("MRH_LOGGING: ZLIB-NG unable to set wasm64") + dump_cmake_variables() +endif() + if(WIN32) # Shared library if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 496bdb0d33e5cd..383cb8b05f33fc 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -97,6 +97,11 @@ if (CMAKE_USE_PTHREADS) add_linker_flag(-pthread) endif() +if (CMAKE_USE_MEMORY64) + message("MRH_LOGGING: Building native libs with MEMORY64 enabled") + add_compile_options(--target=wasm64) +endif() + if (LOCAL_BUILD) set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(NATIVEGLOBALIZATION_SOURCES ${NATIVEGLOBALIZATION_SOURCES} pal_icushim_static.c) diff --git a/src/native/libs/System.IO.Compression.Native/CMakeLists.txt b/src/native/libs/System.IO.Compression.Native/CMakeLists.txt index 51320228df5ea5..84803de75bcfb1 100644 --- a/src/native/libs/System.IO.Compression.Native/CMakeLists.txt +++ b/src/native/libs/System.IO.Compression.Native/CMakeLists.txt @@ -43,6 +43,11 @@ if (NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_WASI) ) endif () +if (CLR_CMAKE_TARGET_BROWSER AND CMAKE_USE_MEMORY64) + message("MRH_LOGGING: Building native compression libs with MEMORY64 enabled and Browser targeted") + add_compile_options(--target=wasm64) +endif() + if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) set(NATIVE_LIBS_EXTRA) append_extra_compression_libs(NATIVE_LIBS_EXTRA) From 5ad12ae379e17f90e3b922ccc1381c6bc61f093c Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 15 Apr 2025 14:46:36 +0100 Subject: [PATCH 015/209] remove setting of AOT_TARGET_TRIPLE - not appropriate for this target --- src/mono/mono.proj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 517a98c4b1783a..0acae0de05ffc7 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -584,8 +584,7 @@ JS_ENGINES = [NODE_JS] <_MonoCMakeArgs Include="-DENABLE_ICALL_EXPORT=1"/> <_MonoCMakeArgs Include="-DENABLE_LAZY_GC_THREAD_CREATION=1"/> <_MonoCMakeArgs Include="-DENABLE_WEBCIL=1"/> - <_MonoCMakeArgs Include="-DDISABLE_JITERPRETER=1"/> - <_MonoCMakeArgs Include="-DAOT_TARGET_TRIPLE=$(MonoAotAbi)"/> + <_MonoCMakeArgs Include="-DDISABLE_JITERPRETER=1"/> <_MonoCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread"/> <_MonoCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-D_GNU_SOURCE=1" /> <_MonoCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64" /> From 4d46486844df48874dfd3acb6f6757e0b39883c4 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 15 Apr 2025 16:19:26 +0100 Subject: [PATCH 016/209] add stubs for jiterpreter functions --- src/mono/mono/mini/interp/jiterpreter_stubs.c | 540 ++++++++++++++++++ 1 file changed, 540 insertions(+) create mode 100644 src/mono/mono/mini/interp/jiterpreter_stubs.c diff --git a/src/mono/mono/mini/interp/jiterpreter_stubs.c b/src/mono/mono/mini/interp/jiterpreter_stubs.c new file mode 100644 index 00000000000000..fbe20606298289 --- /dev/null +++ b/src/mono/mono/mini/interp/jiterpreter_stubs.c @@ -0,0 +1,540 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// This file contains icalls used in jitted interpreter traces and wrappers, +// along with infrastructure to support code generration + +#ifndef __USE_ISOC99 +#define __USE_ISOC99 +#endif +#include "config.h" + +void jiterp_preserve_module (void); + +// NOTE: All code in this file needs to be guarded with HOST_BROWSER, since +// we don't run non-wasm tests for changes to this file! + +#if HOST_BROWSER + +#if 0 +#define jiterp_assert(b) g_assert(b) +#else +#define jiterp_assert(b) +#endif + +#include +#include +#include + +#include +#include +#include + +#ifndef DISABLE_THREADS +#include +#endif + +#include +#include +#include +#include + +#include "interp.h" +#include "interp-internals.h" +#include "mintops.h" +#include "transform.h" +#include "interp-intrins.h" +#include "tiering.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "jiterpreter.h" + +// We disable this diagnostic because EMSCRIPTEN_KEEPALIVE makes it a false alarm, the keepalive +// functions are being used externally. Having a bunch of prototypes is pointless since these +// functions are not consumed by C anywhere else +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_encode_leb64_ref (unsigned char * destination, void * source, int valueIsSigned) { + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_encode_leb52 (unsigned char * destination, double doubleValue, int valueIsSigned) { + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_encode_leb_signed_boundary (unsigned char * destination, int bits, int sign) { + return 0; +} + +// Many of the following functions implement various opcodes or provide support for opcodes +// so that jiterpreter traces don't have to inline dozens of wasm instructions worth of +// complex logic - these are designed to match interp.c + +// If a trace is jitted for a method that hasn't been tiered yet, we need to +// update the interpreter entry count for the method. +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_increase_entry_count (void *_imethod) { + return 0; +} + +EMSCRIPTEN_KEEPALIVE void* +mono_jiterp_object_unbox (MonoObject *obj) { + return (void*)0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_type_is_byref (MonoType *type) { + return 0; +} + +EMSCRIPTEN_KEEPALIVE void +mono_jiterp_value_copy (void *dest, void *src, MonoClass *klass) { +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_try_newobj_inlined (MonoObject **destination, MonoVTable *vtable) { + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_try_newstr (MonoString **destination, int length) { + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_try_newarr (MonoArray **destination, MonoVTable *vtable, int length) { + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_gettype_ref ( + MonoObject **destination, MonoObject **source +) { + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_has_parent_fast ( + MonoClass *klass, MonoClass *parent +) { + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_implements_interface ( + MonoVTable *vtable, MonoClass *klass +) { + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_is_special_interface (MonoClass *klass) +{ + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_implements_special_interface ( + MonoObject *obj, MonoVTable *vtable, MonoClass *klass +) { + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_cast_v2 ( + MonoObject **destination, MonoObject *obj, + MonoClass *klass, MintOpcode opcode +) { + return 0; +} + +EMSCRIPTEN_KEEPALIVE void +mono_jiterp_localloc (gpointer *destination, gint32 len, InterpFrame *frame) +{ + return 0; +} + +EMSCRIPTEN_KEEPALIVE void +mono_jiterp_ldtsflda (gpointer *destination, guint32 offset) { +} + +EMSCRIPTEN_KEEPALIVE void +mono_jiterp_box_ref (MonoVTable *vtable, MonoObject **dest, void *src, gboolean vt) { +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_conv (void *dest, void *src, int opcode) { + return 0; +} + +// keep in sync with jiterpreter-opcodes.ts +enum { + JITERP_CNE_UN_R4 = (0xFFFF + 0), + JITERP_CGE_UN_R4, + JITERP_CLE_UN_R4, + JITERP_CNE_UN_R8, + JITERP_CGE_UN_R8, + JITERP_CLE_UN_R8, +}; + +#define JITERP_RELOP(opcode, type, op, noorder) \ + case opcode: \ + { \ + if (is_unordered) \ + return noorder; \ + else \ + return ((type)lhs op (type)rhs); \ + } + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_relop_fp (double lhs, double rhs, int opcode) { + return 0; +} + +#undef JITERP_RELOP + +EMSCRIPTEN_KEEPALIVE size_t +mono_jiterp_get_size_of_stackval () { + return 0; +} + +// jiterpreter-interp-entry.ts uses this information to decide whether to call +// stackval_from_data for a given type or just do a raw value copy of N bytes +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_type_get_raw_value_size (MonoType *type) { + return 0; +} + +// we use these helpers to record when a trace bails out (in countBailouts mode) +EMSCRIPTEN_KEEPALIVE void +mono_jiterp_trace_bailout (int reason) +{ +} + +EMSCRIPTEN_KEEPALIVE double +mono_jiterp_get_trace_bailout_count (int reason) +{ + return 0; +} + +// we use this to record how many times a trace has aborted due to a given opcode. +// this is done in C because the heuristic updates it along with typescript updating it +EMSCRIPTEN_KEEPALIVE gint32 +mono_jiterp_adjust_abort_count (MintOpcode opcode, gint32 delta) { + return 0; +} + +// at the start of a jitted interp_entry wrapper, this is called to perform initial setup +// like resolving the target for delegates and setting up the thread context +// inlining this into the wrappers would make them unnecessarily big and complex +EMSCRIPTEN_KEEPALIVE stackval * +mono_jiterp_interp_entry_prologue (JiterpEntryData *data, void *this_arg) +{ + return (void*)0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_get_opcode_value_table_entry (int opcode) { + return 0; +} + +void +jiterp_insert_entry_points (void *_imethod, void *_td) +{ + +} + +EMSCRIPTEN_KEEPALIVE double +mono_jiterp_get_trace_hit_count (gint32 trace_index) { + return 0; +} + +MONO_NEVER_INLINE JiterpreterThunk +mono_interp_tier_prepare_jiterpreter_fast ( + void *_frame, const guint16 *ip +) { + return (JiterpreterThunk)(void*)0; +} + +void +mono_jiterp_free_method_data (MonoMethod *method, InterpMethod *imethod) +{ +} + +EMSCRIPTEN_KEEPALIVE gboolean +mono_jiterp_parse_option (const char *option) +{ + return FALSE; +} + +EMSCRIPTEN_KEEPALIVE gint32 +mono_jiterp_get_options_version () +{ + return 0; +} + +EMSCRIPTEN_KEEPALIVE char * +mono_jiterp_get_options_as_json () +{ + return (char*)0; +} + +EMSCRIPTEN_KEEPALIVE gint32 +mono_jiterp_get_option_as_int (const char *name) +{ + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_object_has_component_size (MonoObject **ppObj) +{ + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_get_hashcode (MonoObject ** ppObj) +{ + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_try_get_hashcode (MonoObject ** ppObj) +{ + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_get_signature_has_this (MonoMethodSignature *sig) +{ + return 0; +} + +EMSCRIPTEN_KEEPALIVE MonoType * +mono_jiterp_get_signature_return_type (MonoMethodSignature *sig) +{ + return sig->ret; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_get_signature_param_count (MonoMethodSignature *sig) +{ + return 0; +} + +EMSCRIPTEN_KEEPALIVE MonoType ** +mono_jiterp_get_signature_params (MonoMethodSignature *sig) +{ + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_type_to_ldind (MonoType *type) +{ + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_type_to_stind (MonoType *type) +{ + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_get_array_rank (gint32 *dest, MonoObject **src) +{ + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_get_array_element_size (gint32 *dest, MonoObject **src) +{ + return 0; +} + +// Returns 1 on success so that the trace can do br_if to bypass its bailout +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_set_object_field ( + uint8_t *locals, guint32 fieldOffsetBytes, + guint32 targetLocalOffsetBytes, guint32 sourceLocalOffsetBytes +) { + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_debug_count () +{ + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_stelem_ref ( + MonoArray *o, gint32 aindex, MonoObject *ref +) { + return 0; +} + + +// keep in sync with jiterpreter-enums.ts JiterpMember +enum { + JITERP_MEMBER_VT_INITIALIZED = 0, + JITERP_MEMBER_ARRAY_DATA, + JITERP_MEMBER_STRING_LENGTH, + JITERP_MEMBER_STRING_DATA, + JITERP_MEMBER_IMETHOD, + JITERP_MEMBER_DATA_ITEMS, + JITERP_MEMBER_RMETHOD, + JITERP_MEMBER_SPAN_LENGTH, + JITERP_MEMBER_SPAN_DATA, + JITERP_MEMBER_ARRAY_LENGTH, + // Kept as-is but no longer implemented + JITERP_MEMBER_BACKWARD_BRANCH_OFFSETS, + // Ditto + JITERP_MEMBER_BACKWARD_BRANCH_OFFSETS_COUNT, + JITERP_MEMBER_CLAUSE_DATA_OFFSETS, + JITERP_MEMBER_PARAMS_COUNT, + JITERP_MEMBER_VTABLE, + JITERP_MEMBER_VTABLE_KLASS, + JITERP_MEMBER_CLASS_RANK, + JITERP_MEMBER_CLASS_ELEMENT_CLASS, + JITERP_MEMBER_BOXED_VALUE_DATA, + JITERP_MEMBER_BACKWARD_BRANCH_TAKEN, + JITERP_MEMBER_BAILOUT_OPCODE_COUNT, +}; + + +// we use these helpers at JIT time to figure out where to do memory loads and stores +EMSCRIPTEN_KEEPALIVE size_t +mono_jiterp_get_member_offset (int member) { + return 0; +} + +// keep in sync with jiterpreter-enums.ts JiterpCounter +enum { + JITERP_COUNTER_TRACE_CANDIDATES = 0, + JITERP_COUNTER_TRACES_COMPILED, + JITERP_COUNTER_ENTRY_WRAPPERS_COMPILED, + JITERP_COUNTER_JIT_CALLS_COMPILED, + JITERP_COUNTER_DIRECT_JIT_CALLS_COMPILED, + JITERP_COUNTER_FAILURES, + JITERP_COUNTER_BYTES_GENERATED, + JITERP_COUNTER_NULL_CHECKS_ELIMINATED, + JITERP_COUNTER_NULL_CHECKS_FUSED, + JITERP_COUNTER_BACK_BRANCHES_EMITTED, + JITERP_COUNTER_BACK_BRANCHES_NOT_EMITTED, + JITERP_COUNTER_ELAPSED_GENERATION, + JITERP_COUNTER_ELAPSED_COMPILATION, + JITERP_COUNTER_SWITCH_TARGETS_OK, + JITERP_COUNTER_SWITCH_TARGETS_FAILED, + JITERP_COUNTER_MAX = JITERP_COUNTER_SWITCH_TARGETS_FAILED +}; + +#define JITERP_COUNTER_UNIT 100 + +static long counters[JITERP_COUNTER_MAX + 1] = {0}; + +static long * +mono_jiterp_get_counter_address (int counter) { + return 0; +} + +EMSCRIPTEN_KEEPALIVE double +mono_jiterp_get_counter (int counter) { + return 0; +} + +EMSCRIPTEN_KEEPALIVE double +mono_jiterp_modify_counter (int counter, double delta) { + return 0; +} + + +EMSCRIPTEN_KEEPALIVE void +mono_jiterp_write_number_unaligned (void *dest, double value, int mode) { +} + +MONO_NEVER_INLINE ptrdiff_t +mono_jiterp_monitor_trace (const guint16 *ip, void *_frame, void *locals) +{ + return 0; +} + +EMSCRIPTEN_KEEPALIVE gint32 +mono_jiterp_get_rejected_trace_count () +{ + return 0; +} + +EMSCRIPTEN_KEEPALIVE void +mono_jiterp_boost_back_branch_target (const JiterpreterOpcode *ip) { +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_is_imethod_var_address_taken (InterpMethod *imethod, int offset) { + return 0; +} + +EMSCRIPTEN_KEEPALIVE void +mono_jiterp_initialize_table (int type, int first_index, int last_index) { +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_allocate_table_entry (int type) { + return 0; +} + +int +mono_jiterp_increment_counter (volatile int *counter) { + return 0; +} + +gboolean +mono_jiterp_patch_opcode (volatile JiterpreterOpcode *ip, guint16 old_opcode, guint16 new_opcode) { + return FALSE; +} + + +// Purges this item from all queues +void +mono_jiterp_tlqueue_purge_all (gpointer item) { +} + +EMSCRIPTEN_KEEPALIVE gpointer +mono_jiterp_tlqueue_next (int queue) { + return (gpointer)0; +} + +// Adds a new item to the end of the queue and returns the new size of the queue +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_tlqueue_add (int queue, gpointer item) { + return 0; +} + +EMSCRIPTEN_KEEPALIVE void +mono_jiterp_tlqueue_clear (int queue) { +} + +EMSCRIPTEN_KEEPALIVE +#else +int +mono_jiterp_is_enabled (void); +#endif // HOST_BROWSER + +int +mono_jiterp_is_enabled (void) { + return 0; +} + +void +jiterp_preserve_module (void) { +} From 55bb3d7e753e33ce13c234faacd84c714fd1a3a4 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 15 Apr 2025 16:20:13 +0100 Subject: [PATCH 017/209] jiterpreter stub in CMakeLists.txt - not being picked up atm --- src/mono/mono/mini/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index 3d4acd1fedf9ee..391f1059d4e106 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -252,6 +252,8 @@ set(interp_stub_sources interp-stubs.c) set(jiterp_sources interp/jiterpreter.c) +set(jiterp_stub_sources + interp/jiterpreter_stubs.c) if(NOT DISABLE_INTERPRETER) if(HOST_WASM) @@ -261,7 +263,10 @@ if(NOT DISABLE_INTERPRETER) endif() if(NOT DISABLE_JITERPRETER) list(APPEND mini_interp_sources ${jiterp_sources}) + else() + list(APPEND mini_interp_sources ${jiterp_stub_sources}) endif() + else() set(mini_interp_sources ${interp_stub_sources}) endif() From f1183f65ff124f1a9dd0a28632d5261110579291 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 15 Apr 2025 16:20:34 +0100 Subject: [PATCH 018/209] logging only --- src/mono/mono/utils/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mono/mono/utils/CMakeLists.txt b/src/mono/mono/utils/CMakeLists.txt index 1d67663fe8706f..745d2cd6188d03 100644 --- a/src/mono/mono/utils/CMakeLists.txt +++ b/src/mono/mono/utils/CMakeLists.txt @@ -193,6 +193,9 @@ else() #message(FATAL_ERROR "") endif() +message(STATUS "MRH_LOGGING_UTILS: TARGET_WASM is: '${TARGET_WASM}'") +message(STATUS "MRH_LOGGING_UTILS: MONO_CROSS_COMPILE is: '${MONO_CROSS_COMPILE}'") + if(MONO_CROSS_COMPILE) set(utils_arch_sources "${utils_arch_sources};mono-hwcap-cross.c") elseif(TARGET_AMD64 OR TARGET_X86) @@ -207,6 +210,7 @@ elseif(TARGET_S390X) set(utils_arch_sources "${utils_arch_sources};mono-hwcap-s390x.c") elseif(TARGET_WASM) set(utils_arch_sources "${utils_arch_sources};mono-hwcap-wasm.c;mono-mmap-wasm.c") +message(STATUS "MRH_LOGGING_UTILS: added mono-mmap-wasm.c, utils_arch_sources is '${utils_arch_sources}''") elseif(TARGET_WASI) set(utils_arch_sources "${utils_arch_sources};mono-hwcap-wasm.c") elseif(TARGET_POWERPC OR TARGET_POWERPC64) From ef98c18c99c0b4ec40e14013cb783372837c3db7 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 15 Apr 2025 17:29:41 +0100 Subject: [PATCH 019/209] Make DISABLE_JITERPRETER independent of DISABLE_INTERPRETER, fix to jiterpreter stub function, set DISABLE_JITERPRETER for browser builds of BuildMonoCross --- src/mono/mono.proj | 17 +++++++++-------- src/mono/mono/mini/CMakeLists.txt | 19 ++++++++++++------- src/mono/mono/mini/interp/jiterpreter_stubs.c | 3 +-- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 0acae0de05ffc7..a7dc7ec4c1b6d7 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -878,7 +878,7 @@ JS_ENGINES = [NODE_JS] - + <_MonoAOTCFLAGS Condition="'$(AotHostArchitecture)' == 'arm64'" Include="-arch arm64" /> <_MonoAOTCXXFLAGS Condition="'$(AotHostArchitecture)' == 'arm64'" Include="-arch arm64" /> @@ -894,13 +894,14 @@ JS_ENGINES = [NODE_JS] - <_MonoAOTCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread -D_GNU_SOURCE=1" /> - <_MonoAOTCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="--target=wasm64 -DMEMORY64" /> - <_MonoAOTCPPFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread -D_GNU_SOURCE=1"/> - <_MonoAOTCPPFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64 --target=wasm64" /> - <_MonoAOTCXXFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread -D_GNU_SOURCE=1"/> - <_MonoAOTCXXFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64 --target=wasm64" /> - + + <_MonoAOTCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread -D_GNU_SOURCE=1" /> + <_MonoAOTCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="--target=wasm64 -DMEMORY64" /> + <_MonoAOTCPPFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread -D_GNU_SOURCE=1"/> + <_MonoAOTCPPFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64 --target=wasm64" /> + <_MonoAOTCXXFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread -D_GNU_SOURCE=1"/> + <_MonoAOTCXXFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64 --target=wasm64" /> + diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index 391f1059d4e106..93bab622667a70 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -255,22 +255,27 @@ set(jiterp_sources set(jiterp_stub_sources interp/jiterpreter_stubs.c) +message("MRH_LOGGING_MINI: DISABLE_INTERPRETER '${DISABLE_INTERPRETER}'") +message("MRH_LOGGING_MINI: DISABLE_JITERPRETER '${DISABLE_JITERPRETER}'") + if(NOT DISABLE_INTERPRETER) if(HOST_WASM) set(mini_interp_sources ${interp_sources}) else() set(mini_interp_sources ${interp_sources} ${interp_simd_sources}) - endif() - if(NOT DISABLE_JITERPRETER) - list(APPEND mini_interp_sources ${jiterp_sources}) - else() - list(APPEND mini_interp_sources ${jiterp_stub_sources}) - endif() - + endif() else() set(mini_interp_sources ${interp_stub_sources}) endif() +if(NOT DISABLE_JITERPRETER) + list(APPEND mini_interp_sources ${jiterp_sources}) +else() + message("MRH_LOGGING: adding jiterp stub sources '${jiterp_stub_sources}'") + list(APPEND mini_interp_sources ${jiterp_stub_sources}) +endif() + + if(ENABLE_INTERP_LIB) add_library(mono-ee-interp STATIC "${interp_sources}") target_link_libraries(mono-ee-interp PRIVATE monoapi eglib_api) diff --git a/src/mono/mono/mini/interp/jiterpreter_stubs.c b/src/mono/mono/mini/interp/jiterpreter_stubs.c index fbe20606298289..2ed766753aa4b1 100644 --- a/src/mono/mono/mini/interp/jiterpreter_stubs.c +++ b/src/mono/mono/mini/interp/jiterpreter_stubs.c @@ -161,8 +161,7 @@ mono_jiterp_cast_v2 ( EMSCRIPTEN_KEEPALIVE void mono_jiterp_localloc (gpointer *destination, gint32 len, InterpFrame *frame) -{ - return 0; +{ } EMSCRIPTEN_KEEPALIVE void From 4c1f71fed28af6dfc85805bf133d9e21bcb978b9 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 16 Apr 2025 09:27:49 +0100 Subject: [PATCH 020/209] Add missing function pointer --- src/mono/mono/mini/interp/jiterpreter_stubs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mono/mono/mini/interp/jiterpreter_stubs.c b/src/mono/mono/mini/interp/jiterpreter_stubs.c index 2ed766753aa4b1..9958c9ed831522 100644 --- a/src/mono/mono/mini/interp/jiterpreter_stubs.c +++ b/src/mono/mono/mini/interp/jiterpreter_stubs.c @@ -62,6 +62,8 @@ void jiterp_preserve_module (void); // functions are not consumed by C anywhere else #pragma clang diagnostic ignored "-Wmissing-prototypes" +int mono_jiterp_first_trace_fn_ptr = 0; + EMSCRIPTEN_KEEPALIVE int mono_jiterp_encode_leb64_ref (unsigned char * destination, void * source, int valueIsSigned) { return 0; From 3583d31f4089bc66a294fcda7580833b12a1656f Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 16 Apr 2025 14:25:08 +0100 Subject: [PATCH 021/209] Try removing System.Globalization.Native (doesn't work - committing so I've got a record of the change, will revert) --- src/mono/browser/runtime/CMakeLists.txt | 2 +- src/native/libs/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mono/browser/runtime/CMakeLists.txt b/src/mono/browser/runtime/CMakeLists.txt index 43bf137937aa6f..123c5600df0b8f 100644 --- a/src/mono/browser/runtime/CMakeLists.txt +++ b/src/mono/browser/runtime/CMakeLists.txt @@ -31,7 +31,7 @@ target_link_libraries(dotnet.native ${MONO_ARTIFACTS_DIR}/libmono-profiler-log.a ${NATIVE_BIN_DIR}/wasm-bundled-timezones.a ${NATIVE_BIN_DIR}/libSystem.Native.a - ${NATIVE_BIN_DIR}/libSystem.Globalization.Native.a + #${NATIVE_BIN_DIR}/libSystem.Globalization.Native.a ${NATIVE_BIN_DIR}/libSystem.IO.Compression.Native.a ${NATIVE_BIN_DIR}/libz.a) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index d18370b577d259..ebc77bf32ec5d5 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -107,7 +107,7 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) endif () else () set(CMAKE_SHARED_LIBRARY_PREFIX "") - add_subdirectory(System.Globalization.Native) + #add_subdirectory(System.Globalization.Native) endif () add_subdirectory(System.IO.Compression.Native) @@ -153,7 +153,7 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) endif () add_subdirectory(System.Native) - add_subdirectory(System.Globalization.Native) + #add_subdirectory(System.Globalization.Native) if (CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) # skip for now From abe0091121282fac75ca7794cc3a50e631d190fb Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 16 Apr 2025 14:25:21 +0100 Subject: [PATCH 022/209] Revert "Try removing System.Globalization.Native (doesn't work - committing so I've got a record of the change, will revert)" This reverts commit 3583d31f4089bc66a294fcda7580833b12a1656f. --- src/mono/browser/runtime/CMakeLists.txt | 2 +- src/native/libs/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mono/browser/runtime/CMakeLists.txt b/src/mono/browser/runtime/CMakeLists.txt index 123c5600df0b8f..43bf137937aa6f 100644 --- a/src/mono/browser/runtime/CMakeLists.txt +++ b/src/mono/browser/runtime/CMakeLists.txt @@ -31,7 +31,7 @@ target_link_libraries(dotnet.native ${MONO_ARTIFACTS_DIR}/libmono-profiler-log.a ${NATIVE_BIN_DIR}/wasm-bundled-timezones.a ${NATIVE_BIN_DIR}/libSystem.Native.a - #${NATIVE_BIN_DIR}/libSystem.Globalization.Native.a + ${NATIVE_BIN_DIR}/libSystem.Globalization.Native.a ${NATIVE_BIN_DIR}/libSystem.IO.Compression.Native.a ${NATIVE_BIN_DIR}/libz.a) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index ebc77bf32ec5d5..d18370b577d259 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -107,7 +107,7 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) endif () else () set(CMAKE_SHARED_LIBRARY_PREFIX "") - #add_subdirectory(System.Globalization.Native) + add_subdirectory(System.Globalization.Native) endif () add_subdirectory(System.IO.Compression.Native) @@ -153,7 +153,7 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) endif () add_subdirectory(System.Native) - #add_subdirectory(System.Globalization.Native) + add_subdirectory(System.Globalization.Native) if (CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) # skip for now From aabe547cc3d392e6c3dbd0dfc5163864bbbe96f1 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 16 Apr 2025 17:21:41 +0100 Subject: [PATCH 023/209] Add stubs for icu methods, hard code use of them for memory64 --- .../CMakeLists.txt | 3 +- .../pal_icushim_stubs.c | 148 ++++++++++++++++++ 2 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 src/native/libs/System.Globalization.Native/pal_icushim_stubs.c diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 383cb8b05f33fc..51446ac4699a03 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -99,7 +99,8 @@ endif() if (CMAKE_USE_MEMORY64) message("MRH_LOGGING: Building native libs with MEMORY64 enabled") - add_compile_options(--target=wasm64) + add_compile_options(--target=wasm64) + set(NATIVEGLOBALIZATION_SOURCES ${NATIVEGLOBALIZATION_SOURCES} pal_icushim_stubs.c) endif() if (LOCAL_BUILD) diff --git a/src/native/libs/System.Globalization.Native/pal_icushim_stubs.c b/src/native/libs/System.Globalization.Native/pal_icushim_stubs.c new file mode 100644 index 00000000000000..972acbfecb6e33 --- /dev/null +++ b/src/native/libs/System.Globalization.Native/pal_icushim_stubs.c @@ -0,0 +1,148 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// + +#include "pal_icushim_internal.h" + +typedef struct UCollator UCollator; +typedef struct UCollationElements UCollationElements; +typedef struct UEnumeration UEnumeration; +typedef struct UIDNA UIDNA; +typedef struct UNormalizer2 UNormalizer2; +typedef struct ULocaleDisplayNames ULocaleDisplayNames; +typedef struct UResourceBundle UResourceBundle; +typedef struct UStringSearch UStringSearch; +typedef struct UBreakIterator UBreakIterator; + +typedef int8_t UBool; +typedef uint16_t UChar; +typedef int32_t UChar32; +typedef double UDate; +typedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH]; + +typedef void* UNumberFormat; +typedef void* UDateFormat; +typedef void* UDateTimePatternGenerator; +typedef void* UCalendar; + + +#define CREATE_STUB_VOID(fn_decl) fn_decl {} + +#define CREATE_STUB_WITH_RETURN(type, fn_decl) fn_decl { return (type)0; } + +CREATE_STUB_WITH_RETURN(UCollator *, UCollator * ucol_safeClone(const UCollator* coll, void* stackBuffer, int32_t* pBufferSize, UErrorCode* status)) +CREATE_STUB_WITH_RETURN(const char *, const char * u_errorName(UErrorCode status)) + +CREATE_STUB_VOID(void udata_setCommonData(const void * v, UErrorCode * err)) + +CREATE_STUB_VOID(void u_charsToUChars(const char * cs, UChar * us, int32_t length)) +CREATE_STUB_VOID(void u_getVersion(UVersionInfo versionArray)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t u_strlen(const UChar * s)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t u_strcmp(const UChar * s1, const UChar * s2)) +CREATE_STUB_WITH_RETURN(UChar *, UChar * u_strcpy(UChar * dst, const UChar * src)) +CREATE_STUB_WITH_RETURN(UChar *, UChar * u_strncpy(UChar * dst, const UChar * src, int32_t n)) +CREATE_STUB_WITH_RETURN(UChar32, UChar32 u_tolower(UChar32 c)) +CREATE_STUB_WITH_RETURN(UChar32, UChar32 u_toupper(UChar32 c)) + +CREATE_STUB_WITH_RETURN(UChar*, UChar* u_uastrncpy(UChar * dst, const char * src, int32_t n)) +CREATE_STUB_VOID(void ubrk_close(UBreakIterator * bi)) +CREATE_STUB_WITH_RETURN(UBreakIterator*, UBreakIterator* ubrk_openRules(const UChar * rules, int32_t rulesLength, const UChar * text, int32_t textLength, UParseError * parseErr, UErrorCode * status)) +CREATE_STUB_VOID(void ucal_add(UCalendar * cal, UCalendarDateFields field, int32_t amount, UErrorCode * status)) +CREATE_STUB_VOID(void ucal_close(UCalendar * cal)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t ucal_get(const UCalendar * cal, UCalendarDateFields field, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t ucal_getAttribute(const UCalendar * cal, UCalendarAttribute attr)) +CREATE_STUB_WITH_RETURN(UEnumeration *, UEnumeration * ucal_getKeywordValuesForLocale(const char * key, const char * locale, UBool commonlyUsed, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t ucal_getLimit(const UCalendar * cal, UCalendarDateFields field, UCalendarLimitType type, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(UDate, UDate ucal_getNow(void)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t ucal_getTimeZoneDisplayName(const UCalendar * cal, UCalendarDisplayNameType type, const char * locale, UChar * result, int32_t resultLength, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t ucal_getTimeZoneIDForWindowsID(const UChar * winid, int32_t len, const char * region, UChar * id, int32_t idCapacity, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t ucal_getWindowsTimeZoneID(const UChar * id, int32_t len, UChar * winid, int32_t winidCapacity, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(UCalendar *, UCalendar * ucal_open(const UChar * zoneID, int32_t len, const char * locale, UCalendarType type, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(UEnumeration *, UEnumeration * ucal_openTimeZoneIDEnumeration(USystemTimeZoneType zoneType, const char * region, const int32_t * rawOffset, UErrorCode * ec)) +CREATE_STUB_VOID(void ucal_set(UCalendar * cal, UCalendarDateFields field, int32_t value)) +CREATE_STUB_VOID(void ucal_setMillis(UCalendar * cal, UDate dateTime, UErrorCode * status)) +CREATE_STUB_VOID(void ucol_close(UCollator * coll)) +CREATE_STUB_VOID(void ucol_closeElements(UCollationElements * elems)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t ucol_getOffset(const UCollationElements *elems)) +CREATE_STUB_WITH_RETURN(const UChar *, const UChar * ucol_getRules(const UCollator * coll, int32_t * length)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t ucol_getSortKey(const UCollator * coll, const UChar * source, int32_t sourceLength, uint8_t * result, int32_t resultLength)) +CREATE_STUB_WITH_RETURN(UCollationStrength, UCollationStrength ucol_getStrength(const UCollator * coll)) +CREATE_STUB_VOID(void ucol_getVersion(const UCollator * coll, UVersionInfo info)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t ucol_next(UCollationElements * elems, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t ucol_previous(UCollationElements * elems, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(UCollator *, UCollator * ucol_open(const char * loc, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(UCollationElements *, UCollationElements * ucol_openElements(const UCollator * coll, const UChar * text, int32_t textLength, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(UCollator *, UCollator * ucol_openRules(const UChar * rules, int32_t rulesLength, UColAttributeValue normalizationMode, UCollationStrength strength, UParseError * parseError, UErrorCode * status)) +//CREATE_STUB_WITH_RETURN(UCollator *, UCollator * ucol_clone(const UCollator * coll, UErrorCode * status)) +CREATE_STUB_VOID(void ucol_setAttribute(UCollator * coll, UColAttribute attr, UColAttributeValue value, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(UCollationResult, UCollationResult ucol_strcoll(const UCollator * coll, const UChar * source, int32_t sourceLength, const UChar * target, int32_t targetLength)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t ucurr_forLocale(const char * locale, UChar * buff, int32_t buffCapacity, UErrorCode * ec)) +CREATE_STUB_WITH_RETURN(const UChar *, const UChar * ucurr_getName(const UChar * currency, const char * locale, UCurrNameStyle nameStyle, UBool * isChoiceFormat, int32_t * len, UErrorCode * ec)) +CREATE_STUB_VOID(void udat_close(UDateFormat * format)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t udat_countSymbols(const UDateFormat * fmt, UDateFormatSymbolType type)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t udat_format(const UDateFormat * format, UDate dateToFormat, UChar * result, int32_t resultLength, UFieldPosition * position, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t udat_getSymbols(const UDateFormat * fmt, UDateFormatSymbolType type, int32_t symbolIndex, UChar * result, int32_t resultLength, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(UDateFormat *, UDateFormat * udat_open(UDateFormatStyle timeStyle, UDateFormatStyle dateStyle, const char * locale, const UChar * tzID, int32_t tzIDLength, const UChar * pattern, int32_t patternLength, UErrorCode * status)) +CREATE_STUB_VOID(void udat_setCalendar(UDateFormat * fmt, const UCalendar * calendarToSet)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t udat_toPattern(const UDateFormat * fmt, UBool localized, UChar * result, int32_t resultLength, UErrorCode * status)) +CREATE_STUB_VOID(void udatpg_close(UDateTimePatternGenerator * dtpg)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t udatpg_getBestPattern(UDateTimePatternGenerator * dtpg, const UChar * skeleton, int32_t length, UChar * bestPattern, int32_t capacity, UErrorCode * pErrorCode)) +CREATE_STUB_WITH_RETURN(UDateTimePatternGenerator *, UDateTimePatternGenerator * udatpg_open(const char * locale, UErrorCode * pErrorCode)) +CREATE_STUB_VOID(void uenum_close(UEnumeration * en)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t uenum_count(UEnumeration * en, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(const char *, const char * uenum_next(UEnumeration * en, int32_t * resultLength, UErrorCode * status)) +CREATE_STUB_VOID(void uidna_close(UIDNA * idna)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t uidna_nameToASCII(const UIDNA * idna, const UChar * name, int32_t length, UChar * dest, int32_t capacity, UIDNAInfo * pInfo, UErrorCode * pErrorCode)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t uidna_nameToUnicode(const UIDNA * idna, const UChar * name, int32_t length, UChar * dest, int32_t capacity, UIDNAInfo * pInfo, UErrorCode * pErrorCode)) +CREATE_STUB_WITH_RETURN(UIDNA *, UIDNA * uidna_openUTS46(uint32_t options, UErrorCode * pErrorCode)) +CREATE_STUB_VOID(void uldn_close(ULocaleDisplayNames * ldn)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t uldn_keyValueDisplayName(const ULocaleDisplayNames * ldn, const char * key, const char * value, UChar * result, int32_t maxResultSize, UErrorCode * pErrorCode)) +CREATE_STUB_WITH_RETURN(ULocaleDisplayNames *, ULocaleDisplayNames * uldn_open(const char * locale, UDialectHandling dialectHandling, UErrorCode * pErrorCode)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t uloc_canonicalize(const char * localeID, char * name, int32_t nameCapacity, UErrorCode * err)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t uloc_countAvailable(void)) +CREATE_STUB_WITH_RETURN(const char *, const char * uloc_getAvailable(int32_t n)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t uloc_getBaseName(const char * localeID, char * name, int32_t nameCapacity, UErrorCode * err)) +CREATE_STUB_WITH_RETURN(ULayoutType, ULayoutType uloc_getCharacterOrientation(const char * localeId, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t uloc_getCountry(const char * localeID, char * country, int32_t countryCapacity, UErrorCode * err)) +CREATE_STUB_WITH_RETURN(const char *, const char * uloc_getDefault(void)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t uloc_getDisplayCountry(const char * locale, const char * displayLocale, UChar * country, int32_t countryCapacity, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t uloc_getDisplayLanguage(const char * locale, const char * displayLocale, UChar * language, int32_t languageCapacity, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t uloc_getDisplayName(const char * localeID, const char * inLocaleID, UChar * result, int32_t maxResultSize, UErrorCode * err)) +CREATE_STUB_WITH_RETURN(const char *, const char * uloc_getISO3Country(const char * localeID)) +CREATE_STUB_WITH_RETURN(const char *, const char * uloc_getISO3Language(const char * localeID)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t uloc_getKeywordValue(const char * localeID, const char * keywordName, char * buffer, int32_t bufferCapacity, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t uloc_getLanguage(const char * localeID, char * language, int32_t languageCapacity, UErrorCode * err)) +CREATE_STUB_WITH_RETURN(uint32_t, uint32_t uloc_getLCID(const char * localeID)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t uloc_getName(const char * localeID, char * name, int32_t nameCapacity, UErrorCode * err)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t uloc_getParent(const char * localeID, char * parent, int32_t parentCapacity, UErrorCode * err)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t uloc_setKeywordValue(const char * keywordName, const char * keywordValue, char * buffer, int32_t bufferCapacity, UErrorCode * status)) +CREATE_STUB_VOID(void ulocdata_getCLDRVersion(UVersionInfo versionArray, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(UMeasurementSystem, UMeasurementSystem ulocdata_getMeasurementSystem(const char * localeID, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(const UNormalizer2 *, const UNormalizer2 * unorm2_getNFCInstance(UErrorCode * pErrorCode)) +CREATE_STUB_WITH_RETURN(const UNormalizer2 *, const UNormalizer2 * unorm2_getNFDInstance(UErrorCode * pErrorCode)) +CREATE_STUB_WITH_RETURN(const UNormalizer2 *, const UNormalizer2 * unorm2_getNFKCInstance(UErrorCode * pErrorCode)) +CREATE_STUB_WITH_RETURN(const UNormalizer2 *, const UNormalizer2 * unorm2_getNFKDInstance(UErrorCode * pErrorCode)) +CREATE_STUB_WITH_RETURN(UBool, UBool unorm2_isNormalized(const UNormalizer2 * norm2, const UChar * s, int32_t length, UErrorCode * pErrorCode)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t unorm2_normalize(const UNormalizer2 * norm2, const UChar * src, int32_t length, UChar * dest, int32_t capacity, UErrorCode * pErrorCode)) +CREATE_STUB_VOID(void unum_close(UNumberFormat * fmt)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t unum_getAttribute(const UNumberFormat * fmt, UNumberFormatAttribute attr)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t unum_getSymbol(const UNumberFormat * fmt, UNumberFormatSymbol symbol, UChar * buffer, int32_t size, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(UNumberFormat *, UNumberFormat * unum_open(UNumberFormatStyle style, const UChar * pattern, int32_t patternLength, const char * locale, UParseError * parseErr, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t unum_toPattern(const UNumberFormat * fmt, UBool isPatternLocalized, UChar * result, int32_t resultLength, UErrorCode * status)) +CREATE_STUB_VOID(void ures_close(UResourceBundle * resourceBundle)) +CREATE_STUB_WITH_RETURN(UResourceBundle *, UResourceBundle * ures_getByKey(const UResourceBundle * resourceBundle, const char * key, UResourceBundle * fillIn, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t ures_getSize(const UResourceBundle * resourceBundle)) +CREATE_STUB_WITH_RETURN(const UChar *, const UChar * ures_getStringByIndex(const UResourceBundle * resourceBundle, int32_t indexS, int32_t * len, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(UResourceBundle *, UResourceBundle * ures_open(const char * packageName, const char * locale, UErrorCode * status)) +CREATE_STUB_VOID(void usearch_close(UStringSearch * searchiter)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t usearch_first(UStringSearch * strsrch, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(const UBreakIterator*, const UBreakIterator* usearch_getBreakIterator(const UStringSearch * strsrch)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t usearch_getMatchedLength(const UStringSearch * strsrch)) +CREATE_STUB_WITH_RETURN(int32_t, int32_t usearch_last(UStringSearch * strsrch, UErrorCode * status)) +CREATE_STUB_WITH_RETURN(UStringSearch *, UStringSearch * usearch_openFromCollator(const UChar * pattern, int32_t patternlength, const UChar * text, int32_t textlength, const UCollator * collator, UBreakIterator * breakiter, UErrorCode * status)) +CREATE_STUB_VOID(void usearch_setPattern(UStringSearch * strsrch, const UChar * pattern, int32_t patternlength, UErrorCode * status)) +CREATE_STUB_VOID(void usearch_setText(UStringSearch * strsrch, const UChar * text, int32_t textlength, UErrorCode * status)) +CREATE_STUB_VOID(void ucol_setMaxVariable(UCollator * coll, UColReorderCode group, UErrorCode * pErrorCode)) + +#undef CREATE_STUB_CREATE_STUB_VOID +#undef CREATE_STUB_WITH_RETURN From dbdb11050eb84c9bdd9ecc753eda79949d1704ad Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 17 Apr 2025 12:56:04 +0100 Subject: [PATCH 024/209] Add wasm64 target when building brotli compression --- src/native/external/brotli/CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/native/external/brotli/CMakeLists.txt b/src/native/external/brotli/CMakeLists.txt index 61378cdae31aa2..43cc7b5c1e1b97 100644 --- a/src/native/external/brotli/CMakeLists.txt +++ b/src/native/external/brotli/CMakeLists.txt @@ -27,11 +27,19 @@ check_c_source_compiles( BROTLI_EMSCRIPTEN ) if (BROTLI_EMSCRIPTEN) - message("-- Compiler is EMSCRIPTEN") + message("-- Brotli Compiler is EMSCRIPTEN") else() - message("-- Compiler is not EMSCRIPTEN") + message("-- Brotli Compiler is not EMSCRIPTEN") endif() +if (BROTLI_EMSCRIPTEN AND "${CMAKE_C_FLAGS}" MATCHES "MEMORY64") + message("MRH_LOGGING BROTLI: Building native BROTLI with MEMORY64") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --target=wasm64") +else() + message("MRH_LOGGING: BROTLI unable to set wasm64") +endif() + + # If Brotli is being bundled in another project, we don't want to # install anything. However, we want to let people override this, so # we'll use the BROTLI_BUNDLED_MODE variable to let them do that; just From d032b31aaf88b633662acec8fcc07249fbbad3c6 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 25 Apr 2025 18:11:01 +0100 Subject: [PATCH 025/209] Declare _scriptDir --- src/mono/browser/runtime/es6/dotnet.es6.extpost.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/browser/runtime/es6/dotnet.es6.extpost.js b/src/mono/browser/runtime/es6/dotnet.es6.extpost.js index 510b2bef4efd4f..6a8d6b53db932a 100644 --- a/src/mono/browser/runtime/es6/dotnet.es6.extpost.js +++ b/src/mono/browser/runtime/es6/dotnet.es6.extpost.js @@ -1,2 +1,2 @@ -var fetch = fetch || undefined; var require = require || undefined; var __dirname = __dirname || ''; var _nativeModuleLoaded = false; +var _scriptDir = _scriptDir || ''; var fetch = fetch || undefined; var require = require || undefined; var __dirname = __dirname || ''; var _nativeModuleLoaded = false; From 109758183d2ba7508291d25e64209cde3678aa81 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 30 Apr 2025 12:35:53 +0100 Subject: [PATCH 026/209] Revert "Declare _scriptDir" This reverts commit d032b31aaf88b633662acec8fcc07249fbbad3c6. --- src/mono/browser/runtime/es6/dotnet.es6.extpost.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/browser/runtime/es6/dotnet.es6.extpost.js b/src/mono/browser/runtime/es6/dotnet.es6.extpost.js index 6a8d6b53db932a..510b2bef4efd4f 100644 --- a/src/mono/browser/runtime/es6/dotnet.es6.extpost.js +++ b/src/mono/browser/runtime/es6/dotnet.es6.extpost.js @@ -1,2 +1,2 @@ -var _scriptDir = _scriptDir || ''; var fetch = fetch || undefined; var require = require || undefined; var __dirname = __dirname || ''; var _nativeModuleLoaded = false; +var fetch = fetch || undefined; var require = require || undefined; var __dirname = __dirname || ''; var _nativeModuleLoaded = false; From e361003877cb06053f3387c5864cfcd1bf6cfe69 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 2 May 2025 11:06:12 +0100 Subject: [PATCH 027/209] ensure wasm64 is used if uses_mem64 is set --- src/mono/CMakeLists.txt | 23 +++++++++++++++++++---- src/native/libs/CMakeLists.txt | 1 + 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index 1265054cd8343d..518e4c93c358ef 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -419,8 +419,24 @@ endif() # TARGET ARCH CHECKS ###################################### +function(DUMP_CMAKE_VARIABLES) + message("MRH_LOGGING: DUMP_CMAKE_VARIABLES:") + get_cmake_property(_variableNames VARIABLES) + list (SORT _variableNames) + foreach (_variableName ${_variableNames}) + message(STATUS "${_variableName}=${${_variableName}}") + endforeach() +endfunction() + if(NOT TARGET_ARCH) - set(TARGET_ARCH "${CMAKE_SYSTEM_PROCESSOR}") + if (CMAKE_SYSTEM_PROCESSOR STREQUAL "wasm" AND USES_MEM64) + set(TARGET_ARCH "wasm64") + message("MRH_LOGGING: SET TARGET_ARCH to wasm64") + else() + set(TARGET_ARCH "${CMAKE_SYSTEM_PROCESSOR}") + message("MRH_LOGGING: SET TARGET_ARCH to CMAKE_SYSTEM_PROCESSOR:=${TARGET_ARCH}") + DUMP_CMAKE_VARIABLES() + endif() endif() # Unify naming @@ -485,7 +501,7 @@ elseif(TARGET_ARCH STREQUAL "s390x") set(TARGET_SIZEOF_VOID_P 8) set(SIZEOF_REGISTER 8) elseif(TARGET_ARCH STREQUAL "wasm" OR TARGET_ARCH STREQUAL "wasm32") - message ("MRH_LOGGING: setting wasm32!") + message ("MRH_LOGGING: setting wasm32! - target arch is '${TARGET_ARCH}'") set(TARGET_WASM 1) set(MONO_ARCHITECTURE "\"wasm\"") set(TARGET_SIZEOF_VOID_P 4) @@ -494,8 +510,7 @@ elseif(TARGET_ARCH STREQUAL "wasm64" ) message ("MRH_LOGGING: setting wasm64!") set(TARGET_WASM 1) set(MONO_ARCHITECTURE "\"wasm\"") - set(TARGET_SIZEOF_VOID_P 8) - #set(SIZEOF_VOID_P 8) + set(TARGET_SIZEOF_VOID_P 8) set(SIZEOF_REGISTER 8) elseif(TARGET_ARCH STREQUAL "ppc64le") set(TARGET_POWERPC 1) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index d18370b577d259..ad275a854d83cf 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -127,6 +127,7 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) add_definitions(-DMEMORY64) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMEMORY64") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --target=wasm64") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-experimental") add_compile_options(-DMEMORY64=1) endif() From 2d8a5e7affd41bc08b0f3f2c7e81cfdc63d69926 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 6 May 2025 13:10:44 +0100 Subject: [PATCH 028/209] turn off experimental warnings (for wasm64 + emscripten 3.1.56) --- eng/native/configurecompiler.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index e8ad8615f6d4bd..93d8925634a7b7 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -153,6 +153,7 @@ elseif (CLR_CMAKE_HOST_UNIX) add_compile_options(-Wno-unused-parameter) add_compile_options(-Wno-alloca) add_compile_options(-Wno-implicit-int-float-conversion) + add_compile_options(-Wno-experimental) endif() endif(MSVC) From 26f0bb89822171488d2ac0d66e172b2433bf333e Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 6 May 2025 13:11:19 +0100 Subject: [PATCH 029/209] set USES_MEM64 --- src/mono/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index 518e4c93c358ef..a0c9048f8b9c45 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -427,6 +427,15 @@ function(DUMP_CMAKE_VARIABLES) message(STATUS "${_variableName}=${${_variableName}}") endforeach() endfunction() +if (CMAKE_C_FLAGS MATCHES "wasm64") + set(USES_MEM64 TRUE) + message("MRH_LOGGING: SET USES_MEM64 due to wasm64") +endif() + +if (CMAKE_C_FLAGS MATCHES "MEMORY64") + set(USES_MEM64 TRUE) + message("MRH_LOGGING: SET USES_MEM64 due to MEMORY64") +endif() if(NOT TARGET_ARCH) if (CMAKE_SYSTEM_PROCESSOR STREQUAL "wasm" AND USES_MEM64) From 75029f2c3fb72a8bd91a895cddbdcf2df34e2e8a Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 6 May 2025 13:12:19 +0100 Subject: [PATCH 030/209] Require WasmEnableMemory64 to set wasm64-unknown-none --- src/mono/mono.proj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index a7dc7ec4c1b6d7..8db6dc43757a41 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -573,7 +573,7 @@ JS_ENGINES = [NODE_JS] <_MonoMinimal Condition="'$(WasmEnableThreads)' != 'true'">$(_MonoMinimal),threads - wasm64-unknown-none + wasm64-unknown-none @@ -905,7 +905,7 @@ JS_ENGINES = [NODE_JS] - + From e81160f907ae5204e9a1e12a094f2381703fa821 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 6 May 2025 13:13:03 +0100 Subject: [PATCH 031/209] make memory64 flag setting conditional --- src/native/external/zlib-ng.cmake | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/native/external/zlib-ng.cmake b/src/native/external/zlib-ng.cmake index 23d47d549a7fd6..e76590a0c41b7a 100644 --- a/src/native/external/zlib-ng.cmake +++ b/src/native/external/zlib-ng.cmake @@ -2,6 +2,15 @@ include(FetchContent) +function(DUMP_CMAKE_VARIABLES) + message("MRH_LOGGING: DUMP_CMAKE_VARIABLES ZLIB-NG.CMAKE:") + get_cmake_property(_variableNames VARIABLES) + list (SORT _variableNames) + foreach (_variableName ${_variableNames}) + message(STATUS "${_variableName}=${${_variableName}}") + endforeach() +endfunction() + FetchContent_Declare( fetchzlibng SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/zlib-ng") @@ -29,12 +38,15 @@ if (CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) add_compile_options(-pthread) add_linker_flag(-pthread) endif() - + + if (CMAKE_USE_MEMORY64 OR USES_MEM64) message(STATUS "MRH_LOGGING: setting MEMORY64 in zlib-ng.make") add_definitions(-DMEMORY64) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMEMORY64") add_compile_options(-DMEMORY64=1) - + else() + DUMP_CMAKE_VARIABLES() + endif() endif() set(BUILD_SHARED_LIBS OFF) # Shared libraries aren't supported in wasm From 30ea2fc06938549db6ac8b65426417c693f9c1aa Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 6 May 2025 13:13:35 +0100 Subject: [PATCH 032/209] Addresses Emscripten build warnings and flags Adds a compiler flag to suppress errors during Emscripten builds and ensures proper handling of MEMORY64. Suppresses experimental warnings. --- src/native/external/zlib-ng/CMakeLists.txt | 2 +- src/native/libs/build-native.cmd | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/native/external/zlib-ng/CMakeLists.txt b/src/native/external/zlib-ng/CMakeLists.txt index c1a9817e640d68..0366b0d8b8596f 100644 --- a/src/native/external/zlib-ng/CMakeLists.txt +++ b/src/native/external/zlib-ng/CMakeLists.txt @@ -1195,7 +1195,7 @@ endfunction() if (EMSCRIPTEN AND "${CMAKE_C_FLAGS}" MATCHES "MEMORY64") message("MRH_LOGGING: Building native ZLIB-NG with MEMORY64") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --target=wasm64") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --target=wasm64 -Wno-error") else() message("MRH_LOGGING: ZLIB-NG unable to set wasm64") dump_cmake_variables() diff --git a/src/native/libs/build-native.cmd b/src/native/libs/build-native.cmd index b9b772ce1e9f3c..37a413cfcac015 100644 --- a/src/native/libs/build-native.cmd +++ b/src/native/libs/build-native.cmd @@ -85,6 +85,7 @@ if %__useMemory64% == 1 ( set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_USE_MEMORY64=1" echo "MRH_LOGGING_CMD: set -DCMAKE_USE_MEMORY64, params now: !__ExtraCmakeParams!"" ) +:: set __ExtraCmakeParams=%__ExtraCmakeParams% "-Wno-experimental" if [%__outConfig%] == [] set __outConfig=%__TargetOS%-%__BuildArch%-%CMAKE_BUILD_TYPE% From d7ef8edcf90788ad5d3b00cda2201c208f06ab0e Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 6 May 2025 15:17:50 +0100 Subject: [PATCH 033/209] Make --target=wasm64 conditional --- src/mono/browser/browser.proj | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mono/browser/browser.proj b/src/mono/browser/browser.proj index 20eb1f343826f5..0108ba8f899b9f 100644 --- a/src/mono/browser/browser.proj +++ b/src/mono/browser/browser.proj @@ -116,7 +116,13 @@ Overwrite="true" Lines="@(_WasmBundleTimezonesSources, ' ')" WriteOnlyWhenDifferent="true" /> - +   --target=wasm64 + + + Date: Wed, 7 May 2025 12:00:54 +0100 Subject: [PATCH 034/209] make SIZEOF_VOID_P available in driver.c --- src/mono/browser/runtime/CMakeLists.txt | 3 +++ src/mono/browser/runtime/driver.c | 15 +++++++++++++-- src/mono/browser/runtime/wasm-config.h.in | 2 ++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/mono/browser/runtime/CMakeLists.txt b/src/mono/browser/runtime/CMakeLists.txt index 43bf137937aa6f..c0a82970c2cadd 100644 --- a/src/mono/browser/runtime/CMakeLists.txt +++ b/src/mono/browser/runtime/CMakeLists.txt @@ -1,6 +1,7 @@ cmake_minimum_required(VERSION 3.20) project(mono-wasm-runtime C) +include (CheckTypeSize) option(DISABLE_THREADS "defined if the build does NOT support multithreading" ON) option(ENABLE_JS_INTEROP_BY_VALUE "defined when JS interop without pointers to managed objects" OFF) @@ -50,4 +51,6 @@ if(CMAKE_BUILD_TYPE STREQUAL "Release") COMMENT "Stripping debug symbols from dotnet.native.wasm using wasm-opt") endif() + +check_type_size("void*" SIZEOF_VOID_P) configure_file(wasm-config.h.in include/wasm/wasm-config.h) diff --git a/src/mono/browser/runtime/driver.c b/src/mono/browser/runtime/driver.c index f2741b050772ca..21fb48eef03afe 100644 --- a/src/mono/browser/runtime/driver.c +++ b/src/mono/browser/runtime/driver.c @@ -74,17 +74,28 @@ wasm_trace_logger (const char *log_domain, const char *log_level, const char *me exit (1); } +#ifndef SIZEOF_VOID_P +#pragma message ("MRH_LOGGING_DRIVER: SIZEOF_VOID_P is undefined in driver.c") +#define SIZEOF_VOID_P @SIZEOF_VOID_P@ +#endif + #if SIZEOF_VOID_P == 4 +#pragma message ("MRH_LOGGING_DRIVER: SIZEOF_VOID_P is 4 in driver.c.") typedef uint32_t target_mword; typedef int32_t d_handle; -#else +#elif SIZEOF_VOID_P == 8 +#pragma message ("MRH_LOGGING_DRIVER: SIZEOF_VOID_P is 8 in driver.c") typedef uint64_t target_mword; typedef int64_t d_handle; +#else +#pragma message ("MRH_LOGGING_DRIVER: SIZEOF_VOID_P is still undefined in driver.c") +typedef uint32_t target_mword; +typedef int32_t d_handle; #endif typedef target_mword SgenDescriptor; typedef SgenDescriptor MonoGCDescriptor; -MONO_API int mono_gc_register_root (char *start, size_t size, MonoGCDescriptor descr, MonoGCRootSource source, void *key, const char *msg); +MONO_API int mono_gc_register_root (char *start, size_t size, MonoGCDescriptor descr, MonoGCRootSource source, void *key, const char *msg); void mono_gc_deregister_root (char* addr); EMSCRIPTEN_KEEPALIVE int diff --git a/src/mono/browser/runtime/wasm-config.h.in b/src/mono/browser/runtime/wasm-config.h.in index d8a2d8127c2ec3..75ec0d053351aa 100644 --- a/src/mono/browser/runtime/wasm-config.h.in +++ b/src/mono/browser/runtime/wasm-config.h.in @@ -10,4 +10,6 @@ /* Support for JS interop without pointers to managed objects */ #cmakedefine ENABLE_JS_INTEROP_BY_VALUE +#define SIZEOF_VOID_P @SIZEOF_VOID_P@ + #endif/*__MONO_WASM_CONFIG_H__*/ From b43ba2d56b12d2d8c2fea87966d58e5bc3860b00 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 7 May 2025 12:02:17 +0100 Subject: [PATCH 035/209] use stubs file regardless of MEMORY64 (BAD - FIXME) --- src/native/libs/System.Globalization.Native/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 51446ac4699a03..293ddb87a5e8ff 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -100,8 +100,10 @@ endif() if (CMAKE_USE_MEMORY64) message("MRH_LOGGING: Building native libs with MEMORY64 enabled") add_compile_options(--target=wasm64) - set(NATIVEGLOBALIZATION_SOURCES ${NATIVEGLOBALIZATION_SOURCES} pal_icushim_stubs.c) + #set(NATIVEGLOBALIZATION_SOURCES ${NATIVEGLOBALIZATION_SOURCES} pal_icushim_stubs.c) endif() +#TODO: this should be conditional on invariant globalization +set(NATIVEGLOBALIZATION_SOURCES ${NATIVEGLOBALIZATION_SOURCES} pal_icushim_stubs.c) if (LOCAL_BUILD) set(CMAKE_POSITION_INDEPENDENT_CODE ON) From 613330590312b26ebca55d2a95e4e86cda386e35 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 7 May 2025 12:02:53 +0100 Subject: [PATCH 036/209] only use MEMORY64 is USES_MEM64 AND host is wasm --- src/mono/mono/utils/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/utils/CMakeLists.txt b/src/mono/mono/utils/CMakeLists.txt index 745d2cd6188d03..b01078d4c33a30 100644 --- a/src/mono/mono/utils/CMakeLists.txt +++ b/src/mono/mono/utils/CMakeLists.txt @@ -36,7 +36,7 @@ else() set(utils_platform_sources ${utils_unix_sources}) endif() -if(HOST_WASM) +if(HOST_WASM AND USES_MEM64) set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -DMEMORY64 --target=wasm64") message(STATUS "MRH_LOGGING_UTILS: Set CMAKE_ASM_FLAGS to: '${CMAKE_ASM_FLAGS}'") endif() From bc24b97df3e647b66e0361868f4c4b500d7418ef Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 8 May 2025 22:57:45 +0100 Subject: [PATCH 037/209] Rename _scriptDir to _scriptName as used by emscripten 4.0.5 --- src/mono/browser/runtime/es6/dotnet.es6.lib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/browser/runtime/es6/dotnet.es6.lib.js b/src/mono/browser/runtime/es6/dotnet.es6.lib.js index 0fadbb29d84e99..78a61cda8318d7 100644 --- a/src/mono/browser/runtime/es6/dotnet.es6.lib.js +++ b/src/mono/browser/runtime/es6/dotnet.es6.lib.js @@ -38,7 +38,7 @@ function setup(emscriptenBuildOptions) { noExitRuntime = dotnet_replacements.noExitRuntime; fetch = dotnet_replacements.fetch; require = dotnet_replacements.require; - _scriptDir = __dirname = scriptDirectory = dotnet_replacements.scriptDirectory; + _scriptName = __dirname = scriptDirectory = dotnet_replacements.scriptDirectory; Module.__dotnet_runtime.passEmscriptenInternals({ isPThread: ENVIRONMENT_IS_PTHREAD, quit_, ExitStatus, From d8efce9832e74ddab9c86a15c7a27c44646ca299 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 8 May 2025 22:58:58 +0100 Subject: [PATCH 038/209] Assign readyPromise to Module Emscripten no longer assigns this to the module, instead defining readyPromise as a separate object. --- src/mono/browser/runtime/es6/dotnet.es6.pre.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mono/browser/runtime/es6/dotnet.es6.pre.js b/src/mono/browser/runtime/es6/dotnet.es6.pre.js index 1c134a6ba33ef9..a00b6dc52ac36b 100644 --- a/src/mono/browser/runtime/es6/dotnet.es6.pre.js +++ b/src/mono/browser/runtime/es6/dotnet.es6.pre.js @@ -1,3 +1,4 @@ if (_nativeModuleLoaded) throw new Error("Native module already loaded"); _nativeModuleLoaded = true; createDotnetRuntime = Module = moduleArg(Module); +Module.ready = readyPromise; From e35bd9ea4843dd895acc975cf2477c3f506cbb2e Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 9 May 2025 16:52:57 +0100 Subject: [PATCH 039/209] Set WASM_ASYNC_COMPILATION=0 --- src/mono/browser/browser.proj | 4 ++-- src/mono/browser/build/BrowserWasmApp.targets | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mono/browser/browser.proj b/src/mono/browser/browser.proj index 0108ba8f899b9f..f6548cb79c4a05 100644 --- a/src/mono/browser/browser.proj +++ b/src/mono/browser/browser.proj @@ -122,7 +122,7 @@   --target=wasm64 - $(ArtifactsObjDir)wasm/pinvoke-table.h $(ArtifactsObjDir)wasm/wasm_m2n_invoke.g.h - -g -Os -DDEBUG=1 -DENABLE_AOT_PROFILER=1 -DENABLE_BROWSER_PROFILER=1 -DENABLE_LOG_PROFILER=1 + -sWASM_ASYNC_COMPILATION=0 -g -Os -DDEBUG=1 -DENABLE_AOT_PROFILER=1 -DENABLE_BROWSER_PROFILER=1 -DENABLE_LOG_PROFILER=1 -Oz $(CMakeConfigurationLinkFlags) -DMEMORY64 --target=wasm64 diff --git a/src/mono/browser/build/BrowserWasmApp.targets b/src/mono/browser/build/BrowserWasmApp.targets index 6e1516bfa620e6..5dd1945d72aa7b 100644 --- a/src/mono/browser/build/BrowserWasmApp.targets +++ b/src/mono/browser/build/BrowserWasmApp.targets @@ -336,7 +336,7 @@ <_EmccCFlags Include="-DENABLE_BROWSER_PROFILER=1" Condition="$(WasmProfilers.Contains('browser'))" /> <_EmccCFlags Include="-DENABLE_LOG_PROFILER=1" Condition="$(WasmProfilers.Contains('log'))" /> <_EmccCFlags Include="-DENABLE_JS_INTEROP_BY_VALUE=1" Condition="'$(WasmEnableJsInteropByValue)' == 'true'" /> - + <_EmccCFlags Include="-sWASM_ASYNC_COMPILATION=0" /> <_EmccCFlags Include="-DGEN_PINVOKE=1" /> <_EmccCFlags Include="-emit-llvm" /> From 7163f64a9b788f7a7b1038534c354ff28272bdc2 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 8 May 2025 22:57:45 +0100 Subject: [PATCH 040/209] Rename _scriptDir to _scriptName as used by emscripten 4.0.5 --- src/mono/browser/runtime/es6/dotnet.es6.lib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/browser/runtime/es6/dotnet.es6.lib.js b/src/mono/browser/runtime/es6/dotnet.es6.lib.js index 0fadbb29d84e99..78a61cda8318d7 100644 --- a/src/mono/browser/runtime/es6/dotnet.es6.lib.js +++ b/src/mono/browser/runtime/es6/dotnet.es6.lib.js @@ -38,7 +38,7 @@ function setup(emscriptenBuildOptions) { noExitRuntime = dotnet_replacements.noExitRuntime; fetch = dotnet_replacements.fetch; require = dotnet_replacements.require; - _scriptDir = __dirname = scriptDirectory = dotnet_replacements.scriptDirectory; + _scriptName = __dirname = scriptDirectory = dotnet_replacements.scriptDirectory; Module.__dotnet_runtime.passEmscriptenInternals({ isPThread: ENVIRONMENT_IS_PTHREAD, quit_, ExitStatus, From 564c1dcc152a1791f75f126a7add5167ccc63f30 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 8 May 2025 22:58:58 +0100 Subject: [PATCH 041/209] Assign readyPromise to Module Emscripten no longer assigns this to the module, instead defining readyPromise as a separate object. --- src/mono/browser/runtime/es6/dotnet.es6.pre.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mono/browser/runtime/es6/dotnet.es6.pre.js b/src/mono/browser/runtime/es6/dotnet.es6.pre.js index 1c134a6ba33ef9..a00b6dc52ac36b 100644 --- a/src/mono/browser/runtime/es6/dotnet.es6.pre.js +++ b/src/mono/browser/runtime/es6/dotnet.es6.pre.js @@ -1,3 +1,4 @@ if (_nativeModuleLoaded) throw new Error("Native module already loaded"); _nativeModuleLoaded = true; createDotnetRuntime = Module = moduleArg(Module); +Module.ready = readyPromise; From ebeebbb54ecafc24a435268e9ae674123d7abd21 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 14 May 2025 10:14:10 +0100 Subject: [PATCH 042/209] Allow user to set EmscriptenPythonToolsPath --- src/mono/browser/build/EmSdkRepo.Defaults.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/browser/build/EmSdkRepo.Defaults.props b/src/mono/browser/build/EmSdkRepo.Defaults.props index aa94ded228bfc7..70c4e2c2ad8293 100644 --- a/src/mono/browser/build/EmSdkRepo.Defaults.props +++ b/src/mono/browser/build/EmSdkRepo.Defaults.props @@ -15,7 +15,7 @@ - $([MSBuild]::NormalizeDirectory($(EmscriptenSdkToolsPath)python)) + $([MSBuild]::NormalizeDirectory($(EmscriptenSdkToolsPath)python)) <_EMSDKMissingPaths Condition="'$(_EMSDKMissingPaths)' == '' and ('$(EmscriptenPythonToolsPath)' == '' or !Exists('$(EmscriptenPythonToolsPath)'))">%24(EmscriptenPythonToolsPath)=$(EmscriptenPythonToolsPath) From f93638ce4558f70402539ded580ddb51f3bbb3f2 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 14 May 2025 14:51:32 +0100 Subject: [PATCH 043/209] Add a sample with WASM_ASYNC_COMPILATION disabled --- src/mono/sample/wasm/browser-async/Makefile | 11 ++++++++ src/mono/sample/wasm/browser-async/Program.cs | 21 ++++++++++++++ .../Wasm.Browser.Async.Sample.csproj | 10 +++++++ src/mono/sample/wasm/browser-async/index.html | 18 ++++++++++++ src/mono/sample/wasm/browser-async/main.js | 28 +++++++++++++++++++ 5 files changed, 88 insertions(+) create mode 100644 src/mono/sample/wasm/browser-async/Makefile create mode 100644 src/mono/sample/wasm/browser-async/Program.cs create mode 100644 src/mono/sample/wasm/browser-async/Wasm.Browser.Async.Sample.csproj create mode 100644 src/mono/sample/wasm/browser-async/index.html create mode 100644 src/mono/sample/wasm/browser-async/main.js diff --git a/src/mono/sample/wasm/browser-async/Makefile b/src/mono/sample/wasm/browser-async/Makefile new file mode 100644 index 00000000000000..7ae388cce865d3 --- /dev/null +++ b/src/mono/sample/wasm/browser-async/Makefile @@ -0,0 +1,11 @@ +TOP=../../../../.. + +include ../wasm.mk + +ifneq ($(AOT),) +override MSBUILD_ARGS+=/p:RunAOTCompilation=true +endif + +PROJECT_NAME=Wasm.Browser.Sample.csproj + +run: run-browser diff --git a/src/mono/sample/wasm/browser-async/Program.cs b/src/mono/sample/wasm/browser-async/Program.cs new file mode 100644 index 00000000000000..ce542da6201921 --- /dev/null +++ b/src/mono/sample/wasm/browser-async/Program.cs @@ -0,0 +1,21 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices.JavaScript; +using System.Runtime.InteropServices; + +namespace Sample +{ + public partial class Test + { + public static int Main(string[] args) + { + DisplayMeaning(42); + return 0; + } + + [JSImport("Sample.Test.displayMeaning", "main.js")] + internal static partial void DisplayMeaning(int meaning); + } +} diff --git a/src/mono/sample/wasm/browser-async/Wasm.Browser.Async.Sample.csproj b/src/mono/sample/wasm/browser-async/Wasm.Browser.Async.Sample.csproj new file mode 100644 index 00000000000000..8f887304869822 --- /dev/null +++ b/src/mono/sample/wasm/browser-async/Wasm.Browser.Async.Sample.csproj @@ -0,0 +1,10 @@ + + + + $(EmccFlags) -sWASM_ASYNC_COMPILATION=0 + + + + + + diff --git a/src/mono/sample/wasm/browser-async/index.html b/src/mono/sample/wasm/browser-async/index.html new file mode 100644 index 00000000000000..b4c21ec1b92e2e --- /dev/null +++ b/src/mono/sample/wasm/browser-async/index.html @@ -0,0 +1,18 @@ + + + + + + + Wasm Browser Sample + + + + + + + + Answer to the Ultimate Question of Life, the Universe, and Everything is : + + + \ No newline at end of file diff --git a/src/mono/sample/wasm/browser-async/main.js b/src/mono/sample/wasm/browser-async/main.js new file mode 100644 index 00000000000000..20fd268d65b9ac --- /dev/null +++ b/src/mono/sample/wasm/browser-async/main.js @@ -0,0 +1,28 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +import { dotnet, exit } from './_framework/dotnet.js' + +function displayMeaning(meaning) { + document.getElementById("out").innerHTML = `${meaning}`; +} + +try { + const { setModuleImports } = await dotnet + .withElementOnExit() + .withExitOnUnhandledError() + .create(); + + setModuleImports("main.js", { + Sample: { + Test: { + displayMeaning + } + } + }); + + await dotnet.run(); +} +catch (err) { + exit(2, err); +} \ No newline at end of file From a688f6499d0d74e0138f350fc797ae503ad96e52 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 15 May 2025 10:55:13 +0100 Subject: [PATCH 044/209] Turn on USE_CLOSURE_COMPILER by default Move from EmccExtraLDFlags in Wasm.Advanced.Sample. This results in createWasm not being awaited, and lambdas being generated for export access (e.g. _emscripten_stack_init) --- src/mono/sample/wasm/DefaultBrowserSample.targets | 1 + .../sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mono/sample/wasm/DefaultBrowserSample.targets b/src/mono/sample/wasm/DefaultBrowserSample.targets index af224ce9c48af3..2de9872370a3be 100644 --- a/src/mono/sample/wasm/DefaultBrowserSample.targets +++ b/src/mono/sample/wasm/DefaultBrowserSample.targets @@ -11,6 +11,7 @@ true $(TestArchiveRoot)chromeonly/ $(TestArchiveTestsRoot)$(OSPlatformConfig)/ + $(EmccFlags) -sUSE_CLOSURE_COMPILER=1 diff --git a/src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj b/src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj index 88824cf2b9ec81..7e002488602e96 100644 --- a/src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj +++ b/src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj @@ -9,7 +9,7 @@ true web,worker - -s USE_CLOSURE_COMPILER=1 -s LEGACY_GL_EMULATION=1 -lGL -lSDL -lidbfs.js + -s LEGACY_GL_EMULATION=1 -lGL -lSDL -lidbfs.js <_ServeHeaders>$(_ServeHeaders) -h "Content-Security-Policy: default-src 'self' 'wasm-unsafe-eval'" -h "Timing-Allow-Origin: *" -h "Cross-Origin-Opener-Policy: same-origin" -h "Cross-Origin-Embedder-Policy: require-corp" From 1e6327ba20a6d395037b629c2683e61c86eb04d8 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 15 May 2025 10:56:38 +0100 Subject: [PATCH 045/209] Remove sample showing WASM_ASYNC_COMPILATION=0 This flag can be left untouched --- src/mono/sample/wasm/browser-async/Makefile | 11 -------- src/mono/sample/wasm/browser-async/Program.cs | 21 -------------- .../Wasm.Browser.Async.Sample.csproj | 10 ------- src/mono/sample/wasm/browser-async/index.html | 18 ------------ src/mono/sample/wasm/browser-async/main.js | 28 ------------------- 5 files changed, 88 deletions(-) delete mode 100644 src/mono/sample/wasm/browser-async/Makefile delete mode 100644 src/mono/sample/wasm/browser-async/Program.cs delete mode 100644 src/mono/sample/wasm/browser-async/Wasm.Browser.Async.Sample.csproj delete mode 100644 src/mono/sample/wasm/browser-async/index.html delete mode 100644 src/mono/sample/wasm/browser-async/main.js diff --git a/src/mono/sample/wasm/browser-async/Makefile b/src/mono/sample/wasm/browser-async/Makefile deleted file mode 100644 index 7ae388cce865d3..00000000000000 --- a/src/mono/sample/wasm/browser-async/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -TOP=../../../../.. - -include ../wasm.mk - -ifneq ($(AOT),) -override MSBUILD_ARGS+=/p:RunAOTCompilation=true -endif - -PROJECT_NAME=Wasm.Browser.Sample.csproj - -run: run-browser diff --git a/src/mono/sample/wasm/browser-async/Program.cs b/src/mono/sample/wasm/browser-async/Program.cs deleted file mode 100644 index ce542da6201921..00000000000000 --- a/src/mono/sample/wasm/browser-async/Program.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices.JavaScript; -using System.Runtime.InteropServices; - -namespace Sample -{ - public partial class Test - { - public static int Main(string[] args) - { - DisplayMeaning(42); - return 0; - } - - [JSImport("Sample.Test.displayMeaning", "main.js")] - internal static partial void DisplayMeaning(int meaning); - } -} diff --git a/src/mono/sample/wasm/browser-async/Wasm.Browser.Async.Sample.csproj b/src/mono/sample/wasm/browser-async/Wasm.Browser.Async.Sample.csproj deleted file mode 100644 index 8f887304869822..00000000000000 --- a/src/mono/sample/wasm/browser-async/Wasm.Browser.Async.Sample.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - - $(EmccFlags) -sWASM_ASYNC_COMPILATION=0 - - - - - - diff --git a/src/mono/sample/wasm/browser-async/index.html b/src/mono/sample/wasm/browser-async/index.html deleted file mode 100644 index b4c21ec1b92e2e..00000000000000 --- a/src/mono/sample/wasm/browser-async/index.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - Wasm Browser Sample - - - - - - - - Answer to the Ultimate Question of Life, the Universe, and Everything is : - - - \ No newline at end of file diff --git a/src/mono/sample/wasm/browser-async/main.js b/src/mono/sample/wasm/browser-async/main.js deleted file mode 100644 index 20fd268d65b9ac..00000000000000 --- a/src/mono/sample/wasm/browser-async/main.js +++ /dev/null @@ -1,28 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -import { dotnet, exit } from './_framework/dotnet.js' - -function displayMeaning(meaning) { - document.getElementById("out").innerHTML = `${meaning}`; -} - -try { - const { setModuleImports } = await dotnet - .withElementOnExit() - .withExitOnUnhandledError() - .create(); - - setModuleImports("main.js", { - Sample: { - Test: { - displayMeaning - } - } - }); - - await dotnet.run(); -} -catch (err) { - exit(2, err); -} \ No newline at end of file From e3ef9d1a05704206fe59c5819604c3d98b70d140 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 20 May 2025 13:05:53 +0100 Subject: [PATCH 046/209] Logging --- .../build/Microsoft.NET.Sdk.WebAssembly.Browser.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets index 88eb46e6928a2d..6a368563ad4444 100644 --- a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets +++ b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets @@ -236,7 +236,7 @@ Copyright (c) .NET Foundation. All rights reserved. <_WasmEmitSourceMapBuild>$(WasmEmitSourceMap) <_WasmEmitSourceMapBuild Condition="'$(_WasmEmitSourceMapBuild)' == ''">true - + Date: Tue, 20 May 2025 13:06:24 +0100 Subject: [PATCH 047/209] Remove TaskFactory specification May be able to revert this but commit for posterity --- .../Microsoft.NET.Sdk.WebAssembly.Browser.targets | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets index 6a368563ad4444..56bfb3f80cff79 100644 --- a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets +++ b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets @@ -54,10 +54,10 @@ Copyright (c) .NET Foundation. All rights reserved. true - - - - + + + + true @@ -254,7 +254,7 @@ Copyright (c) .NET Foundation. All rights reserved. EmitSourceMap="$(_WasmEmitSourceMapBuild)" FingerprintAssets="$(_WasmFingerprintAssets)" FingerprintDotnetJs="$(_WasmFingerprintDotnetJs)" - > + > From f645ffd8176b27fa74ca70af0a5fc178ac5b0092 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 20 May 2025 13:06:50 +0100 Subject: [PATCH 048/209] Revert "Remove TaskFactory specification" This reverts commit 2097548041a23514f311fce14fc1df54978367f4. --- .../Microsoft.NET.Sdk.WebAssembly.Browser.targets | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets index 56bfb3f80cff79..6a368563ad4444 100644 --- a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets +++ b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets @@ -54,10 +54,10 @@ Copyright (c) .NET Foundation. All rights reserved. true - - - - + + + + true @@ -254,7 +254,7 @@ Copyright (c) .NET Foundation. All rights reserved. EmitSourceMap="$(_WasmEmitSourceMapBuild)" FingerprintAssets="$(_WasmFingerprintAssets)" FingerprintDotnetJs="$(_WasmFingerprintDotnetJs)" - > + > From 44c3f11aa531cd7d9ae9a6d969d90a9a8e02f70e Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 20 May 2025 14:25:11 +0100 Subject: [PATCH 049/209] Revert "Logging" This reverts commit e3ef9d1a05704206fe59c5819604c3d98b70d140. --- .../build/Microsoft.NET.Sdk.WebAssembly.Browser.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets index 6a368563ad4444..88eb46e6928a2d 100644 --- a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets +++ b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets @@ -236,7 +236,7 @@ Copyright (c) .NET Foundation. All rights reserved. <_WasmEmitSourceMapBuild>$(WasmEmitSourceMap) <_WasmEmitSourceMapBuild Condition="'$(_WasmEmitSourceMapBuild)' == ''">true - + Date: Wed, 21 May 2025 10:24:28 +0100 Subject: [PATCH 050/209] Set wasm64 default properties --- src/mono/sample/wasm/DefaultBrowserSample.targets | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mono/sample/wasm/DefaultBrowserSample.targets b/src/mono/sample/wasm/DefaultBrowserSample.targets index 2de9872370a3be..108e7fb9b6da7c 100644 --- a/src/mono/sample/wasm/DefaultBrowserSample.targets +++ b/src/mono/sample/wasm/DefaultBrowserSample.targets @@ -11,7 +11,8 @@ true $(TestArchiveRoot)chromeonly/ $(TestArchiveTestsRoot)$(OSPlatformConfig)/ - $(EmccFlags) -sUSE_CLOSURE_COMPILER=1 + $(EmccFlags) -sUSE_CLOSURE_COMPILER=1 -sMEMORY64 + true From ceaadfcac70a6e3daca4f1f65601d1e5dd41e390 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 28 May 2025 08:49:37 +0100 Subject: [PATCH 051/209] use closure compiler --- src/mono/browser/browser.proj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mono/browser/browser.proj b/src/mono/browser/browser.proj index f6548cb79c4a05..45d531d37998cd 100644 --- a/src/mono/browser/browser.proj +++ b/src/mono/browser/browser.proj @@ -30,7 +30,7 @@ false false false - emcc + emcc -g $(ArtifactsObjDir)wasm <_EmccDefaultsRspPath>$(NativeBinDir)src\emcc-default.rsp <_EmccCompileRspPath>$(NativeBinDir)src\emcc-compile.rsp @@ -122,7 +122,7 @@   --target=wasm64 - $(ArtifactsObjDir)wasm/pinvoke-table.h $(ArtifactsObjDir)wasm/wasm_m2n_invoke.g.h - -sWASM_ASYNC_COMPILATION=0 -g -Os -DDEBUG=1 -DENABLE_AOT_PROFILER=1 -DENABLE_BROWSER_PROFILER=1 -DENABLE_LOG_PROFILER=1 + -sUSE_CLOSURE_COMPILER=1 -g -Os -DDEBUG=1 -DENABLE_AOT_PROFILER=1 -DENABLE_BROWSER_PROFILER=1 -DENABLE_LOG_PROFILER=1 -Oz $(CMakeConfigurationLinkFlags) -DMEMORY64 --target=wasm64 - $(CMakeConfigurationEmccFlags) -s ASSERTIONS=1 + $(CMakeConfigurationLinkFlags) -s ASSERTIONS=1 -O2 From f6d496fad5eb91cae247b6d500004511298fa20d Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 29 May 2025 08:38:58 +0100 Subject: [PATCH 052/209] First change to pointer in fn_signatures --- src/mono/browser/runtime/cwraps.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/browser/runtime/cwraps.ts b/src/mono/browser/runtime/cwraps.ts index d326d0631af810..3c35df24b34a72 100644 --- a/src/mono/browser/runtime/cwraps.ts +++ b/src/mono/browser/runtime/cwraps.ts @@ -38,7 +38,7 @@ const fn_signatures: SigLine[] = [ [true, "mono_wasm_send_dbg_command", "bool", ["number", "number", "number", "number", "number"]], [true, "mono_wasm_send_dbg_command_with_parms", "bool", ["number", "number", "number", "number", "number", "number", "string"]], [true, "mono_wasm_setenv", null, ["string", "string"]], - [true, "mono_wasm_parse_runtime_options", null, ["number", "number"]], + [true, "mono_wasm_parse_runtime_options", null, ["number", "pointer"]], [true, "mono_wasm_strdup", "number", ["string"]], [true, "mono_background_exec", null, []], [true, "mono_wasm_ds_exec", null, []], From 2ec098f3c0a2032caad581685a0357247975cef0 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 29 May 2025 11:04:44 +0100 Subject: [PATCH 053/209] cwrap pointer conversions --- src/mono/browser/runtime/cwraps.ts | 112 ++++++++++++++--------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/src/mono/browser/runtime/cwraps.ts b/src/mono/browser/runtime/cwraps.ts index 3c35df24b34a72..e18cc42d8de3ae 100644 --- a/src/mono/browser/runtime/cwraps.ts +++ b/src/mono/browser/runtime/cwraps.ts @@ -17,79 +17,79 @@ type SigLine = [lazyOrSkip: boolean | (() => boolean), name: string, returnType: const threading_cwraps: SigLine[] = WasmEnableThreads ? [ [false, "mono_wasm_init_finalizer_thread", null, []], - [false, "mono_wasm_invoke_jsexport_async_post", "void", ["number", "number", "number"]], - [false, "mono_wasm_invoke_jsexport_sync_send", "void", ["number", "number", "number"]], - [false, "mono_wasm_invoke_jsexport_sync", "void", ["number", "number"]], - [true, "mono_wasm_create_deputy_thread", "number", []], - [true, "mono_wasm_create_io_thread", "number", []], + [false, "mono_wasm_invoke_jsexport_async_post", "void", ["pointer", "pointer", "pointer"]], + [false, "mono_wasm_invoke_jsexport_sync_send", "void", ["pointer", "pointer", "pointer"]], + [false, "mono_wasm_invoke_jsexport_sync", "void", ["pointer", "pointer"]], + [true, "mono_wasm_create_deputy_thread", "pointer", []], + [true, "mono_wasm_create_io_thread", "pointer", []], [true, "mono_wasm_register_ui_thread", "void", []], [true, "mono_wasm_register_io_thread", "void", []], [true, "mono_wasm_print_thread_dump", "void", []], [true, "mono_wasm_synchronization_context_pump", "void", []], - [true, "mono_threads_wasm_sync_run_in_target_thread_done", "void", ["number"]], + [true, "mono_threads_wasm_sync_run_in_target_thread_done", "void", ["pointer"]], ] : []; // when the method is assigned/cached at usage, instead of being invoked directly from cwraps, it can't be marked lazy, because it would be re-bound on each call const fn_signatures: SigLine[] = [ - [true, "mono_wasm_register_root", "number", ["number", "number", "string"]], - [true, "mono_wasm_deregister_root", null, ["number"]], - [true, "mono_wasm_string_get_data_ref", null, ["number", "number", "number", "number"]], + [true, "mono_wasm_register_root", "number", ["pointer", "number", "string"]], + [true, "mono_wasm_deregister_root", null, ["pointer"]], + [true, "mono_wasm_string_get_data_ref", null, ["pointer", "pointer", "pointer", "pointer"]], [true, "mono_wasm_set_is_debugger_attached", "void", ["bool"]], - [true, "mono_wasm_send_dbg_command", "bool", ["number", "number", "number", "number", "number"]], - [true, "mono_wasm_send_dbg_command_with_parms", "bool", ["number", "number", "number", "number", "number", "number", "string"]], + [true, "mono_wasm_send_dbg_command", "bool", ["number", "number", "number", "pointer", "number"]], + [true, "mono_wasm_send_dbg_command_with_parms", "bool", ["number", "number", "number", "pointer", "number", "number", "string"]], [true, "mono_wasm_setenv", null, ["string", "string"]], [true, "mono_wasm_parse_runtime_options", null, ["number", "pointer"]], [true, "mono_wasm_strdup", "number", ["string"]], [true, "mono_background_exec", null, []], [true, "mono_wasm_ds_exec", null, []], [true, "mono_wasm_execute_timer", null, []], - [true, "mono_wasm_load_icu_data", "number", ["number"]], - [false, "mono_wasm_add_assembly", "number", ["string", "number", "number"]], - [true, "mono_wasm_add_satellite_assembly", "void", ["string", "string", "number", "number"]], + [true, "mono_wasm_load_icu_data", "number", ["pointer"]], + [false, "mono_wasm_add_assembly", "number", ["string", "pointer", "number"]], + [true, "mono_wasm_add_satellite_assembly", "void", ["string", "string", "pointer", "number"]], [false, "mono_wasm_load_runtime", null, ["number"]], [true, "mono_wasm_change_debugger_log_level", "void", ["number"]], - [true, "mono_wasm_assembly_load", "number", ["string"]], - [true, "mono_wasm_assembly_find_class", "number", ["number", "string", "string"]], - [true, "mono_wasm_assembly_find_method", "number", ["number", "string", "number"]], - [true, "mono_wasm_string_from_utf16_ref", "void", ["number", "number", "number"]], - [true, "mono_wasm_intern_string_ref", "void", ["number"]], + [true, "mono_wasm_assembly_load", "pointer", ["string"]], + [true, "mono_wasm_assembly_find_class", "pointer", ["pointer", "string", "string"]], + [true, "mono_wasm_assembly_find_method", "pointer", ["pointer", "string", "number"]], + [true, "mono_wasm_string_from_utf16_ref", "void", ["pointer", "number", "pointer"]], + [true, "mono_wasm_intern_string_ref", "void", ["pointer"]], [false, "mono_wasm_exit", "void", ["number"]], - [true, "mono_wasm_getenv", "number", ["string"]], - [true, "mono_wasm_set_main_args", "void", ["number", "number"]], + [true, "mono_wasm_getenv", "pointer", ["string"]], + [true, "mono_wasm_set_main_args", "void", ["number", "pointer"]], // These three need to be lazy because they may be missing [() => !runtimeHelpers.emscriptenBuildOptions.enableAotProfiler, "mono_wasm_profiler_init_aot", "void", ["string"]], [() => !runtimeHelpers.emscriptenBuildOptions.enableBrowserProfiler, "mono_wasm_profiler_init_browser", "void", ["string"]], [() => !runtimeHelpers.emscriptenBuildOptions.enableLogProfiler, "mono_wasm_profiler_init_log", "void", ["string"]], [false, "mono_wasm_exec_regression", "number", ["number", "string"]], - [false, "mono_wasm_invoke_jsexport", "void", ["number", "number"]], + [false, "mono_wasm_invoke_jsexport", "void", ["pointer", "pointer"]], [true, "mono_wasm_write_managed_pointer_unsafe", "void", ["number", "number"]], - [true, "mono_wasm_copy_managed_pointer", "void", ["number", "number"]], - [true, "mono_wasm_i52_to_f64", "number", ["number", "number"]], - [true, "mono_wasm_u52_to_f64", "number", ["number", "number"]], - [true, "mono_wasm_f64_to_i52", "number", ["number", "number"]], - [true, "mono_wasm_f64_to_u52", "number", ["number", "number"]], - [true, "mono_wasm_method_get_name", "number", ["number"]], - [true, "mono_wasm_method_get_name_ex", "number", ["number"]], - [true, "mono_wasm_method_get_full_name", "number", ["number"]], + [true, "mono_wasm_copy_managed_pointer", "void", ["pointer", "pointer"]], + [true, "mono_wasm_i52_to_f64", "number", ["pointer", "pointer"]], + [true, "mono_wasm_u52_to_f64", "number", ["pointer", "pointer"]], + [true, "mono_wasm_f64_to_i52", "number", ["pointer", "pointer"]], + [true, "mono_wasm_f64_to_u52", "number", ["pointer", "pointer"]], + [true, "mono_wasm_method_get_name", "pointer", ["pointer"]], + [true, "mono_wasm_method_get_name_ex", "pointer", ["pointer"]], + [true, "mono_wasm_method_get_full_name", "pointer", ["pointer"]], [true, "mono_wasm_gc_lock", "void", []], [true, "mono_wasm_gc_unlock", "void", []], - [true, "mono_wasm_get_i32_unaligned", "number", ["number"]], - [true, "mono_wasm_get_f32_unaligned", "number", ["number"]], - [true, "mono_wasm_get_f64_unaligned", "number", ["number"]], - [true, "mono_wasm_read_as_bool_or_null_unsafe", "number", ["number"]], + [true, "mono_wasm_get_i32_unaligned", "number", ["pointer"]], + [true, "mono_wasm_get_f32_unaligned", "number", ["pointer"]], + [true, "mono_wasm_get_f64_unaligned", "number", ["pointer"]], + [true, "mono_wasm_read_as_bool_or_null_unsafe", "number", ["pointer"]], // jiterpreter [true, "mono_jiterp_trace_bailout", "void", ["number"]], [true, "mono_jiterp_get_trace_bailout_count", "number", ["number"]], [true, "mono_jiterp_value_copy", "void", ["number", "number", "number"]], [true, "mono_jiterp_get_member_offset", "number", ["number"]], - [true, "mono_jiterp_encode_leb52", "number", ["number", "number", "number"]], - [true, "mono_jiterp_encode_leb64_ref", "number", ["number", "number", "number"]], - [true, "mono_jiterp_encode_leb_signed_boundary", "number", ["number", "number", "number"]], - [true, "mono_jiterp_write_number_unaligned", "void", ["number", "number", "number"]], - [true, "mono_jiterp_type_is_byref", "number", ["number"]], + [true, "mono_jiterp_encode_leb52", "number", ["pointer", "number", "number"]], + [true, "mono_jiterp_encode_leb64_ref", "number", ["pointer", "pointer", "number"]], + [true, "mono_jiterp_encode_leb_signed_boundary", "number", ["pointer", "number", "number"]], + [true, "mono_jiterp_write_number_unaligned", "void", ["pointer", "number", "number"]], + [true, "mono_jiterp_type_is_byref", "number", ["pointer"]], [true, "mono_jiterp_get_size_of_stackval", "number", []], [true, "mono_jiterp_parse_option", "number", ["string"]], [true, "mono_jiterp_get_options_as_json", "number", []], @@ -98,21 +98,21 @@ const fn_signatures: SigLine[] = [ [true, "mono_jiterp_adjust_abort_count", "number", ["number", "number"]], [true, "mono_jiterp_register_jit_call_thunk", "void", ["number", "number"]], [true, "mono_jiterp_type_get_raw_value_size", "number", ["number"]], - [true, "mono_jiterp_get_signature_has_this", "number", ["number"]], - [true, "mono_jiterp_get_signature_return_type", "number", ["number"]], - [true, "mono_jiterp_get_signature_param_count", "number", ["number"]], - [true, "mono_jiterp_get_signature_params", "number", ["number"]], - [true, "mono_jiterp_type_to_ldind", "number", ["number"]], - [true, "mono_jiterp_type_to_stind", "number", ["number"]], - [true, "mono_jiterp_imethod_to_ftnptr", "number", ["number"]], + [true, "mono_jiterp_get_signature_has_this", "number", ["pointer"]], + [true, "mono_jiterp_get_signature_return_type", "pointer", ["pointer"]], + [true, "mono_jiterp_get_signature_param_count", "number", ["pointer"]], + [true, "mono_jiterp_get_signature_params", "pointer", ["pointer"]], + [true, "mono_jiterp_type_to_ldind", "number", ["pointer"]], + [true, "mono_jiterp_type_to_stind", "number", ["pointer"]], + [true, "mono_jiterp_imethod_to_ftnptr", "pointer", ["pointer"]], [true, "mono_jiterp_debug_count", "number", []], [true, "mono_jiterp_get_trace_hit_count", "number", ["number"]], - [true, "mono_jiterp_get_polling_required_address", "number", []], + [true, "mono_jiterp_get_polling_required_address", "pointer", []], [true, "mono_jiterp_get_rejected_trace_count", "number", []], [true, "mono_jiterp_boost_back_branch_target", "void", ["number"]], - [true, "mono_jiterp_is_imethod_var_address_taken", "number", ["number", "number"]], + [true, "mono_jiterp_is_imethod_var_address_taken", "number", ["pointer", "number"]], [true, "mono_jiterp_get_opcode_value_table_entry", "number", ["number"]], - [true, "mono_jiterp_get_simd_intrinsic", "number", ["number", "number"]], + [true, "mono_jiterp_get_simd_intrinsic", "pointer", ["number", "number"]], [true, "mono_jiterp_get_simd_opcode", "number", ["number", "number"]], [true, "mono_jiterp_get_arg_offset", "number", ["number", "number", "number"]], [true, "mono_jiterp_get_opcode_info", "number", ["number", "number"]], @@ -123,16 +123,16 @@ const fn_signatures: SigLine[] = [ [true, "mono_jiterp_get_interp_entry_func", "number", ["number"]], [true, "mono_jiterp_get_counter", "number", ["number"]], [true, "mono_jiterp_modify_counter", "number", ["number", "number"]], - [true, "mono_jiterp_tlqueue_next", "number", ["number"]], - [true, "mono_jiterp_tlqueue_add", "number", ["number", "number"]], + [true, "mono_jiterp_tlqueue_next", "pointer", ["number"]], + [true, "mono_jiterp_tlqueue_add", "number", ["number", "pointer"]], [true, "mono_jiterp_tlqueue_clear", "void", ["number"]], [true, "mono_jiterp_begin_catch", "void", ["number"]], [true, "mono_jiterp_end_catch", "void", []], - [true, "mono_interp_pgo_load_table", "number", ["number", "number"]], - [true, "mono_interp_pgo_save_table", "number", ["number", "number"]], - [() => !runtimeHelpers.emscriptenBuildOptions.enablePerfTracing && !runtimeHelpers.emscriptenBuildOptions.enableBrowserProfiler, "mono_jiterp_prof_enter", "void", ["number", "number"]], - [() => !runtimeHelpers.emscriptenBuildOptions.enablePerfTracing && !runtimeHelpers.emscriptenBuildOptions.enableBrowserProfiler, "mono_jiterp_prof_samplepoint", "void", ["number", "number"]], - [() => !runtimeHelpers.emscriptenBuildOptions.enablePerfTracing && !runtimeHelpers.emscriptenBuildOptions.enableBrowserProfiler, "mono_jiterp_prof_leave", "void", ["number", "number"]], + [true, "mono_interp_pgo_load_table", "number", ["pointer", "number"]], + [true, "mono_interp_pgo_save_table", "number", ["pointer", "number"]], + [() => !runtimeHelpers.emscriptenBuildOptions.enablePerfTracing && !runtimeHelpers.emscriptenBuildOptions.enableBrowserProfiler, "mono_jiterp_prof_enter", "void", ["pointer", "pointer"]], + [() => !runtimeHelpers.emscriptenBuildOptions.enablePerfTracing && !runtimeHelpers.emscriptenBuildOptions.enableBrowserProfiler, "mono_jiterp_prof_samplepoint", "void", ["pointer", "pointer"]], + [() => !runtimeHelpers.emscriptenBuildOptions.enablePerfTracing && !runtimeHelpers.emscriptenBuildOptions.enableBrowserProfiler, "mono_jiterp_prof_leave", "void", ["pointer", "pointer"]], ...threading_cwraps, ]; From c0d07eebd5050f84e018fafc13f7e27e28e8a96e Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 2 Jun 2025 14:21:44 +0100 Subject: [PATCH 054/209] More debug output --- src/mono/browser/browser.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/browser/browser.proj b/src/mono/browser/browser.proj index 45d531d37998cd..7cc30f8768e2d6 100644 --- a/src/mono/browser/browser.proj +++ b/src/mono/browser/browser.proj @@ -392,7 +392,7 @@ $(ArtifactsObjDir)wasm/pinvoke-table.h $(ArtifactsObjDir)wasm/wasm_m2n_invoke.g.h - -sUSE_CLOSURE_COMPILER=1 -g -Os -DDEBUG=1 -DENABLE_AOT_PROFILER=1 -DENABLE_BROWSER_PROFILER=1 -DENABLE_LOG_PROFILER=1 + -sUSE_CLOSURE_COMPILER=1 -g -gsource-map -O0 -DDEBUG=1 -DENABLE_AOT_PROFILER=1 -DENABLE_BROWSER_PROFILER=1 -DENABLE_LOG_PROFILER=1 -Oz $(CMakeConfigurationLinkFlags) -DMEMORY64 --target=wasm64 From b5d5ee91dfc8864d41d19e59fd614abe81acdc04 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 2 Jun 2025 14:22:52 +0100 Subject: [PATCH 055/209] change return type to pointer --- src/mono/browser/runtime/cwraps.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/browser/runtime/cwraps.ts b/src/mono/browser/runtime/cwraps.ts index e18cc42d8de3ae..e91261026f4e85 100644 --- a/src/mono/browser/runtime/cwraps.ts +++ b/src/mono/browser/runtime/cwraps.ts @@ -115,7 +115,7 @@ const fn_signatures: SigLine[] = [ [true, "mono_jiterp_get_simd_intrinsic", "pointer", ["number", "number"]], [true, "mono_jiterp_get_simd_opcode", "number", ["number", "number"]], [true, "mono_jiterp_get_arg_offset", "number", ["number", "number", "number"]], - [true, "mono_jiterp_get_opcode_info", "number", ["number", "number"]], + [true, "mono_jiterp_get_opcode_info", "pointer", ["number", "number"]], [true, "mono_wasm_is_zero_page_reserved", "number", []], [true, "mono_jiterp_is_special_interface", "number", ["number"]], [true, "mono_jiterp_initialize_table", "void", ["number", "number", "number"]], From 30b12733d3d302838c91366378facdd5e5aa6d80 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 2 Jun 2025 14:23:08 +0100 Subject: [PATCH 056/209] Debug output --- src/mono/browser/runtime/loader/assets.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mono/browser/runtime/loader/assets.ts b/src/mono/browser/runtime/loader/assets.ts index 2f05054130ca93..fa03a7f6c982e5 100644 --- a/src/mono/browser/runtime/loader/assets.ts +++ b/src/mono/browser/runtime/loader/assets.ts @@ -198,12 +198,19 @@ export async function mono_download_assets (): Promise { mono_assert(typeof asset.resolvedUrl === "string", "resolvedUrl must be string"); const url = asset.resolvedUrl!; const buffer = await asset.buffer; + mono_log_debug("URL: " + url); + mono_log_debug("Type: " + typeof buffer); // should be 'object' + mono_log_debug(buffer instanceof ArrayBuffer ? "is ArrayBuffer" : "is not ArrayBuffer"); + mono_log_debug("Constructor: " + (buffer as any)?.constructor?.name); + mono_log_debug("Creating array:"); const data = new Uint8Array(buffer); + mono_log_debug("Created array:"); cleanupAsset(asset); // wait till after onRuntimeInitialized await runtimeHelpers.beforeOnRuntimeInitialized.promise; + mono_log_debug("Instantiating asset:" + url); runtimeHelpers.instantiate_asset(asset, url, data); } } else { From d8db3c46e96c92000cc8fbbe7e06e7e20654424b Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 2 Jun 2025 14:23:48 +0100 Subject: [PATCH 057/209] Logging function/macro --- src/mono/mono/metadata/mh_log.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/mono/mono/metadata/mh_log.h diff --git a/src/mono/mono/metadata/mh_log.h b/src/mono/mono/metadata/mh_log.h new file mode 100644 index 00000000000000..735a3674aa1047 --- /dev/null +++ b/src/mono/mono/metadata/mh_log.h @@ -0,0 +1,14 @@ +#ifndef MH_LOG_HEADER_ +#define MH_LOG_HEADER_ + + +#include + +#define MH_LOG(msg, ...) { \ + printf("MH_NATIVE_LOG: File %s | Line %d :: ", __FILE__, __LINE__); \ + printf((msg), ##__VA_ARGS__); \ + printf("\n"); \ + fflush(stdout); \ +} + +#endif From 824f7a1b2e5bae869d8bcc8ec717744fe8796e77 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 2 Jun 2025 14:24:46 +0100 Subject: [PATCH 058/209] Add more mono logging at sample runtime --- src/mono/sample/wasm/browser/main.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mono/sample/wasm/browser/main.js b/src/mono/sample/wasm/browser/main.js index 20fd268d65b9ac..6d513a857cea34 100644 --- a/src/mono/sample/wasm/browser/main.js +++ b/src/mono/sample/wasm/browser/main.js @@ -21,8 +21,16 @@ try { } }); - await dotnet.run(); + await dotnet + .withDiagnosticTracing(true) // enable JavaScript tracing + .withConfig({ + environmentVariables: { + "MONO_LOG_LEVEL": "debug", //enable Mono VM detailed logging by + "MONO_LOG_MASK": "all", // categories, could be also gc,aot,type,... + } + }) + .run(); } catch (err) { exit(2, err); -} \ No newline at end of file +} From ecb36a9589f9996d6b217f74d173ba1a4d6e0d28 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 2 Jun 2025 14:25:38 +0100 Subject: [PATCH 059/209] More debug output --- src/mono/mono.proj | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 8db6dc43757a41..7d8b12d47ddd35 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -587,16 +587,28 @@ JS_ENGINES = [NODE_JS] <_MonoCMakeArgs Include="-DDISABLE_JITERPRETER=1"/> <_MonoCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread"/> <_MonoCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-D_GNU_SOURCE=1" /> - <_MonoCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64" /> - <_MonoCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="--target=wasm64" /> + <_MonoCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64=1" /> + <_MonoCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-g" /> + <_MonoCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-gsource-map" /> + <_MonoCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-O0" /> + <_MonoCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="--target=wasm64" /> <_MonoCXXFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread"/> <_MonoCXXFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-D_GNU_SOURCE=1" /> - <_MonoCXXFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64" /> - <_MonoCXXFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="--target=wasm64" /> - <_MonoBuildEnv Condition="'$(WasmEnableMemory64)' == 'true'" Include="TARGET_BUILD_ARCH=wasm64" /> + <_MonoCXXFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64=1" /> + <_MonoCXXFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="--target=wasm64" /> + <_MonoCXXFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-g" /> + <_MonoBuildEnv Condition="'$(WasmEnableMemory64)' == 'true'" Include="TARGET_BUILD_ARCH=wasm64" /> - + + true + false + false + true + true + true + false + @@ -896,11 +908,11 @@ JS_ENGINES = [NODE_JS] <_MonoAOTCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread -D_GNU_SOURCE=1" /> - <_MonoAOTCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="--target=wasm64 -DMEMORY64" /> + <_MonoAOTCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="--target=wasm64 -DMEMORY64=1 -g -gsource-map -O0" /> <_MonoAOTCPPFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread -D_GNU_SOURCE=1"/> - <_MonoAOTCPPFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64 --target=wasm64" /> + <_MonoAOTCPPFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64=1 --target=wasm64 -g -gsource-map -O0" /> <_MonoAOTCXXFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread -D_GNU_SOURCE=1"/> - <_MonoAOTCXXFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64 --target=wasm64" /> + <_MonoAOTCXXFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64=1 --target=wasm64 -g -gsource-map -O0" /> From 14d237c80ea947fbec1bd1bd8a4386194182d9ac Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 2 Jun 2025 14:25:58 +0100 Subject: [PATCH 060/209] debug logging --- src/mono/mono/metadata/appdomain.c | 26 ++++++++++++++++---------- src/mono/mono/metadata/gc.c | 11 +++++++++-- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/mono/mono/metadata/appdomain.c b/src/mono/mono/metadata/appdomain.c index f0a7789108d552..f29abe4596aa9d 100644 --- a/src/mono/mono/metadata/appdomain.c +++ b/src/mono/mono/metadata/appdomain.c @@ -12,7 +12,7 @@ * Copyright 2012 Xamarin Inc * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ - +#include "mh_log.h" #include #include #include @@ -151,6 +151,7 @@ mono_runtime_set_no_exec (gboolean val) gboolean mono_runtime_get_no_exec (void) { + MH_LOG("inside mono_runtime_get_no_exec"); return no_exec; } @@ -235,6 +236,7 @@ mono_runtime_init (MonoDomain *domain, MonoThreadStartCB start_cb, MonoThreadAtt void mono_runtime_init_checked (MonoDomain *domain, MonoThreadStartCB start_cb, MonoThreadAttachCB attach_cb, MonoError *error) { + printf("MH_NATIVE_LOG: calling HANDLE_FUNCTION_ENTER\n");fflush(stdout); HANDLE_FUNCTION_ENTER (); MonoAppDomainHandle ad; @@ -245,13 +247,13 @@ mono_runtime_init_checked (MonoDomain *domain, MonoThreadStartCB start_cb, MonoT mono_monitor_init (); mono_marshal_init (); mono_gc_init_icalls (); - + printf("MH_NATIVE_LOG: calling mono_install_assembly_preload_hook_v2\n");fflush(stdout); // We have to append here because otherwise this will run before the netcore hook (which is installed first), see https://github.com/dotnet/runtime/issues/34273 mono_install_assembly_preload_hook_v2 (mono_domain_assembly_preload, GUINT_TO_POINTER (FALSE), TRUE); mono_install_assembly_search_hook_v2 (mono_domain_assembly_search, GUINT_TO_POINTER (FALSE), FALSE, FALSE); mono_install_assembly_search_hook_v2 (mono_domain_assembly_postload_search, GUINT_TO_POINTER (FALSE), TRUE, FALSE); mono_install_assembly_load_hook_v2 (mono_domain_fire_assembly_load, NULL, FALSE); - + printf("MH_NATIVE_LOG: calling mono_thread_init\n");fflush(stdout); mono_thread_init (start_cb, attach_cb); if (!mono_runtime_get_no_exec ()) { @@ -276,22 +278,25 @@ mono_runtime_init_checked (MonoDomain *domain, MonoThreadStartCB start_cb, MonoT mono_component_event_pipe ()->add_rundown_execution_checkpoint ("RuntimeResumed"); mono_component_event_pipe ()->write_event_ee_startup_start (); - + printf("MH_NATIVE_LOG: calling mono_type_initialization_init (%p)\n", &mono_type_initialization_init);fflush(stdout); mono_type_initialization_init (); - + printf("MH_NATIVE_LOG: exited mono_type_initialization_init\n");fflush(stdout); if (!mono_runtime_get_no_exec ()) create_domain_objects (domain); - + + MH_LOG("Calling mono_gc_init %p", &mono_gc_init); /* GC init has to happen after thread init */ mono_gc_init (); + MH_LOG("mono_runtime_get_no_exec"); if (!mono_runtime_get_no_exec ()) mono_runtime_install_appctx_properties (); mono_locks_tracer_init (); - + printf("MH_NATIVE_LOG: calling mono_domain_fire_assembly_load\n");fflush(stdout); /* mscorlib is loaded before we install the load hook */ mono_domain_fire_assembly_load (mono_alc_get_default (), mono_defaults.corlib->assembly, NULL, error); + printf("MH_NATIVE_LOG: exited mono_domain_fire_assembly_load. Error code is %s\n", is_ok(error) ? "ok" : "not ok");fflush(stdout); goto_if_nok (error, exit); exit: @@ -848,7 +853,7 @@ static GENERATE_GET_CLASS_WITH_CACHE (appctx, "System", "AppContext") /* Install properties into AppContext */ void mono_runtime_install_appctx_properties (void) -{ +{ ERROR_DECL (error); gpointer args [5]; int n_runtimeconfig_json_props = 0; @@ -859,12 +864,13 @@ mono_runtime_install_appctx_properties (void) guint32 *combined_value_lengths; MonoFileMap *runtimeconfig_json_map = NULL; gpointer runtimeconfig_json_map_handle = NULL; + MH_LOG("Calling runtimeconfig_json_get_buffer"); const char *buffer_start = runtimeconfig_json_get_buffer (runtime_config_arg, &runtimeconfig_json_map, &runtimeconfig_json_map_handle); const char *buffer = buffer_start; - + MH_LOG("Got buffer. calling mono_class_get_method_from_name_checked"); MonoMethod *setup = mono_class_get_method_from_name_checked (mono_class_get_appctx_class (), "Setup", 5, 0, error); g_assert (setup); - + MH_LOG("Got Setup method"); // FIXME: TRUSTED_PLATFORM_ASSEMBLIES is very large // Combine and convert properties diff --git a/src/mono/mono/metadata/gc.c b/src/mono/mono/metadata/gc.c index 5ef0faa9f80516..ea1f368d805023 100644 --- a/src/mono/mono/metadata/gc.c +++ b/src/mono/mono/metadata/gc.c @@ -9,7 +9,7 @@ * Copyright 2012 Xamarin Inc (http://www.xamarin.com) * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ - +#include #include #include #include @@ -919,6 +919,7 @@ finalizer_thread (gpointer unused) static void init_finalizer_thread (void) { + MH_LOG("inside init_finalizer_thread"); ERROR_DECL (error); gc_thread = mono_thread_create_internal ((MonoThreadStart)finalizer_thread, NULL, MONO_THREAD_CREATE_FLAGS_NONE, error); mono_error_assert_ok (error); @@ -953,17 +954,23 @@ reference_queue_mutex_init (void) void mono_gc_init (void) { + MH_LOG("Calling mono_lazy_initialize %p", &reference_queue_mutex_inited); mono_lazy_initialize (&reference_queue_mutex_inited, reference_queue_mutex_init); + MH_LOG("Calling mono_coop_mutex_init_recursive"); mono_coop_mutex_init_recursive (&finalizer_mutex); + MH_LOG("Calling mono_coop_mutex_init_recursive"); mono_os_mutex_init_recursive (&finalizable_objects_hash_lock); + MH_LOG("Creating new hash table"); finalizable_objects_hash = g_hash_table_new (mono_aligned_addr_hash, NULL); + MH_LOG("Calling mono_counters_register"); mono_counters_register ("Minor GC collections", MONO_COUNTER_GC | MONO_COUNTER_INT, &mono_gc_stats.minor_gc_count); mono_counters_register ("Major GC collections", MONO_COUNTER_GC | MONO_COUNTER_INT, &mono_gc_stats.major_gc_count); mono_counters_register ("Minor GC time", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &mono_gc_stats.minor_gc_time); mono_counters_register ("Major GC time", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &mono_gc_stats.major_gc_time); mono_counters_register ("Major GC time concurrent", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &mono_gc_stats.major_gc_time_concurrent); + MH_LOG("mono_gc_base_init"); mono_gc_base_init (); if (mono_gc_is_disabled ()) { @@ -981,7 +988,7 @@ mono_gc_init (void) mono_coop_cond_init (&exited_cond); mono_coop_sem_init (&finalizer_sem, 0); - + MH_LOG("Exiting mono_gc_init"); #ifndef LAZY_GC_THREAD_CREATION if (!mono_runtime_get_no_exec ()) init_finalizer_thread (); From 39f3f159e08580efa0677326d75113afac3869d4 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 5 Jun 2025 12:02:20 +0100 Subject: [PATCH 061/209] try removing -gsource-map to help with debug info (no work) --- src/mono/browser/browser.proj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/browser/browser.proj b/src/mono/browser/browser.proj index 7cc30f8768e2d6..2104f8489bdaf0 100644 --- a/src/mono/browser/browser.proj +++ b/src/mono/browser/browser.proj @@ -300,7 +300,7 @@ <_EmccLinkFlags Condition="'$(_EmccExportedLibraryFunction)' != ''" Include="-s DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=$(_EmccExportedLibraryFunction)" /> <_EmccLinkFlags Include="-s EXPORTED_RUNTIME_METHODS=$(_EmccExportedRuntimeMethods)" /> <_EmccLinkFlags Include="-s EXPORTED_FUNCTIONS=$(_EmccExportedFunctions)" /> - <_EmccLinkFlags Include="--source-map-base http://example.com" /> + <_EmccLinkFlags Include="--source-map-base http://localhost:8000" /> <_EmccLinkFlags Include="-s WASM_BIGINT=1" /> <_EmccLinkFlags Include="-s EXPORT_NAME="'createDotnetRuntime'"" /> <_EmccLinkFlags Include="-s MODULARIZE=1" /> @@ -392,7 +392,7 @@ $(ArtifactsObjDir)wasm/pinvoke-table.h $(ArtifactsObjDir)wasm/wasm_m2n_invoke.g.h - -sUSE_CLOSURE_COMPILER=1 -g -gsource-map -O0 -DDEBUG=1 -DENABLE_AOT_PROFILER=1 -DENABLE_BROWSER_PROFILER=1 -DENABLE_LOG_PROFILER=1 + -sUSE_CLOSURE_COMPILER=1 -g -O0 -DDEBUG=1 -DENABLE_AOT_PROFILER=1 -DENABLE_BROWSER_PROFILER=1 -DENABLE_LOG_PROFILER=1 -Oz $(CMakeConfigurationLinkFlags) -DMEMORY64 --target=wasm64 From 0364d18f2735386d169c3cbcba5bc170174399e0 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 5 Jun 2025 12:02:40 +0100 Subject: [PATCH 062/209] logging and test function lookup --- src/mono/browser/runtime/runtime.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/mono/browser/runtime/runtime.c b/src/mono/browser/runtime/runtime.c index 1988f6cc0d0d85..6433e6b67eb7aa 100644 --- a/src/mono/browser/runtime/runtime.c +++ b/src/mono/browser/runtime/runtime.c @@ -289,6 +289,16 @@ wasm_dl_symbol (void *handle, const char *name, char **err, void *user_data) return result->func; } +#ifndef ICALL_EXPORT +#define ICALL_EXPORT +#endif +#define TEST_ICALL_SYMBOL_MAP +#ifdef TEST_ICALL_SYMBOL_MAP +const char* +mono_lookup_icall_symbol_internal (gpointer func); +ICALL_EXPORT int ves_icall_System_Environment_get_ProcessorCount (); +#endif + MonoDomain * mono_wasm_load_runtime_common (int debug_level, MonoLogCallback log_callback, const char *interp_opts) { @@ -298,7 +308,7 @@ mono_wasm_load_runtime_common (int debug_level, MonoLogCallback log_callback, co mono_dl_fallback_register (wasm_dl_load, wasm_dl_symbol, NULL, NULL); mono_wasm_install_get_native_to_interp_tramp (get_native_to_interp); - + #ifdef GEN_PINVOKE mono_wasm_install_interp_to_native_callback (mono_wasm_interp_to_native_callback); #endif @@ -329,9 +339,17 @@ mono_wasm_load_runtime_common (int debug_level, MonoLogCallback log_callback, co mono_wasm_enable_debugging (debug_level); } #endif - + printf("about to init_icall_table\n"); init_icall_table (); + { + printf("Checking mono_lookup_icall_symbol_internal\n"); + const char *p = mono_lookup_icall_symbol_internal (mono_lookup_icall_symbol_internal); + printf ("%s\n", p ? p : "null"); + printf("Checking ves_icall_System_Environment_get_ProcessorCount: "); + p = mono_lookup_icall_symbol_internal (ves_icall_System_Environment_get_ProcessorCount); + printf ("%s\n", p ? p : "null"); + } mono_ee_interp_init (interp_opts); mono_marshal_ilgen_init(); mono_method_builder_ilgen_init (); @@ -341,7 +359,7 @@ mono_wasm_load_runtime_common (int debug_level, MonoLogCallback log_callback, co mono_trace_set_log_handler (log_callback, NULL); domain = mono_jit_init_version ("mono", NULL); mono_thread_set_main (mono_thread_current ()); - + printf("returning"); return domain; } @@ -430,4 +448,4 @@ mono_wasm_marshal_get_managed_wrapper (const char* assemblyName, const char* nam assert (managedWrapper); mono_compile_method (managedWrapper); MONO_EXIT_GC_UNSAFE; -} \ No newline at end of file +} From fb913564833eca948b9f6b86eae4034ead2948ec Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 5 Jun 2025 12:02:58 +0100 Subject: [PATCH 063/209] remove -gsource-map --- src/mono/mono.proj | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 7d8b12d47ddd35..9161baa89bb300 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -588,8 +588,7 @@ JS_ENGINES = [NODE_JS] <_MonoCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread"/> <_MonoCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-D_GNU_SOURCE=1" /> <_MonoCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64=1" /> - <_MonoCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-g" /> - <_MonoCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-gsource-map" /> + <_MonoCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-g" /> <_MonoCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-O0" /> <_MonoCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="--target=wasm64" /> <_MonoCXXFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread"/> @@ -908,11 +907,11 @@ JS_ENGINES = [NODE_JS] <_MonoAOTCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread -D_GNU_SOURCE=1" /> - <_MonoAOTCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="--target=wasm64 -DMEMORY64=1 -g -gsource-map -O0" /> + <_MonoAOTCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="--target=wasm64 -DMEMORY64=1 -g -O0" /> <_MonoAOTCPPFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread -D_GNU_SOURCE=1"/> - <_MonoAOTCPPFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64=1 --target=wasm64 -g -gsource-map -O0" /> + <_MonoAOTCPPFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64=1 --target=wasm64 -g -O0" /> <_MonoAOTCXXFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread -D_GNU_SOURCE=1"/> - <_MonoAOTCXXFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64=1 --target=wasm64 -g -gsource-map -O0" /> + <_MonoAOTCXXFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64=1 --target=wasm64 -g -O0" /> From 38b1825332c2c1d8c5889c432df0a1fea1a91b40 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 5 Jun 2025 12:03:26 +0100 Subject: [PATCH 064/209] hack to ensure void_p is 8 --- src/mono/browser/runtime/driver.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mono/browser/runtime/driver.c b/src/mono/browser/runtime/driver.c index 21fb48eef03afe..d4d3910c2b2720 100644 --- a/src/mono/browser/runtime/driver.c +++ b/src/mono/browser/runtime/driver.c @@ -73,9 +73,14 @@ wasm_trace_logger (const char *log_domain, const char *log_level, const char *me if (fatal) exit (1); } +//TOOD: HACK +#ifdef SIZEOF_VOID_P +#undef SIZEOF_VOID_P +#endif +#define SIZEOF_VOID_P 8 #ifndef SIZEOF_VOID_P -#pragma message ("MRH_LOGGING_DRIVER: SIZEOF_VOID_P is undefined in driver.c") +#pragma message ("MRH_LOGGING_DRIVER: SIZEOF_VOID_P is undefined in driver.c") #define SIZEOF_VOID_P @SIZEOF_VOID_P@ #endif From ab3ee58bed110e92a70ab9145d3324534a9e776d Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 5 Jun 2025 12:04:00 +0100 Subject: [PATCH 065/209] use bigint --- src/mono/browser/runtime/crypto.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mono/browser/runtime/crypto.ts b/src/mono/browser/runtime/crypto.ts index a6642d874ffcbb..24606cf075c9d1 100644 --- a/src/mono/browser/runtime/crypto.ts +++ b/src/mono/browser/runtime/crypto.ts @@ -11,7 +11,14 @@ export function mono_wasm_browser_entropy (bufferPtr: number, bufferLength: numb } const memoryView = localHeapViewU8(); - const targetView = memoryView.subarray(bufferPtr, bufferPtr + bufferLength); + let targetView; + if (typeof bufferPtr != typeof bufferLength) { + const start = bufferPtr; + const end = BigInt(bufferPtr) + BigInt(bufferLength); + targetView = memoryView.subarray(Number(start), Number(end)); + } else { + targetView = memoryView.subarray(bufferPtr + bufferLength); + } // When threading is enabled, Chrome doesn't want SharedArrayBuffer to be passed to crypto APIs const needsCopy = isSharedArrayBuffer(memoryView.buffer); From a5c78194e2782aa489e6f832844d177c437b4b30 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 5 Jun 2025 12:04:39 +0100 Subject: [PATCH 066/209] Debug Logging --- src/mono/browser/runtime/driver.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/mono/browser/runtime/driver.c b/src/mono/browser/runtime/driver.c index d4d3910c2b2720..612f639e62243a 100644 --- a/src/mono/browser/runtime/driver.c +++ b/src/mono/browser/runtime/driver.c @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. #include #include +#include #include #include #include @@ -98,6 +99,30 @@ typedef uint32_t target_mword; typedef int32_t d_handle; #endif + +#include +#include + +#include +#include + +EMSCRIPTEN_KEEPALIVE void log_message(const char *filename, const char *message) { + FILE *file = fopen(filename, "a"); // Open for append, create if doesn't exist + if (file == NULL) { + perror("Error opening file"); + return; + } + + fprintf(file, "%s\n", message); // Write message followed by newline + fclose(file); // Close the file +} + +EMSCRIPTEN_KEEPALIVE void debug_log(const char* msg) { + EM_ASM({ + console.log(UTF8ToString($0)); + }, msg); +} + typedef target_mword SgenDescriptor; typedef SgenDescriptor MonoGCDescriptor; MONO_API int mono_gc_register_root (char *start, size_t size, MonoGCDescriptor descr, MonoGCRootSource source, void *key, const char *msg); @@ -140,6 +165,8 @@ mono_wasm_add_assembly (const char *name, const unsigned char *data, unsigned in } char *assembly_name = strdup (name); assert (assembly_name); + printf("Calling mono_bundled_resources_add_assembly_resource for %s, size %u\n", name, size); + fflush(stdout); mono_bundled_resources_add_assembly_resource (assembly_name, assembly_name, data, size, bundled_resources_free_func, assembly_name); return mono_has_pdb_checksum ((char*)data, size); } From e2fdea8d12a34a693846bee9f50f5f9e3bec7172 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 5 Jun 2025 12:05:06 +0100 Subject: [PATCH 067/209] make -g default --- src/mono/browser/build/BrowserWasmApp.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mono/browser/build/BrowserWasmApp.targets b/src/mono/browser/build/BrowserWasmApp.targets index 5dd1945d72aa7b..0e0bc4f3f8e70b 100644 --- a/src/mono/browser/build/BrowserWasmApp.targets +++ b/src/mono/browser/build/BrowserWasmApp.targets @@ -56,6 +56,7 @@ <_WasmDefaultFlags Condition="'$(WasmEnableExceptionHandling)' == 'false'">-fexceptions <_WasmDefaultFlags Condition="'$(WasmEnableExceptionHandling)' != 'false'">-fwasm-exceptions <_WasmDefaultFlags Condition="'$(WasmEnableSIMD)' == 'true'">-msimd128 + <_WasmDefaultFlags>-g <_WasmOutputFileName Condition="'$(WasmSingleFileBundle)' != 'true'">dotnet.native.wasm From 30fa856f8ae838a6cb69c5dab868b24c4e51aaad Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 5 Jun 2025 12:06:40 +0100 Subject: [PATCH 068/209] disable JITERP --- src/mono/mono/mini/interp/interp.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mono/mono/mini/interp/interp.h b/src/mono/mono/mini/interp/interp.h index a09111c490bec4..8a5208bad2d86d 100644 --- a/src/mono/mono/mini/interp/interp.h +++ b/src/mono/mono/mini/interp/interp.h @@ -45,7 +45,8 @@ enum { INTERP_OPT_PRECISE_GC = 256, INTERP_OPT_DEFAULT = INTERP_OPT_INLINE | INTERP_OPT_CPROP | INTERP_OPT_SUPER_INSTRUCTIONS | INTERP_OPT_BBLOCKS | INTERP_OPT_TIERING | INTERP_OPT_SIMD | INTERP_OPT_SSA | INTERP_OPT_PRECISE_GC #if HOST_BROWSER - | INTERP_OPT_JITERPRETER + // disable for testing wasm64 + /*| INTERP_OPT_JITERPRETER*/ #endif }; From a8e3a6f1d2eb7215906ab57db3033383096e7292 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 13 Jun 2025 15:10:15 +0100 Subject: [PATCH 069/209] Remove some hardcoded 4 byte assumptions --- src/mono/browser/runtime/roots.ts | 11 ++++++----- src/mono/browser/runtime/startup.ts | 12 +++++++----- src/mono/browser/runtime/types/emscripten.ts | 1 + src/mono/mono/mini/interp/transform-opt.c | 4 ++-- src/mono/mono/profiler/coverage.c | 2 +- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/mono/browser/runtime/roots.ts b/src/mono/browser/runtime/roots.ts index 5b81331c29ff25..e6d6a9cf70f011 100644 --- a/src/mono/browser/runtime/roots.ts +++ b/src/mono/browser/runtime/roots.ts @@ -16,6 +16,7 @@ let _scratch_root_free_indices: Int32Array | null = null; let _scratch_root_free_indices_count = 0; const _scratch_root_free_instances: WasmRoot[] = []; const _external_root_free_instances: WasmExternalRoot[] = []; +const ptrSize = 8; /** * Allocates a block of memory that can safely contain pointers into the managed heap. @@ -30,9 +31,9 @@ export function mono_wasm_new_root_buffer (capacity: number, name?: string): Was capacity = capacity | 0; - const capacityBytes = capacity * 4; + const capacityBytes = capacity * ptrSize; const offset = malloc(capacityBytes); - if ((offset % 4) !== 0) + if ((offset % ptrSize) !== 0) throw new Error("Malloc returned an unaligned offset"); _zero_region(offset, capacityBytes); @@ -191,7 +192,7 @@ export class WasmRootBufferImpl implements WasmRootBuffer { get_address (index: number): MonoObjectRef { this._check_in_range(index); - return this.__offset + (index * 4); + return this.__offset + (index * ptrSize); } get_address_32 (index: number): number { @@ -230,14 +231,14 @@ export class WasmRootBufferImpl implements WasmRootBuffer { clear (): void { if (this.__offset) - _zero_region(this.__offset, this.__count * 4); + _zero_region(this.__offset, this.__count * ptrSize); } release (): void { if (this.__offset && this.__ownsAllocation) { mono_assert(!WasmEnableThreads || !gc_locked, "GC must not be locked when disposing a GC root"); cwraps.mono_wasm_deregister_root(this.__offset); - _zero_region(this.__offset, this.__count * 4); + _zero_region(this.__offset, this.__count * ptrSize); free(this.__offset); } diff --git a/src/mono/browser/runtime/startup.ts b/src/mono/browser/runtime/startup.ts index 5874334a846325..5aa307483fb771 100644 --- a/src/mono/browser/runtime/startup.ts +++ b/src/mono/browser/runtime/startup.ts @@ -34,6 +34,8 @@ import { runtimeList } from "./exports"; import { nativeAbort, nativeExit } from "./run"; import { replaceEmscriptenPThreadInit } from "./pthreads/worker-thread"; +const ptrSize = 8; + export async function configureRuntimeStartup (module: DotnetModuleInternal): Promise { if (!module.out) { // eslint-disable-next-line no-console @@ -470,13 +472,13 @@ export function mono_wasm_set_runtime_options (options: string[]): void { if (!Array.isArray(options)) throw new Error("Expected runtimeOptions to be an array of strings"); - const argv = malloc(options.length * 4); + const argv = malloc(options.length * ptrSize); let aindex = 0; for (let i = 0; i < options.length; ++i) { const option = options[i]; if (typeof (option) !== "string") throw new Error("Expected runtimeOptions to be an array of strings"); - Module.setValue(argv + (aindex * 4), cwraps.mono_wasm_strdup(option), "i32"); + Module.setValue(argv + (aindex * ptrSize), cwraps.mono_wasm_strdup(option), "i64"); aindex += 1; } cwraps.mono_wasm_parse_runtime_options(options.length, argv); @@ -666,12 +668,12 @@ export function mono_wasm_asm_loaded (assembly_name: CharPtr, assembly_ptr: numb export function mono_wasm_set_main_args (name: string, allRuntimeArguments: string[]): void { const main_argc = allRuntimeArguments.length + 1; - const main_argv = malloc(main_argc * 4); + const main_argv = malloc(main_argc * ptrSize); let aindex = 0; - Module.setValue(main_argv + (aindex * 4), cwraps.mono_wasm_strdup(name), "i32"); + Module.setValue(main_argv + (aindex * ptrSize), cwraps.mono_wasm_strdup(name), "i64"); aindex += 1; for (let i = 0; i < allRuntimeArguments.length; ++i) { - Module.setValue(main_argv + (aindex * 4), cwraps.mono_wasm_strdup(allRuntimeArguments[i]), "i32"); + Module.setValue(main_argv + (aindex * ptrSize), cwraps.mono_wasm_strdup(allRuntimeArguments[i]), "i64"); aindex += 1; } cwraps.mono_wasm_set_main_args(main_argc, main_argv); diff --git a/src/mono/browser/runtime/types/emscripten.ts b/src/mono/browser/runtime/types/emscripten.ts index bb630df0b32e8e..f5aaf817058a9a 100644 --- a/src/mono/browser/runtime/types/emscripten.ts +++ b/src/mono/browser/runtime/types/emscripten.ts @@ -34,6 +34,7 @@ export declare interface EmscriptenModule { ccall(ident: string, returnType?: string | null, argTypes?: string[], args?: any[], opts?: any): T; cwrap(ident: string, returnType: string, argTypes?: string[], opts?: any): T; cwrap(ident: string, ...args: any[]): T; + setValue(ptr: VoidPtr, value: VoidPtr, type: string, noSafe?: number | boolean): void; setValue(ptr: VoidPtr, value: number, type: string, noSafe?: number | boolean): void; setValue(ptr: Int32Ptr, value: number, type: string, noSafe?: number | boolean): void; getValue(ptr: number, type: string, noSafe?: number | boolean): number; diff --git a/src/mono/mono/mini/interp/transform-opt.c b/src/mono/mono/mini/interp/transform-opt.c index b9f9e65b03e792..451a1a86bb09fe 100644 --- a/src/mono/mono/mini/interp/transform-opt.c +++ b/src/mono/mono/mini/interp/transform-opt.c @@ -983,9 +983,9 @@ compute_gen_set_cb (TransformData *td, int *pvar, gpointer data) // in the bblock). static void compute_gen_kill_sets (TransformData *td) -{ +{ int bitsize = mono_bitset_alloc_size (td->renamable_vars_size, 0); - char *mem = (char *)mono_mempool_alloc0 (td->opt_mempool, bitsize * td->bblocks_count_no_eh * 4); + char *mem = (char *)mono_mempool_alloc0 (td->opt_mempool, bitsize * td->bblocks_count_no_eh * sizeof(char*)); for (int i = 0; i < td->bblocks_count_no_eh; i++) { InterpBasicBlock *bb = td->bblocks [i]; diff --git a/src/mono/mono/profiler/coverage.c b/src/mono/mono/profiler/coverage.c index d692caf60c3b5e..a8d07027e9db72 100644 --- a/src/mono/mono/profiler/coverage.c +++ b/src/mono/mono/profiler/coverage.c @@ -234,7 +234,7 @@ parse_generic_type_names(char *name) if (name == NULL || *name == '\0') return g_strdup (""); - if (!(ret = new_name = (char *) g_calloc (strlen (name) * 4 + 1, sizeof (char)))) + if (!(ret = new_name = (char *) g_calloc (strlen (name) * sizeof(char*) + 1, sizeof (char)))) return NULL; do { From cb60ccbbbd36b4a67e3ae67c11e074b2cc46ad9f Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 13 Jun 2025 15:07:56 +0100 Subject: [PATCH 070/209] Some signature changes --- src/mono/browser/runtime/cwraps.ts | 18 +++++++++--------- src/mono/browser/runtime/dotnet.d.ts | 1 + src/mono/browser/runtime/driver.c | 9 +++++++++ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/mono/browser/runtime/cwraps.ts b/src/mono/browser/runtime/cwraps.ts index e91261026f4e85..e33204f36838b2 100644 --- a/src/mono/browser/runtime/cwraps.ts +++ b/src/mono/browser/runtime/cwraps.ts @@ -31,7 +31,7 @@ const threading_cwraps: SigLine[] = WasmEnableThreads ? [ // when the method is assigned/cached at usage, instead of being invoked directly from cwraps, it can't be marked lazy, because it would be re-bound on each call const fn_signatures: SigLine[] = [ - [true, "mono_wasm_register_root", "number", ["pointer", "number", "string"]], + [true, "mono_wasm_register_root", "number", ["pointer", "pointer", "string"]], [true, "mono_wasm_deregister_root", null, ["pointer"]], [true, "mono_wasm_string_get_data_ref", null, ["pointer", "pointer", "pointer", "pointer"]], [true, "mono_wasm_set_is_debugger_attached", "void", ["bool"]], @@ -39,7 +39,7 @@ const fn_signatures: SigLine[] = [ [true, "mono_wasm_send_dbg_command_with_parms", "bool", ["number", "number", "number", "pointer", "number", "number", "string"]], [true, "mono_wasm_setenv", null, ["string", "string"]], [true, "mono_wasm_parse_runtime_options", null, ["number", "pointer"]], - [true, "mono_wasm_strdup", "number", ["string"]], + [true, "mono_wasm_strdup", "pointer", ["string"]], [true, "mono_background_exec", null, []], [true, "mono_wasm_ds_exec", null, []], [true, "mono_wasm_execute_timer", null, []], @@ -64,15 +64,15 @@ const fn_signatures: SigLine[] = [ [() => !runtimeHelpers.emscriptenBuildOptions.enableLogProfiler, "mono_wasm_profiler_init_log", "void", ["string"]], [false, "mono_wasm_exec_regression", "number", ["number", "string"]], [false, "mono_wasm_invoke_jsexport", "void", ["pointer", "pointer"]], - [true, "mono_wasm_write_managed_pointer_unsafe", "void", ["number", "number"]], + [true, "mono_wasm_write_managed_pointer_unsafe", "void", ["pointer", "pointer"]], [true, "mono_wasm_copy_managed_pointer", "void", ["pointer", "pointer"]], [true, "mono_wasm_i52_to_f64", "number", ["pointer", "pointer"]], [true, "mono_wasm_u52_to_f64", "number", ["pointer", "pointer"]], - [true, "mono_wasm_f64_to_i52", "number", ["pointer", "pointer"]], - [true, "mono_wasm_f64_to_u52", "number", ["pointer", "pointer"]], - [true, "mono_wasm_method_get_name", "pointer", ["pointer"]], - [true, "mono_wasm_method_get_name_ex", "pointer", ["pointer"]], - [true, "mono_wasm_method_get_full_name", "pointer", ["pointer"]], + [true, "mono_wasm_f64_to_i52", "number", ["pointer", "number"]], + [true, "mono_wasm_f64_to_u52", "number", ["pointer", "number"]], + [true, "mono_wasm_method_get_name", "string", ["pointer"]], + [true, "mono_wasm_method_get_name_ex", "string", ["pointer"]], + [true, "mono_wasm_method_get_full_name", "string", ["pointer"]], [true, "mono_wasm_gc_lock", "void", []], [true, "mono_wasm_gc_unlock", "void", []], [true, "mono_wasm_get_i32_unaligned", "number", ["pointer"]], @@ -165,7 +165,7 @@ export interface t_Cwraps { mono_wasm_send_dbg_command(id: number, command_set: number, command: number, data: VoidPtr, size: number): boolean; mono_wasm_send_dbg_command_with_parms(id: number, command_set: number, command: number, data: VoidPtr, size: number, valtype: number, newvalue: string): boolean; mono_wasm_setenv(name: string, value: string): void; - mono_wasm_strdup(value: string): number; + mono_wasm_strdup(value: string): VoidPtr; mono_wasm_parse_runtime_options(length: number, argv: VoidPtr): void; mono_background_exec(): void; mono_wasm_ds_exec(): void; diff --git a/src/mono/browser/runtime/dotnet.d.ts b/src/mono/browser/runtime/dotnet.d.ts index 0cd2872d719113..b8f72137c81be9 100644 --- a/src/mono/browser/runtime/dotnet.d.ts +++ b/src/mono/browser/runtime/dotnet.d.ts @@ -26,6 +26,7 @@ declare interface EmscriptenModule { ccall(ident: string, returnType?: string | null, argTypes?: string[], args?: any[], opts?: any): T; cwrap(ident: string, returnType: string, argTypes?: string[], opts?: any): T; cwrap(ident: string, ...args: any[]): T; + setValue(ptr: VoidPtr, value: VoidPtr, type: string, noSafe?: number | boolean): void; setValue(ptr: VoidPtr, value: number, type: string, noSafe?: number | boolean): void; setValue(ptr: Int32Ptr, value: number, type: string, noSafe?: number | boolean): void; getValue(ptr: number, type: string, noSafe?: number | boolean): number; diff --git a/src/mono/browser/runtime/driver.c b/src/mono/browser/runtime/driver.c index 612f639e62243a..0ff389ee1e7f1e 100644 --- a/src/mono/browser/runtime/driver.c +++ b/src/mono/browser/runtime/driver.c @@ -37,6 +37,14 @@ #include "runtime.h" #include "gc-common.h" +#ifndef MH_LOG +#define MH_LOG(msg, ...) { \ + printf("MH_NATIVE_LOG: %s : %s | %d :: ", __func__, __FILE__, __LINE__); \ + printf((msg), ##__VA_ARGS__); \ + printf("\n"); \ + fflush(stdout); \ +} +#endif void bindings_initialize_internals (); @@ -420,6 +428,7 @@ mono_wasm_set_main_args (int argc, char* argv[]) EMSCRIPTEN_KEEPALIVE d_handle mono_wasm_strdup (const char *s) { + MH_LOG("duplicating %s", s); return (d_handle)strdup (s); } From ff389a0d7fe1215be4f80c844f18d382a904ac15 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 18 Jun 2025 08:20:34 +0100 Subject: [PATCH 071/209] Move do_icall into separate file Moves do_icall into its own file - this seems to help with generating useable debug browser symbols Enables the TEST_ICALL_SYMBOL_MAP define for testing purposes. --- src/mono/mono/metadata/icall-table.c | 2 +- src/mono/mono/metadata/mh_log.h | 23 +++- src/mono/mono/mini/CMakeLists.txt | 2 + src/mono/mono/mini/interp/interp-icalls.c | 103 +++++++++++++++++ src/mono/mono/mini/interp/interp-icalls.h | 12 ++ src/mono/mono/mini/interp/interp.c | 128 +++++++--------------- 6 files changed, 176 insertions(+), 94 deletions(-) create mode 100644 src/mono/mono/mini/interp/interp-icalls.c create mode 100644 src/mono/mono/mini/interp/interp-icalls.h diff --git a/src/mono/mono/metadata/icall-table.c b/src/mono/mono/metadata/icall-table.c index b864900037d3cb..33224aeb9c5b0f 100644 --- a/src/mono/mono/metadata/icall-table.c +++ b/src/mono/mono/metadata/icall-table.c @@ -45,7 +45,7 @@ #define HANDLES_REUSE_WRAPPER HANDLES #define MONO_HANDLE_REGISTER_ICALL(...) /* nothing */ -//#define TEST_ICALL_SYMBOL_MAP 1 +#define TEST_ICALL_SYMBOL_MAP 1 // Generate Icall_ constants enum { diff --git a/src/mono/mono/metadata/mh_log.h b/src/mono/mono/metadata/mh_log.h index 735a3674aa1047..0b7feb19a19eb7 100644 --- a/src/mono/mono/metadata/mh_log.h +++ b/src/mono/mono/metadata/mh_log.h @@ -1,14 +1,25 @@ -#ifndef MH_LOG_HEADER_ -#define MH_LOG_HEADER_ - +#pragma once #include +#pragma message("Defining MH_LOG") + +static int MH_LOG_indent_level = 0; #define MH_LOG(msg, ...) { \ - printf("MH_NATIVE_LOG: File %s | Line %d :: ", __FILE__, __LINE__); \ - printf((msg), ##__VA_ARGS__); \ + printf("MH_NATIVE_LOG: "); \ + for (int i = 0; i < MH_LOG_indent_level; i++) { \ + printf(" "); \ + } \ + printf("%s : %s | %d :: ", __func__, __FILE__, __LINE__); \ + printf(msg, ##__VA_ARGS__); \ printf("\n"); \ fflush(stdout); \ } -#endif +#define MH_LOG_INDENT() { \ + MH_LOG_indent_level++; \ +} + +#define MH_LOG_UNINDENT() { \ + MH_LOG_indent_level--; \ +} diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index 93bab622667a70..d2b9177996ffeb 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -239,6 +239,8 @@ set(interp_sources interp/interp.c interp/interp-intrins.h interp/interp-intrins.c + interp/interp-icalls.h + interp/interp-icalls.c interp/mintops.h interp/mintops.c interp/transform.c diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c new file mode 100644 index 00000000000000..f1d96bd4f295f4 --- /dev/null +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -0,0 +1,103 @@ +#include "interp-icalls.h" +void +do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval *sp, gpointer ptr, gboolean save_last_error) +{ + if (save_last_error) + mono_marshal_clear_last_error (); + log_op(op); + switch (op) { + case MINT_ICALLSIG_V_V: { + typedef void (*T)(void); + T func = (T)ptr; + func (); + break; + } + case MINT_ICALLSIG_V_P: { + typedef gpointer (*T)(void); + T func = (T)ptr; + ret_sp->data.p = func (); + break; + } + case MINT_ICALLSIG_P_V: { + typedef void (*T)(gpointer); + T func = (T)ptr; + func (sp [0].data.p); + break; + } + case MINT_ICALLSIG_P_P: { + typedef gpointer (*T)(gpointer); + T func = (T)ptr; + ret_sp->data.p = func (sp [0].data.p); + break; + } + case MINT_ICALLSIG_PP_V: { + typedef void (*T)(gpointer,gpointer); + T func = (T)ptr; + func (sp [0].data.p, sp [1].data.p); + break; + } + case MINT_ICALLSIG_PP_P: { + typedef gpointer (*T)(gpointer,gpointer); + T func = (T)ptr; + ret_sp->data.p = func (sp [0].data.p, sp [1].data.p); + break; + } + case MINT_ICALLSIG_PPP_V: { + typedef void (*T)(gpointer,gpointer,gpointer); + T func = (T)ptr; + func (sp [0].data.p, sp [1].data.p, sp [2].data.p); + break; + } + case MINT_ICALLSIG_PPP_P: { + typedef gpointer (*T)(gpointer,gpointer,gpointer); + T func = (T)ptr; + ret_sp->data.p = func (sp [0].data.p, sp [1].data.p, sp [2].data.p); + break; + } + case MINT_ICALLSIG_PPPP_V: { + typedef void (*T)(gpointer,gpointer,gpointer,gpointer); + T func = (T)ptr; + func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p); + break; + } + case MINT_ICALLSIG_PPPP_P: { + typedef gpointer (*T)(gpointer,gpointer,gpointer,gpointer); + T func = (T)ptr; + ret_sp->data.p = func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p); + break; + } + case MINT_ICALLSIG_PPPPP_V: { + typedef void (*T)(gpointer,gpointer,gpointer,gpointer,gpointer); + T func = (T)ptr; + func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p, sp [4].data.p); + break; + } + case MINT_ICALLSIG_PPPPP_P: { + typedef gpointer (*T)(gpointer,gpointer,gpointer,gpointer,gpointer); + T func = (T)ptr; + ret_sp->data.p = func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p, sp [4].data.p); + break; + } + case MINT_ICALLSIG_PPPPPP_V: { + typedef void (*T)(gpointer,gpointer,gpointer,gpointer,gpointer,gpointer); + T func = (T)ptr; + func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p, sp [4].data.p, sp [5].data.p); + break; + } + case MINT_ICALLSIG_PPPPPP_P: { + typedef gpointer (*T)(gpointer,gpointer,gpointer,gpointer,gpointer,gpointer); + T func = (T)ptr; + ret_sp->data.p = func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p, sp [4].data.p, sp [5].data.p); + break; + } + default: + g_assert_not_reached (); + } + + if (save_last_error) + mono_marshal_set_last_error (); + + /* convert the native representation to the stackval representation */ + if (sig) + stackval_from_data (sig->ret, ret_sp, (char*) &ret_sp->data.p, sig->pinvoke && !sig->marshalling_disabled); +} diff --git a/src/mono/mono/mini/interp/interp-icalls.h b/src/mono/mono/mini/interp/interp-icalls.h new file mode 100644 index 00000000000000..11df37a0ece941 --- /dev/null +++ b/src/mono/mono/mini/interp/interp-icalls.h @@ -0,0 +1,12 @@ +#ifndef __MONO_MINI_INTERP_ICALLS_H__ +#define __MONO_MINI_INTERP_ICALLS_H__ + +#include +#include +#include "mintSigs.h" +#include "interp-internals.h" +#include "interp-enum-codecs.h" + +extern void do_icall(MonoMethodSignature * sig, MintICallSig op, stackval * ret_sp, stackval * sp, gpointer ptr, gboolean save_last_error); + +#endif diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index e37a23dcc96ad1..5de29bd7053f19 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -64,6 +64,7 @@ #include "interp-internals.h" #include "mintops.h" #include "interp-intrins.h" +#include "interp-icalls.h" #include "tiering.h" #ifdef INTERP_ENABLE_SIMD @@ -94,6 +95,8 @@ #include #endif +#include + /* Arguments that are passed when invoking only a finally/filter clause from the frame */ struct FrameClauseArgs { /* Where we start the frame execution from */ @@ -2348,120 +2351,70 @@ interp_entry (InterpEntryData *data) stackval_to_data (type, frame.stack, data->res, FALSE); } -static void -do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval *sp, gpointer ptr, gboolean save_last_error) +static void log_op(MintICallSig op) { - if (save_last_error) - mono_marshal_clear_last_error (); - - switch (op) { - case MINT_ICALLSIG_V_V: { - typedef void (*T)(void); - T func = (T)ptr; - func (); + switch(op) { + case MINT_ICALLSIG_V_V: + MH_LOG("MINT_ICALLSIG_V_V"); break; - } - case MINT_ICALLSIG_V_P: { - typedef gpointer (*T)(void); - T func = (T)ptr; - ret_sp->data.p = func (); + case MINT_ICALLSIG_V_P: + MH_LOG("MINT_ICALLSIG_V_P"); break; - } - case MINT_ICALLSIG_P_V: { - typedef void (*T)(gpointer); - T func = (T)ptr; - func (sp [0].data.p); + case MINT_ICALLSIG_P_V: + MH_LOG("MINT_ICALLSIG_P_V"); break; - } - case MINT_ICALLSIG_P_P: { - typedef gpointer (*T)(gpointer); - T func = (T)ptr; - ret_sp->data.p = func (sp [0].data.p); + case MINT_ICALLSIG_P_P: + MH_LOG("MINT_ICALLSIG_P_P"); break; - } - case MINT_ICALLSIG_PP_V: { - typedef void (*T)(gpointer,gpointer); - T func = (T)ptr; - func (sp [0].data.p, sp [1].data.p); + case MINT_ICALLSIG_PP_V: + MH_LOG("MINT_ICALLSIG_PP_V"); break; - } - case MINT_ICALLSIG_PP_P: { - typedef gpointer (*T)(gpointer,gpointer); - T func = (T)ptr; - ret_sp->data.p = func (sp [0].data.p, sp [1].data.p); + case MINT_ICALLSIG_PP_P: + MH_LOG("MINT_ICALLSIG_PP_P"); break; - } - case MINT_ICALLSIG_PPP_V: { - typedef void (*T)(gpointer,gpointer,gpointer); - T func = (T)ptr; - func (sp [0].data.p, sp [1].data.p, sp [2].data.p); + case MINT_ICALLSIG_PPP_V: + MH_LOG("MINT_ICALLSIG_PPP_V"); break; - } - case MINT_ICALLSIG_PPP_P: { - typedef gpointer (*T)(gpointer,gpointer,gpointer); - T func = (T)ptr; - ret_sp->data.p = func (sp [0].data.p, sp [1].data.p, sp [2].data.p); + case MINT_ICALLSIG_PPP_P: + MH_LOG("MINT_ICALLSIG_PPP_P"); break; - } - case MINT_ICALLSIG_PPPP_V: { - typedef void (*T)(gpointer,gpointer,gpointer,gpointer); - T func = (T)ptr; - func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p); + case MINT_ICALLSIG_PPPP_V: + MH_LOG("MINT_ICALLSIG_PPPP_V"); break; - } - case MINT_ICALLSIG_PPPP_P: { - typedef gpointer (*T)(gpointer,gpointer,gpointer,gpointer); - T func = (T)ptr; - ret_sp->data.p = func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p); + case MINT_ICALLSIG_PPPP_P: + MH_LOG("MINT_ICALLSIG_PPPP_P"); break; - } - case MINT_ICALLSIG_PPPPP_V: { - typedef void (*T)(gpointer,gpointer,gpointer,gpointer,gpointer); - T func = (T)ptr; - func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p, sp [4].data.p); + case MINT_ICALLSIG_PPPPP_V: + MH_LOG("MINT_ICALLSIG_PPPPP_V"); break; - } - case MINT_ICALLSIG_PPPPP_P: { - typedef gpointer (*T)(gpointer,gpointer,gpointer,gpointer,gpointer); - T func = (T)ptr; - ret_sp->data.p = func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p, sp [4].data.p); + case MINT_ICALLSIG_PPPPP_P: + MH_LOG("MINT_ICALLSIG_PPPPP_P"); break; - } - case MINT_ICALLSIG_PPPPPP_V: { - typedef void (*T)(gpointer,gpointer,gpointer,gpointer,gpointer,gpointer); - T func = (T)ptr; - func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p, sp [4].data.p, sp [5].data.p); + case MINT_ICALLSIG_PPPPPP_V: + MH_LOG("MINT_ICALLSIG_PPPPPP_V"); break; - } - case MINT_ICALLSIG_PPPPPP_P: { - typedef gpointer (*T)(gpointer,gpointer,gpointer,gpointer,gpointer,gpointer); - T func = (T)ptr; - ret_sp->data.p = func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p, sp [4].data.p, sp [5].data.p); + case MINT_ICALLSIG_PPPPPP_P: + MH_LOG("MINT_ICALLSIG_PPPPPP_P"); break; - } default: - g_assert_not_reached (); + MH_LOG("Unknown MintICallSig: %d", op); + break; } - - if (save_last_error) - mono_marshal_set_last_error (); - - /* convert the native representation to the stackval representation */ - if (sig) - stackval_from_data (sig->ret, ret_sp, (char*) &ret_sp->data.p, sig->pinvoke && !sig->marshalling_disabled); } /* MONO_NO_OPTIMIZATION is needed due to usage of INTERP_PUSH_LMF_WITH_CTX. */ #ifdef _MSC_VER #pragma optimize ("", off) -#endif +#endif + // Do not inline in case order of frame addresses matters, and maybe other reasons. static MONO_NO_OPTIMIZATION MONO_NEVER_INLINE gpointer do_icall_wrapper (InterpFrame *frame, MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval *sp, gpointer ptr, gboolean save_last_error, gboolean *gc_transitions) { MonoLMFExt ext; INTERP_PUSH_LMF_WITH_CTX (frame, ext, exit_icall); - + MH_LOG_INDENT(); + MH_LOG("calling do_icall for %s", mono_method_full_name (frame->imethod->method, TRUE)); if (*gc_transitions) { MONO_ENTER_GC_SAFE; do_icall (sig, op, ret_sp, sp, ptr, save_last_error); @@ -2470,7 +2423,7 @@ do_icall_wrapper (InterpFrame *frame, MonoMethodSignature *sig, MintICallSig op, } else { do_icall (sig, op, ret_sp, sp, ptr, save_last_error); } - + MH_LOG_UNINDENT(); interp_pop_lmf (&ext); goto exit_icall; // prevent unused label warning in some configurations @@ -3686,6 +3639,7 @@ mono_interp_leave (InterpFrame* parent_frame) * to check the abort threshold. For this to work we use frame as a * dummy frame that is stored in the lmf and serves as the transition frame */ + do_icall_wrapper (&frame, NULL, MINT_ICALLSIG_V_P, &tmp_sp, &tmp_sp, (gpointer)mono_thread_get_undeniable_exception, FALSE, &gc_transitions); return (MonoException*)tmp_sp.data.p; From 7449f5a1dec26775433068f47b1dbee1ecc51767 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 18 Jun 2025 16:46:38 +0100 Subject: [PATCH 072/209] Remove unnecessary logging --- src/mono/mono/metadata/appdomain.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mono/mono/metadata/appdomain.c b/src/mono/mono/metadata/appdomain.c index f29abe4596aa9d..e1b804273efbe3 100644 --- a/src/mono/mono/metadata/appdomain.c +++ b/src/mono/mono/metadata/appdomain.c @@ -150,8 +150,7 @@ mono_runtime_set_no_exec (gboolean val) */ gboolean mono_runtime_get_no_exec (void) -{ - MH_LOG("inside mono_runtime_get_no_exec"); +{ return no_exec; } From 1c55b5f48ad9fd1b514ed2a17e6e47d09423350d Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 18 Jun 2025 16:47:38 +0100 Subject: [PATCH 073/209] Move do_icall into a separate file This helps with generating debug info. Add logging for diagnostics, targetted signature extensions --- src/mono/mono/mini/interp/interp-icalls.c | 327 +++++++++++++++++++++- src/mono/mono/mini/interp/interp-icalls.h | 5 +- src/mono/mono/mini/interp/interp.c | 149 +--------- 3 files changed, 331 insertions(+), 150 deletions(-) diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index f1d96bd4f295f4..6b548a0cf34f53 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -1,10 +1,256 @@ #include "interp-icalls.h" +#include +#include + +typedef gint32 I4; +typedef gpointer I8; + +gboolean is_scalar_vtype(MonoType* tp); + +static gboolean +interp_type_as_ptr4 (MonoType *tp) +{ + if(sizeof(gpointer) == 4) + { + if (MONO_TYPE_IS_POINTER (tp)) + return TRUE; + if (MONO_TYPE_IS_REFERENCE (tp)) + return TRUE; + } + if ((tp)->type == MONO_TYPE_I4) + return TRUE; + if ((tp)->type == MONO_TYPE_BOOLEAN) + return TRUE; + if ((tp)->type == MONO_TYPE_CHAR) + return TRUE; + if ((tp)->type == MONO_TYPE_VALUETYPE && m_class_is_enumtype (m_type_data_get_klass_unchecked (tp))) + return TRUE; + if (is_scalar_vtype (tp)) + return TRUE; + return FALSE; +} + +static gboolean +interp_type_as_ptr8 (MonoType *tp) +{ + if(sizeof(gpointer) != 8) + { + return false; + } + if (MONO_TYPE_IS_POINTER (tp)) + return TRUE; + if (MONO_TYPE_IS_REFERENCE (tp)) + return TRUE; + if ((tp)->type == MONO_TYPE_I8 || (tp)->type == MONO_TYPE_U8) + return TRUE; + if ((tp)->type == MONO_TYPE_R8) + return TRUE; + + return FALSE; +} + +static gboolean +interp_type_as_ptr(MonoType *tp) +{ + return (interp_type_as_ptr4(tp) || interp_type_as_ptr8(tp)); +} +/* is_scalar_vtype taken from transform.c */ +gboolean +is_scalar_vtype (MonoType *type) +{ + MonoClass *klass; + MonoClassField *field; + gpointer iter; + + if (!MONO_TYPE_ISSTRUCT (type)) + return FALSE; + klass = mono_class_from_mono_type_internal (type); + mono_class_init_internal (klass); + + int size = mono_class_value_size (klass, NULL); + if (size == 0 || size > SIZEOF_VOID_P) + return FALSE; + + iter = NULL; + int nfields = 0; + field = NULL; + while ((field = mono_class_get_fields_internal (klass, &iter))) { + if (field->type->attrs & FIELD_ATTRIBUTE_STATIC) + continue; + nfields ++; + if (nfields > 1) + return FALSE; + MonoType *t = mini_get_underlying_type (field->type); + if (!interp_type_as_ptr (t)) + return FALSE; + } + + return TRUE; +} +void +stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean pinvoke) +{ + MH_LOG_INDENT(); + MH_LOG("Converting data to stackval for type %s", mono_type_get_name (type)); + if (m_type_is_byref (type)) { + result->data.p = *(gpointer*)data; + return; + } + switch (type->type) { + case MONO_TYPE_VOID: + break;; + case MONO_TYPE_I1: + result->data.i = *(gint8*)data; + break; + case MONO_TYPE_U1: + case MONO_TYPE_BOOLEAN: + result->data.i = *(guint8*)data; + break; + case MONO_TYPE_I2: + result->data.i = *(gint16*)data; + break; + case MONO_TYPE_U2: + case MONO_TYPE_CHAR: + result->data.i = *(guint16*)data; + break; + case MONO_TYPE_I4: + result->data.i = *(gint32*)data; + break; + case MONO_TYPE_U: + case MONO_TYPE_I: + result->data.nati = *(mono_i*)data; + break; + case MONO_TYPE_PTR: + case MONO_TYPE_FNPTR: + result->data.p = *(gpointer*)data; + break; + case MONO_TYPE_U4: + result->data.i = *(guint32*)data; + break; + case MONO_TYPE_R4: + /* memmove handles unaligned case */ + memmove (&result->data.f_r4, data, sizeof (float)); + break; + case MONO_TYPE_I8: + case MONO_TYPE_U8: + memmove (&result->data.l, data, sizeof (gint64)); + break; + case MONO_TYPE_R8: + memmove (&result->data.f, data, sizeof (double)); + break; + case MONO_TYPE_STRING: + case MONO_TYPE_SZARRAY: + case MONO_TYPE_CLASS: + case MONO_TYPE_OBJECT: + case MONO_TYPE_ARRAY: + result->data.p = *(gpointer*)data; + break; + case MONO_TYPE_VALUETYPE: + if (m_class_is_enumtype (m_type_data_get_klass_unchecked (type))) { + stackval_from_data (mono_class_enum_basetype_internal (m_type_data_get_klass_unchecked (type)), result, data, pinvoke); + break; + } else { + int size; + if (pinvoke) + size = mono_class_native_size (m_type_data_get_klass_unchecked (type), NULL); + else + size = mono_class_value_size (m_type_data_get_klass_unchecked (type), NULL); + memcpy (result, data, size); + break; + } + case MONO_TYPE_GENERICINST: { + if (mono_type_generic_inst_is_valuetype (type)) { + MonoClass *klass = mono_class_from_mono_type_internal (type); + int size; + if (pinvoke) + size = mono_class_native_size (klass, NULL); + else + size = mono_class_value_size (klass, NULL); + memcpy (result, data, size); + break; + } + stackval_from_data (m_class_get_byval_arg (m_type_data_get_generic_class_unchecked (type)->container_class), result, data, pinvoke); + break; + } + default: + g_error ("got type 0x%02x", type->type); + } + MH_LOG("Converted data to stackval: %s", mono_type_get_name (type)); + MH_LOG_UNINDENT(); +} +static char * log_sig(MonoMethodSignature* sig) +{ + char buffer[256]; + int offset = 0; + for (int i = 0; i < sig->param_count; ++i) { + MonoType* tp = sig->params[i]; + if(tp) + offset += sprintf(buffer + offset, "%d", interp_type_as_ptr4(tp) ? 4 : interp_type_as_ptr8(tp) ? 8 : 0); + else + offset += sprintf(buffer + offset, "E"); + } + offset += sprintf(buffer + offset, "_%s", sig->ret->type == MONO_TYPE_VOID ? "V" : (interp_type_as_ptr4(sig->ret) ? "4" : "8")); + MH_LOG("Signature: %s", buffer); + return strdup(buffer); +} +static void log_op(MintICallSig op) +{ + switch(op) { + case MINT_ICALLSIG_V_V: + MH_LOG("MINT_ICALLSIG_V_V"); + break; + case MINT_ICALLSIG_V_P: + MH_LOG("MINT_ICALLSIG_V_P"); + break; + case MINT_ICALLSIG_P_V: + MH_LOG("MINT_ICALLSIG_P_V"); + break; + case MINT_ICALLSIG_P_P: + MH_LOG("MINT_ICALLSIG_P_P"); + break; + case MINT_ICALLSIG_PP_V: + MH_LOG("MINT_ICALLSIG_PP_V"); + break; + case MINT_ICALLSIG_PP_P: + MH_LOG("MINT_ICALLSIG_PP_P"); + break; + case MINT_ICALLSIG_PPP_V: + MH_LOG("MINT_ICALLSIG_PPP_V"); + break; + case MINT_ICALLSIG_PPP_P: + MH_LOG("MINT_ICALLSIG_PPP_P"); + break; + case MINT_ICALLSIG_PPPP_V: + MH_LOG("MINT_ICALLSIG_PPPP_V"); + break; + case MINT_ICALLSIG_PPPP_P: + MH_LOG("MINT_ICALLSIG_PPPP_P"); + break; + case MINT_ICALLSIG_PPPPP_V: + MH_LOG("MINT_ICALLSIG_PPPPP_V"); + break; + case MINT_ICALLSIG_PPPPP_P: + MH_LOG("MINT_ICALLSIG_PPPPP_P"); + break; + case MINT_ICALLSIG_PPPPPP_V: + MH_LOG("MINT_ICALLSIG_PPPPPP_V"); + break; + case MINT_ICALLSIG_PPPPPP_P: + MH_LOG("MINT_ICALLSIG_PPPPPP_P"); + break; + default: + MH_LOG("Unknown MintICallSig: %d", op); + break; + } +} void do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval *sp, gpointer ptr, gboolean save_last_error) { + MH_LOG_INDENT(); if (save_last_error) mono_marshal_clear_last_error (); log_op(op); + char* sigTest = log_sig(sig); switch (op) { case MINT_ICALLSIG_V_V: { typedef void (*T)(void); @@ -13,9 +259,19 @@ do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval break; } case MINT_ICALLSIG_V_P: { - typedef gpointer (*T)(void); - T func = (T)ptr; - ret_sp->data.p = func (); + if (interp_type_as_ptr4(sig->ret)) + { + typedef I4 (*T)(void); + T func = (T)ptr; + ret_sp->data.i = func (); // note return directly into .i field (union) + } + else + { + typedef I8 (*T)(void); + T func = (T)ptr; + ret_sp->data.p = func (); + } + break; } case MINT_ICALLSIG_P_V: { @@ -37,14 +293,68 @@ do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval break; } case MINT_ICALLSIG_PP_P: { - typedef gpointer (*T)(gpointer,gpointer); - T func = (T)ptr; - ret_sp->data.p = func (sp [0].data.p, sp [1].data.p); + if(interp_type_as_ptr4(sig->ret)) + { + if (interp_type_as_ptr4(sig->params[0]) && interp_type_as_ptr4(sig->params[1])) + { + typedef I4 (*T)(I4, I4); + T func = (T)ptr; + ret_sp->data.i = func (sp [0].data.i, sp [1].data.i); + } + else if (interp_type_as_ptr4(sig->params[0])) + { + typedef I4 (*T)(I4, I8); + T func = (T)ptr; + ret_sp->data.i = func (sp [0].data.i, sp [1].data.p); + } + else if (interp_type_as_ptr4(sig->params[1])) + { + typedef I4 (*T)(I8, I4); + T func = (T)ptr; + ret_sp->data.i = func (sp [0].data.p, sp [1].data.i); + } + else + { + typedef I4 (*T)(I8, I8); + T func = (T)ptr; + ret_sp->data.i = func (sp [0].data.p, sp [1].data.p); + } + } + else + { + if (interp_type_as_ptr4(sig->params[0]) && interp_type_as_ptr4(sig->params[1])) + { + typedef gpointer (*T)(I4, I4); + T func = (T)ptr; + ret_sp->data.p = func (sp [0].data.i, sp [1].data.i); + } + else if (interp_type_as_ptr4(sig->params[0])) + { + typedef gpointer (*T)(I4, I8); + T func = (T)ptr; + ret_sp->data.p = func (sp [0].data.i, sp [1].data.p); + } + else if (interp_type_as_ptr4(sig->params[1])) + { + typedef gpointer (*T)(I8, I4); + T func = (T)ptr; + ret_sp->data.p = func (sp [0].data.p, sp [1].data.i); + } + else + { + typedef gpointer (*T)(I8, I8); + T func = (T)ptr; + ret_sp->data.p = func (sp [0].data.p, sp [1].data.p); + } + } + break; } case MINT_ICALLSIG_PPP_V: { typedef void (*T)(gpointer,gpointer,gpointer); T func = (T)ptr; + MH_LOG("Param count is %d, ptr is %p", sig->param_count, ptr); + func (sp [0].data.p, sp [1].data.p, sp [2].data.p); break; } @@ -100,4 +410,9 @@ do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval /* convert the native representation to the stackval representation */ if (sig) stackval_from_data (sig->ret, ret_sp, (char*) &ret_sp->data.p, sig->pinvoke && !sig->marshalling_disabled); + if(sigTest) + free(sigTest); + MH_LOG("Returning from do_icall with ret_sp: %p", ret_sp->data.p); + MH_LOG_UNINDENT(); } + diff --git a/src/mono/mono/mini/interp/interp-icalls.h b/src/mono/mono/mini/interp/interp-icalls.h index 11df37a0ece941..7bf286a3590977 100644 --- a/src/mono/mono/mini/interp/interp-icalls.h +++ b/src/mono/mono/mini/interp/interp-icalls.h @@ -3,10 +3,9 @@ #include #include -#include "mintSigs.h" +#include "mintops.h" #include "interp-internals.h" -#include "interp-enum-codecs.h" - +extern void stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean pinvoke); extern void do_icall(MonoMethodSignature * sig, MintICallSig op, stackval * ret_sp, stackval * sp, gpointer ptr, gboolean save_last_error); #endif diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index 5de29bd7053f19..be13660cd6906e 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -789,93 +789,7 @@ get_virtual_method_fast (InterpMethod *imethod, MonoVTable *vtable, int offset) } } -static void -stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean pinvoke) -{ - if (m_type_is_byref (type)) { - result->data.p = *(gpointer*)data; - return; - } - switch (type->type) { - case MONO_TYPE_VOID: - break;; - case MONO_TYPE_I1: - result->data.i = *(gint8*)data; - break; - case MONO_TYPE_U1: - case MONO_TYPE_BOOLEAN: - result->data.i = *(guint8*)data; - break; - case MONO_TYPE_I2: - result->data.i = *(gint16*)data; - break; - case MONO_TYPE_U2: - case MONO_TYPE_CHAR: - result->data.i = *(guint16*)data; - break; - case MONO_TYPE_I4: - result->data.i = *(gint32*)data; - break; - case MONO_TYPE_U: - case MONO_TYPE_I: - result->data.nati = *(mono_i*)data; - break; - case MONO_TYPE_PTR: - case MONO_TYPE_FNPTR: - result->data.p = *(gpointer*)data; - break; - case MONO_TYPE_U4: - result->data.i = *(guint32*)data; - break; - case MONO_TYPE_R4: - /* memmove handles unaligned case */ - memmove (&result->data.f_r4, data, sizeof (float)); - break; - case MONO_TYPE_I8: - case MONO_TYPE_U8: - memmove (&result->data.l, data, sizeof (gint64)); - break; - case MONO_TYPE_R8: - memmove (&result->data.f, data, sizeof (double)); - break; - case MONO_TYPE_STRING: - case MONO_TYPE_SZARRAY: - case MONO_TYPE_CLASS: - case MONO_TYPE_OBJECT: - case MONO_TYPE_ARRAY: - result->data.p = *(gpointer*)data; - break; - case MONO_TYPE_VALUETYPE: - if (m_class_is_enumtype (m_type_data_get_klass_unchecked (type))) { - stackval_from_data (mono_class_enum_basetype_internal (m_type_data_get_klass_unchecked (type)), result, data, pinvoke); - break; - } else { - int size; - if (pinvoke) - size = mono_class_native_size (m_type_data_get_klass_unchecked (type), NULL); - else - size = mono_class_value_size (m_type_data_get_klass_unchecked (type), NULL); - memcpy (result, data, size); - break; - } - case MONO_TYPE_GENERICINST: { - if (mono_type_generic_inst_is_valuetype (type)) { - MonoClass *klass = mono_class_from_mono_type_internal (type); - int size; - if (pinvoke) - size = mono_class_native_size (klass, NULL); - else - size = mono_class_value_size (klass, NULL); - memcpy (result, data, size); - break; - } - stackval_from_data (m_class_get_byval_arg (m_type_data_get_generic_class_unchecked (type)->container_class), result, data, pinvoke); - break; - } - default: - g_error ("got type 0x%02x", type->type); - } -} + static int stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) @@ -2218,11 +2132,12 @@ interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject // method is transformed. context->stack_pointer = (guchar*)(sp + 4); g_assert (context->stack_pointer < context->stack_end); - + MH_LOG_INDENT(); + MH_LOG("calling mono_interp_exec_method for %s : %s", method->name, mono_method_full_name (method, TRUE)); MONO_ENTER_GC_UNSAFE; mono_interp_exec_method (&frame, context, NULL); MONO_EXIT_GC_UNSAFE; - + MH_LOG_UNINDENT(); context->stack_pointer = (guchar*)sp; if (context->has_resume_state) { @@ -2351,56 +2266,6 @@ interp_entry (InterpEntryData *data) stackval_to_data (type, frame.stack, data->res, FALSE); } -static void log_op(MintICallSig op) -{ - switch(op) { - case MINT_ICALLSIG_V_V: - MH_LOG("MINT_ICALLSIG_V_V"); - break; - case MINT_ICALLSIG_V_P: - MH_LOG("MINT_ICALLSIG_V_P"); - break; - case MINT_ICALLSIG_P_V: - MH_LOG("MINT_ICALLSIG_P_V"); - break; - case MINT_ICALLSIG_P_P: - MH_LOG("MINT_ICALLSIG_P_P"); - break; - case MINT_ICALLSIG_PP_V: - MH_LOG("MINT_ICALLSIG_PP_V"); - break; - case MINT_ICALLSIG_PP_P: - MH_LOG("MINT_ICALLSIG_PP_P"); - break; - case MINT_ICALLSIG_PPP_V: - MH_LOG("MINT_ICALLSIG_PPP_V"); - break; - case MINT_ICALLSIG_PPP_P: - MH_LOG("MINT_ICALLSIG_PPP_P"); - break; - case MINT_ICALLSIG_PPPP_V: - MH_LOG("MINT_ICALLSIG_PPPP_V"); - break; - case MINT_ICALLSIG_PPPP_P: - MH_LOG("MINT_ICALLSIG_PPPP_P"); - break; - case MINT_ICALLSIG_PPPPP_V: - MH_LOG("MINT_ICALLSIG_PPPPP_V"); - break; - case MINT_ICALLSIG_PPPPP_P: - MH_LOG("MINT_ICALLSIG_PPPPP_P"); - break; - case MINT_ICALLSIG_PPPPPP_V: - MH_LOG("MINT_ICALLSIG_PPPPPP_V"); - break; - case MINT_ICALLSIG_PPPPPP_P: - MH_LOG("MINT_ICALLSIG_PPPPPP_P"); - break; - default: - MH_LOG("Unknown MintICallSig: %d", op); - break; - } -} /* MONO_NO_OPTIMIZATION is needed due to usage of INTERP_PUSH_LMF_WITH_CTX. */ #ifdef _MSC_VER @@ -2414,7 +2279,7 @@ do_icall_wrapper (InterpFrame *frame, MonoMethodSignature *sig, MintICallSig op, MonoLMFExt ext; INTERP_PUSH_LMF_WITH_CTX (frame, ext, exit_icall); MH_LOG_INDENT(); - MH_LOG("calling do_icall for %s", mono_method_full_name (frame->imethod->method, TRUE)); + MH_LOG("calling do_icall for %s : %s", frame->imethod->method->name, mono_method_full_name (frame->imethod->method, TRUE)); if (*gc_transitions) { MONO_ENTER_GC_SAFE; do_icall (sig, op, ret_sp, sp, ptr, save_last_error); @@ -4299,8 +4164,10 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause gpointer *cache = (gpointer*)&frame->imethod->data_items [ip [7]]; /* for calls, have ip pointing at the start of next instruction */ frame->state.ip = ip + 8; + MH_LOG_INDENT(); + MH_LOG ("Calling native method %s with signature %s\n", mono_method_full_name (imethod->method, TRUE), mono_signature_full_name (csignature)); ves_pinvoke_method (imethod, csignature, (MonoFuncV)code, context, frame, (stackval*)(locals + ip [1]), (stackval*)(locals + ip [3]), save_last_error, cache, &gc_transitions); - + MH_LOG_UNINDENT(); EXCEPTION_CHECKPOINT; CHECK_RESUME_STATE (context); From 0442479ebe6f2f24755a174ffc59fa9185b9c0d8 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 19 Jun 2025 09:01:01 +0100 Subject: [PATCH 074/209] Copies of interp.c for refactoring --- src/mono/mono/mini/interp/interp-pinvoke.c | 9172 ++++++++++++++++++++ src/mono/mono/mini/interp/interp-pinvoke.h | 26 + 2 files changed, 9198 insertions(+) create mode 100644 src/mono/mono/mini/interp/interp-pinvoke.c create mode 100644 src/mono/mono/mini/interp/interp-pinvoke.h diff --git a/src/mono/mono/mini/interp/interp-pinvoke.c b/src/mono/mono/mini/interp/interp-pinvoke.c new file mode 100644 index 00000000000000..02a8c18993b329 --- /dev/null +++ b/src/mono/mono/mini/interp/interp-pinvoke.c @@ -0,0 +1,9172 @@ +/** + * \file + * + * interp.c: Interpreter for CIL byte codes + * + * Authors: + * Paolo Molaro (lupus@ximian.com) + * Miguel de Icaza (miguel@ximian.com) + * Dietmar Maurer (dietmar@ximian.com) + * + * (C) 2001, 2002 Ximian, Inc. + */ +#ifndef __USE_ISOC99 +#define __USE_ISOC99 +#endif +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_ALLOCA_H +# include +#else +# ifdef __CYGWIN__ +# define alloca __builtin_alloca +# endif +#endif + +/* trim excessive headers */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "interp.h" +#include "interp-internals.h" +#include "mintops.h" +#include "interp-intrins.h" +#include "interp-icalls.h" +#include "tiering.h" + +#ifdef INTERP_ENABLE_SIMD +#include "interp-simd.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#ifdef TARGET_ARM +#include +#endif +#include + +#include "interp-pgo.h" + +#ifdef HOST_BROWSER +#include "jiterpreter.h" +#include +#endif + +#include + +/* Arguments that are passed when invoking only a finally/filter clause from the frame */ +struct FrameClauseArgs { + /* Where we start the frame execution from */ + const guint16 *start_with_ip; + /* + * End ip of the exit_clause. We need it so we know whether the resume + * state is for this frame (which is called from EH) or for the original + * frame further down the stack. + */ + const guint16 *end_at_ip; + /* Frame that is executing this clause */ + InterpFrame *exec_frame; + gboolean run_until_end; +}; + +static MONO_NEVER_INLINE void +mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClauseArgs *clause_args); + +/* + * This code synchronizes with interp_mark_stack () using compiler memory barriers. + */ + +static FrameDataFragment* +frame_data_frag_new (int size) +{ + FrameDataFragment *frag = (FrameDataFragment*)g_malloc (size); + + frag->pos = (guint8*)&frag->data; + frag->end = (guint8*)frag + size; + frag->next = NULL; + return frag; +} + +static void +frame_data_frag_free (FrameDataFragment *frag) +{ + while (frag) { + FrameDataFragment *next = frag->next; + g_free (frag); + frag = next; + } +} + +static void +frame_data_allocator_init (FrameDataAllocator *stack, int size) +{ + FrameDataFragment *frag; + + frag = frame_data_frag_new (size); + stack->first = stack->current = frag; + stack->infos_capacity = 4; + stack->infos = (FrameDataInfo*)g_malloc (stack->infos_capacity * sizeof (FrameDataInfo)); +} + +static void +frame_data_allocator_free (FrameDataAllocator *stack) +{ + /* Assert to catch leaks */ + g_assert_checked (stack->current == stack->first && stack->current->pos == (guint8*)&stack->current->data); + frame_data_frag_free (stack->first); +} + +static FrameDataFragment* +frame_data_allocator_add_frag (FrameDataAllocator *stack, int size) +{ + FrameDataFragment *new_frag; + + // FIXME: + guint frag_size = 4096; + if (size + sizeof (FrameDataFragment) > frag_size) + frag_size = size + sizeof (FrameDataFragment); + new_frag = frame_data_frag_new (frag_size); + mono_compiler_barrier (); + stack->current->next = new_frag; + stack->current = new_frag; + return new_frag; +} + +static gpointer +frame_data_allocator_alloc (FrameDataAllocator *stack, InterpFrame *frame, int size) +{ + FrameDataFragment *current = stack->current; + gpointer res; + + int infos_len = stack->infos_len; + + if (!infos_len || (infos_len > 0 && stack->infos [infos_len - 1].frame != frame)) { + /* First allocation by this frame. Save the markers for restore */ + if (infos_len == stack->infos_capacity) { + stack->infos_capacity = infos_len * 2; + stack->infos = (FrameDataInfo*)g_realloc (stack->infos, stack->infos_capacity * sizeof (FrameDataInfo)); + } + stack->infos [infos_len].frame = frame; + stack->infos [infos_len].frag = current; + stack->infos [infos_len].pos = current->pos; + stack->infos_len++; + } + + if (G_LIKELY (current->pos + size <= current->end)) { + res = current->pos; + current->pos += size; + } else { + if (current->next && current->next->pos + size <= current->next->end) { + current = stack->current = current->next; + current->pos = (guint8*)¤t->data; + } else { + FrameDataFragment *tmp = current->next; + /* avoid linking to be freed fragments, so the GC can't trip over it */ + current->next = NULL; + mono_compiler_barrier (); + frame_data_frag_free (tmp); + + current = frame_data_allocator_add_frag (stack, size); + } + g_assert (current->pos + size <= current->end); + res = (gpointer)current->pos; + current->pos += size; + } + mono_compiler_barrier (); + return res; +} + +static void +frame_data_allocator_pop (FrameDataAllocator *stack, InterpFrame *frame) +{ + int infos_len = stack->infos_len; + + if (infos_len > 0 && stack->infos [infos_len - 1].frame == frame) { + infos_len--; + stack->current = stack->infos [infos_len].frag; + stack->current->pos = stack->infos [infos_len].pos; + stack->infos_len = infos_len; + } +} + +/* + * reinit_frame: + * + * Reinitialize a frame. + */ +static void +reinit_frame (InterpFrame *frame, InterpFrame *parent, InterpMethod *imethod, gpointer retval, gpointer stack) +{ + frame->parent = parent; + frame->imethod = imethod; + frame->stack = (stackval*)stack; + frame->retval = (stackval*)retval; + frame->state.ip = NULL; +} + +#define STACK_ADD_ALIGNED_BYTES(sp,bytes) ((stackval*)((char*)(sp) + (bytes))) +#define STACK_ADD_BYTES(sp,bytes) ((stackval*)((char*)(sp) + ALIGN_TO(bytes, MINT_STACK_SLOT_SIZE))) +#define STACK_SUB_BYTES(sp,bytes) ((stackval*)((char*)(sp) - ALIGN_TO(bytes, MINT_STACK_SLOT_SIZE))) + +/* + * List of classes whose methods will be executed by transitioning to JITted code. + * Used for testing. + */ +GSList *mono_interp_jit_classes; +/* Optimizations enabled with interpreter */ +int mono_interp_opt = INTERP_OPT_DEFAULT; +/* If TRUE, interpreted code will be interrupted at function entry/backward branches */ +static gboolean ss_enabled; + +static gboolean interp_init_done = FALSE; + +#ifdef HOST_WASI +static gboolean debugger_enabled = FALSE; +#endif + +static MonoException* do_transform_method (InterpMethod *imethod, InterpFrame *method, ThreadContext *context); + +typedef void (*ICallMethod) (InterpFrame *frame); + +static MonoNativeTlsKey thread_context_id; + +#define DEBUG_INTERP 0 +#define COUNT_OPS 0 + +#if DEBUG_INTERP +int mono_interp_traceopt = 2; +/* If true, then we output the opcodes as we interpret them */ +static int global_tracing = 2; + +static int debug_indent_level = 0; + +static int break_on_method = 0; +static int nested_trace = 0; +static GList *db_methods = NULL; +static char* dump_args (InterpFrame *inv); + +static void +output_indent (void) +{ + int h; + + for (h = 0; h < debug_indent_level; h++) + g_print (" "); +} + +static void +db_match_method (gpointer data, gpointer user_data) +{ + MonoMethod *m = (MonoMethod*)user_data; + MonoMethodDesc *desc = (MonoMethodDesc*)data; + + if (mono_method_desc_full_match (desc, m)) + break_on_method = 1; +} + +static void +debug_enter (InterpFrame *frame, int *tracing) +{ + if (db_methods) { + g_list_foreach (db_methods, db_match_method, (gpointer)frame->imethod->method); + if (break_on_method) + *tracing = nested_trace ? (global_tracing = 2, 3) : 2; + break_on_method = 0; + } + if (*tracing) { + MonoMethod *method = frame->imethod->method; + char *mn, *args = dump_args (frame); + debug_indent_level++; + output_indent (); + mn = mono_method_full_name (method, FALSE); + g_print ("(%p) Entering %s (", mono_thread_internal_current (), mn); + g_free (mn); + g_print ("%s)\n", args); + g_free (args); + } +} + +#define DEBUG_LEAVE() \ + if (tracing) { \ + char *mn, *args; \ + args = dump_retval (frame); \ + output_indent (); \ + mn = mono_method_full_name (frame->imethod->method, FALSE); \ + g_print ("(%p) Leaving %s", mono_thread_internal_current (), mn); \ + g_free (mn); \ + g_print (" => %s\n", args); \ + g_free (args); \ + debug_indent_level--; \ + if (tracing == 3) global_tracing = 0; \ + } + +#else + +int mono_interp_traceopt = 0; +#define DEBUG_LEAVE() + +#endif + +#if defined(__GNUC__) && !defined(TARGET_WASM) && !COUNT_OPS && !DEBUG_INTERP && !ENABLE_CHECKED_BUILD && !PROFILE_INTERP +#define USE_COMPUTED_GOTO 1 +#endif + +#if USE_COMPUTED_GOTO + +#define MINT_IN_DISPATCH(op) goto *in_labels [opcode = (MintOpcode)(op)] +#define MINT_IN_SWITCH(op) MINT_IN_DISPATCH (op); +#define MINT_IN_BREAK MINT_IN_DISPATCH (*ip) +#define MINT_IN_CASE(x) LAB_ ## x: + +#else + +#define MINT_IN_SWITCH(op) COUNT_OP(op); switch (opcode = (MintOpcode)(op)) +#define MINT_IN_CASE(x) case x: +#define MINT_IN_BREAK break + +#endif + +static void +clear_resume_state (ThreadContext *context) +{ + context->has_resume_state = 0; + context->handler_frame = NULL; + context->handler_ei = NULL; + g_assert (context->exc_gchandle); + mono_gchandle_free_internal (context->exc_gchandle); + context->exc_gchandle = 0; +} + +/* + * If this bit is set, it means the call has thrown the exception, and we + * reached this point because the EH code in mono_handle_exception () + * unwound all the JITted frames below us. mono_interp_set_resume_state () + * has set the fields in context to indicate where we have to resume execution. + */ +#define CHECK_RESUME_STATE(context) do { \ + if ((context)->has_resume_state) \ + goto resume; \ + } while (0) + +static void +set_context (ThreadContext *context) +{ + mono_native_tls_set_value (thread_context_id, context); + + if (!context) + return; + + MonoJitTlsData *jit_tls = mono_tls_get_jit_tls (); + g_assertf (jit_tls, "ThreadContext needs initialized JIT TLS"); + + /* jit_tls assumes ownership of 'context' */ + jit_tls->interp_context = context; +} + +static ThreadContext * +get_context (void) +{ + ThreadContext *context = (ThreadContext *) mono_native_tls_get_value (thread_context_id); + if (context == NULL) { + context = g_new0 (ThreadContext, 1); + context->stack_start = (guchar*)mono_valloc_aligned (INTERP_STACK_SIZE, MINT_STACK_ALIGNMENT, MONO_MMAP_READ | MONO_MMAP_WRITE, MONO_MEM_ACCOUNT_INTERP_STACK); + // A bit for every pointer sized slot in the stack. FIXME don't allocate whole bit array + if (mono_interp_opt & INTERP_OPT_PRECISE_GC) + context->no_ref_slots = (guchar*)mono_valloc (NULL, INTERP_STACK_SIZE / (8 * sizeof (gpointer)), MONO_MMAP_READ | MONO_MMAP_WRITE, MONO_MEM_ACCOUNT_INTERP_STACK); + context->stack_end = context->stack_start + INTERP_STACK_SIZE - INTERP_REDZONE_SIZE; + context->stack_real_end = context->stack_start + INTERP_STACK_SIZE; + /* We reserve a stack slot at the top of the interp stack to make temp objects visible to GC */ + context->stack_pointer = context->stack_start + MINT_STACK_ALIGNMENT; + + frame_data_allocator_init (&context->data_stack, 8192); + /* Make sure all data is initialized before publishing the context */ + mono_compiler_barrier (); + set_context (context); + } + return context; +} + +static void +interp_free_context (gpointer ctx) +{ + ThreadContext *context = (ThreadContext*)ctx; + + ThreadContext *current_context = (ThreadContext *) mono_native_tls_get_value (thread_context_id); + /* at thread exit, we can be called from the JIT TLS key destructor with current_context == NULL */ + if (current_context != NULL) { + /* check that the context we're freeing is the current one before overwriting TLS */ + g_assert (context == current_context); + set_context (NULL); + } + + mono_vfree (context->stack_start, INTERP_STACK_SIZE, MONO_MEM_ACCOUNT_INTERP_STACK); + /* Prevent interp_mark_stack from trying to scan the data_stack, before freeing it */ + context->stack_start = NULL; + mono_compiler_barrier (); + frame_data_allocator_free (&context->data_stack); + g_free (context); +} + +static gboolean +need_native_unwind (ThreadContext *context) +{ + return context->has_resume_state && !context->handler_frame; +} + +void +mono_interp_error_cleanup (MonoError* error) +{ + mono_error_cleanup (error); /* FIXME: don't swallow the error */ + error_init_reuse (error); // one instruction, so this function is good inline candidate +} + +static InterpMethod* +lookup_imethod (MonoMethod *method) +{ + InterpMethod *imethod; + MonoJitMemoryManager *jit_mm = jit_mm_for_method (method); + + jit_mm_lock (jit_mm); + imethod = (InterpMethod*)mono_internal_hash_table_lookup (&jit_mm->interp_code_hash, method); + jit_mm_unlock (jit_mm); + + return imethod; +} + +InterpMethod* +mono_interp_get_imethod (MonoMethod *method) +{ + InterpMethod *imethod; + MonoMethodSignature *sig; + MonoJitMemoryManager *jit_mm = jit_mm_for_method (method); + int i; + + jit_mm_lock (jit_mm); + imethod = (InterpMethod*)mono_internal_hash_table_lookup (&jit_mm->interp_code_hash, method); + jit_mm_unlock (jit_mm); + if (imethod) + return imethod; + + sig = mono_method_signature_internal (method); + + if (method->dynamic) + imethod = (InterpMethod*)mono_dyn_method_alloc0 (method, sizeof (InterpMethod)); + else + imethod = (InterpMethod*)m_method_alloc0 (method, sizeof (InterpMethod)); + imethod->method = method; + imethod->param_count = sig->param_count; + imethod->hasthis = sig->hasthis; + imethod->vararg = sig->call_convention == MONO_CALL_VARARG; + imethod->code_type = IMETHOD_CODE_UNKNOWN; + // This flag allows us to optimize out the interp_entry 'is this a delegate invoke' checks + imethod->is_invoke = (m_class_get_parent (method->klass) == mono_defaults.multicastdelegate_class) && !strcmp(method->name, "Invoke"); + // always optimize code if tiering is disabled + // always optimize wrappers + if (!mono_interp_tiering_enabled () || method->wrapper_type != MONO_WRAPPER_NONE || (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)) + imethod->optimized = TRUE; + + if (imethod->method->string_ctor) + imethod->rtype = m_class_get_byval_arg (mono_defaults.string_class); + else + imethod->rtype = mini_get_underlying_type (sig->ret); + if (method->dynamic) + imethod->param_types = (MonoType**)mono_dyn_method_alloc0 (method, sizeof (MonoType*) * sig->param_count); + else + imethod->param_types = (MonoType**)m_method_alloc0 (method, sizeof (MonoType*) * sig->param_count); + for (i = 0; i < sig->param_count; ++i) + imethod->param_types [i] = mini_get_underlying_type (sig->params [i]); + + if (!imethod->optimized && mono_interp_pgo_should_tier_method (method)) + imethod->optimized = TRUE; + + jit_mm_lock (jit_mm); + InterpMethod *old_imethod; + if (!((old_imethod = mono_internal_hash_table_lookup (&jit_mm->interp_code_hash, method)))) { + mono_internal_hash_table_insert (&jit_mm->interp_code_hash, method, imethod); + } else { + imethod = old_imethod; /* leak the newly allocated InterpMethod to the mempool */ + } + jit_mm_unlock (jit_mm); + + imethod->prof_flags = mono_profiler_get_call_instrumentation_flags (imethod->method); + + return imethod; +} + +#if defined (MONO_CROSS_COMPILE) || defined (HOST_WASM) +#define INTERP_PUSH_LMF_WITH_CTX_BODY(ext, exit_label) \ + (ext).kind = MONO_LMFEXT_INTERP_EXIT; + +#elif defined(MONO_ARCH_HAS_NO_PROPER_MONOCTX) +/* some platforms, e.g. appleTV, don't provide us a precise MonoContext + * (registers are not accurate), thus resuming to the label does not work. */ +#define INTERP_PUSH_LMF_WITH_CTX_BODY(ext, exit_label) \ + (ext).kind = MONO_LMFEXT_INTERP_EXIT; +#elif defined (_MSC_VER) +#define INTERP_PUSH_LMF_WITH_CTX_BODY(ext, exit_label) \ + (ext).kind = MONO_LMFEXT_INTERP_EXIT_WITH_CTX; \ + (ext).interp_exit_label_set = FALSE; \ + MONO_CONTEXT_GET_CURRENT ((ext).ctx); \ + if ((ext).interp_exit_label_set == FALSE) \ + mono_arch_do_ip_adjustment (&(ext).ctx); \ + if ((ext).interp_exit_label_set == TRUE) \ + goto exit_label; \ + (ext).interp_exit_label_set = TRUE; +#elif defined(MONO_ARCH_HAS_MONO_CONTEXT) +#define INTERP_PUSH_LMF_WITH_CTX_BODY(ext, exit_label) \ + (ext).kind = MONO_LMFEXT_INTERP_EXIT_WITH_CTX; \ + MONO_CONTEXT_GET_CURRENT ((ext).ctx); \ + MONO_CONTEXT_SET_IP (&(ext).ctx, (&&exit_label)); \ + mono_arch_do_ip_adjustment (&(ext).ctx); +#else +#define INTERP_PUSH_LMF_WITH_CTX_BODY(ext, exit_label) g_error ("requires working mono-context"); +#endif + +/* INTERP_PUSH_LMF_WITH_CTX: + * + * same as interp_push_lmf, but retrieving and attaching MonoContext to it. + * This is needed to resume into the interp when the exception is thrown from + * native code (see ./mono/tests/install_eh_callback.exe). + * + * This must be a macro in order to retrieve the right register values for + * MonoContext. + */ +#define INTERP_PUSH_LMF_WITH_CTX(frame, ext, exit_label) \ + memset (&(ext), 0, sizeof (MonoLMFExt)); \ + (ext).interp_exit_data = (frame); \ + INTERP_PUSH_LMF_WITH_CTX_BODY ((ext), exit_label); \ + mono_push_lmf (&(ext)); + +/* + * interp_push_lmf: + * + * Push an LMF frame on the LMF stack + * to mark the transition to native code. + * This is needed for the native code to + * be able to do stack walks. + */ +static void +interp_push_lmf (MonoLMFExt *ext, InterpFrame *frame) +{ + memset (ext, 0, sizeof (MonoLMFExt)); + ext->kind = MONO_LMFEXT_INTERP_EXIT; + ext->interp_exit_data = frame; + + mono_push_lmf (ext); +} + +static void +interp_pop_lmf (MonoLMFExt *ext) +{ + mono_pop_lmf (&ext->lmf); +} + +static InterpMethod* +get_virtual_method (InterpMethod *imethod, MonoVTable *vtable) +{ + MonoMethod *m = imethod->method; + + if ((m->flags & METHOD_ATTRIBUTE_FINAL) || !(m->flags & METHOD_ATTRIBUTE_VIRTUAL)) { + if (m->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED) + return mono_interp_get_imethod (mono_marshal_get_synchronized_wrapper (m)); + else + return imethod; + } + + mono_class_setup_vtable (vtable->klass); + + int slot = mono_method_get_vtable_slot (m); + if (mono_class_is_interface (m->klass)) { + g_assert (vtable->klass != m->klass); + /* TODO: interface offset lookup is slow, go through IMT instead */ + gboolean non_exact_match; + int ioffset = mono_class_interface_offset_with_variance (vtable->klass, m->klass, &non_exact_match); + g_assert (ioffset >= 0); + slot += ioffset; + } + + MonoMethod *virtual_method = m_class_get_vtable (vtable->klass) [slot]; + g_assert (virtual_method); + + if (m->is_inflated && mono_method_get_context (m)->method_inst) { + MonoGenericContext context = { NULL, NULL }; + + if (mono_class_is_ginst (virtual_method->klass)) + context.class_inst = mono_class_get_generic_class (virtual_method->klass)->context.class_inst; + else if (mono_class_is_gtd (virtual_method->klass)) + context.class_inst = mono_class_get_generic_container (virtual_method->klass)->context.class_inst; + context.method_inst = mono_method_get_context (m)->method_inst; + + ERROR_DECL (error); + virtual_method = mono_class_inflate_generic_method_checked (virtual_method, &context, error); + mono_error_cleanup (error); /* FIXME: don't swallow the error */ + } + + if (virtual_method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) { + virtual_method = mono_marshal_get_native_wrapper (virtual_method, FALSE, FALSE); + } + + if (virtual_method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED) { + virtual_method = mono_marshal_get_synchronized_wrapper (virtual_method); + } + + InterpMethod *virtual_imethod = mono_interp_get_imethod (virtual_method); + return virtual_imethod; +} + +typedef struct { + InterpMethod *imethod; + InterpMethod *target_imethod; +} InterpVTableEntry; + +/* memory manager lock must be held */ +static GSList* +append_imethod (MonoMemoryManager *memory_manager, GSList *list, InterpMethod *imethod, InterpMethod *target_imethod) +{ + GSList *ret; + InterpVTableEntry *entry; + + entry = (InterpVTableEntry*) mono_mem_manager_alloc0 (memory_manager, sizeof (InterpVTableEntry)); + entry->imethod = imethod; + entry->target_imethod = target_imethod; + ret = mono_mem_manager_alloc0 (memory_manager, sizeof (GSList)); + ret->data = entry; + ret = g_slist_concat (list, ret); + + mono_interp_register_imethod_patch_site ((gpointer*)&entry->imethod); + mono_interp_register_imethod_patch_site ((gpointer*)&entry->target_imethod); + + return ret; +} + +static InterpMethod* +get_target_imethod (GSList *list, InterpMethod *imethod) +{ + while (list != NULL) { + InterpVTableEntry *entry = (InterpVTableEntry*) list->data; + // We don't account for tiering here so this comparison is racy + // The side effect is that we might end up with duplicates of the same + // method in the vtable list, but this is extremely uncommon. + if (entry->imethod == imethod) + return entry->target_imethod; + list = list->next; + } + return NULL; +} + +static inline MonoVTableEEData* +get_vtable_ee_data (MonoVTable *vtable) +{ + MonoVTableEEData *ee_data = (MonoVTableEEData*)vtable->ee_data; + + if (G_UNLIKELY (!ee_data)) { + ee_data = m_class_alloc0 (vtable->klass, sizeof (MonoVTableEEData)); + mono_memory_barrier (); + vtable->ee_data = ee_data; + } + return ee_data; +} + +static gpointer* +get_method_table (MonoVTable *vtable, int offset) +{ + if (offset >= 0) + return get_vtable_ee_data (vtable)->interp_vtable; + else + return (gpointer*)vtable; +} + +static gpointer* +alloc_method_table (MonoVTable *vtable, int offset) +{ + gpointer *table; + + if (offset >= 0) { + table = (gpointer*)m_class_alloc0 (vtable->klass, m_class_get_vtable_size (vtable->klass) * sizeof (gpointer)); + get_vtable_ee_data (vtable)->interp_vtable = table; + } else { + table = (gpointer*)vtable; + } + + return table; +} + +static InterpMethod* // Inlining causes additional stack use in caller. +get_virtual_method_fast (InterpMethod *imethod, MonoVTable *vtable, int offset) +{ + gpointer *table; + MonoMemoryManager *memory_manager = NULL; + + table = get_method_table (vtable, offset); + + if (G_UNLIKELY (!table)) { + memory_manager = m_class_get_mem_manager (vtable->klass); + /* Lazily allocate method table */ + mono_mem_manager_lock (memory_manager); + table = get_method_table (vtable, offset); + if (!table) + table = alloc_method_table (vtable, offset); + mono_mem_manager_unlock (memory_manager); + } + + if (G_UNLIKELY (!table [offset])) { + InterpMethod *target_imethod = get_virtual_method (imethod, vtable); + if (!memory_manager) + memory_manager = m_class_get_mem_manager (vtable->klass); + /* Lazily initialize the method table slot */ + mono_mem_manager_lock (memory_manager); + if (!table [offset]) { + if (imethod->method->is_inflated || offset < 0) { + table [offset] = append_imethod (memory_manager, NULL, imethod, target_imethod); + } else { + table [offset] = (gpointer) ((gsize)target_imethod | 0x1); + mono_interp_register_imethod_patch_site (&table [offset]); + } + } + mono_mem_manager_unlock (memory_manager); + } + + if ((gsize)table [offset] & 0x1) { + /* Non generic virtual call. Only one method in slot */ + return (InterpMethod*) ((gsize)table [offset] & ~0x1); + } else { + /* Virtual generic or interface call. Multiple methods in slot */ + InterpMethod *target_imethod = get_target_imethod ((GSList*)table [offset], imethod); + + if (G_UNLIKELY (!target_imethod)) { + target_imethod = get_virtual_method (imethod, vtable); + if (!memory_manager) + memory_manager = m_class_get_mem_manager (vtable->klass); + mono_mem_manager_lock (memory_manager); + if (!get_target_imethod ((GSList*)table [offset], imethod)) + table [offset] = append_imethod (memory_manager, (GSList*)table [offset], imethod, target_imethod); + mono_mem_manager_unlock (memory_manager); + } + return target_imethod; + } +} + + + +static int +stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) +{ + if (m_type_is_byref (type)) { + gpointer *p = (gpointer*)data; + *p = val->data.p; + return MINT_STACK_SLOT_SIZE; + } + /* printf ("TODAT0 %p\n", data); */ + switch (type->type) { + case MONO_TYPE_BOOLEAN: + case MONO_TYPE_I1: + case MONO_TYPE_U1: { + guint8 *p = (guint8*)data; + *p = GINT32_TO_UINT8 (val->data.i); + return MINT_STACK_SLOT_SIZE; + } + case MONO_TYPE_I2: + case MONO_TYPE_U2: + case MONO_TYPE_CHAR: { + guint16 *p = (guint16*)data; + *p = GINT32_TO_UINT16 (val->data.i); + return MINT_STACK_SLOT_SIZE; + } + case MONO_TYPE_I: { + mono_i *p = (mono_i*)data; + /* In theory the value used by stloc should match the local var type + but in practice it sometimes doesn't (a int32 gets dup'd and stloc'd into + a native int - both by csc and mcs). Not sure what to do about sign extension + as it is outside the spec... doing the obvious */ + *p = (mono_i)val->data.nati; + return MINT_STACK_SLOT_SIZE; + } + case MONO_TYPE_U: { + mono_u *p = (mono_u*)data; + /* see above. */ + *p = (mono_u)val->data.nati; + return MINT_STACK_SLOT_SIZE; + } + case MONO_TYPE_I4: + case MONO_TYPE_U4: { + gint32 *p = (gint32*)data; + *p = val->data.i; + return MINT_STACK_SLOT_SIZE; + } + case MONO_TYPE_I8: + case MONO_TYPE_U8: { + memmove (data, &val->data.l, sizeof (gint64)); + return MINT_STACK_SLOT_SIZE; + } + case MONO_TYPE_R4: { + /* memmove handles unaligned case */ + memmove (data, &val->data.f_r4, sizeof (float)); + return MINT_STACK_SLOT_SIZE; + } + case MONO_TYPE_R8: { + memmove (data, &val->data.f, sizeof (double)); + return MINT_STACK_SLOT_SIZE; + } + case MONO_TYPE_STRING: + case MONO_TYPE_SZARRAY: + case MONO_TYPE_CLASS: + case MONO_TYPE_OBJECT: + case MONO_TYPE_ARRAY: { + gpointer *p = (gpointer *) data; + mono_gc_wbarrier_generic_store_internal (p, val->data.o); + return MINT_STACK_SLOT_SIZE; + } + case MONO_TYPE_PTR: + case MONO_TYPE_FNPTR: { + gpointer *p = (gpointer *) data; + *p = val->data.p; + return MINT_STACK_SLOT_SIZE; + } + case MONO_TYPE_VALUETYPE: + if (m_class_is_enumtype (m_type_data_get_klass_unchecked (type))) { + return stackval_to_data (mono_class_enum_basetype_internal (m_type_data_get_klass_unchecked (type)), val, data, pinvoke); + } else { + int size; + if (pinvoke) { + size = mono_class_native_size (m_type_data_get_klass_unchecked (type), NULL); + memcpy (data, val, size); + } else { + size = mono_class_value_size (m_type_data_get_klass_unchecked (type), NULL); + mono_value_copy_internal (data, val, m_type_data_get_klass_unchecked (type)); + } + return ALIGN_TO (size, MINT_STACK_SLOT_SIZE); + } + case MONO_TYPE_GENERICINST: { + MonoClass *container_class = m_type_data_get_generic_class_unchecked (type)->container_class; + + if (m_class_is_valuetype (container_class) && !m_class_is_enumtype (container_class)) { + MonoClass *klass = mono_class_from_mono_type_internal (type); + int size; + if (pinvoke) { + size = mono_class_native_size (klass, NULL); + memcpy (data, val, size); + } else { + size = mono_class_value_size (klass, NULL); + mono_value_copy_internal (data, val, klass); + } + return ALIGN_TO (size, MINT_STACK_SLOT_SIZE); + } + return stackval_to_data (m_class_get_byval_arg (m_type_data_get_generic_class_unchecked (type)->container_class), val, data, pinvoke); + } + default: + g_error ("got type %x", type->type); + } +} + +typedef struct { + MonoException *ex; + MonoContext *ctx; +} HandleExceptionCbData; + +static void +handle_exception_cb (gpointer arg) +{ + HandleExceptionCbData *cb_data = (HandleExceptionCbData*)arg; + + mono_handle_exception (cb_data->ctx, (MonoObject*)cb_data->ex); +} + +/* + * interp_throw: + * Throw an exception from the interpreter. + */ +static MONO_NEVER_INLINE void +interp_throw (ThreadContext *context, MonoException *ex, InterpFrame *frame, const guint16* ip, gboolean rethrow) +{ + ERROR_DECL (error); + MonoLMFExt ext; + + /* + * When explicitly throwing exception we pass the ip of the instruction that throws the exception. + * Offset the subtraction from interp_frame_get_ip, so we don't end up in prev instruction. + */ + frame->state.ip = ip + 1; + + // This LMF is pop'ed by the EH machinery before resuming + interp_push_lmf (&ext, frame); + + if (mono_object_isinst_checked ((MonoObject *) ex, mono_defaults.exception_class, error)) { + MonoException *mono_ex = ex; + if (!rethrow) { + mono_ex->stack_trace = NULL; + mono_ex->trace_ips = NULL; + } + } + mono_error_assert_ok (error); + + MonoContext ctx; + memset (&ctx, 0, sizeof (MonoContext)); + MONO_CONTEXT_SET_SP (&ctx, frame); + + /* + * Call the JIT EH code. The EH code will call back to us using: + * - mono_interp_set_resume_state ()/run_finally ()/run_filter (). + * Since ctx.ip is 0, this will start unwinding from the LMF frame + * pushed above, which points to our frames. + */ + + mono_handle_exception (&ctx, (MonoObject*)ex); + + if (MONO_CONTEXT_GET_IP (&ctx) != 0) { + /* We need to unwind into non-interpreter code */ + mono_restore_context (&ctx); + g_assert_not_reached (); + } + + g_assert (context->has_resume_state); +} + +static MONO_NEVER_INLINE MonoException * +interp_error_convert_to_exception (InterpFrame *frame, MonoError *error, const guint16 *ip) +{ + MonoLMFExt ext; + MonoException *ex; + + /* + * When calling runtime functions we pass the ip of the instruction triggering the runtime call. + * Offset the subtraction from interp_frame_get_ip, so we don't end up in prev instruction. + */ + frame->state.ip = ip + 1; + + interp_push_lmf (&ext, frame); + ex = mono_error_convert_to_exception (error); + interp_pop_lmf (&ext); + return ex; +} + +#define INTERP_BUILD_EXCEPTION_TYPE_FUNC_NAME(prefix_name, type_name) \ +prefix_name ## _ ## type_name + +#define INTERP_GET_EXCEPTION(exception_type) \ +static MONO_NEVER_INLINE MonoException * \ +INTERP_BUILD_EXCEPTION_TYPE_FUNC_NAME(interp_get_exception, exception_type) (InterpFrame *frame, const guint16 *ip)\ +{ \ + MonoLMFExt ext; \ + MonoException *ex; \ + frame->state.ip = ip + 1; \ + interp_push_lmf (&ext, frame); \ + ex = INTERP_BUILD_EXCEPTION_TYPE_FUNC_NAME(mono_get_exception,exception_type) (); \ + interp_pop_lmf (&ext); \ + return ex; \ +} + +#define INTERP_GET_EXCEPTION_CHAR_ARG(exception_type) \ +static MONO_NEVER_INLINE MonoException * \ +INTERP_BUILD_EXCEPTION_TYPE_FUNC_NAME(interp_get_exception, exception_type) (const char *arg, InterpFrame *frame, const guint16 *ip)\ +{ \ + MonoLMFExt ext; \ + MonoException *ex; \ + frame->state.ip = ip + 1; \ + interp_push_lmf (&ext, frame); \ + ex = INTERP_BUILD_EXCEPTION_TYPE_FUNC_NAME(mono_get_exception,exception_type) (arg); \ + interp_pop_lmf (&ext); \ + return ex; \ +} + +INTERP_GET_EXCEPTION(null_reference) +INTERP_GET_EXCEPTION(divide_by_zero) +INTERP_GET_EXCEPTION(overflow) +INTERP_GET_EXCEPTION(invalid_cast) +INTERP_GET_EXCEPTION(index_out_of_range) +INTERP_GET_EXCEPTION(array_type_mismatch) +INTERP_GET_EXCEPTION(arithmetic) +INTERP_GET_EXCEPTION_CHAR_ARG(argument_out_of_range) + +// Inlining throw logic into interp_exec_method makes it bigger and could push us up against +// internal limits in things like WASM compilers +static MONO_NEVER_INLINE void +interp_throw_ex_general ( + MonoException *__ex, ThreadContext *context, InterpFrame *frame, const guint16 *ex_ip, gboolean rethrow +) +{ + HANDLE_FUNCTION_ENTER (); + MonoExceptionHandle tmp_handle = MONO_HANDLE_NEW (MonoException, __ex); + interp_throw (context, MONO_HANDLE_RAW(tmp_handle), (frame), (ex_ip), (rethrow)); + HANDLE_FUNCTION_RETURN (); +} + +// We conservatively pin exception object here to avoid tweaking the +// numerous call sites of this macro, even though, in a few cases, +// this is not needed. +#define THROW_EX_GENERAL(exception,ex_ip, rethrow) \ + do { \ + interp_throw_ex_general (exception, context, frame, ex_ip, rethrow); \ + goto resume; \ + } while (0) + +#define THROW_EX(exception,ex_ip) THROW_EX_GENERAL ((exception), (ex_ip), FALSE) + +#define NULL_CHECK(o) do { \ + if (G_UNLIKELY (!(o))) \ + THROW_EX (interp_get_exception_null_reference (frame, ip), ip); \ + } while (0) + +#define EXCEPTION_CHECKPOINT \ + do { \ + if (mono_thread_interruption_request_flag && !mono_threads_is_critical_method (frame->imethod->method)) { \ + MonoException *exc = mono_thread_interruption_checkpoint (); \ + if (exc) \ + THROW_EX_GENERAL (exc, ip, TRUE); \ + } \ + } while (0) + +// Reduce duplicate code in mono_interp_exec_method +static MONO_NEVER_INLINE void +do_safepoint (InterpFrame *frame, ThreadContext *context, const guint16 *ip) +{ + MonoLMFExt ext; + + /* + * When calling runtime functions we pass the ip of the instruction triggering the runtime call. + * Offset the subtraction from interp_frame_get_ip, so we don't end up in prev instruction. + */ + frame->state.ip = ip + 1; + + interp_push_lmf (&ext, frame); + /* Poll safepoint */ + mono_threads_safepoint (); + interp_pop_lmf (&ext); +} + +#define SAFEPOINT \ + do { \ + if (G_UNLIKELY (mono_polling_required)) \ + do_safepoint (frame, context, ip); \ + } while (0) + +static MonoObject* +ves_array_create (MonoClass *klass, int param_count, stackval *values, MonoError *error) +{ + int rank = m_class_get_rank (klass); + uintptr_t *lengths = g_newa (uintptr_t, rank * 2); + intptr_t *lower_bounds = NULL; + + if (param_count > rank && m_class_get_byval_arg (klass)->type == MONO_TYPE_SZARRAY) { + // Special constructor for jagged arrays + for (int i = 0; i < param_count; ++i) + lengths [i] = values [i].data.i; + return (MonoObject*) mono_array_new_jagged_checked (klass, param_count, lengths, error); + } else if (2 * rank == param_count) { + for (int l = 0; l < 2; ++l) { + int src = l; + int dst = l * rank; + for (int r = 0; r < rank; ++r, src += 2, ++dst) { + lengths [dst] = values [src].data.i; + } + } + /* lower bounds are first. */ + lower_bounds = (intptr_t *) lengths; + lengths += rank; + } else { + /* Only lengths provided. */ + for (int i = 0; i < param_count; ++i) { + lengths [i] = values [i].data.i; + } + } + return (MonoObject*) mono_array_new_full_checked (klass, lengths, lower_bounds, error); +} + +static gint32 +ves_array_calculate_index (MonoArray *ao, stackval *sp, gboolean safe) +{ + MonoClass *ac = ((MonoObject *) ao)->vtable->klass; + + guint32 pos = 0; + if (ao->bounds) { + for (gint32 i = 0; i < m_class_get_rank (ac); i++) { + gint32 idx = sp [i].data.i; + gint32 lower = ao->bounds [i].lower_bound; + guint32 len = ao->bounds [i].length; + if (safe && (idx < lower || (guint32)(idx - lower) >= len)) + return -1; + pos = (pos * len) + (guint32)(idx - lower); + } + } else { + pos = sp [0].data.i; + if (safe && pos >= ao->max_length) + return -1; + } + return pos; +} + +static MonoException* +ves_array_element_address (InterpFrame *frame, MonoClass *required_type, MonoArray *ao, gpointer *ret, stackval *sp, gboolean needs_typecheck) +{ + MonoClass *ac = ((MonoObject *) ao)->vtable->klass; + + g_assert (m_class_get_rank (ac) >= 1); + + gint32 pos = ves_array_calculate_index (ao, sp, TRUE); + if (pos == -1) + return mono_get_exception_index_out_of_range (); + + if (needs_typecheck && !mono_class_is_assignable_from_internal (m_class_get_element_class (mono_object_class ((MonoObject *) ao)), required_type)) + return mono_get_exception_array_type_mismatch (); + gint32 esize = mono_array_element_size (ac); + *ret = mono_array_addr_with_size_fast (ao, esize, pos); + return NULL; +} + +/* Does not handle `this` argument */ +static guint32 +compute_arg_offset (MonoMethodSignature *sig, int index) +{ + if (index == 0) + return 0; + + guint32 offset = 0; + int size, align; + MonoType *type; + for (int i = 0; i < index; i++) { + type = sig->params [i]; + size = mono_interp_type_size (type, mono_mint_type (type), &align); + + offset = ALIGN_TO (offset, align); + offset += size; + } + type = sig->params [index]; + mono_interp_type_size (type, mono_mint_type (type), &align); + + offset = ALIGN_TO (offset, align); + return offset; +} + +static gpointer +imethod_alloc0 (InterpMethod *imethod, guint size) +{ + if (imethod->method->dynamic) + return mono_dyn_method_alloc0 (imethod->method, size); + else + return m_method_alloc0 (imethod->method, size); +} + +static guint32* +initialize_arg_offsets (InterpMethod *imethod, MonoMethodSignature *csig) +{ + if (imethod->arg_offsets) + return imethod->arg_offsets; + + // For pinvokes, csig represents the real signature with marshalled args. If an explicit + // marshalled signature was not provided, we use the managed signature of the method. + MonoMethodSignature *sig = csig; + if (!sig) + sig = mono_method_signature_internal (imethod->method); + int arg_count = sig->hasthis + sig->param_count; + guint32 *arg_offsets = (guint32*)imethod_alloc0 (imethod, (arg_count + 1) * sizeof (int)); + int index = 0, offset = 0; + + if (sig->hasthis) { + arg_offsets [index++] = 0; + offset = MINT_STACK_SLOT_SIZE; + } + + for (int i = 0; i < sig->param_count; i++) { + MonoType *type = sig->params [i]; + int size, align; + size = mono_interp_type_size (type, mono_mint_type (type), &align); + + offset = ALIGN_TO (offset, align); + arg_offsets [index++] = offset; + offset += size; + } + // This index is not associated with an actual argument, we just store the offset + // for convenience in order to easily determine the size of the param area used + arg_offsets [index] = ALIGN_TO (offset, MINT_STACK_SLOT_SIZE); + + mono_memory_write_barrier (); + /* If this fails, the new one is leaked in the mem manager */ + mono_atomic_cas_ptr ((gpointer*)&imethod->arg_offsets, arg_offsets, NULL); + return imethod->arg_offsets; +} + +static guint32 +get_arg_offset_fast (InterpMethod *imethod, MonoMethodSignature *sig, int index) +{ + guint32 *arg_offsets = imethod->arg_offsets; + if (arg_offsets) + return arg_offsets [index]; + + arg_offsets = initialize_arg_offsets (imethod, sig); + g_assert (arg_offsets); + return arg_offsets [index]; +} + +static guint32 +get_arg_offset (InterpMethod *imethod, MonoMethodSignature *sig, int index) +{ + if (imethod) { + return get_arg_offset_fast (imethod, sig, index); + } else { + g_assert (!sig->hasthis); + return compute_arg_offset (sig, index); + } +} + +#ifdef MONO_ARCH_HAVE_INTERP_ENTRY_TRAMPOLINE +static MonoFuncV mono_native_to_interp_trampoline = NULL; +#endif + +#ifndef MONO_ARCH_HAVE_INTERP_PINVOKE_TRAMP + +typedef enum { + PINVOKE_ARG_NONE = 0, + PINVOKE_ARG_INT = 1, + PINVOKE_ARG_INT_PAIR = 2, + PINVOKE_ARG_R8 = 3, + PINVOKE_ARG_R4 = 4, + PINVOKE_ARG_VTYPE = 5, + PINVOKE_ARG_SCALAR_VTYPE = 6, + // This isn't ifdefed so it's easier to write code that handles it without sprinkling + // 800 ifdefs in this file + PINVOKE_ARG_WASM_VALUETYPE_RESULT = 7, +} PInvokeArgType; + +typedef struct { + int ilen, flen; + MonoType *ret_mono_type; + PInvokeArgType ret_pinvoke_type; + PInvokeArgType *arg_types; +} BuildArgsFromSigInfo; + +static MonoType * +filter_type_for_args_from_sig (MonoType *type) { +#if defined(HOST_WASM) + MonoType *etype; + if (MONO_TYPE_ISSTRUCT (type) && mini_wasm_is_scalar_vtype (type, &etype)) + // FIXME: Does this need to be recursive? + return etype; +#endif + return type; +} + +static BuildArgsFromSigInfo * +get_build_args_from_sig_info (MonoMemoryManager *mem_manager, MonoMethodSignature *sig) +{ + BuildArgsFromSigInfo *info = mono_mem_manager_alloc0 (mem_manager, sizeof (BuildArgsFromSigInfo)); + int ilen = 0, flen = 0; + + info->arg_types = mono_mem_manager_alloc0 (mem_manager, sizeof (PInvokeArgType) * sig->param_count); + + g_assert (!sig->hasthis); + + for (int i = 0; i < sig->param_count; i++) { + MonoType *type = filter_type_for_args_from_sig (sig->params [i]); + guint32 ptype; + +retry: + ptype = m_type_is_byref (type) ? MONO_TYPE_PTR : type->type; + switch (ptype) { + case MONO_TYPE_BOOLEAN: + case MONO_TYPE_CHAR: + case MONO_TYPE_I1: + case MONO_TYPE_U1: + case MONO_TYPE_I2: + case MONO_TYPE_U2: + case MONO_TYPE_I4: + case MONO_TYPE_U4: + case MONO_TYPE_I: + case MONO_TYPE_U: + case MONO_TYPE_PTR: + case MONO_TYPE_FNPTR: + case MONO_TYPE_SZARRAY: + case MONO_TYPE_CLASS: + case MONO_TYPE_OBJECT: + case MONO_TYPE_STRING: +#if SIZEOF_VOID_P == 8 + case MONO_TYPE_I8: + case MONO_TYPE_U8: +#endif + info->arg_types [i] = PINVOKE_ARG_INT; + ilen++; + break; +#if SIZEOF_VOID_P == 4 + case MONO_TYPE_I8: + case MONO_TYPE_U8: + info->arg_types [i] = PINVOKE_ARG_INT_PAIR; + ilen += 2; + break; +#endif + case MONO_TYPE_R4: + info->arg_types [i] = PINVOKE_ARG_R4; + flen++; + break; + case MONO_TYPE_R8: + info->arg_types [i] = PINVOKE_ARG_R8; + flen++; + break; + case MONO_TYPE_VALUETYPE: + if (m_class_is_enumtype (m_type_data_get_klass_unchecked (type))) { + type = mono_class_enum_basetype_internal (m_type_data_get_klass_unchecked (type)); + goto retry; + } + info->arg_types [i] = PINVOKE_ARG_VTYPE; + +#ifdef HOST_WASM + { + MonoType *etype; + + /* Scalar vtypes are passed by value */ + // FIXME: r4/r8 + if (mini_wasm_is_scalar_vtype (sig->params [i], &etype) && etype->type != MONO_TYPE_R4 && etype->type != MONO_TYPE_R8) + info->arg_types [i] = PINVOKE_ARG_SCALAR_VTYPE; + } +#endif + ilen++; + break; + case MONO_TYPE_GENERICINST: { + // FIXME: Should mini_wasm_is_scalar_vtype stuff go in here? + MonoClass *container_class = m_type_data_get_generic_class_unchecked (type)->container_class; + type = m_class_get_byval_arg (container_class); + goto retry; + } + default: + g_error ("build_args_from_sig: not implemented yet (1): 0x%x\n", ptype); + } + } + + if (ilen > INTERP_ICALL_TRAMP_IARGS) + g_error ("build_args_from_sig: TODO, allocate gregs: %d\n", ilen); + + if (flen > INTERP_ICALL_TRAMP_FARGS) + g_error ("build_args_from_sig: TODO, allocate fregs: %d\n", flen); + + info->ilen = ilen; + info->flen = flen; + + info->ret_mono_type = filter_type_for_args_from_sig (sig->ret); + + switch (info->ret_mono_type->type) { + case MONO_TYPE_BOOLEAN: + case MONO_TYPE_CHAR: + case MONO_TYPE_I1: + case MONO_TYPE_U1: + case MONO_TYPE_I2: + case MONO_TYPE_U2: + case MONO_TYPE_I4: + case MONO_TYPE_U4: + case MONO_TYPE_I: + case MONO_TYPE_U: + case MONO_TYPE_PTR: + case MONO_TYPE_FNPTR: + case MONO_TYPE_SZARRAY: + case MONO_TYPE_CLASS: + case MONO_TYPE_OBJECT: + case MONO_TYPE_STRING: + info->ret_pinvoke_type = PINVOKE_ARG_INT; + break; +#if SIZEOF_VOID_P == 8 + case MONO_TYPE_I8: + case MONO_TYPE_U8: +#endif + info->ret_pinvoke_type = PINVOKE_ARG_INT; + break; +#if SIZEOF_VOID_P == 4 + case MONO_TYPE_I8: + case MONO_TYPE_U8: + info->ret_pinvoke_type = PINVOKE_ARG_INT; + break; +#endif + case MONO_TYPE_VALUETYPE: + case MONO_TYPE_GENERICINST: + info->ret_pinvoke_type = PINVOKE_ARG_INT; +#ifdef HOST_WASM + // This ISSTRUCT check is important, because the type could be an enum + if (MONO_TYPE_ISSTRUCT (info->ret_mono_type)) { + // The return type was already filtered previously, so if we get here + // we're returning a struct byref instead of as a scalar + info->ret_pinvoke_type = PINVOKE_ARG_WASM_VALUETYPE_RESULT; + info->ilen++; + } +#endif + break; + case MONO_TYPE_R4: + case MONO_TYPE_R8: + info->ret_pinvoke_type = PINVOKE_ARG_R8; + break; + case MONO_TYPE_VOID: + info->ret_pinvoke_type = PINVOKE_ARG_NONE; + break; + default: + g_error ("build_args_from_sig: ret type not implemented yet: 0x%x\n", info->ret_mono_type->type); + } + + return info; +} + +static void +build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, BuildArgsFromSigInfo *info, InterpFrame *frame) +{ +#ifdef TARGET_WASM + margs->sig = sig; +#endif + + margs->ilen = info->ilen; + margs->flen = info->flen; + + size_t int_i = 0; + size_t int_f = 0; + + if (info->ret_pinvoke_type == PINVOKE_ARG_WASM_VALUETYPE_RESULT) { + // Allocate an empty arg0 for the address of the return value + // info->ilen was already increased earlier + int_i++; + } + + if (margs->ilen > 0) { + if (margs->ilen <= 8) + margs->iargs = margs->iargs_buf; + else + margs->iargs = g_malloc0 (sizeof (gpointer) * margs->ilen); + } + + if (margs->flen > 0) { + if (margs->flen <= 8) + margs->fargs = margs->fargs_buf; + else + margs->fargs = g_malloc0 (sizeof (double) * margs->flen); + } + + for (int i = 0; i < sig->param_count; i++) { + guint32 offset = get_arg_offset (frame->imethod, sig, i); + stackval *sp_arg = STACK_ADD_BYTES (frame->stack, offset); + + switch (info->arg_types [i]) { + case PINVOKE_ARG_INT: + margs->iargs [int_i] = sp_arg->data.p; +#if DEBUG_INTERP + g_print ("build_args_from_sig: margs->iargs [%d]: %p (frame @ %d)\n", int_i, margs->iargs [int_i], i); +#endif + int_i++; + break; + case PINVOKE_ARG_R4: + * (float *) &(margs->fargs [int_f]) = sp_arg->data.f_r4; +#if DEBUG_INTERP + g_print ("build_args_from_sig: margs->fargs [%d]: %p (%f) (frame @ %d)\n", int_f, margs->fargs [int_f], margs->fargs [int_f], i); +#endif + int_f ++; + break; + case PINVOKE_ARG_R8: + margs->fargs [int_f] = sp_arg->data.f; +#if DEBUG_INTERP + g_print ("build_args_from_sig: margs->fargs [%d]: %p (%f) (frame @ %d)\n", int_f, margs->fargs [int_f], margs->fargs [int_f], i); +#endif + int_f ++; + break; + case PINVOKE_ARG_VTYPE: + margs->iargs [int_i] = sp_arg; +#if DEBUG_INTERP + g_print ("build_args_from_sig: margs->iargs [%d]: %p (vt) (frame @ %d)\n", int_i, margs->iargs [int_i], i); +#endif + int_i++; + break; + case PINVOKE_ARG_SCALAR_VTYPE: + margs->iargs [int_i] = *(gpointer*)sp_arg; + +#if DEBUG_INTERP + g_print ("build_args_from_sig: margs->iargs [%d]: %p (vt) (frame @ %d)\n", int_i, margs->iargs [int_i], i); +#endif + int_i++; + break; + case PINVOKE_ARG_INT_PAIR: { + margs->iargs [int_i] = (gpointer)(gssize)sp_arg->data.pair.lo; + int_i++; + margs->iargs [int_i] = (gpointer)(gssize)sp_arg->data.pair.hi; +#if DEBUG_INTERP + g_print ("build_args_from_sig: margs->iargs [%d/%d]: 0x%016" PRIx64 ", hi=0x%08x lo=0x%08x (frame @ %d)\n", int_i - 1, int_i, *((guint64 *) &margs->iargs [int_i - 1]), sp_arg->data.pair.hi, sp_arg->data.pair.lo, i); +#endif + int_i++; + break; + } + default: + g_assert_not_reached (); + break; + } + } + + switch (info->ret_pinvoke_type) { + case PINVOKE_ARG_WASM_VALUETYPE_RESULT: + // We pass the return value address in arg0 so fill it in, we already + // reserved space for it earlier. + g_assert (frame->retval); + margs->iargs[0] = (gpointer*)frame->retval; + // The return type is void so retval should be NULL + margs->retval = NULL; + margs->is_float_ret = 0; + break; + case PINVOKE_ARG_INT: + margs->retval = (gpointer*)frame->retval; + margs->is_float_ret = 0; + break; + case PINVOKE_ARG_R8: + margs->retval = (gpointer*)frame->retval; + margs->is_float_ret = 1; + break; + case PINVOKE_ARG_NONE: + margs->retval = NULL; + break; + default: + g_assert_not_reached (); + break; + } +} +#endif + +static void +interp_frame_arg_to_data (MonoInterpFrameHandle frame, MonoMethodSignature *sig, int index, gpointer data) +{ + InterpFrame *iframe = (InterpFrame*)frame; + InterpMethod *imethod = iframe->imethod; + + // If index == -1, we finished executing an InterpFrame and the result is at retval. + if (index == -1) + stackval_to_data (sig->ret, iframe->retval, data, sig->pinvoke && !sig->marshalling_disabled); + else if (sig->hasthis && index == 0) + *(gpointer*)data = iframe->stack->data.p; + else + stackval_to_data (sig->params [index - sig->hasthis], STACK_ADD_BYTES (iframe->stack, get_arg_offset (imethod, sig, index)), data, sig->pinvoke && !sig->marshalling_disabled); +} + +static void +interp_data_to_frame_arg (MonoInterpFrameHandle frame, MonoMethodSignature *sig, int index, gconstpointer data) +{ + InterpFrame *iframe = (InterpFrame*)frame; + InterpMethod *imethod = iframe->imethod; + + // Get result from pinvoke call, put it directly on top of execution stack in the caller frame + if (index == -1) + stackval_from_data (sig->ret, iframe->retval, data, sig->pinvoke && !sig->marshalling_disabled); + else if (sig->hasthis && index == 0) + iframe->stack->data.p = *(gpointer*)data; + else + stackval_from_data (sig->params [index - sig->hasthis], STACK_ADD_BYTES (iframe->stack, get_arg_offset (imethod, sig, index)), data, sig->pinvoke && !sig->marshalling_disabled); +} + +static gpointer +interp_frame_arg_to_storage (MonoInterpFrameHandle frame, MonoMethodSignature *sig, int index) +{ + InterpFrame *iframe = (InterpFrame*)frame; + InterpMethod *imethod = iframe->imethod; + + if (index == -1) + return iframe->retval; + else + return STACK_ADD_BYTES (iframe->stack, get_arg_offset (imethod, sig, index)); +} + +static MonoPIFunc +get_interp_to_native_trampoline (void) +{ + static MonoPIFunc trampoline = NULL; + + if (!trampoline) { + if (mono_ee_features.use_aot_trampolines) { + trampoline = (MonoPIFunc) mono_aot_get_trampoline ("interp_to_native_trampoline"); + } else { + MonoTrampInfo *info; + trampoline = (MonoPIFunc) mono_arch_get_interp_to_native_trampoline (&info); + mono_tramp_info_register (info, NULL); + } + mono_memory_barrier (); + } + return trampoline; +} + +static void +interp_to_native_trampoline (gpointer addr, gpointer ccontext) +{ + get_interp_to_native_trampoline () (addr, ccontext); +} + +#ifdef HOST_WASM +typedef struct { + MonoPIFunc entry_func; + BuildArgsFromSigInfo *call_info; +} WasmPInvokeCacheData; +#endif + +/* MONO_NO_OPTIMIZATION is needed due to usage of INTERP_PUSH_LMF_WITH_CTX. */ +#ifdef _MSC_VER +#pragma optimize ("", off) +#endif +MONO_NO_OPTIMIZATION MONO_NEVER_INLINE gpointer +ves_pinvoke_method ( + InterpMethod *imethod, + MonoMethodSignature *sig, + MonoFuncV addr, + ThreadContext *context, + InterpFrame *parent_frame, + stackval *ret_sp, + stackval *sp, + gboolean save_last_error, + gpointer *cache, + gboolean *gc_transitions) +{ + InterpFrame frame = {0}; + frame.parent = parent_frame; + frame.imethod = imethod; + frame.stack = sp; + frame.retval = ret_sp; + + MonoLMFExt ext; + gpointer args; + + MONO_REQ_GC_UNSAFE_MODE; + +#ifdef HOST_WASM + /* + * Use a per-signature entry function. + * Cache it in imethod->data_items. + * This is GC safe. + */ + MonoPIFunc entry_func = NULL; + WasmPInvokeCacheData *cache_data = (WasmPInvokeCacheData*)*cache; + if (!cache_data) { + cache_data = g_new0 (WasmPInvokeCacheData, 1); + cache_data->entry_func = (MonoPIFunc)mono_wasm_get_interp_to_native_trampoline (sig); + cache_data->call_info = get_build_args_from_sig_info (get_default_mem_manager (), sig); + mono_memory_barrier (); + *cache = cache_data; + } + entry_func = cache_data->entry_func; +#else + static MonoPIFunc entry_func = NULL; + if (!entry_func) { + MONO_ENTER_GC_UNSAFE; +#ifdef MONO_ARCH_HAS_NO_PROPER_MONOCTX + ERROR_DECL (error); + entry_func = (MonoPIFunc) mono_jit_compile_method_jit_only (mini_get_interp_lmf_wrapper ("mono_interp_to_native_trampoline", (gpointer) mono_interp_to_native_trampoline), error); + mono_error_assert_ok (error); +#else + entry_func = get_interp_to_native_trampoline (); +#endif + mono_memory_barrier (); + MONO_EXIT_GC_UNSAFE; + } +#endif + + if (save_last_error) { + mono_marshal_clear_last_error (); + } + +#ifdef MONO_ARCH_HAVE_INTERP_PINVOKE_TRAMP + gpointer call_info = *cache; + + if (!call_info) { + call_info = mono_arch_get_interp_native_call_info (get_default_mem_manager (), sig); + mono_memory_barrier (); + *cache = call_info; + } + CallContext ccontext; + mono_arch_set_native_call_context_args (&ccontext, &frame, sig, call_info); + args = &ccontext; +#else + +#ifdef HOST_WASM + BuildArgsFromSigInfo *call_info = cache_data->call_info; +#else + BuildArgsFromSigInfo *call_info = NULL; + g_assert_not_reached (); +#endif + + InterpMethodArguments margs; + memset (&margs, 0, sizeof (InterpMethodArguments)); + build_args_from_sig (&margs, sig, call_info, &frame); + args = &margs; +#endif + + INTERP_PUSH_LMF_WITH_CTX (&frame, ext, exit_pinvoke); + + if (*gc_transitions) { + MONO_ENTER_GC_SAFE; + entry_func ((gpointer) addr, args); + MONO_EXIT_GC_SAFE; + *gc_transitions = FALSE; + } else { + entry_func ((gpointer) addr, args); + } + + if (save_last_error) + mono_marshal_set_last_error (); + interp_pop_lmf (&ext); + +#ifdef MONO_ARCH_HAVE_INTERP_PINVOKE_TRAMP +#ifdef MONO_ARCH_HAVE_SWIFTCALL + if (mono_method_signature_has_ext_callconv (sig, MONO_EXT_CALLCONV_SWIFTCALL)) { + int arg_index = -1; + gpointer data = mono_arch_get_swift_error (&ccontext, sig, &arg_index); + + // Perform an indirect store at arg_index stack location + if (arg_index >= 0) { + g_assert (data); + stackval *result = (stackval*) STACK_ADD_BYTES (frame.stack, get_arg_offset (frame.imethod, sig, arg_index)); + *(gpointer*)result->data.p = *(gpointer*)data; + } + } +#endif + if (!context->has_resume_state) { + mono_arch_get_native_call_context_ret (&ccontext, &frame, sig, call_info); + } + + g_free (ccontext.stack); +#else + // Only the vt address has been returned, we need to copy the entire content on interp stack + if (!context->has_resume_state && MONO_TYPE_ISSTRUCT (call_info->ret_mono_type)) { + if (call_info->ret_pinvoke_type != PINVOKE_ARG_WASM_VALUETYPE_RESULT) + stackval_from_data (call_info->ret_mono_type, frame.retval, (char*)frame.retval->data.p, sig->pinvoke && !sig->marshalling_disabled); + } + + if (margs.iargs != margs.iargs_buf) + g_free (margs.iargs); + if (margs.fargs != margs.fargs_buf) + g_free (margs.fargs); +#endif + goto exit_pinvoke; // prevent unused label warning in some configurations +exit_pinvoke: + return NULL; +} +#ifdef _MSC_VER +#pragma optimize ("", on) +#endif + +/* + * interp_init_delegate: + * + * Initialize del->interp_method. + */ +static void +interp_init_delegate (MonoDelegate *del, MonoDelegateTrampInfo **out_info, MonoError *error) +{ + MonoMethod *method; + + if (del->interp_method) { + /* Delegate created by a call to ves_icall_mono_delegate_ctor_interp () */ + del->method = ((InterpMethod *)del->interp_method)->method; + } else if (del->method_ptr && !del->method) { + /* Delegate created from methodInfo.MethodHandle.GetFunctionPointer() */ + del->interp_method = (InterpMethod *)del->method_ptr; + if (mono_llvm_only) + // FIXME: + g_assert_not_reached (); + } else if (del->method) { + /* Delegate created dynamically */ + del->interp_method = mono_interp_get_imethod (del->method); + } else { + /* Created from JITted code */ + g_assert_not_reached (); + } + + method = ((InterpMethod*)del->interp_method)->method; + if (del->target && + method && + method->flags & METHOD_ATTRIBUTE_VIRTUAL && + method->flags & METHOD_ATTRIBUTE_ABSTRACT && + mono_class_is_abstract (method->klass)) + del->interp_method = get_virtual_method ((InterpMethod*)del->interp_method, del->target->vtable); + + method = ((InterpMethod*)del->interp_method)->method; + if (method && m_class_get_parent (method->klass) == mono_defaults.multicastdelegate_class) { + const char *name = method->name; + if (*name == 'I' && (strcmp (name, "Invoke") == 0)) { + /* + * When invoking the delegate interp_method is executed directly. If it's an + * invoke make sure we replace it with the appropriate delegate invoke wrapper. + * + * FIXME We should do this later, when we also know the delegate on which the + * target method is called. + */ + del->interp_method = mono_interp_get_imethod (mono_marshal_get_delegate_invoke (method, NULL)); + } + } + + if (!((InterpMethod *) del->interp_method)->transformed && method_is_dynamic (method)) { + /* Return any errors from method compilation */ + mono_interp_transform_method ((InterpMethod *) del->interp_method, get_context (), error); + return_if_nok (error); + } + + /* + * Compute a MonoDelegateTrampInfo for this delegate if possible and pass it back to + * the caller. + * Keep a 1 element cache in imethod->del_info. This should be good enough since most methods + * are only associated with one delegate type. + */ + if (out_info) + *out_info = NULL; + if (mono_llvm_only) { + InterpMethod *imethod = del->interp_method; + method = imethod->method; + if (imethod->del_info && imethod->del_info->klass == del->object.vtable->klass) { + *out_info = imethod->del_info; + } else if (!imethod->del_info) { + imethod->del_info = mono_create_delegate_trampoline_info (del->object.vtable->klass, method, FALSE); + *out_info = imethod->del_info; + } + } +} + +/* Convert a function pointer for a managed method to an InterpMethod* */ +static InterpMethod* +ftnptr_to_imethod (gpointer addr, gboolean *need_unbox) +{ + InterpMethod *imethod; + + if (mono_llvm_only) { + /* Function pointers are represented by a MonoFtnDesc structure */ + MonoFtnDesc *ftndesc = (MonoFtnDesc*)addr; + g_assert (ftndesc); + g_assert (ftndesc->method); + + if (!ftndesc->interp_method) { + imethod = mono_interp_get_imethod (ftndesc->method); + mono_memory_barrier (); + // FIXME Handle unboxing here ? + ftndesc->interp_method = imethod; + } + *need_unbox = INTERP_IMETHOD_IS_TAGGED_UNBOX (ftndesc->interp_method); + imethod = INTERP_IMETHOD_UNTAG_UNBOX (ftndesc->interp_method); + } else { + /* Function pointers are represented by their InterpMethod */ + *need_unbox = INTERP_IMETHOD_IS_TAGGED_UNBOX (addr); + imethod = INTERP_IMETHOD_UNTAG_UNBOX (addr); + } + return imethod; +} + +static gpointer +imethod_to_ftnptr (InterpMethod *imethod, gboolean need_unbox) +{ + if (mono_llvm_only) { + ERROR_DECL (error); + /* Function pointers are represented by a MonoFtnDesc structure */ + MonoFtnDesc **ftndesc_p; + if (need_unbox) + ftndesc_p = &imethod->ftndesc_unbox; + else + ftndesc_p = &imethod->ftndesc; + if (!*ftndesc_p) { + MonoFtnDesc *ftndesc = mini_llvmonly_load_method_ftndesc (imethod->method, FALSE, need_unbox, error); + mono_error_assert_ok (error); + if (need_unbox) + ftndesc->interp_method = INTERP_IMETHOD_TAG_UNBOX (imethod); + else + ftndesc->interp_method = imethod; + mono_memory_barrier (); + *ftndesc_p = ftndesc; + } + return *ftndesc_p; + } else { + if (need_unbox) + return INTERP_IMETHOD_TAG_UNBOX (imethod); + else + return imethod; + } +} + +static void +interp_delegate_ctor (MonoObjectHandle this_obj, MonoObjectHandle target, gpointer addr, MonoError *error) +{ + gboolean need_unbox; + /* addr is the result of an LDFTN opcode */ + InterpMethod *imethod = ftnptr_to_imethod (addr, &need_unbox); + + if (!(imethod->method->flags & METHOD_ATTRIBUTE_STATIC)) { + MonoMethod *invoke = mono_get_delegate_invoke_internal (mono_handle_class (this_obj)); + /* virtual invoke delegates must not have null check */ + if (mono_method_signature_internal (imethod->method)->param_count == mono_method_signature_internal (invoke)->param_count + && MONO_HANDLE_IS_NULL (target)) { + mono_error_set_argument (error, "this", "Delegate to an instance method cannot have null 'this'"); + return; + } + } + + g_assert (imethod->method); + gpointer entry = mini_get_interp_callbacks ()->create_method_pointer (imethod->method, FALSE, error); + return_if_nok (error); + + MONO_HANDLE_SETVAL (MONO_HANDLE_CAST (MonoDelegate, this_obj), interp_method, gpointer, imethod); + + mono_delegate_ctor (this_obj, target, entry, imethod->method, error); +} + +#if DEBUG_INTERP +static void +dump_stackval (GString *str, stackval *s, MonoType *type) +{ + switch (type->type) { + case MONO_TYPE_I1: + case MONO_TYPE_U1: + case MONO_TYPE_I2: + case MONO_TYPE_U2: + case MONO_TYPE_I4: + case MONO_TYPE_U4: + case MONO_TYPE_CHAR: + case MONO_TYPE_BOOLEAN: + g_string_append_printf (str, "[%d] ", s->data.i); + break; + case MONO_TYPE_STRING: + case MONO_TYPE_SZARRAY: + case MONO_TYPE_CLASS: + case MONO_TYPE_OBJECT: + case MONO_TYPE_ARRAY: + case MONO_TYPE_PTR: + case MONO_TYPE_FNPTR: + case MONO_TYPE_I: + case MONO_TYPE_U: + g_string_append_printf (str, "[%p] ", s->data.p); + break; + case MONO_TYPE_VALUETYPE: + if (m_class_is_enumtype (m_type_data_get_klass_unchecked (type))) + g_string_append_printf (str, "[%d] ", s->data.i); + else + g_string_append_printf (str, "[vt:%p] ", s->data.p); + break; + case MONO_TYPE_R4: + g_string_append_printf (str, "[%g] ", s->data.f_r4); + break; + case MONO_TYPE_R8: + g_string_append_printf (str, "[%g] ", s->data.f); + break; + case MONO_TYPE_I8: + case MONO_TYPE_U8: + default: { + GString *res = g_string_new (""); + mono_type_get_desc (res, type, TRUE); + g_string_append_printf (str, "[{%s} %" PRId64 "/0x%0" PRIx64 "] ", res->str, (gint64)s->data.l, (guint64)s->data.l); + g_string_free (res, TRUE); + break; + } + } +} + +static char* +dump_retval (InterpFrame *inv) +{ + GString *str = g_string_new (""); + MonoType *ret = mono_method_signature_internal (inv->imethod->method)->ret; + + if (ret->type != MONO_TYPE_VOID) + dump_stackval (str, inv->stack, ret); + + return g_string_free (str, FALSE); +} + +static char* +dump_args (InterpFrame *inv) +{ + GString *str = g_string_new (""); + int i; + MonoMethodSignature *signature = mono_method_signature_internal (inv->imethod->method); + + if (signature->param_count == 0 && !signature->hasthis) + return g_string_free (str, FALSE); + + if (signature->hasthis) { + MonoMethod *method = inv->imethod->method; + dump_stackval (str, inv->stack, m_class_get_byval_arg (method->klass)); + } + + for (i = 0; i < signature->param_count; ++i) + dump_stackval (str, inv->stack + (!!signature->hasthis) + i, signature->params [i]); + + return g_string_free (str, FALSE); +} +#endif + +#define CHECK_ADD_OVERFLOW(a,b) \ + (gint32)(b) >= 0 ? (gint32)(G_MAXINT32) - (gint32)(b) < (gint32)(a) ? -1 : 0 \ + : (gint32)(G_MININT32) - (gint32)(b) > (gint32)(a) ? +1 : 0 + +#define CHECK_SUB_OVERFLOW(a,b) \ + (gint32)(b) < 0 ? (gint32)(G_MAXINT32) + (gint32)(b) < (gint32)(a) ? -1 : 0 \ + : (gint32)(G_MININT32) + (gint32)(b) > (gint32)(a) ? +1 : 0 + +#define CHECK_ADD_OVERFLOW_UN(a,b) \ + (guint32)(G_MAXUINT32) - (guint32)(b) < (guint32)(a) ? -1 : 0 + +#define CHECK_SUB_OVERFLOW_UN(a,b) \ + (guint32)(a) < (guint32)(b) ? -1 : 0 + +#define CHECK_ADD_OVERFLOW64(a,b) \ + (gint64)(b) >= 0 ? (gint64)(G_MAXINT64) - (gint64)(b) < (gint64)(a) ? -1 : 0 \ + : (gint64)(G_MININT64) - (gint64)(b) > (gint64)(a) ? +1 : 0 + +#define CHECK_SUB_OVERFLOW64(a,b) \ + (gint64)(b) < 0 ? (gint64)(G_MAXINT64) + (gint64)(b) < (gint64)(a) ? -1 : 0 \ + : (gint64)(G_MININT64) + (gint64)(b) > (gint64)(a) ? +1 : 0 + +#define CHECK_ADD_OVERFLOW64_UN(a,b) \ + (guint64)(G_MAXUINT64) - (guint64)(b) < (guint64)(a) ? -1 : 0 + +#define CHECK_SUB_OVERFLOW64_UN(a,b) \ + (guint64)(a) < (guint64)(b) ? -1 : 0 + +#if SIZEOF_VOID_P == 4 +#define CHECK_ADD_OVERFLOW_NAT(a,b) CHECK_ADD_OVERFLOW(a,b) +#define CHECK_ADD_OVERFLOW_NAT_UN(a,b) CHECK_ADD_OVERFLOW_UN(a,b) +#else +#define CHECK_ADD_OVERFLOW_NAT(a,b) CHECK_ADD_OVERFLOW64(a,b) +#define CHECK_ADD_OVERFLOW_NAT_UN(a,b) CHECK_ADD_OVERFLOW64_UN(a,b) +#endif + +/* Resolves to TRUE if the operands would overflow */ +#define CHECK_MUL_OVERFLOW(a,b) \ + ((gint32)(a) == 0) || ((gint32)(b) == 0) ? 0 : \ + (((gint32)(a) > 0) && ((gint32)(b) == -1)) ? FALSE : \ + (((gint32)(a) < 0) && ((gint32)(b) == -1)) ? (a == G_MININT32) : \ + (((gint32)(a) > 0) && ((gint32)(b) > 0)) ? (gint32)(a) > ((G_MAXINT32) / (gint32)(b)) : \ + (((gint32)(a) > 0) && ((gint32)(b) < 0)) ? (gint32)(a) > ((G_MININT32) / (gint32)(b)) : \ + (((gint32)(a) < 0) && ((gint32)(b) > 0)) ? (gint32)(a) < ((G_MININT32) / (gint32)(b)) : \ + (gint32)(a) < ((G_MAXINT32) / (gint32)(b)) + +#define CHECK_MUL_OVERFLOW_UN(a,b) \ + ((guint32)(a) == 0) || ((guint32)(b) == 0) ? 0 : \ + (guint32)(b) > ((G_MAXUINT32) / (guint32)(a)) + +#define CHECK_MUL_OVERFLOW64(a,b) \ + ((gint64)(a) == 0) || ((gint64)(b) == 0) ? 0 : \ + (((gint64)(a) > 0) && ((gint64)(b) == -1)) ? FALSE : \ + (((gint64)(a) < 0) && ((gint64)(b) == -1)) ? (a == G_MININT64) : \ + (((gint64)(a) > 0) && ((gint64)(b) > 0)) ? (gint64)(a) > ((G_MAXINT64) / (gint64)(b)) : \ + (((gint64)(a) > 0) && ((gint64)(b) < 0)) ? (gint64)(a) > ((G_MININT64) / (gint64)(b)) : \ + (((gint64)(a) < 0) && ((gint64)(b) > 0)) ? (gint64)(a) < ((G_MININT64) / (gint64)(b)) : \ + (gint64)(a) < ((G_MAXINT64) / (gint64)(b)) + +#define CHECK_MUL_OVERFLOW64_UN(a,b) \ + ((guint64)(a) == 0) || ((guint64)(b) == 0) ? 0 : \ + (guint64)(b) > ((G_MAXUINT64) / (guint64)(a)) + +#if SIZEOF_VOID_P == 4 +#define CHECK_MUL_OVERFLOW_NAT(a,b) CHECK_MUL_OVERFLOW(a,b) +#define CHECK_MUL_OVERFLOW_NAT_UN(a,b) CHECK_MUL_OVERFLOW_UN(a,b) +#else +#define CHECK_MUL_OVERFLOW_NAT(a,b) CHECK_MUL_OVERFLOW64(a,b) +#define CHECK_MUL_OVERFLOW_NAT_UN(a,b) CHECK_MUL_OVERFLOW64_UN(a,b) +#endif + +// Do not inline in case order of frame addresses matters. +static MONO_NEVER_INLINE MonoObject* +interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc, MonoError *error) +{ + ThreadContext *context = get_context (); + MonoMethodSignature *sig = mono_method_signature_internal (method); + stackval *sp = (stackval*)context->stack_pointer; + MonoMethod *target_method = method; + + error_init (error); + if (exc) + *exc = NULL; + + if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) + target_method = mono_marshal_get_native_wrapper (target_method, FALSE, FALSE); + MonoMethod *invoke_wrapper = mono_marshal_get_runtime_invoke_full (target_method, FALSE, TRUE); + + //* MonoObject *runtime_invoke (MonoObject *this_obj, void **params, MonoObject **exc, void* method) + + if (sig->hasthis) + sp [0].data.p = obj; + else + sp [0].data.p = NULL; + sp [1].data.p = params; + sp [2].data.p = exc; + sp [3].data.p = target_method; + + InterpMethod *imethod = mono_interp_get_imethod (invoke_wrapper); + + InterpFrame frame = {0}; + frame.imethod = imethod; + frame.stack = sp; + frame.retval = sp; + + // The method to execute might not be transformed yet, so we don't know how much stack + // it uses. We bump the stack_pointer here so any code triggered by method compilation + // will not attempt to use the space that we used to push the args for this method. + // The real top of stack for this method will be set in mono_interp_exec_method once the + // method is transformed. + context->stack_pointer = (guchar*)(sp + 4); + g_assert (context->stack_pointer < context->stack_end); + MH_LOG_INDENT(); + MH_LOG("calling mono_interp_exec_method for %s : %s", method->name, mono_method_full_name (method, TRUE)); + MONO_ENTER_GC_UNSAFE; + mono_interp_exec_method (&frame, context, NULL); + MONO_EXIT_GC_UNSAFE; + MH_LOG_UNINDENT(); + context->stack_pointer = (guchar*)sp; + + if (context->has_resume_state) { + /* + * This can happen on wasm where native frames cannot be skipped during EH. + * EH processing will continue when control returns to the interpreter. + */ + if (mono_aot_mode == MONO_AOT_MODE_LLVMONLY_INTERP) + mono_llvm_start_native_unwind (); + return NULL; + } + // The return value is at the bottom of the stack + return frame.stack->data.o; +} + +typedef struct { + InterpMethod *rmethod; + gpointer this_arg; + gpointer res; + gpointer args [16]; + gpointer *many_args; +} InterpEntryData; + +/* Main function for entering the interpreter from compiled code */ +// Do not inline in case order of frame addresses matters. +static MONO_NEVER_INLINE void +interp_entry (InterpEntryData *data) +{ + InterpMethod *rmethod; + ThreadContext *context; + stackval *sp; + int stack_index = 0; + MonoMethod *method; + MonoMethodSignature *sig; + MonoType *type; + gpointer orig_domain = NULL, attach_cookie; + int i; + + if ((gsize)data->rmethod & 1) { + /* Unbox */ + data->this_arg = mono_object_unbox_internal ((MonoObject*)data->this_arg); + data->rmethod = (InterpMethod*)(gpointer)((gsize)data->rmethod & ~1); + } + rmethod = data->rmethod; + + if (rmethod->needs_thread_attach) + orig_domain = mono_threads_attach_coop (mono_domain_get (), &attach_cookie); + + context = get_context (); + sp = (stackval*)context->stack_pointer; + + method = rmethod->method; + + if (rmethod->is_invoke) { + /* + * This happens when AOT code for the invoke wrapper is not found. + * Have to replace the method with the wrapper here, since the wrapper depends on the delegate. + */ + MonoDelegate *del = (MonoDelegate*)data->this_arg; + // FIXME: This is slow + method = mono_marshal_get_delegate_invoke (method, del); + data->rmethod = mono_interp_get_imethod (method); + } + + sig = mono_method_signature_internal (method); + + // FIXME: Optimize this + + if (sig->hasthis) { + sp->data.p = data->this_arg; + stack_index = 1; + } + + gpointer *params; + if (data->many_args) + params = data->many_args; + else + params = data->args; + for (i = 0; i < sig->param_count; ++i) { + int arg_offset = get_arg_offset_fast (rmethod, NULL, stack_index + i); + stackval *sval = STACK_ADD_ALIGNED_BYTES (sp, arg_offset); + + if (m_type_is_byref (sig->params [i])) + sval->data.p = params [i]; + else + stackval_from_data (sig->params [i], sval, params [i], FALSE); + } + + InterpFrame frame = {0}; + frame.imethod = data->rmethod; + frame.stack = sp; + frame.retval = sp; + + int params_size = get_arg_offset_fast (rmethod, NULL, stack_index + sig->param_count); + context->stack_pointer = (guchar*)ALIGN_TO ((guchar*)sp + params_size, MINT_STACK_ALIGNMENT); + g_assert (context->stack_pointer < context->stack_end); + + MONO_ENTER_GC_UNSAFE; + mono_interp_exec_method (&frame, context, NULL); + MONO_EXIT_GC_UNSAFE; + + context->stack_pointer = (guchar*)sp; + + if (rmethod->needs_thread_attach) + mono_threads_detach_coop (orig_domain, &attach_cookie); + + if (need_native_unwind (context)) { + mono_llvm_start_native_unwind (); + return; + } + + if (mono_llvm_only) { + if (context->has_resume_state) { + /* The exception will be handled in a frame above us */ + mono_llvm_start_native_unwind (); + // FIXME: Set dummy return value ? + return; + } + } else { + g_assert (!context->has_resume_state); + } + + // The return value is at the bottom of the stack, after the locals space + type = rmethod->rtype; + if (type->type != MONO_TYPE_VOID) + stackval_to_data (type, frame.stack, data->res, FALSE); +} + + +/* MONO_NO_OPTIMIZATION is needed due to usage of INTERP_PUSH_LMF_WITH_CTX. */ +#ifdef _MSC_VER +#pragma optimize ("", off) +#endif + +// Do not inline in case order of frame addresses matters, and maybe other reasons. +static MONO_NO_OPTIMIZATION MONO_NEVER_INLINE gpointer +do_icall_wrapper (InterpFrame *frame, MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval *sp, gpointer ptr, gboolean save_last_error, gboolean *gc_transitions) +{ + MonoLMFExt ext; + INTERP_PUSH_LMF_WITH_CTX (frame, ext, exit_icall); + MH_LOG_INDENT(); + MH_LOG("calling do_icall for %s : %s", frame->imethod->method->name, mono_method_full_name (frame->imethod->method, TRUE)); + if (*gc_transitions) { + MONO_ENTER_GC_SAFE; + do_icall (sig, op, ret_sp, sp, ptr, save_last_error); + MONO_EXIT_GC_SAFE; + *gc_transitions = FALSE; + } else { + do_icall (sig, op, ret_sp, sp, ptr, save_last_error); + } + MH_LOG_UNINDENT(); + interp_pop_lmf (&ext); + + goto exit_icall; // prevent unused label warning in some configurations + /* If an exception is thrown from native code, execution will continue here */ +exit_icall: + return NULL; +} +#ifdef _MSC_VER +#pragma optimize ("", on) +#endif + +typedef struct { + int pindex; + gpointer jit_wrapper; + gpointer *args; + gpointer extra_arg; + MonoFtnDesc ftndesc; +} JitCallCbData; + +/* Callback called by mono_llvm_catch_exception () */ +static void +jit_call_cb (gpointer arg) +{ + JitCallCbData *cb_data = (JitCallCbData*)arg; + gpointer jit_wrapper = cb_data->jit_wrapper; + int pindex = cb_data->pindex; + gpointer *args = cb_data->args; + gpointer ftndesc = cb_data->extra_arg; + + switch (pindex) { + case 0: { + typedef void (*T)(gpointer); + T func = (T)jit_wrapper; + + func (ftndesc); + break; + } + case 1: { + typedef void (*T)(gpointer, gpointer); + T func = (T)jit_wrapper; + + func (args [0], ftndesc); + break; + } + case 2: { + typedef void (*T)(gpointer, gpointer, gpointer); + T func = (T)jit_wrapper; + + func (args [0], args [1], ftndesc); + break; + } + case 3: { + typedef void (*T)(gpointer, gpointer, gpointer, gpointer); + T func = (T)jit_wrapper; + + func (args [0], args [1], args [2], ftndesc); + break; + } + case 4: { + typedef void (*T)(gpointer, gpointer, gpointer, gpointer, gpointer); + T func = (T)jit_wrapper; + + func (args [0], args [1], args [2], args [3], ftndesc); + break; + } + case 5: { + typedef void (*T)(gpointer, gpointer, gpointer, gpointer, gpointer, gpointer); + T func = (T)jit_wrapper; + + func (args [0], args [1], args [2], args [3], args [4], ftndesc); + break; + } + case 6: { + typedef void (*T)(gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer); + T func = (T)jit_wrapper; + + func (args [0], args [1], args [2], args [3], args [4], args [5], ftndesc); + break; + } + case 7: { + typedef void (*T)(gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer); + T func = (T)jit_wrapper; + + func (args [0], args [1], args [2], args [3], args [4], args [5], args [6], ftndesc); + break; + } + case 8: { + typedef void (*T)(gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer); + T func = (T)jit_wrapper; + + func (args [0], args [1], args [2], args [3], args [4], args [5], args [6], args [7], ftndesc); + break; + } + case 9: { + typedef void (*T)(gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer); + T func = (T)jit_wrapper; + + func (args [0], args [1], args [2], args [3], args [4], args [5], args [6], args [7], args [8], ftndesc); + break; + } + case 10: { + typedef void (*T)(gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer); + T func = (T)jit_wrapper; + + func (args [0], args [1], args [2], args [3], args [4], args [5], args [6], args [7], args [8], args [9], ftndesc); + break; + } + case 11: { + typedef void (*T)(gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer); + T func = (T)jit_wrapper; + + func (args [0], args [1], args [2], args [3], args [4], args [5], args [6], args [7], args [8], args [9], args [10], ftndesc); + break; + } + case 12: { + typedef void (*T)(gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer); + T func = (T)jit_wrapper; + + func (args [0], args [1], args [2], args [3], args [4], args [5], args [6], args [7], args [8], args [9], args [10], args [11], ftndesc); + break; + } + default: + g_assert_not_reached (); + break; + } +} + +enum { + /* Pass stackval->data.p */ + JIT_ARG_BYVAL, + /* Pass &stackval->data.p */ + JIT_ARG_BYREF +}; + +enum { + JIT_RET_VOID, + JIT_RET_SCALAR, + JIT_RET_VTYPE +}; + +typedef struct _JitCallInfo JitCallInfo; +struct _JitCallInfo { + gpointer addr; + gpointer extra_arg; + gpointer wrapper; + MonoMethodSignature *sig; + guint8 *arginfo; + gint32 res_size; + int ret_mt; + gboolean no_wrapper; +#if HOST_BROWSER + int hit_count; + WasmJitCallThunk jiterp_thunk; +#endif +}; + +static MONO_NEVER_INLINE void +init_jit_call_info (InterpMethod *rmethod, MonoError *error) +{ + MonoMethodSignature *sig; + JitCallInfo *cinfo; + + //printf ("jit_call: %s\n", mono_method_full_name (rmethod->method, 1)); + + MonoMethod *method = rmethod->method; + + // FIXME: Memory management + cinfo = g_new0 (JitCallInfo, 1); + + sig = mono_method_signature_internal (method); + g_assert (sig); + + gpointer addr = mono_jit_compile_method_jit_only (method, error); + return_if_nok (error); + g_assert (addr); + + gboolean need_wrapper = TRUE; + if (mono_llvm_only) { + MonoAotMethodFlags flags = mono_aot_get_method_flags (addr); + + if (flags & MONO_AOT_METHOD_FLAG_GSHAREDVT_VARIABLE) { + /* + * The callee already has a gsharedvt signature, we can call it directly + * instead of through a gsharedvt out wrapper. + */ + need_wrapper = FALSE; + cinfo->no_wrapper = TRUE; + } + } + + gpointer jit_wrapper = NULL; + if (need_wrapper) { + MonoMethod *wrapper = mini_get_gsharedvt_out_sig_wrapper (sig); + jit_wrapper = mono_jit_compile_method_jit_only (wrapper, error); + mono_error_assert_ok (error); + } + + if (mono_llvm_only) { + gboolean caller_gsharedvt = !need_wrapper; + cinfo->addr = mini_llvmonly_add_method_wrappers (method, addr, caller_gsharedvt, FALSE, &cinfo->extra_arg); + } else { + cinfo->addr = addr; + } + + cinfo->sig = sig; + cinfo->wrapper = jit_wrapper; + + if (sig->ret->type != MONO_TYPE_VOID) { + int mt = mono_mint_type (sig->ret); + if (mt == MINT_TYPE_VT) { + MonoClass *klass = mono_class_from_mono_type_internal (sig->ret); + /* + * We cache this size here, instead of the instruction stream of the + * calling instruction, to save space for common callvirt instructions + * that could end up doing a jit call. + */ + gint32 size = mono_class_value_size (klass, NULL); + cinfo->res_size = ALIGN_TO (size, MINT_STACK_SLOT_SIZE); + } else { + cinfo->res_size = MINT_STACK_SLOT_SIZE; + } + cinfo->ret_mt = mt; + } else { + cinfo->ret_mt = -1; + } + + if (sig->param_count) { + cinfo->arginfo = g_new0 (guint8, sig->param_count); + + for (guint i = 0; i < rmethod->param_count; ++i) { + MonoType *t = rmethod->param_types [i]; + int mt = mono_mint_type (t); + if (m_type_is_byref (sig->params [i])) { + cinfo->arginfo [i] = JIT_ARG_BYVAL; + } else if (mt == MINT_TYPE_O) { + cinfo->arginfo [i] = JIT_ARG_BYREF; + } else { + /* stackval->data is an union */ + cinfo->arginfo [i] = JIT_ARG_BYREF; + } + } + } + + mono_memory_barrier (); + rmethod->jit_call_info = cinfo; +} + +#if HOST_BROWSER +EMSCRIPTEN_KEEPALIVE void +mono_jiterp_register_jit_call_thunk (void *cinfo, WasmJitCallThunk thunk) { + ((JitCallInfo*)cinfo)->jiterp_thunk = thunk; +} +#endif + +static MONO_NEVER_INLINE void +do_jit_call (ThreadContext *context, stackval *ret_sp, stackval *sp, InterpFrame *frame, InterpMethod *rmethod, MonoError *error) +{ + MonoLMFExt ext; + JitCallInfo *cinfo; + gboolean thrown = FALSE; + + //printf ("jit_call: %s\n", mono_method_full_name (rmethod->method, 1)); + + /* + * Call JITted code through a gsharedvt_out wrapper. These wrappers receive every argument + * by ref and return a return value using an explicit return value argument. + */ + if (G_UNLIKELY (!rmethod->jit_call_info)) { + init_jit_call_info (rmethod, error); + mono_error_assert_ok (error); + } + + cinfo = (JitCallInfo*)rmethod->jit_call_info; + +#if JITERPRETER_ENABLE_JIT_CALL_TRAMPOLINES + // The jiterpreter will compile a unique thunk for each do_jit_call call site if it is hot + // enough to justify it. At that point we can invoke the thunk to efficiently do most of + // the work that would normally be done by do_jit_call + if (mono_opt_jiterpreter_jit_call_enabled) { + // FIXME: Thread safety for the thunk pointer + WasmJitCallThunk thunk = cinfo->jiterp_thunk; + if (thunk) { + MonoFtnDesc ftndesc = {0}; + ftndesc.addr = cinfo->addr; + ftndesc.arg = cinfo->extra_arg; + interp_push_lmf (&ext, frame); + if ( + mono_opt_jiterpreter_wasm_eh_enabled || + (mono_aot_mode != MONO_AOT_MODE_LLVMONLY_INTERP) + ) { + // WASM EH is available or we are otherwise in a situation where we know + // that the jiterpreter thunk was compiled with exception handling built-in + // so we can just invoke it directly and errors will be handled + thunk (ret_sp, sp, &ftndesc, &thrown); + } else { + // Call a special JS function that will invoke the compiled jiterpreter thunk + // and trap errors for us to set the thrown flag + mono_interp_invoke_wasm_jit_call_trampoline ( + thunk, ret_sp, sp, &ftndesc, &thrown + ); + } + interp_pop_lmf (&ext); + + // We reuse do_jit_call's epilogue to do things like propagate thrown exceptions + // and sign-extend return values instead of inlining that logic into every thunk + // the dummy implementation sets a special value into thrown to indicate that + // we need to go through the slow path because this thread has no thunk yet + if (G_UNLIKELY (thrown == 999)) + thrown = 0; + else + goto epilogue; + } else { + int old_count = mono_jiterp_increment_counter (&cinfo->hit_count); + // If our hit count just reached the threshold, we request that a thunk be jitted + // for this specific call site. It will go into a queue and wait until there + // are enough jit calls waiting to be compiled into one WASM module + if (old_count == mono_opt_jiterpreter_jit_call_trampoline_hit_count) { + mono_interp_jit_wasm_jit_call_trampoline ( + rmethod->method, rmethod, cinfo, + initialize_arg_offsets(rmethod, mono_method_signature_internal (rmethod->method)), + mono_aot_mode == MONO_AOT_MODE_LLVMONLY_INTERP + ); + } else { + int excess = old_count - mono_opt_jiterpreter_jit_call_queue_flush_threshold; + // If our hit count just reached the flush threshold, that means that we + // previously requested compilation for this call site and it didn't + // happen yet. We will request a flush of the entire queue this one + // time which will probably result in it being compiled + if (excess == 0) + mono_interp_flush_jitcall_queue (); + } + } + } +#endif + + /* + * Convert the arguments on the interpreter stack to the format expected by the gsharedvt_out wrapper. + */ + gpointer args [32]; + int pindex = 0; + int stack_index = 0; + if (rmethod->hasthis) { + args [pindex ++] = sp [0].data.p; + stack_index ++; + } + /* return address */ + if (cinfo->ret_mt != -1) + args [pindex ++] = ret_sp; + for (guint i = 0; i < rmethod->param_count; ++i) { + stackval *sval = STACK_ADD_ALIGNED_BYTES (sp, get_arg_offset_fast (rmethod, NULL, stack_index + i)); + if (cinfo->arginfo [i] == JIT_ARG_BYVAL) + args [pindex ++] = sval->data.p; + else + /* data is an union, so can use 'p' for all types */ + args [pindex ++] = sval; + } + + JitCallCbData cb_data; + cb_data.pindex = pindex; + cb_data.args = args; + cb_data.ftndesc.interp_method = NULL; + cb_data.ftndesc.method = NULL; + if (cinfo->no_wrapper) { + cb_data.ftndesc.addr = NULL; + cb_data.ftndesc.arg = NULL; + cb_data.jit_wrapper = cinfo->addr; + cb_data.extra_arg = cinfo->extra_arg; + } else { + cb_data.ftndesc.addr = cinfo->addr; + cb_data.ftndesc.arg = cinfo->extra_arg; + cb_data.jit_wrapper = cinfo->wrapper; + cb_data.extra_arg = &cb_data.ftndesc; + } + + interp_push_lmf (&ext, frame); + + if (mono_aot_mode == MONO_AOT_MODE_LLVMONLY_INTERP) { + /* Catch the exception thrown by the native code using a try-catch */ + mono_llvm_catch_exception (jit_call_cb, &cb_data, &thrown); + } else { + jit_call_cb (&cb_data); + } + + interp_pop_lmf (&ext); + +#if JITERPRETER_ENABLE_JIT_CALL_TRAMPOLINES +epilogue: +#endif + if (thrown) { + if (context->has_resume_state) + /* + * This happens when interp_entry calls mono_llvm_reraise_exception (). + */ + return; + MonoJitTlsData *jit_tls = mono_get_jit_tls (); + if (jit_tls->resume_state.il_state) { + /* + * This c++ exception is going to be caught by an AOTed frame above us. + * We can't rethrow here, since that will skip the cleanup of the + * interpreter stack space etc. So instruct the interpreter to unwind. + */ + context->has_resume_state = TRUE; + context->handler_frame = NULL; + return; + } + MonoObject *obj = mini_llvmonly_load_exception (); + g_assert (obj); + mini_llvmonly_clear_exception (); + mono_error_set_exception_instance (error, (MonoException*)obj); + return; + } + if (cinfo->ret_mt != -1) { + // Sign/zero extend if necessary + switch (cinfo->ret_mt) { + case MINT_TYPE_I1: + ret_sp->data.i = *(gint8*)ret_sp; + break; + case MINT_TYPE_U1: + ret_sp->data.i = *(guint8*)ret_sp; + break; + case MINT_TYPE_I2: + ret_sp->data.i = *(gint16*)ret_sp; + break; + case MINT_TYPE_U2: + ret_sp->data.i = *(guint16*)ret_sp; + break; + case MINT_TYPE_I4: + case MINT_TYPE_I8: + case MINT_TYPE_R4: + case MINT_TYPE_R8: + case MINT_TYPE_VT: + case MINT_TYPE_O: + /* The result was written to ret_sp */ + break; + default: + g_assert_not_reached (); + } + } +} + +static MONO_NEVER_INLINE void +do_debugger_tramp (void (*tramp) (void), InterpFrame *frame) +{ + MonoLMFExt ext; + interp_push_lmf (&ext, frame); + tramp (); + interp_pop_lmf (&ext); +} + +static MONO_NEVER_INLINE MonoException* +do_transform_method (InterpMethod *imethod, InterpFrame *frame, ThreadContext *context) +{ + MonoLMFExt ext; + /* Don't push lmf if we have no interp data */ + gboolean push_lmf = frame->parent != NULL; + MonoException *ex = NULL; + ERROR_DECL (error); + + /* Use the parent frame as the current frame is not complete yet */ + if (push_lmf) + interp_push_lmf (&ext, frame->parent); + +#if DEBUG_INTERP + if (imethod->method) { + char* mn = mono_method_full_name (imethod->method, TRUE); + g_print ("(%p) Transforming %s\n", mono_thread_internal_current (), mn); + g_free (mn); + } +#endif + + mono_interp_transform_method (imethod, context, error); + if (!is_ok (error)) + ex = mono_error_convert_to_exception (error); + + if (push_lmf) + interp_pop_lmf (&ext); + + return ex; +} + +static void +init_arglist (InterpFrame *frame, MonoMethodSignature *sig, stackval *sp, char *arglist) +{ + *(gpointer*)arglist = sig; + arglist += sizeof (gpointer); + + for (int i = sig->sentinelpos; i < sig->param_count; i++) { + int align, arg_size, sv_size; + arg_size = mono_type_stack_size (sig->params [i], &align); + arglist = (char*)ALIGN_PTR_TO (arglist, align); + + sv_size = stackval_to_data (sig->params [i], sp, arglist, FALSE); + arglist += arg_size; + sp = STACK_ADD_BYTES (sp, sv_size); + } +} + +/* + * These functions are the entry points into the interpreter from compiled code. + * They are called by the interp_in wrappers. They have the following signature: + * void (, , , ..., , ) + * They pack up their arguments into an InterpEntryData structure and call interp_entry (). + * It would be possible for the wrappers to pack up the arguments etc, but that would make them bigger, and there are + * more wrappers then these functions. + * this/static * ret/void * 16 arguments -> 64 functions. + */ + +#if HOST_BROWSER +/* + * For the jiterpreter, we want to record a hit count for interp_entry wrappers that can + * be jitted, but not for ones that can't. As a result we need to put this in its own + * macro instead of in INTERP_ENTRY_BASE, so that the generic wrappers don't have to + * call it on every invocation. + * Once this gets called a few hundred times, the wrapper will be jitted so we'll stop + * paying the cost of the hit counter and the entry will become faster. + */ +#define INTERP_ENTRY_UPDATE_HIT_COUNT(_method) \ + if (mono_opt_jiterpreter_interp_entry_enabled) \ + mono_interp_record_interp_entry (_method) +#else +#define INTERP_ENTRY_UPDATE_HIT_COUNT(_method) +#endif + +#define INTERP_ENTRY_BASE(_method, _this_arg, _res) \ + InterpEntryData data; \ + (data).rmethod = (_method); \ + (data).res = (_res); \ + (data).this_arg = (_this_arg); \ + (data).many_args = NULL; + +#define INTERP_ENTRY_BASE_WITH_HIT_COUNT(_method, _this_arg, _res) \ + INTERP_ENTRY_BASE (_method, _this_arg, _res) \ + INTERP_ENTRY_UPDATE_HIT_COUNT (_method); + +#define INTERP_ENTRY0(_this_arg, _res, _method) { \ + INTERP_ENTRY_BASE_WITH_HIT_COUNT (_method, _this_arg, _res); \ + interp_entry (&data); \ + } +#define INTERP_ENTRY1(_this_arg, _res, _method) { \ + INTERP_ENTRY_BASE_WITH_HIT_COUNT (_method, _this_arg, _res); \ + (data).args [0] = arg1; \ + interp_entry (&data); \ + } +#define INTERP_ENTRY2(_this_arg, _res, _method) { \ + INTERP_ENTRY_BASE_WITH_HIT_COUNT (_method, _this_arg, _res); \ + (data).args [0] = arg1; \ + (data).args [1] = arg2; \ + interp_entry (&data); \ + } +#define INTERP_ENTRY3(_this_arg, _res, _method) { \ + INTERP_ENTRY_BASE_WITH_HIT_COUNT (_method, _this_arg, _res); \ + (data).args [0] = arg1; \ + (data).args [1] = arg2; \ + (data).args [2] = arg3; \ + interp_entry (&data); \ + } +#define INTERP_ENTRY4(_this_arg, _res, _method) { \ + INTERP_ENTRY_BASE_WITH_HIT_COUNT (_method, _this_arg, _res); \ + (data).args [0] = arg1; \ + (data).args [1] = arg2; \ + (data).args [2] = arg3; \ + (data).args [3] = arg4; \ + interp_entry (&data); \ + } +#define INTERP_ENTRY5(_this_arg, _res, _method) { \ + INTERP_ENTRY_BASE_WITH_HIT_COUNT (_method, _this_arg, _res); \ + (data).args [0] = arg1; \ + (data).args [1] = arg2; \ + (data).args [2] = arg3; \ + (data).args [3] = arg4; \ + (data).args [4] = arg5; \ + interp_entry (&data); \ + } +#define INTERP_ENTRY6(_this_arg, _res, _method) { \ + INTERP_ENTRY_BASE_WITH_HIT_COUNT (_method, _this_arg, _res); \ + (data).args [0] = arg1; \ + (data).args [1] = arg2; \ + (data).args [2] = arg3; \ + (data).args [3] = arg4; \ + (data).args [4] = arg5; \ + (data).args [5] = arg6; \ + interp_entry (&data); \ + } +#define INTERP_ENTRY7(_this_arg, _res, _method) { \ + INTERP_ENTRY_BASE_WITH_HIT_COUNT (_method, _this_arg, _res); \ + (data).args [0] = arg1; \ + (data).args [1] = arg2; \ + (data).args [2] = arg3; \ + (data).args [3] = arg4; \ + (data).args [4] = arg5; \ + (data).args [5] = arg6; \ + (data).args [6] = arg7; \ + interp_entry (&data); \ + } +#define INTERP_ENTRY8(_this_arg, _res, _method) { \ + INTERP_ENTRY_BASE_WITH_HIT_COUNT (_method, _this_arg, _res); \ + (data).args [0] = arg1; \ + (data).args [1] = arg2; \ + (data).args [2] = arg3; \ + (data).args [3] = arg4; \ + (data).args [4] = arg5; \ + (data).args [5] = arg6; \ + (data).args [6] = arg7; \ + (data).args [7] = arg8; \ + interp_entry (&data); \ + } + +#define ARGLIST0 InterpMethod *rmethod +#define ARGLIST1 gpointer arg1, InterpMethod *rmethod +#define ARGLIST2 gpointer arg1, gpointer arg2, InterpMethod *rmethod +#define ARGLIST3 gpointer arg1, gpointer arg2, gpointer arg3, InterpMethod *rmethod +#define ARGLIST4 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, InterpMethod *rmethod +#define ARGLIST5 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, InterpMethod *rmethod +#define ARGLIST6 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, gpointer arg6, InterpMethod *rmethod +#define ARGLIST7 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, gpointer arg6, gpointer arg7, InterpMethod *rmethod +#define ARGLIST8 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, gpointer arg6, gpointer arg7, gpointer arg8, InterpMethod *rmethod + +static void interp_entry_static_0 (ARGLIST0) INTERP_ENTRY0 (NULL, NULL, rmethod) +static void interp_entry_static_1 (ARGLIST1) INTERP_ENTRY1 (NULL, NULL, rmethod) +static void interp_entry_static_2 (ARGLIST2) INTERP_ENTRY2 (NULL, NULL, rmethod) +static void interp_entry_static_3 (ARGLIST3) INTERP_ENTRY3 (NULL, NULL, rmethod) +static void interp_entry_static_4 (ARGLIST4) INTERP_ENTRY4 (NULL, NULL, rmethod) +static void interp_entry_static_5 (ARGLIST5) INTERP_ENTRY5 (NULL, NULL, rmethod) +static void interp_entry_static_6 (ARGLIST6) INTERP_ENTRY6 (NULL, NULL, rmethod) +static void interp_entry_static_7 (ARGLIST7) INTERP_ENTRY7 (NULL, NULL, rmethod) +static void interp_entry_static_8 (ARGLIST8) INTERP_ENTRY8 (NULL, NULL, rmethod) +static void interp_entry_static_ret_0 (gpointer res, ARGLIST0) INTERP_ENTRY0 (NULL, res, rmethod) +static void interp_entry_static_ret_1 (gpointer res, ARGLIST1) INTERP_ENTRY1 (NULL, res, rmethod) +static void interp_entry_static_ret_2 (gpointer res, ARGLIST2) INTERP_ENTRY2 (NULL, res, rmethod) +static void interp_entry_static_ret_3 (gpointer res, ARGLIST3) INTERP_ENTRY3 (NULL, res, rmethod) +static void interp_entry_static_ret_4 (gpointer res, ARGLIST4) INTERP_ENTRY4 (NULL, res, rmethod) +static void interp_entry_static_ret_5 (gpointer res, ARGLIST5) INTERP_ENTRY5 (NULL, res, rmethod) +static void interp_entry_static_ret_6 (gpointer res, ARGLIST6) INTERP_ENTRY6 (NULL, res, rmethod) +static void interp_entry_static_ret_7 (gpointer res, ARGLIST7) INTERP_ENTRY7 (NULL, res, rmethod) +static void interp_entry_static_ret_8 (gpointer res, ARGLIST8) INTERP_ENTRY8 (NULL, res, rmethod) +static void interp_entry_instance_0 (gpointer this_arg, ARGLIST0) INTERP_ENTRY0 (this_arg, NULL, rmethod) +static void interp_entry_instance_1 (gpointer this_arg, ARGLIST1) INTERP_ENTRY1 (this_arg, NULL, rmethod) +static void interp_entry_instance_2 (gpointer this_arg, ARGLIST2) INTERP_ENTRY2 (this_arg, NULL, rmethod) +static void interp_entry_instance_3 (gpointer this_arg, ARGLIST3) INTERP_ENTRY3 (this_arg, NULL, rmethod) +static void interp_entry_instance_4 (gpointer this_arg, ARGLIST4) INTERP_ENTRY4 (this_arg, NULL, rmethod) +static void interp_entry_instance_5 (gpointer this_arg, ARGLIST5) INTERP_ENTRY5 (this_arg, NULL, rmethod) +static void interp_entry_instance_6 (gpointer this_arg, ARGLIST6) INTERP_ENTRY6 (this_arg, NULL, rmethod) +static void interp_entry_instance_7 (gpointer this_arg, ARGLIST7) INTERP_ENTRY7 (this_arg, NULL, rmethod) +static void interp_entry_instance_8 (gpointer this_arg, ARGLIST8) INTERP_ENTRY8 (this_arg, NULL, rmethod) +static void interp_entry_instance_ret_0 (gpointer this_arg, gpointer res, ARGLIST0) INTERP_ENTRY0 (this_arg, res, rmethod) +static void interp_entry_instance_ret_1 (gpointer this_arg, gpointer res, ARGLIST1) INTERP_ENTRY1 (this_arg, res, rmethod) +static void interp_entry_instance_ret_2 (gpointer this_arg, gpointer res, ARGLIST2) INTERP_ENTRY2 (this_arg, res, rmethod) +static void interp_entry_instance_ret_3 (gpointer this_arg, gpointer res, ARGLIST3) INTERP_ENTRY3 (this_arg, res, rmethod) +static void interp_entry_instance_ret_4 (gpointer this_arg, gpointer res, ARGLIST4) INTERP_ENTRY4 (this_arg, res, rmethod) +static void interp_entry_instance_ret_5 (gpointer this_arg, gpointer res, ARGLIST5) INTERP_ENTRY5 (this_arg, res, rmethod) +static void interp_entry_instance_ret_6 (gpointer this_arg, gpointer res, ARGLIST6) INTERP_ENTRY6 (this_arg, res, rmethod) +static void interp_entry_instance_ret_7 (gpointer this_arg, gpointer res, ARGLIST7) INTERP_ENTRY7 (this_arg, res, rmethod) +static void interp_entry_instance_ret_8 (gpointer this_arg, gpointer res, ARGLIST8) INTERP_ENTRY8 (this_arg, res, rmethod) + +#define INTERP_ENTRY_FUNCLIST(type) (gpointer)interp_entry_ ## type ## _0, (gpointer)interp_entry_ ## type ## _1, (gpointer)interp_entry_ ## type ## _2, (gpointer)interp_entry_ ## type ## _3, (gpointer)interp_entry_ ## type ## _4, (gpointer)interp_entry_ ## type ## _5, (gpointer)interp_entry_ ## type ## _6, (gpointer)interp_entry_ ## type ## _7, (gpointer)interp_entry_ ## type ## _8 + +static gpointer entry_funcs_static [MAX_INTERP_ENTRY_ARGS + 1] = { INTERP_ENTRY_FUNCLIST (static) }; +static gpointer entry_funcs_static_ret [MAX_INTERP_ENTRY_ARGS + 1] = { INTERP_ENTRY_FUNCLIST (static_ret) }; +static gpointer entry_funcs_instance [MAX_INTERP_ENTRY_ARGS + 1] = { INTERP_ENTRY_FUNCLIST (instance) }; +static gpointer entry_funcs_instance_ret [MAX_INTERP_ENTRY_ARGS + 1] = { INTERP_ENTRY_FUNCLIST (instance_ret) }; + +/* General version for methods with more than MAX_INTERP_ENTRY_ARGS arguments */ +static void +interp_entry_general (gpointer this_arg, gpointer res, gpointer *args, gpointer rmethod) +{ + INTERP_ENTRY_BASE ((InterpMethod*)rmethod, this_arg, res); + data.many_args = args; + interp_entry (&data); +} + +#ifdef MONO_ARCH_HAVE_INTERP_ENTRY_TRAMPOLINE + +// Do not inline in case order of frame addresses matters. +static MONO_NEVER_INLINE void +interp_entry_from_trampoline (gpointer ccontext_untyped, gpointer rmethod_untyped) +{ + ThreadContext *context; + stackval *sp; + MonoMethod *method; + MonoMethodSignature *sig; + CallContext *ccontext = (CallContext*) ccontext_untyped; + InterpMethod *rmethod = (InterpMethod*) rmethod_untyped; + gpointer orig_domain = NULL, attach_cookie; + int i; + + if (rmethod->needs_thread_attach) + orig_domain = mono_threads_attach_coop (mono_domain_get (), &attach_cookie); + + context = get_context (); + sp = (stackval*)context->stack_pointer; + + method = rmethod->method; + sig = mono_method_signature_internal (method); + if (method->string_ctor) { + MonoMethodSignature *newsig = (MonoMethodSignature*)g_alloca (MONO_SIZEOF_METHOD_SIGNATURE + ((sig->param_count + 2) * sizeof (MonoType*))); + memcpy (newsig, sig, mono_metadata_signature_size (sig)); + newsig->ret = m_class_get_byval_arg (mono_defaults.string_class); + sig = newsig; + } + + InterpFrame frame = {0}; + frame.imethod = rmethod; + frame.stack = sp; + frame.retval = sp; + + gpointer call_info = mono_arch_get_interp_native_call_info (NULL, sig); + + /* Copy the args saved in the trampoline to the frame stack */ + gpointer retp = mono_arch_get_native_call_context_args (ccontext, &frame, sig, call_info); + +#ifdef MONO_ARCH_HAVE_SWIFTCALL + int swift_error_arg_index = -1; + gpointer swift_error_data; + gpointer* swift_error_pointer; + if (mono_method_signature_has_ext_callconv (sig, MONO_EXT_CALLCONV_SWIFTCALL)) { + swift_error_data = mono_arch_get_swift_error (ccontext, sig, &swift_error_arg_index); + + int swift_error_offset = frame.imethod->swift_error_offset; + if (swift_error_offset >= 0) { + swift_error_pointer = (gpointer*)((guchar*)frame.stack + swift_error_offset); + *swift_error_pointer = *(gpointer*)swift_error_data; + } + } +#endif + + /* Allocate storage for value types */ + stackval *newsp = sp; + /* FIXME we should reuse computation on imethod for this */ + if (sig->hasthis) + newsp++; + for (i = 0; i < sig->param_count; i++) { + MonoType *type = sig->params [i]; + int size; + + if (type->type == MONO_TYPE_GENERICINST && !MONO_TYPE_IS_REFERENCE (type)) { + size = mono_class_value_size (mono_class_from_mono_type_internal (type), NULL); + } else if (type->type == MONO_TYPE_VALUETYPE) { + if (sig->pinvoke && !sig->marshalling_disabled) + size = mono_class_native_size (m_type_data_get_klass_unchecked (type), NULL); + else + size = mono_class_value_size (m_type_data_get_klass_unchecked (type), NULL); + } else { + size = MINT_STACK_SLOT_SIZE; + } +#ifdef MONO_ARCH_HAVE_SWIFTCALL + if (swift_error_arg_index >= 0 && swift_error_arg_index == i) + newsp->data.p = swift_error_pointer; +#endif + newsp = STACK_ADD_BYTES (newsp, size); + } + newsp = (stackval*)ALIGN_TO (newsp, MINT_STACK_ALIGNMENT); + context->stack_pointer = (guchar*)newsp; + g_assert (context->stack_pointer < context->stack_end); + + MONO_ENTER_GC_UNSAFE; + mono_interp_exec_method (&frame, context, NULL); + MONO_EXIT_GC_UNSAFE; + +#ifdef MONO_ARCH_HAVE_SWIFTCALL + if (swift_error_arg_index >= 0) + *(gpointer*)swift_error_data = *(gpointer*)swift_error_pointer; +#endif + + context->stack_pointer = (guchar*)sp; + g_assert (!context->has_resume_state); + + if (rmethod->needs_thread_attach) + mono_threads_detach_coop (orig_domain, &attach_cookie); + + if (need_native_unwind (context)) { + mono_llvm_start_native_unwind (); + return; + } + + /* Write back the return value */ + /* 'frame' is still valid */ + mono_arch_set_native_call_context_ret (ccontext, &frame, sig, call_info, retp); + + mono_arch_free_interp_native_call_info (call_info); +} + +#else + +static void +interp_entry_from_trampoline (gpointer ccontext_untyped, gpointer rmethod_untyped) +{ + g_assert_not_reached (); +} + +#endif /* MONO_ARCH_HAVE_INTERP_ENTRY_TRAMPOLINE */ + +static void +interp_entry_llvmonly (gpointer res, gpointer *args, gpointer imethod_untyped) +{ + InterpMethod *imethod = (InterpMethod*)imethod_untyped; + + if (imethod->hasthis) + interp_entry_general (*(gpointer*)(args [0]), res, args + 1, imethod); + else + interp_entry_general (NULL, res, args, imethod); +} + +static gpointer +interp_get_interp_method (MonoMethod *method) +{ + return mono_interp_get_imethod (method); +} + +static MonoJitInfo* +interp_compile_interp_method (MonoMethod *method, MonoError *error) +{ + InterpMethod *imethod = mono_interp_get_imethod (method); + + if (!imethod->transformed) { + mono_interp_transform_method (imethod, get_context (), error); + return_val_if_nok (error, NULL); + } + + return imethod->jinfo; +} + +#ifndef MONO_ARCH_HAVE_INTERP_NATIVE_TO_MANAGED +static void +interp_no_native_to_managed (void) +{ + g_error ("interpreter: native-to-managed transition not available on this platform"); +} +#endif + +static void +no_llvmonly_interp_method_pointer (void) +{ + g_assert_not_reached (); +} + +/* + * interp_create_method_pointer_llvmonly: + * + * Return an ftndesc for entering the interpreter and executing METHOD. + */ +static MonoFtnDesc* +interp_create_method_pointer_llvmonly (MonoMethod *method, gboolean unbox, MonoError *error) +{ + gpointer addr, entry_func = NULL, entry_wrapper; + MonoMethodSignature *sig; + MonoMethod *wrapper; + InterpMethod *imethod; + + imethod = mono_interp_get_imethod (method); + + if (unbox) { + if (imethod->llvmonly_unbox_entry) + return (MonoFtnDesc*)imethod->llvmonly_unbox_entry; + } else { + if (imethod->jit_entry) + return (MonoFtnDesc*)imethod->jit_entry; + } + + sig = mono_method_signature_internal (method); + + /* + * The entry functions need access to the method to call, so we have + * to use a ftndesc. The caller uses a normal signature, while the + * entry functions use a gsharedvt_in signature, so wrap the entry function in + * a gsharedvt_in_sig wrapper. + * We use a gsharedvt_in_sig wrapper instead of an interp_in wrapper, because they + * are mostly the same, and they are already generated. The exception is the + * wrappers for methods with more than 8 arguments, those are different. + */ + if (sig->param_count > MAX_INTERP_ENTRY_ARGS) + wrapper = mini_get_interp_in_wrapper (sig); + else + wrapper = mini_get_gsharedvt_in_sig_wrapper (sig); + + entry_wrapper = mono_jit_compile_method_jit_only (wrapper, error); + mono_error_assertf_ok (error, "couldn't compile wrapper \"%s\" for \"%s\"", + mono_method_get_name_full (wrapper, TRUE, TRUE, MONO_TYPE_NAME_FORMAT_IL), + mono_method_get_name_full (method, TRUE, TRUE, MONO_TYPE_NAME_FORMAT_IL)); + + if (sig->param_count > MAX_INTERP_ENTRY_ARGS) { + entry_func = (gpointer)interp_entry_general; + } else if (sig->hasthis) { + if (sig->ret->type == MONO_TYPE_VOID) + entry_func = entry_funcs_instance [sig->param_count]; + else + entry_func = entry_funcs_instance_ret [sig->param_count]; + } else { + if (sig->ret->type == MONO_TYPE_VOID) + entry_func = entry_funcs_static [sig->param_count]; + else + entry_func = entry_funcs_static_ret [sig->param_count]; + } + g_assert (entry_func); + +#if HOST_BROWSER + // FIXME: We don't support generating wasm trampolines for high arg counts yet + if ( + (sig->param_count <= MAX_INTERP_ENTRY_ARGS) && + mono_opt_jiterpreter_interp_entry_enabled + ) { + jiterp_preserve_module(); + + gpointer wasm_entry_func = mono_interp_jit_wasm_entry_trampoline ( + imethod, method, sig->param_count, (MonoType *)sig->params, + unbox, sig->hasthis, sig->ret->type != MONO_TYPE_VOID, + entry_func + ); + + // Compiling a trampoline can fail for various reasons, so in that case we will fall back to the pre-existing ones below + if (wasm_entry_func) + entry_func = wasm_entry_func; + } +#endif + + /* Encode unbox in the lower bit of imethod */ + gpointer entry_arg = imethod; + if (unbox) + entry_arg = (gpointer)(((gsize)entry_arg) | 1); + + MonoFtnDesc *entry_ftndesc = mini_llvmonly_create_ftndesc (method, entry_func, entry_arg); + + addr = mini_llvmonly_create_ftndesc (method, entry_wrapper, entry_ftndesc); + + mono_memory_barrier (); + if (unbox) + imethod->llvmonly_unbox_entry = addr; + else + imethod->jit_entry = addr; + + return (MonoFtnDesc*)addr; +} + +/* + * interp_create_method_pointer: + * + * Return a function pointer which can be used to call METHOD using the + * interpreter. Return NULL for methods which are not supported. + */ +static gpointer +interp_create_method_pointer (MonoMethod *method, gboolean compile, MonoError *error) +{ + gpointer addr, entry_func, entry_wrapper = NULL; + InterpMethod *imethod = mono_interp_get_imethod (method); + + if (imethod->jit_entry) + return imethod->jit_entry; + + if (compile && !imethod->transformed) { + /* Return any errors from method compilation */ + mono_interp_transform_method (imethod, get_context (), error); + return_val_if_nok (error, NULL); + } + + MonoMethodSignature *sig = mono_method_signature_internal (method); + if (method->string_ctor) { + MonoMethodSignature *newsig = (MonoMethodSignature*)g_alloca (MONO_SIZEOF_METHOD_SIGNATURE + ((sig->param_count + 2) * sizeof (MonoType*))); + memcpy (newsig, sig, mono_metadata_signature_size (sig)); + newsig->ret = m_class_get_byval_arg (mono_defaults.string_class); + sig = newsig; + } + + if (sig->param_count > MAX_INTERP_ENTRY_ARGS) { + entry_func = (gpointer)interp_entry_general; + } else if (sig->hasthis) { + if (sig->ret->type == MONO_TYPE_VOID) + entry_func = entry_funcs_instance [sig->param_count]; + else + entry_func = entry_funcs_instance_ret [sig->param_count]; + } else { + if (sig->ret->type == MONO_TYPE_VOID) + entry_func = entry_funcs_static [sig->param_count]; + else + entry_func = entry_funcs_static_ret [sig->param_count]; + } + +#ifndef MONO_ARCH_HAVE_INTERP_NATIVE_TO_MANAGED +#ifdef HOST_WASM + if (method->wrapper_type == MONO_WRAPPER_NATIVE_TO_MANAGED) { + WrapperInfo *info = mono_marshal_get_wrapper_info (method); + MonoMethod *orig_method = info->d.native_to_managed.method; + + /* + * These are called from native code. Ask the host app for a trampoline. + */ + MonoFtnDesc *ftndesc = g_new0 (MonoFtnDesc, 1); + ftndesc->addr = entry_func; + ftndesc->arg = imethod; + + addr = mono_wasm_get_native_to_interp_trampoline (orig_method, ftndesc); + if (addr) { + mono_memory_barrier (); + imethod->jit_entry = addr; + return addr; + } + + /* + * The runtime expects a function pointer unique to method and + * the native caller expects a function pointer with the + * right signature, so fail right away. + */ + char *s = mono_method_get_full_name (orig_method); + char *msg = g_strdup_printf ("No native to managed transition for method '%s', missing [UnmanagedCallersOnly] attribute.", s); + mono_error_set_platform_not_supported (error, msg); + g_free (s); + g_free (msg); + return NULL; + } +#endif + return (gpointer)interp_no_native_to_managed; +#endif + + if (mono_llvm_only) { + /* The caller should call interp_create_method_pointer_llvmonly */ + //g_assert_not_reached (); + return (gpointer)no_llvmonly_interp_method_pointer; + } + +#ifndef MONO_ARCH_HAVE_FTNPTR_ARG_TRAMPOLINE + /* + * Interp in wrappers get the argument in the rgctx register. If + * MONO_ARCH_HAVE_FTNPTR_ARG_TRAMPOLINE is defined it means that + * on that arch the rgctx register is not scratch, so we use a + * separate temp register. We should update the wrappers for this + * if we really care about those architectures (arm). + */ + + MonoMethod *wrapper = NULL; +#ifdef MONO_ARCH_HAVE_SWIFTCALL + /* Methods with Swift cconv should go to trampoline */ + if (!mono_method_signature_has_ext_callconv (sig, MONO_EXT_CALLCONV_SWIFTCALL)) +#endif + { + wrapper = mini_get_interp_in_wrapper (sig); + entry_wrapper = mono_jit_compile_method_jit_only (wrapper, error); + } +#endif + if (!entry_wrapper) { +#ifndef MONO_ARCH_HAVE_INTERP_ENTRY_TRAMPOLINE + g_assertion_message ("couldn't compile wrapper \"%s\" for \"%s\"", + mono_method_get_name_full (wrapper, TRUE, TRUE, MONO_TYPE_NAME_FORMAT_IL), + mono_method_get_name_full (method, TRUE, TRUE, MONO_TYPE_NAME_FORMAT_IL)); +#else + mono_interp_error_cleanup (error); + if (!mono_native_to_interp_trampoline) { + if (mono_aot_only) { + mono_native_to_interp_trampoline = (MonoFuncV)mono_aot_get_trampoline ("native_to_interp_trampoline"); + } else { + MonoTrampInfo *info; + mono_native_to_interp_trampoline = (MonoFuncV)mono_arch_get_native_to_interp_trampoline (&info); + mono_tramp_info_register (info, NULL); + } + } + entry_wrapper = (gpointer)mono_native_to_interp_trampoline; + /* We need the lmf wrapper only when being called from mixed mode */ + if (sig->pinvoke) + entry_func = (gpointer)interp_entry_from_trampoline; + else { + static gpointer cached_func = NULL; + if (!cached_func) { + cached_func = mono_jit_compile_method_jit_only (mini_get_interp_lmf_wrapper ("mono_interp_entry_from_trampoline", (gpointer) mono_interp_entry_from_trampoline), error); + mono_memory_barrier (); + } + entry_func = cached_func; + } +#endif + } + + g_assert (entry_func); + /* This is the argument passed to the interp_in wrapper by the static rgctx trampoline */ + MonoFtnDesc *ftndesc = g_new0 (MonoFtnDesc, 1); + ftndesc->addr = entry_func; + ftndesc->arg = imethod; + mono_error_assert_ok (error); + + /* + * The wrapper is called by compiled code, which doesn't pass the extra argument, so we pass it in the + * rgctx register using a trampoline. + */ + + addr = mono_create_ftnptr_arg_trampoline (ftndesc, entry_wrapper); + + mono_memory_barrier (); + imethod->jit_entry = addr; + + return addr; +} + +static void +interp_free_method (MonoMethod *method) +{ + MonoJitMemoryManager *jit_mm = jit_mm_for_method (method); + MonoDynamicMethod *dmethod = (MonoDynamicMethod*)method; + + jit_mm_lock (jit_mm); + +#if HOST_BROWSER + InterpMethod *imethod = (InterpMethod*)mono_internal_hash_table_lookup (&jit_mm->interp_code_hash, method); + mono_jiterp_free_method_data (method, imethod); +#endif + + mono_internal_hash_table_remove (&jit_mm->interp_code_hash, method); + jit_mm_unlock (jit_mm); + + if (dmethod->mp) { + mono_mempool_destroy (dmethod->mp); + dmethod->mp = NULL; + } +} + +#if COUNT_OPS +static long opcode_counts[MINT_LASTOP]; + +#define COUNT_OP(op) opcode_counts[op]++ +#else +#define COUNT_OP(op) +#endif + +#if DEBUG_INTERP +#define DUMP_INSTR() \ + if (tracing > 1) { \ + output_indent (); \ + char *mn = mono_method_full_name (frame->imethod->method, FALSE); \ + g_print ("(%p) %s -> IL_%04x: %-10s\n", mono_thread_internal_current (), mn, (gint32)(ip - frame->imethod->code), mono_interp_opname (*ip)); \ + g_free (mn); \ + } +#else +#define DUMP_INSTR() +#endif + +static MONO_NEVER_INLINE MonoException* +do_init_vtable (MonoVTable *vtable, MonoError *error, InterpFrame *frame, const guint16 *ip) +{ + MonoLMFExt ext; + MonoException *ex = NULL; + + /* + * When calling runtime functions we pass the ip of the instruction triggering the runtime call. + * Offset the subtraction from interp_frame_get_ip, so we don't end up in prev instruction. + */ + frame->state.ip = ip + 1; + + interp_push_lmf (&ext, frame); + mono_runtime_class_init_full (vtable, error); + if (!is_ok (error)) + ex = mono_error_convert_to_exception (error); + interp_pop_lmf (&ext); + return ex; +} + +#define INIT_VTABLE(vtable) do { \ + if (G_UNLIKELY (!(vtable)->initialized)) { \ + MonoException *__init_vtable_ex = do_init_vtable ((vtable), error, frame, ip); \ + if (G_UNLIKELY (__init_vtable_ex)) \ + THROW_EX (__init_vtable_ex, ip); \ + } \ + } while (0); + +static MonoObject* +mono_interp_new (MonoClass* klass) +{ + ERROR_DECL (error); + MonoObject* const object = mono_object_new_checked (klass, error); + mono_error_cleanup (error); // FIXME: do not swallow the error + return object; +} + +static gboolean +mono_interp_isinst (MonoObject* object, MonoClass* klass) +{ + ERROR_DECL (error); + gboolean isinst; + MonoClass *obj_class = mono_object_class (object); + mono_class_is_assignable_from_checked (klass, obj_class, &isinst, error); + mono_error_cleanup (error); // FIXME: do not swallow the error + return isinst; +} + +static MONO_NEVER_INLINE InterpMethod* +mono_interp_get_native_func_wrapper (InterpMethod* imethod, MonoMethodSignature* csignature, guchar* code) +{ + /* Pinvoke call is missing the wrapper. See mono_get_native_calli_wrapper */ + MonoMarshalSpec** mspecs = g_newa0 (MonoMarshalSpec*, csignature->param_count + 1); + + MonoMethodPInvoke iinfo; + memset (&iinfo, 0, sizeof (iinfo)); + + MonoMethod *method = imethod->method; + MonoImage *image = NULL; + if (imethod->method->dynamic) + image = ((MonoDynamicMethod*)method)->assembly->image; + else + image = m_class_get_image (method->klass); + MonoMethod* m = mono_marshal_get_native_func_wrapper (image, csignature, &iinfo, mspecs, code); + + for (int i = csignature->param_count; i >= 0; i--) + if (mspecs [i]) + mono_metadata_free_marshal_spec (mspecs [i]); + + InterpMethod *cmethod = mono_interp_get_imethod (m); + + return cmethod; +} + +// Do not inline in case order of frame addresses matters. +static MONO_NEVER_INLINE MonoException* +mono_interp_leave (InterpFrame* parent_frame) +{ + InterpFrame frame = {parent_frame}; + gboolean gc_transitions = FALSE; + stackval tmp_sp; + /* + * We need for mono_thread_get_undeniable_exception to be able to unwind + * to check the abort threshold. For this to work we use frame as a + * dummy frame that is stored in the lmf and serves as the transition frame + */ + + do_icall_wrapper (&frame, NULL, MINT_ICALLSIG_V_P, &tmp_sp, &tmp_sp, (gpointer)mono_thread_get_undeniable_exception, FALSE, &gc_transitions); + + return (MonoException*)tmp_sp.data.p; +} + +static gint32 +mono_interp_enum_hasflag (stackval *sp1, stackval *sp2, MonoClass* klass) +{ + guint64 a_val = 0, b_val = 0; + + stackval_to_data (m_class_get_byval_arg (klass), sp1, &a_val, FALSE); + stackval_to_data (m_class_get_byval_arg (klass), sp2, &b_val, FALSE); + return (a_val & b_val) == b_val; +} + +static void +interp_simd_create (gpointer dest, gpointer args, int el_size) +{ + const int num_elements = SIZEOF_V128 / el_size; + gint8 res_buffer [SIZEOF_V128]; + for (int i = 0; i < num_elements; i++) { + switch (el_size) { + case 1: res_buffer [i] = *(gint8*)args; break; + case 2: ((gint16*)res_buffer) [i] = *(gint16*)args; break; + case 4: ((gint32*)res_buffer) [i] = *(gint32*)args; break; + case 8: ((gint64*)res_buffer) [i] = *(gint64*)args; break; + default: + g_assert_not_reached (); + } + args = (gpointer) ((char*)args + MINT_STACK_SLOT_SIZE); + } + + memcpy (dest, res_buffer, SIZEOF_V128); +} + +// varargs in wasm consumes extra linear stack per call-site. +// These g_warning/g_error wrappers fix that. It is not the +// small wasm stack, but conserving it is still desirable. +static void +g_warning_d (const char *format, int d) +{ + g_warning (format, d); +} + +#if !USE_COMPUTED_GOTO +static void +interp_error_xsx (const char *format, int x1, const char *s, int x2) +{ + g_error (format, x1, s, x2); +} +#endif + +static MONO_ALWAYS_INLINE gboolean +method_entry (ThreadContext *context, InterpFrame *frame, +#if DEBUG_INTERP + int *out_tracing, +#endif + MonoException **out_ex) +{ + gboolean slow = FALSE; + +#if DEBUG_INTERP + debug_enter (frame, out_tracing); +#endif +#if PROFILE_INTERP + frame->imethod->calls++; +#endif + + *out_ex = NULL; + if (!G_UNLIKELY (frame->imethod->transformed)) { + slow = TRUE; + MonoException *ex = do_transform_method (frame->imethod, frame, context); + if (ex) { + *out_ex = ex; + /* + * Initialize the stack base pointer here, in the uncommon branch, so we don't + * need to check for it everytime when exitting a frame. + */ + frame->stack = (stackval*)context->stack_pointer; + return slow; + } + } else { + mono_memory_read_barrier (); + } + + return slow; +} + +/* Save the state of the interpreter main loop into FRAME */ +#define SAVE_INTERP_STATE(frame) do { \ + frame->state.ip = ip; \ + } while (0) + +/* Load and clear state from FRAME */ +#define LOAD_INTERP_STATE(frame) do { \ + ip = frame->state.ip; \ + locals = (unsigned char *)frame->stack; \ + frame->state.ip = NULL; \ + } while (0) + +/* Initialize interpreter state for executing FRAME */ +#define INIT_INTERP_STATE(frame, _clause_args) do { \ + ip = _clause_args ? ((FrameClauseArgs *)_clause_args)->start_with_ip : (frame)->imethod->code; \ + locals = (unsigned char *)(frame)->stack; \ + } while (0) + +#if PROFILE_INTERP +static long total_executed_opcodes; +#endif + +#define LOCAL_VAR(offset,type) (*(type*)(locals + (offset))) + +// The start of the stack has a reserved slot for a GC visible temp object pointer +#ifdef TARGET_WASM +#define SET_TEMP_POINTER(value) (*((volatile MonoObject * volatile *)context->stack_start) = value) +#else +#define SET_TEMP_POINTER(value) (*((MonoObject **)context->stack_start) = value) +#endif + +/* + * Custom C implementations of the min/max operations for float and double. + * We cannot directly use the C stdlib functions because their semantics do not match + * the C# methods in System.Math, but having interpreter opcodes for these operations + * improves performance for FP math a lot in some cases. + */ +static float +min_f (float lhs, float rhs) +{ + if (mono_isnan (lhs)) + return lhs; + else if (mono_isnan (rhs)) + return rhs; + else if (lhs == rhs) + return mono_signbit (lhs) ? lhs : rhs; + else + return fminf (lhs, rhs); +} + +static float +max_f (float lhs, float rhs) +{ + if (mono_isnan (lhs)) + return lhs; + else if (mono_isnan (rhs)) + return rhs; + else if (lhs == rhs) + return mono_signbit (rhs) ? lhs : rhs; + else + return fmaxf (lhs, rhs); +} + +static double +min_d (double lhs, double rhs) +{ + if (mono_isnan (lhs)) + return lhs; + else if (mono_isnan (rhs)) + return rhs; + else if (lhs == rhs) + return mono_signbit (lhs) ? lhs : rhs; + else + return fmin (lhs, rhs); +} + +static double +max_d (double lhs, double rhs) +{ + if (mono_isnan (lhs)) + return lhs; + else if (mono_isnan (rhs)) + return rhs; + else if (lhs == rhs) + return mono_signbit (rhs) ? lhs : rhs; + else + return fmax (lhs, rhs); +} + +// Equivalent of mono_get_addr_compiled_method +static gpointer +interp_ldvirtftn_delegate (gpointer arg, MonoDelegate *del) +{ + MonoMethod *virtual_method = del->method; + ERROR_DECL(error); + + MonoClass *klass = del->object.vtable->klass; + MonoMethod *invoke = mono_get_delegate_invoke_internal (klass); + MonoMethodSignature *invoke_sig = mono_method_signature_internal (invoke); + + MonoClass *arg_class = NULL; + if (m_type_is_byref (invoke_sig->params [0])) { + arg_class = mono_class_from_mono_type_internal (invoke_sig->params [0]); + } else { + MonoObject *object = (MonoObject*)arg; + arg_class = object->vtable->klass; + } + + MonoMethod *res = mono_class_get_virtual_method (arg_class, virtual_method, error); + mono_error_assert_ok (error); + + gboolean need_unbox = m_class_is_valuetype (res->klass) && !m_class_is_valuetype (virtual_method->klass); + + InterpMethod *imethod = mono_interp_get_imethod (res); + return imethod_to_ftnptr (imethod, need_unbox); +} + +static MONO_NEVER_INLINE void +mono_interp_trace_with_ctx (InterpFrame *frame, void (*trace_cb)(MonoMethod*,MonoJitInfo*,MonoProfilerCallContext*)) +{ + MonoProfilerCallContext prof_ctx; + MonoLMFExt ext; + memset (&prof_ctx, 0, sizeof (MonoProfilerCallContext)); + prof_ctx.interp_frame = frame; + prof_ctx.method = frame->imethod->method; + prof_ctx.return_value = frame->retval; + interp_push_lmf (&ext, frame); + trace_cb (frame->imethod->method, frame->imethod->jinfo, &prof_ctx); + interp_pop_lmf (&ext); +} + +static MONO_NEVER_INLINE void +mono_interp_profiler_raise_with_ctx (InterpFrame *frame, void (*prof_cb)(MonoMethod*,MonoProfilerCallContext*)) +{ + MonoProfilerCallContext prof_ctx; + MonoLMFExt ext; + memset (&prof_ctx, 0, sizeof (MonoProfilerCallContext)); + prof_ctx.interp_frame = frame; + prof_ctx.method = frame->imethod->method; + prof_ctx.return_value = frame->retval; + interp_push_lmf (&ext, frame); + prof_cb (frame->imethod->method, &prof_ctx); + interp_pop_lmf (&ext); +} + +static MONO_NEVER_INLINE void +mono_interp_profiler_raise (InterpFrame *frame, void (*prof_cb)(MonoMethod*,MonoProfilerCallContext*)) +{ + MonoLMFExt ext; + interp_push_lmf (&ext, frame); + prof_cb (frame->imethod->method, NULL); + interp_pop_lmf (&ext); +} + +static MONO_NEVER_INLINE void +mono_interp_profiler_raise_tail_call (InterpFrame *frame, MonoMethod *new_method) +{ + MonoLMFExt ext; + interp_push_lmf (&ext, frame); + mono_profiler_raise_method_tail_call (frame->imethod->method, new_method); + interp_pop_lmf (&ext); +} + +#define INTERP_PROFILER_RAISE(name_lower, name_upper) \ + if ((flag & TRACING_FLAG) || ((flag & PROFILING_FLAG) && MONO_PROFILER_ENABLED (method_ ## name_lower) && \ + (frame->imethod->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_ ## name_upper ## _CONTEXT ))) { \ + if (flag & TRACING_FLAG) \ + mono_interp_trace_with_ctx (frame, mono_trace_ ## name_lower ## _method); \ + if (flag & PROFILING_FLAG) \ + mono_interp_profiler_raise_with_ctx (frame, mono_profiler_raise_method_ ## name_lower); \ + } else if ((flag & PROFILING_FLAG) && MONO_PROFILER_ENABLED (method_ ## name_lower)) { \ + mono_interp_profiler_raise (frame, mono_profiler_raise_method_ ## name_lower); \ + } + + +/* + * If CLAUSE_ARGS is non-null, start executing from it. + * The ERROR argument is used to avoid declaring an error object for every interp frame, its not used + * to return error information. + * FRAME is only valid until the next call to alloc_frame (). + */ +static MONO_NEVER_INLINE void +mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClauseArgs *clause_args) +{ + InterpMethod *cmethod; + ERROR_DECL(error); + + /* Interpreter main loop state (InterpState) */ + const guint16 *ip = NULL; + unsigned char *locals = NULL; + int call_args_offset; + int return_offset; + gboolean gc_transitions = FALSE; + +#if DEBUG_INTERP + int tracing = global_tracing; +#endif +#if USE_COMPUTED_GOTO + static void * const in_labels[] = { +#define OPDEF(a,b,c,d,e,f) &&LAB_ ## a, +#define IROPDEF(a,b,c,d,e,f) +#include "mintops.def" + }; +#endif + + /* + * GC SAFETY: + * + * The interpreter executes in gc unsafe (non-preempt) mode. On wasm, we cannot rely on + * scanning the stack or any registers. In order to make the code GC safe, every objref + * handled by the code needs to be kept alive and pinned in any of the following ways: + * - the object needs to be stored on the interpreter stack. In order to make sure the + * object actually gets stored on the interp stack and the store is not optimized out, + * the store/variable should be volatile. + * - if the execution of an opcode requires an object not coming from interp stack to be + * kept alive, the tmp_handle below can be used. This handle will keep only one object + * pinned by the GC. Ideally, once this object is no longer needed, the handle should be + * cleared. If we will need to have more objects pinned simultaneously, additional handles + * can be reserved here. + */ + MonoException *method_entry_ex; + if (method_entry (context, frame, +#if DEBUG_INTERP + &tracing, +#endif + &method_entry_ex)) { + if (method_entry_ex) + THROW_EX (method_entry_ex, NULL); + EXCEPTION_CHECKPOINT; + CHECK_RESUME_STATE (context); + } + + if (!clause_args) { + context->stack_pointer = (guchar*)frame->stack + frame->imethod->alloca_size; + g_assert (context->stack_pointer < context->stack_end); + /* Make sure the stack pointer is bumped before we store any references on the stack */ + mono_compiler_barrier (); + } + + INIT_INTERP_STATE (frame, clause_args); + + if (clause_args && clause_args->run_until_end) + /* + * Called from run_with_il_state to run the method until the end. + * Clear this out so it doesn't confuse the rest of the code. + */ + clause_args = NULL; + +#ifdef ENABLE_EXPERIMENT_TIERED + mini_tiered_inc (frame->imethod->method, &frame->imethod->tiered_counter, 0); +#endif + //g_print ("(%p) Call %s\n", mono_thread_internal_current (), mono_method_get_full_name (frame->imethod->method)); + +#if defined(ENABLE_HYBRID_SUSPEND) || defined(ENABLE_COOP_SUSPEND) + mono_threads_safepoint (); +#endif +main_loop: + /* + * using while (ip < end) may result in a 15% performance drop, + * but it may be useful for debug + */ + while (1) { +#if PROFILE_INTERP + frame->imethod->opcounts++; + total_executed_opcodes++; +#endif + MintOpcode opcode; + DUMP_INSTR(); + MINT_IN_SWITCH (*ip) { + MINT_IN_CASE(MINT_INITLOCAL) + MINT_IN_CASE(MINT_INITLOCALS) + memset (locals + ip [1], 0, ip [2]); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_NIY) + g_printf ("MONO interpreter: NIY encountered in method %s\n", mono_method_full_name (frame->imethod->method, TRUE)); + g_assert_not_reached (); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BREAK) + ++ip; + SAVE_INTERP_STATE (frame); + do_debugger_tramp (mono_component_debugger ()->user_break, frame); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BREAKPOINT) + ++ip; + mono_break (); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_INIT_ARGLIST) { + const guint16 *call_ip = frame->parent->state.ip - 6; + g_assert_checked (*call_ip == MINT_CALL_VARARG); + int params_stack_size = call_ip [5]; + MonoMethodSignature *sig = (MonoMethodSignature*)frame->parent->imethod->data_items [call_ip [4]]; + + // we are being overly conservative with the size here, for simplicity + gpointer arglist = frame_data_allocator_alloc (&context->data_stack, frame, params_stack_size + MINT_STACK_SLOT_SIZE); + + init_arglist (frame, sig, STACK_ADD_BYTES (frame->stack, ip [2]), (char*)arglist); + + // save the arglist for future access with MINT_ARGLIST + LOCAL_VAR (ip [1], gpointer) = arglist; + + ip += 3; + MINT_IN_BREAK; + } + + MINT_IN_CASE(MINT_LDC_I4_0) + LOCAL_VAR (ip [1], gint32) = 0; + ip += 2; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDC_I4_1) + LOCAL_VAR (ip [1], gint32) = 1; + ip += 2; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDC_I4_S) + LOCAL_VAR (ip [1], gint32) = (short)ip [2]; + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDC_I4) + LOCAL_VAR (ip [1], gint32) = READ32 (ip + 2); + ip += 4; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDC_I8_0) + LOCAL_VAR (ip [1], gint64) = 0; + ip += 2; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDC_I8) + LOCAL_VAR (ip [1], gint64) = READ64 (ip + 2); + ip += 6; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDC_I8_S) + LOCAL_VAR (ip [1], gint64) = (short)ip [2]; + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDC_R4) { + LOCAL_VAR (ip [1], gint32) = READ32(ip + 2); /* not union usage */ + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_LDC_R8) + LOCAL_VAR (ip [1], gint64) = READ64 (ip + 2); /* note union usage */ + ip += 6; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_TAILCALL) + MINT_IN_CASE(MINT_TAILCALL_VIRT) + MINT_IN_CASE(MINT_JMP) { + gboolean is_tailcall = *ip != MINT_JMP; + InterpMethod *new_method; + + if (is_tailcall) { + guint16 params_offset = ip [1]; + guint16 params_size = ip [3]; + + new_method = (InterpMethod*)frame->imethod->data_items [ip [2]]; + + if (*ip == MINT_TAILCALL_VIRT) { + gint16 slot = (gint16)ip [4]; + MonoObject **this_arg_p = (MonoObject **)((guchar*)frame->stack + params_offset); + MonoObject *this_arg = *this_arg_p; + new_method = get_virtual_method_fast (new_method, this_arg->vtable, slot); + if (m_class_is_valuetype (this_arg->vtable->klass) && m_class_is_valuetype (new_method->method->klass)) { + /* unbox */ + gpointer unboxed = mono_object_unbox_internal (this_arg); + *this_arg_p = unboxed; + } + + InterpMethodCodeType code_type = new_method->code_type; + + g_assert (code_type == IMETHOD_CODE_UNKNOWN || + code_type == IMETHOD_CODE_INTERP || + code_type == IMETHOD_CODE_COMPILED); + + if (G_UNLIKELY (code_type == IMETHOD_CODE_UNKNOWN)) { + // FIXME push/pop LMF + MonoMethodSignature *sig = mono_method_signature_internal (new_method->method); + if (mono_interp_jit_call_supported (new_method->method, sig)) + code_type = IMETHOD_CODE_COMPILED; + else + code_type = IMETHOD_CODE_INTERP; + new_method->code_type = code_type; + } + + if (code_type == IMETHOD_CODE_COMPILED) { + error_init_reuse (error); + do_jit_call (context, frame->retval, (stackval*)((guchar*)frame->stack + params_offset), frame, new_method, error); + if (!is_ok (error)) { + MonoException *call_ex = interp_error_convert_to_exception (frame, error, ip); + THROW_EX (call_ex, ip); + } + + goto exit_frame; + } + } + + // Copy the params to their location at the start of the frame + memmove (frame->stack, (guchar*)frame->stack + params_offset, params_size); + } else { + new_method = (InterpMethod*)frame->imethod->data_items [ip [1]]; + } + + if (frame->imethod->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_TAIL_CALL) + if (MONO_PROFILER_ENABLED (method_tail_call)) + mono_interp_profiler_raise_tail_call (frame, new_method->method); + + if (!new_method->transformed) { + MonoException *transform_ex = do_transform_method (new_method, frame, context); + if (transform_ex) + THROW_EX (transform_ex, ip); + EXCEPTION_CHECKPOINT; + } + /* + * It's possible for the caller stack frame to be smaller + * than the callee stack frame (at the interp level) + */ + context->stack_pointer = (guchar*)frame->stack + new_method->alloca_size; + if (G_UNLIKELY (context->stack_pointer >= context->stack_end)) { + context->stack_end = context->stack_real_end; + THROW_EX (mono_domain_get ()->stack_overflow_ex, ip); + } + + frame->imethod = new_method; + ip = frame->imethod->code; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_MOV_STACK_UNOPT) { + int src_offset = ip [1]; + int dst_offset = src_offset + (gint16)ip [2]; + int size = ip [3]; + + memmove (locals + dst_offset, locals + src_offset, size); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CALL_DELEGATE) { + return_offset = ip [1]; + call_args_offset = ip [2]; + MonoDelegate *del = LOCAL_VAR (call_args_offset, MonoDelegate*); + gboolean is_multicast = del->method == NULL; + InterpMethod *del_imethod = (InterpMethod*)del->interp_invoke_impl; + + if (!del_imethod) { + // FIXME push/pop LMF + if (is_multicast) { + MonoMethod *invoke = mono_get_delegate_invoke_internal (del->object.vtable->klass); + del_imethod = mono_interp_get_imethod (mono_marshal_get_delegate_invoke (invoke, del)); + del->interp_invoke_impl = del_imethod; + } else if (!del->interp_method) { + // Not created from interpreted code + g_assert (del->method); + del_imethod = mono_interp_get_imethod (del->method); + if (del->target && m_method_is_virtual (del->method)) + del_imethod = get_virtual_method (del_imethod, del->target->vtable); + del->interp_method = del_imethod; + del->interp_invoke_impl = del_imethod; + } else { + del_imethod = (InterpMethod*)del->interp_method; + if (del_imethod->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) { + del_imethod = mono_interp_get_imethod (mono_marshal_get_native_wrapper (del_imethod->method, FALSE, FALSE)); + del->interp_invoke_impl = del_imethod; + } else if ((m_method_is_virtual (del_imethod->method) && !m_method_is_static (del_imethod->method)) && !del->target && !m_class_is_valuetype (del_imethod->method->klass)) { + // 'this' is passed dynamically, we need to recompute the target method + // with each call + MonoObject *obj = LOCAL_VAR (call_args_offset + MINT_STACK_SLOT_SIZE, MonoObject*); + del_imethod = get_virtual_method (del_imethod, obj->vtable); + if (m_class_is_valuetype (del_imethod->method->klass)) { + // We are calling into a value type method, `this` needs to be unboxed + LOCAL_VAR (call_args_offset + MINT_STACK_SLOT_SIZE, gpointer) = mono_object_unbox_internal (obj); + } + } else { + del->interp_invoke_impl = del_imethod; + } + } + } + if (del_imethod->optimized_imethod) { + del_imethod = del_imethod->optimized_imethod; + // don't patch for virtual calls + if (del->interp_invoke_impl) + del->interp_invoke_impl = del_imethod; + } + cmethod = del_imethod; + if (!is_multicast) { + int ref_slot_offset = frame->imethod->ref_slot_offset; + if (ref_slot_offset >= 0) + LOCAL_VAR (ref_slot_offset, gpointer) = del; + int param_count = ip [4]; + if (cmethod->param_count == param_count + 1) { + // Target method is static but the delegate has a target object. We handle + // this separately from the case below, because, for these calls, the instance + // is allowed to be null. + LOCAL_VAR (call_args_offset, MonoObject*) = del->target; + } else if (del->target) { + MonoObject *this_arg = del->target; + + // replace the MonoDelegate* on the stack with 'this' pointer + if (m_class_is_valuetype (cmethod->method->klass)) { + gpointer unboxed = mono_object_unbox_internal (this_arg); + LOCAL_VAR (call_args_offset, gpointer) = unboxed; + } else { + LOCAL_VAR (call_args_offset, MonoObject*) = this_arg; + } + } else { + // skip the delegate pointer for static calls + // FIXME we could avoid memmove + memmove (locals + call_args_offset, locals + call_args_offset + ip [5], ip [3]); + } + } + ip += 6; + + goto jit_call; + } + MINT_IN_CASE(MINT_CALLI) { + gboolean need_unbox; + + /* In mixed mode, stay in the interpreter for simplicity even if there is an AOT version of the callee */ + cmethod = ftnptr_to_imethod (LOCAL_VAR (ip [2], gpointer), &need_unbox); + + if (cmethod->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) { + // FIXME push/pop LMF + cmethod = mono_interp_get_imethod (mono_marshal_get_native_wrapper (cmethod->method, FALSE, FALSE)); + } + + return_offset = ip [1]; + call_args_offset = ip [3]; + + if (need_unbox) { + MonoObject *this_arg = LOCAL_VAR (call_args_offset, MonoObject*); + LOCAL_VAR (call_args_offset, gpointer) = mono_object_unbox_internal (this_arg); + } + ip += 4; + + goto jit_call; + } + MINT_IN_CASE(MINT_CALLI_NAT_FAST) { + MintICallSig icall_sig = (MintICallSig)ip [4]; + MonoMethodSignature *csignature = (MonoMethodSignature*)frame->imethod->data_items [ip [5]]; + gboolean save_last_error = ip [6]; + + stackval *ret = (stackval*)(locals + ip [1]); + gpointer target_ip = LOCAL_VAR (ip [2], gpointer); + stackval *args = (stackval*)(locals + ip [3]); + /* for calls, have ip pointing at the start of next instruction */ + frame->state.ip = ip + 7; + + do_icall_wrapper (frame, csignature, icall_sig, ret, args, target_ip, save_last_error, &gc_transitions); + EXCEPTION_CHECKPOINT; + CHECK_RESUME_STATE (context); + ip += 7; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CALLI_NAT_DYNAMIC) { + MonoMethodSignature* csignature = (MonoMethodSignature*)frame->imethod->data_items [ip [4]]; + + return_offset = ip [1]; + guchar* code = LOCAL_VAR (ip [2], guchar*); + call_args_offset = ip [3]; + + // FIXME push/pop LMF + cmethod = mono_interp_get_native_func_wrapper (frame->imethod, csignature, code); + + ip += 5; + goto jit_call; + } + MINT_IN_CASE(MINT_CALLI_NAT) { + MonoMethodSignature *csignature = (MonoMethodSignature*)frame->imethod->data_items [ip [4]]; + InterpMethod *imethod = (InterpMethod*)frame->imethod->data_items [ip [5]]; + + guchar *code = LOCAL_VAR (ip [2], guchar*); + + gboolean save_last_error = ip [6]; + gpointer *cache = (gpointer*)&frame->imethod->data_items [ip [7]]; + /* for calls, have ip pointing at the start of next instruction */ + frame->state.ip = ip + 8; + MH_LOG_INDENT(); + MH_LOG ("Calling native method %s with signature %s\n", mono_method_full_name (imethod->method, TRUE), mono_signature_full_name (csignature)); + ves_pinvoke_method (imethod, csignature, (MonoFuncV)code, context, frame, (stackval*)(locals + ip [1]), (stackval*)(locals + ip [3]), save_last_error, cache, &gc_transitions); + MH_LOG_UNINDENT(); + EXCEPTION_CHECKPOINT; + CHECK_RESUME_STATE (context); + + ip += 8; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CALLVIRT_FAST) { + MonoObject *this_arg; + int slot; + + cmethod = (InterpMethod*)frame->imethod->data_items [ip [3]]; + return_offset = ip [1]; + call_args_offset = ip [2]; + + this_arg = LOCAL_VAR (call_args_offset, MonoObject*); + NULL_CHECK (this_arg); + + slot = (gint16)ip [4]; + ip += 5; + // FIXME push/pop LMF + cmethod = get_virtual_method_fast (cmethod, this_arg->vtable, slot); + if (m_class_is_valuetype (cmethod->method->klass)) { + /* unbox */ + gpointer unboxed = mono_object_unbox_internal (this_arg); + LOCAL_VAR (call_args_offset, gpointer) = unboxed; + } + +jit_call: + { + InterpMethodCodeType code_type = cmethod->code_type; + + g_assert (code_type == IMETHOD_CODE_UNKNOWN || + code_type == IMETHOD_CODE_INTERP || + code_type == IMETHOD_CODE_COMPILED); + + if (G_UNLIKELY (code_type == IMETHOD_CODE_UNKNOWN)) { + // FIXME push/pop LMF + MonoMethodSignature *sig = mono_method_signature_internal (cmethod->method); + if (mono_interp_jit_call_supported (cmethod->method, sig)) + code_type = IMETHOD_CODE_COMPILED; + else + code_type = IMETHOD_CODE_INTERP; + cmethod->code_type = code_type; + } + + if (code_type == IMETHOD_CODE_INTERP) { + + goto interp_call; + + } else if (code_type == IMETHOD_CODE_COMPILED) { + frame->state.ip = ip; + error_init_reuse (error); + do_jit_call (context, (stackval*)(locals + return_offset), (stackval*)(locals + call_args_offset), frame, cmethod, error); + if (!is_ok (error)) { + MonoException *call_ex = interp_error_convert_to_exception (frame, error, ip); + THROW_EX (call_ex, ip); + } + + CHECK_RESUME_STATE (context); + } + MINT_IN_BREAK; + } + } + MINT_IN_CASE(MINT_CALL_VARARG) { + // Same as MINT_CALL, except at ip [4] we have the index for the csignature, + // which is required by the called method to set up the arglist. + cmethod = (InterpMethod*)frame->imethod->data_items [ip [3]]; + return_offset = ip [1]; + call_args_offset = ip [2]; + ip += 6; + goto jit_call; + } + + MINT_IN_CASE(MINT_CALL) { + cmethod = (InterpMethod*)frame->imethod->data_items [ip [3]]; + return_offset = ip [1]; + call_args_offset = ip [2]; + +#ifdef ENABLE_EXPERIMENT_TIERED + ip += 5; +#else + ip += 4; +#endif + +interp_call: + /* + * Make a non-recursive call by loading the new interpreter state based on child frame, + * and going back to the main loop. + */ + SAVE_INTERP_STATE (frame); + + // Allocate child frame. + // FIXME: Add stack overflow checks + { + InterpFrame *child_frame = frame->next_free; + if (!child_frame) { + child_frame = g_newa0 (InterpFrame, 1); + // Not free currently, but will be when allocation attempted. + frame->next_free = child_frame; + } + reinit_frame (child_frame, frame, cmethod, locals + return_offset, locals + call_args_offset); + frame = child_frame; + } + g_assert_checked (((gsize)frame->stack % MINT_STACK_ALIGNMENT) == 0); + + MonoException *call_ex; + if (method_entry (context, frame, +#if DEBUG_INTERP + &tracing, +#endif + &call_ex)) { + if (call_ex) + THROW_EX (call_ex, NULL); + EXCEPTION_CHECKPOINT; + CHECK_RESUME_STATE (context); + } + + context->stack_pointer = (guchar*)frame->stack + cmethod->alloca_size; + + if (G_UNLIKELY (context->stack_pointer >= context->stack_end)) { + context->stack_end = context->stack_real_end; + THROW_EX (mono_domain_get ()->stack_overflow_ex, ip); + } + + /* Make sure the stack pointer is bumped before we store any references on the stack */ + mono_compiler_barrier (); + + INIT_INTERP_STATE (frame, NULL); + + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_JIT_CALL) { + InterpMethod *rmethod = (InterpMethod*)frame->imethod->data_items [ip [3]]; + error_init_reuse (error); + /* for calls, have ip pointing at the start of next instruction */ + frame->state.ip = ip + 4; + do_jit_call (context, (stackval*)(locals + ip [1]), (stackval*)(locals + ip [2]), frame, rmethod, error); + if (!is_ok (error)) { + MonoException *call_ex = interp_error_convert_to_exception (frame, error, ip); + THROW_EX (call_ex, ip); + } + + CHECK_RESUME_STATE (context); + ip += 4; + + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_JIT_CALL2) { +#ifdef ENABLE_EXPERIMENT_TIERED + InterpMethod *rmethod = (InterpMethod *) READ64 (ip + 2); + + error_init_reuse (error); + + frame->state.ip = ip + 6; + do_jit_call (context, (stackval*)(locals + ip [1]), frame, rmethod, error); + if (!is_ok (error)) { + MonoException *call_ex = interp_error_convert_to_exception (frame, error); + THROW_EX (call_ex, ip); + } + + CHECK_RESUME_STATE (context); + + ip += 6; +#else + g_error ("MINT_JIT_ICALL2 shouldn't be used"); +#endif + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_RET) + frame->retval [0] = LOCAL_VAR (ip [1], stackval); + goto exit_frame; + MINT_IN_CASE(MINT_RET_I1) + frame->retval [0].data.i = (gint8) LOCAL_VAR (ip [1], gint32); + goto exit_frame; + MINT_IN_CASE(MINT_RET_U1) + frame->retval [0].data.i = (guint8) LOCAL_VAR (ip [1], gint32); + goto exit_frame; + MINT_IN_CASE(MINT_RET_I2) + frame->retval [0].data.i = (gint16) LOCAL_VAR (ip [1], gint32); + goto exit_frame; + MINT_IN_CASE(MINT_RET_U2) + frame->retval [0].data.i = (guint16) LOCAL_VAR (ip [1], gint32); + goto exit_frame; + MINT_IN_CASE(MINT_RET_I4_IMM) + frame->retval [0].data.i = (gint16)ip [1]; + goto exit_frame; + MINT_IN_CASE(MINT_RET_I8_IMM) + frame->retval [0].data.l = (gint16)ip [1]; + goto exit_frame; + MINT_IN_CASE(MINT_RET_VOID) + goto exit_frame; + MINT_IN_CASE(MINT_RET_VT) { + memmove (frame->retval, locals + ip [1], ip [2]); + goto exit_frame; + } + MINT_IN_CASE(MINT_RET_LOCALLOC) + frame->retval [0] = LOCAL_VAR (ip [1], stackval); + frame_data_allocator_pop (&context->data_stack, frame); + goto exit_frame; + MINT_IN_CASE(MINT_RET_VOID_LOCALLOC) + frame_data_allocator_pop (&context->data_stack, frame); + goto exit_frame; + MINT_IN_CASE(MINT_RET_VT_LOCALLOC) { + memmove (frame->retval, locals + ip [1], ip [2]); + frame_data_allocator_pop (&context->data_stack, frame); + goto exit_frame; + } + +#ifdef ENABLE_EXPERIMENT_TIERED +#define BACK_BRANCH_PROFILE(offset) do { \ + if (offset < 0) \ + mini_tiered_inc (frame->imethod->method, &frame->imethod->tiered_counter, 0); \ + } while (0); +#else +#define BACK_BRANCH_PROFILE(offset) +#endif + + MINT_IN_CASE(MINT_BR_S) { + short br_offset = (short) *(ip + 1); + BACK_BRANCH_PROFILE (br_offset); + ip += br_offset; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BR) { + gint32 br_offset = (gint32) READ32(ip + 1); + BACK_BRANCH_PROFILE (br_offset); + ip += br_offset; + MINT_IN_BREAK; + } + +#define ZEROP_S(datatype, op) \ + if (LOCAL_VAR (ip [1], datatype) op 0) { \ + gint16 br_offset = (gint16) ip [2]; \ + BACK_BRANCH_PROFILE (br_offset); \ + ip += br_offset; \ + } else \ + ip += 3; + +#define ZEROP(datatype, op) \ + if (LOCAL_VAR (ip [1], datatype) op 0) { \ + gint32 br_offset = (gint32)READ32(ip + 2); \ + BACK_BRANCH_PROFILE (br_offset); \ + ip += br_offset; \ + } else \ + ip += 4; + + MINT_IN_CASE(MINT_BRFALSE_I4_S) + ZEROP_S(gint32, ==); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BRFALSE_I8_S) + ZEROP_S(gint64, ==); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BRFALSE_I4) + ZEROP(gint32, ==); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BRFALSE_I8) + ZEROP(gint64, ==); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BRTRUE_I4_S) + ZEROP_S(gint32, !=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BRTRUE_I8_S) + ZEROP_S(gint64, !=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BRTRUE_I4) + ZEROP(gint32, !=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BRTRUE_I8) + ZEROP(gint64, !=); + MINT_IN_BREAK; +#define CONDBR_S(cond) \ + if (cond) { \ + gint16 br_offset = (gint16) ip [3]; \ + BACK_BRANCH_PROFILE (br_offset); \ + ip += br_offset; \ + } else \ + ip += 4; +#define BRELOP_S(datatype, op) \ + CONDBR_S(LOCAL_VAR (ip [1], datatype) op LOCAL_VAR (ip [2], datatype)) + +#define CONDBR(cond) \ + if (cond) { \ + gint32 br_offset = (gint32) READ32 (ip + 3); \ + BACK_BRANCH_PROFILE (br_offset); \ + ip += br_offset; \ + } else \ + ip += 5; + +#define BRELOP(datatype, op) \ + CONDBR(LOCAL_VAR (ip [1], datatype) op LOCAL_VAR (ip [2], datatype)) + + MINT_IN_CASE(MINT_BEQ_I4_S) + BRELOP_S(gint32, ==) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BEQ_I8_S) + BRELOP_S(gint64, ==) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BEQ_R4_S) { + float f1 = LOCAL_VAR (ip [1], float); + float f2 = LOCAL_VAR (ip [2], float); + CONDBR_S(!isunordered (f1, f2) && f1 == f2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BEQ_R8_S) { + double d1 = LOCAL_VAR (ip [1], double); + double d2 = LOCAL_VAR (ip [2], double); + CONDBR_S(!mono_isunordered (d1, d2) && d1 == d2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BEQ_I4) + BRELOP(gint32, ==) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BEQ_I8) + BRELOP(gint64, ==) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BEQ_R4) { + float f1 = LOCAL_VAR (ip [1], float); + float f2 = LOCAL_VAR (ip [2], float); + CONDBR(!isunordered (f1, f2) && f1 == f2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BEQ_R8) { + double d1 = LOCAL_VAR (ip [1], double); + double d2 = LOCAL_VAR (ip [2], double); + CONDBR(!mono_isunordered (d1, d2) && d1 == d2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BGE_I4_S) + BRELOP_S(gint32, >=) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGE_I8_S) + BRELOP_S(gint64, >=) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGE_R4_S) { + float f1 = LOCAL_VAR (ip [1], float); + float f2 = LOCAL_VAR (ip [2], float); + CONDBR_S(!isunordered (f1, f2) && f1 >= f2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BGE_R8_S) { + double d1 = LOCAL_VAR (ip [1], double); + double d2 = LOCAL_VAR (ip [2], double); + CONDBR_S(!mono_isunordered (d1, d2) && d1 >= d2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BGE_I4) + BRELOP(gint32, >=) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGE_I8) + BRELOP(gint64, >=) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGE_R4) { + float f1 = LOCAL_VAR (ip [1], float); + float f2 = LOCAL_VAR (ip [2], float); + CONDBR(!isunordered (f1, f2) && f1 >= f2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BGE_R8) { + double d1 = LOCAL_VAR (ip [1], double); + double d2 = LOCAL_VAR (ip [2], double); + CONDBR(!mono_isunordered (d1, d2) && d1 >= d2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BGT_I4_S) + BRELOP_S(gint32, >) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGT_I8_S) + BRELOP_S(gint64, >) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGT_R4_S) { + float f1 = LOCAL_VAR (ip [1], float); + float f2 = LOCAL_VAR (ip [2], float); + CONDBR_S(!isunordered (f1, f2) && f1 > f2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BGT_R8_S) { + double d1 = LOCAL_VAR (ip [1], double); + double d2 = LOCAL_VAR (ip [2], double); + CONDBR_S(!mono_isunordered (d1, d2) && d1 > d2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BGT_I4) + BRELOP(gint32, >) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGT_I8) + BRELOP(gint64, >) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGT_R4) { + float f1 = LOCAL_VAR (ip [1], float); + float f2 = LOCAL_VAR (ip [2], float); + CONDBR(!isunordered (f1, f2) && f1 > f2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BGT_R8) { + double d1 = LOCAL_VAR (ip [1], double); + double d2 = LOCAL_VAR (ip [2], double); + CONDBR(!mono_isunordered (d1, d2) && d1 > d2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BLT_I4_S) + BRELOP_S(gint32, <) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLT_I8_S) + BRELOP_S(gint64, <) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLT_R4_S) { + float f1 = LOCAL_VAR (ip [1], float); + float f2 = LOCAL_VAR (ip [2], float); + CONDBR_S(!isunordered (f1, f2) && f1 < f2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BLT_R8_S) { + double d1 = LOCAL_VAR (ip [1], double); + double d2 = LOCAL_VAR (ip [2], double); + CONDBR_S(!mono_isunordered (d1, d2) && d1 < d2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BLT_I4) + BRELOP(gint32, <) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLT_I8) + BRELOP(gint64, <) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLT_R4) { + float f1 = LOCAL_VAR (ip [1], float); + float f2 = LOCAL_VAR (ip [2], float); + CONDBR(!isunordered (f1, f2) && f1 < f2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BLT_R8) { + double d1 = LOCAL_VAR (ip [1], double); + double d2 = LOCAL_VAR (ip [2], double); + CONDBR(!mono_isunordered (d1, d2) && d1 < d2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BLE_I4_S) + BRELOP_S(gint32, <=) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLE_I8_S) + BRELOP_S(gint64, <=) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLE_R4_S) { + float f1 = LOCAL_VAR (ip [1], float); + float f2 = LOCAL_VAR (ip [2], float); + CONDBR_S(!isunordered (f1, f2) && f1 <= f2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BLE_R8_S) { + double d1 = LOCAL_VAR (ip [1], double); + double d2 = LOCAL_VAR (ip [2], double); + CONDBR_S(!mono_isunordered (d1, d2) && d1 <= d2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BLE_I4) + BRELOP(gint32, <=) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLE_I8) + BRELOP(gint64, <=) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLE_R4) { + float f1 = LOCAL_VAR (ip [1], float); + float f2 = LOCAL_VAR (ip [2], float); + CONDBR(!isunordered (f1, f2) && f1 <= f2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BLE_R8) { + double d1 = LOCAL_VAR (ip [1], double); + double d2 = LOCAL_VAR (ip [2], double); + CONDBR(!mono_isunordered (d1, d2) && d1 <= d2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BNE_UN_I4_S) + BRELOP_S(gint32, !=) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BNE_UN_I8_S) + BRELOP_S(gint64, !=) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BNE_UN_R4_S) { + float f1 = LOCAL_VAR (ip [1], float); + float f2 = LOCAL_VAR (ip [2], float); + CONDBR_S(isunordered (f1, f2) || f1 != f2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BNE_UN_R8_S) { + double d1 = LOCAL_VAR (ip [1], double); + double d2 = LOCAL_VAR (ip [2], double); + CONDBR_S(mono_isunordered (d1, d2) || d1 != d2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BNE_UN_I4) + BRELOP(gint32, !=) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BNE_UN_I8) + BRELOP(gint64, !=) + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BNE_UN_R4) { + float f1 = LOCAL_VAR (ip [1], float); + float f2 = LOCAL_VAR (ip [2], float); + CONDBR(isunordered (f1, f2) || f1 != f2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BNE_UN_R8) { + double d1 = LOCAL_VAR (ip [1], double); + double d2 = LOCAL_VAR (ip [2], double); + CONDBR(mono_isunordered (d1, d2) || d1 != d2) + MINT_IN_BREAK; + } + +#define BRELOP_S_CAST(datatype, op) \ + if (LOCAL_VAR (ip [1], datatype) op LOCAL_VAR (ip [2], datatype)) { \ + gint16 br_offset = (gint16) ip [3]; \ + BACK_BRANCH_PROFILE (br_offset); \ + ip += br_offset; \ + } else \ + ip += 4; + +#define BRELOP_CAST(datatype, op) \ + if (LOCAL_VAR (ip [1], datatype) op LOCAL_VAR (ip [2], datatype)) { \ + gint32 br_offset = (gint32)READ32(ip + 3); \ + BACK_BRANCH_PROFILE (br_offset); \ + ip += br_offset; \ + } else \ + ip += 5; + + MINT_IN_CASE(MINT_BGE_UN_I4_S) + BRELOP_S_CAST(guint32, >=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGE_UN_I8_S) + BRELOP_S_CAST(guint64, >=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGE_UN_R4_S) { + float f1 = LOCAL_VAR (ip [1], float); + float f2 = LOCAL_VAR (ip [2], float); + CONDBR_S(isunordered (f1, f2) || f1 >= f2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BGE_UN_R8_S) { + double d1 = LOCAL_VAR (ip [1], double); + double d2 = LOCAL_VAR (ip [2], double); + CONDBR_S(mono_isunordered (d1, d2) || d1 >= d2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BGE_UN_I4) + BRELOP_CAST(guint32, >=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGE_UN_I8) + BRELOP_CAST(guint64, >=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGE_UN_R4) { + float f1 = LOCAL_VAR (ip [1], float); + float f2 = LOCAL_VAR (ip [2], float); + CONDBR(isunordered (f1, f2) || f1 >= f2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BGE_UN_R8) { + double d1 = LOCAL_VAR (ip [1], double); + double d2 = LOCAL_VAR (ip [2], double); + CONDBR(mono_isunordered (d1, d2) || d1 >= d2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BGT_UN_I4_S) + BRELOP_S_CAST(guint32, >); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGT_UN_I8_S) + BRELOP_S_CAST(guint64, >); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGT_UN_R4_S) { + float f1 = LOCAL_VAR (ip [1], float); + float f2 = LOCAL_VAR (ip [2], float); + CONDBR_S(isunordered (f1, f2) || f1 > f2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BGT_UN_R8_S) { + double d1 = LOCAL_VAR (ip [1], double); + double d2 = LOCAL_VAR (ip [2], double); + CONDBR_S(mono_isunordered (d1, d2) || d1 > d2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BGT_UN_I4) + BRELOP_CAST(guint32, >); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGT_UN_I8) + BRELOP_CAST(guint64, >); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGT_UN_R4) { + float f1 = LOCAL_VAR (ip [1], float); + float f2 = LOCAL_VAR (ip [2], float); + CONDBR(isunordered (f1, f2) || f1 > f2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BGT_UN_R8) { + double d1 = LOCAL_VAR (ip [1], double); + double d2 = LOCAL_VAR (ip [2], double); + CONDBR(mono_isunordered (d1, d2) || d1 > d2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BLE_UN_I4_S) + BRELOP_S_CAST(guint32, <=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLE_UN_I8_S) + BRELOP_S_CAST(guint64, <=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLE_UN_R4_S) { + float f1 = LOCAL_VAR (ip [1], float); + float f2 = LOCAL_VAR (ip [2], float); + CONDBR_S(isunordered (f1, f2) || f1 <= f2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BLE_UN_R8_S) { + double d1 = LOCAL_VAR (ip [1], double); + double d2 = LOCAL_VAR (ip [2], double); + CONDBR_S(mono_isunordered (d1, d2) || d1 <= d2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BLE_UN_I4) + BRELOP_CAST(guint32, <=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLE_UN_I8) + BRELOP_CAST(guint64, <=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLE_UN_R4) { + float f1 = LOCAL_VAR (ip [1], float); + float f2 = LOCAL_VAR (ip [2], float); + CONDBR(isunordered (f1, f2) || f1 <= f2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BLE_UN_R8) { + double d1 = LOCAL_VAR (ip [1], double); + double d2 = LOCAL_VAR (ip [2], double); + CONDBR(mono_isunordered (d1, d2) || d1 <= d2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BLT_UN_I4_S) + BRELOP_S_CAST(guint32, <); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLT_UN_I8_S) + BRELOP_S_CAST(guint64, <); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLT_UN_R4_S) { + float f1 = LOCAL_VAR (ip [1], float); + float f2 = LOCAL_VAR (ip [2], float); + CONDBR_S(isunordered (f1, f2) || f1 < f2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BLT_UN_R8_S) { + double d1 = LOCAL_VAR (ip [1], double); + double d2 = LOCAL_VAR (ip [2], double); + CONDBR_S(mono_isunordered (d1, d2) || d1 < d2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BLT_UN_I4) + BRELOP_CAST(guint32, <); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLT_UN_I8) + BRELOP_CAST(guint64, <); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLT_UN_R4) { + float f1 = LOCAL_VAR (ip [1], float); + float f2 = LOCAL_VAR (ip [2], float); + CONDBR(isunordered (f1, f2) || f1 < f2) + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BLT_UN_R8) { + double d1 = LOCAL_VAR (ip [1], double); + double d2 = LOCAL_VAR (ip [2], double); + CONDBR(mono_isunordered (d1, d2) || d1 < d2) + MINT_IN_BREAK; + } + +#define ZEROP_SP(datatype, op) \ + if (LOCAL_VAR (ip [1], datatype) op 0) { \ + gint16 br_offset = (gint16) ip [2]; \ + BACK_BRANCH_PROFILE (br_offset); \ + SAFEPOINT; \ + ip += br_offset; \ + } else \ + ip += 3; + +MINT_IN_CASE(MINT_BRFALSE_I4_SP) ZEROP_SP(gint32, ==); MINT_IN_BREAK; +MINT_IN_CASE(MINT_BRFALSE_I8_SP) ZEROP_SP(gint64, ==); MINT_IN_BREAK; +MINT_IN_CASE(MINT_BRTRUE_I4_SP) ZEROP_SP(gint32, !=); MINT_IN_BREAK; +MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; + +#define CONDBR_SP(cond) \ + if (cond) { \ + gint16 br_offset = (gint16) ip [3]; \ + BACK_BRANCH_PROFILE (br_offset); \ + SAFEPOINT; \ + ip += br_offset; \ + } else \ + ip += 4; +#define BRELOP_SP(datatype, op) \ + CONDBR_SP(LOCAL_VAR (ip [1], datatype) op LOCAL_VAR (ip [2], datatype)) + + MINT_IN_CASE(MINT_BEQ_I4_SP) BRELOP_SP(gint32, ==); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BEQ_I8_SP) BRELOP_SP(gint64, ==); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGE_I4_SP) BRELOP_SP(gint32, >=); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGE_I8_SP) BRELOP_SP(gint64, >=); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGT_I4_SP) BRELOP_SP(gint32, >); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGT_I8_SP) BRELOP_SP(gint64, >); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLT_I4_SP) BRELOP_SP(gint32, <); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLT_I8_SP) BRELOP_SP(gint64, <); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLE_I4_SP) BRELOP_SP(gint32, <=); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLE_I8_SP) BRELOP_SP(gint64, <=); MINT_IN_BREAK; + + MINT_IN_CASE(MINT_BNE_UN_I4_SP) BRELOP_SP(guint32, !=); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BNE_UN_I8_SP) BRELOP_SP(guint64, !=); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGE_UN_I4_SP) BRELOP_SP(guint32, >=); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGE_UN_I8_SP) BRELOP_SP(guint64, >=); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGT_UN_I4_SP) BRELOP_SP(guint32, >); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGT_UN_I8_SP) BRELOP_SP(guint64, >); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLE_UN_I4_SP) BRELOP_SP(guint32, <=); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLE_UN_I8_SP) BRELOP_SP(guint64, <=); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLT_UN_I4_SP) BRELOP_SP(guint32, <); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLT_UN_I8_SP) BRELOP_SP(guint64, <); MINT_IN_BREAK; + +#define BRELOP_IMM_SP(datatype, op) \ + CONDBR_SP(LOCAL_VAR (ip [1], datatype) op (datatype)(gint16)ip [2]) + + MINT_IN_CASE(MINT_BEQ_I4_IMM_SP) BRELOP_IMM_SP(gint32, ==); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BEQ_I8_IMM_SP) BRELOP_IMM_SP(gint64, ==); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGE_I4_IMM_SP) BRELOP_IMM_SP(gint32, >=); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGE_I8_IMM_SP) BRELOP_IMM_SP(gint64, >=); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGT_I4_IMM_SP) BRELOP_IMM_SP(gint32, >); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGT_I8_IMM_SP) BRELOP_IMM_SP(gint64, >); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLT_I4_IMM_SP) BRELOP_IMM_SP(gint32, <); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLT_I8_IMM_SP) BRELOP_IMM_SP(gint64, <); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLE_I4_IMM_SP) BRELOP_IMM_SP(gint32, <=); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLE_I8_IMM_SP) BRELOP_IMM_SP(gint64, <=); MINT_IN_BREAK; + + MINT_IN_CASE(MINT_BNE_UN_I4_IMM_SP) BRELOP_IMM_SP(guint32, !=); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BNE_UN_I8_IMM_SP) BRELOP_IMM_SP(guint64, !=); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGE_UN_I4_IMM_SP) BRELOP_IMM_SP(guint32, >=); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGE_UN_I8_IMM_SP) BRELOP_IMM_SP(guint64, >=); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGT_UN_I4_IMM_SP) BRELOP_IMM_SP(guint32, >); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BGT_UN_I8_IMM_SP) BRELOP_IMM_SP(guint64, >); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLE_UN_I4_IMM_SP) BRELOP_IMM_SP(guint32, <=); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLE_UN_I8_IMM_SP) BRELOP_IMM_SP(guint64, <=); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLT_UN_I4_IMM_SP) BRELOP_IMM_SP(guint32, <); MINT_IN_BREAK; + MINT_IN_CASE(MINT_BLT_UN_I8_IMM_SP) BRELOP_IMM_SP(guint64, <); MINT_IN_BREAK; + + MINT_IN_CASE(MINT_SWITCH) { + guint32 val = LOCAL_VAR (ip [1], guint32); + guint32 n = READ32 (ip + 2); + ip += 4; + if (val < n) { + ip += 2 * val; + int offset = READ32 (ip); + ip += offset; + } else { + ip += 2 * n; + } + MINT_IN_BREAK; + } +#define LDIND(datatype,casttype,unaligned) do { \ + MONO_DISABLE_WARNING(4127) \ + gpointer ptr = LOCAL_VAR (ip [2], gpointer); \ + NULL_CHECK (ptr); \ + if (unaligned && ((gsize)ptr % SIZEOF_VOID_P)) \ + memcpy (locals + ip [1], ptr, sizeof (datatype)); \ + else \ + LOCAL_VAR (ip [1], datatype) = *(casttype*)ptr; \ + ip += 3; \ + MONO_RESTORE_WARNING \ +} while (0) + MINT_IN_CASE(MINT_LDIND_I1) + LDIND(int, gint8, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_U1) + LDIND(int, guint8, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_I2) + LDIND(int, gint16, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_U2) + LDIND(int, guint16, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_I4) { + LDIND(int, gint32, FALSE); + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_LDIND_I8) +#ifdef NO_UNALIGNED_ACCESS + LDIND(gint64, gint64, TRUE); +#else + LDIND(gint64, gint64, FALSE); +#endif + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_R4) + LDIND(float, gfloat, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_R8) +#ifdef NO_UNALIGNED_ACCESS + LDIND(double, gdouble, TRUE); +#else + LDIND(double, gdouble, FALSE); +#endif + MINT_IN_BREAK; + +#define LDIND_OFFSET(datatype,casttype,unaligned) do { \ + MONO_DISABLE_WARNING(4127) \ + gpointer ptr = LOCAL_VAR (ip [2], gpointer); \ + NULL_CHECK (ptr); \ + ptr = (char*)ptr + LOCAL_VAR (ip [3], mono_i); \ + if (unaligned && ((gsize)ptr % SIZEOF_VOID_P)) \ + memcpy (locals + ip [1], ptr, sizeof (datatype)); \ + else \ + LOCAL_VAR (ip [1], datatype) = *(casttype*)ptr; \ + ip += 4; \ + MONO_RESTORE_WARNING \ +} while (0) + MINT_IN_CASE(MINT_LDIND_OFFSET_I1) + LDIND_OFFSET(int, gint8, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_OFFSET_U1) + LDIND_OFFSET(int, guint8, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_OFFSET_I2) + LDIND_OFFSET(int, gint16, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_OFFSET_U2) + LDIND_OFFSET(int, guint16, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_OFFSET_I4) + LDIND_OFFSET(int, gint32, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_OFFSET_I8) +#ifdef NO_UNALIGNED_ACCESS + LDIND_OFFSET(gint64, gint64, TRUE); +#else + LDIND_OFFSET(gint64, gint64, FALSE); +#endif + MINT_IN_BREAK; + +#define LDIND_OFFSET_ADD_MUL(datatype,casttype,unaligned) do { \ + MONO_DISABLE_WARNING(4127) \ + gpointer ptr = LOCAL_VAR (ip [2], gpointer); \ + NULL_CHECK (ptr); \ + ptr = (char*)ptr + (LOCAL_VAR (ip [3], mono_i) + (gint16)ip [4]) * (gint16)ip [5]; \ + if (unaligned && ((gsize)ptr % SIZEOF_VOID_P)) \ + memcpy (locals + ip [1], ptr, sizeof (datatype)); \ + else \ + LOCAL_VAR (ip [1], datatype) = *(casttype*)ptr; \ + ip += 6; \ + MONO_RESTORE_WARNING \ +} while (0) + MINT_IN_CASE(MINT_LDIND_OFFSET_ADD_MUL_IMM_I1) + LDIND_OFFSET_ADD_MUL(gint32, gint8, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_OFFSET_ADD_MUL_IMM_U1) + LDIND_OFFSET_ADD_MUL(gint32, guint8, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_OFFSET_ADD_MUL_IMM_I2) + LDIND_OFFSET_ADD_MUL(gint32, gint16, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_OFFSET_ADD_MUL_IMM_U2) + LDIND_OFFSET_ADD_MUL(gint32, guint16, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_OFFSET_ADD_MUL_IMM_I4) + LDIND_OFFSET_ADD_MUL(gint32, gint32, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_OFFSET_ADD_MUL_IMM_I8) +#ifdef NO_UNALIGNED_ACCESS + LDIND_OFFSET_ADD_MUL(gint64, gint64, TRUE); +#else + LDIND_OFFSET_ADD_MUL(gint64, gint64, FALSE); +#endif + MINT_IN_BREAK; + +#define LDIND_OFFSET_IMM(datatype,casttype,unaligned) do { \ + MONO_DISABLE_WARNING(4127) \ + gpointer ptr = LOCAL_VAR (ip [2], gpointer); \ + NULL_CHECK (ptr); \ + ptr = (char*)ptr + (gint16)ip [3]; \ + if (unaligned && ((gsize)ptr % SIZEOF_VOID_P)) \ + memcpy (locals + ip [1], ptr, sizeof (datatype)); \ + else \ + LOCAL_VAR (ip [1], datatype) = *(casttype*)ptr; \ + ip += 4; \ + MONO_RESTORE_WARNING \ +} while (0) + MINT_IN_CASE(MINT_LDIND_OFFSET_IMM_I1) + LDIND_OFFSET_IMM(int, gint8, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_OFFSET_IMM_U1) + LDIND_OFFSET_IMM(int, guint8, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_OFFSET_IMM_I2) + LDIND_OFFSET_IMM(int, gint16, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_OFFSET_IMM_U2) + LDIND_OFFSET_IMM(int, guint16, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_OFFSET_IMM_I4) + LDIND_OFFSET_IMM(int, gint32, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDIND_OFFSET_IMM_I8) +#ifdef NO_UNALIGNED_ACCESS + LDIND_OFFSET_IMM(gint64, gint64, TRUE); +#else + LDIND_OFFSET_IMM(gint64, gint64, FALSE); +#endif + MINT_IN_BREAK; + MINT_IN_CASE(MINT_STIND_REF) { + gpointer ptr = LOCAL_VAR (ip [1], gpointer); + NULL_CHECK (ptr); + mono_gc_wbarrier_generic_store_internal (ptr, LOCAL_VAR (ip [2], MonoObject*)); + ip += 3; + MINT_IN_BREAK; + } +#define STIND(datatype,unaligned) do { \ + MONO_DISABLE_WARNING(4127) \ + gpointer ptr = LOCAL_VAR (ip [1], gpointer); \ + NULL_CHECK (ptr); \ + if (unaligned && ((gsize)ptr % SIZEOF_VOID_P)) \ + memcpy (ptr, locals + ip [2], sizeof (datatype)); \ + else \ + *(datatype*)ptr = LOCAL_VAR (ip [2], datatype); \ + ip += 3; \ + MONO_RESTORE_WARNING \ +} while (0) + MINT_IN_CASE(MINT_STIND_I1) + STIND(gint8, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_STIND_I2) + STIND(gint16, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_STIND_I4) + STIND(gint32, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_STIND_I8) +#ifdef NO_UNALIGNED_ACCESS + STIND(gint64, TRUE); +#else + STIND(gint64, FALSE); +#endif + MINT_IN_BREAK; + MINT_IN_CASE(MINT_STIND_R4) + STIND(float, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_STIND_R8) +#ifdef NO_UNALIGNED_ACCESS + STIND(double, TRUE); +#else + STIND(double, FALSE); +#endif + MINT_IN_BREAK; + +#define STIND_OFFSET(datatype,unaligned) do { \ + MONO_DISABLE_WARNING(4127) \ + gpointer ptr = LOCAL_VAR (ip [1], gpointer); \ + NULL_CHECK (ptr); \ + ptr = (char*)ptr + LOCAL_VAR (ip [2], mono_i); \ + if (unaligned && ((gsize)ptr % SIZEOF_VOID_P)) \ + memcpy (ptr, locals + ip [3], sizeof (datatype)); \ + else \ + *(datatype*)ptr = LOCAL_VAR (ip [3], datatype); \ + ip += 4; \ + MONO_RESTORE_WARNING \ +} while (0) + MINT_IN_CASE(MINT_STIND_OFFSET_I1) + STIND_OFFSET(gint8, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_STIND_OFFSET_I2) + STIND_OFFSET(gint16, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_STIND_OFFSET_I4) + STIND_OFFSET(gint32, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_STIND_OFFSET_I8) +#ifdef NO_UNALIGNED_ACCESS + STIND_OFFSET(gint64, TRUE); +#else + STIND_OFFSET(gint64, FALSE); +#endif + MINT_IN_BREAK; + +#define STIND_OFFSET_IMM(datatype,unaligned) do { \ + MONO_DISABLE_WARNING(4127) \ + gpointer ptr = LOCAL_VAR (ip [1], gpointer); \ + NULL_CHECK (ptr); \ + ptr = (char*)ptr + (gint16)ip [3]; \ + if (unaligned && ((gsize)ptr % SIZEOF_VOID_P)) \ + memcpy (ptr, locals + ip [2], sizeof (datatype)); \ + else \ + *(datatype*)ptr = LOCAL_VAR (ip [2], datatype); \ + ip += 4; \ + MONO_RESTORE_WARNING \ +} while (0) + MINT_IN_CASE(MINT_STIND_OFFSET_IMM_I1) + STIND_OFFSET_IMM(gint8, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_STIND_OFFSET_IMM_I2) + STIND_OFFSET_IMM(gint16, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_STIND_OFFSET_IMM_I4) + STIND_OFFSET_IMM(gint32, FALSE); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_STIND_OFFSET_IMM_I8) +#ifdef NO_UNALIGNED_ACCESS + STIND_OFFSET_IMM(gint64, TRUE); +#else + STIND_OFFSET_IMM(gint64, FALSE); +#endif + MINT_IN_BREAK; +#define BINOP(datatype, op) \ + LOCAL_VAR (ip [1], datatype) = LOCAL_VAR (ip [2], datatype) op LOCAL_VAR (ip [3], datatype); \ + ip += 4; + MINT_IN_CASE(MINT_ADD_I4) + BINOP(gint32, +); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_ADD_I8) + BINOP(gint64, +); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_ADD_R4) + BINOP(float, +); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_ADD_R8) + BINOP(double, +); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_ADD1_I4) + LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) + 1; + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_ADD_I4_IMM) + LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) + (gint16)ip [3]; + ip += 4; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_ADD_I4_IMM2) + LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) + (gint32)READ32 (ip + 3); + ip += 5; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_ADD1_I8) + LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) + 1; + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_ADD_I8_IMM) + LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) + (gint16)ip [3]; + ip += 4; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_ADD_I8_IMM2) + LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) + (gint32)READ32 (ip + 3); + ip += 5; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SUB_I4) + BINOP(gint32, -); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SUB_I8) + BINOP(gint64, -); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SUB_R4) + BINOP(float, -); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SUB_R8) + BINOP(double, -); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SUB1_I4) + LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) - 1; + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SUB1_I8) + LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) - 1; + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_MUL_I4) + BINOP(gint32, *); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_MUL_I8) + BINOP(gint64, *); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_MUL_I4_IMM) + LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) * (gint16)ip [3]; + ip += 4; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_MUL_I4_IMM2) + LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) * (gint32)READ32 (ip + 3); + ip += 5; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_MUL_I8_IMM) + LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) * (gint16)ip [3]; + ip += 4; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_MUL_I8_IMM2) + LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) * (gint32)READ32 (ip + 3); + ip += 5; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_ADD_MUL_I4_IMM) + LOCAL_VAR (ip [1], gint32) = (LOCAL_VAR (ip [2], gint32) + (gint16)ip [3]) * (gint16)ip [4]; + ip += 5; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_ADD_MUL_I8_IMM) + LOCAL_VAR (ip [1], gint64) = (LOCAL_VAR (ip [2], gint64) + (gint16)ip [3]) * (gint16)ip [4]; + ip += 5; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_MUL_R4) + BINOP(float, *); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_MUL_R8) + BINOP(double, *); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_DIV_I4) { + gint32 i1 = LOCAL_VAR (ip [2], gint32); + gint32 i2 = LOCAL_VAR (ip [3], gint32); + if (i2 == 0) + THROW_EX (interp_get_exception_divide_by_zero (frame, ip), ip); + if (i2 == (-1) && i1 == G_MININT32) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = i1 / i2; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_DIV_I8) { + gint64 l1 = LOCAL_VAR (ip [2], gint64); + gint64 l2 = LOCAL_VAR (ip [3], gint64); + if (l2 == 0) + THROW_EX (interp_get_exception_divide_by_zero (frame, ip), ip); + if (l2 == (-1) && l1 == G_MININT64) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint64) = l1 / l2; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_DIV_R4) + BINOP(float, /); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_DIV_R8) + BINOP(double, /); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_DIV_UN_I4) { + guint32 i2 = LOCAL_VAR (ip [3], guint32); + if (i2 == 0) + THROW_EX (interp_get_exception_divide_by_zero (frame, ip), ip); + LOCAL_VAR (ip [1], guint32) = LOCAL_VAR (ip [2], guint32) / i2; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_DIV_UN_I8) { + guint64 l2 = LOCAL_VAR (ip [3], guint64); + if (l2 == 0) + THROW_EX (interp_get_exception_divide_by_zero (frame, ip), ip); + LOCAL_VAR (ip [1], guint64) = LOCAL_VAR (ip [2], guint64) / l2; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_REM_I4) { + gint32 i1 = LOCAL_VAR (ip [2], gint32); + gint32 i2 = LOCAL_VAR (ip [3], gint32); + if (i2 == 0) + THROW_EX (interp_get_exception_divide_by_zero (frame, ip), ip); + if (i2 == (-1) && i1 == G_MININT32) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = i1 % i2; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_REM_I8) { + gint64 l1 = LOCAL_VAR (ip [2], gint64); + gint64 l2 = LOCAL_VAR (ip [3], gint64); + if (l2 == 0) + THROW_EX (interp_get_exception_divide_by_zero (frame, ip), ip); + if (l2 == (-1) && l1 == G_MININT64) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint64) = l1 % l2; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_REM_R4) + LOCAL_VAR (ip [1], float) = fmodf (LOCAL_VAR (ip [2], float), LOCAL_VAR (ip [3], float)); + ip += 4; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_REM_R8) + LOCAL_VAR (ip [1], double) = fmod (LOCAL_VAR (ip [2], double), LOCAL_VAR (ip [3], double)); + ip += 4; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_REM_UN_I4) { + guint32 i2 = LOCAL_VAR (ip [3], guint32); + if (i2 == 0) + THROW_EX (interp_get_exception_divide_by_zero (frame, ip), ip); + LOCAL_VAR (ip [1], guint32) = LOCAL_VAR (ip [2], guint32) % i2; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_REM_UN_I8) { + guint64 l2 = LOCAL_VAR (ip [3], guint64); + if (l2 == 0) + THROW_EX (interp_get_exception_divide_by_zero (frame, ip), ip); + LOCAL_VAR (ip [1], guint64) = LOCAL_VAR (ip [2], guint64) % l2; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_AND_I4) + BINOP(gint32, &); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_AND_I4_IMM) + LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) & (gint16)ip [3]; + ip += 4; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_AND_I4_IMM2) + LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) & READ32 (ip + 3); + ip += 5; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_AND_I8) + BINOP(gint64, &); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_OR_I4) + BINOP(gint32, |); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_OR_I4_IMM) + LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) | (gint16)ip [3]; + ip += 4; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_OR_I4_IMM2) + LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) | READ32 (ip + 3); + ip += 5; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_OR_I8) + BINOP(gint64, |); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_XOR_I4) + BINOP(gint32, ^); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_XOR_I8) + BINOP(gint64, ^); + MINT_IN_BREAK; + +#define SHIFTOP(datatype, op) \ + LOCAL_VAR (ip [1], datatype) = LOCAL_VAR (ip [2], datatype) op LOCAL_VAR (ip [3], gint32); \ + ip += 4; + + MINT_IN_CASE(MINT_SHL_I4) + SHIFTOP(gint32, <<); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SHL_I8) + SHIFTOP(gint64, <<); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SHR_I4) + SHIFTOP(gint32, >>); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SHR_I8) + SHIFTOP(gint64, >>); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SHR_UN_I4) + SHIFTOP(guint32, >>); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SHR_UN_I8) + SHIFTOP(guint64, >>); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SHL_I4_IMM) + LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) << ip [3]; + ip += 4; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SHL_I8_IMM) + LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) << ip [3]; + ip += 4; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SHR_I4_IMM) + LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) >> ip [3]; + ip += 4; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SHR_I8_IMM) + LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) >> ip [3]; + ip += 4; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SHR_UN_I4_IMM) + LOCAL_VAR (ip [1], guint32) = LOCAL_VAR (ip [2], guint32) >> ip [3]; + ip += 4; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SHR_UN_I8_IMM) + LOCAL_VAR (ip [1], guint64) = LOCAL_VAR (ip [2], guint64) >> ip [3]; + ip += 4; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SHL_AND_I4) + LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) << (LOCAL_VAR (ip [3], gint32) & 31); + ip += 4; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SHL_AND_I8) + LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) << (LOCAL_VAR (ip [3], gint64) & 63); + ip += 4; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_NEG_I4) + LOCAL_VAR (ip [1], gint32) = - LOCAL_VAR (ip [2], gint32); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_NEG_I8) + LOCAL_VAR (ip [1], gint64) = - LOCAL_VAR (ip [2], gint64); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_NEG_R4) + LOCAL_VAR (ip [1], float) = - LOCAL_VAR (ip [2], float); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_NEG_R8) + LOCAL_VAR (ip [1], double) = - LOCAL_VAR (ip [2], double); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_NOT_I4) + LOCAL_VAR (ip [1], gint32) = ~ LOCAL_VAR (ip [2], gint32); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_NOT_I8) + LOCAL_VAR (ip [1], gint64) = ~ LOCAL_VAR (ip [2], gint64); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_I1_I4) + // FIXME read casted var directly and remove redundant conv opcodes + LOCAL_VAR (ip [1], gint32) = (gint8)LOCAL_VAR (ip [2], gint32); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_I1_I8) + LOCAL_VAR (ip [1], gint32) = (gint8)LOCAL_VAR (ip [2], gint64); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_I1_R4) + LOCAL_VAR (ip [1], gint32) = (gint8) (gint32) LOCAL_VAR (ip [2], float); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_I1_R8) + /* without gint32 cast, C compiler is allowed to use undefined + * behaviour if data.f is bigger than >255. See conv.fpint section + * in C standard: + * > The conversion truncates; that is, the fractional part + * > is discarded. The behavior is undefined if the truncated + * > value cannot be represented in the destination type. + * */ + LOCAL_VAR (ip [1], gint32) = (gint8) (gint32) LOCAL_VAR (ip [2], double); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_U1_I4) + LOCAL_VAR (ip [1], gint32) = (guint8) LOCAL_VAR (ip [2], gint32); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_U1_I8) + LOCAL_VAR (ip [1], gint32) = (guint8) LOCAL_VAR (ip [2], gint64); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_U1_R4) + LOCAL_VAR (ip [1], gint32) = (guint8) (guint32) LOCAL_VAR (ip [2], float); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_U1_R8) + LOCAL_VAR (ip [1], gint32) = (guint8) (guint32) LOCAL_VAR (ip [2], double); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_I2_I4) + LOCAL_VAR (ip [1], gint32) = (gint16) LOCAL_VAR (ip [2], gint32); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_I2_I8) + LOCAL_VAR (ip [1], gint32) = (gint16) LOCAL_VAR (ip [2], gint64); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_I2_R4) + LOCAL_VAR (ip [1], gint32) = (gint16) (gint32) LOCAL_VAR (ip [2], float); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_I2_R8) + LOCAL_VAR (ip [1], gint32) = (gint16) (gint32) LOCAL_VAR (ip [2], double); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_U2_I4) + LOCAL_VAR (ip [1], gint32) = (guint16) LOCAL_VAR (ip [2], gint32); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_U2_I8) + LOCAL_VAR (ip [1], gint32) = (guint16) LOCAL_VAR (ip [2], gint64); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_U2_R4) + LOCAL_VAR (ip [1], gint32) = (guint16) (guint32) LOCAL_VAR (ip [2], float); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_U2_R8) + LOCAL_VAR (ip [1], gint32) = (guint16) (guint32) LOCAL_VAR (ip [2], double); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_I4_R4) + LOCAL_VAR (ip [1], gint32) = (gint32) LOCAL_VAR (ip [2], float); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_I4_R8) + LOCAL_VAR (ip [1], gint32) = (gint32) LOCAL_VAR (ip [2], double); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_U4_R4) +#ifdef MONO_ARCH_EMULATE_FCONV_TO_U4 + LOCAL_VAR (ip [1], gint32) = mono_rconv_u4 (LOCAL_VAR (ip [2], float)); +#else + LOCAL_VAR (ip [1], gint32) = (guint32) LOCAL_VAR (ip [2], float); +#endif + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_U4_R8) +#ifdef MONO_ARCH_EMULATE_FCONV_TO_U4 + LOCAL_VAR (ip [1], gint32) = mono_fconv_u4 (LOCAL_VAR (ip [2], double)); +#else + LOCAL_VAR (ip [1], gint32) = (guint32) LOCAL_VAR (ip [2], double); +#endif + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_I8_I4) + LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint32); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_I8_U4) + LOCAL_VAR (ip [1], gint64) = (guint32) LOCAL_VAR (ip [2], gint32); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_I8_R4) + LOCAL_VAR (ip [1], gint64) = (gint64) LOCAL_VAR (ip [2], float); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_I8_R8) + LOCAL_VAR (ip [1], gint64) = (gint64) LOCAL_VAR (ip [2], double); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_R4_I4) + LOCAL_VAR (ip [1], float) = (float) LOCAL_VAR (ip [2], gint32); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_R4_I8) + LOCAL_VAR (ip [1], float) = (float) LOCAL_VAR (ip [2], gint64); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_R4_R8) + LOCAL_VAR (ip [1], float) = (float) LOCAL_VAR (ip [2], double); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_R8_I4) + LOCAL_VAR (ip [1], double) = (double) LOCAL_VAR (ip [2], gint32); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_R8_I8) + LOCAL_VAR (ip [1], double) = (double) LOCAL_VAR (ip [2], gint64); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_R8_R4) + LOCAL_VAR (ip [1], double) = (double) LOCAL_VAR (ip [2], float); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_U8_R4) +#ifdef MONO_ARCH_EMULATE_FCONV_TO_U8 + LOCAL_VAR (ip [1], gint64) = mono_rconv_u8 (LOCAL_VAR (ip [2], float)); +#else + LOCAL_VAR (ip [1], gint64) = (guint64) LOCAL_VAR (ip [2], float); +#endif + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_U8_R8) +#ifdef MONO_ARCH_EMULATE_FCONV_TO_U8 + LOCAL_VAR (ip [1], gint64) = mono_fconv_u8 (LOCAL_VAR (ip [2], double)); +#else + LOCAL_VAR (ip [1], gint64) = (guint64) LOCAL_VAR (ip [2], double); +#endif + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CPOBJ) { + MonoClass* const c = (MonoClass*)frame->imethod->data_items[ip [3]]; + g_assert (m_class_is_valuetype (c)); + /* if this assertion fails, we need to add a write barrier */ + g_assert (!MONO_TYPE_IS_REFERENCE (m_class_get_byval_arg (c))); + stackval_from_data (m_class_get_byval_arg (c), (stackval*)LOCAL_VAR (ip [1], gpointer), LOCAL_VAR (ip [2], gpointer), FALSE); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CPOBJ_VT) { + MonoClass* const c = (MonoClass*)frame->imethod->data_items[ip [3]]; + mono_value_copy_internal (LOCAL_VAR (ip [1], gpointer), LOCAL_VAR (ip [2], gpointer), c); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CPOBJ_VT_NOREF) { + gpointer src_addr = LOCAL_VAR (ip [2], gpointer); + NULL_CHECK (src_addr); + memcpy (LOCAL_VAR (ip [1], gpointer), src_addr, ip [3]); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_LDOBJ_VT) { + guint16 size = ip [3]; + gpointer srcAddr = LOCAL_VAR (ip [2], gpointer); + NULL_CHECK (srcAddr); + memcpy (locals + ip [1], srcAddr, size); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_LDSTR) + LOCAL_VAR (ip [1], gpointer) = frame->imethod->data_items [ip [2]]; + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDSTR_DYNAMIC) { + MonoString *s = NULL; + guint32 strtoken = (guint32)(gsize)frame->imethod->data_items [ip [2]]; + + MonoMethod *method = frame->imethod->method; + g_assert (method->wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD); + s = (MonoString*)mono_method_get_wrapper_data (method, strtoken); + LOCAL_VAR (ip [1], gpointer) = s; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_LDSTR_CSTR) { + MonoString *s = NULL; + const char* cstr = (const char*)frame->imethod->data_items [ip [2]]; + + // FIXME push/pop LMF + s = mono_string_new_wrapper_internal (cstr); + LOCAL_VAR (ip [1], gpointer) = s; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_NEWOBJ_ARRAY) { + MonoClass *newobj_class; + guint32 token = ip [3]; + guint16 param_count = ip [4]; + + newobj_class = (MonoClass*) frame->imethod->data_items [token]; + + // FIXME push/pop LMF + LOCAL_VAR (ip [1], MonoObject*) = ves_array_create (newobj_class, param_count, (stackval*)(locals + ip [2]), error); + if (!is_ok (error)) + THROW_EX (interp_error_convert_to_exception (frame, error, ip), ip); + ip += 5; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_NEWOBJ_STRING) { + cmethod = (InterpMethod*)frame->imethod->data_items [ip [3]]; + return_offset = ip [1]; + call_args_offset = ip [2]; + + // `this` is implicit null. The created string will be returned + // by the call, even though the call has void return (?!). + LOCAL_VAR (call_args_offset, gpointer) = NULL; + ip += 4; + goto jit_call; + } + MINT_IN_CASE(MINT_NEWOBJ_STRING_UNOPT) { + // Same as MINT_NEWOBJ_STRING but copy params into right place on stack + cmethod = (InterpMethod*)frame->imethod->data_items [ip [2]]; + return_offset = ip [1]; + call_args_offset = ip [1]; + int aligned_call_args_offset = ALIGN_TO (call_args_offset, MINT_STACK_ALIGNMENT); + + int param_size = ip [3]; + if (param_size) + memmove (locals + aligned_call_args_offset + MINT_STACK_SLOT_SIZE, locals + call_args_offset, param_size); + call_args_offset = aligned_call_args_offset; + LOCAL_VAR (call_args_offset, gpointer) = NULL; + ip += 4; + goto jit_call; + } + MINT_IN_CASE(MINT_NEWOBJ) { + MonoVTable *vtable = (MonoVTable*) frame->imethod->data_items [ip [4]]; + INIT_VTABLE (vtable); + guint16 imethod_index = ip [3]; + return_offset = ip [1]; + call_args_offset = ip [2]; + + // FIXME push/pop LMF + MonoObject *o = mono_gc_alloc_obj (vtable, m_class_get_instance_size (vtable->klass)); + if (G_UNLIKELY (!o)) { + mono_error_set_out_of_memory (error, "Could not allocate %i bytes", m_class_get_instance_size (vtable->klass)); + THROW_EX (interp_error_convert_to_exception (frame, error, ip), ip); + } + + // This is return value + LOCAL_VAR (return_offset, MonoObject*) = o; + // Set `this` arg for ctor call + LOCAL_VAR (call_args_offset, MonoObject*) = o; + ip += 5; + + cmethod = (InterpMethod*)frame->imethod->data_items [imethod_index]; + + goto jit_call; + } + MINT_IN_CASE(MINT_NEWOBJ_INLINED) { + MonoVTable *vtable = (MonoVTable*) frame->imethod->data_items [ip [2]]; + INIT_VTABLE (vtable); + + // FIXME push/pop LMF + MonoObject *o = mono_gc_alloc_obj (vtable, m_class_get_instance_size (vtable->klass)); + if (G_UNLIKELY (!o)) { + mono_error_set_out_of_memory (error, "Could not allocate %i bytes", m_class_get_instance_size (vtable->klass)); + THROW_EX (interp_error_convert_to_exception (frame, error, ip), ip); + } + + // This is return value + LOCAL_VAR (ip [1], MonoObject*) = o; + ip += 3; + MINT_IN_BREAK; + } + + MINT_IN_CASE(MINT_NEWOBJ_VT) { + guint16 imethod_index = ip [3]; + guint16 ret_size = ip [4]; + return_offset = ip [1]; + call_args_offset = ip [2]; + gpointer this_vt = locals + return_offset; + + // clear the valuetype + memset (this_vt, 0, ret_size); + // pass the address of the valuetype + LOCAL_VAR (call_args_offset, gpointer) = this_vt; + ip += 5; + + cmethod = (InterpMethod*)frame->imethod->data_items [imethod_index]; + goto jit_call; + } + MINT_IN_CASE(MINT_NEWOBJ_SLOW) { + guint32 const token = ip [3]; + return_offset = ip [1]; + call_args_offset = ip [2]; + + cmethod = (InterpMethod*)frame->imethod->data_items [token]; + + MonoClass * const newobj_class = cmethod->method->klass; + + /* + * First arg is the object. + * a constructor returns void, but we need to return the object we created + */ + + g_assert (!m_class_is_valuetype (newobj_class)); + + // FIXME push/pop LMF + MonoVTable *vtable = mono_class_vtable_checked (newobj_class, error); + if (!is_ok (error) || !mono_runtime_class_init_full (vtable, error)) { + MonoException *exc = interp_error_convert_to_exception (frame, error, ip); + g_assert (exc); + THROW_EX (exc, ip); + } + error_init_reuse (error); + MonoObject* o = mono_object_new_checked (newobj_class, error); + LOCAL_VAR (return_offset, MonoObject*) = o; // return value + LOCAL_VAR (call_args_offset, MonoObject*) = o; // first parameter + + mono_interp_error_cleanup (error); // FIXME: do not swallow the error + EXCEPTION_CHECKPOINT; + ip += 4; + goto jit_call; + } + + MINT_IN_CASE(MINT_ROL_I4_IMM) { + guint32 val = LOCAL_VAR (ip [2], guint32); + int amount = ip [3]; + LOCAL_VAR (ip [1], guint32) = (val << amount) | (val >> (32 - amount)); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_ROL_I8_IMM) { + guint64 val = LOCAL_VAR (ip [2], guint64); + int amount = ip [3]; + LOCAL_VAR (ip [1], guint64) = (val << amount) | (val >> (64 - amount)); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_ROR_I4_IMM) { + guint32 val = LOCAL_VAR (ip [2], guint32); + int amount = ip [3]; + LOCAL_VAR (ip [1], guint32) = (val >> amount) | (val << (32 - amount)); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_ROR_I8_IMM) { + guint64 val = LOCAL_VAR (ip [2], guint64); + int amount = ip [3]; + LOCAL_VAR (ip [1], guint64) = (val >> amount) | (val << (64 - amount)); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CLZ_I4) LOCAL_VAR (ip [1], gint32) = interp_intrins_clz_i4 (LOCAL_VAR (ip [2], guint32)); ip += 3; MINT_IN_BREAK; + MINT_IN_CASE(MINT_CLZ_I8) LOCAL_VAR (ip [1], gint64) = interp_intrins_clz_i8 (LOCAL_VAR (ip [2], guint64)); ip += 3; MINT_IN_BREAK; + MINT_IN_CASE(MINT_CTZ_I4) LOCAL_VAR (ip [1], gint32) = interp_intrins_ctz_i4 (LOCAL_VAR (ip [2], guint32)); ip += 3; MINT_IN_BREAK; + MINT_IN_CASE(MINT_CTZ_I8) LOCAL_VAR (ip [1], gint64) = interp_intrins_ctz_i8 (LOCAL_VAR (ip [2], guint64)); ip += 3; MINT_IN_BREAK; + MINT_IN_CASE(MINT_POPCNT_I4) LOCAL_VAR (ip [1], gint32) = interp_intrins_popcount_i4 (LOCAL_VAR (ip [2], guint32)); ip += 3; MINT_IN_BREAK; + MINT_IN_CASE(MINT_POPCNT_I8) LOCAL_VAR (ip [1], gint64) = interp_intrins_popcount_i8 (LOCAL_VAR (ip [2], guint64)); ip += 3; MINT_IN_BREAK; + MINT_IN_CASE(MINT_LOG2_I4) LOCAL_VAR (ip [1], gint32) = 31 ^ interp_intrins_clz_i4 (LOCAL_VAR (ip [2], guint32) | 1); ip += 3; MINT_IN_BREAK; + MINT_IN_CASE(MINT_LOG2_I8) LOCAL_VAR (ip [1], gint32) = 63 ^ interp_intrins_clz_i8 (LOCAL_VAR (ip [2], guint64) | 1); ip += 3; MINT_IN_BREAK; + +#ifdef INTERP_ENABLE_SIMD + MINT_IN_CASE(MINT_SIMD_V128_LDC) { + memcpy (locals + ip [1], ip + 2, SIZEOF_V128); + ip += 10; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_SIMD_V128_I1_CREATE) { + interp_simd_create (locals + ip [1], locals + ip [2], 1); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_SIMD_V128_I2_CREATE) { + interp_simd_create (locals + ip [1], locals + ip [2], 2); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_SIMD_V128_I4_CREATE) { + interp_simd_create (locals + ip [1], locals + ip [2], 4); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_SIMD_V128_I8_CREATE) { + interp_simd_create (locals + ip [1], locals + ip [2], 8); + ip += 3; + MINT_IN_BREAK; + } + + MINT_IN_CASE(MINT_SIMD_INTRINS_P_P) + interp_simd_p_p_table [ip [3]] (locals + ip [1], locals + ip [2]); + ip += 4; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SIMD_INTRINS_P_PP) + interp_simd_p_pp_table [ip [4]] (locals + ip [1], locals + ip [2], locals + ip [3]); + ip += 5; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SIMD_INTRINS_P_PPP) + interp_simd_p_ppp_table [ip [5]] (locals + ip [1], locals + ip [2], locals + ip [3], locals + ip [4]); + ip += 6; + MINT_IN_BREAK; +#else + MINT_IN_CASE(MINT_SIMD_V128_LDC) + MINT_IN_CASE(MINT_SIMD_V128_I1_CREATE) + MINT_IN_CASE(MINT_SIMD_V128_I2_CREATE) + MINT_IN_CASE(MINT_SIMD_V128_I4_CREATE) + MINT_IN_CASE(MINT_SIMD_V128_I8_CREATE) + MINT_IN_CASE(MINT_SIMD_INTRINS_P_P) + MINT_IN_CASE(MINT_SIMD_INTRINS_P_PP) + MINT_IN_CASE(MINT_SIMD_INTRINS_P_PPP) + g_assert_not_reached (); + MINT_IN_BREAK; +#endif + + MINT_IN_CASE(MINT_INTRINS_SPAN_CTOR) { + gpointer ptr = LOCAL_VAR (ip [2], gpointer); + int len = LOCAL_VAR (ip [3], gint32); + if (len < 0) + THROW_EX (interp_get_exception_argument_out_of_range ("length", frame, ip), ip); + gpointer span = locals + ip [1]; + *(gpointer*)span = ptr; + *(gint32*)((gpointer*)span + 1) = len; + ip += 4;; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_INTRINS_CLEAR_WITH_REFERENCES) { + gpointer p = LOCAL_VAR (ip [1], gpointer); + size_t size = LOCAL_VAR (ip [2], mono_u) * sizeof (gpointer); + mono_gc_bzero_aligned (p, size); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_INTRINS_MARVIN_BLOCK) { + guint32 *pp0 = (guint32*)(locals + ip [1]); + guint32 *pp1 = (guint32*)(locals + ip [2]); + guint32 *dest0 = (guint32*)(locals + ip [3]); + guint32 *dest1 = (guint32*)(locals + ip [4]); + + interp_intrins_marvin_block (pp0, pp1, dest0, dest1); + ip += 5; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_INTRINS_ASCII_CHARS_TO_UPPERCASE) { + LOCAL_VAR (ip [1], gint32) = interp_intrins_ascii_chars_to_uppercase (LOCAL_VAR (ip [2], guint32)); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_INTRINS_MEMORYMARSHAL_GETARRAYDATAREF) { + MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); + NULL_CHECK (o); + LOCAL_VAR (ip [1], gpointer) = (guint8*)o + MONO_STRUCT_OFFSET (MonoArray, vector); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_INTRINS_ORDINAL_IGNORE_CASE_ASCII) { + LOCAL_VAR (ip [1], gint32) = interp_intrins_ordinal_ignore_case_ascii (LOCAL_VAR (ip [2], guint32), LOCAL_VAR (ip [3], guint32)); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_INTRINS_64ORDINAL_IGNORE_CASE_ASCII) { + LOCAL_VAR (ip [1], gint32) = interp_intrins_64ordinal_ignore_case_ascii (LOCAL_VAR (ip [2], guint64), LOCAL_VAR (ip [3], guint64)); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_INTRINS_WIDEN_ASCII_TO_UTF16) { + LOCAL_VAR (ip [1], mono_u) = interp_intrins_widen_ascii_to_utf16 (LOCAL_VAR (ip [2], guint8*), LOCAL_VAR (ip [3], mono_unichar2*), LOCAL_VAR (ip [4], mono_u)); + ip += 5; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_INTRINS_RUNTIMEHELPERS_OBJECT_HAS_COMPONENT_SIZE) { + MonoObject *obj = LOCAL_VAR (ip [2], MonoObject*); + LOCAL_VAR (ip [1], gint32) = (obj->vtable->flags & MONO_VT_FLAG_ARRAY_OR_STRING) != 0; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CASTCLASS_INTERFACE) + MINT_IN_CASE(MINT_ISINST_INTERFACE) { + MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); + if (o) { + MonoClass *c = (MonoClass*)frame->imethod->data_items [ip [3]]; + gboolean isinst; + if (MONO_VTABLE_IMPLEMENTS_INTERFACE (o->vtable, m_class_get_interface_id (c))) { + isinst = TRUE; + } else if (m_class_is_array_special_interface (c)) { + /* slow path */ + // FIXME push/pop LMF + isinst = mono_interp_isinst (o, c); // FIXME: do not swallow the error + } else { + isinst = FALSE; + } + + if (!isinst) { + gboolean const isinst_instr = *ip == MINT_ISINST_INTERFACE; + if (isinst_instr) + LOCAL_VAR (ip [1], MonoObject*) = NULL; + else + THROW_EX (interp_get_exception_invalid_cast (frame, ip), ip); + } else { + LOCAL_VAR (ip [1], MonoObject*) = o; + } + } else { + LOCAL_VAR (ip [1], MonoObject*) = NULL; + } + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CASTCLASS_COMMON) + MINT_IN_CASE(MINT_ISINST_COMMON) { + MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); + if (o) { + MonoClass *c = (MonoClass*)frame->imethod->data_items [ip [3]]; + gboolean isinst = mono_class_has_parent_fast (o->vtable->klass, c); + + if (!isinst) { + gboolean const isinst_instr = *ip == MINT_ISINST_COMMON; + if (isinst_instr) + LOCAL_VAR (ip [1], MonoObject*) = NULL; + else + THROW_EX (interp_get_exception_invalid_cast (frame, ip), ip); + } else { + LOCAL_VAR (ip [1], MonoObject*) = o; + } + } else { + LOCAL_VAR (ip [1], MonoObject*) = NULL; + } + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CASTCLASS) + MINT_IN_CASE(MINT_ISINST) { + MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); + if (o) { + MonoClass* const c = (MonoClass*)frame->imethod->data_items [ip [3]]; + // FIXME push/pop LMF + if (!mono_interp_isinst (o, c)) { // FIXME: do not swallow the error + gboolean const isinst_instr = *ip == MINT_ISINST; + if (isinst_instr) + LOCAL_VAR (ip [1], MonoObject*) = NULL; + else + THROW_EX (interp_get_exception_invalid_cast (frame, ip), ip); + } else { + LOCAL_VAR (ip [1], MonoObject*) = o; + } + } else { + LOCAL_VAR (ip [1], MonoObject*) = NULL; + } + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_R_UN_I4) + LOCAL_VAR (ip [1], double) = (double)LOCAL_VAR (ip [2], guint32); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CONV_R_UN_I8) + LOCAL_VAR (ip [1], double) = (double)LOCAL_VAR (ip [2], guint64); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_UNBOX) { + MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); + NULL_CHECK (o); + MonoClass *c = (MonoClass*)frame->imethod->data_items [ip [3]]; + + if (!(m_class_get_rank (o->vtable->klass) == 0 && m_class_get_element_class (o->vtable->klass) == m_class_get_element_class (c))) + THROW_EX (interp_get_exception_invalid_cast (frame, ip), ip); + + LOCAL_VAR (ip [1], gpointer) = mono_object_unbox_internal (o); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_THROW) { + MonoException *local_ex = LOCAL_VAR (ip [1], MonoException*); + if (!local_ex) + local_ex = interp_get_exception_null_reference (frame, ip); + + THROW_EX (local_ex, ip); + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_SAFEPOINT) + SAFEPOINT; + ++ip; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLDA_UNSAFE) { + LOCAL_VAR (ip [1], gpointer) = (char*)LOCAL_VAR (ip [2], gpointer) + ip [3]; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_LDFLDA) { + MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); + NULL_CHECK (o); + LOCAL_VAR (ip [1], gpointer) = (char *)o + ip [3]; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CKNULL) { + MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); + NULL_CHECK (o); + LOCAL_VAR (ip [1], MonoObject*) = o; + ip += 3; + MINT_IN_BREAK; + } + +#define LDFLD_UNALIGNED(datatype, fieldtype, unaligned) do { \ + MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); \ + NULL_CHECK (o); \ + if (unaligned) \ + memcpy (locals + ip [1], (char *)o + ip [3], sizeof (fieldtype)); \ + else \ + LOCAL_VAR (ip [1], datatype) = * (fieldtype *)((char *)o + ip [3]) ; \ + ip += 4; \ +} while (0) + +#define LDFLD(datamem, fieldtype) LDFLD_UNALIGNED(datamem, fieldtype, FALSE) + + MINT_IN_CASE(MINT_LDFLD_I1) LDFLD(gint32, gint8); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_U1) LDFLD(gint32, guint8); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_I2) LDFLD(gint32, gint16); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_U2) LDFLD(gint32, guint16); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_I4) LDFLD(gint32, gint32); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_I8) LDFLD(gint64, gint64); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_R4) LDFLD(float, float); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_R8) LDFLD(double, double); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_O) LDFLD(gpointer, gpointer); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_I8_UNALIGNED) LDFLD_UNALIGNED(gint64, gint64, TRUE); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_R8_UNALIGNED) LDFLD_UNALIGNED(double, double, TRUE); MINT_IN_BREAK; + + MINT_IN_CASE(MINT_LDFLD_VT) { + MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); + NULL_CHECK (o); + memcpy (locals + ip [1], (char *)o + ip [3], ip [4]); + ip += 5; + MINT_IN_BREAK; + } + +#define STFLD_UNALIGNED(datatype, fieldtype, unaligned) do { \ + MonoObject *o = LOCAL_VAR (ip [1], MonoObject*); \ + NULL_CHECK (o); \ + if (unaligned) \ + memcpy ((char *)o + ip [3], locals + ip [2], sizeof (fieldtype)); \ + else \ + * (fieldtype *)((char *)o + ip [3]) = (fieldtype)(LOCAL_VAR (ip [2], datatype)); \ + ip += 4; \ +} while (0) + +#define STFLD(datamem, fieldtype) STFLD_UNALIGNED(datamem, fieldtype, FALSE) + + MINT_IN_CASE(MINT_STFLD_I1) STFLD(gint32, gint8); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STFLD_U1) STFLD(gint32, guint8); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STFLD_I2) STFLD(gint32, gint16); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STFLD_U2) STFLD(gint32, guint16); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STFLD_I4) STFLD(gint32, gint32); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STFLD_I8) STFLD(gint64, gint64); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STFLD_R4) STFLD(float, float); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STFLD_R8) STFLD(double, double); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STFLD_O) { + MonoObject *o = LOCAL_VAR (ip [1], MonoObject*); + NULL_CHECK (o); + mono_gc_wbarrier_set_field_internal (o, (char*)o + ip [3], LOCAL_VAR (ip [2], MonoObject*)); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_STFLD_I8_UNALIGNED) STFLD_UNALIGNED(gint64, gint64, TRUE); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STFLD_R8_UNALIGNED) STFLD_UNALIGNED(double, double, TRUE); MINT_IN_BREAK; + + MINT_IN_CASE(MINT_STFLD_VT_NOREF) { + MonoObject *o = LOCAL_VAR (ip [1], MonoObject*); + NULL_CHECK (o); + memcpy ((char*)o + ip [3], locals + ip [2], ip [4]); + ip += 5; + MINT_IN_BREAK; + } + + MINT_IN_CASE(MINT_STFLD_VT) { + MonoClass *klass = (MonoClass*)frame->imethod->data_items [ip [4]]; + MonoObject *o = LOCAL_VAR (ip [1], MonoObject*); + NULL_CHECK (o); + mono_value_copy_internal ((char*)o + ip [3], locals + ip [2], klass); + ip += 5; + MINT_IN_BREAK; + } + + MINT_IN_CASE(MINT_LDSFLDA) { + MonoVTable *vtable = (MonoVTable*) frame->imethod->data_items [ip [2]]; + INIT_VTABLE (vtable); + LOCAL_VAR (ip [1], gpointer) = frame->imethod->data_items [ip [3]]; + ip += 4; + MINT_IN_BREAK; + } + + MINT_IN_CASE(MINT_LDTSFLDA) { + MonoInternalThread *thread = mono_thread_internal_current (); + guint32 offset = READ32 (ip + 2); + LOCAL_VAR (ip [1], gpointer) = ((char*)thread->static_data [offset & 0x3f]) + (offset >> 6); + ip += 4; + MINT_IN_BREAK; + } + +/* We init class here to preserve cctor order */ +#define LDSFLD(datatype, fieldtype) { \ + MonoVTable *vtable = (MonoVTable*) frame->imethod->data_items [ip [2]]; \ + INIT_VTABLE (vtable); \ + LOCAL_VAR (ip [1], datatype) = * (fieldtype *)(frame->imethod->data_items [ip [3]]) ; \ + ip += 4; \ + } + + MINT_IN_CASE(MINT_LDSFLD_I1) LDSFLD(gint32, gint8); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDSFLD_U1) LDSFLD(gint32, guint8); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDSFLD_I2) LDSFLD(gint32, gint16); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDSFLD_U2) LDSFLD(gint32, guint16); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDSFLD_I4) LDSFLD(gint32, gint32); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDSFLD_I8) LDSFLD(gint64, gint64); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDSFLD_R4) LDSFLD(float, float); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDSFLD_R8) LDSFLD(double, double); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDSFLD_O) LDSFLD(gpointer, gpointer); MINT_IN_BREAK; + + MINT_IN_CASE(MINT_LDSFLD_VT) { + MonoVTable *vtable = (MonoVTable*) frame->imethod->data_items [ip [2]]; + INIT_VTABLE (vtable); + + gpointer addr = frame->imethod->data_items [ip [3]]; + guint16 size = ip [4]; + + memcpy (locals + ip [1], addr, size); + ip += 5; + MINT_IN_BREAK; + } + + MINT_IN_CASE(MINT_LDSFLD_W) { + MonoVTable *vtable = (MonoVTable*) frame->imethod->data_items [READ32 (ip + 2)]; + INIT_VTABLE (vtable); + gpointer addr = frame->imethod->data_items [READ32 (ip + 4)]; + MonoClass *klass = frame->imethod->data_items [READ32 (ip + 6)]; + stackval_from_data (m_class_get_byval_arg (klass), (stackval*)(locals + ip [1]), addr, FALSE); + ip += 8; + MINT_IN_BREAK; + } + +#define STSFLD(datatype, fieldtype) { \ + MonoVTable *vtable = (MonoVTable*) frame->imethod->data_items [ip [2]]; \ + INIT_VTABLE (vtable); \ + * (fieldtype *)(frame->imethod->data_items [ip [3]]) = (fieldtype)(LOCAL_VAR (ip [1], datatype)); \ + ip += 4; \ + } + + MINT_IN_CASE(MINT_STSFLD_I1) STSFLD(gint32, gint8); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STSFLD_U1) STSFLD(gint32, guint8); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STSFLD_I2) STSFLD(gint32, gint16); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STSFLD_U2) STSFLD(gint32, guint16); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STSFLD_I4) STSFLD(gint32, gint32); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STSFLD_I8) STSFLD(gint64, gint64); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STSFLD_R4) STSFLD(float, float); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STSFLD_R8) STSFLD(double, double); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STSFLD_O) STSFLD(gpointer, gpointer); MINT_IN_BREAK; + + MINT_IN_CASE(MINT_STSFLD_VT) { + MonoVTable *vtable = (MonoVTable*) frame->imethod->data_items [ip [2]]; + INIT_VTABLE (vtable); + gpointer addr = frame->imethod->data_items [ip [3]]; + memcpy (addr, locals + ip [1], ip [4]); + ip += 5; + MINT_IN_BREAK; + } + + MINT_IN_CASE(MINT_STSFLD_W) { + MonoVTable *vtable = (MonoVTable*) frame->imethod->data_items [READ32 (ip + 2)]; + INIT_VTABLE (vtable); + gpointer addr = frame->imethod->data_items [READ32 (ip + 4)]; + MonoClass *klass = frame->imethod->data_items [READ32 (ip + 6)]; + stackval_to_data (m_class_get_byval_arg (klass), (stackval*)(locals + ip [1]), addr, FALSE); + ip += 8; + MINT_IN_BREAK; + } + + MINT_IN_CASE(MINT_STOBJ_VT) { + MonoClass *c = (MonoClass*)frame->imethod->data_items [ip [3]]; + mono_value_copy_internal (LOCAL_VAR (ip [1], gpointer), locals + ip [2], c); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_STOBJ_VT_NOREF) { + memcpy (LOCAL_VAR (ip [1], gpointer), locals + ip [2], ip [3]); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_U8_I4) { + gint32 val = LOCAL_VAR (ip [2], gint32); + if (val < 0) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], guint64) = val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_U8_I8) { + gint64 val = LOCAL_VAR (ip [2], gint64); + if (val < 0) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], guint64) = val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_I8_U8) { + guint64 val = LOCAL_VAR (ip [2], guint64); + if (val > G_MAXINT64) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint64) = val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_U8_R4) { + float val = LOCAL_VAR (ip [2], float); + if (!mono_try_trunc_u64 (val, (guint64*)(locals + ip [1]))) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_U8_R8) { + double val = LOCAL_VAR (ip [2], double); + if (!mono_try_trunc_u64 (val, (guint64*)(locals + ip [1]))) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_I8_R4) { + float val = LOCAL_VAR (ip [2], float); + if (!mono_try_trunc_i64 (val, (gint64*)(locals + ip [1]))) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_I8_R8) { + double val = LOCAL_VAR (ip [2], double); + if (!mono_try_trunc_i64 (val, (gint64*)(locals + ip [1]))) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BOX) { + MonoVTable *vtable = (MonoVTable*)frame->imethod->data_items [ip [3]]; + + // FIXME push/pop LMF + MonoObject *o = mono_gc_alloc_obj (vtable, m_class_get_instance_size (vtable->klass)); + SET_TEMP_POINTER(o); + stackval_to_data (m_class_get_byval_arg (vtable->klass), (stackval*)(locals + ip [2]), mono_object_get_data (o), FALSE); + LOCAL_VAR (ip [1], MonoObject*) = o; + SET_TEMP_POINTER(NULL); + + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BOX_VT) { + MonoVTable *vtable = (MonoVTable*)frame->imethod->data_items [ip [3]]; + MonoClass *c = vtable->klass; + + if (G_UNLIKELY (m_class_is_byreflike (c))) { + char *str = g_strdup_printf ("Cannot box IsByRefLike type '%s.%s'", m_class_get_name_space (c), m_class_get_name (c)); + MonoException *ex = mono_exception_from_name_msg (mono_defaults.corlib, "System", "InvalidProgramException", str); + g_free (str); + THROW_EX (ex, ip); + } + + // FIXME push/pop LMF + MonoObject *o = mono_gc_alloc_obj (vtable, m_class_get_instance_size (c)); + SET_TEMP_POINTER(o); + mono_value_copy_internal (mono_object_get_data (o), locals + ip [2], c); + LOCAL_VAR (ip [1], MonoObject*) = o; + SET_TEMP_POINTER(NULL); + + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BOX_PTR) { + MonoVTable *vtable = (MonoVTable*)frame->imethod->data_items [ip [3]]; + MonoClass *c = vtable->klass; + + // FIXME push/pop LMF + MonoObject *o = mono_gc_alloc_obj (vtable, m_class_get_instance_size (c)); + SET_TEMP_POINTER(o); + mono_value_copy_internal (mono_object_get_data (o), LOCAL_VAR (ip [2], gpointer), c); + LOCAL_VAR (ip [1], MonoObject*) = o; + SET_TEMP_POINTER(NULL); + + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_BOX_NULLABLE_PTR) { + MonoClass *c = (MonoClass*)frame->imethod->data_items [ip [3]]; + + // FIXME push/pop LMF + LOCAL_VAR (ip [1], MonoObject*) = mono_nullable_box (LOCAL_VAR (ip [2], gpointer), c, error); + mono_interp_error_cleanup (error); /* FIXME: don't swallow the error */ + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_NEWARR) { + // FIXME push/pop LMF + MonoVTable *vtable = (MonoVTable*)frame->imethod->data_items [ip [3]]; + LOCAL_VAR (ip [1], MonoObject*) = (MonoObject*) mono_array_new_specific_checked (vtable, LOCAL_VAR (ip [2], gint32), error); + if (!is_ok (error)) { + THROW_EX (interp_error_convert_to_exception (frame, error, ip), ip); + } + ip += 4; + /*if (profiling_classes) { + guint count = GPOINTER_TO_UINT (g_hash_table_lookup (profiling_classes, o->vtable->klass)); + count++; + g_hash_table_insert (profiling_classes, o->vtable->klass, GUINT_TO_POINTER (count)); + }*/ + + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_NEWSTR) { + LOCAL_VAR (ip [1], MonoString*) = mono_string_new_size_checked (LOCAL_VAR (ip [2], gint32), error); + if (!is_ok (error)) { + THROW_EX (interp_error_convert_to_exception (frame, error, ip), ip); + } + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_LDLEN) { + MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); + NULL_CHECK (o); + LOCAL_VAR (ip [1], mono_u) = mono_array_length_internal ((MonoArray *)o); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_GETCHR) { + MonoString *s = LOCAL_VAR (ip [2], MonoString*); + NULL_CHECK (s); + int i32 = LOCAL_VAR (ip [3], int); + if (i32 < 0 || i32 >= mono_string_length_internal (s)) + THROW_EX (interp_get_exception_index_out_of_range (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = mono_string_chars_internal (s)[i32]; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_GETITEM_SPAN) { + MonoSpanOfVoid *span = LOCAL_VAR (ip [2], MonoSpanOfVoid*); + int index = LOCAL_VAR (ip [3], int); + NULL_CHECK (span); + + gint32 length = span->_length; + if (index < 0 || index >= length) + THROW_EX (interp_get_exception_index_out_of_range (frame, ip), ip); + + gsize element_size = (gsize)(gint16)ip [4]; + LOCAL_VAR (ip [1], gpointer) = (guint8*)span->_reference + index * element_size; + + ip += 5; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_GETITEM_LOCALSPAN) { + // Same as getitem span but we know the offset of the span structure on the stack + MonoSpanOfVoid *span = (MonoSpanOfVoid*)(locals + ip [2]); + int index = LOCAL_VAR (ip [3], int); + + gint32 length = span->_length; + if (index < 0 || index >= length) + THROW_EX (interp_get_exception_index_out_of_range (frame, ip), ip); + + gsize element_size = (gsize)(gint16)ip [4]; + LOCAL_VAR (ip [1], gpointer) = (guint8*)span->_reference + index * element_size; + + ip += 5; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_STRLEN) { + MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); + NULL_CHECK (o); + LOCAL_VAR (ip [1], gint32) = mono_string_length_internal ((MonoString*) o); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_ARRAY_RANK) { + MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); + NULL_CHECK (o); + LOCAL_VAR (ip [1], gint32) = m_class_get_rank (mono_object_class (o)); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_ARRAY_ELEMENT_SIZE) { + // FIXME push/pop LMF + MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); + NULL_CHECK (o); + LOCAL_VAR (ip [1], gint32) = mono_array_element_size (mono_object_class (o)); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_LDELEMA1) { + /* No bounds, one direction */ + MonoArray *ao = LOCAL_VAR (ip [2], MonoArray*); + NULL_CHECK (ao); + guint32 index = LOCAL_VAR (ip [3], guint32); + if (index >= ao->max_length) + THROW_EX (interp_get_exception_index_out_of_range (frame, ip), ip); + guint16 size = ip [4]; + LOCAL_VAR (ip [1], gpointer) = mono_array_addr_with_size_fast (ao, size, index); + ip += 5; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_LDELEMA) { + guint16 rank = ip [3]; + guint16 esize = ip [4]; + stackval *sp = (stackval*)(locals + ip [2]); + + MonoArray *ao = (MonoArray*) sp [0].data.o; + NULL_CHECK (ao); + + g_assert (ao->bounds); + guint32 pos = 0; + for (int i = 0; i < rank; i++) { + gint32 idx = sp [i + 1].data.i; + gint32 lower = ao->bounds [i].lower_bound; + guint32 len = ao->bounds [i].length; + if (idx < lower || (guint32)(idx - lower) >= len) + THROW_EX (interp_get_exception_index_out_of_range (frame, ip), ip); + pos = (pos * len) + (guint32)(idx - lower); + } + + LOCAL_VAR (ip [1], gpointer) = mono_array_addr_with_size_fast (ao, esize, pos); + ip += 5; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_LDELEMA_TC) { + // FIXME push/pop LMF + stackval *sp = (stackval*)(locals + ip [2]); + + MonoObject *o = (MonoObject*) sp [0].data.o; + NULL_CHECK (o); + + MonoClass *klass = (MonoClass*)frame->imethod->data_items [ip [3]]; + MonoException *address_ex = ves_array_element_address (frame, klass, (MonoArray *) o, (gpointer*)(locals + ip [1]), sp + 1, TRUE); + if (address_ex) + THROW_EX (address_ex, ip); + ip += 4; + MINT_IN_BREAK; + } + +#define LDELEM(datatype,elemtype) do { \ + MonoArray *o = LOCAL_VAR (ip [2], MonoArray*); \ + NULL_CHECK (o); \ + guint32 aindex = LOCAL_VAR (ip [3], guint32); \ + if (aindex >= mono_array_length_internal (o)) \ + THROW_EX (interp_get_exception_index_out_of_range (frame, ip), ip); \ + LOCAL_VAR (ip [1], datatype) = mono_array_get_fast (o, elemtype, aindex); \ + ip += 4; \ +} while (0) + MINT_IN_CASE(MINT_LDELEM_I1) LDELEM(gint32, gint8); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDELEM_U1) LDELEM(gint32, guint8); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDELEM_I2) LDELEM(gint32, gint16); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDELEM_U2) LDELEM(gint32, guint16); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDELEM_I4) LDELEM(gint32, gint32); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDELEM_U4) LDELEM(gint32, guint32); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDELEM_I8) LDELEM(gint64, guint64); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDELEM_R4) LDELEM(float, float); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDELEM_R8) LDELEM(double, double); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDELEM_REF) LDELEM(gpointer, gpointer); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDELEM_VT) { + MonoArray *o = LOCAL_VAR (ip [2], MonoArray*); + NULL_CHECK (o); + mono_u aindex = LOCAL_VAR (ip [3], gint32); + if (aindex >= mono_array_length_internal (o)) + THROW_EX (interp_get_exception_index_out_of_range (frame, ip), ip); + + guint16 size = ip [4]; + char *src_addr = mono_array_addr_with_size_fast ((MonoArray *) o, size, aindex); + memcpy (locals + ip [1], src_addr, size); + + ip += 5; + MINT_IN_BREAK; + } +#define STELEM_PROLOG(o, aindex) do { \ + o = LOCAL_VAR (ip [1], MonoArray*); \ + NULL_CHECK (o); \ + aindex = LOCAL_VAR (ip [2], gint32); \ + if (aindex >= mono_array_length_internal (o)) \ + THROW_EX (interp_get_exception_index_out_of_range (frame, ip), ip); \ +} while (0) + +#define STELEM(datatype, elemtype) do { \ + MonoArray *o; \ + guint32 aindex; \ + STELEM_PROLOG(o, aindex); \ + mono_array_set_fast (o, elemtype, aindex, LOCAL_VAR (ip [3], datatype)); \ + ip += 4; \ +} while (0) + MINT_IN_CASE(MINT_STELEM_I1) STELEM(gint32, gint8); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STELEM_U1) STELEM(gint32, guint8); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STELEM_I2) STELEM(gint32, gint16); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STELEM_U2) STELEM(gint32, guint16); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STELEM_I4) STELEM(gint32, gint32); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STELEM_I8) STELEM(gint64, gint64); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STELEM_R4) STELEM(float, float); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STELEM_R8) STELEM(double, double); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STELEM_REF_UNCHECKED) { + MonoArray *o; + guint32 aindex; + STELEM_PROLOG(o, aindex); + mono_array_setref_fast ((MonoArray *) o, aindex, LOCAL_VAR (ip [3], MonoObject*)); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_STELEM_REF) { + MonoArray *o; + guint32 aindex; + STELEM_PROLOG(o, aindex); + MonoObject *ref = LOCAL_VAR (ip [3], MonoObject*); + + if (ref) { + // FIXME push/pop LMF + gboolean isinst = mono_interp_isinst (ref, m_class_get_element_class (mono_object_class (o))); + if (!isinst) + THROW_EX (interp_get_exception_array_type_mismatch (frame, ip), ip); + } + mono_array_setref_fast ((MonoArray *) o, aindex, ref); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_STELEM_VT) { + MonoArray *o = LOCAL_VAR (ip [1], MonoArray*); + NULL_CHECK (o); + guint32 aindex = LOCAL_VAR (ip [2], guint32); + if (aindex >= mono_array_length_internal (o)) + THROW_EX (interp_get_exception_index_out_of_range (frame, ip), ip); + + guint16 size = ip [5]; + char *dst_addr = mono_array_addr_with_size_fast ((MonoArray *) o, size, aindex); + MonoClass *klass_vt = (MonoClass*)frame->imethod->data_items [ip [4]]; + mono_value_copy_internal (dst_addr, locals + ip [3], klass_vt); + ip += 6; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_STELEM_VT_NOREF) { + MonoArray *o = LOCAL_VAR (ip [1], MonoArray*); + NULL_CHECK (o); + guint32 aindex = LOCAL_VAR (ip [2], guint32); + if (aindex >= mono_array_length_internal (o)) + THROW_EX (interp_get_exception_index_out_of_range (frame, ip), ip); + + guint16 size = ip [5]; + char *dst_addr = mono_array_addr_with_size_fast ((MonoArray *) o, size, aindex); + memcpy (dst_addr, locals + ip [3], size); + ip += 6; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_I4_U4) { + gint32 val = LOCAL_VAR (ip [2], gint32); + if (val < 0) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_I4_I8) { + gint64 val = LOCAL_VAR (ip [2], gint64); + if (val < G_MININT32 || val > G_MAXINT32) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = (gint32) val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_I4_U8) { + guint64 val = LOCAL_VAR (ip [2], guint64); + if (val > G_MAXINT32) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = (gint32) val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_I4_R4) { + float val = LOCAL_VAR (ip [2], float); + double val_r8 = (double)val; + if (val_r8 > ((double)G_MININT32 - 1) && val_r8 < ((double)G_MAXINT32 + 1)) + LOCAL_VAR (ip [1], gint32) = (gint32) val; + else + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_I4_R8) { + double val = LOCAL_VAR (ip [2], double); + if (val > ((double)G_MININT32 - 1) && val < ((double)G_MAXINT32 + 1)) + LOCAL_VAR (ip [1], gint32) = (gint32) val; + else + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_U4_I4) { + gint32 val = LOCAL_VAR (ip [2], gint32); + if (val < 0) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_U4_I8) { + gint64 val = LOCAL_VAR (ip [2], gint64); + if (val < 0 || val > G_MAXUINT32) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = (guint32) val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_U4_R4) { + float val = LOCAL_VAR (ip [2], float); + double val_r8 = val; + if (val_r8 > -1.0 && val_r8 < ((double)G_MAXUINT32 + 1)) + LOCAL_VAR (ip [1], gint32) = (guint32)val; + else + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_U4_R8) { + double val = LOCAL_VAR (ip [2], double); + if (val > -1.0 && val < ((double)G_MAXUINT32 + 1)) + LOCAL_VAR (ip [1], gint32) = (guint32)val; + else + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_I2_I4) { + gint32 val = LOCAL_VAR (ip [2], gint32); + if (val < G_MININT16 || val > G_MAXINT16) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = (gint16)val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_I2_U4) { + gint32 val = LOCAL_VAR (ip [2], gint32); + if (val < 0 || val > G_MAXINT16) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = (gint16)val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_I2_I8) { + gint64 val = LOCAL_VAR (ip [2], gint64); + if (val < G_MININT16 || val > G_MAXINT16) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = (gint16) val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_I2_U8) { + gint64 val = LOCAL_VAR (ip [2], gint64); + if (val < 0 || val > G_MAXINT16) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = (gint16) val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_I2_R4) { + float val = LOCAL_VAR (ip [2], float); + if (val > (G_MININT16 - 1) && val < (G_MAXINT16 + 1)) + LOCAL_VAR (ip [1], gint32) = (gint16) val; + else + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_I2_R8) { + double val = LOCAL_VAR (ip [2], double); + if (val > (G_MININT16 - 1) && val < (G_MAXINT16 + 1)) + LOCAL_VAR (ip [1], gint32) = (gint16) val; + else + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_U2_I4) { + gint32 val = LOCAL_VAR (ip [2], gint32); + if (val < 0 || val > G_MAXUINT16) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_U2_I8) { + gint64 val = LOCAL_VAR (ip [2], gint64); + if (val < 0 || val > G_MAXUINT16) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = (guint16) val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_U2_R4) { + float val = LOCAL_VAR (ip [2], float); + if (val > -1.0f && val < (G_MAXUINT16 + 1)) + LOCAL_VAR (ip [1], gint32) = (guint16) val; + else + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_U2_R8) { + double val = LOCAL_VAR (ip [2], double); + if (val > -1.0 && val < (G_MAXUINT16 + 1)) + LOCAL_VAR (ip [1], gint32) = (guint16) val; + else + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_I1_I4) { + gint32 val = LOCAL_VAR (ip [2], gint32); + if (val < G_MININT8 || val > G_MAXINT8) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_I1_U4) { + gint32 val = LOCAL_VAR (ip [2], gint32); + if (val < 0 || val > G_MAXINT8) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_I1_I8) { + gint64 val = LOCAL_VAR (ip [2], gint64); + if (val < G_MININT8 || val > G_MAXINT8) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = (gint8) val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_I1_U8) { + gint64 val = LOCAL_VAR (ip [2], gint64); + if (val < 0 || val > G_MAXINT8) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = (gint8) val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_I1_R4) { + float val = LOCAL_VAR (ip [2], float); + if (val > (G_MININT8 - 1) && val < (G_MAXINT8 + 1)) + LOCAL_VAR (ip [1], gint32) = (gint8) val; + else + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_I1_R8) { + double val = LOCAL_VAR (ip [2], double); + if (val > (G_MININT8 - 1) && val < (G_MAXINT8 + 1)) + LOCAL_VAR (ip [1], gint32) = (gint8) val; + else + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_U1_I4) { + gint32 val = LOCAL_VAR (ip [2], gint32); + if (val < 0 || val > G_MAXUINT8) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_U1_I8) { + gint64 val = LOCAL_VAR (ip [2], gint64); + if (val < 0 || val > G_MAXUINT8) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = (guint8) val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_U1_R4) { + float val = LOCAL_VAR (ip [2], float); + if (val > -1.0f && val < (G_MAXUINT8 + 1)) + LOCAL_VAR (ip [1], gint32) = (guint8)val; + else + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CONV_OVF_U1_R8) { + double val = LOCAL_VAR (ip [2], double); + if (val > -1.0 && val < (G_MAXUINT8 + 1)) + LOCAL_VAR (ip [1], gint32) = (guint8)val; + else + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CKFINITE_R4) { + float val = LOCAL_VAR (ip [2], float); + if (!mono_isfinite (val)) + THROW_EX (interp_get_exception_arithmetic (frame, ip), ip); + LOCAL_VAR (ip [1], float) = val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CKFINITE_R8) { + double val = LOCAL_VAR (ip [2], double); + if (!mono_isfinite (val)) + THROW_EX (interp_get_exception_arithmetic (frame, ip), ip); + LOCAL_VAR (ip [1], double) = val; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_MKREFANY) { + MonoClass *c = (MonoClass*)frame->imethod->data_items [ip [3]]; + + gpointer addr = LOCAL_VAR (ip [2], gpointer); + /* Write the typedref value */ + MonoTypedRef *tref = (MonoTypedRef*)(locals + ip [1]); + tref->klass = c; + tref->type = m_class_get_byval_arg (c); + tref->value = addr; + + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_REFANYTYPE) { + MonoTypedRef *tref = (MonoTypedRef*)(locals + ip [2]); + + LOCAL_VAR (ip [1], gpointer) = tref->type; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_REFANYVAL) { + MonoTypedRef *tref = (MonoTypedRef*)(locals + ip [2]); + + MonoClass *c = (MonoClass*)frame->imethod->data_items [ip [3]]; + if (c != tref->klass) + THROW_EX (interp_get_exception_invalid_cast (frame, ip), ip); + + LOCAL_VAR (ip [1], gpointer) = tref->value; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_ADD_OVF_I4) { + gint32 i1 = LOCAL_VAR (ip [2], gint32); + gint32 i2 = LOCAL_VAR (ip [3], gint32); + if (CHECK_ADD_OVERFLOW (i1, i2)) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = i1 + i2; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_ADD_OVF_I8) { + gint64 l1 = LOCAL_VAR (ip [2], gint64); + gint64 l2 = LOCAL_VAR (ip [3], gint64); + if (CHECK_ADD_OVERFLOW64 (l1, l2)) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint64) = l1 + l2; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_ADD_OVF_UN_I4) { + guint32 i1 = LOCAL_VAR (ip [2], guint32); + guint32 i2 = LOCAL_VAR (ip [3], guint32); + if (CHECK_ADD_OVERFLOW_UN (i1, i2)) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], guint32) = i1 + i2; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_ADD_OVF_UN_I8) { + guint64 l1 = LOCAL_VAR (ip [2], guint64); + guint64 l2 = LOCAL_VAR (ip [3], guint64); + if (CHECK_ADD_OVERFLOW64_UN (l1, l2)) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], guint64) = l1 + l2; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_MUL_OVF_I4) { + gint32 i1 = LOCAL_VAR (ip [2], gint32); + gint32 i2 = LOCAL_VAR (ip [3], gint32); + if (CHECK_MUL_OVERFLOW (i1, i2)) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = i1 * i2; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_MUL_OVF_I8) { + gint64 l1 = LOCAL_VAR (ip [2], gint64); + gint64 l2 = LOCAL_VAR (ip [3], gint64); + if (CHECK_MUL_OVERFLOW64 (l1, l2)) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint64) = l1 * l2; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_MUL_OVF_UN_I4) { + guint32 i1 = LOCAL_VAR (ip [2], guint32); + guint32 i2 = LOCAL_VAR (ip [3], guint32); + if (CHECK_MUL_OVERFLOW_UN (i1, i2)) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], guint32) = i1 * i2; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_MUL_OVF_UN_I8) { + guint64 l1 = LOCAL_VAR (ip [2], guint64); + guint64 l2 = LOCAL_VAR (ip [3], guint64); + if (CHECK_MUL_OVERFLOW64_UN (l1, l2)) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], guint64) = l1 * l2; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_SUB_OVF_I4) { + gint32 i1 = LOCAL_VAR (ip [2], gint32); + gint32 i2 = LOCAL_VAR (ip [3], gint32); + if (CHECK_SUB_OVERFLOW (i1, i2)) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint32) = i1 - i2; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_SUB_OVF_I8) { + gint64 l1 = LOCAL_VAR (ip [2], gint64); + gint64 l2 = LOCAL_VAR (ip [3], gint64); + if (CHECK_SUB_OVERFLOW64 (l1, l2)) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint64) = l1 - l2; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_SUB_OVF_UN_I4) { + guint32 i1 = LOCAL_VAR (ip [2], guint32); + guint32 i2 = LOCAL_VAR (ip [3], guint32); + if (CHECK_SUB_OVERFLOW_UN (i1, i2)) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], guint32) = i1 - i2; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_SUB_OVF_UN_I8) { + guint64 l1 = LOCAL_VAR (ip [2], guint64); + guint64 l2 = LOCAL_VAR (ip [3], guint64); + if (CHECK_SUB_OVERFLOW64_UN (l1, l2)) + THROW_EX (interp_get_exception_overflow (frame, ip), ip); + LOCAL_VAR (ip [1], gint64) = l1 - l2; + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_ENDFINALLY) { + guint16 clause_index = *(ip + 1); + + guint16 *ret_ip = *(guint16**)(locals + frame->imethod->clause_data_offsets [clause_index]); + if (!ret_ip) { + // this clause was called from EH, return to eh + g_assert (clause_args && clause_args->exec_frame == frame); + goto exit_clause; + } + ip = ret_ip; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_CALL_HANDLER) + MINT_IN_CASE(MINT_CALL_HANDLER_S) { + gboolean short_offset = *ip == MINT_CALL_HANDLER_S; + const guint16 *ret_ip = short_offset ? (ip + 3) : (ip + 4); + guint16 clause_index = *(ret_ip - 1); + + *(const guint16**)(locals + frame->imethod->clause_data_offsets [clause_index]) = ret_ip; + + // jump to clause + ip += short_offset ? (gint16)*(ip + 1) : (gint32)READ32 (ip + 1); + MINT_IN_BREAK; + } + + MINT_IN_CASE(MINT_LEAVE_CHECK) + MINT_IN_CASE(MINT_LEAVE_S_CHECK) { + int leave_opcode = *ip; + + if (frame->imethod->method->wrapper_type != MONO_WRAPPER_RUNTIME_INVOKE) { + MonoException *abort_exc = mono_interp_leave (frame); + if (abort_exc) + THROW_EX (abort_exc, ip); + } + + gboolean const short_offset = leave_opcode == MINT_LEAVE_S_CHECK; + ip += short_offset ? (gint16)*(ip + 1) : (gint32)READ32 (ip + 1); + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_ICALL) { + stackval *ret = (stackval*)(locals + ip [1]); + stackval *args = (stackval*)(locals + ip [2]); + MintICallSig icall_sig = (MintICallSig)ip [3]; + gpointer target_ip = frame->imethod->data_items [ip [4]]; + + frame->state.ip = ip + 5; + do_icall_wrapper (frame, NULL, icall_sig, ret, args, target_ip, FALSE, &gc_transitions); + EXCEPTION_CHECKPOINT; + CHECK_RESUME_STATE (context); + ip += 5; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_LDPTR) + LOCAL_VAR (ip [1], gpointer) = frame->imethod->data_items [ip [2]]; + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_MONO_NEWOBJ) + // FIXME push/pop LMF + LOCAL_VAR (ip [1], MonoObject*) = mono_interp_new ((MonoClass*)frame->imethod->data_items [ip [2]]); // FIXME: do not swallow the error + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_MONO_RETOBJ) + // FIXME push/pop LMF + stackval_from_data (mono_method_signature_internal (frame->imethod->method)->ret, frame->stack, LOCAL_VAR (ip [1], gpointer), + mono_method_signature_internal (frame->imethod->method)->pinvoke && !mono_method_signature_internal (frame->imethod->method)->marshalling_disabled); + frame_data_allocator_pop (&context->data_stack, frame); + goto exit_frame; + MINT_IN_CASE(MINT_MONO_MEMORY_BARRIER) { + ++ip; + mono_memory_barrier (); + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_MONO_EXCHANGE_U1) { + guint8 *dest = LOCAL_VAR (ip [2], guint8*); + guint8 exch = LOCAL_VAR (ip[3], guint8); + NULL_CHECK(dest); + LOCAL_VAR(ip[1], guint32) = (guint32)mono_atomic_xchg_u8(dest, exch); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_MONO_EXCHANGE_I1) { + gint8 *dest = LOCAL_VAR (ip [2], gint8*); + gint8 exch = LOCAL_VAR (ip[3], gint8); + NULL_CHECK(dest); + LOCAL_VAR(ip[1], gint32) = (gint32)(gint8)mono_atomic_xchg_u8((guint8*)dest, exch); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_MONO_EXCHANGE_U2) { + guint16 *dest = LOCAL_VAR (ip [2], guint16*); + guint16 exch = LOCAL_VAR (ip[3], guint16); + NULL_CHECK(dest); + LOCAL_VAR(ip[1], guint32) = (guint32)mono_atomic_xchg_u16(dest, exch); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_MONO_EXCHANGE_I2) { + gint16 *dest = LOCAL_VAR (ip [2], gint16*); + gint16 exch = LOCAL_VAR (ip[3], gint16); + NULL_CHECK(dest); + LOCAL_VAR(ip[1], gint32) = (gint32)(gint16)mono_atomic_xchg_u16((guint16*)dest, exch); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_MONO_EXCHANGE_I4) { + gint32 *dest = LOCAL_VAR (ip [2], gint32*); + gint32 exch = LOCAL_VAR (ip[3], gint32); + NULL_CHECK(dest); + LOCAL_VAR(ip[1], gint32) = mono_atomic_xchg_i32(dest, exch); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_MONO_EXCHANGE_I8) { + gboolean flag = FALSE; + gint64 *dest = LOCAL_VAR (ip [2], gint64*); + gint64 exch = LOCAL_VAR (ip [3], gint64); + NULL_CHECK(dest); +#if SIZEOF_VOID_P == 4 + if (G_UNLIKELY (((size_t)dest) & 0x7)) { + gint64 result; + mono_interlocked_lock (); + result = *dest; + *dest = exch; + mono_interlocked_unlock (); + LOCAL_VAR (ip [1], gint64) = result; + flag = TRUE; + } +#endif + if (!flag) + LOCAL_VAR (ip [1], gint64) = mono_atomic_xchg_i64 (dest, exch); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_MONO_CMPXCHG_U1) { + guint8 *dest = LOCAL_VAR(ip[2], guint8*); + guint8 value = LOCAL_VAR(ip[3], guint8); + guint8 comparand = LOCAL_VAR(ip[4], guint8); + NULL_CHECK(dest); + + LOCAL_VAR(ip[1], guint32) = (guint32)mono_atomic_cas_u8(dest, value, comparand); + ip += 5; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_MONO_CMPXCHG_I1) { + gint8 *dest = LOCAL_VAR(ip[2], gint8*); + gint8 value = LOCAL_VAR(ip[3], gint8); + gint8 comparand = LOCAL_VAR(ip[4], gint8); + NULL_CHECK(dest); + + LOCAL_VAR(ip[1], gint32) = (gint32)(gint8)mono_atomic_cas_u8((guint8*)dest, value, comparand); + ip += 5; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_MONO_CMPXCHG_U2) { + guint16 *dest = LOCAL_VAR(ip[2], guint16*); + guint16 value = LOCAL_VAR(ip[3], guint16); + guint16 comparand = LOCAL_VAR(ip[4], guint16); + NULL_CHECK(dest); + + LOCAL_VAR(ip[1], guint32) = (guint32)mono_atomic_cas_u16(dest, value, comparand); + ip += 5; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_MONO_CMPXCHG_I2) { + gint16 *dest = LOCAL_VAR(ip[2], gint16*); + gint16 value = LOCAL_VAR(ip[3], gint16); + gint16 comparand = LOCAL_VAR(ip[4], gint16); + NULL_CHECK(dest); + + LOCAL_VAR(ip[1], gint32) = (gint32)(gint16)mono_atomic_cas_u16((guint16*)dest, value, comparand); + ip += 5; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_MONO_CMPXCHG_I4) { + gint32 *dest = LOCAL_VAR(ip[2], gint32*); + gint32 value = LOCAL_VAR(ip[3], gint32); + gint32 comparand = LOCAL_VAR(ip[4], gint32); + NULL_CHECK(dest); + + LOCAL_VAR(ip[1], gint32) = mono_atomic_cas_i32(dest, value, comparand); + ip += 5; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_MONO_CMPXCHG_I8) { + gboolean flag = FALSE; + gint64 *dest = LOCAL_VAR(ip[2], gint64*); + gint64 value = LOCAL_VAR(ip[3], gint64); + gint64 comparand = LOCAL_VAR(ip[4], gint64); + NULL_CHECK(dest); + +#if SIZEOF_VOID_P == 4 + if (G_UNLIKELY ((size_t)dest & 0x7)) { + gint64 old; + mono_interlocked_lock (); + old = *dest; + if (old == comparand) + *dest = value; + mono_interlocked_unlock (); + LOCAL_VAR(ip[1], gint64) = old; + flag = TRUE; + } +#endif + + if (!flag) + LOCAL_VAR(ip[1], gint64) = mono_atomic_cas_i64(dest, value, comparand); + ip += 5; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_MONO_LDDOMAIN) + LOCAL_VAR (ip [1], gpointer) = mono_domain_get (); + ip += 2; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_MONO_ENABLE_GCTRANS) + gc_transitions = TRUE; + ip++; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SDB_INTR_LOC) + if (G_UNLIKELY (ss_enabled)) { + typedef void (*T) (void); + static T ss_tramp; + + if (!ss_tramp) { + // FIXME push/pop LMF + void *tramp = mini_get_single_step_trampoline (); + mono_memory_barrier (); + ss_tramp = (T)tramp; + } + + /* + * Make this point to the MINT_SDB_SEQ_POINT instruction which follows this since + * the address of that instruction is stored as the seq point address. Add also + * 1 to offset subtraction from interp_frame_get_ip. + */ + frame->state.ip = ip + 2; + + /* + * Use the same trampoline as the JIT. This ensures that + * the debugger has the context for the last interpreter + * native frame. + */ + do_debugger_tramp (ss_tramp, frame); + + CHECK_RESUME_STATE (context); + } + ++ip; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SDB_SEQ_POINT) + /* Just a placeholder for a breakpoint */ +#if HOST_WASI + if (debugger_enabled) + mono_component_debugger()->receive_and_process_command_from_debugger_agent (); +#endif + ++ip; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SDB_BREAKPOINT) { + typedef void (*T) (void); + static T bp_tramp; + if (!bp_tramp) { + // FIXME push/pop LMF + void *tramp = mini_get_breakpoint_trampoline (); + mono_memory_barrier (); + bp_tramp = (T)tramp; + } + + /* Add 1 to offset subtraction from interp_frame_get_ip */ + frame->state.ip = ip + 1; + + /* Use the same trampoline as the JIT */ + do_debugger_tramp (bp_tramp, frame); + + CHECK_RESUME_STATE (context); + + ++ip; + MINT_IN_BREAK; + } + +#define RELOP(datatype, op) \ + LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], datatype) op LOCAL_VAR (ip [3], datatype); \ + ip += 4; + +#define RELOP_FP(datatype, op, noorder) do { \ + datatype a1 = LOCAL_VAR (ip [2], datatype); \ + datatype a2 = LOCAL_VAR (ip [3], datatype); \ + if (mono_isunordered (a1, a2)) \ + LOCAL_VAR (ip [1], gint32) = noorder; \ + else \ + LOCAL_VAR (ip [1], gint32) = a1 op a2; \ + ip += 4; \ +} while (0) + + MINT_IN_CASE(MINT_CEQ_I4) + RELOP(gint32, ==); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CEQ0_I4) + LOCAL_VAR (ip [1], gint32) = (LOCAL_VAR (ip [2], gint32) == 0); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CEQ_I8) + RELOP(gint64, ==); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CEQ_R4) + RELOP_FP(float, ==, 0); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CEQ_R8) + RELOP_FP(double, ==, 0); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CNE_I4) + RELOP(gint32, !=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CNE_I8) + RELOP(gint64, !=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CNE_R4) + RELOP_FP(float, !=, 1); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CNE_R8) + RELOP_FP(double, !=, 1); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CGT_I4) + RELOP(gint32, >); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CGT_I8) + RELOP(gint64, >); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CGT_R4) + RELOP_FP(float, >, 0); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CGT_R8) + RELOP_FP(double, >, 0); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CGE_I4) + RELOP(gint32, >=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CGE_I8) + RELOP(gint64, >=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CGE_R4) + RELOP_FP(float, >=, 0); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CGE_R8) + RELOP_FP(double, >=, 0); + MINT_IN_BREAK; + +#define RELOP_CAST(datatype, op) \ + LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], datatype) op LOCAL_VAR (ip [3], datatype); \ + ip += 4; + + MINT_IN_CASE(MINT_CGE_UN_I4) + RELOP_CAST(guint32, >=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CGE_UN_I8) + RELOP_CAST(guint64, >=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CGT_UN_I4) + RELOP_CAST(guint32, >); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CGT_UN_I8) + RELOP_CAST(guint64, >); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CGT_UN_R4) + RELOP_FP(float, >, 1); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CGT_UN_R8) + RELOP_FP(double, >, 1); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CLT_I4) + RELOP(gint32, <); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CLT_I8) + RELOP(gint64, <); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CLT_R4) + RELOP_FP(float, <, 0); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CLT_R8) + RELOP_FP(double, <, 0); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CLT_UN_I4) + RELOP_CAST(guint32, <); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CLT_UN_I8) + RELOP_CAST(guint64, <); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CLT_UN_R4) + RELOP_FP(float, <, 1); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CLT_UN_R8) + RELOP_FP(double, <, 1); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CLE_I4) + RELOP(gint32, <=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CLE_I8) + RELOP(gint64, <=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CLE_UN_I4) + RELOP_CAST(guint32, <=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CLE_UN_I8) + RELOP_CAST(guint64, <=); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CLE_R4) + RELOP_FP(float, <=, 0); + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CLE_R8) + RELOP_FP(double, <=, 0); + MINT_IN_BREAK; + +#undef RELOP +#undef RELOP_FP +#undef RELOP_CAST + + MINT_IN_CASE(MINT_LDFTN_ADDR) { + LOCAL_VAR (ip [1], gpointer) = frame->imethod->data_items [ip [2]]; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_LDFTN) { + InterpMethod *m = (InterpMethod*)frame->imethod->data_items [ip [2]]; + + // FIXME push/pop LMF + LOCAL_VAR (ip [1], gpointer) = imethod_to_ftnptr (m, FALSE); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_LDVIRTFTN) { + InterpMethod *virtual_method = (InterpMethod*)frame->imethod->data_items [ip [3]]; + MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); + NULL_CHECK (o); + + // FIXME push/pop LMF + InterpMethod *res_method = get_virtual_method (virtual_method, o->vtable); + gboolean need_unbox = m_class_is_valuetype (res_method->method->klass) && !m_class_is_valuetype (virtual_method->method->klass); + LOCAL_VAR (ip [1], gpointer) = imethod_to_ftnptr (res_method, need_unbox); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_LDFTN_DYNAMIC) { + error_init_reuse (error); + + MonoMethod *local_cmethod = LOCAL_VAR (ip [2], MonoMethod*); + + if (local_cmethod->is_generic || mono_class_is_gtd (local_cmethod->klass)) { + MonoException *ex = mono_exception_from_name_msg (mono_defaults.corlib, "System", "InvalidOperationException", ""); + THROW_EX (ex, ip); + } + + // FIXME push/pop LMF + if (G_UNLIKELY (mono_method_has_unmanaged_callers_only_attribute (local_cmethod))) { + local_cmethod = mono_marshal_get_managed_wrapper (local_cmethod, NULL, (MonoGCHandle)0, error); + mono_error_assert_ok (error); + gpointer addr = mini_get_interp_callbacks ()->create_method_pointer (local_cmethod, TRUE, error); + LOCAL_VAR (ip [1], gpointer) = addr; + } else { + InterpMethod *m = mono_interp_get_imethod (local_cmethod); + LOCAL_VAR (ip [1], gpointer) = imethod_to_ftnptr (m, FALSE); + } + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_PROF_ENTER) { + guint16 flag = ip [1]; + ip += 2; + INTERP_PROFILER_RAISE(enter, ENTER); + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_PROF_SAMPLEPOINT) { + guint16 flag = ip [1]; + ip += 2; + INTERP_PROFILER_RAISE(samplepoint, SAMPLEPOINT); + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_PROF_EXIT) + MINT_IN_CASE(MINT_PROF_EXIT_VOID) { + gboolean is_void = ip [0] == MINT_PROF_EXIT_VOID; + guint16 flag = is_void ? ip [1] : ip [2]; + // Set retval + if (!is_void) { + int i32 = READ32 (ip + 3); + if (i32) + memmove (frame->retval, locals + ip [1], i32); + else + frame->retval [0] = LOCAL_VAR (ip [1], stackval); + } + INTERP_PROFILER_RAISE(leave, LEAVE); + frame_data_allocator_pop (&context->data_stack, frame); + goto exit_frame; + } + MINT_IN_CASE(MINT_PROF_COVERAGE_STORE) { + ++ip; + guint32 *p = (guint32*)GINT_TO_POINTER (READ64 (ip)); + *p = 1; + ip += 4; + MINT_IN_BREAK; + } + + MINT_IN_CASE(MINT_TIER_ENTER_METHOD) { + frame->imethod->entry_count++; + if (frame->imethod->entry_count > INTERP_TIER_ENTRY_LIMIT && !clause_args) + ip = mono_interp_tier_up_frame_enter (frame, context); + else + ip++; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_TIER_PATCHPOINT) { + frame->imethod->entry_count++; + if (frame->imethod->entry_count > INTERP_TIER_ENTRY_LIMIT && !clause_args) + ip = mono_interp_tier_up_frame_patchpoint (frame, context, ip [1]); + else + ip += 2; + MINT_IN_BREAK; + } + + MINT_IN_CASE(MINT_LDLOCA_S) + LOCAL_VAR (ip [1], gpointer) = locals + ip [2]; + // ip[3] reserved for size data for jiterpreter + ip += 4; + MINT_IN_BREAK; + +#define MOV(argtype1,argtype2) \ + LOCAL_VAR (ip [1], argtype1) = LOCAL_VAR (ip [2], argtype2); \ + ip += 3; + // When loading from a local, we might need to sign / zero extend to 4 bytes + // which is our minimum "register" size in interp. They are only needed when + // the address of the local is taken and we should try to optimize them out + // because the local can't be propagated. + MINT_IN_CASE(MINT_MOV_I4_I1) MOV(gint32, gint8); MINT_IN_BREAK; + MINT_IN_CASE(MINT_MOV_I4_U1) MOV(gint32, guint8); MINT_IN_BREAK; + MINT_IN_CASE(MINT_MOV_I4_I2) MOV(gint32, gint16); MINT_IN_BREAK; + MINT_IN_CASE(MINT_MOV_I4_U2) MOV(gint32, guint16); MINT_IN_BREAK; + // These moves are used to store into the field of a local valuetype + // No sign extension is needed, we just move bytes from the execution + // stack, no additional conversion is needed. + MINT_IN_CASE(MINT_MOV_1) MOV(gint8, gint8); MINT_IN_BREAK; + MINT_IN_CASE(MINT_MOV_2) MOV(gint16, gint16); MINT_IN_BREAK; + // Normal moves between locals + MINT_IN_CASE(MINT_MOV_4) MOV(guint32, guint32); MINT_IN_BREAK; + MINT_IN_CASE(MINT_MOV_8) MOV(guint64, guint64); MINT_IN_BREAK; + + MINT_IN_CASE(MINT_MOV_VT) { + guint16 size = ip [3]; + memmove (locals + ip [1], locals + ip [2], size); + ip += 4; + MINT_IN_BREAK; + } + + MINT_IN_CASE(MINT_MOV_8_2) + LOCAL_VAR (ip [1], guint64) = LOCAL_VAR (ip [2], guint64); + LOCAL_VAR (ip [3], guint64) = LOCAL_VAR (ip [4], guint64); + ip += 5; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_MOV_8_3) + LOCAL_VAR (ip [1], guint64) = LOCAL_VAR (ip [2], guint64); + LOCAL_VAR (ip [3], guint64) = LOCAL_VAR (ip [4], guint64); + LOCAL_VAR (ip [5], guint64) = LOCAL_VAR (ip [6], guint64); + ip += 7; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_MOV_8_4) + LOCAL_VAR (ip [1], guint64) = LOCAL_VAR (ip [2], guint64); + LOCAL_VAR (ip [3], guint64) = LOCAL_VAR (ip [4], guint64); + LOCAL_VAR (ip [5], guint64) = LOCAL_VAR (ip [6], guint64); + LOCAL_VAR (ip [7], guint64) = LOCAL_VAR (ip [8], guint64); + ip += 9; + MINT_IN_BREAK; + + MINT_IN_CASE(MINT_LOCALLOC) { + int len = LOCAL_VAR (ip [2], gint32); + gpointer mem; + if (len > 0) { + // We align len to 8 so we can safely load all primitive types on all platforms + mem = frame_data_allocator_alloc (&context->data_stack, frame, ALIGN_TO (len, sizeof (gint64))); + + if (frame->imethod->init_locals) + memset (mem, 0, len); + } else { + mem = NULL; + } + LOCAL_VAR (ip [1], gpointer) = mem; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_ENDFILTER) + /* top of stack is result of filter */ + frame->retval->data.i = LOCAL_VAR (ip [1], gint32); + goto exit_clause; + MINT_IN_CASE(MINT_ZEROBLK) + memset (LOCAL_VAR (ip [1], gpointer), 0, LOCAL_VAR (ip [2], gsize)); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_ZEROBLK_IMM) + memset (LOCAL_VAR (ip [1], gpointer), 0, ip [2]); + ip += 3; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_CPBLK) { + gpointer dest = LOCAL_VAR (ip [1], gpointer); + gpointer src = LOCAL_VAR (ip [2], gpointer); + guint32 size = LOCAL_VAR (ip [3], guint32); + if (size && (!dest || !src)) + THROW_EX (interp_get_exception_null_reference(frame, ip), ip); + else + memcpy (dest, src, size); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_INITBLK) { + gpointer dest = LOCAL_VAR (ip [1], gpointer); + guint32 size = LOCAL_VAR (ip [3], guint32); + if (size) + NULL_CHECK (dest); + memset (dest, LOCAL_VAR (ip [2], gint32), size); + ip += 4; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_RETHROW) { + int exvar_offset = ip [1]; + THROW_EX_GENERAL (*(MonoException**)(frame_locals (frame) + exvar_offset), ip, TRUE); + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_MONO_RETHROW) { + /* + * need to clarify what this should actually do: + * + * Takes an exception from the stack and rethrows it. + * This is useful for wrappers that don't want to have to + * use CEE_THROW and lose the exception stacktrace. + */ + + MonoException *exc = LOCAL_VAR (ip [1], MonoException*); + if (!exc) + exc = interp_get_exception_null_reference (frame, ip); + + THROW_EX_GENERAL (exc, ip, TRUE); + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_LD_DELEGATE_METHOD_PTR) { + // FIXME push/pop LMF + MonoDelegate *del = LOCAL_VAR (ip [2], MonoDelegate*); + if (!del->interp_method) { + /* Not created from interpreted code */ + g_assert (del->method); + del->interp_method = mono_interp_get_imethod (del->method); + } else if (((InterpMethod*)del->interp_method)->optimized_imethod) { + del->interp_method = ((InterpMethod*)del->interp_method)->optimized_imethod; + } + g_assert (del->interp_method); + LOCAL_VAR (ip [1], gpointer) = imethod_to_ftnptr (del->interp_method, FALSE); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_LDVIRTFTN_DELEGATE) { + gpointer arg = LOCAL_VAR (ip [2], gpointer); + MonoDelegate *del = LOCAL_VAR (ip [3], MonoDelegate*); + NULL_CHECK (arg); + + LOCAL_VAR (ip [1], gpointer) = interp_ldvirtftn_delegate (arg, del); + ip += 4; + MINT_IN_BREAK; + } + +#define MATH_UNOP(mathfunc) \ + LOCAL_VAR (ip [1], double) = mathfunc (LOCAL_VAR (ip [2], double)); \ + ip += 3; + +#define MATH_BINOP(mathfunc) \ + LOCAL_VAR (ip [1], double) = mathfunc (LOCAL_VAR (ip [2], double), LOCAL_VAR (ip [3], double)); \ + ip += 4; + + MINT_IN_CASE(MINT_ASIN) MATH_UNOP(asin); MINT_IN_BREAK; + MINT_IN_CASE(MINT_ASINH) MATH_UNOP(asinh); MINT_IN_BREAK; + MINT_IN_CASE(MINT_ACOS) MATH_UNOP(acos); MINT_IN_BREAK; + MINT_IN_CASE(MINT_ACOSH) MATH_UNOP(acosh); MINT_IN_BREAK; + MINT_IN_CASE(MINT_ATAN) MATH_UNOP(atan); MINT_IN_BREAK; + MINT_IN_CASE(MINT_ATANH) MATH_UNOP(atanh); MINT_IN_BREAK; + MINT_IN_CASE(MINT_CEILING) MATH_UNOP(ceil); MINT_IN_BREAK; + MINT_IN_CASE(MINT_COS) MATH_UNOP(cos); MINT_IN_BREAK; + MINT_IN_CASE(MINT_CBRT) MATH_UNOP(cbrt); MINT_IN_BREAK; + MINT_IN_CASE(MINT_COSH) MATH_UNOP(cosh); MINT_IN_BREAK; + MINT_IN_CASE(MINT_EXP) MATH_UNOP(exp); MINT_IN_BREAK; + MINT_IN_CASE(MINT_FLOOR) MATH_UNOP(floor); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LOG) MATH_UNOP(log); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LOG2) MATH_UNOP(log2); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LOG10) MATH_UNOP(log10); MINT_IN_BREAK; + MINT_IN_CASE(MINT_SIN) MATH_UNOP(sin); MINT_IN_BREAK; + MINT_IN_CASE(MINT_SQRT) MATH_UNOP(sqrt); MINT_IN_BREAK; + MINT_IN_CASE(MINT_SINH) MATH_UNOP(sinh); MINT_IN_BREAK; + MINT_IN_CASE(MINT_TAN) MATH_UNOP(tan); MINT_IN_BREAK; + MINT_IN_CASE(MINT_TANH) MATH_UNOP(tanh); MINT_IN_BREAK; + MINT_IN_CASE(MINT_ABS) MATH_UNOP(fabs); MINT_IN_BREAK; + + MINT_IN_CASE(MINT_ATAN2) MATH_BINOP(atan2); MINT_IN_BREAK; + MINT_IN_CASE(MINT_POW) MATH_BINOP(pow); MINT_IN_BREAK; + MINT_IN_CASE(MINT_MIN) MATH_BINOP(min_d); MINT_IN_BREAK; + MINT_IN_CASE(MINT_MAX) MATH_BINOP(max_d); MINT_IN_BREAK; + MINT_IN_CASE(MINT_FMA) + LOCAL_VAR (ip [1], double) = fma (LOCAL_VAR (ip [2], double), LOCAL_VAR (ip [3], double), LOCAL_VAR (ip [4], double)); + ip += 5; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SCALEB) + LOCAL_VAR (ip [1], double) = scalbn (LOCAL_VAR (ip [2], double), LOCAL_VAR (ip [3], gint32)); + ip += 4; + MINT_IN_BREAK; + +#define MATH_UNOPF(mathfunc) \ + LOCAL_VAR (ip [1], float) = mathfunc (LOCAL_VAR (ip [2], float)); \ + ip += 3; + +#define MATH_BINOPF(mathfunc) \ + LOCAL_VAR (ip [1], float) = mathfunc (LOCAL_VAR (ip [2], float), LOCAL_VAR (ip [3], float)); \ + ip += 4; + MINT_IN_CASE(MINT_ASINF) MATH_UNOPF(asinf); MINT_IN_BREAK; + MINT_IN_CASE(MINT_ASINHF) MATH_UNOPF(asinhf); MINT_IN_BREAK; + MINT_IN_CASE(MINT_ACOSF) MATH_UNOPF(acosf); MINT_IN_BREAK; + MINT_IN_CASE(MINT_ACOSHF) MATH_UNOPF(acoshf); MINT_IN_BREAK; + MINT_IN_CASE(MINT_ATANF) MATH_UNOPF(atanf); MINT_IN_BREAK; + MINT_IN_CASE(MINT_ATANHF) MATH_UNOPF(atanhf); MINT_IN_BREAK; + MINT_IN_CASE(MINT_CEILINGF) MATH_UNOPF(ceilf); MINT_IN_BREAK; + MINT_IN_CASE(MINT_COSF) MATH_UNOPF(cosf); MINT_IN_BREAK; + MINT_IN_CASE(MINT_CBRTF) MATH_UNOPF(cbrtf); MINT_IN_BREAK; + MINT_IN_CASE(MINT_COSHF) MATH_UNOPF(coshf); MINT_IN_BREAK; + MINT_IN_CASE(MINT_EXPF) MATH_UNOPF(expf); MINT_IN_BREAK; + MINT_IN_CASE(MINT_FLOORF) MATH_UNOPF(floorf); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LOGF) MATH_UNOPF(logf); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LOG2F) MATH_UNOPF(log2f); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LOG10F) MATH_UNOPF(log10f); MINT_IN_BREAK; + MINT_IN_CASE(MINT_SINF) MATH_UNOPF(sinf); MINT_IN_BREAK; + MINT_IN_CASE(MINT_SQRTF) MATH_UNOPF(sqrtf); MINT_IN_BREAK; + MINT_IN_CASE(MINT_SINHF) MATH_UNOPF(sinhf); MINT_IN_BREAK; + MINT_IN_CASE(MINT_TANF) MATH_UNOPF(tanf); MINT_IN_BREAK; + MINT_IN_CASE(MINT_TANHF) MATH_UNOPF(tanhf); MINT_IN_BREAK; + MINT_IN_CASE(MINT_ABSF) MATH_UNOPF(fabsf); MINT_IN_BREAK; + + MINT_IN_CASE(MINT_ATAN2F) MATH_BINOPF(atan2f); MINT_IN_BREAK; + MINT_IN_CASE(MINT_POWF) MATH_BINOPF(powf); MINT_IN_BREAK; + MINT_IN_CASE(MINT_MINF) MATH_BINOPF(min_f); MINT_IN_BREAK; + MINT_IN_CASE(MINT_MAXF) MATH_BINOPF(max_f); MINT_IN_BREAK; + MINT_IN_CASE(MINT_FMAF) + LOCAL_VAR (ip [1], float) = fmaf (LOCAL_VAR (ip [2], float), LOCAL_VAR (ip [3], float), LOCAL_VAR (ip [4], float)); + ip += 5; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_SCALEBF) + LOCAL_VAR (ip [1], float) = scalbnf (LOCAL_VAR (ip [2], float), LOCAL_VAR (ip [3], gint32)); + ip += 4; + MINT_IN_BREAK; + + MINT_IN_CASE(MINT_INTRINS_ENUM_HASFLAG) { + MonoClass *klass = (MonoClass*)frame->imethod->data_items [ip [4]]; + LOCAL_VAR (ip [1], gint32) = mono_interp_enum_hasflag ((stackval*)(locals + ip [2]), (stackval*)(locals + ip [3]), klass); + ip += 5; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_INTRINS_GET_HASHCODE) { + LOCAL_VAR (ip [1], gint32) = mono_object_hash_internal (LOCAL_VAR (ip [2], MonoObject*)); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_INTRINS_TRY_GET_HASHCODE) { + LOCAL_VAR (ip [1], gint32) = mono_object_try_get_hash_internal (LOCAL_VAR (ip [2], MonoObject*)); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_INTRINS_GET_TYPE) { + MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); + NULL_CHECK (o); + LOCAL_VAR (ip [1], MonoObject*) = (MonoObject*) o->vtable->type; + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_METADATA_UPDATE_LDFLDA) { + MonoObject *inst = LOCAL_VAR (ip [2], MonoObject*); + MonoType *field_type = frame->imethod->data_items [ip [3]]; + uint32_t fielddef_token = GPOINTER_TO_UINT32 (frame->imethod->data_items [ip [4]]); + // FIXME: can we emit a call directly instead of a runtime-invoke? + gpointer field_addr = mono_metadata_update_added_field_ldflda (inst, field_type, fielddef_token, error); + /* FIXME: think about pinning the FieldStore and adding a second opcode to + * unpin it */ + LOCAL_VAR (ip [1], gpointer) = field_addr; + mono_interp_error_cleanup (error); + ip += 5; + MINT_IN_BREAK; + } + +#ifdef HOST_BROWSER + MINT_IN_CASE(MINT_TIER_NOP_JITERPRETER) { + ip += JITERPRETER_OPCODE_SIZE; + MINT_IN_BREAK; + } + + MINT_IN_CASE(MINT_TIER_PREPARE_JITERPRETER) { + if (mono_opt_jiterpreter_traces_enabled) { + /* + * prepare_jiterpreter will update the trace's hit count and potentially either JIT it or + * disable this entry point based on whether it fails to JIT. the hit counting is necessary + * because a given method may contain many jiterpreter entry points, but some of them will + * not be actually hit often enough to justify the cost of jitting them. (for example, a + * trace that only runs inside an unlikely branch for throwing exceptions.) + * thanks to the heuristic that runs during transform.c's codegen, most (95%+) of these + * entry points will JIT successfully, which will keep the number of NOT_JITTED nops low. + * note: threading doesn't work yet, we will need to broadcast jitted traces to all of our + * JS workers in order to register them at the appropriate slots in the function pointer + * table. when growing the function pointer table we will also need to synchronize that. + */ + JiterpreterThunk prepare_result = mono_interp_tier_prepare_jiterpreter_fast (frame, ip); + ptrdiff_t offset; + switch ((guint32)(void*)prepare_result) { + case JITERPRETER_TRAINING: + // jiterpreter still updating hit count before deciding to generate a trace, + // so skip this opcode. + ip += JITERPRETER_OPCODE_SIZE; + break; + case JITERPRETER_NOT_JITTED: + // Patch opcode to disable it because this trace failed to JIT. + if (!mono_opt_jiterpreter_estimate_heat) { + if (!mono_jiterp_patch_opcode ((volatile JiterpreterOpcode *)ip, MINT_TIER_PREPARE_JITERPRETER, MINT_TIER_NOP_JITERPRETER)) + g_printf ("Failed to patch opcode at %x into a nop\n", (unsigned int)ip); + } + ip += JITERPRETER_OPCODE_SIZE; + break; + default: + /* + * trace generated. patch opcode to disable it, then write the function + * pointer, then patch opcode again to turn this trace on. + * we do this to ensure that other threads won't see an ENTER_JITERPRETER + * opcode that has no function pointer stored inside of it. + * (note that right now threading doesn't work, but it's worth being correct + * here so that implementing thread support will be easier later.) + */ + if (!mono_jiterp_patch_opcode ((volatile JiterpreterOpcode *)ip, MINT_TIER_PREPARE_JITERPRETER, MINT_TIER_MONITOR_JITERPRETER)) + g_printf ("Failed to patch opcode at %x into a monitor point\n", (unsigned int)ip); + // now execute the trace + // this isn't important for performance, but it makes it easier to use the + // jiterpreter early in automated tests where code only runs once + offset = prepare_result (frame, locals, NULL, ip); + ip = (guint16*) (((guint8*)ip) + offset); + break; + } + } else { + ip += JITERPRETER_OPCODE_SIZE; + } + + MINT_IN_BREAK; + } + + MINT_IN_CASE(MINT_TIER_MONITOR_JITERPRETER) { + // The trace is in monitoring mode, where we track how far it actually goes + // each time it is executed for a while. After N more hits, we either + // turn it into an ENTER or a NOP depending on how well it is working + ptrdiff_t offset = mono_jiterp_monitor_trace (ip, frame, locals); + ip = (guint16*) (((guint8*)ip) + offset); + MINT_IN_BREAK; + } + + MINT_IN_CASE(MINT_TIER_ENTER_JITERPRETER) { + // The fn ptr is encoded in a guint16 relative to the index of the first trace fn ptr, so compute the actual ptr + JiterpreterThunk thunk = (JiterpreterThunk)(void *)(((JiterpreterOpcode *)ip)->relative_fn_ptr + mono_jiterp_first_trace_fn_ptr); + ptrdiff_t offset = thunk (frame, locals, NULL, ip); + ip = (guint16*) (((guint8*)ip) + offset); + MINT_IN_BREAK; + } +#endif + +#if !USE_COMPUTED_GOTO + default: + interp_error_xsx ("Unimplemented opcode: %04x %s at 0x%x\n", *ip, mono_interp_opname (*ip), GPTRDIFF_TO_INT (ip - frame->imethod->code)); +#endif // USE_COMPUTED_GOTO + } + } + + g_assert_not_reached (); + +resume: + g_assert (context->has_resume_state); + g_assert (frame->imethod); + + if (frame == context->handler_frame) { + /* + * When running finally blocks, we can have the same frame twice on the stack. If we have + * clause_args information, we need to check whether resuming should happen inside this + * finally block, or in some other part of the method, in which case we need to exit. + */ + if (clause_args && frame == clause_args->exec_frame && context->handler_ip >= clause_args->end_at_ip) { + goto exit_clause; + } else { + /* Set the current execution state to the resume state in context */ + ip = context->handler_ip; + /* spec says stack should be empty at endfinally so it should be at the start too */ + locals = (guchar*)frame->stack; + g_assert (context->exc_gchandle); + + clear_resume_state (context); + // goto main_loop instead of MINT_IN_DISPATCH helps the compiler and therefore conserves stack. + // This is a slow/rare path and conserving stack is preferred over its performance otherwise. + goto main_loop; + } + } else if (clause_args && frame == clause_args->exec_frame) { + /* + * This frame doesn't handle the resume state and it is the first frame invoked from EH. + * We can't just return to parent. We must first exit the EH mechanism and start resuming + * again from the original frame. + */ + goto exit_clause; + } + // Because we are resuming in another frame, bypassing a normal ret opcode, + // we need to make sure to reset the localloc stack + frame_data_allocator_pop (&context->data_stack, frame); + // fall through +exit_frame: + g_assert_checked (frame->imethod); + + if (frame->parent && frame->parent->state.ip) { + /* Return to the main loop after a non-recursive interpreter call */ + //printf ("R: %s -> %s %p\n", mono_method_get_full_name (frame->imethod->method), mono_method_get_full_name (frame->parent->imethod->method), frame->parent->state.ip); + g_assert_checked (frame->stack); + frame = frame->parent; + /* + * FIXME We should be able to avoid dereferencing imethod here, if we will have + * a param_area and all calls would inherit the same sp, or if we are full coop. + */ + context->stack_pointer = (guchar*)frame->stack + frame->imethod->alloca_size; + LOAD_INTERP_STATE (frame); + + CHECK_RESUME_STATE (context); + + goto main_loop; + } +exit_clause: + if (!clause_args) + context->stack_pointer = (guchar*)frame->stack; + + DEBUG_LEAVE (); +} + +#undef SET_TEMP_POINTER + +static void +interp_parse_options (const char *options) +{ + char **args, **ptr; + + if (!options) + return; + + args = g_strsplit (options, ",", -1); + for (ptr = args; ptr && *ptr; ptr ++) { + char *arg = *ptr; + + if (strncmp (arg, "jit=", 4) == 0) { + mono_interp_jit_classes = g_slist_prepend (mono_interp_jit_classes, arg + 4); + } else if (strncmp (arg, "interp-only=", strlen ("interp-only=")) == 0) { + mono_interp_only_classes = g_slist_prepend (mono_interp_only_classes, arg + strlen ("interp-only=")); + } else { + gboolean invert; + int opt = 0; + + if (*arg == '-') { + arg++; + invert = TRUE; + } else { + invert = FALSE; + } + + if (strncmp (arg, "inline", 6) == 0) + opt = INTERP_OPT_INLINE; + else if (strncmp (arg, "cprop", 5) == 0) + opt = INTERP_OPT_CPROP; + else if (strncmp (arg, "super", 5) == 0) + opt = INTERP_OPT_SUPER_INSTRUCTIONS; + else if (strncmp (arg, "bblocks", 7) == 0) + opt = INTERP_OPT_BBLOCKS; + else if (strncmp (arg, "tiering", 7) == 0) + opt = INTERP_OPT_TIERING; + else if (strncmp (arg, "simd", 4) == 0) + opt = INTERP_OPT_SIMD; +#if HOST_BROWSER + else if (strncmp (arg, "jiterp", 6) == 0) + opt = INTERP_OPT_JITERPRETER; +#endif + else if (strncmp (arg, "ssa", 3) == 0) + opt = INTERP_OPT_SSA; + else if (strncmp (arg, "precise", 7) == 0) + opt = INTERP_OPT_PRECISE_GC; + else if (strncmp (arg, "all", 3) == 0) + opt = ~INTERP_OPT_NONE; + + if (opt) { + if (invert) + mono_interp_opt &= ~opt; + else + mono_interp_opt |= opt; + } + } + } + g_strfreev (args); +} + +/* + * interp_set_resume_state: + * + * Set the state the interpreter will continue to execute from after execution returns to the interpreter. + * If INTERP_FRAME is NULL, that means the exception is caught in an AOTed frame and the interpreter needs to + * unwind back to AOT code. + */ +static void +interp_set_resume_state (MonoJitTlsData *jit_tls, MonoObject *ex, MonoJitExceptionInfo *ei, MonoInterpFrameHandle interp_frame, gpointer handler_ip) +{ + ThreadContext *context; + + g_assert (jit_tls); + context = (ThreadContext*)jit_tls->interp_context; + g_assert (context); + + context->has_resume_state = TRUE; + context->handler_frame = (InterpFrame*)interp_frame; + context->handler_ei = ei; + if (context->exc_gchandle) + mono_gchandle_free_internal (context->exc_gchandle); + context->exc_gchandle = mono_gchandle_new_internal ((MonoObject*)ex, FALSE); + /* Ditto */ + if (context->handler_frame) { + if (ei) + *(MonoObject**)(frame_locals (context->handler_frame) + ei->exvar_offset) = ex; + } + context->handler_ip = (const guint16*)handler_ip; +} + +static void +interp_get_resume_state (const MonoJitTlsData *jit_tls, gboolean *has_resume_state, MonoInterpFrameHandle *interp_frame, gpointer *handler_ip) +{ + g_assert (jit_tls); + ThreadContext *context = (ThreadContext*)jit_tls->interp_context; + + *has_resume_state = context ? context->has_resume_state : FALSE; + if (!*has_resume_state) + return; + + *interp_frame = context->handler_frame; + *handler_ip = (gpointer)context->handler_ip; +} + +/* + * interp_run_finally: + * + * Run the finally clause identified by CLAUSE_INDEX in the interpreter frame given by + * frame->interp_frame. + * Return TRUE if the finally clause threw an exception. + */ +static gboolean +interp_run_finally (StackFrameInfo *frame, int clause_index) +{ + InterpFrame *iframe = (InterpFrame*)frame->interp_frame; + MonoJitExceptionInfo *ei = &iframe->imethod->jinfo->clauses [clause_index]; + ThreadContext *context = get_context (); + FrameClauseArgs clause_args; + const guint16 *state_ip; + + memset (&clause_args, 0, sizeof (FrameClauseArgs)); + clause_args.start_with_ip = (const guint16*)ei->handler_start; + clause_args.end_at_ip = (const guint16*)ei->data.handler_end; + clause_args.exec_frame = iframe; + + state_ip = iframe->state.ip; + iframe->state.ip = NULL; + + InterpFrame* const next_free = iframe->next_free; + iframe->next_free = NULL; + + // this informs MINT_ENDFINALLY to return to EH + *(guint16**)(frame_locals (iframe) + iframe->imethod->clause_data_offsets [clause_index]) = NULL; + + mono_interp_exec_method (iframe, context, &clause_args); + + iframe->next_free = next_free; + iframe->state.ip = state_ip; + + if (need_native_unwind (context)) { + mono_llvm_start_native_unwind (); + return TRUE; + } + + if (context->has_resume_state) { + return TRUE; + } else { + return FALSE; + } +} + +/* + * interp_run_filter: + * + * Run the filter clause identified by CLAUSE_INDEX in the interpreter frame given by + * frame->interp_frame. + */ +// Do not inline in case order of frame addresses matters. +static MONO_NEVER_INLINE gboolean +interp_run_filter (StackFrameInfo *frame, MonoException *ex, int clause_index, gpointer handler_ip, gpointer handler_ip_end) +{ + InterpFrame *iframe = (InterpFrame*)frame->interp_frame; + ThreadContext *context = get_context (); + stackval retval; + FrameClauseArgs clause_args; + + /* + * Have to run the clause in a new frame which is a copy of IFRAME, since + * during debugging, there are two copies of the frame on the stack. + */ + InterpFrame child_frame = {0}; + child_frame.parent = iframe; + child_frame.imethod = iframe->imethod; + child_frame.stack = (stackval*)context->stack_pointer; + child_frame.retval = &retval; + + /* Copy the stack frame of the original method */ + memcpy (child_frame.stack, iframe->stack, iframe->imethod->locals_size); + // Write the exception object in its reserved stack slot + *((MonoException**)((char*)child_frame.stack + iframe->imethod->clause_data_offsets [clause_index])) = ex; + context->stack_pointer += iframe->imethod->alloca_size; + g_assert (context->stack_pointer < context->stack_end); + + memset (&clause_args, 0, sizeof (FrameClauseArgs)); + clause_args.start_with_ip = (const guint16*)handler_ip; + clause_args.end_at_ip = (const guint16*)handler_ip_end; + clause_args.exec_frame = &child_frame; + + mono_interp_exec_method (&child_frame, context, &clause_args); + + /* Copy back the updated frame */ + memcpy (iframe->stack, child_frame.stack, iframe->imethod->locals_size); + + context->stack_pointer = (guchar*)child_frame.stack; + + if (need_native_unwind (context)) { + mono_llvm_start_native_unwind (); + return TRUE; + } + + /* ENDFILTER stores the result into child_frame->retval */ + return retval.data.i ? TRUE : FALSE; +} + +/* Returns TRUE if there is a pending exception */ +static gboolean +interp_run_clause_with_il_state (gpointer il_state_ptr, int clause_index, MonoObject *ex, gboolean *filtered) +{ + MonoMethodILState *il_state = (MonoMethodILState*)il_state_ptr; + MonoMethodSignature *sig; + ThreadContext *context = get_context (); + stackval *sp; + InterpMethod *imethod; + FrameClauseArgs clause_args; + ERROR_DECL (error); + + sig = mono_method_signature_internal (il_state->method); + g_assert (sig); + + imethod = mono_interp_get_imethod (il_state->method); + if (!imethod->transformed) { + // In case method is in process of being tiered up, make sure it is compiled + mono_interp_transform_method (imethod, context, error); + mono_error_assert_ok (error); + } + + sp = (stackval*)context->stack_pointer; + + gpointer ret_addr = NULL; + + int findex = 0; + if (sig->ret->type != MONO_TYPE_VOID) { + ret_addr = il_state->data [findex]; + findex ++; + } + int first_param_index = 0; + if (sig->hasthis) { + if (il_state->data [findex]) + sp->data.p = *(gpointer*)il_state->data [findex]; + first_param_index = 1; + findex ++; + } + + for (int i = 0; i < sig->param_count; ++i) { + if (il_state->data [findex]) { + int arg_offset = get_arg_offset_fast (imethod, NULL, first_param_index + i); + stackval *sval = STACK_ADD_ALIGNED_BYTES (sp, arg_offset); + + stackval_from_data (sig->params [i], sval, il_state->data [findex], FALSE); + } + findex ++; + } + + /* Allocate frame */ + InterpFrame frame = {0}; + frame.imethod = imethod; + frame.stack = sp; + frame.retval = sp; + + int params_size = get_arg_offset_fast (imethod, NULL, first_param_index + sig->param_count); + context->stack_pointer = (guchar*)ALIGN_TO ((guchar*)sp + params_size, MINT_STACK_ALIGNMENT); + context->stack_pointer += imethod->alloca_size; + g_assert (context->stack_pointer < context->stack_end); + + MonoMethodHeader *header = mono_method_get_header_internal (il_state->method, error); + mono_error_assert_ok (error); + + /* Init locals */ + if (header->num_locals) + memset (frame_locals (&frame) + imethod->local_offsets [0], 0, imethod->locals_size); + /* Copy locals from il_state */ + int locals_start = findex; + for (int i = 0; i < header->num_locals; ++i) { + if (il_state->data [locals_start + i]) + stackval_from_data (header->locals [i], (stackval*)(frame_locals (&frame) + imethod->local_offsets [i]), il_state->data [locals_start + i], FALSE); + } + + memset (&clause_args, 0, sizeof (FrameClauseArgs)); + MonoJitExceptionInfo *ei = &imethod->jinfo->clauses [clause_index]; + MonoExceptionEnum clause_type = ei->flags; + // For filter clauses, if filtered is set, then we run the filter, otherwise we run the catch handler + if (clause_type == MONO_EXCEPTION_CLAUSE_FILTER && !filtered) + clause_type = MONO_EXCEPTION_CLAUSE_NONE; + + if (clause_type == MONO_EXCEPTION_CLAUSE_FILTER) + clause_args.start_with_ip = (const guint16*)ei->data.filter; + else + clause_args.start_with_ip = (const guint16*)ei->handler_start; + if (clause_type == MONO_EXCEPTION_CLAUSE_NONE || clause_type == MONO_EXCEPTION_CLAUSE_FILTER) { + /* Run until the end */ + clause_args.end_at_ip = NULL; + clause_args.run_until_end = TRUE; + } else { + clause_args.end_at_ip = (const guint16*)ei->data.handler_end; + } + clause_args.exec_frame = &frame; + + if (clause_type == MONO_EXCEPTION_CLAUSE_NONE || clause_type == MONO_EXCEPTION_CLAUSE_FILTER) + *(MonoObject**)(frame_locals (&frame) + imethod->jinfo->clauses [clause_index].exvar_offset) = ex; + else + // this informs MINT_ENDFINALLY to return to EH + *(guint16**)(frame_locals (&frame) + imethod->clause_data_offsets [clause_index]) = NULL; + + /* Set in mono_handle_exception () */ + context->has_resume_state = FALSE; + + mono_interp_exec_method (&frame, context, &clause_args); + + /* Write back args */ + findex = 0; + if (sig->ret->type != MONO_TYPE_VOID) + findex ++; + if (sig->hasthis) { + // FIXME: This + findex ++; + } + for (int i = 0; i < sig->param_count; ++i) { + if (il_state->data [findex]) { + int arg_offset = get_arg_offset_fast (imethod, NULL, first_param_index + i); + stackval *sval = STACK_ADD_ALIGNED_BYTES (sp, arg_offset); + + stackval_to_data (sig->params [i], sval, il_state->data [findex], FALSE); + } + findex ++; + } + /* Write back locals */ + for (int i = 0; i < header->num_locals; ++i) { + if (il_state->data [locals_start + i]) + stackval_to_data (header->locals [i], (stackval*)(frame_locals (&frame) + imethod->local_offsets [i]), il_state->data [locals_start + i], FALSE); + } + mono_metadata_free_mh (header); + + if (clause_type == MONO_EXCEPTION_CLAUSE_NONE && ret_addr) { + stackval_to_data (sig->ret, frame.retval, ret_addr, FALSE); + } else if (clause_type == MONO_EXCEPTION_CLAUSE_FILTER) { + g_assert (filtered); + *filtered = frame.retval->data.i; + } + + memset (sp, 0, (guint8*)context->stack_pointer - (guint8*)sp); + context->stack_pointer = (guchar*)sp; + + if (need_native_unwind (context)) { + mono_llvm_start_native_unwind (); + return FALSE; + } + + return context->has_resume_state; +} + +typedef struct { + InterpFrame *current; +} StackIter; + +static gpointer +interp_frame_get_ip (MonoInterpFrameHandle frame) +{ + InterpFrame *iframe = (InterpFrame*)frame; + + g_assert (iframe->imethod); + /* + * For calls, state.ip points to the instruction following the call, so we need to subtract + * in order to get inside the call instruction range. Other instructions that set the IP for + * the rest of the runtime to see, like throws and sdb breakpoints, will need to account for + * this subtraction that we are doing here. + */ + return (gpointer)(iframe->state.ip - 1); +} + +/* + * interp_frame_iter_init: + * + * Initialize an iterator for iterating through interpreted frames. + */ +static void +interp_frame_iter_init (MonoInterpStackIter *iter, gpointer interp_exit_data) +{ + StackIter *stack_iter = (StackIter*)iter; + + stack_iter->current = (InterpFrame*)interp_exit_data; +} + +/* + * interp_frame_iter_next: + * + * Fill out FRAME with date for the next interpreter frame. + */ +static gboolean +interp_frame_iter_next (MonoInterpStackIter *iter, StackFrameInfo *frame) +{ + StackIter *stack_iter = (StackIter*)iter; + InterpFrame *iframe = stack_iter->current; + + memset (frame, 0, sizeof (StackFrameInfo)); + /* pinvoke frames doesn't have imethod set */ + while (iframe && !(iframe->imethod && iframe->imethod->code && iframe->imethod->jinfo)) + iframe = iframe->parent; + if (!iframe) + return FALSE; + + MonoMethod *method = iframe->imethod->method; + frame->interp_frame = iframe; + frame->method = method; + frame->actual_method = method; + if (method && ((method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) || (method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME)))) { + frame->native_offset = -1; + frame->type = FRAME_TYPE_MANAGED_TO_NATIVE; + } else { + frame->type = FRAME_TYPE_INTERP; + /* This is the offset in the interpreter IR. */ + frame->native_offset = GPTRDIFF_TO_INT ((guint8*)interp_frame_get_ip (iframe) - (guint8*)iframe->imethod->code); + if (method && (!method->wrapper_type || method->wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD)) + frame->managed = TRUE; + } + frame->ji = iframe->imethod->jinfo; + frame->frame_addr = iframe; + + stack_iter->current = iframe->parent; + + return TRUE; +} + +static MonoJitInfo* +interp_find_jit_info (MonoMethod *method) +{ + InterpMethod* imethod; + + imethod = lookup_imethod (method); + if (imethod) + return imethod->jinfo; + else + return NULL; +} + +static void +interp_set_breakpoint (MonoJitInfo *jinfo, gpointer ip) +{ + guint16 *code = (guint16*)ip; + g_assert (*code == MINT_SDB_SEQ_POINT); + *code = MINT_SDB_BREAKPOINT; +} + +static void +interp_clear_breakpoint (MonoJitInfo *jinfo, gpointer ip) +{ + guint16 *code = (guint16*)ip; + g_assert (*code == MINT_SDB_BREAKPOINT); + *code = MINT_SDB_SEQ_POINT; +} + +static MonoJitInfo* +interp_frame_get_jit_info (MonoInterpFrameHandle frame) +{ + InterpFrame *iframe = (InterpFrame*)frame; + + g_assert (iframe->imethod); + return iframe->imethod->jinfo; +} + +static gpointer +interp_frame_get_arg (MonoInterpFrameHandle frame, int pos) +{ + InterpFrame *iframe = (InterpFrame*)frame; + + g_assert (iframe->imethod); + + return (char*)iframe->stack + get_arg_offset_fast (iframe->imethod, NULL, pos + iframe->imethod->hasthis); +} + +static gpointer +interp_frame_get_local (MonoInterpFrameHandle frame, int pos) +{ + InterpFrame *iframe = (InterpFrame*)frame; + + g_assert (iframe->imethod); + + return frame_locals (iframe) + iframe->imethod->local_offsets [pos]; +} + +static gpointer +interp_frame_get_this (MonoInterpFrameHandle frame) +{ + InterpFrame *iframe = (InterpFrame*)frame; + + g_assert (iframe->imethod); + g_assert (iframe->imethod->hasthis); + return iframe->stack; +} + +static MonoInterpFrameHandle +interp_frame_get_parent (MonoInterpFrameHandle frame) +{ + InterpFrame *iframe = (InterpFrame*)frame; + + return iframe->parent; +} + +static void +interp_start_single_stepping (void) +{ + ss_enabled = TRUE; +} + +static void +interp_stop_single_stepping (void) +{ + ss_enabled = FALSE; +} + + +static void +interp_mark_frame_no_ref_slots (ThreadContext *context, InterpFrame *frame, gpointer *top_limit) +{ + InterpMethod *imethod = frame->imethod; + gpointer *frame_stack = (gpointer*)frame->stack; + gpointer *frame_stack_end = (gpointer*)((guchar*)frame->stack + imethod->alloca_size); + // The way interpreter implements calls is by moving arguments to the param area, at the + // top of the stack and then proceed with the call. Up to the moment of the call these slots + // are owned by the calling frame. Once we do the call, the stack pointer of the called + // frame will point inside the param area of the calling frame. + // + // We mark no ref slots from top to bottom and we use the top limit to ignore slots + // that were already handled in the called frame. + if (top_limit && top_limit < frame_stack_end) + frame_stack_end = top_limit; + + for (gpointer *current = frame_stack; current < frame_stack_end; current++) { + gsize slot_index = current - frame_stack; + if (!mono_bitset_test_fast (imethod->ref_slots, slot_index)) { + gsize global_slot_index = current - (gpointer*)context->stack_start; + gsize table_index = global_slot_index / 8; + int bit_index = global_slot_index % 8; + context->no_ref_slots [table_index] |= 1 << bit_index; + } + } +} + +static void +interp_mark_no_ref_slots (ThreadContext *context, MonoLMF* lmf) +{ + memset (context->no_ref_slots, 0, (context->stack_pointer - context->stack_start) / (8 * sizeof (gpointer)) + 1); + while (lmf) { + if ((gsize)lmf->previous_lmf & 2) { + MonoLMFExt *lmf_ext = (MonoLMFExt*) lmf; + if (lmf_ext->kind == MONO_LMFEXT_INTERP_EXIT || lmf_ext->kind == MONO_LMFEXT_INTERP_EXIT_WITH_CTX) { + InterpFrame *frame = (InterpFrame*)lmf_ext->interp_exit_data; + gpointer *top_limit = NULL; + while (frame) { + if (frame->imethod) { + interp_mark_frame_no_ref_slots (context, frame, top_limit); + top_limit = (gpointer*)frame->stack; + } + frame = frame->parent; + } + } + } + lmf = (MonoLMF*)((gsize)lmf->previous_lmf & ~3); + } +} + +/* + * interp_mark_stack: + * + * Mark the interpreter stack frames for a thread. + * + */ +static void +interp_mark_stack (gpointer thread_data, GcScanFunc func, gpointer gc_data, gboolean precise) +{ + MonoThreadInfo *info = (MonoThreadInfo*)thread_data; + + if (!mono_use_interpreter) + return; + if (precise) + return; + + /* + * We explicitly mark the frames instead of registering the stack fragments as GC roots, so + * we have to process less data and avoid false pinning from data which is above 'pos'. + * + * The stack frame handling code uses compiler write barriers only, but the calling code + * in sgen-mono.c already did a mono_memory_barrier_process_wide () so we can + * process these data structures normally. + */ + MonoJitTlsData *jit_tls = (MonoJitTlsData *)info->tls [TLS_KEY_JIT_TLS]; + if (!jit_tls) + return; + + ThreadContext *context = (ThreadContext*)jit_tls->interp_context; + if (!context || !context->stack_start) + return; + + if (mono_interp_opt & INTERP_OPT_PRECISE_GC) { + MonoLMF **lmf_addr = (MonoLMF**)info->tls [TLS_KEY_LMF_ADDR]; + if (lmf_addr) + interp_mark_no_ref_slots (context, *lmf_addr); + } + + int slot_index = 0; + for (gpointer *p = (gpointer*)context->stack_start; p < (gpointer*)context->stack_pointer; p++) { + if (context->no_ref_slots && (context->no_ref_slots [slot_index / 8] & (1 << (slot_index % 8)))) + ;// This slot is marked as no ref, we don't scan it + else + func (p, gc_data); + slot_index++; + } + + FrameDataFragment *frag; + for (frag = context->data_stack.first; frag; frag = frag->next) { + // FIXME: Scan the whole area with 1 call + for (gpointer *p = (gpointer*)&frag->data; p < (gpointer*)frag->pos; ++p) + func (p, gc_data); + if (frag == context->data_stack.current) + break; + } +} + +#if COUNT_OPS + +static int +opcode_count_comparer (const void * pa, const void * pb) +{ + long counta = opcode_counts [*(int*)pa]; + long countb = opcode_counts [*(int*)pb]; + + if (counta < countb) + return 1; + else if (counta > countb) + return -1; + else + return 0; +} + +static void +interp_print_op_count (void) +{ + int ordered_ops [MINT_LASTOP]; + int i; + long total_ops = 0; + + for (i = 0; i < MINT_LASTOP; i++) { + ordered_ops [i] = i; + total_ops += opcode_counts [i]; + } + qsort (ordered_ops, MINT_LASTOP, sizeof (int), opcode_count_comparer); + + g_print ("total ops %ld\n", total_ops); + for (i = 0; i < MINT_LASTOP; i++) { + long count = opcode_counts [ordered_ops [i]]; + g_print ("%s : %ld (%.2lf%%)\n", mono_interp_opname (ordered_ops [i]), count, (double)count / total_ops * 100); + } +} +#endif + +#if PROFILE_INTERP + +static InterpMethod **imethods; +static int num_methods; +const int opcount_threshold = 100000; + +static void +interp_add_imethod (gpointer method, gpointer user_data) +{ + InterpMethod *imethod = (InterpMethod*) method; + if (imethod->opcounts > opcount_threshold) + imethods [num_methods++] = imethod; +} + +static int +imethod_opcount_comparer (gconstpointer m1, gconstpointer m2) +{ + long diff = (*(InterpMethod**)m2)->opcounts - (*(InterpMethod**)m1)->opcounts; + if (diff > 0) + return 1; + else if (diff < 0) + return -1; + else + return 0; +} + +static void +interp_print_method_counts (void) +{ + MonoJitMemoryManager *jit_mm = get_default_jit_mm (); + + jit_mm_lock (jit_mm); + imethods = (InterpMethod**) malloc (jit_mm->interp_code_hash.num_entries * sizeof (InterpMethod*)); + mono_internal_hash_table_apply (&jit_mm->interp_code_hash, interp_add_imethod, NULL); + jit_mm_unlock (jit_mm); + + qsort (imethods, num_methods, sizeof (InterpMethod*), imethod_opcount_comparer); + + printf ("Total executed opcodes %ld\n", total_executed_opcodes); + long cumulative_executed_opcodes = 0; + for (int i = 0; i < num_methods; i++) { + cumulative_executed_opcodes += imethods [i]->opcounts; + printf ("%d%% Opcounts %ld, calls %ld, Method %s, imethod ptr %p\n", (int)(cumulative_executed_opcodes * 100 / total_executed_opcodes), imethods [i]->opcounts, imethods [i]->calls, mono_method_full_name (imethods [i]->method, TRUE), imethods [i]); + } +} +#endif + +static void +interp_set_optimizations (guint32 opts) +{ + mono_interp_opt = opts; +} + +static void +invalidate_transform (gpointer imethod_, gpointer user_data) +{ + InterpMethod *imethod = (InterpMethod *) imethod_; + imethod->transformed = FALSE; +} + +static void +copy_imethod_for_frame (InterpFrame *frame) +{ + InterpMethod *copy = (InterpMethod *) m_method_alloc0 (frame->imethod->method, sizeof (InterpMethod)); + memcpy (copy, frame->imethod, sizeof (InterpMethod)); + copy->next_jit_code_hash = NULL; /* we don't want that in our copy */ + frame->imethod = copy; + /* Note: The copy will be around until the method is unloaded. Ideally we + * would reclaim its memory when the corresponding InterpFrame is popped. + */ +} + +static void +metadata_update_backup_frames (MonoThreadInfo *info, InterpFrame *frame) +{ + while (frame) { + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_METADATA_UPDATE, "threadinfo=%p, copy imethod for method=%s", info, mono_method_full_name (frame->imethod->method, 1)); + copy_imethod_for_frame (frame); + frame = frame->parent; + } +} + +static void +metadata_update_prepare_to_invalidate (void) +{ + /* (1) make a copy of imethod for every interpframe that is on the stack, + * so we do not invalidate currently running methods */ + + FOREACH_THREAD_EXCLUDE (info, MONO_THREAD_INFO_FLAGS_NO_GC) { + if (!info || !info->jit_data) + continue; + + MonoLMF *lmf = info->jit_data->lmf; + while (lmf) { + if (((gsize) lmf->previous_lmf) & 2) { + MonoLMFExt *ext = (MonoLMFExt *) lmf; + if (ext->kind == MONO_LMFEXT_INTERP_EXIT || ext->kind == MONO_LMFEXT_INTERP_EXIT_WITH_CTX) { + InterpFrame *frame = ext->interp_exit_data; + metadata_update_backup_frames (info, frame); + } + } + lmf = (MonoLMF *)(((gsize) lmf->previous_lmf) & ~3); + } + } FOREACH_THREAD_END + + /* (2) invalidate all the registered imethods */ +} + +static void +interp_invalidate_transformed (void) +{ + gboolean need_stw_restart = FALSE; + if (mono_metadata_has_updates ()) { + mono_stop_world (MONO_THREAD_INFO_FLAGS_NO_GC); + metadata_update_prepare_to_invalidate (); + need_stw_restart = TRUE; + } + + GPtrArray *alcs = mono_alc_get_all (); + + if (alcs) { + MonoAssemblyLoadContext* alc; + for (guint i = 0; i < alcs->len; ++i) { + alc = (MonoAssemblyLoadContext*)g_ptr_array_index (alcs, i); + MonoJitMemoryManager *jit_mm = (MonoJitMemoryManager*)(alc->memory_manager->runtime_info); + + jit_mm_lock (jit_mm); + mono_internal_hash_table_apply (&jit_mm->interp_code_hash, invalidate_transform, NULL); + jit_mm_unlock (jit_mm); + } + + g_ptr_array_free (alcs, TRUE); + } + + if (need_stw_restart) + mono_restart_world (MONO_THREAD_INFO_FLAGS_NO_GC); +} + + +typedef struct { + MonoJitInfo **jit_info_array; + gint size; + gint next; +} InterpCopyJitInfoFuncUserData; + +static void +interp_copy_jit_info_func (gpointer imethod, gpointer user_data) +{ + InterpCopyJitInfoFuncUserData *data = (InterpCopyJitInfoFuncUserData*)user_data; + if (data->next < data->size) + data->jit_info_array [data->next++] = ((InterpMethod *)imethod)->jinfo; +} + +static void +interp_jit_info_foreach (InterpJitInfoFunc func, gpointer user_data) +{ + GPtrArray *alcs = mono_alc_get_all (); + + if (alcs) { + MonoAssemblyLoadContext* alc; + for (guint i = 0; i < alcs->len; ++i) { + alc = (MonoAssemblyLoadContext*)g_ptr_array_index (alcs, i); + MonoJitMemoryManager *jit_mm = (MonoJitMemoryManager*)(alc->memory_manager->runtime_info); + InterpCopyJitInfoFuncUserData copy_jit_info_data; + // Can't keep memory manager lock while iterating and calling callback since it might take other locks + // causing poential deadlock situations. Instead, create copy of interpreter imethod jinfo pointers into + // plain array and use pointers from array when when running callbacks. + copy_jit_info_data.size = mono_atomic_load_i32 (&(jit_mm->interp_code_hash.num_entries)); + copy_jit_info_data.next = 0; + copy_jit_info_data.jit_info_array = (MonoJitInfo**) g_new (MonoJitInfo*, copy_jit_info_data.size); + if (copy_jit_info_data.jit_info_array) { + jit_mm_lock (jit_mm); + mono_internal_hash_table_apply (&jit_mm->interp_code_hash, interp_copy_jit_info_func, ©_jit_info_data); + jit_mm_unlock (jit_mm); + } + + if (copy_jit_info_data.jit_info_array) { + for (int j = 0; j < copy_jit_info_data.next; ++j) + func (copy_jit_info_data.jit_info_array [j], user_data); + g_free (copy_jit_info_data.jit_info_array); + } + } + + g_ptr_array_free (alcs, TRUE); + } +} + +static gboolean +interp_sufficient_stack (gsize size) +{ + ThreadContext *context = get_context (); + + return (context->stack_pointer + size) < (context->stack_start + INTERP_STACK_SIZE); +} + +static void +interp_cleanup (void) +{ +#if COUNT_OPS + interp_print_op_count (); +#endif +#if PROFILE_INTERP + interp_print_method_counts (); +#endif +} + +#undef MONO_EE_CALLBACK +#define MONO_EE_CALLBACK(ret, name, sig) interp_ ## name, + +static const MonoEECallbacks mono_interp_callbacks = { + MONO_EE_CALLBACKS +}; + +void +mono_ee_interp_init (const char *opts) +{ + g_assert (mono_ee_api_version () == MONO_EE_API_VERSION); + g_assert (!interp_init_done); + interp_init_done = TRUE; + + mono_native_tls_alloc (&thread_context_id, NULL); + set_context (NULL); + + interp_parse_options (opts); + /* Don't do any optimizations if running under debugger */ + if (mini_get_debug_options ()->mdb_optimizations) + mono_interp_opt = 0; + mono_interp_transform_init (); + + if (mono_interp_opt & INTERP_OPT_TIERING) + mono_interp_tiering_init (); + + mini_install_interp_callbacks (&mono_interp_callbacks); + +#ifdef HOST_WASI + debugger_enabled = mini_get_debug_options ()->mdb_optimizations; +#endif +} + +#ifdef HOST_BROWSER +EMSCRIPTEN_KEEPALIVE void +mono_jiterp_stackval_to_data (MonoType *type, stackval *val, void *data) +{ + stackval_to_data (type, val, data, FALSE); +} + +EMSCRIPTEN_KEEPALIVE void +mono_jiterp_stackval_from_data (MonoType *type, stackval *result, const void *data) +{ + stackval_from_data (type, result, data, FALSE); +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_get_arg_offset (InterpMethod *imethod, MonoMethodSignature *sig, int index) +{ + return get_arg_offset_fast (imethod, sig, index); +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_overflow_check_i4 (gint32 lhs, gint32 rhs, int opcode) +{ + switch (opcode) { + case MINT_MUL_OVF_I4: + if (CHECK_MUL_OVERFLOW (lhs, rhs)) + return 1; + break; + case MINT_ADD_OVF_I4: + if (CHECK_ADD_OVERFLOW (lhs, rhs)) + return 1; + break; + } + + return 0; +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_overflow_check_u4 (guint32 lhs, guint32 rhs, int opcode) +{ + switch (opcode) { + case MINT_MUL_OVF_UN_I4: + if (CHECK_MUL_OVERFLOW_UN (lhs, rhs)) + return 1; + break; + case MINT_ADD_OVF_UN_I4: + if (CHECK_ADD_OVERFLOW_UN (lhs, rhs)) + return 1; + break; + } + + return 0; +} + +EMSCRIPTEN_KEEPALIVE void +mono_jiterp_ld_delegate_method_ptr (gpointer *destination, MonoDelegate **source) +{ + MonoDelegate *del = *source; + if (!del->interp_method) { + /* Not created from interpreted code */ + g_assert (del->method); + del->interp_method = mono_interp_get_imethod (del->method); + } else if (((InterpMethod*)del->interp_method)->optimized_imethod) { + del->interp_method = ((InterpMethod*)del->interp_method)->optimized_imethod; + } + g_assert (del->interp_method); + *destination = imethod_to_ftnptr (del->interp_method, FALSE); +} + +MONO_ALWAYS_INLINE void +mono_jiterp_check_pending_unwind (ThreadContext *context) +{ + if (need_native_unwind (context)) { + // FIXME: Caller needs to check this + if (mono_opt_llvm_emulate_unwind) + g_assert_not_reached (); + mono_llvm_start_native_unwind (); + } +} + +MONO_ALWAYS_INLINE void * +mono_jiterp_get_context (void) +{ + return get_context (); +} + +MONO_ALWAYS_INLINE gpointer +mono_jiterp_frame_data_allocator_alloc (FrameDataAllocator *stack, InterpFrame *frame, int size) +{ + return frame_data_allocator_alloc(stack, frame, size); +} + +// NOTE: This does not perform a null check and passing a null object or klass is an error! +MONO_ALWAYS_INLINE gboolean +mono_jiterp_isinst (MonoObject* object, MonoClass* klass) +{ + return mono_interp_isinst (object, klass); +} + +// after interp_entry_prologue the wrapper will set up all the argument values +// in the correct place and compute the stack offset, then it passes that in to this +// function in order to actually enter the interpreter and process the return value +EMSCRIPTEN_KEEPALIVE void +mono_jiterp_interp_entry (JiterpEntryData *_data, void *res) +{ + JiterpEntryDataHeader header; + MonoType *type; + + // Copy the scratch buffer into a local variable. This is necessary for us to be + // reentrant-safe because mono_interp_exec_method could end up hitting the trampoline + // again + g_assert(_data); + header = _data->header; + + g_assert(header.rmethod); + g_assert(header.rmethod->method); + + stackval *sp = (stackval*)header.context->stack_pointer; + + InterpFrame frame = {0}; + frame.imethod = header.rmethod; + frame.stack = sp; + frame.retval = sp; + + int params_size = get_arg_offset_fast (header.rmethod, NULL, header.params_count); + // g_printf ("jiterp_interp_entry: rmethod=%d, params_count=%d, params_size=%d\n", header.rmethod, header.params_count, params_size); + header.context->stack_pointer = (guchar*)ALIGN_TO ((guchar*)sp + params_size, MINT_STACK_ALIGNMENT); + + g_assert (header.context->stack_pointer < header.context->stack_end); + + MONO_ENTER_GC_UNSAFE; + mono_interp_exec_method (&frame, header.context, NULL); + MONO_EXIT_GC_UNSAFE; + + header.context->stack_pointer = (guchar*)sp; + + if (header.rmethod->needs_thread_attach) + mono_threads_detach_coop (header.orig_domain, &header.attach_cookie); + + mono_jiterp_check_pending_unwind (header.context); + + if (mono_llvm_only) { + if (header.context->has_resume_state) { + /* The exception will be handled in a frame above us */ + mono_llvm_start_native_unwind (); + return; + } + } else { + g_assert (!header.context->has_resume_state); + } + + // The return value is at the bottom of the stack, after the locals space + type = header.rmethod->rtype; + if (type->type != MONO_TYPE_VOID) + mono_jiterp_stackval_to_data (type, frame.stack, res); +} + +EMSCRIPTEN_KEEPALIVE volatile size_t * +mono_jiterp_get_polling_required_address () +{ + return &mono_polling_required; +} + +EMSCRIPTEN_KEEPALIVE void +mono_jiterp_prof_enter (InterpFrame *frame, guint16 *ip) +{ + guint16 flag = ip [1]; + INTERP_PROFILER_RAISE(enter, ENTER); +} + +EMSCRIPTEN_KEEPALIVE void +mono_jiterp_prof_samplepoint (InterpFrame *frame, guint16 *ip) +{ + guint16 flag = ip [1]; + INTERP_PROFILER_RAISE(samplepoint, SAMPLEPOINT); +} + +EMSCRIPTEN_KEEPALIVE void +mono_jiterp_prof_leave (InterpFrame *frame, guint16 *ip) +{ + gboolean is_void = ip [0] == MINT_PROF_EXIT_VOID; + guint16 flag = is_void ? ip [1] : ip [2]; + INTERP_PROFILER_RAISE(leave, LEAVE); +} + +EMSCRIPTEN_KEEPALIVE void +mono_jiterp_do_safepoint (InterpFrame *frame, guint16 *ip) +{ + do_safepoint (frame, get_context(), ip); +} + +EMSCRIPTEN_KEEPALIVE gpointer +mono_jiterp_imethod_to_ftnptr (InterpMethod *imethod) +{ + return imethod_to_ftnptr (imethod, FALSE); +} + +EMSCRIPTEN_KEEPALIVE void +mono_jiterp_enum_hasflag (MonoClass *klass, gint32 *dest, stackval *sp1, stackval *sp2) +{ + *dest = mono_interp_enum_hasflag (sp1, sp2, klass); +} + +EMSCRIPTEN_KEEPALIVE gpointer +mono_jiterp_get_simd_intrinsic (int arity, int index) +{ +#ifdef INTERP_ENABLE_SIMD + switch (arity) { + case 1: + return interp_simd_p_p_table [index]; + case 2: + return interp_simd_p_pp_table [index]; + case 3: + return interp_simd_p_ppp_table [index]; + default: + g_assert_not_reached(); + } +#else + g_assert_not_reached(); +#endif +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_get_simd_opcode (int arity, int index) +{ +#ifdef INTERP_ENABLE_SIMD + switch (arity) { + case 1: + return interp_simd_p_p_wasm_opcode_table [index]; + case 2: + return interp_simd_p_pp_wasm_opcode_table [index]; + case 3: + return interp_simd_p_ppp_wasm_opcode_table [index]; + default: + g_assert_not_reached(); + } +#else + g_assert_not_reached(); +#endif +} + +#define JITERP_OPINFO_TYPE_NAME 0 +#define JITERP_OPINFO_TYPE_LENGTH 1 +#define JITERP_OPINFO_TYPE_SREGS 2 +#define JITERP_OPINFO_TYPE_DREGS 3 +#define JITERP_OPINFO_TYPE_OPARGTYPE 4 + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_get_opcode_info (int opcode, int type) +{ + g_assert ((opcode >= 0) && (opcode <= MINT_LASTOP)); + switch (type) { + case JITERP_OPINFO_TYPE_NAME: + // We know this conversion is safe because wasm pointers are 32 bits + return (int)(void*)(mono_interp_opname (opcode)); + case JITERP_OPINFO_TYPE_LENGTH: + return mono_interp_oplen [opcode]; + case JITERP_OPINFO_TYPE_SREGS: + return mono_interp_op_sregs [opcode]; + case JITERP_OPINFO_TYPE_DREGS: + return mono_interp_op_dregs [opcode]; + case JITERP_OPINFO_TYPE_OPARGTYPE: + return mono_interp_opargtype [opcode]; + default: + g_assert_not_reached(); + } +} + +EMSCRIPTEN_KEEPALIVE int +mono_jiterp_placeholder_trace (void *_frame, void *pLocals, JiterpreterCallInfo *cinfo, const guint16 *ip) +{ + // If this is hit it most likely indicates that a trace is being invoked from a thread + // that has not jitted it yet. We want to jit it on this thread and install it at the + // correct location in the function pointer table. + const JiterpreterOpcode *opcode = (const JiterpreterOpcode *)ip; + if (opcode->relative_fn_ptr) { + int fn_ptr = opcode->relative_fn_ptr + mono_jiterp_first_trace_fn_ptr; + InterpFrame *frame = _frame; + MonoMethod *method = frame->imethod->method; + const guint16 *start_of_body = frame->imethod->jinfo->code_start; + int size_of_body = frame->imethod->jinfo->code_size; + // g_printf ("mono_jiterp_placeholder_trace index=%d fn_ptr=%d ip=%x\n", opcode->trace_index, fn_ptr, ip); + mono_interp_tier_prepare_jiterpreter ( + frame, method, ip, (gint32)opcode->trace_index, + start_of_body, size_of_body, frame->imethod->is_verbose, + fn_ptr + ); + } + // advance past the enter/monitor opcode and return to interp + return mono_interp_oplen [MINT_TIER_ENTER_JITERPRETER] * 2; +} + +EMSCRIPTEN_KEEPALIVE void +mono_jiterp_placeholder_jit_call (void *ret_sp, void *sp, void *ftndesc, gboolean *thrown) +{ + // g_print ("mono_jiterp_placeholder_jit_call\n"); + *thrown = 999; +} + +EMSCRIPTEN_KEEPALIVE void * +mono_jiterp_get_interp_entry_func (int table) +{ + g_assert (table <= JITERPRETER_TABLE_LAST); + + if (table >= JITERPRETER_TABLE_INTERP_ENTRY_INSTANCE_RET_0) + return entry_funcs_instance_ret [table - JITERPRETER_TABLE_INTERP_ENTRY_INSTANCE_RET_0]; + else if (table >= JITERPRETER_TABLE_INTERP_ENTRY_INSTANCE_0) + return entry_funcs_instance [table - JITERPRETER_TABLE_INTERP_ENTRY_INSTANCE_0]; + else if (table >= JITERPRETER_TABLE_INTERP_ENTRY_STATIC_RET_0) + return entry_funcs_static_ret [table - JITERPRETER_TABLE_INTERP_ENTRY_STATIC_RET_0]; + else if (table >= JITERPRETER_TABLE_INTERP_ENTRY_STATIC_0) + return entry_funcs_static [table - JITERPRETER_TABLE_INTERP_ENTRY_STATIC_0]; + else + g_assert_not_reached (); +} + +#endif diff --git a/src/mono/mono/mini/interp/interp-pinvoke.h b/src/mono/mono/mini/interp/interp-pinvoke.h new file mode 100644 index 00000000000000..d3520debe50cba --- /dev/null +++ b/src/mono/mono/mini/interp/interp-pinvoke.h @@ -0,0 +1,26 @@ +#ifndef __MONO_MINI_INTERP_PINVOKE_H__ +#define __MONO_MINI_INTERP_PINVOKE_H__ + +#include +#include +#include "mintops.h" +#include "interp-internals.h" +#include "interp-frame.h" +#include "interp-mono.h" +#include "interp-mono-abi.h" +#include "interp-mono-abi-pinvoke.h" + +extern MONO_NO_OPTIMIZATION MONO_NEVER_INLINE gpointer +ves_pinvoke_method ( + InterpMethod *imethod, + MonoMethodSignature *sig, + MonoFuncV addr, + ThreadContext *context, + InterpFrame *parent_frame, + stackval *ret_sp, + stackval *sp, + gboolean save_last_error, + gpointer *cache, + gboolean *gc_transitions); + +#endif From 616b1f2b13b6ad66010af4a1a741f88d82cc19d7 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 19 Jun 2025 15:17:14 +0100 Subject: [PATCH 075/209] separated and compiling ves_pinvoke --- src/mono/mono/mini/interp/interp-pinvoke.c | 560 +++++---------------- src/mono/mono/mini/interp/interp-pinvoke.h | 5 +- 2 files changed, 127 insertions(+), 438 deletions(-) diff --git a/src/mono/mono/mini/interp/interp-pinvoke.c b/src/mono/mono/mini/interp/interp-pinvoke.c index 02a8c18993b329..25749c15b44c9f 100644 --- a/src/mono/mono/mini/interp/interp-pinvoke.c +++ b/src/mono/mono/mini/interp/interp-pinvoke.c @@ -65,6 +65,7 @@ #include "mintops.h" #include "interp-intrins.h" #include "interp-icalls.h" +#include "interp-pinvoke.h" #include "tiering.h" #ifdef INTERP_ENABLE_SIMD @@ -251,13 +252,7 @@ reinit_frame (InterpFrame *frame, InterpFrame *parent, InterpMethod *imethod, gp #define STACK_ADD_BYTES(sp,bytes) ((stackval*)((char*)(sp) + ALIGN_TO(bytes, MINT_STACK_SLOT_SIZE))) #define STACK_SUB_BYTES(sp,bytes) ((stackval*)((char*)(sp) - ALIGN_TO(bytes, MINT_STACK_SLOT_SIZE))) -/* - * List of classes whose methods will be executed by transitioning to JITted code. - * Used for testing. - */ -GSList *mono_interp_jit_classes; -/* Optimizations enabled with interpreter */ -int mono_interp_opt = INTERP_OPT_DEFAULT; + /* If TRUE, interpreted code will be interrupted at function entry/backward branches */ static gboolean ss_enabled; @@ -345,7 +340,7 @@ debug_enter (InterpFrame *frame, int *tracing) #else -int mono_interp_traceopt = 0; + #define DEBUG_LEAVE() #endif @@ -456,13 +451,6 @@ need_native_unwind (ThreadContext *context) return context->has_resume_state && !context->handler_frame; } -void -mono_interp_error_cleanup (MonoError* error) -{ - mono_error_cleanup (error); /* FIXME: don't swallow the error */ - error_init_reuse (error); // one instruction, so this function is good inline candidate -} - static InterpMethod* lookup_imethod (MonoMethod *method) { @@ -476,66 +464,6 @@ lookup_imethod (MonoMethod *method) return imethod; } -InterpMethod* -mono_interp_get_imethod (MonoMethod *method) -{ - InterpMethod *imethod; - MonoMethodSignature *sig; - MonoJitMemoryManager *jit_mm = jit_mm_for_method (method); - int i; - - jit_mm_lock (jit_mm); - imethod = (InterpMethod*)mono_internal_hash_table_lookup (&jit_mm->interp_code_hash, method); - jit_mm_unlock (jit_mm); - if (imethod) - return imethod; - - sig = mono_method_signature_internal (method); - - if (method->dynamic) - imethod = (InterpMethod*)mono_dyn_method_alloc0 (method, sizeof (InterpMethod)); - else - imethod = (InterpMethod*)m_method_alloc0 (method, sizeof (InterpMethod)); - imethod->method = method; - imethod->param_count = sig->param_count; - imethod->hasthis = sig->hasthis; - imethod->vararg = sig->call_convention == MONO_CALL_VARARG; - imethod->code_type = IMETHOD_CODE_UNKNOWN; - // This flag allows us to optimize out the interp_entry 'is this a delegate invoke' checks - imethod->is_invoke = (m_class_get_parent (method->klass) == mono_defaults.multicastdelegate_class) && !strcmp(method->name, "Invoke"); - // always optimize code if tiering is disabled - // always optimize wrappers - if (!mono_interp_tiering_enabled () || method->wrapper_type != MONO_WRAPPER_NONE || (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)) - imethod->optimized = TRUE; - - if (imethod->method->string_ctor) - imethod->rtype = m_class_get_byval_arg (mono_defaults.string_class); - else - imethod->rtype = mini_get_underlying_type (sig->ret); - if (method->dynamic) - imethod->param_types = (MonoType**)mono_dyn_method_alloc0 (method, sizeof (MonoType*) * sig->param_count); - else - imethod->param_types = (MonoType**)m_method_alloc0 (method, sizeof (MonoType*) * sig->param_count); - for (i = 0; i < sig->param_count; ++i) - imethod->param_types [i] = mini_get_underlying_type (sig->params [i]); - - if (!imethod->optimized && mono_interp_pgo_should_tier_method (method)) - imethod->optimized = TRUE; - - jit_mm_lock (jit_mm); - InterpMethod *old_imethod; - if (!((old_imethod = mono_internal_hash_table_lookup (&jit_mm->interp_code_hash, method)))) { - mono_internal_hash_table_insert (&jit_mm->interp_code_hash, method, imethod); - } else { - imethod = old_imethod; /* leak the newly allocated InterpMethod to the mempool */ - } - jit_mm_unlock (jit_mm); - - imethod->prof_flags = mono_profiler_get_call_instrumentation_flags (imethod->method); - - return imethod; -} - #if defined (MONO_CROSS_COMPILE) || defined (HOST_WASM) #define INTERP_PUSH_LMF_WITH_CTX_BODY(ext, exit_label) \ (ext).kind = MONO_LMFEXT_INTERP_EXIT; @@ -1188,6 +1116,92 @@ imethod_alloc0 (InterpMethod *imethod, guint size) return m_method_alloc0 (imethod->method, size); } +void log_mono_type(MonoType* type) { + if (!type) { + MH_LOG("MonoType: NULL"); + return; + } + + const char* type_str = NULL; + + switch (type->type) { + case MONO_TYPE_VOID: type_str = "VOID"; break; + case MONO_TYPE_BOOLEAN: type_str = "BOOLEAN"; break; + case MONO_TYPE_CHAR: type_str = "CHAR"; break; + case MONO_TYPE_I1: type_str = "I1"; break; + case MONO_TYPE_U1: type_str = "U1"; break; + case MONO_TYPE_I2: type_str = "I2"; break; + case MONO_TYPE_U2: type_str = "U2"; break; + case MONO_TYPE_I4: type_str = "I4"; break; + case MONO_TYPE_U4: type_str = "U4"; break; + case MONO_TYPE_I8: type_str = "I8"; break; + case MONO_TYPE_U8: type_str = "U8"; break; + case MONO_TYPE_R4: type_str = "R4"; break; + case MONO_TYPE_R8: type_str = "R8"; break; + case MONO_TYPE_STRING: type_str = "STRING"; break; + case MONO_TYPE_PTR: type_str = "PTR"; break; + case MONO_TYPE_BYREF: type_str = "BYREF"; break; + case MONO_TYPE_VALUETYPE: type_str = "VALUETYPE"; break; + case MONO_TYPE_CLASS: type_str = "CLASS"; break; + case MONO_TYPE_ARRAY: type_str = "ARRAY"; break; + case MONO_TYPE_SZARRAY: type_str = "SZARRAY"; break; + case MONO_TYPE_OBJECT: type_str = "OBJECT"; break; + case MONO_TYPE_VAR: type_str = "VAR"; break; + case MONO_TYPE_MVAR: type_str = "MVAR"; break; + case MONO_TYPE_GENERICINST: type_str = "GENERICINST"; break; + case MONO_TYPE_FNPTR: type_str = "FNPTR"; break; + default: type_str = "UNKNOWN"; break; + } + + MH_LOG("MonoType: %s", type_str); +} + +void log_mono_type_enum(MonoTypeEnum type_enum) { + const char* type_str = NULL; + + switch (type_enum) { + case MONO_TYPE_END: type_str = "END"; break; + case MONO_TYPE_VOID: type_str = "VOID"; break; + case MONO_TYPE_BOOLEAN: type_str = "BOOLEAN"; break; + case MONO_TYPE_CHAR: type_str = "CHAR"; break; + case MONO_TYPE_I1: type_str = "I1"; break; + case MONO_TYPE_U1: type_str = "U1"; break; + case MONO_TYPE_I2: type_str = "I2"; break; + case MONO_TYPE_U2: type_str = "U2"; break; + case MONO_TYPE_I4: type_str = "I4"; break; + case MONO_TYPE_U4: type_str = "U4"; break; + case MONO_TYPE_I8: type_str = "I8"; break; + case MONO_TYPE_U8: type_str = "U8"; break; + case MONO_TYPE_R4: type_str = "R4"; break; + case MONO_TYPE_R8: type_str = "R8"; break; + case MONO_TYPE_STRING: type_str = "STRING"; break; + case MONO_TYPE_PTR: type_str = "PTR"; break; + case MONO_TYPE_BYREF: type_str = "BYREF"; break; + case MONO_TYPE_VALUETYPE: type_str = "VALUETYPE"; break; + case MONO_TYPE_CLASS: type_str = "CLASS"; break; + case MONO_TYPE_VAR: type_str = "VAR"; break; + case MONO_TYPE_ARRAY: type_str = "ARRAY"; break; + case MONO_TYPE_GENERICINST: type_str = "GENERICINST"; break; + case MONO_TYPE_TYPEDBYREF: type_str = "TYPEDBYREF"; break; + case MONO_TYPE_I: type_str = "I"; break; + case MONO_TYPE_U: type_str = "U"; break; + case MONO_TYPE_FNPTR: type_str = "FNPTR"; break; + case MONO_TYPE_OBJECT: type_str = "OBJECT"; break; + case MONO_TYPE_SZARRAY: type_str = "SZARRAY"; break; + case MONO_TYPE_MVAR: type_str = "MVAR"; break; + case MONO_TYPE_CMOD_REQD: type_str = "CMOD_REQD"; break; + case MONO_TYPE_CMOD_OPT: type_str = "CMOD_OPT"; break; + case MONO_TYPE_INTERNAL: type_str = "INTERNAL"; break; + case MONO_TYPE_MODIFIER: type_str = "MODIFIER"; break; + case MONO_TYPE_SENTINEL: type_str = "SENTINEL"; break; + case MONO_TYPE_PINNED: type_str = "PINNED"; break; + case MONO_TYPE_ENUM: type_str = "MONO_TYPE_ENUM"; break; + default: type_str = "UNKNOWN"; break; + } + + MH_LOG("MonoTypeEnum: %s (0x%x)", type_str, (int)type_enum); +} + static guint32* initialize_arg_offsets (InterpMethod *imethod, MonoMethodSignature *csig) { @@ -1202,21 +1216,27 @@ initialize_arg_offsets (InterpMethod *imethod, MonoMethodSignature *csig) int arg_count = sig->hasthis + sig->param_count; guint32 *arg_offsets = (guint32*)imethod_alloc0 (imethod, (arg_count + 1) * sizeof (int)); int index = 0, offset = 0; - + MH_LOG_INDENT(); + MH_LOG("Getting arg offsets"); if (sig->hasthis) { arg_offsets [index++] = 0; offset = MINT_STACK_SLOT_SIZE; } - + MH_LOG_INDENT(); for (int i = 0; i < sig->param_count; i++) { MonoType *type = sig->params [i]; int size, align; + log_mono_type(type); + log_mono_type_enum(mono_mint_type (type)); + MH_LOG_INDENT(); size = mono_interp_type_size (type, mono_mint_type (type), &align); - + MH_LOG("calculated size: %d - note includes alignment of %d", size, align); + MH_LOG_UNINDENT(); offset = ALIGN_TO (offset, align); arg_offsets [index++] = offset; offset += size; } + MH_LOG_UNINDENT(); // This index is not associated with an actual argument, we just store the offset // for convenience in order to easily determine the size of the param area used arg_offsets [index] = ALIGN_TO (offset, MINT_STACK_SLOT_SIZE); @@ -1224,6 +1244,7 @@ initialize_arg_offsets (InterpMethod *imethod, MonoMethodSignature *csig) mono_memory_write_barrier (); /* If this fails, the new one is leaked in the mem manager */ mono_atomic_cas_ptr ((gpointer*)&imethod->arg_offsets, arg_offsets, NULL); + MH_LOG_UNINDENT(); return imethod->arg_offsets; } @@ -1440,7 +1461,7 @@ get_build_args_from_sig_info (MonoMemoryManager *mem_manager, MonoMethodSignatur return info; } - +#define DEBUG_MH 1 static void build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, BuildArgsFromSigInfo *info, InterpFrame *frame) { @@ -1473,53 +1494,61 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui else margs->fargs = g_malloc0 (sizeof (double) * margs->flen); } - + MH_LOG_INDENT(); + MH_LOG("setting args from signature: %s", mono_signature_full_name (sig)); for (int i = 0; i < sig->param_count; i++) { + MH_LOG_INDENT(); guint32 offset = get_arg_offset (frame->imethod, sig, i); stackval *sp_arg = STACK_ADD_BYTES (frame->stack, offset); switch (info->arg_types [i]) { case PINVOKE_ARG_INT: margs->iargs [int_i] = sp_arg->data.p; -#if DEBUG_INTERP + MH_LOG("PINVOKE_ARG_INT"); +#if DEBUG_INTERP g_print ("build_args_from_sig: margs->iargs [%d]: %p (frame @ %d)\n", int_i, margs->iargs [int_i], i); #endif int_i++; break; case PINVOKE_ARG_R4: * (float *) &(margs->fargs [int_f]) = sp_arg->data.f_r4; -#if DEBUG_INTERP + MH_LOG("PINVOKE_ARG_R4"); +#if DEBUG_INTERP g_print ("build_args_from_sig: margs->fargs [%d]: %p (%f) (frame @ %d)\n", int_f, margs->fargs [int_f], margs->fargs [int_f], i); #endif int_f ++; break; case PINVOKE_ARG_R8: margs->fargs [int_f] = sp_arg->data.f; -#if DEBUG_INTERP + MH_LOG("PINVOKE_ARG_R8"); +#if DEBUG_INTERP g_print ("build_args_from_sig: margs->fargs [%d]: %p (%f) (frame @ %d)\n", int_f, margs->fargs [int_f], margs->fargs [int_f], i); #endif int_f ++; break; case PINVOKE_ARG_VTYPE: margs->iargs [int_i] = sp_arg; -#if DEBUG_INTERP + MH_LOG("PINVOKE_ARG_VTYPE"); +#if DEBUG_INTERP g_print ("build_args_from_sig: margs->iargs [%d]: %p (vt) (frame @ %d)\n", int_i, margs->iargs [int_i], i); #endif int_i++; break; case PINVOKE_ARG_SCALAR_VTYPE: + MH_LOG("PINVOKE_ARG_SCALAR_VTYPE"); margs->iargs [int_i] = *(gpointer*)sp_arg; -#if DEBUG_INTERP +#if DEBUG_INTERP g_print ("build_args_from_sig: margs->iargs [%d]: %p (vt) (frame @ %d)\n", int_i, margs->iargs [int_i], i); #endif int_i++; break; case PINVOKE_ARG_INT_PAIR: { + MH_LOG("PINVOKE_ARG_INT_PAIR"); margs->iargs [int_i] = (gpointer)(gssize)sp_arg->data.pair.lo; int_i++; margs->iargs [int_i] = (gpointer)(gssize)sp_arg->data.pair.hi; -#if DEBUG_INTERP +#if DEBUG_INTERP g_print ("build_args_from_sig: margs->iargs [%d/%d]: 0x%016" PRIx64 ", hi=0x%08x lo=0x%08x (frame @ %d)\n", int_i - 1, int_i, *((guint64 *) &margs->iargs [int_i - 1]), sp_arg->data.pair.hi, sp_arg->data.pair.lo, i); #endif int_i++; @@ -1529,10 +1558,15 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui g_assert_not_reached (); break; } + MH_LOG_UNINDENT(); } + MH_LOG_UNINDENT(); + MH_LOG_INDENT(); + MH_LOG("setting ret_pinvoke_type: %s", mono_signature_full_name (sig)); switch (info->ret_pinvoke_type) { case PINVOKE_ARG_WASM_VALUETYPE_RESULT: + MH_LOG("PINVOKE_ARG_WASM_VALUETYPE_RESULT"); // We pass the return value address in arg0 so fill it in, we already // reserved space for it earlier. g_assert (frame->retval); @@ -1542,23 +1576,29 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui margs->is_float_ret = 0; break; case PINVOKE_ARG_INT: + MH_LOG("PINVOKE_ARG_INT"); margs->retval = (gpointer*)frame->retval; margs->is_float_ret = 0; break; case PINVOKE_ARG_R8: + MH_LOG("PINVOKE_ARG_R8"); margs->retval = (gpointer*)frame->retval; margs->is_float_ret = 1; break; case PINVOKE_ARG_NONE: + MH_LOG("PINVOKE_ARG_NONE"); margs->retval = NULL; break; default: g_assert_not_reached (); break; } + MH_LOG_UNINDENT(); } #endif + + static void interp_frame_arg_to_data (MonoInterpFrameHandle frame, MonoMethodSignature *sig, int index, gpointer data) { @@ -2536,12 +2576,6 @@ init_jit_call_info (InterpMethod *rmethod, MonoError *error) rmethod->jit_call_info = cinfo; } -#if HOST_BROWSER -EMSCRIPTEN_KEEPALIVE void -mono_jiterp_register_jit_call_thunk (void *cinfo, WasmJitCallThunk thunk) { - ((JitCallInfo*)cinfo)->jiterp_thunk = thunk; -} -#endif static MONO_NEVER_INLINE void do_jit_call (ThreadContext *context, stackval *ret_sp, stackval *sp, InterpFrame *frame, InterpMethod *rmethod, MonoError *error) @@ -8828,345 +8862,3 @@ static const MonoEECallbacks mono_interp_callbacks = { MONO_EE_CALLBACKS }; -void -mono_ee_interp_init (const char *opts) -{ - g_assert (mono_ee_api_version () == MONO_EE_API_VERSION); - g_assert (!interp_init_done); - interp_init_done = TRUE; - - mono_native_tls_alloc (&thread_context_id, NULL); - set_context (NULL); - - interp_parse_options (opts); - /* Don't do any optimizations if running under debugger */ - if (mini_get_debug_options ()->mdb_optimizations) - mono_interp_opt = 0; - mono_interp_transform_init (); - - if (mono_interp_opt & INTERP_OPT_TIERING) - mono_interp_tiering_init (); - - mini_install_interp_callbacks (&mono_interp_callbacks); - -#ifdef HOST_WASI - debugger_enabled = mini_get_debug_options ()->mdb_optimizations; -#endif -} - -#ifdef HOST_BROWSER -EMSCRIPTEN_KEEPALIVE void -mono_jiterp_stackval_to_data (MonoType *type, stackval *val, void *data) -{ - stackval_to_data (type, val, data, FALSE); -} - -EMSCRIPTEN_KEEPALIVE void -mono_jiterp_stackval_from_data (MonoType *type, stackval *result, const void *data) -{ - stackval_from_data (type, result, data, FALSE); -} - -EMSCRIPTEN_KEEPALIVE int -mono_jiterp_get_arg_offset (InterpMethod *imethod, MonoMethodSignature *sig, int index) -{ - return get_arg_offset_fast (imethod, sig, index); -} - -EMSCRIPTEN_KEEPALIVE int -mono_jiterp_overflow_check_i4 (gint32 lhs, gint32 rhs, int opcode) -{ - switch (opcode) { - case MINT_MUL_OVF_I4: - if (CHECK_MUL_OVERFLOW (lhs, rhs)) - return 1; - break; - case MINT_ADD_OVF_I4: - if (CHECK_ADD_OVERFLOW (lhs, rhs)) - return 1; - break; - } - - return 0; -} - -EMSCRIPTEN_KEEPALIVE int -mono_jiterp_overflow_check_u4 (guint32 lhs, guint32 rhs, int opcode) -{ - switch (opcode) { - case MINT_MUL_OVF_UN_I4: - if (CHECK_MUL_OVERFLOW_UN (lhs, rhs)) - return 1; - break; - case MINT_ADD_OVF_UN_I4: - if (CHECK_ADD_OVERFLOW_UN (lhs, rhs)) - return 1; - break; - } - - return 0; -} - -EMSCRIPTEN_KEEPALIVE void -mono_jiterp_ld_delegate_method_ptr (gpointer *destination, MonoDelegate **source) -{ - MonoDelegate *del = *source; - if (!del->interp_method) { - /* Not created from interpreted code */ - g_assert (del->method); - del->interp_method = mono_interp_get_imethod (del->method); - } else if (((InterpMethod*)del->interp_method)->optimized_imethod) { - del->interp_method = ((InterpMethod*)del->interp_method)->optimized_imethod; - } - g_assert (del->interp_method); - *destination = imethod_to_ftnptr (del->interp_method, FALSE); -} - -MONO_ALWAYS_INLINE void -mono_jiterp_check_pending_unwind (ThreadContext *context) -{ - if (need_native_unwind (context)) { - // FIXME: Caller needs to check this - if (mono_opt_llvm_emulate_unwind) - g_assert_not_reached (); - mono_llvm_start_native_unwind (); - } -} - -MONO_ALWAYS_INLINE void * -mono_jiterp_get_context (void) -{ - return get_context (); -} - -MONO_ALWAYS_INLINE gpointer -mono_jiterp_frame_data_allocator_alloc (FrameDataAllocator *stack, InterpFrame *frame, int size) -{ - return frame_data_allocator_alloc(stack, frame, size); -} - -// NOTE: This does not perform a null check and passing a null object or klass is an error! -MONO_ALWAYS_INLINE gboolean -mono_jiterp_isinst (MonoObject* object, MonoClass* klass) -{ - return mono_interp_isinst (object, klass); -} - -// after interp_entry_prologue the wrapper will set up all the argument values -// in the correct place and compute the stack offset, then it passes that in to this -// function in order to actually enter the interpreter and process the return value -EMSCRIPTEN_KEEPALIVE void -mono_jiterp_interp_entry (JiterpEntryData *_data, void *res) -{ - JiterpEntryDataHeader header; - MonoType *type; - - // Copy the scratch buffer into a local variable. This is necessary for us to be - // reentrant-safe because mono_interp_exec_method could end up hitting the trampoline - // again - g_assert(_data); - header = _data->header; - - g_assert(header.rmethod); - g_assert(header.rmethod->method); - - stackval *sp = (stackval*)header.context->stack_pointer; - - InterpFrame frame = {0}; - frame.imethod = header.rmethod; - frame.stack = sp; - frame.retval = sp; - - int params_size = get_arg_offset_fast (header.rmethod, NULL, header.params_count); - // g_printf ("jiterp_interp_entry: rmethod=%d, params_count=%d, params_size=%d\n", header.rmethod, header.params_count, params_size); - header.context->stack_pointer = (guchar*)ALIGN_TO ((guchar*)sp + params_size, MINT_STACK_ALIGNMENT); - - g_assert (header.context->stack_pointer < header.context->stack_end); - - MONO_ENTER_GC_UNSAFE; - mono_interp_exec_method (&frame, header.context, NULL); - MONO_EXIT_GC_UNSAFE; - - header.context->stack_pointer = (guchar*)sp; - - if (header.rmethod->needs_thread_attach) - mono_threads_detach_coop (header.orig_domain, &header.attach_cookie); - - mono_jiterp_check_pending_unwind (header.context); - - if (mono_llvm_only) { - if (header.context->has_resume_state) { - /* The exception will be handled in a frame above us */ - mono_llvm_start_native_unwind (); - return; - } - } else { - g_assert (!header.context->has_resume_state); - } - - // The return value is at the bottom of the stack, after the locals space - type = header.rmethod->rtype; - if (type->type != MONO_TYPE_VOID) - mono_jiterp_stackval_to_data (type, frame.stack, res); -} - -EMSCRIPTEN_KEEPALIVE volatile size_t * -mono_jiterp_get_polling_required_address () -{ - return &mono_polling_required; -} - -EMSCRIPTEN_KEEPALIVE void -mono_jiterp_prof_enter (InterpFrame *frame, guint16 *ip) -{ - guint16 flag = ip [1]; - INTERP_PROFILER_RAISE(enter, ENTER); -} - -EMSCRIPTEN_KEEPALIVE void -mono_jiterp_prof_samplepoint (InterpFrame *frame, guint16 *ip) -{ - guint16 flag = ip [1]; - INTERP_PROFILER_RAISE(samplepoint, SAMPLEPOINT); -} - -EMSCRIPTEN_KEEPALIVE void -mono_jiterp_prof_leave (InterpFrame *frame, guint16 *ip) -{ - gboolean is_void = ip [0] == MINT_PROF_EXIT_VOID; - guint16 flag = is_void ? ip [1] : ip [2]; - INTERP_PROFILER_RAISE(leave, LEAVE); -} - -EMSCRIPTEN_KEEPALIVE void -mono_jiterp_do_safepoint (InterpFrame *frame, guint16 *ip) -{ - do_safepoint (frame, get_context(), ip); -} - -EMSCRIPTEN_KEEPALIVE gpointer -mono_jiterp_imethod_to_ftnptr (InterpMethod *imethod) -{ - return imethod_to_ftnptr (imethod, FALSE); -} - -EMSCRIPTEN_KEEPALIVE void -mono_jiterp_enum_hasflag (MonoClass *klass, gint32 *dest, stackval *sp1, stackval *sp2) -{ - *dest = mono_interp_enum_hasflag (sp1, sp2, klass); -} - -EMSCRIPTEN_KEEPALIVE gpointer -mono_jiterp_get_simd_intrinsic (int arity, int index) -{ -#ifdef INTERP_ENABLE_SIMD - switch (arity) { - case 1: - return interp_simd_p_p_table [index]; - case 2: - return interp_simd_p_pp_table [index]; - case 3: - return interp_simd_p_ppp_table [index]; - default: - g_assert_not_reached(); - } -#else - g_assert_not_reached(); -#endif -} - -EMSCRIPTEN_KEEPALIVE int -mono_jiterp_get_simd_opcode (int arity, int index) -{ -#ifdef INTERP_ENABLE_SIMD - switch (arity) { - case 1: - return interp_simd_p_p_wasm_opcode_table [index]; - case 2: - return interp_simd_p_pp_wasm_opcode_table [index]; - case 3: - return interp_simd_p_ppp_wasm_opcode_table [index]; - default: - g_assert_not_reached(); - } -#else - g_assert_not_reached(); -#endif -} - -#define JITERP_OPINFO_TYPE_NAME 0 -#define JITERP_OPINFO_TYPE_LENGTH 1 -#define JITERP_OPINFO_TYPE_SREGS 2 -#define JITERP_OPINFO_TYPE_DREGS 3 -#define JITERP_OPINFO_TYPE_OPARGTYPE 4 - -EMSCRIPTEN_KEEPALIVE int -mono_jiterp_get_opcode_info (int opcode, int type) -{ - g_assert ((opcode >= 0) && (opcode <= MINT_LASTOP)); - switch (type) { - case JITERP_OPINFO_TYPE_NAME: - // We know this conversion is safe because wasm pointers are 32 bits - return (int)(void*)(mono_interp_opname (opcode)); - case JITERP_OPINFO_TYPE_LENGTH: - return mono_interp_oplen [opcode]; - case JITERP_OPINFO_TYPE_SREGS: - return mono_interp_op_sregs [opcode]; - case JITERP_OPINFO_TYPE_DREGS: - return mono_interp_op_dregs [opcode]; - case JITERP_OPINFO_TYPE_OPARGTYPE: - return mono_interp_opargtype [opcode]; - default: - g_assert_not_reached(); - } -} - -EMSCRIPTEN_KEEPALIVE int -mono_jiterp_placeholder_trace (void *_frame, void *pLocals, JiterpreterCallInfo *cinfo, const guint16 *ip) -{ - // If this is hit it most likely indicates that a trace is being invoked from a thread - // that has not jitted it yet. We want to jit it on this thread and install it at the - // correct location in the function pointer table. - const JiterpreterOpcode *opcode = (const JiterpreterOpcode *)ip; - if (opcode->relative_fn_ptr) { - int fn_ptr = opcode->relative_fn_ptr + mono_jiterp_first_trace_fn_ptr; - InterpFrame *frame = _frame; - MonoMethod *method = frame->imethod->method; - const guint16 *start_of_body = frame->imethod->jinfo->code_start; - int size_of_body = frame->imethod->jinfo->code_size; - // g_printf ("mono_jiterp_placeholder_trace index=%d fn_ptr=%d ip=%x\n", opcode->trace_index, fn_ptr, ip); - mono_interp_tier_prepare_jiterpreter ( - frame, method, ip, (gint32)opcode->trace_index, - start_of_body, size_of_body, frame->imethod->is_verbose, - fn_ptr - ); - } - // advance past the enter/monitor opcode and return to interp - return mono_interp_oplen [MINT_TIER_ENTER_JITERPRETER] * 2; -} - -EMSCRIPTEN_KEEPALIVE void -mono_jiterp_placeholder_jit_call (void *ret_sp, void *sp, void *ftndesc, gboolean *thrown) -{ - // g_print ("mono_jiterp_placeholder_jit_call\n"); - *thrown = 999; -} - -EMSCRIPTEN_KEEPALIVE void * -mono_jiterp_get_interp_entry_func (int table) -{ - g_assert (table <= JITERPRETER_TABLE_LAST); - - if (table >= JITERPRETER_TABLE_INTERP_ENTRY_INSTANCE_RET_0) - return entry_funcs_instance_ret [table - JITERPRETER_TABLE_INTERP_ENTRY_INSTANCE_RET_0]; - else if (table >= JITERPRETER_TABLE_INTERP_ENTRY_INSTANCE_0) - return entry_funcs_instance [table - JITERPRETER_TABLE_INTERP_ENTRY_INSTANCE_0]; - else if (table >= JITERPRETER_TABLE_INTERP_ENTRY_STATIC_RET_0) - return entry_funcs_static_ret [table - JITERPRETER_TABLE_INTERP_ENTRY_STATIC_RET_0]; - else if (table >= JITERPRETER_TABLE_INTERP_ENTRY_STATIC_0) - return entry_funcs_static [table - JITERPRETER_TABLE_INTERP_ENTRY_STATIC_0]; - else - g_assert_not_reached (); -} - -#endif diff --git a/src/mono/mono/mini/interp/interp-pinvoke.h b/src/mono/mono/mini/interp/interp-pinvoke.h index d3520debe50cba..b426e91b90df48 100644 --- a/src/mono/mono/mini/interp/interp-pinvoke.h +++ b/src/mono/mono/mini/interp/interp-pinvoke.h @@ -5,10 +5,7 @@ #include #include "mintops.h" #include "interp-internals.h" -#include "interp-frame.h" -#include "interp-mono.h" -#include "interp-mono-abi.h" -#include "interp-mono-abi-pinvoke.h" + extern MONO_NO_OPTIMIZATION MONO_NEVER_INLINE gpointer ves_pinvoke_method ( From c93912748020ae117ea8bcd3cdb32cb3a0a0737c Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 19 Jun 2025 15:17:40 +0100 Subject: [PATCH 076/209] move ves_pinvoke --- src/mono/mono/mini/interp/interp.c | 148 +---------------------------- 1 file changed, 4 insertions(+), 144 deletions(-) diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index be13660cd6906e..246647bbd3a3cd 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -65,6 +65,7 @@ #include "mintops.h" #include "interp-intrins.h" #include "interp-icalls.h" +#include "interp-pinvoke.h" #include "tiering.h" #ifdef INTERP_ENABLE_SIMD @@ -1632,150 +1633,6 @@ typedef struct { } WasmPInvokeCacheData; #endif -/* MONO_NO_OPTIMIZATION is needed due to usage of INTERP_PUSH_LMF_WITH_CTX. */ -#ifdef _MSC_VER -#pragma optimize ("", off) -#endif -static MONO_NO_OPTIMIZATION MONO_NEVER_INLINE gpointer -ves_pinvoke_method ( - InterpMethod *imethod, - MonoMethodSignature *sig, - MonoFuncV addr, - ThreadContext *context, - InterpFrame *parent_frame, - stackval *ret_sp, - stackval *sp, - gboolean save_last_error, - gpointer *cache, - gboolean *gc_transitions) -{ - InterpFrame frame = {0}; - frame.parent = parent_frame; - frame.imethod = imethod; - frame.stack = sp; - frame.retval = ret_sp; - - MonoLMFExt ext; - gpointer args; - - MONO_REQ_GC_UNSAFE_MODE; - -#ifdef HOST_WASM - /* - * Use a per-signature entry function. - * Cache it in imethod->data_items. - * This is GC safe. - */ - MonoPIFunc entry_func = NULL; - WasmPInvokeCacheData *cache_data = (WasmPInvokeCacheData*)*cache; - if (!cache_data) { - cache_data = g_new0 (WasmPInvokeCacheData, 1); - cache_data->entry_func = (MonoPIFunc)mono_wasm_get_interp_to_native_trampoline (sig); - cache_data->call_info = get_build_args_from_sig_info (get_default_mem_manager (), sig); - mono_memory_barrier (); - *cache = cache_data; - } - entry_func = cache_data->entry_func; -#else - static MonoPIFunc entry_func = NULL; - if (!entry_func) { - MONO_ENTER_GC_UNSAFE; -#ifdef MONO_ARCH_HAS_NO_PROPER_MONOCTX - ERROR_DECL (error); - entry_func = (MonoPIFunc) mono_jit_compile_method_jit_only (mini_get_interp_lmf_wrapper ("mono_interp_to_native_trampoline", (gpointer) mono_interp_to_native_trampoline), error); - mono_error_assert_ok (error); -#else - entry_func = get_interp_to_native_trampoline (); -#endif - mono_memory_barrier (); - MONO_EXIT_GC_UNSAFE; - } -#endif - - if (save_last_error) { - mono_marshal_clear_last_error (); - } - -#ifdef MONO_ARCH_HAVE_INTERP_PINVOKE_TRAMP - gpointer call_info = *cache; - - if (!call_info) { - call_info = mono_arch_get_interp_native_call_info (get_default_mem_manager (), sig); - mono_memory_barrier (); - *cache = call_info; - } - CallContext ccontext; - mono_arch_set_native_call_context_args (&ccontext, &frame, sig, call_info); - args = &ccontext; -#else - -#ifdef HOST_WASM - BuildArgsFromSigInfo *call_info = cache_data->call_info; -#else - BuildArgsFromSigInfo *call_info = NULL; - g_assert_not_reached (); -#endif - - InterpMethodArguments margs; - memset (&margs, 0, sizeof (InterpMethodArguments)); - build_args_from_sig (&margs, sig, call_info, &frame); - args = &margs; -#endif - - INTERP_PUSH_LMF_WITH_CTX (&frame, ext, exit_pinvoke); - - if (*gc_transitions) { - MONO_ENTER_GC_SAFE; - entry_func ((gpointer) addr, args); - MONO_EXIT_GC_SAFE; - *gc_transitions = FALSE; - } else { - entry_func ((gpointer) addr, args); - } - - if (save_last_error) - mono_marshal_set_last_error (); - interp_pop_lmf (&ext); - -#ifdef MONO_ARCH_HAVE_INTERP_PINVOKE_TRAMP -#ifdef MONO_ARCH_HAVE_SWIFTCALL - if (mono_method_signature_has_ext_callconv (sig, MONO_EXT_CALLCONV_SWIFTCALL)) { - int arg_index = -1; - gpointer data = mono_arch_get_swift_error (&ccontext, sig, &arg_index); - - // Perform an indirect store at arg_index stack location - if (arg_index >= 0) { - g_assert (data); - stackval *result = (stackval*) STACK_ADD_BYTES (frame.stack, get_arg_offset (frame.imethod, sig, arg_index)); - *(gpointer*)result->data.p = *(gpointer*)data; - } - } -#endif - if (!context->has_resume_state) { - mono_arch_get_native_call_context_ret (&ccontext, &frame, sig, call_info); - } - - g_free (ccontext.stack); -#else - // Only the vt address has been returned, we need to copy the entire content on interp stack - if (!context->has_resume_state && MONO_TYPE_ISSTRUCT (call_info->ret_mono_type)) { - if (call_info->ret_pinvoke_type != PINVOKE_ARG_WASM_VALUETYPE_RESULT) - stackval_from_data (call_info->ret_mono_type, frame.retval, (char*)frame.retval->data.p, sig->pinvoke && !sig->marshalling_disabled); - } - - if (margs.iargs != margs.iargs_buf) - g_free (margs.iargs); - if (margs.fargs != margs.fargs_buf) - g_free (margs.fargs); -#endif - goto exit_pinvoke; // prevent unused label warning in some configurations -exit_pinvoke: - return NULL; -} -#ifdef _MSC_VER -#pragma optimize ("", on) -#endif - /* * interp_init_delegate: * @@ -8001,7 +7858,10 @@ interp_parse_options (const char *options) opt = INTERP_OPT_SIMD; #if HOST_BROWSER else if (strncmp (arg, "jiterp", 6) == 0) + { + #pragma message ("ENABLING JITERPRETER!!") opt = INTERP_OPT_JITERPRETER; + } #endif else if (strncmp (arg, "ssa", 3) == 0) opt = INTERP_OPT_SSA; From e48477a82620ca81f3922e5647bf79e69db171c8 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 23 Jun 2025 09:18:20 +0100 Subject: [PATCH 077/209] WASM signature updates Now generating ILL cookie for an int f(struct, struct) but not creating the matching wasm_invoke_ill function yet --- src/mono/mono/metadata/mh_log.h | 1 - src/mono/mono/mini/CMakeLists.txt | 2 ++ src/mono/mono/mini/aot-runtime-wasm.c | 38 ++++++++++++++++++---- src/mono/mono/mini/interp/interp-pinvoke.c | 23 ++++++++++++- src/mono/mono/mini/interp/transform.c | 9 +++++ 5 files changed, 65 insertions(+), 8 deletions(-) diff --git a/src/mono/mono/metadata/mh_log.h b/src/mono/mono/metadata/mh_log.h index 0b7feb19a19eb7..3124aa70bda3c2 100644 --- a/src/mono/mono/metadata/mh_log.h +++ b/src/mono/mono/metadata/mh_log.h @@ -1,7 +1,6 @@ #pragma once #include -#pragma message("Defining MH_LOG") static int MH_LOG_indent_level = 0; diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index d2b9177996ffeb..9ae1ac96d9e0b3 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -241,6 +241,8 @@ set(interp_sources interp/interp-intrins.c interp/interp-icalls.h interp/interp-icalls.c + interp/interp-pinvoke.h + interp/interp-pinvoke.c interp/mintops.h interp/mintops.c interp/transform.c diff --git a/src/mono/mono/mini/aot-runtime-wasm.c b/src/mono/mono/mini/aot-runtime-wasm.c index 1687088b16597e..46b801e5786b66 100644 --- a/src/mono/mono/mini/aot-runtime-wasm.c +++ b/src/mono/mono/mini/aot-runtime-wasm.c @@ -11,7 +11,7 @@ #include #include "interp/interp.h" #include "aot-runtime.h" - +#include #ifdef HOST_WASM static char @@ -25,7 +25,7 @@ type_to_c (MonoType *t, gboolean *is_byref_return) return 'I'; handle_enum: - switch (t->type) { + switch (t->type) { case MONO_TYPE_BOOLEAN: case MONO_TYPE_CHAR: case MONO_TYPE_I1: @@ -34,6 +34,7 @@ type_to_c (MonoType *t, gboolean *is_byref_return) case MONO_TYPE_U2: case MONO_TYPE_I4: case MONO_TYPE_U4: +#if SIZEOF_VOID_P == 4 case MONO_TYPE_I: case MONO_TYPE_U: case MONO_TYPE_PTR: @@ -41,14 +42,28 @@ type_to_c (MonoType *t, gboolean *is_byref_return) case MONO_TYPE_CLASS: case MONO_TYPE_OBJECT: case MONO_TYPE_STRING: +#else + case MONO_TYPE_I: + case MONO_TYPE_U: +#endif return 'I'; case MONO_TYPE_R4: return 'F'; case MONO_TYPE_R8: return 'D'; break; +#if SIZEOF_VOID_P == 4 + case MONO_TYPE_I8: + case MONO_TYPE_U8: +#else case MONO_TYPE_I8: case MONO_TYPE_U8: + case MONO_TYPE_PTR: + case MONO_TYPE_SZARRAY: + case MONO_TYPE_CLASS: + case MONO_TYPE_OBJECT: + case MONO_TYPE_STRING: +#endif return 'L'; case MONO_TYPE_VOID: return 'V'; @@ -68,8 +83,11 @@ type_to_c (MonoType *t, gboolean *is_byref_return) if (is_byref_return) *is_byref_return = 1; - + #if SIZEOF_VOID_P == 4 return 'I'; + #else + return 'L'; + #endif } case MONO_TYPE_GENERICINST: { // This previously erroneously used m_type_data_get_klass which isn't legal for genericinst, we have to use class_from_mono_type_internal @@ -122,7 +140,12 @@ mono_wasm_install_interp_to_native_callback (MonoWasmNativeToInterpCallback cb) int mono_wasm_interp_method_args_get_iarg (InterpMethodArguments *margs, int i) { - return (int)(gssize)margs->iargs[i]; + MH_LOG_INDENT(); + MH_LOG("Looking for iarg[%d]", i); + int retval = (int)(gssize)margs->iargs[i]; + MH_LOG("Got %d", retval); + MH_LOG_UNINDENT(); + return retval; } gint64 @@ -154,7 +177,10 @@ compare_icall_tramp (const void *key, const void *elem) { return strcmp (key, *(void**)elem); } - +static void +logCookie (int c_count, const char *cookie) { + MH_LOG("WASM ICALL COOKIE: %s\n", cookie); +} gpointer mono_wasm_get_interp_to_native_trampoline (MonoMethodSignature *sig) { @@ -182,7 +208,7 @@ mono_wasm_get_interp_to_native_trampoline (MonoMethodSignature *sig) for (int i = 0; i < sig->param_count; ++i) { cookie [offset + i] = type_to_c (sig->params [i], NULL); } - + logCookie(c_count, cookie); void *p = mono_wasm_interp_to_native_callback (cookie); if (!p) g_error ("CANNOT HANDLE INTERP ICALL SIG %s\n", cookie); diff --git a/src/mono/mono/mini/interp/interp-pinvoke.c b/src/mono/mono/mini/interp/interp-pinvoke.c index 25749c15b44c9f..56319bd1f2819d 100644 --- a/src/mono/mono/mini/interp/interp-pinvoke.c +++ b/src/mono/mono/mini/interp/interp-pinvoke.c @@ -1202,6 +1202,27 @@ void log_mono_type_enum(MonoTypeEnum type_enum) { MH_LOG("MonoTypeEnum: %s (0x%x)", type_str, (int)type_enum); } +static void log_mint_type(int value) +{ + const char* type_str = NULL; + switch (value) + { +case MINT_TYPE_I1: type_str = "MINT_TYPE_I1";break; +case MINT_TYPE_U1: type_str = "MINT_TYPE_U1";break; +case MINT_TYPE_I2: type_str = "MINT_TYPE_I2";break; +case MINT_TYPE_U2: type_str = "MINT_TYPE_U2";break; +case MINT_TYPE_I4: type_str = "MINT_TYPE_I4";break; +case MINT_TYPE_I8: type_str = "MINT_TYPE_I8";break; +case MINT_TYPE_R4: type_str = "MINT_TYPE_R4";break; +case MINT_TYPE_R8: type_str = "MINT_TYPE_R8";break; +case MINT_TYPE_O : type_str = "MINT_TYPE_O";break; +case MINT_TYPE_VT: type_str = "MINT_TYPE_VT";break; +case MINT_TYPE_VOID: type_str = "MINT_TYPE_VOID"; break; + default: + type_str = "UNKNOWN"; + } + MH_LOG("MintType: %s (%d)", type_str, value); +} static guint32* initialize_arg_offsets (InterpMethod *imethod, MonoMethodSignature *csig) { @@ -1227,7 +1248,7 @@ initialize_arg_offsets (InterpMethod *imethod, MonoMethodSignature *csig) MonoType *type = sig->params [i]; int size, align; log_mono_type(type); - log_mono_type_enum(mono_mint_type (type)); + log_mint_type(mono_mint_type (type)); MH_LOG_INDENT(); size = mono_interp_type_size (type, mono_mint_type (type), &align); MH_LOG("calculated size: %d - note includes alignment of %d", size, align); diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index 573408c1e85e05..915934f0481368 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -311,11 +311,20 @@ mono_mint_type (MonoType *type) case MONO_TYPE_I4: case MONO_TYPE_U4: return MINT_TYPE_I4; +#if SIZEOF_VOID_P == 8 + case MONO_TYPE_I: + case MONO_TYPE_U: + return MINT_TYPE_I4; // should still be I4 on 64 bit platforms. + case MONO_TYPE_PTR: + case MONO_TYPE_FNPTR: + return MINT_TYPE_I; // will be I8 on 64-bit platforms, I4 otherwise +#else case MONO_TYPE_I: case MONO_TYPE_U: case MONO_TYPE_PTR: case MONO_TYPE_FNPTR: return MINT_TYPE_I; +#endif case MONO_TYPE_R4: return MINT_TYPE_R4; case MONO_TYPE_I8: From f9c1c662cedd58b6577fb4bffe9d84c6a2839abd Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 23 Jun 2025 11:58:50 +0100 Subject: [PATCH 078/209] use L for signature mapping of pointers conditional on WasmEnableMemory64 --- src/tasks/WasmAppBuilder/SignatureMapper.cs | 7 ++++++- src/tasks/WasmAppBuilder/WasmAppBuilder.csproj | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/tasks/WasmAppBuilder/SignatureMapper.cs b/src/tasks/WasmAppBuilder/SignatureMapper.cs index 3638e432f0ce38..622b0ba2fb0a6a 100644 --- a/src/tasks/WasmAppBuilder/SignatureMapper.cs +++ b/src/tasks/WasmAppBuilder/SignatureMapper.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; @@ -38,8 +38,13 @@ internal static class SignatureMapper nameof(Single) => 'F', nameof(Double) => 'D', // FIXME: These will need to be L for wasm64 +#if SignatureMappingWasm64 + nameof(IntPtr) => 'L', + nameof(UIntPtr) => 'L', +#else nameof(IntPtr) => 'I', nameof(UIntPtr) => 'I', +#endif "Void" => 'V', _ => null }; diff --git a/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj b/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj index addcf203c6a2eb..7dba68c68c81ee 100644 --- a/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj +++ b/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj @@ -11,6 +11,10 @@ true + + $(DefineConstants);SignatureMappingWasm64 + + From c149c31134ca82248dcac8e07a4419f522cf946b Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 23 Jun 2025 11:59:18 +0100 Subject: [PATCH 079/209] build settings I haven't committed previously --- src/mono/sample/wasm/DefaultBrowserSample.targets | 10 +++++++++- src/mono/sample/wasm/Directory.Build.targets | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mono/sample/wasm/DefaultBrowserSample.targets b/src/mono/sample/wasm/DefaultBrowserSample.targets index 108e7fb9b6da7c..e85a3672b46f3d 100644 --- a/src/mono/sample/wasm/DefaultBrowserSample.targets +++ b/src/mono/sample/wasm/DefaultBrowserSample.targets @@ -12,9 +12,17 @@ $(TestArchiveRoot)chromeonly/ $(TestArchiveTestsRoot)$(OSPlatformConfig)/ $(EmccFlags) -sUSE_CLOSURE_COMPILER=1 -sMEMORY64 - true + true + true + + false + <_WasmDevel>true + <_EmccOptimizationFlagDefault>-O0 + + + diff --git a/src/mono/sample/wasm/Directory.Build.targets b/src/mono/sample/wasm/Directory.Build.targets index 548a6ce828c8d0..ab8a87e043d73d 100644 --- a/src/mono/sample/wasm/Directory.Build.targets +++ b/src/mono/sample/wasm/Directory.Build.targets @@ -86,7 +86,7 @@ - + From b375ca348cbde1e7d61c6e33d958f7503bb36557 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 23 Jun 2025 12:55:08 +0100 Subject: [PATCH 080/209] Increment arg count by 1 for long values if wasm64 --- src/tasks/WasmAppBuilder/InterpToNativeGenerator.cs | 4 ++++ src/tasks/WasmAppBuilder/WasmAppBuilder.csproj | 1 + 2 files changed, 5 insertions(+) diff --git a/src/tasks/WasmAppBuilder/InterpToNativeGenerator.cs b/src/tasks/WasmAppBuilder/InterpToNativeGenerator.cs index c231e70be88f1c..cbbe2cdfcaf574 100644 --- a/src/tasks/WasmAppBuilder/InterpToNativeGenerator.cs +++ b/src/tasks/WasmAppBuilder/InterpToNativeGenerator.cs @@ -149,7 +149,11 @@ public string Emit(char c) break; case 'L': argIndex = iarg; +#if Interp2NativeWasm64 + iarg += 1; +#else iarg += 2; +#endif break; case 'F': case 'D': diff --git a/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj b/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj index 7dba68c68c81ee..997cef9b6bd551 100644 --- a/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj +++ b/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj @@ -13,6 +13,7 @@ $(DefineConstants);SignatureMappingWasm64 + $(DefineConstants);Interp2NativeWasm64 From 03d2a962df26ee9035f77f6e7d3457cbf110e9cf Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 23 Jun 2025 13:12:46 +0100 Subject: [PATCH 081/209] Logging and ues L for MONO_TYPE_GENERICINST --- src/mono/mono/mini/aot-runtime-wasm.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/mono/mono/mini/aot-runtime-wasm.c b/src/mono/mono/mini/aot-runtime-wasm.c index 46b801e5786b66..deed5a448dcf0f 100644 --- a/src/mono/mono/mini/aot-runtime-wasm.c +++ b/src/mono/mono/mini/aot-runtime-wasm.c @@ -101,8 +101,11 @@ type_to_c (MonoType *t, gboolean *is_byref_return) return 'S'; } - + #if SIZEOF_VOID_P == 4 return 'I'; + #else + return 'L'; + #endif } default: g_warning ("CANT TRANSLATE %s", mono_type_full_name (t)); @@ -123,10 +126,21 @@ typedef union { static gint64 get_long_arg (InterpMethodArguments *margs, int idx) { + #if SIZEOF_VOID_P == 4 interp_pair p; + MH_LOG_INDENT(); + MH_LOG("Getting long arg [%d]", idx); p.pair.lo = (gint32)(gssize)margs->iargs [idx]; p.pair.hi = (gint32)(gssize)margs->iargs [idx + 1]; + MH_LOG("Got pair %d %d", p.pair.lo, p.pair.hi); + MH_LOG_UNINDENT(); return p.l; + #else + MH_LOG_INDENT(); + MH_LOG("Getting long arg [%d]: %ld", idx, (gint64)(gssize)margs->iargs [idx]); + MH_LOG_UNINDENT(); + return (gint64)(gssize)margs->iargs [idx]; + #endif } static MonoWasmNativeToInterpCallback mono_wasm_interp_to_native_callback; From da0fc430ae8a93622159e80f533c9e49147286c7 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 23 Jun 2025 19:58:49 +0100 Subject: [PATCH 082/209] Provide bigint option for table growth --- .../browser/runtime/jiterpreter-support.ts | 34 ++++++++++++++----- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/src/mono/browser/runtime/jiterpreter-support.ts b/src/mono/browser/runtime/jiterpreter-support.ts index 5bd39ede34563b..2bf7dfd35566c3 100644 --- a/src/mono/browser/runtime/jiterpreter-support.ts +++ b/src/mono/browser/runtime/jiterpreter-support.ts @@ -2136,29 +2136,41 @@ function updateOptions () { } function jiterpreter_allocate_table (type: JiterpreterTable, base: number, size: number, fillValue: Function) { + const wasmTable = getWasmFunctionTable(); - const firstIndex = base, lastIndex = firstIndex + size - 1; + const firstIndex = base; + const isWasm64 = typeof wasmTable.length === "bigint"; + const lastIndex = isWasm64 + ? BigInt(firstIndex) + BigInt(size - 1) + : firstIndex + (size - 1); + const firstIndexWasm = isWasm64 ? BigInt(firstIndex) : firstIndex; mono_assert(lastIndex < wasmTable.length, () => `Last index out of range: ${lastIndex} >= ${wasmTable.length}`); // HACK: Always populate the first slot - wasmTable.set(firstIndex, fillValue); + try { + // wasm64 requires bigint, but types expect number + (wasmTable.set as any)(firstIndexWasm, fillValue); + } catch (e) { + wasmTable.set(firstIndex, fillValue); + } // In threaded builds we need to populate all the reserved slots with safe placeholder functions // This operation is expensive in v8, so avoid doing it in single-threaded builds (which SHOULD // be safe, since it was previously not necessary) if (WasmEnableThreads) { // HACK: If possible, we want to copy any backing state associated with the first placeholder item, // so that additional work doesn't have to be done by the runtime for the following table sets - const preparedValue = wasmTable.get(firstIndex); - for (let i = firstIndex + 1; i <= lastIndex; i++) - wasmTable.set(i, preparedValue); + const preparedValue = (wasmTable.get as any)(firstIndexWasm); + for (let i = firstIndex + 1; i <= lastIndex; i++) { + const idx = isWasm64 ? BigInt(i) : i; + (wasmTable.set as any)(idx, preparedValue); + } } - cwraps.mono_jiterp_initialize_table(type, firstIndex, lastIndex); - return base + size; + cwraps.mono_jiterp_initialize_table(type, Number(firstIndex), Number(lastIndex)); + return Number(isWasm64 ? (BigInt(base) + BigInt(size)) : Number(base) + Number(size)); } // a single js worker might end up hosting multiple managed threads over its lifetime. // we need to ensure we only ever initialize tables once on each js worker. let jiterpreter_tables_allocated = false; - export function jiterpreter_allocate_tables () { if (jiterpreter_tables_allocated) return; @@ -2177,7 +2189,11 @@ export function jiterpreter_allocate_tables () { wasmTable = getWasmFunctionTable(); let base = wasmTable.length; const beforeGrow = performance.now(); - wasmTable.grow(totalSize); + try { + (wasmTable.grow as any)(BigInt(totalSize)); + } catch (e) { + wasmTable.grow(totalSize); + } const afterGrow = performance.now(); if (options.enableStats) mono_log_info(`Allocated ${totalSize} function table entries for jiterpreter, bringing total table size to ${wasmTable.length}`); From c347311d1621163aeebc265c5c6882ee103a69cc Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 24 Jun 2025 06:51:03 +0100 Subject: [PATCH 083/209] Another few cases dealt with manually Will bring in generated code next. --- src/mono/mono/mini/interp/interp-icalls.c | 61 +++++++++++++++++------ 1 file changed, 45 insertions(+), 16 deletions(-) diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index 6b548a0cf34f53..8c39c5663cda5c 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -351,18 +351,35 @@ do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval break; } case MINT_ICALLSIG_PPP_V: { - typedef void (*T)(gpointer,gpointer,gpointer); - T func = (T)ptr; - MH_LOG("Param count is %d, ptr is %p", sig->param_count, ptr); - - func (sp [0].data.p, sp [1].data.p, sp [2].data.p); + if (!strcmp(sigTest, "848_V")) + { + typedef void (*T)(I8,I4,I8); + T func = (T)ptr; + func (sp [0].data.p, sp [1].data.i, sp [2].data.p); + } + else + { + typedef void (*T)(gpointer,gpointer,gpointer); + T func = (T)ptr; + func (sp [0].data.p, sp [1].data.p, sp [2].data.p); + } break; } case MINT_ICALLSIG_PPP_P: { - typedef gpointer (*T)(gpointer,gpointer,gpointer); - T func = (T)ptr; - ret_sp->data.p = func (sp [0].data.p, sp [1].data.p, sp [2].data.p); - break; + if (!strcmp(sigTest, "884_8")) + { + typedef gpointer (*T)(I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func (sp [0].data.p, sp [1].data.p, sp [2].data.i); + break; + } + else + { + typedef gpointer (*T)(gpointer,gpointer,gpointer); + T func = (T)ptr; + ret_sp->data.p = func (sp [0].data.p, sp [1].data.p, sp [2].data.p); + break; + } } case MINT_ICALLSIG_PPPP_V: { typedef void (*T)(gpointer,gpointer,gpointer,gpointer); @@ -383,9 +400,18 @@ do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval break; } case MINT_ICALLSIG_PPPPP_P: { - typedef gpointer (*T)(gpointer,gpointer,gpointer,gpointer,gpointer); - T func = (T)ptr; - ret_sp->data.p = func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p, sp [4].data.p); + if (!strcmp(sigTest, "44444_4")) + { + typedef I4 (*T)(I4,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func (sp [0].data.i, sp [1].data.i, sp [2].data.i, sp [3].data.i, sp [4].data.i); + } + else + { + typedef gpointer (*T)(gpointer,gpointer,gpointer,gpointer,gpointer); + T func = (T)ptr; + ret_sp->data.p = func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p, sp [4].data.p); + } break; } case MINT_ICALLSIG_PPPPPP_V: { @@ -395,10 +421,13 @@ do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval break; } case MINT_ICALLSIG_PPPPPP_P: { - typedef gpointer (*T)(gpointer,gpointer,gpointer,gpointer,gpointer,gpointer); - T func = (T)ptr; - ret_sp->data.p = func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p, sp [4].data.p, sp [5].data.p); - break; + + typedef gpointer (*T)(gpointer,gpointer,gpointer,gpointer,gpointer,gpointer); + T func = (T)ptr; + ret_sp->data.p = func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p, sp [4].data.p, sp [5].data.p); + break; + + } default: g_assert_not_reached (); From 93a6c81899b9e7f69965120fcf78e298654dc6a8 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 24 Jun 2025 09:41:47 +0100 Subject: [PATCH 084/209] Add generated string based signature checks These will need improving (at least use elseif! but a switch statement is needed) --- src/mono/mono/mini/interp/interp-icalls.c | 2066 +++++++++++++++++++-- 1 file changed, 1912 insertions(+), 154 deletions(-) diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index 8c39c5663cda5c..c7eba3d0c1d662 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -189,6 +189,8 @@ static char * log_sig(MonoMethodSignature* sig) else offset += sprintf(buffer + offset, "E"); } + if (!sig->param_count) + offset += sprintf(buffer + offset, "V"); offset += sprintf(buffer + offset, "_%s", sig->ret->type == MONO_TYPE_VOID ? "V" : (interp_type_as_ptr4(sig->ret) ? "4" : "8")); MH_LOG("Signature: %s", buffer); return strdup(buffer); @@ -252,185 +254,1941 @@ do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval log_op(op); char* sigTest = log_sig(sig); switch (op) { - case MINT_ICALLSIG_V_V: { - typedef void (*T)(void); - T func = (T)ptr; - func (); - break; - } + case MINT_ICALLSIG_V_V: case MINT_ICALLSIG_V_P: { - if (interp_type_as_ptr4(sig->ret)) - { + if (!strcmp(sigTest,"V_V")) { + typedef void (*T)(void); + T func = (T)ptr; + func(); + }; + if (!strcmp(sigTest,"V_4")) { typedef I4 (*T)(void); T func = (T)ptr; - ret_sp->data.i = func (); // note return directly into .i field (union) - } - else - { + ret_sp->data.i = func(); + }; + if (!strcmp(sigTest,"V_8")) { typedef I8 (*T)(void); T func = (T)ptr; - ret_sp->data.p = func (); - } - - break; - } - case MINT_ICALLSIG_P_V: { - typedef void (*T)(gpointer); - T func = (T)ptr; - func (sp [0].data.p); - break; + ret_sp->data.p = func(); + }; + break; } + case MINT_ICALLSIG_P_V: case MINT_ICALLSIG_P_P: { - typedef gpointer (*T)(gpointer); - T func = (T)ptr; - ret_sp->data.p = func (sp [0].data.p); - break; - } - case MINT_ICALLSIG_PP_V: { - typedef void (*T)(gpointer,gpointer); - T func = (T)ptr; - func (sp [0].data.p, sp [1].data.p); - break; + if (!strcmp(sigTest,"4_V")) { + typedef void (*T)(I4); + T func = (T)ptr; + func(sp[0].data.i); + }; + if (!strcmp(sigTest,"8_V")) { + typedef void (*T)(I8); + T func = (T)ptr; + func(sp[0].data.p); + }; + if (!strcmp(sigTest,"4_4")) { + typedef I4 (*T)(I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i); + }; + if (!strcmp(sigTest,"8_4")) { + typedef I4 (*T)(I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p); + }; + if (!strcmp(sigTest,"4_8")) { + typedef I8 (*T)(I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i); + }; + if (!strcmp(sigTest,"8_8")) { + typedef I8 (*T)(I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p); + }; + break; } + case MINT_ICALLSIG_PP_V: case MINT_ICALLSIG_PP_P: { - if(interp_type_as_ptr4(sig->ret)) - { - if (interp_type_as_ptr4(sig->params[0]) && interp_type_as_ptr4(sig->params[1])) - { - typedef I4 (*T)(I4, I4); - T func = (T)ptr; - ret_sp->data.i = func (sp [0].data.i, sp [1].data.i); - } - else if (interp_type_as_ptr4(sig->params[0])) - { - typedef I4 (*T)(I4, I8); - T func = (T)ptr; - ret_sp->data.i = func (sp [0].data.i, sp [1].data.p); - } - else if (interp_type_as_ptr4(sig->params[1])) - { - typedef I4 (*T)(I8, I4); - T func = (T)ptr; - ret_sp->data.i = func (sp [0].data.p, sp [1].data.i); - } - else - { - typedef I4 (*T)(I8, I8); - T func = (T)ptr; - ret_sp->data.i = func (sp [0].data.p, sp [1].data.p); - } - } - else - { - if (interp_type_as_ptr4(sig->params[0]) && interp_type_as_ptr4(sig->params[1])) - { - typedef gpointer (*T)(I4, I4); - T func = (T)ptr; - ret_sp->data.p = func (sp [0].data.i, sp [1].data.i); - } - else if (interp_type_as_ptr4(sig->params[0])) - { - typedef gpointer (*T)(I4, I8); - T func = (T)ptr; - ret_sp->data.p = func (sp [0].data.i, sp [1].data.p); - } - else if (interp_type_as_ptr4(sig->params[1])) - { - typedef gpointer (*T)(I8, I4); - T func = (T)ptr; - ret_sp->data.p = func (sp [0].data.p, sp [1].data.i); - } - else - { - typedef gpointer (*T)(I8, I8); - T func = (T)ptr; - ret_sp->data.p = func (sp [0].data.p, sp [1].data.p); - } - } - - break; - } - case MINT_ICALLSIG_PPP_V: { - if (!strcmp(sigTest, "848_V")) - { - typedef void (*T)(I8,I4,I8); - T func = (T)ptr; - func (sp [0].data.p, sp [1].data.i, sp [2].data.p); - } - else - { - typedef void (*T)(gpointer,gpointer,gpointer); - T func = (T)ptr; - func (sp [0].data.p, sp [1].data.p, sp [2].data.p); - } - break; + if (!strcmp(sigTest,"44_V")) { + typedef void (*T)(I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i); + }; + if (!strcmp(sigTest,"48_V")) { + typedef void (*T)(I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p); + }; + if (!strcmp(sigTest,"84_V")) { + typedef void (*T)(I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i); + }; + if (!strcmp(sigTest,"88_V")) { + typedef void (*T)(I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p); + }; + if (!strcmp(sigTest,"44_4")) { + typedef I4 (*T)(I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i); + }; + if (!strcmp(sigTest,"48_4")) { + typedef I4 (*T)(I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p); + }; + if (!strcmp(sigTest,"84_4")) { + typedef I4 (*T)(I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i); + }; + if (!strcmp(sigTest,"88_4")) { + typedef I4 (*T)(I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p); + }; + if (!strcmp(sigTest,"44_8")) { + typedef I8 (*T)(I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i); + }; + if (!strcmp(sigTest,"48_8")) { + typedef I8 (*T)(I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p); + }; + if (!strcmp(sigTest,"84_8")) { + typedef I8 (*T)(I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i); + }; + if (!strcmp(sigTest,"88_8")) { + typedef I8 (*T)(I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p); + }; + break; } + case MINT_ICALLSIG_PPP_V: case MINT_ICALLSIG_PPP_P: { - if (!strcmp(sigTest, "884_8")) - { - typedef gpointer (*T)(I8,I8,I4); + if (!strcmp(sigTest,"444_V")) { + typedef void (*T)(I4,I4,I4); T func = (T)ptr; - ret_sp->data.p = func (sp [0].data.p, sp [1].data.p, sp [2].data.i); - break; - } - else - { - typedef gpointer (*T)(gpointer,gpointer,gpointer); + func(sp[0].data.i,sp[1].data.i,sp[2].data.i); + }; + if (!strcmp(sigTest,"448_V")) { + typedef void (*T)(I4,I4,I8); T func = (T)ptr; - ret_sp->data.p = func (sp [0].data.p, sp [1].data.p, sp [2].data.p); - break; - } - } - case MINT_ICALLSIG_PPPP_V: { - typedef void (*T)(gpointer,gpointer,gpointer,gpointer); - T func = (T)ptr; - func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p); - break; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p); + }; + if (!strcmp(sigTest,"484_V")) { + typedef void (*T)(I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i); + }; + if (!strcmp(sigTest,"488_V")) { + typedef void (*T)(I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p); + }; + if (!strcmp(sigTest,"844_V")) { + typedef void (*T)(I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i); + }; + if (!strcmp(sigTest,"848_V")) { + typedef void (*T)(I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p); + }; + if (!strcmp(sigTest,"884_V")) { + typedef void (*T)(I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i); + }; + if (!strcmp(sigTest,"888_V")) { + typedef void (*T)(I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p); + }; + if (!strcmp(sigTest,"444_4")) { + typedef I4 (*T)(I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i); + }; + if (!strcmp(sigTest,"448_4")) { + typedef I4 (*T)(I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p); + }; + if (!strcmp(sigTest,"484_4")) { + typedef I4 (*T)(I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i); + }; + if (!strcmp(sigTest,"488_4")) { + typedef I4 (*T)(I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p); + }; + if (!strcmp(sigTest,"844_4")) { + typedef I4 (*T)(I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i); + }; + if (!strcmp(sigTest,"848_4")) { + typedef I4 (*T)(I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p); + }; + if (!strcmp(sigTest,"884_4")) { + typedef I4 (*T)(I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i); + }; + if (!strcmp(sigTest,"888_4")) { + typedef I4 (*T)(I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p); + }; + if (!strcmp(sigTest,"444_8")) { + typedef I8 (*T)(I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i); + }; + if (!strcmp(sigTest,"448_8")) { + typedef I8 (*T)(I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p); + }; + if (!strcmp(sigTest,"484_8")) { + typedef I8 (*T)(I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i); + }; + if (!strcmp(sigTest,"488_8")) { + typedef I8 (*T)(I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p); + }; + if (!strcmp(sigTest,"844_8")) { + typedef I8 (*T)(I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i); + }; + if (!strcmp(sigTest,"848_8")) { + typedef I8 (*T)(I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p); + }; + if (!strcmp(sigTest,"884_8")) { + typedef I8 (*T)(I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i); + }; + if (!strcmp(sigTest,"888_8")) { + typedef I8 (*T)(I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p); + }; + break; } + case MINT_ICALLSIG_PPPP_V: case MINT_ICALLSIG_PPPP_P: { - typedef gpointer (*T)(gpointer,gpointer,gpointer,gpointer); - T func = (T)ptr; - ret_sp->data.p = func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p); - break; - } - case MINT_ICALLSIG_PPPPP_V: { - typedef void (*T)(gpointer,gpointer,gpointer,gpointer,gpointer); - T func = (T)ptr; - func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p, sp [4].data.p); - break; + if (!strcmp(sigTest,"4444_V")) { + typedef void (*T)(I4,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"4448_V")) { + typedef void (*T)(I4,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"4484_V")) { + typedef void (*T)(I4,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"4488_V")) { + typedef void (*T)(I4,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"4844_V")) { + typedef void (*T)(I4,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"4848_V")) { + typedef void (*T)(I4,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"4884_V")) { + typedef void (*T)(I4,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"4888_V")) { + typedef void (*T)(I4,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"8444_V")) { + typedef void (*T)(I8,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"8448_V")) { + typedef void (*T)(I8,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"8484_V")) { + typedef void (*T)(I8,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"8488_V")) { + typedef void (*T)(I8,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"8844_V")) { + typedef void (*T)(I8,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"8848_V")) { + typedef void (*T)(I8,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"8884_V")) { + typedef void (*T)(I8,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"8888_V")) { + typedef void (*T)(I8,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"4444_4")) { + typedef I4 (*T)(I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"4448_4")) { + typedef I4 (*T)(I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"4484_4")) { + typedef I4 (*T)(I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"4488_4")) { + typedef I4 (*T)(I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"4844_4")) { + typedef I4 (*T)(I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"4848_4")) { + typedef I4 (*T)(I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"4884_4")) { + typedef I4 (*T)(I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"4888_4")) { + typedef I4 (*T)(I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"8444_4")) { + typedef I4 (*T)(I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"8448_4")) { + typedef I4 (*T)(I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"8484_4")) { + typedef I4 (*T)(I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"8488_4")) { + typedef I4 (*T)(I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"8844_4")) { + typedef I4 (*T)(I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"8848_4")) { + typedef I4 (*T)(I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"8884_4")) { + typedef I4 (*T)(I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"8888_4")) { + typedef I4 (*T)(I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"4444_8")) { + typedef I8 (*T)(I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"4448_8")) { + typedef I8 (*T)(I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"4484_8")) { + typedef I8 (*T)(I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"4488_8")) { + typedef I8 (*T)(I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"4844_8")) { + typedef I8 (*T)(I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"4848_8")) { + typedef I8 (*T)(I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"4884_8")) { + typedef I8 (*T)(I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"4888_8")) { + typedef I8 (*T)(I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"8444_8")) { + typedef I8 (*T)(I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"8448_8")) { + typedef I8 (*T)(I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"8484_8")) { + typedef I8 (*T)(I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"8488_8")) { + typedef I8 (*T)(I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"8844_8")) { + typedef I8 (*T)(I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"8848_8")) { + typedef I8 (*T)(I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"8884_8")) { + typedef I8 (*T)(I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"8888_8")) { + typedef I8 (*T)(I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p); + }; + break; } + case MINT_ICALLSIG_PPPPP_V: case MINT_ICALLSIG_PPPPP_P: { - if (!strcmp(sigTest, "44444_4")) - { + if (!strcmp(sigTest,"44444_V")) { + typedef void (*T)(I4,I4,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"44448_V")) { + typedef void (*T)(I4,I4,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"44484_V")) { + typedef void (*T)(I4,I4,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"44488_V")) { + typedef void (*T)(I4,I4,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"44844_V")) { + typedef void (*T)(I4,I4,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"44848_V")) { + typedef void (*T)(I4,I4,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"44884_V")) { + typedef void (*T)(I4,I4,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"44888_V")) { + typedef void (*T)(I4,I4,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"48444_V")) { + typedef void (*T)(I4,I8,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"48448_V")) { + typedef void (*T)(I4,I8,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"48484_V")) { + typedef void (*T)(I4,I8,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"48488_V")) { + typedef void (*T)(I4,I8,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"48844_V")) { + typedef void (*T)(I4,I8,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"48848_V")) { + typedef void (*T)(I4,I8,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"48884_V")) { + typedef void (*T)(I4,I8,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"48888_V")) { + typedef void (*T)(I4,I8,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"84444_V")) { + typedef void (*T)(I8,I4,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"84448_V")) { + typedef void (*T)(I8,I4,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"84484_V")) { + typedef void (*T)(I8,I4,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"84488_V")) { + typedef void (*T)(I8,I4,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"84844_V")) { + typedef void (*T)(I8,I4,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"84848_V")) { + typedef void (*T)(I8,I4,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"84884_V")) { + typedef void (*T)(I8,I4,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"84888_V")) { + typedef void (*T)(I8,I4,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"88444_V")) { + typedef void (*T)(I8,I8,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"88448_V")) { + typedef void (*T)(I8,I8,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"88484_V")) { + typedef void (*T)(I8,I8,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"88488_V")) { + typedef void (*T)(I8,I8,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"88844_V")) { + typedef void (*T)(I8,I8,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"88848_V")) { + typedef void (*T)(I8,I8,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"88884_V")) { + typedef void (*T)(I8,I8,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"88888_V")) { + typedef void (*T)(I8,I8,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"44444_4")) { typedef I4 (*T)(I4,I4,I4,I4,I4); T func = (T)ptr; - ret_sp->data.i = func (sp [0].data.i, sp [1].data.i, sp [2].data.i, sp [3].data.i, sp [4].data.i); - } - else - { - typedef gpointer (*T)(gpointer,gpointer,gpointer,gpointer,gpointer); + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"44448_4")) { + typedef I4 (*T)(I4,I4,I4,I4,I8); T func = (T)ptr; - ret_sp->data.p = func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p, sp [4].data.p); - } - break; - } - case MINT_ICALLSIG_PPPPPP_V: { - typedef void (*T)(gpointer,gpointer,gpointer,gpointer,gpointer,gpointer); - T func = (T)ptr; - func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p, sp [4].data.p, sp [5].data.p); - break; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"44484_4")) { + typedef I4 (*T)(I4,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"44488_4")) { + typedef I4 (*T)(I4,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"44844_4")) { + typedef I4 (*T)(I4,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"44848_4")) { + typedef I4 (*T)(I4,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"44884_4")) { + typedef I4 (*T)(I4,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"44888_4")) { + typedef I4 (*T)(I4,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"48444_4")) { + typedef I4 (*T)(I4,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"48448_4")) { + typedef I4 (*T)(I4,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"48484_4")) { + typedef I4 (*T)(I4,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"48488_4")) { + typedef I4 (*T)(I4,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"48844_4")) { + typedef I4 (*T)(I4,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"48848_4")) { + typedef I4 (*T)(I4,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"48884_4")) { + typedef I4 (*T)(I4,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"48888_4")) { + typedef I4 (*T)(I4,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"84444_4")) { + typedef I4 (*T)(I8,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"84448_4")) { + typedef I4 (*T)(I8,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"84484_4")) { + typedef I4 (*T)(I8,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"84488_4")) { + typedef I4 (*T)(I8,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"84844_4")) { + typedef I4 (*T)(I8,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"84848_4")) { + typedef I4 (*T)(I8,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"84884_4")) { + typedef I4 (*T)(I8,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"84888_4")) { + typedef I4 (*T)(I8,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"88444_4")) { + typedef I4 (*T)(I8,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"88448_4")) { + typedef I4 (*T)(I8,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"88484_4")) { + typedef I4 (*T)(I8,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"88488_4")) { + typedef I4 (*T)(I8,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"88844_4")) { + typedef I4 (*T)(I8,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"88848_4")) { + typedef I4 (*T)(I8,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"88884_4")) { + typedef I4 (*T)(I8,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"88888_4")) { + typedef I4 (*T)(I8,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"44444_8")) { + typedef I8 (*T)(I4,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"44448_8")) { + typedef I8 (*T)(I4,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"44484_8")) { + typedef I8 (*T)(I4,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"44488_8")) { + typedef I8 (*T)(I4,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"44844_8")) { + typedef I8 (*T)(I4,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"44848_8")) { + typedef I8 (*T)(I4,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"44884_8")) { + typedef I8 (*T)(I4,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"44888_8")) { + typedef I8 (*T)(I4,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"48444_8")) { + typedef I8 (*T)(I4,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"48448_8")) { + typedef I8 (*T)(I4,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"48484_8")) { + typedef I8 (*T)(I4,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"48488_8")) { + typedef I8 (*T)(I4,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"48844_8")) { + typedef I8 (*T)(I4,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"48848_8")) { + typedef I8 (*T)(I4,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"48884_8")) { + typedef I8 (*T)(I4,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"48888_8")) { + typedef I8 (*T)(I4,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"84444_8")) { + typedef I8 (*T)(I8,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"84448_8")) { + typedef I8 (*T)(I8,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"84484_8")) { + typedef I8 (*T)(I8,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"84488_8")) { + typedef I8 (*T)(I8,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"84844_8")) { + typedef I8 (*T)(I8,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"84848_8")) { + typedef I8 (*T)(I8,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"84884_8")) { + typedef I8 (*T)(I8,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"84888_8")) { + typedef I8 (*T)(I8,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"88444_8")) { + typedef I8 (*T)(I8,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"88448_8")) { + typedef I8 (*T)(I8,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"88484_8")) { + typedef I8 (*T)(I8,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"88488_8")) { + typedef I8 (*T)(I8,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"88844_8")) { + typedef I8 (*T)(I8,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"88848_8")) { + typedef I8 (*T)(I8,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"88884_8")) { + typedef I8 (*T)(I8,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"88888_8")) { + typedef I8 (*T)(I8,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + break; } + case MINT_ICALLSIG_PPPPPP_V: case MINT_ICALLSIG_PPPPPP_P: { - - typedef gpointer (*T)(gpointer,gpointer,gpointer,gpointer,gpointer,gpointer); + if (!strcmp(sigTest,"444444_V")) { + typedef void (*T)(I4,I4,I4,I4,I4,I4); T func = (T)ptr; - ret_sp->data.p = func (sp [0].data.p, sp [1].data.p, sp [2].data.p, sp [3].data.p, sp [4].data.p, sp [5].data.p); - break; - - + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"444448_V")) { + typedef void (*T)(I4,I4,I4,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"444484_V")) { + typedef void (*T)(I4,I4,I4,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"444488_V")) { + typedef void (*T)(I4,I4,I4,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"444844_V")) { + typedef void (*T)(I4,I4,I4,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"444848_V")) { + typedef void (*T)(I4,I4,I4,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"444884_V")) { + typedef void (*T)(I4,I4,I4,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"444888_V")) { + typedef void (*T)(I4,I4,I4,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"448444_V")) { + typedef void (*T)(I4,I4,I8,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"448448_V")) { + typedef void (*T)(I4,I4,I8,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"448484_V")) { + typedef void (*T)(I4,I4,I8,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"448488_V")) { + typedef void (*T)(I4,I4,I8,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"448844_V")) { + typedef void (*T)(I4,I4,I8,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"448848_V")) { + typedef void (*T)(I4,I4,I8,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"448884_V")) { + typedef void (*T)(I4,I4,I8,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"448888_V")) { + typedef void (*T)(I4,I4,I8,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"484444_V")) { + typedef void (*T)(I4,I8,I4,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"484448_V")) { + typedef void (*T)(I4,I8,I4,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"484484_V")) { + typedef void (*T)(I4,I8,I4,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"484488_V")) { + typedef void (*T)(I4,I8,I4,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"484844_V")) { + typedef void (*T)(I4,I8,I4,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"484848_V")) { + typedef void (*T)(I4,I8,I4,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"484884_V")) { + typedef void (*T)(I4,I8,I4,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"484888_V")) { + typedef void (*T)(I4,I8,I4,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"488444_V")) { + typedef void (*T)(I4,I8,I8,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"488448_V")) { + typedef void (*T)(I4,I8,I8,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"488484_V")) { + typedef void (*T)(I4,I8,I8,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"488488_V")) { + typedef void (*T)(I4,I8,I8,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"488844_V")) { + typedef void (*T)(I4,I8,I8,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"488848_V")) { + typedef void (*T)(I4,I8,I8,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"488884_V")) { + typedef void (*T)(I4,I8,I8,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"488888_V")) { + typedef void (*T)(I4,I8,I8,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"844444_V")) { + typedef void (*T)(I8,I4,I4,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"844448_V")) { + typedef void (*T)(I8,I4,I4,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"844484_V")) { + typedef void (*T)(I8,I4,I4,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"844488_V")) { + typedef void (*T)(I8,I4,I4,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"844844_V")) { + typedef void (*T)(I8,I4,I4,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"844848_V")) { + typedef void (*T)(I8,I4,I4,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"844884_V")) { + typedef void (*T)(I8,I4,I4,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"844888_V")) { + typedef void (*T)(I8,I4,I4,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"848444_V")) { + typedef void (*T)(I8,I4,I8,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"848448_V")) { + typedef void (*T)(I8,I4,I8,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"848484_V")) { + typedef void (*T)(I8,I4,I8,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"848488_V")) { + typedef void (*T)(I8,I4,I8,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"848844_V")) { + typedef void (*T)(I8,I4,I8,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"848848_V")) { + typedef void (*T)(I8,I4,I8,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"848884_V")) { + typedef void (*T)(I8,I4,I8,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"848888_V")) { + typedef void (*T)(I8,I4,I8,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"884444_V")) { + typedef void (*T)(I8,I8,I4,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"884448_V")) { + typedef void (*T)(I8,I8,I4,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"884484_V")) { + typedef void (*T)(I8,I8,I4,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"884488_V")) { + typedef void (*T)(I8,I8,I4,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"884844_V")) { + typedef void (*T)(I8,I8,I4,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"884848_V")) { + typedef void (*T)(I8,I8,I4,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"884884_V")) { + typedef void (*T)(I8,I8,I4,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"884888_V")) { + typedef void (*T)(I8,I8,I4,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"888444_V")) { + typedef void (*T)(I8,I8,I8,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"888448_V")) { + typedef void (*T)(I8,I8,I8,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"888484_V")) { + typedef void (*T)(I8,I8,I8,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"888488_V")) { + typedef void (*T)(I8,I8,I8,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"888844_V")) { + typedef void (*T)(I8,I8,I8,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"888848_V")) { + typedef void (*T)(I8,I8,I8,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"888884_V")) { + typedef void (*T)(I8,I8,I8,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"888888_V")) { + typedef void (*T)(I8,I8,I8,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"444444_4")) { + typedef I4 (*T)(I4,I4,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"444448_4")) { + typedef I4 (*T)(I4,I4,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"444484_4")) { + typedef I4 (*T)(I4,I4,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"444488_4")) { + typedef I4 (*T)(I4,I4,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"444844_4")) { + typedef I4 (*T)(I4,I4,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"444848_4")) { + typedef I4 (*T)(I4,I4,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"444884_4")) { + typedef I4 (*T)(I4,I4,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"444888_4")) { + typedef I4 (*T)(I4,I4,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"448444_4")) { + typedef I4 (*T)(I4,I4,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"448448_4")) { + typedef I4 (*T)(I4,I4,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"448484_4")) { + typedef I4 (*T)(I4,I4,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"448488_4")) { + typedef I4 (*T)(I4,I4,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"448844_4")) { + typedef I4 (*T)(I4,I4,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"448848_4")) { + typedef I4 (*T)(I4,I4,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"448884_4")) { + typedef I4 (*T)(I4,I4,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"448888_4")) { + typedef I4 (*T)(I4,I4,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"484444_4")) { + typedef I4 (*T)(I4,I8,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"484448_4")) { + typedef I4 (*T)(I4,I8,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"484484_4")) { + typedef I4 (*T)(I4,I8,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"484488_4")) { + typedef I4 (*T)(I4,I8,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"484844_4")) { + typedef I4 (*T)(I4,I8,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"484848_4")) { + typedef I4 (*T)(I4,I8,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"484884_4")) { + typedef I4 (*T)(I4,I8,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"484888_4")) { + typedef I4 (*T)(I4,I8,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"488444_4")) { + typedef I4 (*T)(I4,I8,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"488448_4")) { + typedef I4 (*T)(I4,I8,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"488484_4")) { + typedef I4 (*T)(I4,I8,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"488488_4")) { + typedef I4 (*T)(I4,I8,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"488844_4")) { + typedef I4 (*T)(I4,I8,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"488848_4")) { + typedef I4 (*T)(I4,I8,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"488884_4")) { + typedef I4 (*T)(I4,I8,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"488888_4")) { + typedef I4 (*T)(I4,I8,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"844444_4")) { + typedef I4 (*T)(I8,I4,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"844448_4")) { + typedef I4 (*T)(I8,I4,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"844484_4")) { + typedef I4 (*T)(I8,I4,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"844488_4")) { + typedef I4 (*T)(I8,I4,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"844844_4")) { + typedef I4 (*T)(I8,I4,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"844848_4")) { + typedef I4 (*T)(I8,I4,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"844884_4")) { + typedef I4 (*T)(I8,I4,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"844888_4")) { + typedef I4 (*T)(I8,I4,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"848444_4")) { + typedef I4 (*T)(I8,I4,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"848448_4")) { + typedef I4 (*T)(I8,I4,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"848484_4")) { + typedef I4 (*T)(I8,I4,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"848488_4")) { + typedef I4 (*T)(I8,I4,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"848844_4")) { + typedef I4 (*T)(I8,I4,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"848848_4")) { + typedef I4 (*T)(I8,I4,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"848884_4")) { + typedef I4 (*T)(I8,I4,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"848888_4")) { + typedef I4 (*T)(I8,I4,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"884444_4")) { + typedef I4 (*T)(I8,I8,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"884448_4")) { + typedef I4 (*T)(I8,I8,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"884484_4")) { + typedef I4 (*T)(I8,I8,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"884488_4")) { + typedef I4 (*T)(I8,I8,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"884844_4")) { + typedef I4 (*T)(I8,I8,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"884848_4")) { + typedef I4 (*T)(I8,I8,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"884884_4")) { + typedef I4 (*T)(I8,I8,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"884888_4")) { + typedef I4 (*T)(I8,I8,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"888444_4")) { + typedef I4 (*T)(I8,I8,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"888448_4")) { + typedef I4 (*T)(I8,I8,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"888484_4")) { + typedef I4 (*T)(I8,I8,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"888488_4")) { + typedef I4 (*T)(I8,I8,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"888844_4")) { + typedef I4 (*T)(I8,I8,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"888848_4")) { + typedef I4 (*T)(I8,I8,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"888884_4")) { + typedef I4 (*T)(I8,I8,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"888888_4")) { + typedef I4 (*T)(I8,I8,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"444444_8")) { + typedef I8 (*T)(I4,I4,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"444448_8")) { + typedef I8 (*T)(I4,I4,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"444484_8")) { + typedef I8 (*T)(I4,I4,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"444488_8")) { + typedef I8 (*T)(I4,I4,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"444844_8")) { + typedef I8 (*T)(I4,I4,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"444848_8")) { + typedef I8 (*T)(I4,I4,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"444884_8")) { + typedef I8 (*T)(I4,I4,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"444888_8")) { + typedef I8 (*T)(I4,I4,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"448444_8")) { + typedef I8 (*T)(I4,I4,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"448448_8")) { + typedef I8 (*T)(I4,I4,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"448484_8")) { + typedef I8 (*T)(I4,I4,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"448488_8")) { + typedef I8 (*T)(I4,I4,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"448844_8")) { + typedef I8 (*T)(I4,I4,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"448848_8")) { + typedef I8 (*T)(I4,I4,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"448884_8")) { + typedef I8 (*T)(I4,I4,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"448888_8")) { + typedef I8 (*T)(I4,I4,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"484444_8")) { + typedef I8 (*T)(I4,I8,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"484448_8")) { + typedef I8 (*T)(I4,I8,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"484484_8")) { + typedef I8 (*T)(I4,I8,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"484488_8")) { + typedef I8 (*T)(I4,I8,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"484844_8")) { + typedef I8 (*T)(I4,I8,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"484848_8")) { + typedef I8 (*T)(I4,I8,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"484884_8")) { + typedef I8 (*T)(I4,I8,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"484888_8")) { + typedef I8 (*T)(I4,I8,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"488444_8")) { + typedef I8 (*T)(I4,I8,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"488448_8")) { + typedef I8 (*T)(I4,I8,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"488484_8")) { + typedef I8 (*T)(I4,I8,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"488488_8")) { + typedef I8 (*T)(I4,I8,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"488844_8")) { + typedef I8 (*T)(I4,I8,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"488848_8")) { + typedef I8 (*T)(I4,I8,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"488884_8")) { + typedef I8 (*T)(I4,I8,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"488888_8")) { + typedef I8 (*T)(I4,I8,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"844444_8")) { + typedef I8 (*T)(I8,I4,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"844448_8")) { + typedef I8 (*T)(I8,I4,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"844484_8")) { + typedef I8 (*T)(I8,I4,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"844488_8")) { + typedef I8 (*T)(I8,I4,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"844844_8")) { + typedef I8 (*T)(I8,I4,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"844848_8")) { + typedef I8 (*T)(I8,I4,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"844884_8")) { + typedef I8 (*T)(I8,I4,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"844888_8")) { + typedef I8 (*T)(I8,I4,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"848444_8")) { + typedef I8 (*T)(I8,I4,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"848448_8")) { + typedef I8 (*T)(I8,I4,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"848484_8")) { + typedef I8 (*T)(I8,I4,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"848488_8")) { + typedef I8 (*T)(I8,I4,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"848844_8")) { + typedef I8 (*T)(I8,I4,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"848848_8")) { + typedef I8 (*T)(I8,I4,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"848884_8")) { + typedef I8 (*T)(I8,I4,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"848888_8")) { + typedef I8 (*T)(I8,I4,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"884444_8")) { + typedef I8 (*T)(I8,I8,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"884448_8")) { + typedef I8 (*T)(I8,I8,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"884484_8")) { + typedef I8 (*T)(I8,I8,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"884488_8")) { + typedef I8 (*T)(I8,I8,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"884844_8")) { + typedef I8 (*T)(I8,I8,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"884848_8")) { + typedef I8 (*T)(I8,I8,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"884884_8")) { + typedef I8 (*T)(I8,I8,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"884888_8")) { + typedef I8 (*T)(I8,I8,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"888444_8")) { + typedef I8 (*T)(I8,I8,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"888448_8")) { + typedef I8 (*T)(I8,I8,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"888484_8")) { + typedef I8 (*T)(I8,I8,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"888488_8")) { + typedef I8 (*T)(I8,I8,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"888844_8")) { + typedef I8 (*T)(I8,I8,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"888848_8")) { + typedef I8 (*T)(I8,I8,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"888884_8")) { + typedef I8 (*T)(I8,I8,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"888888_8")) { + typedef I8 (*T)(I8,I8,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + break; } default: - g_assert_not_reached (); + g_assert_not_reached(); } if (save_last_error) From 1948c76a2e00b68a4c65d57e5f1a43207bd8aa54 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 24 Jun 2025 13:10:18 +0100 Subject: [PATCH 085/209] Handles bigint type in pointer fixup Updates `fixupPointer` to correctly handle bigint values by using the `>>` operator for bitwise right shift on bigints instead of the `>>>` operator, which is specific to numbers. --- src/mono/browser/runtime/memory.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mono/browser/runtime/memory.ts b/src/mono/browser/runtime/memory.ts index 0f9f751854de17..b167c76ff81448 100644 --- a/src/mono/browser/runtime/memory.ts +++ b/src/mono/browser/runtime/memory.ts @@ -511,6 +511,10 @@ export function forceThreadMemoryViewRefresh () { } } -export function fixupPointer (signature: any, shiftAmount: number): any { - return ((signature as any) >>> shiftAmount) as any; +export function fixupPointer (signature: any, shiftAmount: any): any { + if (typeof signature === "bigint") { + return signature >> BigInt(shiftAmount); + } else { + return (signature as number) >>> shiftAmount; + } } From f042b14d65ef8b8ee29b35d319eddd7ee5cbc830 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 24 Jun 2025 13:11:01 +0100 Subject: [PATCH 086/209] Extends interp_type_as_ptr8 to valuetypes Extends the `interp_type_as_ptr8` function to also return true for value types that are not enums. This allows for more accurate handling of these types within the interpreter. --- src/mono/mono/mini/interp/interp-icalls.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index c7eba3d0c1d662..a5d886d797d504 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -44,8 +44,10 @@ interp_type_as_ptr8 (MonoType *tp) if ((tp)->type == MONO_TYPE_I8 || (tp)->type == MONO_TYPE_U8) return TRUE; if ((tp)->type == MONO_TYPE_R8) - return TRUE; - + return TRUE; + // return true for value types that are NOT enums + if ((tp)->type == MONO_TYPE_VALUETYPE && !m_class_is_enumtype (m_type_data_get_klass_unchecked (tp))) + return TRUE; return FALSE; } From 8cdd1fe477d2f3fb771804c4c4365951a6e521c8 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 24 Jun 2025 13:53:00 +0100 Subject: [PATCH 087/209] Fixes potential offset overflows Addresses potential integer overflow issues when calculating offsets in JavaScript typed arrays and DataViews. This is achieved by adding a utility function that handles `bigint` offsets and throws an error if the resulting offset exceeds the maximum safe integer value. This prevents unexpected behavior and potential security vulnerabilities. --- src/mono/browser/runtime/marshal.ts | 32 +++++++++++++++++++++++------ src/mono/browser/runtime/memory.ts | 11 +++++++++- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/mono/browser/runtime/marshal.ts b/src/mono/browser/runtime/marshal.ts index 5d537670c4d9db..94a2d0e9619591 100644 --- a/src/mono/browser/runtime/marshal.ts +++ b/src/mono/browser/runtime/marshal.ts @@ -115,7 +115,17 @@ export function set_args_context (args: JSMarshalerArguments): void { set_arg_proxy_context(exc); set_arg_proxy_context(res); } - +function add_offset (ptr: JSFunctionSignature | number | bigint | JSMarshalerType, offset: number): number { + if (typeof ptr === "bigint") { + const result = ptr + BigInt(offset); + if (result > BigInt(Number.MAX_SAFE_INTEGER)) { + throw new Error("Offset too large for JavaScript typed arrays/DataView"); + } + return Number(result); + } else { + return (ptr as number) + offset; + } +} export function get_sig (signature: JSFunctionSignature, index: number): JSMarshalerType { mono_assert(signature, "Null signatures"); return signature + (index * JSMarshalerTypeSize) + JSMarshalerSignatureHeaderSize; @@ -133,7 +143,7 @@ export function get_signature_res_type (sig: JSMarshalerType): MarshalerType { export function get_signature_arg1_type (sig: JSMarshalerType): MarshalerType { mono_assert(sig, "Null sig"); - return getU8(sig + JSBindingTypeOffsets.Arg1MarshalerType); + return getU8(add_offset(sig, JSBindingTypeOffsets.Arg1MarshalerType)); } export function get_signature_arg2_type (sig: JSMarshalerType): MarshalerType { @@ -153,7 +163,16 @@ export function get_signature_argument_count (signature: JSFunctionSignature): n export function get_signature_version (signature: JSFunctionSignature): number { mono_assert(signature, "Null signatures"); - return getI32(signature + JSBindingHeaderOffsets.Version); + if (typeof signature === "bigint") { + const offset = signature + BigInt(JSBindingHeaderOffsets.Version); + if (offset > BigInt(Number.MAX_SAFE_INTEGER)) { + throw new Error("Offset too large for JavaScript typed arrays/DataView"); + } + return new DataView(Module.HEAPU8.buffer).getInt32(Number(offset), true); + } else { + const offset = signature + JSBindingHeaderOffsets.Version; + return getI32(offset); + } } export function get_signature_handle (signature: JSFunctionSignature): number { @@ -163,11 +182,12 @@ export function get_signature_handle (signature: JSFunctionSignature): number { export function get_signature_function_name (signature: JSFunctionSignature): string | null { mono_assert(signature, "Null signatures"); - const functionNameOffset = getI32(signature + JSBindingHeaderOffsets.FunctionNameOffset); + const functionNameOffset = getI32(add_offset(signature, JSBindingHeaderOffsets.FunctionNameOffset)); if (functionNameOffset === 0) return null; - const functionNameLength = getI32(signature + JSBindingHeaderOffsets.FunctionNameLength); + const functionNameLength = getI32(add_offset(signature, JSBindingHeaderOffsets.FunctionNameLength)); mono_assert(functionNameOffset, "Null name"); - return utf16ToString(signature + functionNameOffset, signature + functionNameOffset + functionNameLength); + return utf16ToString(add_offset(signature, functionNameOffset), + add_offset(signature, functionNameOffset + functionNameLength)); } export function get_signature_module_name (signature: JSFunctionSignature): string | null { diff --git a/src/mono/browser/runtime/memory.ts b/src/mono/browser/runtime/memory.ts index b167c76ff81448..4437134aa6f669 100644 --- a/src/mono/browser/runtime/memory.ts +++ b/src/mono/browser/runtime/memory.ts @@ -271,7 +271,16 @@ export function getI16_local (localView: Int16Array, offset: MemOffset): number export function getI32 (offset: MemOffset): number { receiveWorkerHeapViews(); - return Module.HEAP32[offset >>> 2]; + let n: number; + if (typeof offset === "bigint") { + if (offset > BigInt(Number.MAX_SAFE_INTEGER)) { + throw new Error("Offset too large for JS typed arrays"); + } + n = Number(offset); + } else { + n = offset as number; + } + return new DataView(Module.HEAPU8.buffer).getInt32(n, true); } // does not check for growable heap From 88e5ef1a915c55896e3244b77e62c44b4ac4185c Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 24 Jun 2025 14:06:41 +0100 Subject: [PATCH 088/209] Copilot patch to use add_offset --- src/mono/browser/runtime/marshal.ts | 85 ++++++++++++++--------------- 1 file changed, 41 insertions(+), 44 deletions(-) diff --git a/src/mono/browser/runtime/marshal.ts b/src/mono/browser/runtime/marshal.ts index 94a2d0e9619591..51c508f4f2c91c 100644 --- a/src/mono/browser/runtime/marshal.ts +++ b/src/mono/browser/runtime/marshal.ts @@ -75,7 +75,7 @@ export function alloc_stack_frame (size: number): JSMarshalerArguments { export function get_arg (args: JSMarshalerArguments, index: number): JSMarshalerArgument { mono_assert(args, "Null args"); - return args + (index * JavaScriptMarshalerArgSize); + return add_offset(args, index * JavaScriptMarshalerArgSize) as any; } export function is_args_exception (args: JSMarshalerArguments): boolean { @@ -87,24 +87,24 @@ export function is_args_exception (args: JSMarshalerArguments): boolean { export function is_receiver_should_free (args: JSMarshalerArguments): boolean { if (!WasmEnableThreads) return false; mono_assert(args, "Null args"); - return getB8(args + JSMarshalerArgumentOffsets.ReceiverShouldFree); + return getB8(add_offset(args, JSMarshalerArgumentOffsets.ReceiverShouldFree)); } export function get_sync_done_semaphore_ptr (args: JSMarshalerArguments): VoidPtr { if (!WasmEnableThreads) return VoidPtrNull; mono_assert(args, "Null args"); - return getI32(args + JSMarshalerArgumentOffsets.SyncDoneSemaphorePtr) as any; + return getI32(add_offset(args, JSMarshalerArgumentOffsets.SyncDoneSemaphorePtr)) as any; } export function get_caller_native_tid (args: JSMarshalerArguments): PThreadPtr { if (!WasmEnableThreads) return PThreadPtrNull; mono_assert(args, "Null args"); - return getI32(args + JSMarshalerArgumentOffsets.CallerNativeTID) as any; + return getI32(add_offset(args, JSMarshalerArgumentOffsets.CallerNativeTID)) as any; } export function set_receiver_should_free (args: JSMarshalerArguments): void { mono_assert(args, "Null args"); - setB8(args + JSMarshalerArgumentOffsets.ReceiverShouldFree, true); + setB8(add_offset(args, JSMarshalerArgumentOffsets.ReceiverShouldFree), true); } export function set_args_context (args: JSMarshalerArguments): void { @@ -115,7 +115,7 @@ export function set_args_context (args: JSMarshalerArguments): void { set_arg_proxy_context(exc); set_arg_proxy_context(res); } -function add_offset (ptr: JSFunctionSignature | number | bigint | JSMarshalerType, offset: number): number { +function add_offset (ptr: JSMarshalerArguments | JSMarshalerArgument | JSFunctionSignature | number | bigint | JSMarshalerType, offset: number): number { if (typeof ptr === "bigint") { const result = ptr + BigInt(offset); if (result > BigInt(Number.MAX_SAFE_INTEGER)) { @@ -143,59 +143,56 @@ export function get_signature_res_type (sig: JSMarshalerType): MarshalerType { export function get_signature_arg1_type (sig: JSMarshalerType): MarshalerType { mono_assert(sig, "Null sig"); - return getU8(add_offset(sig, JSBindingTypeOffsets.Arg1MarshalerType)); + return getU8(add_offset(sig, JSBindingTypeOffsets.Arg1MarshalerType)) as any; } export function get_signature_arg2_type (sig: JSMarshalerType): MarshalerType { mono_assert(sig, "Null sig"); - return getU8(sig + JSBindingTypeOffsets.Arg2MarshalerType); + return getU8(add_offset(sig, JSBindingTypeOffsets.Arg2MarshalerType)) as any; } export function get_signature_arg3_type (sig: JSMarshalerType): MarshalerType { mono_assert(sig, "Null sig"); - return getU8(sig + JSBindingTypeOffsets.Arg3MarshalerType); + return getU8(add_offset(sig, JSBindingTypeOffsets.Arg3MarshalerType)) as any; } export function get_signature_argument_count (signature: JSFunctionSignature): number { mono_assert(signature, "Null signatures"); - return getI32(signature + JSBindingHeaderOffsets.ArgumentCount); + return getI32(add_offset(signature, JSBindingHeaderOffsets.ArgumentCount)) as any; } export function get_signature_version (signature: JSFunctionSignature): number { mono_assert(signature, "Null signatures"); - if (typeof signature === "bigint") { - const offset = signature + BigInt(JSBindingHeaderOffsets.Version); - if (offset > BigInt(Number.MAX_SAFE_INTEGER)) { - throw new Error("Offset too large for JavaScript typed arrays/DataView"); - } - return new DataView(Module.HEAPU8.buffer).getInt32(Number(offset), true); - } else { - const offset = signature + JSBindingHeaderOffsets.Version; - return getI32(offset); - } + const offset = add_offset(signature, JSBindingHeaderOffsets.Version); + return getI32(offset); } export function get_signature_handle (signature: JSFunctionSignature): number { mono_assert(signature, "Null signatures"); - return getI32(signature + JSBindingHeaderOffsets.ImportHandle); + return getI32(add_offset(signature, JSBindingHeaderOffsets.ImportHandle)) as any; } export function get_signature_function_name (signature: JSFunctionSignature): string | null { mono_assert(signature, "Null signatures"); - const functionNameOffset = getI32(add_offset(signature, JSBindingHeaderOffsets.FunctionNameOffset)); + const functionNameOffset = getI32(add_offset(signature, JSBindingHeaderOffsets.FunctionNameOffset)); if (functionNameOffset === 0) return null; - const functionNameLength = getI32(add_offset(signature, JSBindingHeaderOffsets.FunctionNameLength)); + const functionNameLength = getI32(add_offset(signature, JSBindingHeaderOffsets.FunctionNameLength)); mono_assert(functionNameOffset, "Null name"); - return utf16ToString(add_offset(signature, functionNameOffset), - add_offset(signature, functionNameOffset + functionNameLength)); + return utf16ToString( + add_offset(signature, functionNameOffset), + add_offset(signature, functionNameOffset + functionNameLength) + ); } export function get_signature_module_name (signature: JSFunctionSignature): string | null { mono_assert(signature, "Null signatures"); - const moduleNameOffset = getI32(signature + JSBindingHeaderOffsets.ModuleNameOffset); + const moduleNameOffset = getI32(add_offset(signature, JSBindingHeaderOffsets.ModuleNameOffset)); if (moduleNameOffset === 0) return null; - const moduleNameLength = getI32(signature + JSBindingHeaderOffsets.ModuleNameLength); - return utf16ToString(signature + moduleNameOffset, signature + moduleNameOffset + moduleNameLength); + const moduleNameLength = getI32(add_offset(signature, JSBindingHeaderOffsets.ModuleNameLength)); + return utf16ToString( + add_offset(signature, moduleNameOffset), + add_offset(signature, moduleNameOffset + moduleNameLength) + ); } export function get_sig_type (sig: JSMarshalerType): MarshalerType { @@ -205,34 +202,34 @@ export function get_sig_type (sig: JSMarshalerType): MarshalerType { export function get_arg_type (arg: JSMarshalerArgument): MarshalerType { mono_assert(arg, "Null arg"); - const type = getU8(arg + JSMarshalerArgumentOffsets.Type); - return type; + const type = getU8(add_offset(arg, JSMarshalerArgumentOffsets.Type)); + return type as any; } export function get_arg_element_type (arg: JSMarshalerArgument): MarshalerType { mono_assert(arg, "Null arg"); - const type = getU8(arg + JSMarshalerArgumentOffsets.ElementType); - return type; + const type = getU8(add_offset(arg, JSMarshalerArgumentOffsets.ElementType)); + return type as any; } export function set_arg_type (arg: JSMarshalerArgument, type: MarshalerType): void { mono_assert(arg, "Null arg"); - setU8(arg + JSMarshalerArgumentOffsets.Type, type); + setU8(add_offset(arg, JSMarshalerArgumentOffsets.Type), type); } export function set_arg_element_type (arg: JSMarshalerArgument, type: MarshalerType): void { mono_assert(arg, "Null arg"); - setU8(arg + JSMarshalerArgumentOffsets.ElementType, type); + setU8(add_offset(arg, JSMarshalerArgumentOffsets.ElementType), type); } export function get_arg_bool (arg: JSMarshalerArgument): boolean { mono_assert(arg, "Null arg"); - return getB8(arg); + return getB8(arg as any); } export function get_arg_u8 (arg: JSMarshalerArgument): number { mono_assert(arg, "Null arg"); - return getU8(arg); + return getU8(arg as any); } export function get_arg_u16 (arg: JSMarshalerArgument): number { @@ -345,29 +342,29 @@ export function set_arg_f32 (arg: JSMarshalerArgument, value: number): void { export function get_arg_js_handle (arg: JSMarshalerArgument): JSHandle { mono_assert(arg, "Null arg"); - return getI32(arg + JSMarshalerArgumentOffsets.JSHandle); + return getI32(add_offset(arg, JSMarshalerArgumentOffsets.JSHandle)) as any; } export function set_arg_proxy_context (arg: JSMarshalerArgument): void { if (!WasmEnableThreads) return; mono_assert(arg, "Null arg"); - setI32(arg + JSMarshalerArgumentOffsets.ContextHandle, runtimeHelpers.proxyGCHandle); + setI32(add_offset(arg, JSMarshalerArgumentOffsets.ContextHandle), runtimeHelpers.proxyGCHandle as any); } export function set_js_handle (arg: JSMarshalerArgument, jsHandle: JSHandle): void { mono_assert(arg, "Null arg"); - setI32(arg + JSMarshalerArgumentOffsets.JSHandle, jsHandle); + setI32(add_offset(arg, JSMarshalerArgumentOffsets.JSHandle), jsHandle as any); set_arg_proxy_context(arg); } export function get_arg_gc_handle (arg: JSMarshalerArgument): GCHandle { mono_assert(arg, "Null arg"); - return getI32(arg + JSMarshalerArgumentOffsets.GCHandle); + return getI32(add_offset(arg, JSMarshalerArgumentOffsets.GCHandle)) as any; } export function set_gc_handle (arg: JSMarshalerArgument, gcHandle: GCHandle): void { mono_assert(arg, "Null arg"); - setI32(arg + JSMarshalerArgumentOffsets.GCHandle, gcHandle); + setI32(add_offset(arg, JSMarshalerArgumentOffsets.GCHandle), gcHandle as any); set_arg_proxy_context(arg); } @@ -378,17 +375,17 @@ export function get_string_root (arg: JSMarshalerArgument): WasmRoot export function get_arg_length (arg: JSMarshalerArgument): number { mono_assert(arg, "Null arg"); - return getI32(arg + JSMarshalerArgumentOffsets.Length); + return getI32(add_offset(arg, JSMarshalerArgumentOffsets.Length)) as any; } export function set_arg_length (arg: JSMarshalerArgument, size: number): void { mono_assert(arg, "Null arg"); - setI32(arg + JSMarshalerArgumentOffsets.Length, size); + setI32(add_offset(arg, JSMarshalerArgumentOffsets.Length), size); } export function set_root (arg: JSMarshalerArgument, root: WasmRoot): void { mono_assert(arg, "Null arg"); - setU32(arg + 0, root.get_address()); + setU32(add_offset(arg, 0), root.get_address()); } export interface IDisposable { From c2cc68e8503b34a2e61efb0c9b86ad5fd6935a53 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 24 Jun 2025 16:17:16 +0100 Subject: [PATCH 089/209] Marshalling updates. Browser sample runs! --- src/mono/browser/runtime/invoke-js.ts | 21 +++++++++++++++------ src/mono/browser/runtime/marshal-to-js.ts | 5 +++-- src/mono/browser/runtime/marshal.ts | 11 +++++++---- src/mono/browser/runtime/tsconfig.json | 5 +++-- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/src/mono/browser/runtime/invoke-js.ts b/src/mono/browser/runtime/invoke-js.ts index 777fdb2d329af1..d65b825f969a39 100644 --- a/src/mono/browser/runtime/invoke-js.ts +++ b/src/mono/browser/runtime/invoke-js.ts @@ -7,8 +7,7 @@ import BuildConfiguration from "consts:configuration"; import { marshal_exception_to_cs, bind_arg_marshal_to_cs, marshal_task_to_cs } from "./marshal-to-cs"; import { get_signature_argument_count, bound_js_function_symbol, get_sig, get_signature_version, get_signature_type, imported_js_function_symbol, get_signature_handle, get_signature_function_name, get_signature_module_name, is_receiver_should_free, get_caller_native_tid, get_sync_done_semaphore_ptr, get_arg } from "./marshal"; import { fixupPointer, forceThreadMemoryViewRefresh, free } from "./memory"; -import { JSFunctionSignature, JSMarshalerArguments, BoundMarshalerToJs, JSFnHandle, BoundMarshalerToCs, JSHandle, MarshalerType, VoidPtrNull } from "./types/internal"; -import { VoidPtr } from "./types/emscripten"; +import { JSFunctionSignature, JSMarshalerArguments, BoundMarshalerToJs, JSFnHandle, BoundMarshalerToCs, JSHandle, MarshalerType } from "./types/internal"; import { INTERNAL, Module, loaderHelpers, mono_assert, runtimeHelpers } from "./globals"; import { bind_arg_marshal_to_js } from "./marshal-to-js"; import { mono_log_debug, mono_wasm_symbolicate_string } from "./logging"; @@ -19,17 +18,27 @@ import { threads_c_functions as tcwraps } from "./cwraps"; import { monoThreadInfo } from "./pthreads"; import { stringToUTF16Ptr } from "./strings"; +export function isWasm64 (): boolean { + // This is a common runtime check, adjust if you have a better flag + return typeof Module.HEAP64 !== "undefined"; +} + export const js_import_wrapper_by_fn_handle: Function[] = [null];// 0th slot is dummy, main thread we free them on shutdown. On web worker thread we free them when worker is detached. +function toPointerForWasm (signature: number, wasm64: boolean): number | bigint { + return wasm64 ? BigInt(signature) : signature; +} -export function mono_wasm_bind_js_import_ST (signature: JSFunctionSignature): VoidPtr { - if (WasmEnableThreads) return VoidPtrNull; +export function mono_wasm_bind_js_import_ST (signature: JSFunctionSignature): number | bigint { + if (WasmEnableThreads) return isWasm64() ? 0n : 0; assert_js_interop(); signature = fixupPointer(signature, 0); try { bind_js_import(signature); - return VoidPtrNull; + return isWasm64() ? (BigInt("0") as any) : 0; } catch (ex: any) { - return stringToUTF16Ptr(normalize_exception(ex)); + const ptr = stringToUTF16Ptr(normalize_exception(ex)); + // @ts-expect-error TS2352: convert VoidPtr (number) to bigint for wasm64, or keep it as number for wasm32. + return toPointerForWasm(ptr as number, isWasm64()); } } diff --git a/src/mono/browser/runtime/marshal-to-js.ts b/src/mono/browser/runtime/marshal-to-js.ts index 29d9f56ff6fb3a..73694dd9287e45 100644 --- a/src/mono/browser/runtime/marshal-to-js.ts +++ b/src/mono/browser/runtime/marshal-to-js.ts @@ -24,6 +24,7 @@ import { fixupPointer, free, localHeapViewF64, localHeapViewI32, localHeapViewU8 import { call_delegate } from "./managed-exports"; import { mono_log_debug } from "./logging"; import { invoke_later_when_on_ui_thread_async } from "./invoke-js"; +import { add_offset } from "./marshal"; export function initialize_marshalers_to_js (): void { if (cs_to_js_marshalers.size == 0) { @@ -82,9 +83,9 @@ export function bind_arg_marshal_to_js (sig: JSMarshalerType, marshaler_type: Ma const converter = get_marshaler_to_js_by_type(marshaler_type)!; const element_type = get_signature_arg1_type(sig); - const arg_offset = index * JavaScriptMarshalerArgSize; + const arg_offset = index * JavaScriptMarshalerArgSize as number; return (args: JSMarshalerArguments) => { - return converter(args + arg_offset, element_type, res_marshaler, arg1_marshaler, arg2_marshaler, arg3_marshaler); + return converter(add_offset(args, arg_offset) as unknown as JSMarshalerArgument, element_type, res_marshaler, arg1_marshaler, arg2_marshaler, arg3_marshaler); }; } diff --git a/src/mono/browser/runtime/marshal.ts b/src/mono/browser/runtime/marshal.ts index 51c508f4f2c91c..ebae9b3d0e53c4 100644 --- a/src/mono/browser/runtime/marshal.ts +++ b/src/mono/browser/runtime/marshal.ts @@ -115,7 +115,10 @@ export function set_args_context (args: JSMarshalerArguments): void { set_arg_proxy_context(exc); set_arg_proxy_context(res); } -function add_offset (ptr: JSMarshalerArguments | JSMarshalerArgument | JSFunctionSignature | number | bigint | JSMarshalerType, offset: number): number { +export function add_offset ( + ptr: JSMarshalerArguments | JSMarshalerArgument | JSFunctionSignature | number | bigint | JSMarshalerType, + offset: number +): number { if (typeof ptr === "bigint") { const result = ptr + BigInt(offset); if (result > BigInt(Number.MAX_SAFE_INTEGER)) { @@ -128,17 +131,17 @@ function add_offset (ptr: JSMarshalerArguments | JSMarshalerArgument | JSFunctio } export function get_sig (signature: JSFunctionSignature, index: number): JSMarshalerType { mono_assert(signature, "Null signatures"); - return signature + (index * JSMarshalerTypeSize) + JSMarshalerSignatureHeaderSize; + return add_offset(signature, (index * JSMarshalerTypeSize) + JSMarshalerSignatureHeaderSize) as any; } export function get_signature_type (sig: JSMarshalerType): MarshalerType { mono_assert(sig, "Null sig"); - return getU8(sig + JSBindingTypeOffsets.Type); + return getU8(add_offset(sig, JSBindingTypeOffsets.Type)) as any; } export function get_signature_res_type (sig: JSMarshalerType): MarshalerType { mono_assert(sig, "Null sig"); - return getU8(sig + JSBindingTypeOffsets.ResultMarshalerType); + return getU8(add_offset(sig, JSBindingTypeOffsets.ResultMarshalerType)) as any; } export function get_signature_arg1_type (sig: JSMarshalerType): MarshalerType { diff --git a/src/mono/browser/runtime/tsconfig.json b/src/mono/browser/runtime/tsconfig.json index c5a5693168aa23..611be9dcbdab2e 100644 --- a/src/mono/browser/runtime/tsconfig.json +++ b/src/mono/browser/runtime/tsconfig.json @@ -1,10 +1,11 @@ { "extends": "./tsconfig.shared.json", "compilerOptions": { + "target": "ES2020", "lib": [ "esnext", "dom" ], - "sourceMap": true, + "sourceMap": true } -} \ No newline at end of file +} From 3409e45ad01b6d83e680bfd85445ff54cca0858d Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 24 Jun 2025 16:19:45 +0100 Subject: [PATCH 090/209] Fixes type size check order in logging Corrects the order of type size checks in the logging function to ensure correct size determination and avoid potential errors. --- src/mono/mono/mini/interp/interp-icalls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index a5d886d797d504..1e945174bc0c9d 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -187,7 +187,7 @@ static char * log_sig(MonoMethodSignature* sig) for (int i = 0; i < sig->param_count; ++i) { MonoType* tp = sig->params[i]; if(tp) - offset += sprintf(buffer + offset, "%d", interp_type_as_ptr4(tp) ? 4 : interp_type_as_ptr8(tp) ? 8 : 0); + offset += sprintf(buffer + offset, "%d", interp_type_as_ptr8(tp) ? 8 : interp_type_as_ptr4(tp) ? 4 : 0); else offset += sprintf(buffer + offset, "E"); } From 836e7a8f101687f3c0d9b17257550685c3ae64cc Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 25 Jun 2025 12:04:47 +0100 Subject: [PATCH 091/209] Updates method name return types Changes the return types of `mono_wasm_method_get_name`, `mono_wasm_method_get_name_ex`, and `mono_wasm_method_get_full_name` from `string` to `pointer`. --- src/mono/browser/runtime/cwraps.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mono/browser/runtime/cwraps.ts b/src/mono/browser/runtime/cwraps.ts index e33204f36838b2..b590ce1f5ac15c 100644 --- a/src/mono/browser/runtime/cwraps.ts +++ b/src/mono/browser/runtime/cwraps.ts @@ -70,9 +70,9 @@ const fn_signatures: SigLine[] = [ [true, "mono_wasm_u52_to_f64", "number", ["pointer", "pointer"]], [true, "mono_wasm_f64_to_i52", "number", ["pointer", "number"]], [true, "mono_wasm_f64_to_u52", "number", ["pointer", "number"]], - [true, "mono_wasm_method_get_name", "string", ["pointer"]], - [true, "mono_wasm_method_get_name_ex", "string", ["pointer"]], - [true, "mono_wasm_method_get_full_name", "string", ["pointer"]], + [true, "mono_wasm_method_get_name", "pointer", ["pointer"]], + [true, "mono_wasm_method_get_name_ex", "pointer", ["pointer"]], + [true, "mono_wasm_method_get_full_name", "pointer", ["pointer"]], [true, "mono_wasm_gc_lock", "void", []], [true, "mono_wasm_gc_unlock", "void", []], [true, "mono_wasm_get_i32_unaligned", "number", ["pointer"]], From be207a934ea835451fa2042a5a7a832498efbcf7 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 25 Jun 2025 12:05:24 +0100 Subject: [PATCH 092/209] Adds safe BigInt to Number conversion Adds a function to safely convert BigInt to Number, throwing an error if the BigInt is outside the safe integer range for JavaScript numbers. Updates utf8ToString to use this new safe conversion when dealing with BigInt pointers, preventing potential data loss or unexpected behavior. --- src/mono/browser/runtime/invoke-js.ts | 6 ++++++ src/mono/browser/runtime/strings.ts | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/mono/browser/runtime/invoke-js.ts b/src/mono/browser/runtime/invoke-js.ts index d65b825f969a39..24c154d8a22d68 100644 --- a/src/mono/browser/runtime/invoke-js.ts +++ b/src/mono/browser/runtime/invoke-js.ts @@ -22,6 +22,12 @@ export function isWasm64 (): boolean { // This is a common runtime check, adjust if you have a better flag return typeof Module.HEAP64 !== "undefined"; } +export function safeBigIntToNumber (ptr: bigint): number { + if (ptr > BigInt(Number.MAX_SAFE_INTEGER) || ptr < BigInt(Number.MIN_SAFE_INTEGER)) { + throw new Error(`Pointer value ${ptr} is out of safe integer range for JavaScript numbers.`); + } + return Number(ptr); +} export const js_import_wrapper_by_fn_handle: Function[] = [null];// 0th slot is dummy, main thread we free them on shutdown. On web worker thread we free them when worker is detached. function toPointerForWasm (signature: number, wasm64: boolean): number | bigint { diff --git a/src/mono/browser/runtime/strings.ts b/src/mono/browser/runtime/strings.ts index 2b52f82b0320b8..4dd02a67512822 100644 --- a/src/mono/browser/runtime/strings.ts +++ b/src/mono/browser/runtime/strings.ts @@ -9,6 +9,7 @@ import { Module } from "./globals"; import cwraps from "./cwraps"; import { isSharedArrayBuffer, localHeapViewU8, getU32_local, setU16_local, localHeapViewU32, getU16_local, localHeapViewU16, _zero_region, malloc, free } from "./memory"; import { NativePointer, CharPtr, VoidPtr } from "./types/emscripten"; +import { safeBigIntToNumber } from "./invoke-js"; export const interned_js_string_table = new Map(); export const mono_wasm_empty_string = ""; @@ -65,7 +66,14 @@ export function utf8ToStringRelaxed (buffer: Uint8Array): string { export function utf8ToString (ptr: CharPtr): string { const heapU8 = localHeapViewU8(); - return utf8BufferToString(heapU8, ptr as any, heapU8.length - (ptr as any)); + let idx: number; + if (typeof ptr === "bigint") { + idx = safeBigIntToNumber(ptr); + } else { + // @ts-expect-error TS2352 + idx = ptr as number; + } + return utf8BufferToString(heapU8, idx, heapU8.length - idx); } export function utf8BufferToString (heapOrArray: Uint8Array, idx: number, maxBytesToRead: number): string { From a8aaa338e332d39179353c454aae70a6cb76b963 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 26 Jun 2025 11:57:20 +0100 Subject: [PATCH 093/209] Some marshalling updates for WASM64 Updates marshalling logic still some issues. treat MONO_TYPE_U and MONO_TYPE_I as pointers also strings --- src/mono/browser/runtime/marshal-to-cs.ts | 6 +- src/mono/mono/mini/aot-runtime-wasm.c | 66 ++++++++++----------- src/mono/mono/mini/interp/interp-icalls.c | 9 ++- src/mono/mono/mini/interp/interp.c | 12 ++-- src/tasks/WasmAppBuilder/SignatureMapper.cs | 43 +++++++------- 5 files changed, 72 insertions(+), 64 deletions(-) diff --git a/src/mono/browser/runtime/marshal-to-cs.ts b/src/mono/browser/runtime/marshal-to-cs.ts index 326905214f9778..3865a4ddbea49b 100644 --- a/src/mono/browser/runtime/marshal-to-cs.ts +++ b/src/mono/browser/runtime/marshal-to-cs.ts @@ -15,7 +15,8 @@ import { set_arg_length, get_arg, get_signature_arg1_type, get_signature_arg2_type, js_to_cs_marshalers, get_signature_res_type, bound_js_function_symbol, set_arg_u16, array_element_size, get_string_root, Span, ArraySegment, MemoryViewType, get_signature_arg3_type, set_arg_i64_big, set_arg_intptr, - set_arg_element_type, ManagedObject, JavaScriptMarshalerArgSize, proxy_debug_symbol, get_arg_gc_handle, get_arg_type, set_arg_proxy_context, get_arg_intptr + set_arg_element_type, ManagedObject, JavaScriptMarshalerArgSize, proxy_debug_symbol, get_arg_gc_handle, get_arg_type, set_arg_proxy_context, get_arg_intptr, + add_offset } from "./marshal"; import { get_marshaler_to_js_by_type } from "./marshal-to-js"; import { _zero_region, fixupPointer, localHeapViewF64, localHeapViewI32, localHeapViewU8, malloc } from "./memory"; @@ -82,7 +83,8 @@ export function bind_arg_marshal_to_cs (sig: JSMarshalerType, marshaler_type: Ma const arg_offset = index * JavaScriptMarshalerArgSize; return (args: JSMarshalerArguments, value: any) => { - converter(args + arg_offset, value, element_type, res_marshaler, arg1_marshaler, arg2_marshaler, arg3_marshaler); + // @ts-expect-error TS2352: + converter(add_offset(args, arg_offset) as JSMarshalerArgument, value, element_type, res_marshaler, arg1_marshaler, arg2_marshaler, arg3_marshaler); }; } diff --git a/src/mono/mono/mini/aot-runtime-wasm.c b/src/mono/mono/mini/aot-runtime-wasm.c index deed5a448dcf0f..0e4ff31262d354 100644 --- a/src/mono/mono/mini/aot-runtime-wasm.c +++ b/src/mono/mono/mini/aot-runtime-wasm.c @@ -14,6 +14,12 @@ #include #ifdef HOST_WASM +#if SIZEOF_VOID_P == 4 +static const char ptrChar = 'I'; +#else +static const char ptrChar = 'L'; +#endif + static char type_to_c (MonoType *t, gboolean *is_byref_return) { @@ -22,7 +28,9 @@ type_to_c (MonoType *t, gboolean *is_byref_return) if (is_byref_return) *is_byref_return = 0; if (m_type_is_byref (t)) - return 'I'; + { + return ptrChar; + } handle_enum: switch (t->type) { @@ -34,40 +42,28 @@ type_to_c (MonoType *t, gboolean *is_byref_return) case MONO_TYPE_U2: case MONO_TYPE_I4: case MONO_TYPE_U4: -#if SIZEOF_VOID_P == 4 - case MONO_TYPE_I: - case MONO_TYPE_U: + return 'I'; + case MONO_TYPE_I: + case MONO_TYPE_U: case MONO_TYPE_PTR: case MONO_TYPE_SZARRAY: case MONO_TYPE_CLASS: case MONO_TYPE_OBJECT: case MONO_TYPE_STRING: -#else - case MONO_TYPE_I: - case MONO_TYPE_U: -#endif - return 'I'; + return ptrChar; case MONO_TYPE_R4: return 'F'; case MONO_TYPE_R8: return 'D'; break; -#if SIZEOF_VOID_P == 4 - case MONO_TYPE_I8: - case MONO_TYPE_U8: -#else case MONO_TYPE_I8: - case MONO_TYPE_U8: - case MONO_TYPE_PTR: - case MONO_TYPE_SZARRAY: - case MONO_TYPE_CLASS: - case MONO_TYPE_OBJECT: - case MONO_TYPE_STRING: -#endif + case MONO_TYPE_U8: return 'L'; case MONO_TYPE_VOID: return 'V'; case MONO_TYPE_VALUETYPE: { + MH_LOG_INDENT(); + MH_LOG("Handling valuetype %s", mono_type_full_name (t)); if (m_class_is_enumtype (m_type_data_get_klass_unchecked (t))) { t = mono_class_enum_basetype_internal (m_type_data_get_klass_unchecked (t)); goto handle_enum; @@ -83,11 +79,7 @@ type_to_c (MonoType *t, gboolean *is_byref_return) if (is_byref_return) *is_byref_return = 1; - #if SIZEOF_VOID_P == 4 - return 'I'; - #else - return 'L'; - #endif + return ptrChar; } case MONO_TYPE_GENERICINST: { // This previously erroneously used m_type_data_get_klass which isn't legal for genericinst, we have to use class_from_mono_type_internal @@ -101,11 +93,7 @@ type_to_c (MonoType *t, gboolean *is_byref_return) return 'S'; } - #if SIZEOF_VOID_P == 4 - return 'I'; - #else - return 'L'; - #endif + return ptrChar; } default: g_warning ("CANT TRANSLATE %s", mono_type_full_name (t)); @@ -137,7 +125,7 @@ get_long_arg (InterpMethodArguments *margs, int idx) return p.l; #else MH_LOG_INDENT(); - MH_LOG("Getting long arg [%d]: %ld", idx, (gint64)(gssize)margs->iargs [idx]); + MH_LOG("Getting long arg [%d]: %lld", idx, (gint64)(gssize)margs->iargs [idx]); MH_LOG_UNINDENT(); return (gint64)(gssize)margs->iargs [idx]; #endif @@ -204,6 +192,8 @@ mono_wasm_get_interp_to_native_trampoline (MonoMethodSignature *sig) memset (cookie, 0, 32); cookie [0] = type_to_c (sig->ret, &is_byref_return); + MH_LOG_INDENT(); + MH_LOG("Parameter cookie[0] = %c (from type: %s (enum: %d))\n", cookie [0], mono_type_get_name_full(sig->ret, MONO_TYPE_NAME_FORMAT_FULL_NAME), (int)sig->ret->type); c_count = sig->param_count + sig->hasthis + is_byref_return + 1; g_assert (c_count < sizeof (cookie)); //ensure we don't overflow the local @@ -211,18 +201,28 @@ mono_wasm_get_interp_to_native_trampoline (MonoMethodSignature *sig) if (is_byref_return) { cookie[0] = 'V'; // return value address goes in arg0 - cookie[1] = 'I'; + cookie[1] = ptrChar; + MH_LOG_INDENT(); + MH_LOG("Return value is byref: cookie[0][1] = %c, %c", cookie [0], cookie [1]); + MH_LOG_UNINDENT(); offset += 1; } if (sig->hasthis) { // thisptr goes in arg0/arg1 depending on return type - cookie [offset] = 'I'; + cookie [offset] = ptrChar; + MH_LOG_INDENT(); + MH_LOG("Sig hasthis: value is byref: cookie[%d] = %c", offset, cookie [offset]); + MH_LOG_UNINDENT(); offset += 1; } + for (int i = 0; i < sig->param_count; ++i) { cookie [offset + i] = type_to_c (sig->params [i], NULL); + MH_LOG("Parameter cookie[%d] = %c (from type: %s)\n", offset + i, cookie [offset + i], mono_type_get_name_full(sig->params[i], MONO_TYPE_NAME_FORMAT_FULL_NAME)); } + MH_LOG_UNINDENT(); logCookie(c_count, cookie); + void *p = mono_wasm_interp_to_native_callback (cookie); if (!p) g_error ("CANNOT HANDLE INTERP ICALL SIG %s\n", cookie); diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index 1e945174bc0c9d..8fddd6f049caab 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -96,6 +96,7 @@ stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean MH_LOG("Converting data to stackval for type %s", mono_type_get_name (type)); if (m_type_is_byref (type)) { result->data.p = *(gpointer*)data; + MH_LOG_UNINDENT(); return; } switch (type->type) { @@ -184,13 +185,17 @@ static char * log_sig(MonoMethodSignature* sig) { char buffer[256]; int offset = 0; + MH_LOG_INDENT(); for (int i = 0; i < sig->param_count; ++i) { - MonoType* tp = sig->params[i]; + MonoType* tp = sig->params[i]; + MH_LOG("Param %d: %s", (int)tp->type, mono_type_get_name (tp)); if(tp) offset += sprintf(buffer + offset, "%d", interp_type_as_ptr8(tp) ? 8 : interp_type_as_ptr4(tp) ? 4 : 0); else offset += sprintf(buffer + offset, "E"); + } + MH_LOG_UNINDENT(); if (!sig->param_count) offset += sprintf(buffer + offset, "V"); offset += sprintf(buffer + offset, "_%s", sig->ret->type == MONO_TYPE_VOID ? "V" : (interp_type_as_ptr4(sig->ret) ? "4" : "8")); @@ -743,6 +748,7 @@ do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval } case MINT_ICALLSIG_PPPPP_V: case MINT_ICALLSIG_PPPPP_P: { + log_sig(sig); // just here for a breakpoint if (!strcmp(sigTest,"44444_V")) { typedef void (*T)(I4,I4,I4,I4,I4); T func = (T)ptr; @@ -1227,6 +1233,7 @@ do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval } case MINT_ICALLSIG_PPPPPP_V: case MINT_ICALLSIG_PPPPPP_P: { + log_sig(sig); // just here for a breakpoint if (!strcmp(sigTest,"444444_V")) { typedef void (*T)(I4,I4,I4,I4,I4,I4); T func = (T)ptr; diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index 246647bbd3a3cd..d74abfc15f0017 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -2093,6 +2093,9 @@ interp_entry (InterpEntryData *data) g_assert (context->stack_pointer < context->stack_end); MONO_ENTER_GC_UNSAFE; + MH_LOG_INDENT(); + MH_LOG("calling mono_interp_exec_method for %s : %s", method->name, mono_method_full_name (method, TRUE)); + MH_LOG_UNINDENT(); mono_interp_exec_method (&frame, context, NULL); MONO_EXIT_GC_UNSAFE; @@ -7856,13 +7859,8 @@ interp_parse_options (const char *options) opt = INTERP_OPT_TIERING; else if (strncmp (arg, "simd", 4) == 0) opt = INTERP_OPT_SIMD; -#if HOST_BROWSER - else if (strncmp (arg, "jiterp", 6) == 0) - { - #pragma message ("ENABLING JITERPRETER!!") - opt = INTERP_OPT_JITERPRETER; - } -#endif + else if (strncmp (arg, "jiterp", 6) == 0) + opt = INTERP_OPT_JITERPRETER; else if (strncmp (arg, "ssa", 3) == 0) opt = INTERP_OPT_SSA; else if (strncmp (arg, "precise", 7) == 0) diff --git a/src/tasks/WasmAppBuilder/SignatureMapper.cs b/src/tasks/WasmAppBuilder/SignatureMapper.cs index 622b0ba2fb0a6a..7fbcef704bd9a7 100644 --- a/src/tasks/WasmAppBuilder/SignatureMapper.cs +++ b/src/tasks/WasmAppBuilder/SignatureMapper.cs @@ -21,10 +21,17 @@ internal static class SignatureMapper } char? c = null; +#if SignatureMappingWasm64 + const char ptrChar = 'L'; // Pointer types are L for wasm64 + const string refVoid = "VL"; // ByRef structs are passed as a pointer to the struct in slot 0 +#else + const char ptrChar = 'I'; // Pointer types are I for wasm32 + const string refVoid = "VI"; // ByRef structs are passed as a pointer to the struct in slot 0 +#endif if (t.Namespace == "System") { c = t.Name switch { - nameof(String) => 'I', + nameof(String) => ptrChar, nameof(Boolean) => 'I', nameof(Char) => 'I', nameof(SByte) => 'I', @@ -37,40 +44,33 @@ internal static class SignatureMapper nameof(UInt64) => 'L', nameof(Single) => 'F', nameof(Double) => 'D', - // FIXME: These will need to be L for wasm64 -#if SignatureMappingWasm64 - nameof(IntPtr) => 'L', - nameof(UIntPtr) => 'L', -#else - nameof(IntPtr) => 'I', - nameof(UIntPtr) => 'I', -#endif + nameof(IntPtr) => ptrChar, + nameof(UIntPtr) => ptrChar, "Void" => 'V', _ => null }; } if (c == null) - { - // FIXME: Most of these need to be L for wasm64 + { if (t.IsArray) - c = 'I'; + c = ptrChar; else if (t.IsByRef) - c = 'I'; + c = ptrChar; else if (typeof(Delegate).IsAssignableFrom(t)) // FIXME: Should we narrow this to only certain types of delegates? - c = 'I'; + c = ptrChar; else if (t.IsClass) - c = 'I'; + c = ptrChar; else if (t.IsInterface) - c = 'I'; + c = ptrChar; else if (t.IsEnum) { Type underlyingType = t.GetEnumUnderlyingType(); c = TypeToChar(underlyingType, log, out _, ++depth); } else if (t.IsPointer) - c = 'I'; + c = ptrChar; else if (PInvokeTableGenerator.IsFunctionPointer(t)) - c = 'I'; + c = ptrChar; else if (t.IsValueType) { var fields = t.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); @@ -78,7 +78,7 @@ internal static class SignatureMapper Type fieldType = fields[0].FieldType; return TypeToChar(fieldType, log, out isByRefStruct, ++depth); } else if (PInvokeTableGenerator.IsBlittable(t, log)) - c = 'I'; + c =ptrChar; isByRefStruct = true; } @@ -90,8 +90,9 @@ internal static class SignatureMapper } public static string? MethodToSignature(MethodInfo method, LogAdapter log) - { + { string? result = TypeToChar(method.ReturnType, log, out bool resultIsByRef)?.ToString(); + if (result == null) { return null; @@ -99,7 +100,7 @@ internal static class SignatureMapper if (resultIsByRef) { // WASM abi passes a result-pointer in slot 0 instead of returning struct results - result = "VI"; + result = refVoid; } foreach (var parameter in method.GetParameters()) From a2003fb740026c71ac30cf902aaa69fb21b17011 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 26 Jun 2025 13:30:12 +0100 Subject: [PATCH 094/209] Make ptrChar and refVoid available to other methods --- src/tasks/WasmAppBuilder/SignatureMapper.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/tasks/WasmAppBuilder/SignatureMapper.cs b/src/tasks/WasmAppBuilder/SignatureMapper.cs index 7fbcef704bd9a7..49c648eb2a40e4 100644 --- a/src/tasks/WasmAppBuilder/SignatureMapper.cs +++ b/src/tasks/WasmAppBuilder/SignatureMapper.cs @@ -11,6 +11,14 @@ internal static class SignatureMapper { +#if SignatureMappingWasm64 + private const char ptrChar = 'L'; // Pointer types are L for wasm64 + private const string refVoid = "VL"; // ByRef structs are passed as a pointer to the struct in slot 0 +#else + private const char ptrChar = 'I'; // Pointer types are I for wasm32 + private const string refVoid = "VI"; // ByRef structs are passed as a pointer to the struct in slot 0 +#endif + internal static char? TypeToChar(Type t, LogAdapter log, out bool isByRefStruct, int depth = 0) { isByRefStruct = false; @@ -21,13 +29,7 @@ internal static class SignatureMapper } char? c = null; -#if SignatureMappingWasm64 - const char ptrChar = 'L'; // Pointer types are L for wasm64 - const string refVoid = "VL"; // ByRef structs are passed as a pointer to the struct in slot 0 -#else - const char ptrChar = 'I'; // Pointer types are I for wasm32 - const string refVoid = "VI"; // ByRef structs are passed as a pointer to the struct in slot 0 -#endif + if (t.Namespace == "System") { c = t.Name switch { From c7152013bfd6695a755844fa06a342400897d0f4 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 26 Jun 2025 13:30:24 +0100 Subject: [PATCH 095/209] Logging update --- src/mono/mono/profiler/browser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/profiler/browser.c b/src/mono/mono/profiler/browser.c index 9fd0eebdd164c1..83e040afb66291 100644 --- a/src/mono/mono/profiler/browser.c +++ b/src/mono/mono/profiler/browser.c @@ -133,7 +133,7 @@ method_leave (MonoProfiler *prof, MonoMethod *method, MonoProfilerCallContext *c ProfilerStackFrame *top_frame = &profiler_stack_frames[top_index]; if (!is_over) { - g_assertf(top_frame->method == method, "method_exc_leave: %d method mismatch top_frame %s != leave %s\n", top_stack_frame_index, mono_method_get_full_name (top_frame->method), mono_method_get_full_name (method)); + g_assertf(top_frame->method == method, "method_exc_leave: %d method mismatch. Pointer comparison: %p : %p. \ntop_frame %s != leave %s. \n", top_stack_frame_index, top_frame->method, method, mono_method_get_full_name (top_frame->method), mono_method_get_full_name (method)); g_assertf(!ctx || !top_frame->interp_frame || top_frame->interp_frame == ctx->interp_frame, "method_exc_leave: %d interp_frame mismatch top_frame %p != leave %p\n", top_stack_frame_index, top_frame->interp_frame, ctx->interp_frame); } From 28ce1b58b744bef853a1e8f1b19dfb3a66f10cb6 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 26 Jun 2025 13:30:44 +0100 Subject: [PATCH 096/209] Logging --- src/mono/mono/mini/interp/interp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index d74abfc15f0017..1dc2f2d422b906 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -1990,10 +1990,11 @@ interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject context->stack_pointer = (guchar*)(sp + 4); g_assert (context->stack_pointer < context->stack_end); MH_LOG_INDENT(); - MH_LOG("calling mono_interp_exec_method for %s : %s", method->name, mono_method_full_name (method, TRUE)); + MH_LOG("calling mono_interp_exec_method for %s", mono_method_full_name (method, TRUE)); MONO_ENTER_GC_UNSAFE; mono_interp_exec_method (&frame, context, NULL); MONO_EXIT_GC_UNSAFE; + MH_LOG("completed mono_interp_exec_method for %s", mono_method_full_name (method, TRUE)); MH_LOG_UNINDENT(); context->stack_pointer = (guchar*)sp; From a774e89aef02ef8e35ce07d2c39ed608a8c60283 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 26 Jun 2025 13:31:27 +0100 Subject: [PATCH 097/209] Use data.p for MONO_TYPE_U and MONO_TYPE_I --- src/mono/mono/mini/interp/interp-icalls.c | 2 +- src/mono/mono/mini/interp/interp-pinvoke.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index 8fddd6f049caab..b3223269e4ff36 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -121,7 +121,7 @@ stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean break; case MONO_TYPE_U: case MONO_TYPE_I: - result->data.nati = *(mono_i*)data; + result->data.p = *(gpointer*)data; break; case MONO_TYPE_PTR: case MONO_TYPE_FNPTR: diff --git a/src/mono/mono/mini/interp/interp-pinvoke.c b/src/mono/mono/mini/interp/interp-pinvoke.c index 56319bd1f2819d..19eb769a828205 100644 --- a/src/mono/mono/mini/interp/interp-pinvoke.c +++ b/src/mono/mono/mini/interp/interp-pinvoke.c @@ -749,13 +749,13 @@ stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) but in practice it sometimes doesn't (a int32 gets dup'd and stloc'd into a native int - both by csc and mcs). Not sure what to do about sign extension as it is outside the spec... doing the obvious */ - *p = (mono_i)val->data.nati; + *p = (mono_i)val->data.p; return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_U: { mono_u *p = (mono_u*)data; /* see above. */ - *p = (mono_u)val->data.nati; + *p = (mono_u)val->data.p; return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_I4: From 8f9ca98755b6dd353116688020a2f3e9aafb5d0c Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 27 Jun 2025 13:26:51 +0100 Subject: [PATCH 098/209] hardcode port --- src/mono/sample/wasm/simple-server/Program.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mono/sample/wasm/simple-server/Program.cs b/src/mono/sample/wasm/simple-server/Program.cs index 692eaddd017725..5a5cf48876923f 100644 --- a/src/mono/sample/wasm/simple-server/Program.cs +++ b/src/mono/sample/wasm/simple-server/Program.cs @@ -94,7 +94,8 @@ public static int Main(string[] args) private bool StartServer() { - var port = 8000 + Random.Shared.Next(1000); + //var port = 8000 + Random.Shared.Next(1000); + var port = 8002; var listener = new HttpListener(); var url = $"http://localhost:{port}/"; listener.Prefixes.Add(url); From 3e9bc1d009486617ee4d0a8698bb3941cd76710d Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 27 Jun 2025 13:27:24 +0100 Subject: [PATCH 099/209] default jiterpreter options off --- src/mono/mono/utils/options-def.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mono/mono/utils/options-def.h b/src/mono/mono/utils/options-def.h index 2397b3dd4ede3a..e7ac6c8fd36210 100644 --- a/src/mono/mono/utils/options-def.h +++ b/src/mono/mono/utils/options-def.h @@ -74,11 +74,11 @@ DEFINE_BOOL(interp_codegen_timing, "interp-codegen-timing", FALSE, "Measure time // jiterpreter AOT optimizations aren't thread safe yet #ifdef DISABLE_THREADS // traces_enabled controls whether the jiterpreter will JIT individual interpreter opcode traces -DEFINE_BOOL(jiterpreter_traces_enabled, "jiterpreter-traces-enabled", TRUE, "JIT interpreter opcode traces into WASM") +DEFINE_BOOL(jiterpreter_traces_enabled, "jiterpreter-traces-enabled", FALSE, "JIT interpreter opcode traces into WASM") // interp_entry_enabled controls whether specialized interp_entry wrappers will be jitted -DEFINE_BOOL(jiterpreter_interp_entry_enabled, "jiterpreter-interp-entry-enabled", TRUE, "JIT specialized WASM interp_entry wrappers") +DEFINE_BOOL(jiterpreter_interp_entry_enabled, "jiterpreter-interp-entry-enabled", FALSE, "JIT specialized WASM interp_entry wrappers") // jit_call_enabled controls whether do_jit_call will use specialized trampolines for hot call sites -DEFINE_BOOL(jiterpreter_jit_call_enabled, "jiterpreter-jit-call-enabled", TRUE, "JIT specialized WASM do_jit_call trampolines") +DEFINE_BOOL(jiterpreter_jit_call_enabled, "jiterpreter-jit-call-enabled", FALSE, "JIT specialized WASM do_jit_call trampolines") DEFINE_BOOL(wasm_gc_safepoints, "wasm-gc-safepoints", FALSE, "Use GC safepoints on WASM") #else From 78df75015fcda5fa2aac2fc20929d30bd4d75925 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 30 Jun 2025 10:49:57 +0100 Subject: [PATCH 100/209] Build issue resolved --- .../browser/runtime/cancelable-promise.ts | 28 +++++++++++++------ src/mono/browser/runtime/dotnet.d.ts | 1 + src/mono/browser/runtime/exports.ts | 2 ++ src/mono/browser/runtime/invoke-js.ts | 12 ++++---- src/mono/browser/runtime/marshal-to-js.ts | 2 +- src/mono/browser/runtime/marshal.ts | 27 ++++++++++++++---- src/mono/browser/runtime/memory.ts | 12 ++++++++ src/mono/browser/runtime/rollup.config.js | 2 ++ src/mono/browser/runtime/types/consts.d.ts | 5 ++++ src/mono/browser/runtime/types/index.ts | 1 + src/mono/browser/runtime/types/internal.ts | 2 +- 11 files changed, 70 insertions(+), 24 deletions(-) diff --git a/src/mono/browser/runtime/cancelable-promise.ts b/src/mono/browser/runtime/cancelable-promise.ts index fa4e11fe07ee08..b81bd0cf875e83 100644 --- a/src/mono/browser/runtime/cancelable-promise.ts +++ b/src/mono/browser/runtime/cancelable-promise.ts @@ -1,14 +1,11 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - -import WasmEnableThreads from "consts:wasmEnableThreads"; - import { _lookup_js_owned_object, teardown_managed_proxy, upgrade_managed_proxy_to_strong_ref } from "./gc-handles"; import { createPromiseController, loaderHelpers, mono_assert } from "./globals"; import { ControllablePromise, GCHandle, MarshalerToCs } from "./types/internal"; import { ManagedObject } from "./marshal"; -import { compareExchangeI32, forceThreadMemoryViewRefresh } from "./memory"; -import { mono_log_debug } from "./logging"; +import { compareExchangeI32, compareExchangeI64, forceThreadMemoryViewRefresh } from "./memory"; +import { mono_log_debug } from "../runtime/logging"; import { complete_task } from "./managed-exports"; import { marshal_cs_object_to_cs } from "./marshal-to-cs"; import { invoke_later_when_on_ui_thread_async } from "./invoke-js"; @@ -56,6 +53,8 @@ const enum PromiseHolderState { } const promise_holder_symbol = Symbol.for("wasm promise_holder"); +const WasmEnableThreads = false; +const IsWasm64 = false; export class PromiseHolder extends ManagedObject { public isResolved = false; @@ -65,19 +64,30 @@ export class PromiseHolder extends ManagedObject { public reason: any = undefined; public constructor (public promise: Promise, private gc_handle: GCHandle, - private promiseHolderPtr: number, // could be null for GCV_handle + private promiseHolderPtr: number | bigint, // could be null for GCV_handle private res_converter?: MarshalerToCs) { super(); } - // returns false if the promise is being canceled by another thread in managed code setIsResolving (): boolean { if (!WasmEnableThreads || this.promiseHolderPtr === 0) { return true; } forceThreadMemoryViewRefresh(); - if (compareExchangeI32(this.promiseHolderPtr + PromiseHolderState.IsResolving, 1, 0) === 0) { - return true; + if (IsWasm64) { + const ptr = typeof this.promiseHolderPtr === "bigint" + ? this.promiseHolderPtr + BigInt(PromiseHolderState.IsResolving) // PromiseHolderState.IsResolving is 0 + : BigInt(this.promiseHolderPtr) + BigInt(0); + if (compareExchangeI64(ptr, 1n, 0n) === 0n) { + return true; + } + } else { + const ptr = typeof this.promiseHolderPtr === "number" + ? this.promiseHolderPtr + PromiseHolderState.IsResolving // PromiseHolderState.IsResolving is 0 + : Number(this.promiseHolderPtr) + PromiseHolderState.IsResolving; + if (compareExchangeI32(ptr, 1, 0) === 0) { + return true; + } } return false; } diff --git a/src/mono/browser/runtime/dotnet.d.ts b/src/mono/browser/runtime/dotnet.d.ts index b8f72137c81be9..16048fefc792d3 100644 --- a/src/mono/browser/runtime/dotnet.d.ts +++ b/src/mono/browser/runtime/dotnet.d.ts @@ -642,6 +642,7 @@ type RuntimeAPI = { wasmEnableThreads: boolean; wasmEnableSIMD: boolean; wasmEnableExceptionHandling: boolean; + isWasm64: boolean; }; } & APIType; type ModuleAPI = { diff --git a/src/mono/browser/runtime/exports.ts b/src/mono/browser/runtime/exports.ts index 3dc0117767161b..22098ed0327f2a 100644 --- a/src/mono/browser/runtime/exports.ts +++ b/src/mono/browser/runtime/exports.ts @@ -5,6 +5,7 @@ import ProductVersion from "consts:productVersion"; import BuildConfiguration from "consts:configuration"; import WasmEnableThreads from "consts:wasmEnableThreads"; import WasmEnableSIMD from "consts:wasmEnableSIMD"; +import IsWasm64 from "consts:isWasm64"; import WasmEnableExceptionHandling from "consts:wasmEnableExceptionHandling"; import { type RuntimeAPI } from "./types"; @@ -63,6 +64,7 @@ function initializeExports (globalObjects: GlobalObjects): RuntimeAPI { wasmEnableThreads: WasmEnableThreads, wasmEnableSIMD: WasmEnableSIMD, wasmEnableExceptionHandling: WasmEnableExceptionHandling, + IsWasm64: IsWasm64 }, ...API, }); diff --git a/src/mono/browser/runtime/invoke-js.ts b/src/mono/browser/runtime/invoke-js.ts index 24c154d8a22d68..d39c269fa13356 100644 --- a/src/mono/browser/runtime/invoke-js.ts +++ b/src/mono/browser/runtime/invoke-js.ts @@ -3,6 +3,8 @@ import WasmEnableThreads from "consts:wasmEnableThreads"; import BuildConfiguration from "consts:configuration"; +//import isWasm64 from "consts:isWasm64" +const isWasm64 = true; // TODO: remove hardcoding! import { marshal_exception_to_cs, bind_arg_marshal_to_cs, marshal_task_to_cs } from "./marshal-to-cs"; import { get_signature_argument_count, bound_js_function_symbol, get_sig, get_signature_version, get_signature_type, imported_js_function_symbol, get_signature_handle, get_signature_function_name, get_signature_module_name, is_receiver_should_free, get_caller_native_tid, get_sync_done_semaphore_ptr, get_arg } from "./marshal"; @@ -18,10 +20,6 @@ import { threads_c_functions as tcwraps } from "./cwraps"; import { monoThreadInfo } from "./pthreads"; import { stringToUTF16Ptr } from "./strings"; -export function isWasm64 (): boolean { - // This is a common runtime check, adjust if you have a better flag - return typeof Module.HEAP64 !== "undefined"; -} export function safeBigIntToNumber (ptr: bigint): number { if (ptr > BigInt(Number.MAX_SAFE_INTEGER) || ptr < BigInt(Number.MIN_SAFE_INTEGER)) { throw new Error(`Pointer value ${ptr} is out of safe integer range for JavaScript numbers.`); @@ -35,16 +33,16 @@ function toPointerForWasm (signature: number, wasm64: boolean): number | bigint } export function mono_wasm_bind_js_import_ST (signature: JSFunctionSignature): number | bigint { - if (WasmEnableThreads) return isWasm64() ? 0n : 0; + if (WasmEnableThreads) return isWasm64 ? 0n : 0; assert_js_interop(); signature = fixupPointer(signature, 0); try { bind_js_import(signature); - return isWasm64() ? (BigInt("0") as any) : 0; + return isWasm64 ? (BigInt("0") as any) : 0; } catch (ex: any) { const ptr = stringToUTF16Ptr(normalize_exception(ex)); // @ts-expect-error TS2352: convert VoidPtr (number) to bigint for wasm64, or keep it as number for wasm32. - return toPointerForWasm(ptr as number, isWasm64()); + return toPointerForWasm(ptr as number, isWasm64); } } diff --git a/src/mono/browser/runtime/marshal-to-js.ts b/src/mono/browser/runtime/marshal-to-js.ts index 73694dd9287e45..3eea9eb76a1d55 100644 --- a/src/mono/browser/runtime/marshal-to-js.ts +++ b/src/mono/browser/runtime/marshal-to-js.ts @@ -170,7 +170,7 @@ function _marshal_double_to_js (arg: JSMarshalerArgument): number | null { return get_arg_f64(arg); } -function _marshal_intptr_to_js (arg: JSMarshalerArgument): number | null { +function _marshal_intptr_to_js (arg: JSMarshalerArgument): number | bigint | null { const type = get_arg_type(arg); if (type == MarshalerType.None) { return null; diff --git a/src/mono/browser/runtime/marshal.ts b/src/mono/browser/runtime/marshal.ts index ebae9b3d0e53c4..3af41a50dea924 100644 --- a/src/mono/browser/runtime/marshal.ts +++ b/src/mono/browser/runtime/marshal.ts @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. import WasmEnableThreads from "consts:wasmEnableThreads"; +import isWasm64 from "consts:isWasm64"; +//const isWasm64 = true; // TODO: remove hardcoding! import { js_owned_gc_handle_symbol, teardown_managed_proxy } from "./gc-handles"; import { Module, loaderHelpers, mono_assert, runtimeHelpers } from "./globals"; @@ -11,6 +13,7 @@ import { GCHandle, JSHandle, MonoObject, MonoString, GCHandleNull, JSMarshalerAr import { TypedArray, VoidPtr } from "./types/emscripten"; import { utf16ToString } from "./strings"; import { get_managed_stack_trace } from "./managed-exports"; +import { mono_log_debug } from "./logging"; export const cs_to_js_marshalers = new Map(); export const js_to_cs_marshalers = new Map(); @@ -18,8 +21,8 @@ export const bound_cs_function_symbol = Symbol.for("wasm bound_cs_function"); export const bound_js_function_symbol = Symbol.for("wasm bound_js_function"); export const imported_js_function_symbol = Symbol.for("wasm imported_js_function"); export const proxy_debug_symbol = Symbol.for("wasm proxy_debug"); - export const JavaScriptMarshalerArgSize = 32; + // keep in sync with JSMarshalerArgumentImpl offsets const enum JSMarshalerArgumentOffsets { BooleanValue = 0, @@ -146,16 +149,19 @@ export function get_signature_res_type (sig: JSMarshalerType): MarshalerType { export function get_signature_arg1_type (sig: JSMarshalerType): MarshalerType { mono_assert(sig, "Null sig"); + mono_log_debug(`get_signature_arg1_type for sig '${sig}' is '${getU8(add_offset(sig, JSBindingTypeOffsets.Arg1MarshalerType))}'`); return getU8(add_offset(sig, JSBindingTypeOffsets.Arg1MarshalerType)) as any; } export function get_signature_arg2_type (sig: JSMarshalerType): MarshalerType { mono_assert(sig, "Null sig"); + mono_log_debug(`get_signature_arg3_type for sig '${sig}' is '${getU8(add_offset(sig, JSBindingTypeOffsets.Arg2MarshalerType))}'`); return getU8(add_offset(sig, JSBindingTypeOffsets.Arg2MarshalerType)) as any; } export function get_signature_arg3_type (sig: JSMarshalerType): MarshalerType { mono_assert(sig, "Null sig"); + mono_log_debug(`get_signature_arg3_type for sig '${sig}' is '${getU8(add_offset(sig, JSBindingTypeOffsets.Arg3MarshalerType))}'`); return getU8(add_offset(sig, JSBindingTypeOffsets.Arg3MarshalerType)) as any; } @@ -250,9 +256,9 @@ export function get_arg_i32 (arg: JSMarshalerArgument): number { return getI32(arg); } -export function get_arg_intptr (arg: JSMarshalerArgument): number { +export function get_arg_intptr (arg: JSMarshalerArgument): number | bigint { mono_assert(arg, "Null arg"); - return getU32(arg); + return isWasm64 ? getI64Big(arg) : getU32(arg); } export function get_arg_i52 (arg: JSMarshalerArgument): number { @@ -309,9 +315,17 @@ export function set_arg_i32 (arg: JSMarshalerArgument, value: number): void { setI32(arg, value); } -export function set_arg_intptr (arg: JSMarshalerArgument, value: VoidPtr): void { +export function set_arg_intptr (arg: JSMarshalerArgument, value: VoidPtr | bigint | number): void { mono_assert(arg, "Null arg"); - setU32(arg, value); + if (typeof arg === "number" || typeof arg === "bigint") { + mono_log_debug("set_arg_intptr: is already a pointer/address, skipping set"); + return; + } + if (isWasm64) { + setI64Big(arg, value as bigint); + } else { + setU32(arg, value as number); + } } export function set_arg_i52 (arg: JSMarshalerArgument, value: number): void { @@ -373,7 +387,8 @@ export function set_gc_handle (arg: JSMarshalerArgument, gcHandle: GCHandle): vo export function get_string_root (arg: JSMarshalerArgument): WasmRoot { mono_assert(arg, "Null arg"); - return mono_wasm_new_external_root(arg); + const ptr = get_arg_intptr(arg); + return mono_wasm_new_external_root(ptr); } export function get_arg_length (arg: JSMarshalerArgument): number { diff --git a/src/mono/browser/runtime/memory.ts b/src/mono/browser/runtime/memory.ts index 4437134aa6f669..594e1856aefecc 100644 --- a/src/mono/browser/runtime/memory.ts +++ b/src/mono/browser/runtime/memory.ts @@ -403,6 +403,18 @@ export function compareExchangeI32 (offset: MemOffset, value: number, expected: return globalThis.Atomics.compareExchange(localHeapViewI32(), offset >>> 2, expected, value); } +export function compareExchangeI64 (offset: MemOffset, value: bigint, expected: bigint): bigint { + mono_assert((offset & 7) === 0, () => `compareExchangeI64: offset must be 8-byte aligned, got ${offset}`); + if (!WasmEnableThreads) { + const actual = getI64Big(offset); + if (actual === expected) { + setI64Big(offset, value); + } + return actual; + } + return globalThis.Atomics.compareExchange(localHeapViewI64Big(), offset >>> 3, expected, value); +} + export function storeI32 (offset: MemOffset, value: number): void { mono_assert((offset & 3) === 0, () => `storeI32: offset must be 4-byte aligned, got ${offset}`); if (!WasmEnableThreads) return setI32(offset, value); diff --git a/src/mono/browser/runtime/rollup.config.js b/src/mono/browser/runtime/rollup.config.js index ec1de7d67b0f75..255ce2afbf44c3 100644 --- a/src/mono/browser/runtime/rollup.config.js +++ b/src/mono/browser/runtime/rollup.config.js @@ -19,6 +19,7 @@ const productVersion = process.env.ProductVersion || "8.0.0-dev"; const nativeBinDir = process.env.NativeBinDir ? process.env.NativeBinDir.replace(/"/g, "") : "bin"; const wasmObjDir = process.env.WasmObjDir ? process.env.WasmObjDir.replace(/"/g, "") : "obj"; const wasmEnableThreads = process.env.WasmEnableThreads === "true" ? true : false; +const isWasm64 = true; const wasmEnableSIMD = process.env.WASM_ENABLE_SIMD === "1" ? true : false; const wasmEnableExceptionHandling = process.env.WASM_ENABLE_EH === "1" ? true : false; const wasmEnableJsInteropByValue = process.env.ENABLE_JS_INTEROP_BY_VALUE == "1" ? true : false; @@ -117,6 +118,7 @@ const envConstants = { gitHash, wasmEnableJsInteropByValue, isContinuousIntegrationBuild, + isWasm64 }; const locationCache = {}; diff --git a/src/mono/browser/runtime/types/consts.d.ts b/src/mono/browser/runtime/types/consts.d.ts index a4934bcab18d71..b7a37198276d9b 100644 --- a/src/mono/browser/runtime/types/consts.d.ts +++ b/src/mono/browser/runtime/types/consts.d.ts @@ -12,6 +12,11 @@ declare module "consts:wasmEnableThreads" { export default constant; } +declare module "consts:isWasm64" { + const constant: boolean; + export default constant; +} + // this will throw exception if the condition is false // see src\mono\browser\runtime\rollup.config.js // inline this, because the lambda could allocate closure on hot path otherwise diff --git a/src/mono/browser/runtime/types/index.ts b/src/mono/browser/runtime/types/index.ts index e2653cc0d54580..0fad6be42790cf 100644 --- a/src/mono/browser/runtime/types/index.ts +++ b/src/mono/browser/runtime/types/index.ts @@ -606,6 +606,7 @@ export type RuntimeAPI = { wasmEnableThreads: boolean, wasmEnableSIMD: boolean, wasmEnableExceptionHandling: boolean, + isWasm64: boolean } } & APIType diff --git a/src/mono/browser/runtime/types/internal.ts b/src/mono/browser/runtime/types/internal.ts index ce6aef7e1ea125..074744f0a18a4a 100644 --- a/src/mono/browser/runtime/types/internal.ts +++ b/src/mono/browser/runtime/types/internal.ts @@ -403,7 +403,7 @@ export interface JSMarshalerArgument extends NativePointer { __brand: "JSMarshalerArgument" } -export type MemOffset = number | VoidPtr | NativePointer | ManagedPointer; +export type MemOffset = number | VoidPtr | NativePointer | ManagedPointer | bigint; export type NumberOrPointer = number | VoidPtr | NativePointer | ManagedPointer; export interface WasmRoot { From 89869b418c39a6f765f07f45bab6e7cd6e32167d Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 30 Jun 2025 12:49:28 +0100 Subject: [PATCH 101/209] remove problematic get_arg_intptr input already is an intptr --- src/mono/browser/runtime/marshal.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mono/browser/runtime/marshal.ts b/src/mono/browser/runtime/marshal.ts index 3af41a50dea924..cb49f4ac9226dc 100644 --- a/src/mono/browser/runtime/marshal.ts +++ b/src/mono/browser/runtime/marshal.ts @@ -387,8 +387,7 @@ export function set_gc_handle (arg: JSMarshalerArgument, gcHandle: GCHandle): vo export function get_string_root (arg: JSMarshalerArgument): WasmRoot { mono_assert(arg, "Null arg"); - const ptr = get_arg_intptr(arg); - return mono_wasm_new_external_root(ptr); + return mono_wasm_new_external_root(arg); } export function get_arg_length (arg: JSMarshalerArgument): number { From aa337f41c8bf04394eb42600b3618aac137cc25d Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 30 Jun 2025 12:52:12 +0100 Subject: [PATCH 102/209] Keep consistent with heap access method --- src/mono/browser/runtime/memory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/browser/runtime/memory.ts b/src/mono/browser/runtime/memory.ts index 594e1856aefecc..3bd53f7e5b6e65 100644 --- a/src/mono/browser/runtime/memory.ts +++ b/src/mono/browser/runtime/memory.ts @@ -280,7 +280,7 @@ export function getI32 (offset: MemOffset): number { } else { n = offset as number; } - return new DataView(Module.HEAPU8.buffer).getInt32(n, true); + return Module.HEAP32[n >>> 2]; } // does not check for growable heap From 9736e25648fda4aae9f8eb6d84835aa6c2d417e7 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 30 Jun 2025 16:12:55 +0100 Subject: [PATCH 103/209] remove unnecessary type check --- src/mono/browser/runtime/marshal.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/mono/browser/runtime/marshal.ts b/src/mono/browser/runtime/marshal.ts index cb49f4ac9226dc..fcaff0f0f37df3 100644 --- a/src/mono/browser/runtime/marshal.ts +++ b/src/mono/browser/runtime/marshal.ts @@ -317,10 +317,6 @@ export function set_arg_i32 (arg: JSMarshalerArgument, value: number): void { export function set_arg_intptr (arg: JSMarshalerArgument, value: VoidPtr | bigint | number): void { mono_assert(arg, "Null arg"); - if (typeof arg === "number" || typeof arg === "bigint") { - mono_log_debug("set_arg_intptr: is already a pointer/address, skipping set"); - return; - } if (isWasm64) { setI64Big(arg, value as bigint); } else { From 08c0554cba7dcac1ec7e9e2ebbbe192ed632fac7 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 30 Jun 2025 16:13:07 +0100 Subject: [PATCH 104/209] logging --- src/mono/mono/mini/interp/interp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index 1dc2f2d422b906..9076805689a09b 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -3365,9 +3365,11 @@ mono_interp_leave (InterpFrame* parent_frame) * to check the abort threshold. For this to work we use frame as a * dummy frame that is stored in the lmf and serves as the transition frame */ - + MH_LOG_INDENT(); + MH_LOG("Calling do_icall_wrapper for mono_thread_get_undeniable_exception\n"); do_icall_wrapper (&frame, NULL, MINT_ICALLSIG_V_P, &tmp_sp, &tmp_sp, (gpointer)mono_thread_get_undeniable_exception, FALSE, &gc_transitions); - + MH_LOG("..Finished calling do_icall_wrapper for mono_thread_get_undeniable_exception\n"); + MH_LOG_UNINDENT(); return (MonoException*)tmp_sp.data.p; } From 49aac1f59d01f68705cb549cb966b07b0ba48b57 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 30 Jun 2025 16:13:58 +0100 Subject: [PATCH 105/209] Temp logging & replace assert in profiler/browser.c with warning --- src/mono/mono/profiler/browser.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/mono/mono/profiler/browser.c b/src/mono/mono/profiler/browser.c index 83e040afb66291..f2fcf4a873dc7c 100644 --- a/src/mono/mono/profiler/browser.c +++ b/src/mono/mono/profiler/browser.c @@ -25,6 +25,7 @@ #include #include #include +#include struct _MonoProfiler { gboolean verbose; @@ -95,6 +96,8 @@ method_enter (MonoProfiler *prof, MonoMethod *method, MonoProfilerCallContext *c newframe->method = method; newframe->interp_frame = ctx ? ctx->interp_frame : NULL; } + MH_LOG_INDENT(); + MH_LOG("method_enter: %d %s\n", top_stack_frame_index, mono_method_get_full_name (method)); } static void @@ -132,6 +135,9 @@ method_leave (MonoProfiler *prof, MonoMethod *method, MonoProfilerCallContext *c int top_index = is_over ? MAX_STACK_DEPTH - 1 : top_stack_frame_index; ProfilerStackFrame *top_frame = &profiler_stack_frames[top_index]; + MH_LOG_UNINDENT(); + MH_LOG("method_leave: %d %s\n", top_stack_frame_index, mono_method_get_full_name (method)); + if (!is_over) { g_assertf(top_frame->method == method, "method_exc_leave: %d method mismatch. Pointer comparison: %p : %p. \ntop_frame %s != leave %s. \n", top_stack_frame_index, top_frame->method, method, mono_method_get_full_name (top_frame->method), mono_method_get_full_name (method)); g_assertf(!ctx || !top_frame->interp_frame || top_frame->interp_frame == ctx->interp_frame, "method_exc_leave: %d interp_frame mismatch top_frame %p != leave %p\n", top_stack_frame_index, top_frame->interp_frame, ctx->interp_frame); @@ -164,6 +170,9 @@ method_exc_leave (MonoProfiler *prof, MonoMethod *method, MonoObject *exc) int top_index = is_over ? MAX_STACK_DEPTH - 1 : top_stack_frame_index; ProfilerStackFrame *top_frame = &profiler_stack_frames[top_index]; + MH_LOG_UNINDENT(); + MH_LOG("method_exc_leave: %d %s\n", top_stack_frame_index, mono_method_get_full_name (method)); + if (top_frame->should_record || should_record_frame (mono_wasm_profiler_now ())) { // propagate should_record to parent, if any @@ -182,8 +191,14 @@ method_exc_leave (MonoProfiler *prof, MonoMethod *method, MonoObject *exc) if (!is_over) { top_index = is_over ? MAX_STACK_DEPTH - 1 : top_stack_frame_index; top_frame = &profiler_stack_frames[top_index]; - g_assertf(top_frame->method == method, "method_exc_leave: %d method mismatch top_frame %s != leave %s\n", top_stack_frame_index, mono_method_get_full_name (top_frame->method), mono_method_get_full_name (method)); + //g_assertf(top_frame->method == method, "method_exc_leave: %d method mismatch top_frame %s != leave %s\n", top_stack_frame_index, mono_method_get_full_name (top_frame->method), mono_method_get_full_name (method)); + if (top_frame->method != method) { + if (strcmp(mono_method_get_full_name(top_frame->method), mono_method_get_full_name(method)) != 0) { + g_warning("method_exc_leave: %d method mismatch top_frame %s != leave %s\n", top_stack_frame_index, mono_method_get_full_name(top_frame->method), mono_method_get_full_name(method)); + } + } } + } static void From 97bfc3c06dfabe8e605f0c94651522f0fcb2ae6e Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 30 Jun 2025 16:14:21 +0100 Subject: [PATCH 106/209] Move loop ahead of promise for simpler testing --- src/mono/sample/wasm/browser-advanced/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mono/sample/wasm/browser-advanced/main.js b/src/mono/sample/wasm/browser-advanced/main.js index 0bb31d8648cb07..e32ce97f8150a2 100644 --- a/src/mono/sample/wasm/browser-advanced/main.js +++ b/src/mono/sample/wasm/browser-advanced/main.js @@ -105,14 +105,16 @@ try { document.getElementById("out").innerHTML = `${meaning} as computed on dotnet ver ${runtimeBuildInfo.productVersion}`; } + exports.Sample.Test.SillyLoop(); + const deepMeaning = new Promise(resolve => setTimeout(() => resolve(meaning), 100)); exports.Sample.Test.PrintMeaning(deepMeaning); - exports.Sample.Test.SillyLoop(); + let exit_code = await runMain(config.mainAssemblyName, []); exit(exit_code); } catch (err) { exit(2, err); -} \ No newline at end of file +} From fc913f2d4105b6fd7909a541f693fb21a0629027 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 1 Jul 2025 15:25:48 +0100 Subject: [PATCH 107/209] remove interp-pinvoke this was split out to aid debugging, but it is also no longer directly debuggable --- src/mono/mono/mini/CMakeLists.txt | 4 +- src/mono/mono/mini/interp/interp-pinvoke.h | 23 --- src/mono/mono/mini/interp/interp.c | 204 +++++++++++++++++++-- 3 files changed, 186 insertions(+), 45 deletions(-) delete mode 100644 src/mono/mono/mini/interp/interp-pinvoke.h diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index 9ae1ac96d9e0b3..d632fc10f40936 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -240,9 +240,7 @@ set(interp_sources interp/interp-intrins.h interp/interp-intrins.c interp/interp-icalls.h - interp/interp-icalls.c - interp/interp-pinvoke.h - interp/interp-pinvoke.c + interp/interp-icalls.c interp/mintops.h interp/mintops.c interp/transform.c diff --git a/src/mono/mono/mini/interp/interp-pinvoke.h b/src/mono/mono/mini/interp/interp-pinvoke.h deleted file mode 100644 index b426e91b90df48..00000000000000 --- a/src/mono/mono/mini/interp/interp-pinvoke.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef __MONO_MINI_INTERP_PINVOKE_H__ -#define __MONO_MINI_INTERP_PINVOKE_H__ - -#include -#include -#include "mintops.h" -#include "interp-internals.h" - - -extern MONO_NO_OPTIMIZATION MONO_NEVER_INLINE gpointer -ves_pinvoke_method ( - InterpMethod *imethod, - MonoMethodSignature *sig, - MonoFuncV addr, - ThreadContext *context, - InterpFrame *parent_frame, - stackval *ret_sp, - stackval *sp, - gboolean save_last_error, - gpointer *cache, - gboolean *gc_transitions); - -#endif diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index 9076805689a09b..f5c0dccd9cdf19 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -65,7 +65,6 @@ #include "mintops.h" #include "interp-intrins.h" #include "interp-icalls.h" -#include "interp-pinvoke.h" #include "tiering.h" #ifdef INTERP_ENABLE_SIMD @@ -1189,6 +1188,7 @@ imethod_alloc0 (InterpMethod *imethod, guint size) return m_method_alloc0 (imethod->method, size); } + static guint32* initialize_arg_offsets (InterpMethod *imethod, MonoMethodSignature *csig) { @@ -1203,21 +1203,27 @@ initialize_arg_offsets (InterpMethod *imethod, MonoMethodSignature *csig) int arg_count = sig->hasthis + sig->param_count; guint32 *arg_offsets = (guint32*)imethod_alloc0 (imethod, (arg_count + 1) * sizeof (int)); int index = 0, offset = 0; - + MH_LOG_INDENT(); + MH_LOG("Getting arg offsets"); if (sig->hasthis) { arg_offsets [index++] = 0; offset = MINT_STACK_SLOT_SIZE; } - + MH_LOG_INDENT(); for (int i = 0; i < sig->param_count; i++) { MonoType *type = sig->params [i]; int size, align; + log_mono_type(type); + log_mint_type(mono_mint_type (type)); + MH_LOG_INDENT(); size = mono_interp_type_size (type, mono_mint_type (type), &align); - + MH_LOG("calculated size: %d - note includes alignment of %d", size, align); + MH_LOG_UNINDENT(); offset = ALIGN_TO (offset, align); arg_offsets [index++] = offset; offset += size; } + MH_LOG_UNINDENT(); // This index is not associated with an actual argument, we just store the offset // for convenience in order to easily determine the size of the param area used arg_offsets [index] = ALIGN_TO (offset, MINT_STACK_SLOT_SIZE); @@ -1225,6 +1231,7 @@ initialize_arg_offsets (InterpMethod *imethod, MonoMethodSignature *csig) mono_memory_write_barrier (); /* If this fails, the new one is leaked in the mem manager */ mono_atomic_cas_ptr ((gpointer*)&imethod->arg_offsets, arg_offsets, NULL); + MH_LOG_UNINDENT(); return imethod->arg_offsets; } @@ -1441,7 +1448,7 @@ get_build_args_from_sig_info (MonoMemoryManager *mem_manager, MonoMethodSignatur return info; } - +#define DEBUG_MH 1 static void build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, BuildArgsFromSigInfo *info, InterpFrame *frame) { @@ -1474,53 +1481,61 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui else margs->fargs = g_malloc0 (sizeof (double) * margs->flen); } - + MH_LOG_INDENT(); + MH_LOG("setting args from signature: %s", mono_signature_full_name (sig)); for (int i = 0; i < sig->param_count; i++) { + MH_LOG_INDENT(); guint32 offset = get_arg_offset (frame->imethod, sig, i); stackval *sp_arg = STACK_ADD_BYTES (frame->stack, offset); switch (info->arg_types [i]) { case PINVOKE_ARG_INT: margs->iargs [int_i] = sp_arg->data.p; -#if DEBUG_INTERP + MH_LOG("PINVOKE_ARG_INT"); +#if DEBUG_INTERP g_print ("build_args_from_sig: margs->iargs [%d]: %p (frame @ %d)\n", int_i, margs->iargs [int_i], i); #endif int_i++; break; case PINVOKE_ARG_R4: * (float *) &(margs->fargs [int_f]) = sp_arg->data.f_r4; -#if DEBUG_INTERP + MH_LOG("PINVOKE_ARG_R4"); +#if DEBUG_INTERP g_print ("build_args_from_sig: margs->fargs [%d]: %p (%f) (frame @ %d)\n", int_f, margs->fargs [int_f], margs->fargs [int_f], i); #endif int_f ++; break; case PINVOKE_ARG_R8: margs->fargs [int_f] = sp_arg->data.f; -#if DEBUG_INTERP + MH_LOG("PINVOKE_ARG_R8"); +#if DEBUG_INTERP g_print ("build_args_from_sig: margs->fargs [%d]: %p (%f) (frame @ %d)\n", int_f, margs->fargs [int_f], margs->fargs [int_f], i); #endif int_f ++; break; case PINVOKE_ARG_VTYPE: margs->iargs [int_i] = sp_arg; -#if DEBUG_INTERP + MH_LOG("PINVOKE_ARG_VTYPE"); +#if DEBUG_INTERP g_print ("build_args_from_sig: margs->iargs [%d]: %p (vt) (frame @ %d)\n", int_i, margs->iargs [int_i], i); #endif int_i++; break; case PINVOKE_ARG_SCALAR_VTYPE: + MH_LOG("PINVOKE_ARG_SCALAR_VTYPE"); margs->iargs [int_i] = *(gpointer*)sp_arg; -#if DEBUG_INTERP +#if DEBUG_INTERP g_print ("build_args_from_sig: margs->iargs [%d]: %p (vt) (frame @ %d)\n", int_i, margs->iargs [int_i], i); #endif int_i++; break; case PINVOKE_ARG_INT_PAIR: { + MH_LOG("PINVOKE_ARG_INT_PAIR"); margs->iargs [int_i] = (gpointer)(gssize)sp_arg->data.pair.lo; int_i++; margs->iargs [int_i] = (gpointer)(gssize)sp_arg->data.pair.hi; -#if DEBUG_INTERP +#if DEBUG_INTERP g_print ("build_args_from_sig: margs->iargs [%d/%d]: 0x%016" PRIx64 ", hi=0x%08x lo=0x%08x (frame @ %d)\n", int_i - 1, int_i, *((guint64 *) &margs->iargs [int_i - 1]), sp_arg->data.pair.hi, sp_arg->data.pair.lo, i); #endif int_i++; @@ -1530,10 +1545,15 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui g_assert_not_reached (); break; } + MH_LOG_UNINDENT(); } + MH_LOG_UNINDENT(); + MH_LOG_INDENT(); + MH_LOG("setting ret_pinvoke_type: %s", mono_signature_full_name (sig)); switch (info->ret_pinvoke_type) { case PINVOKE_ARG_WASM_VALUETYPE_RESULT: + MH_LOG("PINVOKE_ARG_WASM_VALUETYPE_RESULT"); // We pass the return value address in arg0 so fill it in, we already // reserved space for it earlier. g_assert (frame->retval); @@ -1543,20 +1563,24 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui margs->is_float_ret = 0; break; case PINVOKE_ARG_INT: + MH_LOG("PINVOKE_ARG_INT"); margs->retval = (gpointer*)frame->retval; margs->is_float_ret = 0; break; case PINVOKE_ARG_R8: + MH_LOG("PINVOKE_ARG_R8"); margs->retval = (gpointer*)frame->retval; margs->is_float_ret = 1; break; case PINVOKE_ARG_NONE: + MH_LOG("PINVOKE_ARG_NONE"); margs->retval = NULL; break; default: g_assert_not_reached (); break; } + MH_LOG_UNINDENT(); } #endif @@ -1633,6 +1657,150 @@ typedef struct { } WasmPInvokeCacheData; #endif +/* MONO_NO_OPTIMIZATION is needed due to usage of INTERP_PUSH_LMF_WITH_CTX. */ +#ifdef _MSC_VER +#pragma optimize ("", off) +#endif +static MONO_NO_OPTIMIZATION MONO_NEVER_INLINE gpointer +ves_pinvoke_method ( + InterpMethod *imethod, + MonoMethodSignature *sig, + MonoFuncV addr, + ThreadContext *context, + InterpFrame *parent_frame, + stackval *ret_sp, + stackval *sp, + gboolean save_last_error, + gpointer *cache, + gboolean *gc_transitions) +{ + InterpFrame frame = {0}; + frame.parent = parent_frame; + frame.imethod = imethod; + frame.stack = sp; + frame.retval = ret_sp; + + MonoLMFExt ext; + gpointer args; + + MONO_REQ_GC_UNSAFE_MODE; + +#ifdef HOST_WASM + /* + * Use a per-signature entry function. + * Cache it in imethod->data_items. + * This is GC safe. + */ + MonoPIFunc entry_func = NULL; + WasmPInvokeCacheData *cache_data = (WasmPInvokeCacheData*)*cache; + if (!cache_data) { + cache_data = g_new0 (WasmPInvokeCacheData, 1); + cache_data->entry_func = (MonoPIFunc)mono_wasm_get_interp_to_native_trampoline (sig); + cache_data->call_info = get_build_args_from_sig_info (get_default_mem_manager (), sig); + mono_memory_barrier (); + *cache = cache_data; + } + entry_func = cache_data->entry_func; +#else + static MonoPIFunc entry_func = NULL; + if (!entry_func) { + MONO_ENTER_GC_UNSAFE; +#ifdef MONO_ARCH_HAS_NO_PROPER_MONOCTX + ERROR_DECL (error); + entry_func = (MonoPIFunc) mono_jit_compile_method_jit_only (mini_get_interp_lmf_wrapper ("mono_interp_to_native_trampoline", (gpointer) mono_interp_to_native_trampoline), error); + mono_error_assert_ok (error); +#else + entry_func = get_interp_to_native_trampoline (); +#endif + mono_memory_barrier (); + MONO_EXIT_GC_UNSAFE; + } +#endif + + if (save_last_error) { + mono_marshal_clear_last_error (); + } + +#ifdef MONO_ARCH_HAVE_INTERP_PINVOKE_TRAMP + gpointer call_info = *cache; + + if (!call_info) { + call_info = mono_arch_get_interp_native_call_info (get_default_mem_manager (), sig); + mono_memory_barrier (); + *cache = call_info; + } + CallContext ccontext; + mono_arch_set_native_call_context_args (&ccontext, &frame, sig, call_info); + args = &ccontext; +#else + +#ifdef HOST_WASM + BuildArgsFromSigInfo *call_info = cache_data->call_info; +#else + BuildArgsFromSigInfo *call_info = NULL; + g_assert_not_reached (); +#endif + + InterpMethodArguments margs; + memset (&margs, 0, sizeof (InterpMethodArguments)); + build_args_from_sig (&margs, sig, call_info, &frame); + args = &margs; +#endif + + INTERP_PUSH_LMF_WITH_CTX (&frame, ext, exit_pinvoke); + + if (*gc_transitions) { + MONO_ENTER_GC_SAFE; + entry_func ((gpointer) addr, args); + MONO_EXIT_GC_SAFE; + *gc_transitions = FALSE; + } else { + entry_func ((gpointer) addr, args); + } + + if (save_last_error) + mono_marshal_set_last_error (); + interp_pop_lmf (&ext); + +#ifdef MONO_ARCH_HAVE_INTERP_PINVOKE_TRAMP +#ifdef MONO_ARCH_HAVE_SWIFTCALL + if (mono_method_signature_has_ext_callconv (sig, MONO_EXT_CALLCONV_SWIFTCALL)) { + int arg_index = -1; + gpointer data = mono_arch_get_swift_error (&ccontext, sig, &arg_index); + + // Perform an indirect store at arg_index stack location + if (arg_index >= 0) { + g_assert (data); + stackval *result = (stackval*) STACK_ADD_BYTES (frame.stack, get_arg_offset (frame.imethod, sig, arg_index)); + *(gpointer*)result->data.p = *(gpointer*)data; + } + } +#endif + if (!context->has_resume_state) { + mono_arch_get_native_call_context_ret (&ccontext, &frame, sig, call_info); + } + + g_free (ccontext.stack); +#else + // Only the vt address has been returned, we need to copy the entire content on interp stack + if (!context->has_resume_state && MONO_TYPE_ISSTRUCT (call_info->ret_mono_type)) { + if (call_info->ret_pinvoke_type != PINVOKE_ARG_WASM_VALUETYPE_RESULT) + stackval_from_data (call_info->ret_mono_type, frame.retval, (char*)frame.retval->data.p, sig->pinvoke && !sig->marshalling_disabled); + } + + if (margs.iargs != margs.iargs_buf) + g_free (margs.iargs); + if (margs.fargs != margs.fargs_buf) + g_free (margs.fargs); +#endif + goto exit_pinvoke; // prevent unused label warning in some configurations +exit_pinvoke: + return NULL; +} +#ifdef _MSC_VER +#pragma optimize ("", on) +#endif + /* * interp_init_delegate: * @@ -1990,11 +2158,10 @@ interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject context->stack_pointer = (guchar*)(sp + 4); g_assert (context->stack_pointer < context->stack_end); MH_LOG_INDENT(); - MH_LOG("calling mono_interp_exec_method for %s", mono_method_full_name (method, TRUE)); + MH_LOG("calling mono_interp_exec_method for %s : %s", method->name, mono_method_full_name (method, TRUE)); MONO_ENTER_GC_UNSAFE; mono_interp_exec_method (&frame, context, NULL); MONO_EXIT_GC_UNSAFE; - MH_LOG("completed mono_interp_exec_method for %s", mono_method_full_name (method, TRUE)); MH_LOG_UNINDENT(); context->stack_pointer = (guchar*)sp; @@ -2094,9 +2261,6 @@ interp_entry (InterpEntryData *data) g_assert (context->stack_pointer < context->stack_end); MONO_ENTER_GC_UNSAFE; - MH_LOG_INDENT(); - MH_LOG("calling mono_interp_exec_method for %s : %s", method->name, mono_method_full_name (method, TRUE)); - MH_LOG_UNINDENT(); mono_interp_exec_method (&frame, context, NULL); MONO_EXIT_GC_UNSAFE; @@ -7862,8 +8026,10 @@ interp_parse_options (const char *options) opt = INTERP_OPT_TIERING; else if (strncmp (arg, "simd", 4) == 0) opt = INTERP_OPT_SIMD; - else if (strncmp (arg, "jiterp", 6) == 0) - opt = INTERP_OPT_JITERPRETER; +#if HOST_BROWSER + else if (strncmp (arg, "jiterp", 6) == 0) + opt = INTERP_OPT_JITERPRETER; +#endif else if (strncmp (arg, "ssa", 3) == 0) opt = INTERP_OPT_SSA; else if (strncmp (arg, "precise", 7) == 0) From 8b7cb03aaba11ed245e484ec8d6c08f899eecb8d Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 1 Jul 2025 15:32:54 +0100 Subject: [PATCH 108/209] Move enum logging into mh_log --- src/mono/mono/metadata/mh_log.c | 126 ++++++++++++++++++++++++++++++++ src/mono/mono/metadata/mh_log.h | 6 +- 2 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 src/mono/mono/metadata/mh_log.c diff --git a/src/mono/mono/metadata/mh_log.c b/src/mono/mono/metadata/mh_log.c new file mode 100644 index 00000000000000..c55c7a3f2b2fc2 --- /dev/null +++ b/src/mono/mono/metadata/mh_log.c @@ -0,0 +1,126 @@ +#include "mh_log.h" +#include + + +void log_mono_type(MonoType* type) { + if (!type) { + MH_LOG("MonoType: NULL"); + return; + } + + const char* type_str = NULL; + + switch (type->type) { + case MONO_TYPE_VOID: type_str = "VOID"; break; + case MONO_TYPE_BOOLEAN: type_str = "BOOLEAN"; break; + case MONO_TYPE_CHAR: type_str = "CHAR"; break; + case MONO_TYPE_I1: type_str = "I1"; break; + case MONO_TYPE_U1: type_str = "U1"; break; + case MONO_TYPE_I2: type_str = "I2"; break; + case MONO_TYPE_U2: type_str = "U2"; break; + case MONO_TYPE_I4: type_str = "I4"; break; + case MONO_TYPE_U4: type_str = "U4"; break; + case MONO_TYPE_I8: type_str = "I8"; break; + case MONO_TYPE_U8: type_str = "U8"; break; + case MONO_TYPE_R4: type_str = "R4"; break; + case MONO_TYPE_R8: type_str = "R8"; break; + case MONO_TYPE_STRING: type_str = "STRING"; break; + case MONO_TYPE_PTR: type_str = "PTR"; break; + case MONO_TYPE_BYREF: type_str = "BYREF"; break; + case MONO_TYPE_VALUETYPE: type_str = "VALUETYPE"; break; + case MONO_TYPE_CLASS: type_str = "CLASS"; break; + case MONO_TYPE_ARRAY: type_str = "ARRAY"; break; + case MONO_TYPE_SZARRAY: type_str = "SZARRAY"; break; + case MONO_TYPE_OBJECT: type_str = "OBJECT"; break; + case MONO_TYPE_VAR: type_str = "VAR"; break; + case MONO_TYPE_MVAR: type_str = "MVAR"; break; + case MONO_TYPE_GENERICINST: type_str = "GENERICINST"; break; + case MONO_TYPE_FNPTR: type_str = "FNPTR"; break; + default: type_str = "UNKNOWN"; break; + } + + MH_LOG("MonoType: %s", type_str); +} + +void log_mono_type_enum(MonoTypeEnum type_enum) { + const char* type_str = NULL; + + switch (type_enum) { + case MONO_TYPE_END: type_str = "END"; break; + case MONO_TYPE_VOID: type_str = "VOID"; break; + case MONO_TYPE_BOOLEAN: type_str = "BOOLEAN"; break; + case MONO_TYPE_CHAR: type_str = "CHAR"; break; + case MONO_TYPE_I1: type_str = "I1"; break; + case MONO_TYPE_U1: type_str = "U1"; break; + case MONO_TYPE_I2: type_str = "I2"; break; + case MONO_TYPE_U2: type_str = "U2"; break; + case MONO_TYPE_I4: type_str = "I4"; break; + case MONO_TYPE_U4: type_str = "U4"; break; + case MONO_TYPE_I8: type_str = "I8"; break; + case MONO_TYPE_U8: type_str = "U8"; break; + case MONO_TYPE_R4: type_str = "R4"; break; + case MONO_TYPE_R8: type_str = "R8"; break; + case MONO_TYPE_STRING: type_str = "STRING"; break; + case MONO_TYPE_PTR: type_str = "PTR"; break; + case MONO_TYPE_BYREF: type_str = "BYREF"; break; + case MONO_TYPE_VALUETYPE: type_str = "VALUETYPE"; break; + case MONO_TYPE_CLASS: type_str = "CLASS"; break; + case MONO_TYPE_VAR: type_str = "VAR"; break; + case MONO_TYPE_ARRAY: type_str = "ARRAY"; break; + case MONO_TYPE_GENERICINST: type_str = "GENERICINST"; break; + case MONO_TYPE_TYPEDBYREF: type_str = "TYPEDBYREF"; break; + case MONO_TYPE_I: type_str = "I"; break; + case MONO_TYPE_U: type_str = "U"; break; + case MONO_TYPE_FNPTR: type_str = "FNPTR"; break; + case MONO_TYPE_OBJECT: type_str = "OBJECT"; break; + case MONO_TYPE_SZARRAY: type_str = "SZARRAY"; break; + case MONO_TYPE_MVAR: type_str = "MVAR"; break; + case MONO_TYPE_CMOD_REQD: type_str = "CMOD_REQD"; break; + case MONO_TYPE_CMOD_OPT: type_str = "CMOD_OPT"; break; + case MONO_TYPE_INTERNAL: type_str = "INTERNAL"; break; + case MONO_TYPE_MODIFIER: type_str = "MODIFIER"; break; + case MONO_TYPE_SENTINEL: type_str = "SENTINEL"; break; + case MONO_TYPE_PINNED: type_str = "PINNED"; break; + case MONO_TYPE_ENUM: type_str = "MONO_TYPE_ENUM"; break; + default: type_str = "UNKNOWN"; break; + } + + MH_LOG("MonoTypeEnum: %s (0x%x)", type_str, (int)type_enum); +} + +#ifndef MH_MINT_TYPES_DEFINED +#define MH_MINT_TYPES_DEFINED +// mirror those in interp-internals.h +#define MH_MINT_TYPE_I1 0 +#define MH_MINT_TYPE_U1 1 +#define MH_MINT_TYPE_I2 2 +#define MH_MINT_TYPE_U2 3 +#define MH_MINT_TYPE_I4 4 +#define MH_MINT_TYPE_I8 5 +#define MH_MINT_TYPE_R4 6 +#define MH_MINT_TYPE_R8 7 +#define MH_MINT_TYPE_O 8 +#define MH_MINT_TYPE_VT 9 +#define MH_MINT_TYPE_VOID 10 +#endif +void log_mint_type(int value) +{ + const char* type_str = NULL; + switch (value) + { +case MH_MINT_TYPE_I1: type_str = "MINT_TYPE_I1";break; +case MH_MINT_TYPE_U1: type_str = "MINT_TYPE_U1";break; +case MH_MINT_TYPE_I2: type_str = "MINT_TYPE_I2";break; +case MH_MINT_TYPE_U2: type_str = "MINT_TYPE_U2";break; +case MH_MINT_TYPE_I4: type_str = "MINT_TYPE_I4";break; +case MH_MINT_TYPE_I8: type_str = "MINT_TYPE_I8";break; +case MH_MINT_TYPE_R4: type_str = "MINT_TYPE_R4";break; +case MH_MINT_TYPE_R8: type_str = "MINT_TYPE_R8";break; +case MH_MINT_TYPE_O : type_str = "MINT_TYPE_O";break; +case MH_MINT_TYPE_VT: type_str = "MINT_TYPE_VT";break; +case MH_MINT_TYPE_VOID: type_str = "MINT_TYPE_VOID"; break; + default: + type_str = "UNKNOWN"; + } + MH_LOG("MintType: %s (%d)", type_str, value); +} diff --git a/src/mono/mono/metadata/mh_log.h b/src/mono/mono/metadata/mh_log.h index 3124aa70bda3c2..a9bc6a386cb95b 100644 --- a/src/mono/mono/metadata/mh_log.h +++ b/src/mono/mono/metadata/mh_log.h @@ -1,5 +1,5 @@ #pragma once - +#include #include static int MH_LOG_indent_level = 0; @@ -22,3 +22,7 @@ static int MH_LOG_indent_level = 0; #define MH_LOG_UNINDENT() { \ MH_LOG_indent_level--; \ } + +extern void log_mono_type(MonoType* type) ; +extern void log_mono_type_enum(MonoTypeEnum type_enum); +extern void log_mint_type(int value); From 2ce66f0d85ee7d796b8b00788da256c965ece5f5 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 1 Jul 2025 15:33:11 +0100 Subject: [PATCH 109/209] As previous --- src/mono/mono/metadata/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mono/mono/metadata/CMakeLists.txt b/src/mono/mono/metadata/CMakeLists.txt index e3463b514d0c0f..3b8a2882e64674 100644 --- a/src/mono/mono/metadata/CMakeLists.txt +++ b/src/mono/mono/metadata/CMakeLists.txt @@ -100,6 +100,8 @@ set(metadata_common_sources method-builder.h method-builder-internals.h method-builder.c + mh_log.c + mh_log.h mono-basic-block.c mono-basic-block.h mono-config.c From 15b50220251fd98363db269cd46071cb873f5a50 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 1 Jul 2025 15:33:45 +0100 Subject: [PATCH 110/209] Don't truncate pointer to 32bits for wasm64 --- src/mono/browser/runtime/memory.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mono/browser/runtime/memory.ts b/src/mono/browser/runtime/memory.ts index 3bd53f7e5b6e65..9a05beff65c7a9 100644 --- a/src/mono/browser/runtime/memory.ts +++ b/src/mono/browser/runtime/memory.ts @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. import WasmEnableThreads from "consts:wasmEnableThreads"; - +import isWasm64 from "consts:isWasm64"; import { MemOffset, NumberOrPointer } from "./types/internal"; import { VoidPtr, CharPtr } from "./types/emscripten"; import cwraps, { I52Error } from "./cwraps"; @@ -37,9 +37,15 @@ export function temp_malloc (size: number): VoidPtr { return result; } -// returns always uint32 (not negative Number) export function malloc (size: number): VoidPtr { - return (Module._malloc(size) as any >>> 0) as any; + const ptr = Module._malloc(size) as any; + if (isWasm64) { + // NB: emscripten's malloc currently returns a number, not a bigint + return ptr; + } else { + // This bitshift ensures the value is returned as a 32-bit unsigned integer. + return (ptr >>> 0) as any; + } } export function free (ptr: VoidPtr) { From 5b567519351c172e0ee18636c74f2489564cbb34 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 2 Jul 2025 11:34:07 +0100 Subject: [PATCH 111/209] Move mh_log to public header location Will obviously need to undo this later --- src/mono/browser/runtime/corebindings.c | 4 ++- src/mono/mono/metadata/CMakeLists.txt | 1 - src/mono/mono/metadata/appdomain.c | 3 +- src/mono/mono/metadata/assembly.c | 2 ++ src/mono/mono/metadata/mh_log.c | 2 +- src/mono/mono/mini/interp/transform.c | 32 +++++++++++-------- .../public}/mono/metadata/mh_log.h | 0 src/native/public/monoapi.cmake | 1 + 8 files changed, 27 insertions(+), 18 deletions(-) rename src/{mono => native/public}/mono/metadata/mh_log.h (100%) diff --git a/src/mono/browser/runtime/corebindings.c b/src/mono/browser/runtime/corebindings.c index 7bb175a4363d60..40de61603a6356 100644 --- a/src/mono/browser/runtime/corebindings.c +++ b/src/mono/browser/runtime/corebindings.c @@ -15,6 +15,8 @@ #include #include #include +#include + #include #include "wasm-config.h" @@ -108,9 +110,9 @@ static MonoAssembly* _mono_wasm_assembly_load (char *assembly_name) { assert (assembly_name); MonoImageOpenStatus status; + MH_LOG("Got assembly name %s", assembly_name); MonoAssemblyName* aname = mono_assembly_name_new (assembly_name); assert (aname); - MonoAssembly *res = mono_assembly_load (aname, NULL, &status); mono_assembly_name_free (aname); free (assembly_name); diff --git a/src/mono/mono/metadata/CMakeLists.txt b/src/mono/mono/metadata/CMakeLists.txt index 3b8a2882e64674..381c37d02489ae 100644 --- a/src/mono/mono/metadata/CMakeLists.txt +++ b/src/mono/mono/metadata/CMakeLists.txt @@ -101,7 +101,6 @@ set(metadata_common_sources method-builder-internals.h method-builder.c mh_log.c - mh_log.h mono-basic-block.c mono-basic-block.h mono-config.c diff --git a/src/mono/mono/metadata/appdomain.c b/src/mono/mono/metadata/appdomain.c index e1b804273efbe3..40c5f4e301890d 100644 --- a/src/mono/mono/metadata/appdomain.c +++ b/src/mono/mono/metadata/appdomain.c @@ -12,7 +12,7 @@ * Copyright 2012 Xamarin Inc * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ -#include "mh_log.h" + #include #include #include @@ -57,6 +57,7 @@ #include #include #include +#include #ifdef HOST_WIN32 #include diff --git a/src/mono/mono/metadata/assembly.c b/src/mono/mono/metadata/assembly.c index 49eca9772f481e..aeb19748ec4016 100644 --- a/src/mono/mono/metadata/assembly.c +++ b/src/mono/mono/metadata/assembly.c @@ -44,6 +44,7 @@ #include #include #include +#include #ifndef HOST_WIN32 #include @@ -2855,6 +2856,7 @@ mono_assembly_load (MonoAssemblyName *aname, const char *basedir, MonoImageOpenS { MonoAssembly *result = NULL; MONO_ENTER_GC_UNSAFE; + MH_LOG("Loading assembly %s from basedir %s", aname->name, basedir ? basedir : "NULL"); MonoAssemblyByNameRequest req; mono_assembly_request_prepare_byname (&req, mono_alc_get_default ()); req.requesting_assembly = NULL; diff --git a/src/mono/mono/metadata/mh_log.c b/src/mono/mono/metadata/mh_log.c index c55c7a3f2b2fc2..858894ccaad8bd 100644 --- a/src/mono/mono/metadata/mh_log.c +++ b/src/mono/mono/metadata/mh_log.c @@ -1,4 +1,4 @@ -#include "mh_log.h" +#include #include diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index 915934f0481368..37ea0f621a524b 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -39,6 +39,7 @@ #if HOST_BROWSER #include "jiterpreter.h" #endif +#include "mono/metadata/mh_log.h" MonoInterpStats mono_interp_stats; @@ -311,20 +312,11 @@ mono_mint_type (MonoType *type) case MONO_TYPE_I4: case MONO_TYPE_U4: return MINT_TYPE_I4; -#if SIZEOF_VOID_P == 8 case MONO_TYPE_I: case MONO_TYPE_U: - return MINT_TYPE_I4; // should still be I4 on 64 bit platforms. case MONO_TYPE_PTR: case MONO_TYPE_FNPTR: return MINT_TYPE_I; // will be I8 on 64-bit platforms, I4 otherwise -#else - case MONO_TYPE_I: - case MONO_TYPE_U: - case MONO_TYPE_PTR: - case MONO_TYPE_FNPTR: - return MINT_TYPE_I; -#endif case MONO_TYPE_R4: return MINT_TYPE_R4; case MONO_TYPE_I8: @@ -436,6 +428,12 @@ interp_create_var_explicit (TransformData *td, MonoType *type, int size) td->vars = (InterpVar*) g_realloc (td->vars, td->vars_capacity * sizeof (InterpVar)); } int mt = mono_mint_type (type); + + /*MH_LOG("Got mono_mint_type %d for type %s\n", mt, mono_type_get_name (type)); + MH_LOG_INDENT(); + log_mint_type (mt); + MH_LOG_UNINDENT();*/ + InterpVar *local = &td->vars [td->vars_size]; // FIXME: We don't need to do this memset unless we realloc'd, since we malloc0 vars initially memset (local, 0, sizeof (InterpVar)); @@ -3088,9 +3086,9 @@ interp_inline_method (TransformData *td, MonoMethod *target_method, MonoMethodHe td->aggressive_inlining = TRUE; } if (td->verbose_level) - g_print ("Inline start method %s.%s\n", m_class_get_name (target_method->klass), target_method->name); - - td->inline_depth++; + g_print ("Inline start method %s.%s\n", m_class_get_name (target_method->klass), target_method->name); + MH_LOG("Inline start method %s.%s\n", m_class_get_name (target_method->klass), target_method->name); + td->inline_depth++; ret = generate_code (td, target_method, header, generic_context, error); td->inline_depth--; @@ -5274,7 +5272,9 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, original_bb = bb = mono_basic_block_split (method, error, header); goto_if_nok (error, exit); g_assert (bb); - + + MH_LOG("Generating code for method %s\n", mono_method_full_name (method, TRUE)); + td->il_code = header->code; td->in_start = td->ip = header->code; end = td->ip + header->code_size; @@ -5409,13 +5409,17 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, int local; arg_locals = (guint32*) g_malloc ((!!signature->hasthis + signature->param_count) * sizeof (guint32)); /* Allocate locals to store inlined method args from stack */ + MH_LOG_INDENT(); for (int i = signature->param_count - 1; i >= 0; i--) { MonoType *type = get_type_from_stack (td->sp [-1].type, td->sp [-1].klass); + + MH_LOG("Creating local for inlined arg %d: %s\n", i, mono_type_full_name (type)); + local = interp_create_var (td, type); arg_locals [i + !!signature->hasthis] = local; store_local (td, local); } - + MH_LOG_UNINDENT(); if (signature->hasthis) { /* * If this is value type, it is passed by address and not by value. diff --git a/src/mono/mono/metadata/mh_log.h b/src/native/public/mono/metadata/mh_log.h similarity index 100% rename from src/mono/mono/metadata/mh_log.h rename to src/native/public/mono/metadata/mh_log.h diff --git a/src/native/public/monoapi.cmake b/src/native/public/monoapi.cmake index 65ecd1398ebff4..7b1fca85fddfda 100644 --- a/src/native/public/monoapi.cmake +++ b/src/native/public/monoapi.cmake @@ -45,6 +45,7 @@ set(metadata_public_headers image.h loader.h metadata.h + mh_log.h mono-config.h mono-debug.h mono-gc.h From 72b97f614457c0b1c4d82286e48a7f3f3de95e67 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 2 Jul 2025 15:04:22 +0100 Subject: [PATCH 112/209] Improves string handling with zero buffer Addresses potential issues with string operations by initializing string buffers with zeros. Also includes minor pointer size corrections and debug logging for string conversions, which will be removed later. --- src/mono/browser/runtime/strings.ts | 53 ++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 13 deletions(-) diff --git a/src/mono/browser/runtime/strings.ts b/src/mono/browser/runtime/strings.ts index 4dd02a67512822..63b8558b75540c 100644 --- a/src/mono/browser/runtime/strings.ts +++ b/src/mono/browser/runtime/strings.ts @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. import WasmEnableThreads from "consts:wasmEnableThreads"; - +import isWasm64 from "consts:isWasm64"; import { mono_wasm_new_root, mono_wasm_new_root_buffer } from "./roots"; import { MonoString, MonoStringNull, WasmRoot, WasmRootBuffer } from "./types/internal"; import { Module } from "./globals"; @@ -10,6 +10,7 @@ import cwraps from "./cwraps"; import { isSharedArrayBuffer, localHeapViewU8, getU32_local, setU16_local, localHeapViewU32, getU16_local, localHeapViewU16, _zero_region, malloc, free } from "./memory"; import { NativePointer, CharPtr, VoidPtr } from "./types/emscripten"; import { safeBigIntToNumber } from "./invoke-js"; +import { mono_log_debug } from "./logging"; export const interned_js_string_table = new Map(); export const mono_wasm_empty_string = ""; @@ -51,7 +52,8 @@ export function stringToUTF8 (str: string): Uint8Array { export function stringToUTF8Ptr (str: string): CharPtr { const size = Module.lengthBytesUTF8(str) + 1; const ptr = malloc(size) as any; - const buffer = localHeapViewU8().subarray(ptr, ptr + size); + const idx = typeof ptr === "bigint" ? safeBigIntToNumber(ptr) : ptr as number; + const buffer = localHeapViewU8().subarray(idx, idx + size); Module.stringToUTF8Array(str, buffer, 0, size); buffer[size - 1] = 0; return ptr; @@ -59,12 +61,19 @@ export function stringToUTF8Ptr (str: string): CharPtr { export function utf8ToStringRelaxed (buffer: Uint8Array): string { if (_text_decoder_utf8_relaxed === undefined) { - return Module.UTF8ArrayToString(buffer, 0, buffer.byteLength); + const retval = Module.UTF8ArrayToString(buffer, 0, buffer.byteLength); + mono_log_debug("utf8ToStringRelaxed: UTF8ArrayToString got " + retval); + return retval; } - return _text_decoder_utf8_relaxed.decode(buffer); + const retval = _text_decoder_utf8_relaxed.decode(buffer); + mono_log_debug("utf8ToStringRelaxed: _text_decoder_utf8_relaxed.decode got " + retval); + return retval; } export function utf8ToString (ptr: CharPtr): string { + if (!ptr) { + return ""; + } const heapU8 = localHeapViewU8(); let idx: number; if (typeof ptr === "bigint") { @@ -73,6 +82,8 @@ export function utf8ToString (ptr: CharPtr): string { // @ts-expect-error TS2352 idx = ptr as number; } + if (idx === 0) + return ""; return utf8BufferToString(heapU8, idx, heapU8.length - idx); } @@ -81,13 +92,19 @@ export function utf8BufferToString (heapOrArray: Uint8Array, idx: number, maxByt let endPtr = idx; while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr; if (endPtr - idx <= 16) { - return Module.UTF8ArrayToString(heapOrArray, idx, maxBytesToRead); + const retval = Module.UTF8ArrayToString(heapOrArray, idx, maxBytesToRead); + mono_log_debug("utf8BufferToString: Module.UTF8ArrayToStrin got " + retval); + return retval; } if (_text_decoder_utf8_validating === undefined) { - return Module.UTF8ArrayToString(heapOrArray, idx, maxBytesToRead); + const retval = Module.UTF8ArrayToString(heapOrArray, idx, maxBytesToRead); + mono_log_debug("utf8BufferToString: Module.UTF8ArrayToString got " + retval); + return retval; } const view = viewOrCopy(heapOrArray, idx as any, endPtr as any); - return _text_decoder_utf8_validating.decode(view); + const retval = _text_decoder_utf8_validating.decode(view); + mono_log_debug("utf8BufferToString: _text_decoder_utf8_validating.decode got " + retval); + return retval; } export function utf16ToString (startPtr: number, endPtr: number): string { @@ -123,7 +140,10 @@ export function stringToUTF16Ptr (str: string): VoidPtr { const bytes = (str.length + 1) * 2; const ptr = malloc(bytes) as any; _zero_region(ptr, str.length * 2); - stringToUTF16(ptr, ptr + bytes, str); + const ptrEnd = isWasm64 + ? BigInt(ptr) + BigInt(bytes) + : (ptr as unknown as number) + bytes; + stringToUTF16(ptr, ptrEnd as any, str); return ptr; } @@ -135,10 +155,10 @@ export function monoStringToString (root: WasmRoot): string | null { if (root.value === MonoStringNull) return null; - + const ptrSize = isWasm64 ? 8 : 4; const ppChars = mono_wasm_string_decoder_buffer + 0, - pLengthBytes = mono_wasm_string_decoder_buffer + 4, - pIsInterned = mono_wasm_string_decoder_buffer + 8; + pLengthBytes = mono_wasm_string_decoder_buffer + ptrSize, + pIsInterned = mono_wasm_string_decoder_buffer + 2 * ptrSize; cwraps.mono_wasm_string_get_data_ref(root.address, ppChars, pLengthBytes, pIsInterned); @@ -170,6 +190,8 @@ export function stringToMonoStringRoot (string: string, result: WasmRoot // or temp_malloc/alloca for large strings // or skip the scratch buffer entirely, and make a new MonoString of size string.length, pin it, and then call stringToUTF16 to write directly into the MonoString's chars const buffer = malloc(bufferLen); - stringToUTF16(buffer as any, buffer as any + bufferLen, string); - cwraps.mono_wasm_string_from_utf16_ref(buffer, string.length, result.address); + _zero_region(buffer, bufferLen); + //FIXME: will need to use BigInt when emscripten returns BigInt from malloc + const bufferEnd = isWasm64 + ? buffer as any as number + bufferLen + : (buffer as any as number) + bufferLen; + stringToUTF16(buffer as any, bufferEnd as any, string); + cwraps.mono_wasm_string_from_utf16_ref(buffer as any, bufferEnd as any, result.address); free(buffer); } From 63fc34a1f51d6bda9bc9ce20f768e2470fc720ea Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 7 Jul 2025 08:39:03 +0100 Subject: [PATCH 113/209] Adapts JSMarshalerArgument for WASM64 Updates the JSMarshalerArgument struct layout to accommodate WASM64 architecture. Adjusts the size and field offsets within the struct to align with the 64-bit memory model, ensuring proper data alignment and access. Updates the JS interop layer to use the correct size of JSMarshalerArgument based on the WASM architecture. --- .../JavaScript/JSMarshalerArgument.cs | 58 ++++++++++++++--- src/mono/browser/runtime/marshal.ts | 64 +++++++++++++------ 2 files changed, 91 insertions(+), 31 deletions(-) diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSMarshalerArgument.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSMarshalerArgument.cs index 4312973a388aa8..b4c9879d1cc1ef 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSMarshalerArgument.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSMarshalerArgument.cs @@ -1,12 +1,16 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +// FIXME: Make this dynamic! +#define WASM64 using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices.JavaScript; using System.Runtime.Versioning; using System.Threading; + + namespace System.Runtime.InteropServices.JavaScript { /// @@ -19,9 +23,12 @@ namespace System.Runtime.InteropServices.JavaScript public partial struct JSMarshalerArgument { internal JSMarshalerArgumentImpl slot; - // keep in sync with JSMarshalerArgumentOffsets in marshal.ts +#if WASM64 + [StructLayout(LayoutKind.Explicit, Pack = 32, Size = 64)] +#else [StructLayout(LayoutKind.Explicit, Pack = 32, Size = 32)] +#endif internal struct JSMarshalerArgumentImpl { [FieldOffset(0)] @@ -42,7 +49,37 @@ internal struct JSMarshalerArgumentImpl internal double DoubleValue;// must be aligned to 8 because of Module.HEAPF64 view alignment [FieldOffset(0)] internal IntPtr IntPtrValue; +#if WASM64 + [FieldOffset(8)] + internal IntPtr JSHandle; + [FieldOffset(8)] + internal IntPtr GCHandle; + + [FieldOffset(16)] + internal int Length; + /// + /// Discriminators + /// + [FieldOffset(24)] + internal MarshalerType Type; + [FieldOffset(25)] + internal MarshalerType ElementType; + + #if FEATURE_WASM_MANAGED_THREADS + [FieldOffset(32)] + internal IntPtr ContextHandle; + + [FieldOffset(40)] + internal bool ReceiverShouldFree; // note this is 1 byte + + [FieldOffset(48)] + internal IntPtr CallerNativeTID; + + [FieldOffset(56)] + internal IntPtr SyncDoneSemaphorePtr; + #endif +#else [FieldOffset(4)] internal IntPtr JSHandle; [FieldOffset(4)] @@ -59,18 +96,19 @@ internal struct JSMarshalerArgumentImpl [FieldOffset(13)] internal MarshalerType ElementType; -#if FEATURE_WASM_MANAGED_THREADS - [FieldOffset(16)] - internal IntPtr ContextHandle; + #if FEATURE_WASM_MANAGED_THREADS + [FieldOffset(16)] + internal IntPtr ContextHandle; - [FieldOffset(20)] - internal bool ReceiverShouldFree; // note this is 1 byte + [FieldOffset(20)] + internal bool ReceiverShouldFree; // note this is 1 byte - [FieldOffset(24)] - internal IntPtr CallerNativeTID; + [FieldOffset(24)] + internal IntPtr CallerNativeTID; - [FieldOffset(28)] - internal IntPtr SyncDoneSemaphorePtr; + [FieldOffset(28)] + internal IntPtr SyncDoneSemaphorePtr; + #endif #endif } diff --git a/src/mono/browser/runtime/marshal.ts b/src/mono/browser/runtime/marshal.ts index fcaff0f0f37df3..49b25c3e2b6648 100644 --- a/src/mono/browser/runtime/marshal.ts +++ b/src/mono/browser/runtime/marshal.ts @@ -21,29 +21,51 @@ export const bound_cs_function_symbol = Symbol.for("wasm bound_cs_function"); export const bound_js_function_symbol = Symbol.for("wasm bound_js_function"); export const imported_js_function_symbol = Symbol.for("wasm imported_js_function"); export const proxy_debug_symbol = Symbol.for("wasm proxy_debug"); -export const JavaScriptMarshalerArgSize = 32; +export const JavaScriptMarshalerArgSize = isWasm64 ? 64 : 32; // keep in sync with JSMarshalerArgumentImpl offsets -const enum JSMarshalerArgumentOffsets { - BooleanValue = 0, - ByteValue = 0, - CharValue = 0, - Int16Value = 0, - Int32Value = 0, - Int64Value = 0, - SingleValue = 0, - DoubleValue = 0, - IntPtrValue = 0, - JSHandle = 4, - GCHandle = 4, - Length = 8, - Type = 12, - ElementType = 13, - ContextHandle = 16, - ReceiverShouldFree = 20, - CallerNativeTID = 24, - SyncDoneSemaphorePtr = 28, -} +const JSMarshalerArgumentOffsets = isWasm64 ? { + BooleanValue: 0, + ByteValue: 0, + CharValue: 0, + Int16Value: 0, + Int32Value: 0, + Int64Value: 0, + SingleValue: 0, + DoubleValue: 0, + IntPtrValue: 0, + JSHandle: 8, + GCHandle: 8, + Length: 16, + Type: 24, + ElementType: 25, + ContextHandle: 32, + ReceiverShouldFree: 40, + CallerNativeTID: 48, + SyncDoneSemaphorePtr: 56, +} + : + { + BooleanValue: 0, + ByteValue: 0, + CharValue: 0, + Int16Value: 0, + Int32Value: 0, + Int64Value: 0, + SingleValue: 0, + DoubleValue: 0, + IntPtrValue: 0, + JSHandle: 4, + GCHandle: 4, + Length: 8, + Type: 12, + ElementType: 13, + ContextHandle: 16, + ReceiverShouldFree: 20, + CallerNativeTID: 24, + SyncDoneSemaphorePtr: 28, + }; + export const JSMarshalerTypeSize = 32; // keep in sync with JSFunctionBinding.JSBindingType const enum JSBindingTypeOffsets { From fba2a87e399eb99f78a196cf64be39c05dca0936 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 8 Jul 2025 16:16:45 +0100 Subject: [PATCH 114/209] Return intptr from mono_jiterp_get_opcode_info --- src/mono/browser/runtime/cwraps.ts | 2 +- .../browser/runtime/jiterpreter-support.ts | 6 ++++- .../runtime/jiterpreter-trace-generator.ts | 26 ++++++++++++------- src/mono/mono/mini/interp/interp-internals.h | 2 +- src/mono/mono/mini/interp/interp.c | 6 +++-- 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/src/mono/browser/runtime/cwraps.ts b/src/mono/browser/runtime/cwraps.ts index b590ce1f5ac15c..e1b9d1c6d2f737 100644 --- a/src/mono/browser/runtime/cwraps.ts +++ b/src/mono/browser/runtime/cwraps.ts @@ -243,7 +243,7 @@ export interface t_Cwraps { mono_jiterp_get_simd_intrinsic(arity: number, index: number): VoidPtr; mono_jiterp_get_simd_opcode(arity: number, index: number): number; mono_jiterp_get_arg_offset(imethod: number, sig: number, index: number): number; - mono_jiterp_get_opcode_info(opcode: number, type: number): number; + mono_jiterp_get_opcode_info(opcode: number, type: number): VoidPtr; mono_wasm_is_zero_page_reserved(): number; mono_jiterp_is_special_interface(klass: number): number; mono_jiterp_initialize_table(type: number, firstIndex: number, lastIndex: number): void; diff --git a/src/mono/browser/runtime/jiterpreter-support.ts b/src/mono/browser/runtime/jiterpreter-support.ts index 2bf7dfd35566c3..eb4fe13f380770 100644 --- a/src/mono/browser/runtime/jiterpreter-support.ts +++ b/src/mono/browser/runtime/jiterpreter-support.ts @@ -1213,7 +1213,11 @@ class Cfg { this.entryIp = ip; // Skip over the enter opcode const enterSizeU16 = cwraps.mono_jiterp_get_opcode_info(MintOpcode.MINT_TIER_ENTER_JITERPRETER, OpcodeInfoType.Length); - this.firstOpcodeIp = ip + (enterSizeU16 * 2); + if (typeof enterSizeU16 === "bigint") { + this.firstOpcodeIp = (ip as unknown as bigint) + (enterSizeU16 * 2n) as unknown as MintOpcodePtr; + } else if (typeof enterSizeU16 == "number") { + this.firstOpcodeIp = ((ip as unknown as number) + (enterSizeU16 * 2)) as unknown as MintOpcodePtr; + } this.appendBlob(); mono_assert(this.segments.length === 1, "expected 1 segment"); mono_assert(this.segments[0].type === "blob", "expected blob"); diff --git a/src/mono/browser/runtime/jiterpreter-trace-generator.ts b/src/mono/browser/runtime/jiterpreter-trace-generator.ts index 56d1329de5251f..4413a25429b4b8 100644 --- a/src/mono/browser/runtime/jiterpreter-trace-generator.ts +++ b/src/mono/browser/runtime/jiterpreter-trace-generator.ts @@ -3,7 +3,7 @@ import WasmEnableThreads from "consts:wasmEnableThreads"; import { MonoMethod } from "./types/internal"; -import { NativePointer } from "./types/emscripten"; +import { NativePointer, VoidPtr } from "./types/emscripten"; import { getU16, getI16, getU32_unaligned, getI32_unaligned, getF32_unaligned, getF64_unaligned, localHeapViewU8, @@ -176,7 +176,13 @@ function getOpcodeLengthU16 (ip: MintOpcodePtr, opcode: MintOpcode) { // len = MINT_SWITCH_LEN (n); const numDisplacements = getArgU32(ip, 2); // #define MINT_SWITCH_LEN(n) (4 + (n) * 2) - result = 4 + (numDisplacements * 2); + if (typeof opLengthU16 === "bigint" || typeof numDisplacements === "bigint") { + // Ensure both operands are bigint for arithmetic + const n = BigInt(numDisplacements); + result = (4n + (n * 2n)) as unknown as VoidPtr; + } else { + result = (4 + (numDisplacements * 2)) as unknown as VoidPtr; + } } return result; } catch (err) { @@ -232,7 +238,7 @@ export function generateBackwardBranchTable ( // IP of the current opcode in U16s, relative to startOfBody. This is what the back branch table uses const rip16 = (ip - startOfBody) / 2; const opcode = getU16(ip); - const opLengthU16 = getOpcodeLengthU16(ip, opcode); + const opLengthU16 = getOpcodeLengthU16(ip, opcode) as any as number; if (opcode === MintOpcode.MINT_SWITCH) { // FIXME: Once the cfg supports back-branches in jump tables, uncomment this to @@ -355,9 +361,9 @@ export function generateWasmBody ( } let opcode = getU16(ip); - const numSregs = cwraps.mono_jiterp_get_opcode_info(opcode, OpcodeInfoType.Sregs), - numDregs = cwraps.mono_jiterp_get_opcode_info(opcode, OpcodeInfoType.Dregs), - opLengthU16 = getOpcodeLengthU16(ip, opcode); + const numSregs = cwraps.mono_jiterp_get_opcode_info(opcode, OpcodeInfoType.Sregs) as any as number, + numDregs = cwraps.mono_jiterp_get_opcode_info(opcode, OpcodeInfoType.Dregs) as any as number, + opLengthU16 = getOpcodeLengthU16(ip, opcode) as any as number; const isSimdIntrins = (opcode >= MintOpcode.MINT_SIMD_INTRINS_P_P) && (opcode <= MintOpcode.MINT_SIMD_INTRINS_P_PPP); @@ -2839,8 +2845,8 @@ function append_call_handler_store_ret_ip ( function getBranchDisplacement ( ip: MintOpcodePtr, opcode: MintOpcode ): number | undefined { - const opArgType = cwraps.mono_jiterp_get_opcode_info(opcode, OpcodeInfoType.OpArgType), - payloadOffset = cwraps.mono_jiterp_get_opcode_info(opcode, OpcodeInfoType.Sregs), + const opArgType = cwraps.mono_jiterp_get_opcode_info(opcode, OpcodeInfoType.OpArgType) as any as number, + payloadOffset = cwraps.mono_jiterp_get_opcode_info(opcode, OpcodeInfoType.Sregs) as any as number, payloadAddress = ip + 2 + (payloadOffset * 2); let result: number; @@ -2963,7 +2969,7 @@ function emit_branch ( if (relopbranchTable[opcode] === undefined) throw new Error(`Unsupported relop branch opcode: ${getOpcodeName(opcode)}`); - if (cwraps.mono_jiterp_get_opcode_info(opcode, OpcodeInfoType.Length) !== 4) + if (cwraps.mono_jiterp_get_opcode_info(opcode, OpcodeInfoType.Length) as any as number !== 4) throw new Error(`Unsupported long branch opcode: ${getOpcodeName(opcode)}`); break; @@ -4088,7 +4094,7 @@ function emit_atomics ( } function emit_switch (builder: WasmBuilder, ip: MintOpcodePtr, exitOpcodeCounter: number) : boolean { - const lengthU16 = getOpcodeLengthU16(ip, MintOpcode.MINT_SWITCH), + const lengthU16 = getOpcodeLengthU16(ip, MintOpcode.MINT_SWITCH) as any as number, table = decodeSwitch(ip); let failed = false; diff --git a/src/mono/mono/mini/interp/interp-internals.h b/src/mono/mono/mini/interp/interp-internals.h index 5fe04bf314c8c7..cebe45db61f9d9 100644 --- a/src/mono/mono/mini/interp/interp-internals.h +++ b/src/mono/mono/mini/interp/interp-internals.h @@ -361,7 +361,7 @@ mono_jiterp_get_simd_intrinsic (int arity, int index); int mono_jiterp_get_simd_opcode (int arity, int index); -int +intptr_t mono_jiterp_get_opcode_info (int opcode, int type); #endif diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index f5c0dccd9cdf19..30b9889534bceb 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -9127,14 +9127,16 @@ mono_jiterp_get_simd_opcode (int arity, int index) #define JITERP_OPINFO_TYPE_DREGS 3 #define JITERP_OPINFO_TYPE_OPARGTYPE 4 -EMSCRIPTEN_KEEPALIVE int +EMSCRIPTEN_KEEPALIVE intptr_t mono_jiterp_get_opcode_info (int opcode, int type) { + MH_LOG("Test jiterp opcode %d type %d\n", opcode, type); g_assert ((opcode >= 0) && (opcode <= MINT_LASTOP)); switch (type) { case JITERP_OPINFO_TYPE_NAME: // We know this conversion is safe because wasm pointers are 32 bits - return (int)(void*)(mono_interp_opname (opcode)); + // not in wasm64 they aren't + return (intptr_t)(mono_interp_opname (opcode)); case JITERP_OPINFO_TYPE_LENGTH: return mono_interp_oplen [opcode]; case JITERP_OPINFO_TYPE_SREGS: From 6726c0d8bfe0fd8c2b174751ed31c3e0568c5b80 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 8 Jul 2025 16:17:27 +0100 Subject: [PATCH 115/209] Adjusts double argument handling in I2N Updates the InterpToNativeGenerator to correctly increment the floating-point argument index (`farg`) based on the size of `double` on different platforms. On 32-bit WASM, `double` consumes two argument slots, while on 64-bit WASM, it consumes only one. This change ensures that `farg` is incremented by the appropriate amount in each case, leading to correct argument handling. --- src/tasks/WasmAppBuilder/InterpToNativeGenerator.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/tasks/WasmAppBuilder/InterpToNativeGenerator.cs b/src/tasks/WasmAppBuilder/InterpToNativeGenerator.cs index cbbe2cdfcaf574..b2dd0271fef343 100644 --- a/src/tasks/WasmAppBuilder/InterpToNativeGenerator.cs +++ b/src/tasks/WasmAppBuilder/InterpToNativeGenerator.cs @@ -156,9 +156,16 @@ public string Emit(char c) #endif break; case 'F': + argIndex = farg; + farg += 1; + break; case 'D': argIndex = farg; +#if Interp2NativeWasm64 farg += 1; +#else + farg += 2; +#endif break; default: throw new InvalidSignatureCharException(c); From 21db670e9adc900d60aab74ed89f8fb0ae38053b Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 8 Jul 2025 16:17:54 +0100 Subject: [PATCH 116/209] Add switch to turn off MH_LOG --- src/native/public/mono/metadata/mh_log.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/native/public/mono/metadata/mh_log.h b/src/native/public/mono/metadata/mh_log.h index a9bc6a386cb95b..63cf02950c49e7 100644 --- a/src/native/public/mono/metadata/mh_log.h +++ b/src/native/public/mono/metadata/mh_log.h @@ -3,7 +3,11 @@ #include static int MH_LOG_indent_level = 0; - +#if(0) +#define MH_LOG(msg, ...) do { } while (0) +#define MH_LOG_INDENT() do { } while (0) +#define MH_LOG_UNINDENT() do { } while (0) +#else #define MH_LOG(msg, ...) { \ printf("MH_NATIVE_LOG: "); \ for (int i = 0; i < MH_LOG_indent_level; i++) { \ @@ -22,7 +26,7 @@ static int MH_LOG_indent_level = 0; #define MH_LOG_UNINDENT() { \ MH_LOG_indent_level--; \ } - +#endif extern void log_mono_type(MonoType* type) ; extern void log_mono_type_enum(MonoTypeEnum type_enum); extern void log_mint_type(int value); From 3101586341316d2c174ba171f59876a91c24b868 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 11 Jul 2025 09:15:58 +0100 Subject: [PATCH 117/209] WIP finding offset issue logging, modified sample for test function, etc --- src/mono/browser/browser.proj | 4 +- src/mono/browser/build/BrowserWasmApp.targets | 4 +- src/mono/browser/runtime/driver.c | 9 +- src/mono/mono.proj | 3 +- src/mono/mono/metadata/debug-helpers.c | 5 +- src/mono/mono/mini/aot-runtime-wasm.c | 1 + src/mono/mono/mini/interp/interp.c | 136 +++++++++++++----- src/mono/mono/mini/interp/transform.c | 11 +- .../sample/wasm/browser-advanced/Program.cs | 42 +++++- .../Wasm.Advanced.Sample.csproj | 8 +- src/mono/sample/wasm/browser-advanced/main.js | 17 ++- src/native/public/mono/metadata/mh_log.h | 2 +- 12 files changed, 181 insertions(+), 61 deletions(-) diff --git a/src/mono/browser/browser.proj b/src/mono/browser/browser.proj index 2104f8489bdaf0..a101a256c0f5ca 100644 --- a/src/mono/browser/browser.proj +++ b/src/mono/browser/browser.proj @@ -393,11 +393,11 @@ $(ArtifactsObjDir)wasm/wasm_m2n_invoke.g.h -sUSE_CLOSURE_COMPILER=1 -g -O0 -DDEBUG=1 -DENABLE_AOT_PROFILER=1 -DENABLE_BROWSER_PROFILER=1 -DENABLE_LOG_PROFILER=1 - -Oz + -O0 $(CMakeConfigurationLinkFlags) -DMEMORY64 --target=wasm64 $(CMakeConfigurationLinkFlags) -s ASSERTIONS=1 - -O2 + -O0 $(CMakeConfigurationLinkFlags) -s EXPORT_ES6=1 -lexports.js diff --git a/src/mono/browser/build/BrowserWasmApp.targets b/src/mono/browser/build/BrowserWasmApp.targets index 0e0bc4f3f8e70b..b6e98867e6a486 100644 --- a/src/mono/browser/build/BrowserWasmApp.targets +++ b/src/mono/browser/build/BrowserWasmApp.targets @@ -282,7 +282,7 @@ <_EmccOptimizationFlagDefault Condition="'$(_WasmDevel)' == 'true'">-O0 <_EmccOptimizationFlagDefault Condition="'$(_EmccOptimizationFlagDefault)' == '' and '$(Configuration)' == 'Debug' and '$(WasmBuildingForNestedPublish)' != 'true'">-O1 - <_EmccOptimizationFlagDefault Condition="'$(_EmccOptimizationFlagDefault)' == ''">-Oz + <_EmccOptimizationFlagDefault Condition="'$(_EmccOptimizationFlagDefault)' == ''">-O0 $(_EmccOptimizationFlagDefault) @@ -340,6 +340,8 @@ <_EmccCFlags Include="-sWASM_ASYNC_COMPILATION=0" /> <_EmccCFlags Include="-DGEN_PINVOKE=1" /> <_EmccCFlags Include="-emit-llvm" /> + <_EmccCFlags Include="-sUSE_CLOSURE_COMPILER=1" /> + <_EmccCFlags Include="-sMEMORY64" Condition="'$(WasmEnableMemory64)' == 'true'"/> <_EmccCFlags Include=""-I%(_EmccIncludePaths.Identity)"" /> <_EmccCFlags Include="-g" Condition="'$(WasmNativeDebugSymbols)' == 'true'" /> diff --git a/src/mono/browser/runtime/driver.c b/src/mono/browser/runtime/driver.c index 0ff389ee1e7f1e..76fb137a81e5bd 100644 --- a/src/mono/browser/runtime/driver.c +++ b/src/mono/browser/runtime/driver.c @@ -23,6 +23,7 @@ #include #include #include +#include // FIXME: unavailable in emscripten // #include @@ -37,14 +38,6 @@ #include "runtime.h" #include "gc-common.h" -#ifndef MH_LOG -#define MH_LOG(msg, ...) { \ - printf("MH_NATIVE_LOG: %s : %s | %d :: ", __func__, __FILE__, __LINE__); \ - printf((msg), ##__VA_ARGS__); \ - printf("\n"); \ - fflush(stdout); \ -} -#endif void bindings_initialize_internals (); diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 9161baa89bb300..70d86ab87ead40 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -584,7 +584,8 @@ JS_ENGINES = [NODE_JS] <_MonoCMakeArgs Include="-DENABLE_ICALL_EXPORT=1"/> <_MonoCMakeArgs Include="-DENABLE_LAZY_GC_THREAD_CREATION=1"/> <_MonoCMakeArgs Include="-DENABLE_WEBCIL=1"/> - <_MonoCMakeArgs Include="-DDISABLE_JITERPRETER=1"/> + <_MonoCMakeArgs Include="-DDISABLE_JITERPRETER=1"/> + <_MonoCMakeArgs Include="-DMEMORY64=1" Condition="'$(WasmEnableMemory64)' == 'true'" /> <_MonoCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-pthread"/> <_MonoCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="-D_GNU_SOURCE=1" /> <_MonoCFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64=1" /> diff --git a/src/mono/mono/metadata/debug-helpers.c b/src/mono/mono/metadata/debug-helpers.c index 90da5042827680..cebb65f53b9081 100644 --- a/src/mono/mono/metadata/debug-helpers.c +++ b/src/mono/mono/metadata/debug-helpers.c @@ -20,6 +20,9 @@ #include "mono/metadata/tabledefs.h" #include "mono/metadata/appdomain.h" #include "mono/metadata/abi-details.h" + +#include + #ifdef MONO_CLASS_DEF_PRIVATE /* Rationale: we want the functions in this file to work even when everything * is broken. They may be called from a debugger session, for example. If @@ -889,7 +892,7 @@ char * mono_method_get_name_full (MonoMethod *method, gboolean signature, gboolean ret, MonoTypeNameFormat format) { char *res; - char wrapper [64]; + char wrapper [128]; char *klass_desc; char *inst_desc = NULL; ERROR_DECL (error); diff --git a/src/mono/mono/mini/aot-runtime-wasm.c b/src/mono/mono/mini/aot-runtime-wasm.c index 0e4ff31262d354..281c0d0001f17f 100644 --- a/src/mono/mono/mini/aot-runtime-wasm.c +++ b/src/mono/mono/mini/aot-runtime-wasm.c @@ -226,6 +226,7 @@ mono_wasm_get_interp_to_native_trampoline (MonoMethodSignature *sig) void *p = mono_wasm_interp_to_native_callback (cookie); if (!p) g_error ("CANNOT HANDLE INTERP ICALL SIG %s\n", cookie); + MH_LOG("Got interp to native trampoline %p for cookie %s", p, cookie); return p; } diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index 30b9889534bceb..d2711791c7e094 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -112,7 +113,7 @@ struct FrameClauseArgs { gboolean run_until_end; }; -static MONO_NEVER_INLINE void +extern MONO_NEVER_INLINE void mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClauseArgs *clause_args); /* @@ -245,6 +246,7 @@ reinit_frame (InterpFrame *frame, InterpFrame *parent, InterpMethod *imethod, gp frame->stack = (stackval*)stack; frame->retval = (stackval*)retval; frame->state.ip = NULL; + MH_LOG("Reinitializing frame %p with imethod %p, retval %p, stack %p", frame, imethod, retval, stack); } #define STACK_ADD_ALIGNED_BYTES(sp,bytes) ((stackval*)((char*)(sp) + (bytes))) @@ -273,13 +275,13 @@ typedef void (*ICallMethod) (InterpFrame *frame); static MonoNativeTlsKey thread_context_id; -#define DEBUG_INTERP 0 -#define COUNT_OPS 0 +#define DEBUG_INTERP 1 +#define COUNT_OPS 1 #if DEBUG_INTERP int mono_interp_traceopt = 2; /* If true, then we output the opcodes as we interpret them */ -static int global_tracing = 2; +static int global_tracing = 1; static int debug_indent_level = 0; @@ -794,9 +796,15 @@ get_virtual_method_fast (InterpMethod *imethod, MonoVTable *vtable, int offset) static int stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) { + MH_LOG("Converting stackval to data for type %s: ", mono_type_get_name (type)); + log_mono_type (type); + + MH_LOG_INDENT(); if (m_type_is_byref (type)) { gpointer *p = (gpointer*)data; *p = val->data.p; + MH_LOG("Ref value. Assigning %p and returning stack slot size %d", *p, MINT_STACK_SLOT_SIZE); + MH_LOG_UNINDENT(); return MINT_STACK_SLOT_SIZE; } /* printf ("TODAT0 %p\n", data); */ @@ -806,6 +814,8 @@ stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) case MONO_TYPE_U1: { guint8 *p = (guint8*)data; *p = GINT32_TO_UINT8 (val->data.i); + MH_LOG("Bool I1 or U1. Assigning %d and returning stack slot size %d", *p, MINT_STACK_SLOT_SIZE); + MH_LOG_UNINDENT(); return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_I2: @@ -813,6 +823,7 @@ stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) case MONO_TYPE_CHAR: { guint16 *p = (guint16*)data; *p = GINT32_TO_UINT16 (val->data.i); + MH_LOG("I2 U2 or Char. Assigning %d and returning stack slot size %d", *p, MINT_STACK_SLOT_SIZE); return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_I: { @@ -822,31 +833,41 @@ stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) a native int - both by csc and mcs). Not sure what to do about sign extension as it is outside the spec... doing the obvious */ *p = (mono_i)val->data.nati; + MH_LOG("MONO_TYPE_I. Assigning %p and returning stack slot size %d", (intptr_t)*p, MINT_STACK_SLOT_SIZE); + MH_LOG_UNINDENT(); return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_U: { mono_u *p = (mono_u*)data; /* see above. */ *p = (mono_u)val->data.nati; + MH_LOG("MONO_TYPE_U. Assigning %p and returning stack slot size %d", (intptr_t)*p, MINT_STACK_SLOT_SIZE); + MH_LOG_UNINDENT(); return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_I4: case MONO_TYPE_U4: { gint32 *p = (gint32*)data; *p = val->data.i; + MH_LOG("MONO_TYPE_I4 or U4. Assigning %d and returning stack slot size %d", (intptr_t)*p, MINT_STACK_SLOT_SIZE); + MH_LOG_UNINDENT(); return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_I8: case MONO_TYPE_U8: { memmove (data, &val->data.l, sizeof (gint64)); + MH_LOG("MONO_TYPE_I8 or U8. Assigning %p and returning stack slot size %d", (intptr_t)data, MINT_STACK_SLOT_SIZE); + MH_LOG_UNINDENT(); return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_R4: { /* memmove handles unaligned case */ + MH_LOG("MONO_TYPE_R4. Assigning %f and returning stack slot size %d", val->data.f_r4, MINT_STACK_SLOT_SIZE); memmove (data, &val->data.f_r4, sizeof (float)); return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_R8: { + MH_LOG("MONO_TYPE_R8. Assigning %f and returning stack slot size %d", val->data.f, MINT_STACK_SLOT_SIZE); memmove (data, &val->data.f, sizeof (double)); return MINT_STACK_SLOT_SIZE; } @@ -857,15 +878,20 @@ stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) case MONO_TYPE_ARRAY: { gpointer *p = (gpointer *) data; mono_gc_wbarrier_generic_store_internal (p, val->data.o); + MH_LOG("MONO_TYPE_string, object array etc. Assigning %p and returning stack slot size %d", (intptr_t)*p, MINT_STACK_SLOT_SIZE); + MH_LOG_UNINDENT(); return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_PTR: case MONO_TYPE_FNPTR: { gpointer *p = (gpointer *) data; *p = val->data.p; + MH_LOG("MONO_TYPE_PTR or FNPTR. Assigning %p and returning stack slot size %d", (intptr_t)*p, MINT_STACK_SLOT_SIZE); + MH_LOG_UNINDENT(); return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_VALUETYPE: + MH_LOG("MONO_TYPE_VALUETYPE. Converting to data using stackval_to_data for type %s", mono_type_get_name (type)); if (m_class_is_enumtype (m_type_data_get_klass_unchecked (type))) { return stackval_to_data (mono_class_enum_basetype_internal (m_type_data_get_klass_unchecked (type)), val, data, pinvoke); } else { @@ -880,6 +906,7 @@ stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) return ALIGN_TO (size, MINT_STACK_SLOT_SIZE); } case MONO_TYPE_GENERICINST: { + MH_LOG("MONO_TYPE_GENERICINST. Converting to data using stackval_to_data for type %s", mono_type_get_name (type)); MonoClass *container_class = m_type_data_get_generic_class_unchecked (type)->container_class; if (m_class_is_valuetype (container_class) && !m_class_is_enumtype (container_class)) { @@ -1202,28 +1229,23 @@ initialize_arg_offsets (InterpMethod *imethod, MonoMethodSignature *csig) sig = mono_method_signature_internal (imethod->method); int arg_count = sig->hasthis + sig->param_count; guint32 *arg_offsets = (guint32*)imethod_alloc0 (imethod, (arg_count + 1) * sizeof (int)); - int index = 0, offset = 0; - MH_LOG_INDENT(); - MH_LOG("Getting arg offsets"); + int index = 0, offset = 0; + MH_LOG("Getting arg offsets with slot size of %lu", MINT_STACK_SLOT_SIZE); if (sig->hasthis) { arg_offsets [index++] = 0; offset = MINT_STACK_SLOT_SIZE; - } - MH_LOG_INDENT(); + } for (int i = 0; i < sig->param_count; i++) { MonoType *type = sig->params [i]; int size, align; log_mono_type(type); - log_mint_type(mono_mint_type (type)); - MH_LOG_INDENT(); + log_mint_type(mono_mint_type (type)); size = mono_interp_type_size (type, mono_mint_type (type), &align); - MH_LOG("calculated size: %d - note includes alignment of %d", size, align); - MH_LOG_UNINDENT(); + MH_LOG("calculated size: %d - note includes alignment of %d", size, align); offset = ALIGN_TO (offset, align); arg_offsets [index++] = offset; offset += size; - } - MH_LOG_UNINDENT(); + } // This index is not associated with an actual argument, we just store the offset // for convenience in order to easily determine the size of the param area used arg_offsets [index] = ALIGN_TO (offset, MINT_STACK_SLOT_SIZE); @@ -1231,7 +1253,10 @@ initialize_arg_offsets (InterpMethod *imethod, MonoMethodSignature *csig) mono_memory_write_barrier (); /* If this fails, the new one is leaked in the mem manager */ mono_atomic_cas_ptr ((gpointer*)&imethod->arg_offsets, arg_offsets, NULL); - MH_LOG_UNINDENT(); + MH_LOG("Offsets:"); + for(int i = 0; i <= arg_count; i++) { + MH_LOG("arg %d: %d", i, arg_offsets [i]); + } return imethod->arg_offsets; } @@ -1684,7 +1709,8 @@ ves_pinvoke_method ( gpointer args; MONO_REQ_GC_UNSAFE_MODE; - + MH_LOG_INDENT(); + MH_LOG("invoking %s", mono_method_full_name(imethod->method, TRUE)); #ifdef HOST_WASM /* * Use a per-signature entry function. @@ -2116,8 +2142,10 @@ dump_args (InterpFrame *inv) #define CHECK_MUL_OVERFLOW_NAT_UN(a,b) CHECK_MUL_OVERFLOW64_UN(a,b) #endif +extern MONO_NEVER_INLINE MonoObject* +interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc, MonoError *error); // Do not inline in case order of frame addresses matters. -static MONO_NEVER_INLINE MonoObject* +MONO_NEVER_INLINE MonoObject* interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc, MonoError *error) { ThreadContext *context = get_context (); @@ -2133,8 +2161,7 @@ interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject target_method = mono_marshal_get_native_wrapper (target_method, FALSE, FALSE); MonoMethod *invoke_wrapper = mono_marshal_get_runtime_invoke_full (target_method, FALSE, TRUE); - //* MonoObject *runtime_invoke (MonoObject *this_obj, void **params, MonoObject **exc, void* method) - + //* MonoObject *runtime_invoke (MonoObject *this_obj, void **params, MonoObject **exc, void* method) if (sig->hasthis) sp [0].data.p = obj; else @@ -2143,6 +2170,10 @@ interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject sp [2].data.p = exc; sp [3].data.p = target_method; + MH_LOG("Setting up sp: sp [0].data.p : %p ", sp [0].data.p); + MH_LOG("Setting up sp: sp [1].data.p : %p ", sp [1].data.p); + MH_LOG("Setting up sp: sp [2].data.p : %p ", sp [2].data.p); + MH_LOG("Setting up sp: sp [3].data.p : %p ", sp [3].data.p); InterpMethod *imethod = mono_interp_get_imethod (invoke_wrapper); InterpFrame frame = {0}; @@ -2304,7 +2335,19 @@ do_icall_wrapper (InterpFrame *frame, MonoMethodSignature *sig, MintICallSig op, MonoLMFExt ext; INTERP_PUSH_LMF_WITH_CTX (frame, ext, exit_icall); MH_LOG_INDENT(); - MH_LOG("calling do_icall for %s : %s", frame->imethod->method->name, mono_method_full_name (frame->imethod->method, TRUE)); + if(frame->imethod && frame->imethod->method && frame->imethod->method->name) + printf("MH_LOG: calling do_icall for %s : %s\n", frame->imethod->method->name, mono_method_full_name (frame->imethod->method, TRUE)); + else + { + printf("** MH_LOG: not getting name:\n"); + if (!frame->imethod) + printf("** MH_LOG: calling do_icall for null imethod\n"); + else if (!frame->imethod->method) + printf("** MH_LOG: calling do_icall for imethod %p with no method\n", frame->imethod); + else if (!frame->imethod->method->name) + printf("** MH_LOG: calling do_icall for imethod->method %p with no name\n", frame->imethod->method); + } + fflush(stdout); if (*gc_transitions) { MONO_ENTER_GC_SAFE; do_icall (sig, op, ret_sp, sp, ptr, save_last_error); @@ -2799,16 +2842,24 @@ init_arglist (InterpFrame *frame, MonoMethodSignature *sig, stackval *sp, char * { *(gpointer*)arglist = sig; arglist += sizeof (gpointer); - + + MH_LOG("init_arglist: sig %p, sp %p, arglist %p", sig, sp, arglist); + MH_LOG_INDENT(); for (int i = sig->sentinelpos; i < sig->param_count; i++) { int align, arg_size, sv_size; arg_size = mono_type_stack_size (sig->params [i], &align); + log_mono_type(sig->params [i]); + MH_LOG("arg_size: %d, align %d. arg value before align as ptr %p", arg_size, align, (intptr_t)(*arglist)); + arglist = (char*)ALIGN_PTR_TO (arglist, align); + MH_LOG("arg_size: %d, align %d. arg value after align as ptr %p", arg_size, align, (intptr_t)(*arglist)); sv_size = stackval_to_data (sig->params [i], sp, arglist, FALSE); arglist += arg_size; sp = STACK_ADD_BYTES (sp, sv_size); + MH_LOG("Added %d bytes to sp, ch is now %p", sv_size, sp); } + MH_LOG_UNINDENT(); } /* @@ -3801,7 +3852,7 @@ mono_interp_profiler_raise_tail_call (InterpFrame *frame, MonoMethod *new_method * to return error information. * FRAME is only valid until the next call to alloc_frame (). */ -static MONO_NEVER_INLINE void +void mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClauseArgs *clause_args) { InterpMethod *cmethod; @@ -3917,7 +3968,7 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause gpointer arglist = frame_data_allocator_alloc (&context->data_stack, frame, params_stack_size + MINT_STACK_SLOT_SIZE); init_arglist (frame, sig, STACK_ADD_BYTES (frame->stack, ip [2]), (char*)arglist); - + MH_LOG("params_stack_size: %d", params_stack_size); // save the arglist for future access with MINT_ARGLIST LOCAL_VAR (ip [1], gpointer) = arglist; @@ -4192,7 +4243,8 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause /* for calls, have ip pointing at the start of next instruction */ frame->state.ip = ip + 8; MH_LOG_INDENT(); - MH_LOG ("Calling native method %s with signature %s\n", mono_method_full_name (imethod->method, TRUE), mono_signature_full_name (csignature)); + if (imethod->method) + MH_LOG ("Calling native method %s with signature %s\n", mono_method_full_name (imethod->method, TRUE), mono_signature_full_name (csignature)); ves_pinvoke_method (imethod, csignature, (MonoFuncV)code, context, frame, (stackval*)(locals + ip [1]), (stackval*)(locals + ip [3]), save_last_error, cache, &gc_transitions); MH_LOG_UNINDENT(); EXCEPTION_CHECKPOINT; @@ -4269,10 +4321,11 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause } MINT_IN_CASE(MINT_CALL) { + cmethod = (InterpMethod*)frame->imethod->data_items [ip [3]]; return_offset = ip [1]; call_args_offset = ip [2]; - + MH_LOG("MINT_CALL for %s. return offset %d, call_args_offset %d", (InterpMethod*)frame->imethod->method->name, return_offset, call_args_offset); #ifdef ENABLE_EXPERIMENT_TIERED ip += 5; #else @@ -7587,11 +7640,28 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; // These moves are used to store into the field of a local valuetype // No sign extension is needed, we just move bytes from the execution // stack, no additional conversion is needed. - MINT_IN_CASE(MINT_MOV_1) MOV(gint8, gint8); MINT_IN_BREAK; + MINT_IN_CASE(MINT_MOV_1) + (*(gint8*)(locals + (ip[1]))) = (*(gint8*)(locals + (ip[2]))); + MH_LOG("MINT_MOV_1: %d <- %d: %p\n", ip[1], ip[2], (intptr_t)(*(gint8*)(locals + (ip[1])))); + ip += 3; + MINT_IN_BREAK; MINT_IN_CASE(MINT_MOV_2) MOV(gint16, gint16); MINT_IN_BREAK; // Normal moves between locals - MINT_IN_CASE(MINT_MOV_4) MOV(guint32, guint32); MINT_IN_BREAK; - MINT_IN_CASE(MINT_MOV_8) MOV(guint64, guint64); MINT_IN_BREAK; + MINT_IN_CASE(MINT_MOV_4) + (*(guint32*)(locals + (ip[1]))) = (*(guint32*)(locals + (ip[2]))); + MH_LOG("MINT_MOV_4: %d <- %d: %p\n", ip[1], ip[2], (intptr_t)(*(guint32*)(locals + (ip[1])))); + ip += 3;; + MINT_IN_BREAK; + MINT_IN_CASE(MINT_MOV_8) + (*(guint64*)(locals + (ip[1]))) = (*(guint64*)(locals + (ip[2]))); + intptr_t result = (*(guint64*)(locals + (ip[1]))); + intptr_t input = (*(guint64*)(locals + (ip[2]))); + intptr_t inputOffsetm4 = (*(guint64*)(locals + (ip[2] - 4))); + intptr_t inputOffsetp4 = (*(guint64*)(locals + (ip[2] + 4))); + //MH_LOG("MINT_MOV_8: %d <- %d: %p <- %p (-4: %p) (+4: %p)\n", ip[1], ip[2], result, input, inputOffsetm4, inputOffsetp4); + MH_LOG("MINT_MOV_8: %d <- %d: %p <- %p", ip[1], ip[2], result, input); + ip += 3;; + MINT_IN_BREAK; MINT_IN_CASE(MINT_MOV_VT) { guint16 size = ip [3]; @@ -7857,7 +7927,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; */ JiterpreterThunk prepare_result = mono_interp_tier_prepare_jiterpreter_fast (frame, ip); ptrdiff_t offset; - switch ((guint32)(void*)prepare_result) { + switch ((uintptr_t)prepare_result) { case JITERPRETER_TRAINING: // jiterpreter still updating hit count before deciding to generate a trace, // so skip this opcode. @@ -7867,7 +7937,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; // Patch opcode to disable it because this trace failed to JIT. if (!mono_opt_jiterpreter_estimate_heat) { if (!mono_jiterp_patch_opcode ((volatile JiterpreterOpcode *)ip, MINT_TIER_PREPARE_JITERPRETER, MINT_TIER_NOP_JITERPRETER)) - g_printf ("Failed to patch opcode at %x into a nop\n", (unsigned int)ip); + g_printf ("Failed to patch opcode at 0x%" PRIxPTR " into a nop\n", (uintptr_t)ip); } ip += JITERPRETER_OPCODE_SIZE; break; @@ -7881,7 +7951,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; * here so that implementing thread support will be easier later.) */ if (!mono_jiterp_patch_opcode ((volatile JiterpreterOpcode *)ip, MINT_TIER_PREPARE_JITERPRETER, MINT_TIER_MONITOR_JITERPRETER)) - g_printf ("Failed to patch opcode at %x into a monitor point\n", (unsigned int)ip); + g_printf ("Failed to patch opcode at 0x%" PRIxPTR " into a monitor point\n", (uintptr_t)ip); // now execute the trace // this isn't important for performance, but it makes it easier to use the // jiterpreter early in automated tests where code only runs once @@ -7906,6 +7976,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; } MINT_IN_CASE(MINT_TIER_ENTER_JITERPRETER) { + MH_LOG("*** Jiterpreter thunk warning location: %p\n", ip); // The fn ptr is encoded in a guint16 relative to the index of the first trace fn ptr, so compute the actual ptr JiterpreterThunk thunk = (JiterpreterThunk)(void *)(((JiterpreterOpcode *)ip)->relative_fn_ptr + mono_jiterp_first_trace_fn_ptr); ptrdiff_t offset = thunk (frame, locals, NULL, ip); @@ -7972,6 +8043,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; * a param_area and all calls would inherit the same sp, or if we are full coop. */ context->stack_pointer = (guchar*)frame->stack + frame->imethod->alloca_size; + MH_LOG("exiting frame, frame->imethod->alloca_size: %d", frame->imethod->alloca_size); LOAD_INTERP_STATE (frame); CHECK_RESUME_STATE (context); diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index 37ea0f621a524b..0bbf834b269cd5 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -428,12 +428,6 @@ interp_create_var_explicit (TransformData *td, MonoType *type, int size) td->vars = (InterpVar*) g_realloc (td->vars, td->vars_capacity * sizeof (InterpVar)); } int mt = mono_mint_type (type); - - /*MH_LOG("Got mono_mint_type %d for type %s\n", mt, mono_type_get_name (type)); - MH_LOG_INDENT(); - log_mint_type (mt); - MH_LOG_UNINDENT();*/ - InterpVar *local = &td->vars [td->vars_size]; // FIXME: We don't need to do this memset unless we realloc'd, since we malloc0 vars initially memset (local, 0, sizeof (InterpVar)); @@ -488,7 +482,7 @@ interp_create_stack_var (TransformData *td, StackInfo *sp, int type_size) int local = interp_create_var_explicit (td, get_type_from_stack (sp->type, sp->klass), type_size); td->vars [local].execution_stack = TRUE; - sp->var = local; + sp->var = local; } static void @@ -5409,7 +5403,6 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, int local; arg_locals = (guint32*) g_malloc ((!!signature->hasthis + signature->param_count) * sizeof (guint32)); /* Allocate locals to store inlined method args from stack */ - MH_LOG_INDENT(); for (int i = signature->param_count - 1; i >= 0; i--) { MonoType *type = get_type_from_stack (td->sp [-1].type, td->sp [-1].klass); @@ -5419,7 +5412,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, arg_locals [i + !!signature->hasthis] = local; store_local (td, local); } - MH_LOG_UNINDENT(); + if (signature->hasthis) { /* * If this is value type, it is passed by address and not by value. diff --git a/src/mono/sample/wasm/browser-advanced/Program.cs b/src/mono/sample/wasm/browser-advanced/Program.cs index a46f23c267953f..f6d4a099bb67ad 100644 --- a/src/mono/sample/wasm/browser-advanced/Program.cs +++ b/src/mono/sample/wasm/browser-advanced/Program.cs @@ -14,7 +14,7 @@ public partial class Test public static async Task Main(string[] args) { Console.WriteLine("Hello, World!"); - + var rand = new Random(); Console.WriteLine("Today's lucky number is " + rand.Next(100) + " and " + Guid.NewGuid()); @@ -56,10 +56,49 @@ internal static async Task PrintMeaning(Task meaningPromise) { Console.WriteLine("Meaning of life is " + await meaningPromise); } + [JSExport] + internal static int SimpleTestFunctionInt() + { + return 666; + } + + [JSExport] + internal static int SimpleTestFunctionIntSize() + { + return sizeof(int); + } + + [JSExport] + internal static string SimpleTestFunctionString() + { + return "Your lucky number today is:"; + } + [JSExport] + internal static void SimpleTestFunctionPrintEmptyString() + { + // write an empty string to the console + Console.WriteLine(""); + } + [JSExport] + internal static bool SimpleTestConsole() + { + // see if we can access anything from the console + System.IO.TextWriter output = Console.Out; + return output != null; + } + + [JSExport] + internal static void SimpleTestFunctionPrintString() + { + // write an empty string to the console + Console.WriteLine("Test"); + } [JSExport] internal static int TestMeaning() { + // int testSize = 123; + // Console.WriteLine("Size of an int is " + sizeof(int) + " bytes, and test size is " + testSize + " bytes."); // call to C code via [DllImport] var half = Fibonacci(8); // call back to JS via [JSImport] @@ -69,6 +108,7 @@ internal static int TestMeaning() [JSExport] internal static void SillyLoop() { + Console.WriteLine("Entering SillyLoop()"); // this silly method will generate few sample points for the profiler for (int i = 1; i <= 60; i ++) { diff --git a/src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj b/src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj index 7e002488602e96..7f4487d176894a 100644 --- a/src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj +++ b/src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj @@ -14,16 +14,16 @@ <_ServeHeaders>$(_ServeHeaders) -h "Content-Security-Policy: default-src 'self' 'wasm-unsafe-eval'" -h "Timing-Allow-Origin: *" -h "Cross-Origin-Opener-Policy: same-origin" -h "Cross-Origin-Embedder-Policy: require-corp" - browser:callspec=N:Sample; + ./ - true false - --> + diff --git a/src/mono/sample/wasm/browser-advanced/main.js b/src/mono/sample/wasm/browser-advanced/main.js index e32ce97f8150a2..5a35da9c1cb26d 100644 --- a/src/mono/sample/wasm/browser-advanced/main.js +++ b/src/mono/sample/wasm/browser-advanced/main.js @@ -51,7 +51,7 @@ try { // This is called during emscripten `dotnet.wasm` instantiation, after we fetched config. console.log('user code Module.onConfigLoaded'); // config is loaded and could be tweaked before the rest of the runtime startup sequence - config.environmentVariables["MONO_LOG_LEVEL"] = "debug"; + config.environmentVariables["MONO_LOG_LEVEL"] = "trace"; config.browserProfilerOptions = { sampleIntervalMs: 5.15, callSpec: "N:Sample" // needs to match AOT profile @@ -93,7 +93,22 @@ try { const config = getConfig(); const exports = await getAssemblyExports(config.mainAssemblyName); + //const MyStringTest = exports.Sample.Test.SimpleTestFunctionString(); + //console.debug(`MyTest: ${MyStringTest}`); + //const MyTest = exports.Sample.Test.SimpleTestFunctionInt(); + //console.debug(`MyTest: ${MyTest}`); + //const IntSize = exports.Sample.Test.SimpleTestFunctionIntSize(); + //console.debug(`IntSize: ${IntSize}`); + //console.debug("Accessing console:"); + const consoleTest = exports.Sample.Test.SimpleTestConsole(); + //console.debug(`consoleTest: ${consoleTest}`); + //console.debug("Printing empty string from C#:"); + //exports.Sample.Test.SimpleTestFunctionPrintEmptyString(); + //console.debug("Printing non-empty string from C#:"); + //exports.Sample.Test.SimpleTestFunctionPrintString(); + //console.debug("Calling TestMeaning:"); const meaning = exports.Sample.Test.TestMeaning(); + console.debug(`meaning: ${meaning}`); if (typeof Module.GL !== "object") { exit(-10, "Can't find GL"); } diff --git a/src/native/public/mono/metadata/mh_log.h b/src/native/public/mono/metadata/mh_log.h index 63cf02950c49e7..8bb5b0af1cd14f 100644 --- a/src/native/public/mono/metadata/mh_log.h +++ b/src/native/public/mono/metadata/mh_log.h @@ -10,7 +10,7 @@ static int MH_LOG_indent_level = 0; #else #define MH_LOG(msg, ...) { \ printf("MH_NATIVE_LOG: "); \ - for (int i = 0; i < MH_LOG_indent_level; i++) { \ + for (int mh_idx = 0; mh_idx < MH_LOG_indent_level; mh_idx++) { \ printf(" "); \ } \ printf("%s : %s | %d :: ", __func__, __FILE__, __LINE__); \ From f7e374407a1a6c9e70dbe3cb4f75aa4179f1cb41 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 11 Jul 2025 09:17:51 +0100 Subject: [PATCH 118/209] More WIP too much logging for practical use --- src/mono/browser/runtime/runtime.c | 8 +++- src/mono/mono/metadata/icall.c | 25 ++++++++--- src/mono/mono/metadata/loader.c | 6 +-- src/mono/mono/metadata/marshal.c | 54 ++++++++++++++++------- src/mono/mono/mini/interp/interp-icalls.c | 22 +++++++-- src/mono/mono/mini/interp/transform.c | 5 ++- 6 files changed, 90 insertions(+), 30 deletions(-) diff --git a/src/mono/browser/runtime/runtime.c b/src/mono/browser/runtime/runtime.c index 6433e6b67eb7aa..bcd7b5a87b1166 100644 --- a/src/mono/browser/runtime/runtime.c +++ b/src/mono/browser/runtime/runtime.c @@ -44,6 +44,7 @@ #include #include +#include #include "wasm-config.h" #include "pinvoke.h" @@ -273,7 +274,7 @@ static void* wasm_dl_symbol (void *handle, const char *name, char **err, void *user_data) { assert (handle != sysglobal_native_handle); - + MH_LOG("."); #if WASM_SUPPORTS_DLOPEN if (!wasm_dl_is_pinvoke_tables (handle)) { return dlsym (handle, name); @@ -367,6 +368,7 @@ mono_wasm_load_runtime_common (int debug_level, MonoLogCallback log_callback, co EMSCRIPTEN_KEEPALIVE MonoAssembly* mono_wasm_assembly_load (const char *name) { + MH_LOG("."); MonoAssembly *res; assert (name); MonoImageOpenStatus status; @@ -382,6 +384,7 @@ mono_wasm_assembly_load (const char *name) EMSCRIPTEN_KEEPALIVE MonoClass* mono_wasm_assembly_find_class (MonoAssembly *assembly, const char *namespace, const char *name) { + MH_LOG("."); assert (assembly); MonoClass *result; MONO_ENTER_GC_UNSAFE; @@ -394,6 +397,7 @@ mono_wasm_assembly_find_class (MonoAssembly *assembly, const char *namespace, co EMSCRIPTEN_KEEPALIVE MonoMethod* mono_wasm_assembly_find_method (MonoClass *klass, const char *name, int arguments) { + MH_LOG("."); assert (klass); MonoMethod* result; MONO_ENTER_GC_UNSAFE; @@ -405,6 +409,7 @@ mono_wasm_assembly_find_method (MonoClass *klass, const char *name, int argument MonoMethod* mono_wasm_get_method_matching (MonoImage *image, uint32_t token, MonoClass *klass, const char* name, int param_count) { + MH_LOG("mono_wasm_get_method_matching: %s.%s token=%x name=%s param_count=%d\n", mono_image_get_name (image), mono_class_get_name (klass), token, name, param_count); MonoMethod *result = NULL; MONO_ENTER_GC_UNSAFE; MonoMethod *method = mono_get_method (image, token, klass); @@ -433,6 +438,7 @@ mono_wasm_get_method_matching (MonoImage *image, uint32_t token, MonoClass *klas void mono_wasm_marshal_get_managed_wrapper (const char* assemblyName, const char* namespaceName, const char* typeName, const char* methodName, uint32_t token, int param_count) { + MH_LOG("mono_wasm_marshal_get_managed_wrapper: %s.%s.%s::%s token=%x param_count=%d\n", assemblyName, namespaceName, typeName, methodName, token, param_count); MonoError error; mono_error_init (&error); MONO_ENTER_GC_UNSAFE; diff --git a/src/mono/mono/metadata/icall.c b/src/mono/mono/metadata/icall.c index 7b095b3ab8e534..729478bd3df5a8 100644 --- a/src/mono/mono/metadata/icall.c +++ b/src/mono/mono/metadata/icall.c @@ -75,6 +75,7 @@ #include #include #include +#include #include #include #include @@ -4086,10 +4087,13 @@ GPtrArray* ves_icall_RuntimeType_GetConstructors_native (MonoQCallTypeHandle type_handle, guint32 bflags, MonoError *error) { MonoType *type = type_handle.type; + MH_LOG("Getting constructors for type %s\n", mono_type_get_name (type)); if (m_type_is_byref (type)) { - return g_ptr_array_new (); + GPtrArray* res = g_ptr_array_new (); + MH_LOG("Allocated array %p", (void*)res); + return res; } - + MonoClass *startklass, *klass; klass = startklass = mono_class_from_mono_type_internal (type); @@ -4101,6 +4105,7 @@ ves_icall_RuntimeType_GetConstructors_native (MonoQCallTypeHandle type_handle, g GPtrArray *res_array = g_ptr_array_sized_new (4); /* FIXME, guestimating */ + MH_LOG("Allocated array %p \n", (void*)res_array); MonoMethod *method; gpointer iter = NULL; @@ -4724,7 +4729,7 @@ ves_icall_System_Reflection_Assembly_InternalGetReferencedAssemblies (MonoReflec MonoAssembly *assembly = MONO_HANDLE_GETVAL (assembly_h, assembly); MonoImage *image = assembly->image; int count; - + /* FIXME: metadata-update */ if (image_is_dynamic (assembly->image)) { @@ -4737,12 +4742,13 @@ ves_icall_System_Reflection_Assembly_InternalGetReferencedAssemblies (MonoReflec } GPtrArray *result = g_ptr_array_sized_new (count); - + MH_LOG("Created referenced assembly array %p", (void*)result); for (int i = 0; i < count; i++) { MonoAssemblyName *aname = create_referenced_assembly_name (image, i, error); if (!is_ok (error)) break; - g_ptr_array_add (result, aname); + monoeg_g_ptr_array_add (result, aname); + MH_LOG("Added assembly %s to referenced assembly array %p", aname->name, (void*)result); } return result; } @@ -5061,6 +5067,8 @@ ves_icall_GetCurrentMethod (MonoError *error) static MonoMethod* mono_method_get_equivalent_method (MonoMethod *method, MonoClass *klass) { + MH_LOG("mono_method_get_equivalent_method called for method %s\n", method->name); + int offset = -1, i; if (method->is_inflated && ((MonoMethodInflated*)method)->context.method_inst) { ERROR_DECL (error); @@ -5076,6 +5084,7 @@ mono_method_get_equivalent_method (MonoMethod *method, MonoClass *klass) ctx.class_inst = mono_class_get_generic_container (klass)->context.class_inst; result = mono_class_inflate_generic_method_full_checked (inflated->declaring, klass, &ctx, error); g_assert (is_ok (error)); /* FIXME don't swallow the error */ + MH_LOG("returning %p", result); return result; } @@ -5099,7 +5108,7 @@ mono_method_get_equivalent_method (MonoMethod *method, MonoClass *klass) MonoReflectionMethodHandle ves_icall_System_Reflection_RuntimeMethodInfo_GetMethodFromHandleInternalType_native (MonoMethod *method, MonoType *type, MonoBoolean generic_check, MonoError *error) -{ +{ MonoClass *klass; if (type && generic_check) { klass = mono_class_from_mono_type_internal (type); @@ -5115,6 +5124,10 @@ ves_icall_System_Reflection_RuntimeMethodInfo_GetMethodFromHandleInternalType_na klass = mono_class_from_mono_type_internal (type); else klass = method->klass; + + MH_LOG("About to get object handle for method %s in class %s\n", + mono_method_full_name (method, true), + mono_class_full_name (klass)); return mono_method_get_object_handle (method, klass, error); } diff --git a/src/mono/mono/metadata/loader.c b/src/mono/mono/metadata/loader.c index 921fe29e2743e1..a8da9d90d0db48 100644 --- a/src/mono/mono/metadata/loader.c +++ b/src/mono/mono/metadata/loader.c @@ -51,7 +51,7 @@ #include #include #include - +#include /* * This lock protects the hash tables inside MonoImage used by the metadata * loading functions in class.c and loader.c. @@ -407,8 +407,8 @@ static MonoMethod * find_method_in_class (MonoClass *klass, const char *name, const char *qname, const char *fqname, MonoMethodSignature *sig, MonoClass *from_class, MonoError *error) { - int i; - + MH_LOG("find method %s in class - log return value", name); + int i; /* FIXME: method refs from metadata-upate probably end up here */ /* Search directly in the metadata to avoid calling setup_methods () */ diff --git a/src/mono/mono/metadata/marshal.c b/src/mono/mono/metadata/marshal.c index 03379d5c2fd9fe..07d244c89cecfe 100644 --- a/src/mono/mono/metadata/marshal.c +++ b/src/mono/mono/metadata/marshal.c @@ -77,7 +77,7 @@ MONO_PRAGMA_WARNING_POP() #include #include "icall-decl.h" #include "icall-signatures.h" - +#include static void mono_string_utf16len_to_builder (MonoStringBuilderHandle sb, const gunichar2 *text, gsize len, MonoError *error); @@ -1992,7 +1992,9 @@ mono_marshal_get_delegate_begin_invoke (MonoMethod *method) char *name; MonoGenericContext *ctx = NULL; MonoMethod *orig_method = NULL; - + MH_LOG_INDENT(); + MH_LOG("."); + MH_LOG_UNINDENT(); g_assert (method && m_class_get_parent (method->klass) == mono_defaults.multicastdelegate_class && !strcmp (method->name, "BeginInvoke")); @@ -2370,7 +2372,9 @@ mono_marshal_get_delegate_invoke (MonoMethod *method, MonoDelegate *del) MonoMethodSignature *sig; sig = mono_signature_no_pinvoke (method); - + MH_LOG_INDENT(); + MH_LOG("."); + MH_LOG_UNINDENT(); if (del && !del->target && del->method && mono_method_signature_internal (del->method)->hasthis) { if (!(del->method->flags & METHOD_ATTRIBUTE_VIRTUAL) && !m_class_is_valuetype (del->method->klass) && sig->param_count == mono_method_signature_internal (del->method)->param_count + 1) { /* The first argument of the delegate is passed as this, the normal invoke code can handle this */ @@ -2973,7 +2977,9 @@ mono_marshal_get_icall_wrapper (MonoJitICallInfo *callinfo, gboolean check_excep MonoMethodSignature *const sig = callinfo->sig; g_assert (sig->pinvoke); - + MH_LOG_INDENT(); + MH_LOG("."); + MH_LOG_UNINDENT(); char *const name = g_strdup_printf ("__icall_wrapper_%s", callinfo->name); mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_MANAGED_TO_NATIVE); @@ -4119,6 +4125,8 @@ marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass, Mono g_assert (method != NULL); error_init (error); + + MH_LOG("Getting managed wrapper for method %s\n", mono_method_full_name (method, TRUE)); if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) { mono_error_set_invalid_program (error, "Failed because method (%s) marked PInvokeCallback (managed method) and extern (unmanaged) simultaneously.", mono_method_full_name (method, TRUE)); @@ -4385,6 +4393,8 @@ mono_marshal_get_vtfixup_ftnptr (MonoImage *image, guint32 token, guint16 type) int i, param_count; g_assert (token); + + MH_LOG("mono_marshal_get_vtfixup_ftnptr"); method = mono_get_method_checked (image, token, NULL, NULL, error); if (!method) @@ -4572,10 +4582,11 @@ mono_marshal_get_struct_to_ptr (MonoClass *klass) WrapperInfo *info; g_assert (klass != NULL); - + mono_marshal_load_type_info (klass); MonoMarshalType *marshal_info = mono_class_get_marshal_info (klass); + MH_LOG("mono_marshal_get_struct_to_ptr"); if ((res = marshal_info->str_to_ptr)) return res; @@ -4604,6 +4615,7 @@ mono_marshal_get_struct_to_ptr (MonoClass *klass) else res = marshal_info->str_to_ptr; mono_marshal_unlock (); + MH_LOG("returning %p", res); return res; } @@ -4621,7 +4633,7 @@ mono_marshal_get_ptr_to_struct (MonoClass *klass) WrapperInfo *info; g_assert (klass != NULL); - + MH_LOG("mono_marshal_get_ptr_to_struct for class TODO"); mono_marshal_load_type_info (klass); MonoMarshalType *marshal_info = mono_class_get_marshal_info (klass); @@ -4655,6 +4667,7 @@ mono_marshal_get_ptr_to_struct (MonoClass *klass) else res = marshal_info->ptr_to_str; mono_marshal_unlock (); + MH_LOG("returning %p", res); return res; } @@ -4698,6 +4711,7 @@ mono_marshal_get_synchronized_inner_wrapper (MonoMethod *method) res = mono_class_inflate_generic_method_checked (res, ctx, error); g_assert (is_ok (error)); /* FIXME don't swallow the error */ } + MH_LOG("returning %p", res); return res; } @@ -4739,13 +4753,19 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method) */ if (ctx) { cache = get_cache (&((MonoMethodInflated*)orig_method)->owner->wrapper_caches.synchronized_cache, mono_aligned_addr_hash, NULL); - res = check_generic_wrapper_cache (cache, orig_method, orig_method, method); + res = check_generic_wrapper_cache (cache, orig_method, orig_method, method); if (res) + { + MH_LOG("returning %p", res); return res; + } } else { cache = get_cache (&get_method_image (method)->wrapper_caches.synchronized_cache, mono_aligned_addr_hash, NULL); if ((res = mono_marshal_find_in_cache (cache, method))) + { + MH_LOG("returning %p", res); return res; + } } sig = mono_metadata_signature_dup_full (get_method_image (method), mono_method_signature_internal (method)); @@ -4793,7 +4813,7 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method) mb, sig, sig->param_count + 16, info, NULL); } mono_mb_free (mb); - + MH_LOG("returning %p", res); return res; } @@ -4829,7 +4849,7 @@ mono_marshal_get_unbox_wrapper (MonoMethod *method) mono_mb_free (mb); /* mono_method_print_code (res); */ - + MH_LOG("returning %p", res); return res; } @@ -4955,6 +4975,7 @@ mono_marshal_get_virtual_stelemref_wrapper (MonoStelemrefKind kind) } mono_mb_free (mb); + MH_LOG("returning %p", cached_methods [kind]); return cached_methods [kind]; } @@ -4979,6 +5000,7 @@ mono_marshal_get_virtual_stelemref_wrappers (int *nwrappers) res = (MonoMethod **)g_malloc0 (STELEMREF_KIND_COUNT * sizeof (MonoMethod*)); for (i = 0; i < STELEMREF_KIND_COUNT; ++i) res [i] = mono_marshal_get_virtual_stelemref_wrapper ((MonoStelemrefKind)i); + MH_LOG("returning %p", res); return res; } @@ -5016,7 +5038,7 @@ mono_marshal_get_stelemref (void) mono_mb_free (mb); MONO_STATIC_POINTER_INIT_END (MonoMethod, ret) - + MH_LOG("returning %p", ret); return ret; } @@ -5049,7 +5071,7 @@ mono_marshal_get_gsharedvt_in_wrapper (void) mono_mb_free (mb); MONO_STATIC_POINTER_INIT_END (MonoMethod, ret) - + MH_LOG("returning %p", ret); return ret; } @@ -5082,7 +5104,7 @@ mono_marshal_get_gsharedvt_out_wrapper (void) mono_mb_free (mb); MONO_STATIC_POINTER_INIT_END (MonoMethod, ret) - + MH_LOG("returning %p", ret); return ret; } @@ -5181,6 +5203,7 @@ mono_marshal_get_array_address (int rank, int elem_size) elem_addr_cache_next ++; } mono_marshal_unlock (); + MH_LOG("returning %p", ret); return ret; } @@ -5237,7 +5260,7 @@ mono_marshal_get_array_accessor_wrapper (MonoMethod *method) info, NULL); } mono_mb_free (mb); - + MH_LOG("returning %p", res); return res; } @@ -5416,7 +5439,7 @@ mono_marshal_get_unsafe_accessor_wrapper (MonoMethod *accessor_method, MonoUnsaf mono_mb_free (mb); /* mono_method_print_code (res); */ - + MH_LOG("returning %p", res); return res; } @@ -5727,6 +5750,7 @@ ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf (MonoReflectionTypeHan } MonoMarshalType *info = mono_marshal_load_type_info (klass); + MH_LOG("returning offset %d", info->fields [match_index].offset); return info->fields [match_index].offset; } @@ -6092,7 +6116,7 @@ mono_class_native_size (MonoClass *klass, guint32 *align) if (align) *align = info->min_align; - + MH_LOG("klass native size %d, min_align: %d", info->native_size, info->min_align); return info->native_size; } diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index b3223269e4ff36..42573abbdaa0f1 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -93,7 +93,11 @@ void stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean pinvoke) { MH_LOG_INDENT(); - MH_LOG("Converting data to stackval for type %s", mono_type_get_name (type)); + intptr_t data_ptr = *(intptr_t *)data; + MH_LOG("Converting data to stackval for type %s: ,value as intptr_t is %p", mono_type_get_name (type), data_ptr); + +// memset(result, 0, sizeof(stackval)); + log_mono_type(type); if (m_type_is_byref (type)) { result->data.p = *(gpointer*)data; MH_LOG_UNINDENT(); @@ -108,6 +112,7 @@ stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean case MONO_TYPE_U1: case MONO_TYPE_BOOLEAN: result->data.i = *(guint8*)data; + MH_LOG("Assigned U1 or BOOLEAN value assigned: %p", (intptr_t)result->data.i); break; case MONO_TYPE_I2: result->data.i = *(gint16*)data; @@ -118,17 +123,20 @@ stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean break; case MONO_TYPE_I4: result->data.i = *(gint32*)data; + MH_LOG("Assigned I4 value assigned: (int) %d (ptr) %p", result->data.i, (intptr_t)result->data.i); break; case MONO_TYPE_U: case MONO_TYPE_I: - result->data.p = *(gpointer*)data; + result->data.nati = *(mono_u*)data; break; case MONO_TYPE_PTR: case MONO_TYPE_FNPTR: result->data.p = *(gpointer*)data; + MH_LOG("Assigned pointer assigned: %p", result->data.p); break; - case MONO_TYPE_U4: + case MONO_TYPE_U4: result->data.i = *(guint32*)data; + MH_LOG("Assigned U4 value assigned: (int) %d (ptr) %p", result->data.i, (intptr_t)result->data.i); break; case MONO_TYPE_R4: /* memmove handles unaligned case */ @@ -146,6 +154,7 @@ stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean case MONO_TYPE_CLASS: case MONO_TYPE_OBJECT: case MONO_TYPE_ARRAY: + MH_LOG("Assigned pointer value: %p", result->data.p); result->data.p = *(gpointer*)data; break; case MONO_TYPE_VALUETYPE: @@ -158,6 +167,7 @@ stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean size = mono_class_native_size (m_type_data_get_klass_unchecked (type), NULL); else size = mono_class_value_size (m_type_data_get_klass_unchecked (type), NULL); + assert (size <= sizeof(stackval)); memcpy (result, data, size); break; } @@ -169,6 +179,7 @@ stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean size = mono_class_native_size (klass, NULL); else size = mono_class_value_size (klass, NULL); + assert (size <= sizeof(stackval)); memcpy (result, data, size); break; } @@ -178,7 +189,7 @@ stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean default: g_error ("got type 0x%02x", type->type); } - MH_LOG("Converted data to stackval: %s", mono_type_get_name (type)); + MH_LOG("Converted data to stackval. Type: %s, ptr value (result->data.p): %p", mono_type_get_name (type), (intptr_t)result->data.p); MH_LOG_UNINDENT(); } static char * log_sig(MonoMethodSignature* sig) @@ -256,6 +267,8 @@ void do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval *sp, gpointer ptr, gboolean save_last_error) { MH_LOG_INDENT(); + MH_LOG("Sig: %p op: %d ret_sp: %p sp: %p ptr: %p, save_last: %s", (void*)sig, op, (void*)ret_sp, (void*)sp, (void*)ptr, save_last_error ? "T" : "F"); + if (save_last_error) mono_marshal_clear_last_error (); log_op(op); @@ -493,6 +506,7 @@ do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval if (!strcmp(sigTest,"884_8")) { typedef I8 (*T)(I8,I8,I4); T func = (T)ptr; + MH_LOG("Calling 884_8 func with: %p %p %d", (void*)sp[0].data.p, (void*)sp[1].data.p, sp[2].data.i); ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i); }; if (!strcmp(sigTest,"888_8")) { diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index 0bbf834b269cd5..5a025a03f90f17 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -119,6 +119,7 @@ interp_add_ins_explicit (TransformData *td, int opcode, int len) td->cbb->last_ins = new_inst; // We should delete this, but is currently used widely to set the args of an instruction td->last_ins = new_inst; + MH_LOG("adding instruction %s at offset %d\n", mono_interp_opname (opcode), td->current_il_offset); return new_inst; } @@ -444,6 +445,7 @@ interp_create_var_explicit (TransformData *td, MonoType *type, int size) local->ext_index = -1; td->vars_size++; + MH_LOG("Creating var of type %s at index %d, size %d\n", mono_type_full_name (type), td->vars_size - 1, size); return td->vars_size - 1; } @@ -9927,7 +9929,7 @@ mono_interp_transform_method (InterpMethod *imethod, ThreadContext *context, Mon mono_error_set_invalid_operation (error, "%s", "Could not execute the method because the containing type is not fully instantiated."); return; } - + MH_LOG("transforming method %s", method->name); // g_printerr ("TRANSFORM(0x%016lx): begin %s::%s\n", mono_thread_current (), method->klass->name, method->name); method_class_vt = mono_class_vtable_checked (imethod->method->klass, error); return_if_nok (error); @@ -10017,6 +10019,7 @@ mono_interp_transform_method (InterpMethod *imethod, ThreadContext *context, Mon real_imethod = imethod; memcpy (&tmp_imethod, imethod, sizeof (InterpMethod)); imethod = &tmp_imethod; + MH_LOG("Copied imethod (%d) bytes", (int)sizeof (InterpMethod)); MONO_TIME_TRACK (mono_interp_stats.transform_time, generate (method, header, imethod, generic_context, error)); From 98ccdc585df17903ef14baa9077fb5c53cdb74d3 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 15 Jul 2025 08:27:31 +0100 Subject: [PATCH 119/209] Added test method to isolate array read issue --- .../System.Runtime/ref/System.Runtime.cs | 6 ++++- .../src/System/RuntimeType.Mono.cs | 24 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index aaff8b1c5cb654..d71343c169ed14 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -42,7 +42,11 @@ public SafeWaitHandle(System.IntPtr existingHandle, bool ownsHandle) : base (def } } namespace System -{ +{ + public partial class MHTestClass + { + public static IntPtr RunTestArray() { return 0;} + } public partial class AccessViolationException : System.SystemException { public AccessViolationException() { } diff --git a/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs b/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs index 8db74d3a0d9ade..ce437768192b43 100644 --- a/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs @@ -38,6 +38,13 @@ internal enum TypeNameFormatFlags FormatFullInst } + public partial class MHTestClass + { + public static IntPtr RunTestArray() + { + return RuntimeType.TestArray(); + } + } internal unsafe partial class RuntimeType { #region Definitions @@ -2181,6 +2188,23 @@ internal RuntimeMethodInfo[] GetMethodsByName(string? name, BindingFlags binding [MethodImplAttribute(MethodImplOptions.InternalCall)] private static extern IntPtr GetConstructors_native(QCallTypeHandle type, BindingFlags bindingAttr); + [MethodImpl(MethodImplOptions.InternalCall)] + internal static extern unsafe IntPtr TestArray_native(); + + public static IntPtr TestArray() + { + // This is a test method to ensure that the native code can be called correctly. + // It is not used in production code and is only for testing purposes. + IntPtr result = TestArray_native(); + + var h = new Mono.SafeGPtrArrayHandle(result); + var a = h[0]; + var b = h[1]; + var c = h[2]; + var sum = a + b + c; + return sum; + } + private RuntimeConstructorInfo[] GetConstructors_internal(BindingFlags bindingAttr, RuntimeType reflectedType) { var refh = new RuntimeTypeHandle(reflectedType); From 4689b63a898059c8af920b1823f846d455536ced Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 15 Jul 2025 08:29:24 +0100 Subject: [PATCH 120/209] logging and test methods --- src/mono/mono/eglib/gptrarray.c | 11 +- src/mono/mono/metadata/icall-def.h | 3 + src/mono/mono/metadata/icall.c | 38 +++++++ src/mono/mono/mini/interp/interp-icalls.c | 10 +- src/mono/mono/mini/interp/interp.c | 106 ++++++++++++------ src/mono/mono/mini/interp/transform.c | 11 +- .../sample/wasm/browser-advanced/Program.cs | 14 +++ .../Wasm.Advanced.Sample.csproj | 6 +- src/mono/sample/wasm/browser-advanced/main.js | 8 +- 9 files changed, 154 insertions(+), 53 deletions(-) diff --git a/src/mono/mono/eglib/gptrarray.c b/src/mono/mono/eglib/gptrarray.c index 08203bb1079124..16ca886ebed2c1 100644 --- a/src/mono/mono/eglib/gptrarray.c +++ b/src/mono/mono/eglib/gptrarray.c @@ -60,6 +60,8 @@ g_ptr_array_grow(GPtrArrayPriv *array, guint length) GPtrArray * g_ptr_array_new(void) { + //printf("MH_LOG_EGLIB: Creating g_ptr_array\n"); + return g_ptr_array_sized_new(0); } @@ -113,10 +115,17 @@ g_ptr_array_set_size(GPtrArray *array, gint length) void g_ptr_array_add(GPtrArray *array, gpointer data) -{ +{ g_assert (array); + g_assert(sizeof(gpointer) == 8); g_ptr_array_grow((GPtrArrayPriv *)array, 1); array->pdata[array->len++] = data; + fprintf(stderr, "MH_LOG_EGLIB: Added %p to gptr_array %p. Length is now %d. Size is now %d. array->pdata is %p." + "address of array is %p. size of GPtrArray struct is %d\n", data, array, array->len, ((GPtrArrayPriv *)array)->size, array->pdata, &array, (int)sizeof(GPtrArray)); + fflush(stderr); + /*for(guint i = 0; i < array->len; i++) { + fprintf(stderr, "MH_LOG_EGLIB: gptr_array %p contains %p at index %d\n", array, array->pdata[i], i); + }*/ } gpointer diff --git a/src/mono/mono/metadata/icall-def.h b/src/mono/mono/metadata/icall-def.h index 2661ebd4bc0989..04cfc00f7e481c 100644 --- a/src/mono/mono/metadata/icall-def.h +++ b/src/mono/mono/metadata/icall-def.h @@ -496,6 +496,9 @@ HANDLES(RT_1, "CreateInstanceInternal", ves_icall_System_RuntimeType_CreateInsta HANDLES(RT_28, "FunctionPointerReturnAndParameterTypes", ves_icall_RuntimeType_FunctionPointerReturnAndParameterTypes, GPtrArray_ptr, 1, (MonoQCallTypeHandle)) NOHANDLES(ICALL(RT_33, "GetCallingConventionFromFunctionPointerInternal", ves_icall_RuntimeType_GetCallingConventionFromFunctionPointerInternal)) HANDLES(RT_2, "GetConstructors_native", ves_icall_RuntimeType_GetConstructors_native, GPtrArray_ptr, 2, (MonoQCallTypeHandle, guint32)) +HANDLES(RT_34, "TestArray_native", ves_icall_RuntimeType_TestArray_Native, GPtrArray_ptr, 0, ()) +HANDLES(RT_35, "TestArrayRaw_native", ves_icall_RuntimeType_TestArray_Raw_Native, gpointer_ptr, 0, ()) + HANDLES(RT_30, "GetCorrespondingInflatedMethod", ves_icall_RuntimeType_GetCorrespondingInflatedMethod, MonoReflectionMethod, 2, (MonoQCallTypeHandle, MonoReflectionMethod)) HANDLES(RT_21, "GetDeclaringMethod", ves_icall_RuntimeType_GetDeclaringMethod, void, 2, (MonoQCallTypeHandle, MonoObjectHandleOnStack)) HANDLES(RT_22, "GetDeclaringType", ves_icall_RuntimeType_GetDeclaringType, void, 2, (MonoQCallTypeHandle, MonoObjectHandleOnStack)) diff --git a/src/mono/mono/metadata/icall.c b/src/mono/mono/metadata/icall.c index 729478bd3df5a8..7ecaf6f60ea3c6 100644 --- a/src/mono/mono/metadata/icall.c +++ b/src/mono/mono/metadata/icall.c @@ -4083,6 +4083,44 @@ ves_icall_RuntimeType_GetMethodsByName_native (MonoQCallTypeHandle type_handle, return mono_class_get_methods_by_name (klass, mname, bflags, mlisttype, FALSE, error); } +GPtrArray* +ves_icall_RuntimeType_TestArray_Native(MonoError *error) +{ + GPtrArray* res = g_ptr_array_new (); + gpointer val1 = (gpointer)0x111; + gpointer val2 = (gpointer)0x222; + gpointer val3 = (gpointer)0x333; + gpointer val4 = (gpointer)0x444; + + g_ptr_array_add (res, val1); + g_ptr_array_add (res, val2); + g_ptr_array_add (res, val3); + g_ptr_array_add (res, val4); + + MH_LOG ("test array values: %p %p %p", res->pdata[0], res->pdata[1], res->pdata[2]); + MH_LOG ("test array addresses: %p %p %p", &(res->pdata[0]), &(res->pdata[1]), &(res->pdata[2])); + return res; +} + +gpointer_ptr +ves_icall_RuntimeType_TestArray_Raw(MonoError *error) +{ + GPtrArray* res = g_ptr_array_new (); + gpointer val1 = (gpointer)0x111; + gpointer val2 = (gpointer)0x222; + gpointer val3 = (gpointer)0x333; + gpointer val4 = (gpointer)0x444; + + g_ptr_array_add (res, val1); + g_ptr_array_add (res, val2); + g_ptr_array_add (res, val3); + g_ptr_array_add (res, val4); + + MH_LOG ("test array values: %p %p %p", res->pdata[0], res->pdata[1], res->pdata[2]); + MH_LOG ("test array addresses: %p %p %p", &(res->pdata[0]), &(res->pdata[1]), &(res->pdata[2])); + return &(res->pdata); +} + GPtrArray* ves_icall_RuntimeType_GetConstructors_native (MonoQCallTypeHandle type_handle, guint32 bflags, MonoError *error) { diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index 42573abbdaa0f1..71373bbe5f79ec 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -94,7 +94,7 @@ stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean { MH_LOG_INDENT(); intptr_t data_ptr = *(intptr_t *)data; - MH_LOG("Converting data to stackval for type %s: ,value as intptr_t is %p", mono_type_get_name (type), data_ptr); + MH_LOG("Converting data to stackval for type %s: ,value as intptr_t is %p", mono_type_get_name (type), (void*)data_ptr); // memset(result, 0, sizeof(stackval)); log_mono_type(type); @@ -112,7 +112,7 @@ stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean case MONO_TYPE_U1: case MONO_TYPE_BOOLEAN: result->data.i = *(guint8*)data; - MH_LOG("Assigned U1 or BOOLEAN value assigned: %p", (intptr_t)result->data.i); + MH_LOG("Assigned U1 or BOOLEAN value assigned: %p", (void*)result->data.i); break; case MONO_TYPE_I2: result->data.i = *(gint16*)data; @@ -123,7 +123,7 @@ stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean break; case MONO_TYPE_I4: result->data.i = *(gint32*)data; - MH_LOG("Assigned I4 value assigned: (int) %d (ptr) %p", result->data.i, (intptr_t)result->data.i); + MH_LOG("Assigned I4 value assigned: (int) %d (ptr) %p", result->data.i, (void*)result->data.i); break; case MONO_TYPE_U: case MONO_TYPE_I: @@ -136,7 +136,7 @@ stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean break; case MONO_TYPE_U4: result->data.i = *(guint32*)data; - MH_LOG("Assigned U4 value assigned: (int) %d (ptr) %p", result->data.i, (intptr_t)result->data.i); + MH_LOG("Assigned U4 value assigned: (int) %d (ptr) %p", result->data.i, (void*)result->data.i); break; case MONO_TYPE_R4: /* memmove handles unaligned case */ @@ -189,7 +189,7 @@ stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean default: g_error ("got type 0x%02x", type->type); } - MH_LOG("Converted data to stackval. Type: %s, ptr value (result->data.p): %p", mono_type_get_name (type), (intptr_t)result->data.p); + MH_LOG("Converted data to stackval. Type: %s, ptr value (result->data.p): %p", mono_type_get_name (type), (void*)result->data.p); MH_LOG_UNINDENT(); } static char * log_sig(MonoMethodSignature* sig) diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index d2711791c7e094..ecaf1d0e8cddaf 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -246,7 +246,7 @@ reinit_frame (InterpFrame *frame, InterpFrame *parent, InterpMethod *imethod, gp frame->stack = (stackval*)stack; frame->retval = (stackval*)retval; frame->state.ip = NULL; - MH_LOG("Reinitializing frame %p with imethod %p, retval %p, stack %p", frame, imethod, retval, stack); + MH_LOG("Reinitializing frame %p with imethod %s (%p), retval %p, stack %p", frame, mono_method_get_name_full(imethod->method, TRUE, TRUE, MONO_TYPE_NAME_FORMAT_IL), imethod, retval, stack); } #define STACK_ADD_ALIGNED_BYTES(sp,bytes) ((stackval*)((char*)(sp) + (bytes))) @@ -275,8 +275,8 @@ typedef void (*ICallMethod) (InterpFrame *frame); static MonoNativeTlsKey thread_context_id; -#define DEBUG_INTERP 1 -#define COUNT_OPS 1 +#define DEBUG_INTERP 0 +#define COUNT_OPS 0 #if DEBUG_INTERP int mono_interp_traceopt = 2; @@ -803,7 +803,7 @@ stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) if (m_type_is_byref (type)) { gpointer *p = (gpointer*)data; *p = val->data.p; - MH_LOG("Ref value. Assigning %p and returning stack slot size %d", *p, MINT_STACK_SLOT_SIZE); + MH_LOG("Ref value. Assigning %p and returning stack slot size %lu", *p, MINT_STACK_SLOT_SIZE); MH_LOG_UNINDENT(); return MINT_STACK_SLOT_SIZE; } @@ -814,7 +814,7 @@ stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) case MONO_TYPE_U1: { guint8 *p = (guint8*)data; *p = GINT32_TO_UINT8 (val->data.i); - MH_LOG("Bool I1 or U1. Assigning %d and returning stack slot size %d", *p, MINT_STACK_SLOT_SIZE); + MH_LOG("Bool I1 or U1. Assigning %d and returning stack slot size %lu", *p, MINT_STACK_SLOT_SIZE); MH_LOG_UNINDENT(); return MINT_STACK_SLOT_SIZE; } @@ -823,7 +823,7 @@ stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) case MONO_TYPE_CHAR: { guint16 *p = (guint16*)data; *p = GINT32_TO_UINT16 (val->data.i); - MH_LOG("I2 U2 or Char. Assigning %d and returning stack slot size %d", *p, MINT_STACK_SLOT_SIZE); + MH_LOG("I2 U2 or Char. Assigning %d and returning stack slot size %lu", *p, MINT_STACK_SLOT_SIZE); return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_I: { @@ -833,7 +833,7 @@ stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) a native int - both by csc and mcs). Not sure what to do about sign extension as it is outside the spec... doing the obvious */ *p = (mono_i)val->data.nati; - MH_LOG("MONO_TYPE_I. Assigning %p and returning stack slot size %d", (intptr_t)*p, MINT_STACK_SLOT_SIZE); + MH_LOG("MONO_TYPE_I. Assigning %p and returning stack slot size %lu", (void*)*p, MINT_STACK_SLOT_SIZE); MH_LOG_UNINDENT(); return MINT_STACK_SLOT_SIZE; } @@ -841,7 +841,7 @@ stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) mono_u *p = (mono_u*)data; /* see above. */ *p = (mono_u)val->data.nati; - MH_LOG("MONO_TYPE_U. Assigning %p and returning stack slot size %d", (intptr_t)*p, MINT_STACK_SLOT_SIZE); + MH_LOG("MONO_TYPE_U. Assigning %p and returning stack slot size %lu", (void*)*p, MINT_STACK_SLOT_SIZE); MH_LOG_UNINDENT(); return MINT_STACK_SLOT_SIZE; } @@ -849,25 +849,25 @@ stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) case MONO_TYPE_U4: { gint32 *p = (gint32*)data; *p = val->data.i; - MH_LOG("MONO_TYPE_I4 or U4. Assigning %d and returning stack slot size %d", (intptr_t)*p, MINT_STACK_SLOT_SIZE); + MH_LOG("MONO_TYPE_I4 or U4. Assigning %d and returning stack slot size %lu", *p, MINT_STACK_SLOT_SIZE); MH_LOG_UNINDENT(); return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_I8: case MONO_TYPE_U8: { memmove (data, &val->data.l, sizeof (gint64)); - MH_LOG("MONO_TYPE_I8 or U8. Assigning %p and returning stack slot size %d", (intptr_t)data, MINT_STACK_SLOT_SIZE); + MH_LOG("MONO_TYPE_I8 or U8. Assigning %p and returning stack slot size %lu", (void*)data, MINT_STACK_SLOT_SIZE); MH_LOG_UNINDENT(); return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_R4: { /* memmove handles unaligned case */ - MH_LOG("MONO_TYPE_R4. Assigning %f and returning stack slot size %d", val->data.f_r4, MINT_STACK_SLOT_SIZE); + MH_LOG("MONO_TYPE_R4. Assigning %f and returning stack slot size %lu", val->data.f_r4, MINT_STACK_SLOT_SIZE); memmove (data, &val->data.f_r4, sizeof (float)); return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_R8: { - MH_LOG("MONO_TYPE_R8. Assigning %f and returning stack slot size %d", val->data.f, MINT_STACK_SLOT_SIZE); + MH_LOG("MONO_TYPE_R8. Assigning %f and returning stack slot size %lu", val->data.f, MINT_STACK_SLOT_SIZE); memmove (data, &val->data.f, sizeof (double)); return MINT_STACK_SLOT_SIZE; } @@ -878,7 +878,7 @@ stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) case MONO_TYPE_ARRAY: { gpointer *p = (gpointer *) data; mono_gc_wbarrier_generic_store_internal (p, val->data.o); - MH_LOG("MONO_TYPE_string, object array etc. Assigning %p and returning stack slot size %d", (intptr_t)*p, MINT_STACK_SLOT_SIZE); + MH_LOG("MONO_TYPE_string, object array etc. Assigning %p and returning stack slot size %lu", (void*)*p, MINT_STACK_SLOT_SIZE); MH_LOG_UNINDENT(); return MINT_STACK_SLOT_SIZE; } @@ -886,7 +886,7 @@ stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) case MONO_TYPE_FNPTR: { gpointer *p = (gpointer *) data; *p = val->data.p; - MH_LOG("MONO_TYPE_PTR or FNPTR. Assigning %p and returning stack slot size %d", (intptr_t)*p, MINT_STACK_SLOT_SIZE); + MH_LOG("MONO_TYPE_PTR or FNPTR. Assigning %p and returning stack slot size %lu", (void*)*p, MINT_STACK_SLOT_SIZE); MH_LOG_UNINDENT(); return MINT_STACK_SLOT_SIZE; } @@ -3863,7 +3863,7 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause unsigned char *locals = NULL; int call_args_offset; int return_offset; - gboolean gc_transitions = FALSE; + gboolean gc_transitions = FALSE; #if DEBUG_INTERP int tracing = global_tracing; @@ -4104,6 +4104,7 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause MINT_IN_BREAK; } MINT_IN_CASE(MINT_CALL_DELEGATE) { + MH_LOG("MINT_CALL_DELEGATE"); return_offset = ip [1]; call_args_offset = ip [2]; MonoDelegate *del = LOCAL_VAR (call_args_offset, MonoDelegate*); @@ -4182,7 +4183,7 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause } MINT_IN_CASE(MINT_CALLI) { gboolean need_unbox; - + MH_LOG("MINT_CALLI"); /* In mixed mode, stay in the interpreter for simplicity even if there is an AOT version of the callee */ cmethod = ftnptr_to_imethod (LOCAL_VAR (ip [2], gpointer), &need_unbox); @@ -4203,6 +4204,7 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause goto jit_call; } MINT_IN_CASE(MINT_CALLI_NAT_FAST) { + MH_LOG("MINT_CALLI_NAT_FAST"); MintICallSig icall_sig = (MintICallSig)ip [4]; MonoMethodSignature *csignature = (MonoMethodSignature*)frame->imethod->data_items [ip [5]]; gboolean save_last_error = ip [6]; @@ -4325,7 +4327,7 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause cmethod = (InterpMethod*)frame->imethod->data_items [ip [3]]; return_offset = ip [1]; call_args_offset = ip [2]; - MH_LOG("MINT_CALL for %s. return offset %d, call_args_offset %d", (InterpMethod*)frame->imethod->method->name, return_offset, call_args_offset); + MH_LOG("MINT_CALL for %s. return offset %d, call_args_offset %d", mono_method_get_name_full(frame->imethod->method, TRUE, TRUE, MONO_TYPE_NAME_FORMAT_IL), return_offset, call_args_offset); #ifdef ENABLE_EXPERIMENT_TIERED ip += 5; #else @@ -4418,29 +4420,38 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause } MINT_IN_CASE(MINT_RET) frame->retval [0] = LOCAL_VAR (ip [1], stackval); + MH_LOG("returning pointer %p or long %lld", frame->retval [0].data.p, frame->retval [0].data.l); goto exit_frame; MINT_IN_CASE(MINT_RET_I1) frame->retval [0].data.i = (gint8) LOCAL_VAR (ip [1], gint32); + MH_LOG("MINT_RET_I1 %d", frame->retval [0].data.i); goto exit_frame; MINT_IN_CASE(MINT_RET_U1) frame->retval [0].data.i = (guint8) LOCAL_VAR (ip [1], gint32); + MH_LOG("MINT_RET_U1 %d", frame->retval [0].data.i); goto exit_frame; MINT_IN_CASE(MINT_RET_I2) frame->retval [0].data.i = (gint16) LOCAL_VAR (ip [1], gint32); + MH_LOG("MINT_RET_I2 %d", frame->retval [0].data.i); goto exit_frame; MINT_IN_CASE(MINT_RET_U2) frame->retval [0].data.i = (guint16) LOCAL_VAR (ip [1], gint32); + MH_LOG("MINT_RET_U2 %d", frame->retval [0].data.i); goto exit_frame; MINT_IN_CASE(MINT_RET_I4_IMM) frame->retval [0].data.i = (gint16)ip [1]; + MH_LOG("MINT_RET_I4_IMM"); goto exit_frame; MINT_IN_CASE(MINT_RET_I8_IMM) frame->retval [0].data.l = (gint16)ip [1]; + MH_LOG("MINT_RET_I8_IMM casting to gint16 ip[1] = %lld", frame->retval [0].data.l); goto exit_frame; MINT_IN_CASE(MINT_RET_VOID) + MH_LOG("void returning"); goto exit_frame; MINT_IN_CASE(MINT_RET_VT) { memmove (frame->retval, locals + ip [1], ip [2]); + MH_LOG("returning vt, moved %d bytes from offset to give %p", ip[2], ip[1], frame->retval); goto exit_frame; } MINT_IN_CASE(MINT_RET_LOCALLOC) @@ -6177,17 +6188,37 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; #define LDFLD(datamem, fieldtype) LDFLD_UNALIGNED(datamem, fieldtype, FALSE) - MINT_IN_CASE(MINT_LDFLD_I1) LDFLD(gint32, gint8); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_U1) LDFLD(gint32, guint8); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_I2) LDFLD(gint32, gint16); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_U2) LDFLD(gint32, guint16); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_I4) LDFLD(gint32, gint32); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_I8) LDFLD(gint64, gint64); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_R4) LDFLD(float, float); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_R8) LDFLD(double, double); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_O) LDFLD(gpointer, gpointer); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_I8_UNALIGNED) LDFLD_UNALIGNED(gint64, gint64, TRUE); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_R8_UNALIGNED) LDFLD_UNALIGNED(double, double, TRUE); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_I1) MH_LOG("MINT_LDFLD_I1"); LDFLD(gint32, gint8); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_U1) MH_LOG("MINT_LDFLD_U1"); LDFLD(gint32, guint8); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_I2) MH_LOG("MINT_LDFLD_I2"); LDFLD(gint32, gint16); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_U2) MH_LOG("MINT_LDFLD_U2"); LDFLD(gint32, guint16); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_I4) MH_LOG("MINT_LDFLD_I4"); LDFLD(gint32, gint32); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_I8) MH_LOG("MINT_LDFLD_I8"); do { + MonoObject* o = (*(MonoObject**)(locals + (ip[2]))); do { + if ((!(o))) do { + interp_throw_ex_general((interp_get_exception_null_reference(frame, ip)), context, frame, (ip), 0); goto resume; + } while (0); + } while (0); + if (0) + memcpy(locals + ip[1], (char*)o + ip[3], sizeof(gint64)); + else + { + MH_LOG("MINT_LDFLD_I8_UNALIGNED *(%p + %d) = %p", (void*)o, ip[3], *(gint64*)((char*)o + ip[3])); + (*(gint64*)(locals + (ip[1]))) = *(gint64*)((char*)o + ip[3]); + ip += 4; + } +} while (0); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_R4) MH_LOG("MINT_LDFLD_R4"); LDFLD(float, float); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_R8) MH_LOG("MINT_LDFLD_R8"); LDFLD(double, double); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_O) MH_LOG("MINT_LDFLD_O"); do { + MonoObject* o = (*(MonoObject**)(locals + (ip[2]))); do { + if ((!(o))) do { + interp_throw_ex_general((interp_get_exception_null_reference(frame, ip)), context, frame, (ip), 0); goto resume; + } while (0); + } while (0); if (0) memcpy(locals + ip[1], (char*)o + ip[3], sizeof(gpointer)); else (*(gpointer*)(locals + (ip[1]))) = *(gpointer*)((char*)o + ip[3]); ip += 4; +} while (0); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_I8_UNALIGNED) MH_LOG("MINT_LDFLD_I8_UNALIGNED"); LDFLD_UNALIGNED(gint64, gint64, TRUE); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_R8_UNALIGNED) MH_LOG("MINT_LDFLD_R8_UNALIGNED"); LDFLD_UNALIGNED(double, double, TRUE); MINT_IN_BREAK; MINT_IN_CASE(MINT_LDFLD_VT) { MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); @@ -7642,24 +7673,25 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; // stack, no additional conversion is needed. MINT_IN_CASE(MINT_MOV_1) (*(gint8*)(locals + (ip[1]))) = (*(gint8*)(locals + (ip[2]))); - MH_LOG("MINT_MOV_1: %d <- %d: %p\n", ip[1], ip[2], (intptr_t)(*(gint8*)(locals + (ip[1])))); + MH_LOG("MINT_MOV_1: %d <- %d: %p\n", ip[1], ip[2], (void*)(*(gint8*)(locals + (ip[1])))); ip += 3; MINT_IN_BREAK; MINT_IN_CASE(MINT_MOV_2) MOV(gint16, gint16); MINT_IN_BREAK; // Normal moves between locals MINT_IN_CASE(MINT_MOV_4) + // TODO: this is hardcoded for x64 + assert(((uintptr_t)locals % 8) == 0 && "locals is not 8-byte aligned"); (*(guint32*)(locals + (ip[1]))) = (*(guint32*)(locals + (ip[2]))); - MH_LOG("MINT_MOV_4: %d <- %d: %p\n", ip[1], ip[2], (intptr_t)(*(guint32*)(locals + (ip[1])))); + MH_LOG("MINT_MOV_4: %d <- %d: %p\n", ip[1], ip[2], (void*)(*(guint32*)(locals + (ip[1])))); ip += 3;; MINT_IN_BREAK; MINT_IN_CASE(MINT_MOV_8) + // TODO: this is hardcoded for x64 + assert(((uintptr_t)locals % 8) == 0 && "locals is not 8-byte aligned"); + (*(guint64*)(locals + (ip[1]))) = (*(guint64*)(locals + (ip[2]))); - intptr_t result = (*(guint64*)(locals + (ip[1]))); - intptr_t input = (*(guint64*)(locals + (ip[2]))); - intptr_t inputOffsetm4 = (*(guint64*)(locals + (ip[2] - 4))); - intptr_t inputOffsetp4 = (*(guint64*)(locals + (ip[2] + 4))); - //MH_LOG("MINT_MOV_8: %d <- %d: %p <- %p (-4: %p) (+4: %p)\n", ip[1], ip[2], result, input, inputOffsetm4, inputOffsetp4); - MH_LOG("MINT_MOV_8: %d <- %d: %p <- %p", ip[1], ip[2], result, input); + intptr_t result = (*(guint64*)(locals + (ip[1]))); + MH_LOG("MINT_MOV_8: *(%p + %d) = *(%p + %d): %p", locals, ip[1], locals, ip[2], (void*)result); ip += 3;; MINT_IN_BREAK; @@ -8043,7 +8075,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; * a param_area and all calls would inherit the same sp, or if we are full coop. */ context->stack_pointer = (guchar*)frame->stack + frame->imethod->alloca_size; - MH_LOG("exiting frame, frame->imethod->alloca_size: %d", frame->imethod->alloca_size); + MH_LOG("exiting frame %p for %s", frame, mono_method_get_name_full(frame->imethod->method, FALSE, TRUE, MONO_TYPE_NAME_FORMAT_IL)); LOAD_INTERP_STATE (frame); CHECK_RESUME_STATE (context); diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index 5a025a03f90f17..152c313e6c3786 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -119,7 +119,7 @@ interp_add_ins_explicit (TransformData *td, int opcode, int len) td->cbb->last_ins = new_inst; // We should delete this, but is currently used widely to set the args of an instruction td->last_ins = new_inst; - MH_LOG("adding instruction %s at offset %d\n", mono_interp_opname (opcode), td->current_il_offset); + MH_LOG("adding instruction %s at offset %d", mono_interp_opname (opcode), td->current_il_offset); return new_inst; } @@ -445,7 +445,7 @@ interp_create_var_explicit (TransformData *td, MonoType *type, int size) local->ext_index = -1; td->vars_size++; - MH_LOG("Creating var of type %s at index %d, size %d\n", mono_type_full_name (type), td->vars_size - 1, size); + MH_LOG("Creating var of type %s at index %d, size %d", mono_type_full_name (type), td->vars_size - 1, size); return td->vars_size - 1; } @@ -3083,7 +3083,7 @@ interp_inline_method (TransformData *td, MonoMethod *target_method, MonoMethodHe } if (td->verbose_level) g_print ("Inline start method %s.%s\n", m_class_get_name (target_method->klass), target_method->name); - MH_LOG("Inline start method %s.%s\n", m_class_get_name (target_method->klass), target_method->name); + MH_LOG("Inline start method %s.%s", m_class_get_name (target_method->klass), target_method->name); td->inline_depth++; ret = generate_code (td, target_method, header, generic_context, error); td->inline_depth--; @@ -5269,7 +5269,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, goto_if_nok (error, exit); g_assert (bb); - MH_LOG("Generating code for method %s\n", mono_method_full_name (method, TRUE)); + MH_LOG("Generating code for method %s", mono_method_full_name (method, TRUE)); td->il_code = header->code; td->in_start = td->ip = header->code; @@ -5408,7 +5408,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, for (int i = signature->param_count - 1; i >= 0; i--) { MonoType *type = get_type_from_stack (td->sp [-1].type, td->sp [-1].klass); - MH_LOG("Creating local for inlined arg %d: %s\n", i, mono_type_full_name (type)); + MH_LOG("Creating local for inlined arg %d: %s", i, mono_type_full_name (type)); local = interp_create_var (td, type); arg_locals [i + !!signature->hasthis] = local; @@ -10019,7 +10019,6 @@ mono_interp_transform_method (InterpMethod *imethod, ThreadContext *context, Mon real_imethod = imethod; memcpy (&tmp_imethod, imethod, sizeof (InterpMethod)); imethod = &tmp_imethod; - MH_LOG("Copied imethod (%d) bytes", (int)sizeof (InterpMethod)); MONO_TIME_TRACK (mono_interp_stats.transform_time, generate (method, header, imethod, generic_context, error)); diff --git a/src/mono/sample/wasm/browser-advanced/Program.cs b/src/mono/sample/wasm/browser-advanced/Program.cs index f6d4a099bb67ad..054c06c7f781ad 100644 --- a/src/mono/sample/wasm/browser-advanced/Program.cs +++ b/src/mono/sample/wasm/browser-advanced/Program.cs @@ -87,7 +87,21 @@ internal static bool SimpleTestConsole() System.IO.TextWriter output = Console.Out; return output != null; } + [JSExport] + internal static void SimpleTestArray() + { + + var arrayPtr = System.MHTestClass.RunTestArray(); + //var h = new Mono.SafeGPtrArrayHandle(arrayPtr); + var a = 1;// h[0]; + var b = 2;// h[1]; + var c = 3;// h[2]; + + //return a + b + c; + //using (var h = new Mono.SafeGPtrArrayHandle(TestArray_native()); + } + [JSExport] internal static void SimpleTestFunctionPrintString() { diff --git a/src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj b/src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj index 7f4487d176894a..f432ead2e0ee99 100644 --- a/src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj +++ b/src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj @@ -1,8 +1,8 @@ - true - true + false + false true false true @@ -33,7 +33,7 @@ - + diff --git a/src/mono/sample/wasm/browser-advanced/main.js b/src/mono/sample/wasm/browser-advanced/main.js index 5a35da9c1cb26d..b808df1ec056d9 100644 --- a/src/mono/sample/wasm/browser-advanced/main.js +++ b/src/mono/sample/wasm/browser-advanced/main.js @@ -100,7 +100,13 @@ try { //const IntSize = exports.Sample.Test.SimpleTestFunctionIntSize(); //console.debug(`IntSize: ${IntSize}`); //console.debug("Accessing console:"); - const consoleTest = exports.Sample.Test.SimpleTestConsole(); + + const arrayTest = exports.Sample.Test.SimpleTestArray(); + console.debug("Made it past arrayTest! Value is: ", "0x" + arrayTest.toString(16)); + + //const consoleTest = exports.Sample.Test.SimpleTestConsole(); + + //console.debug(`consoleTest: ${consoleTest}`); //console.debug("Printing empty string from C#:"); //exports.Sample.Test.SimpleTestFunctionPrintEmptyString(); From 76697cd74daf19e97b6713e74d6d765d6652556e Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 15 Jul 2025 08:31:04 +0100 Subject: [PATCH 121/209] Try forcing alignment/packing (makes no appreciable difference) --- .../aot/ILCompiler.Diagnostics/AssemblyInfo.cs | 1 + .../src/Mono/RuntimeHandles.cs | 2 ++ .../src/Mono/RuntimeStructs.cs | 15 ++++++++------- .../src/Mono/SafeGPtrArrayHandle.cs | 2 ++ src/mono/mono/eglib/glib.h | 13 +++++++++---- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/coreclr/tools/aot/ILCompiler.Diagnostics/AssemblyInfo.cs b/src/coreclr/tools/aot/ILCompiler.Diagnostics/AssemblyInfo.cs index 60e68309575e62..6212dbd2e400ba 100644 --- a/src/coreclr/tools/aot/ILCompiler.Diagnostics/AssemblyInfo.cs +++ b/src/coreclr/tools/aot/ILCompiler.Diagnostics/AssemblyInfo.cs @@ -5,6 +5,7 @@ using System.Runtime.CompilerServices; [assembly: DisableRuntimeMarshalling] +[assembly: InternalsVisibleTo("Wasm.Advanced.Sample")] namespace ILCompiler.Diagnostics { diff --git a/src/mono/System.Private.CoreLib/src/Mono/RuntimeHandles.cs b/src/mono/System.Private.CoreLib/src/Mono/RuntimeHandles.cs index 90b612313c19d4..feb058c04b53a9 100644 --- a/src/mono/System.Private.CoreLib/src/Mono/RuntimeHandles.cs +++ b/src/mono/System.Private.CoreLib/src/Mono/RuntimeHandles.cs @@ -4,6 +4,7 @@ using System; using System.Reflection; using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; namespace Mono { @@ -205,6 +206,7 @@ public override int GetHashCode() } } + [StructLayout(LayoutKind.Sequential, Pack = 8)] internal unsafe struct RuntimeGPtrArrayHandle { private RuntimeStructs.GPtrArray* value; diff --git a/src/mono/System.Private.CoreLib/src/Mono/RuntimeStructs.cs b/src/mono/System.Private.CoreLib/src/Mono/RuntimeStructs.cs index 3d46673c6c8d56..6aeb66e2c0499e 100644 --- a/src/mono/System.Private.CoreLib/src/Mono/RuntimeStructs.cs +++ b/src/mono/System.Private.CoreLib/src/Mono/RuntimeStructs.cs @@ -22,6 +22,14 @@ namespace Mono // internal static class RuntimeStructs { + // glib.h GPtrArray + [StructLayout(LayoutKind.Sequential, Pack = 8)] + internal unsafe struct GPtrArray + { + internal IntPtr* data; + internal int len; + internal int padding; + } // class-internals.h MonoRemoteClass [StructLayout(LayoutKind.Sequential)] internal unsafe struct RemoteClass @@ -48,13 +56,6 @@ internal unsafe struct GenericParamInfo internal uint token; internal MonoClass** constraints; /* NULL terminated */ } - - // glib.h GPtrArray - internal unsafe struct GPtrArray - { - internal IntPtr* data; - internal int len; - } } //Maps to metadata-internals.h:: MonoAssemblyName diff --git a/src/mono/System.Private.CoreLib/src/Mono/SafeGPtrArrayHandle.cs b/src/mono/System.Private.CoreLib/src/Mono/SafeGPtrArrayHandle.cs index 855fc854b42d52..c21efc1ec55324 100644 --- a/src/mono/System.Private.CoreLib/src/Mono/SafeGPtrArrayHandle.cs +++ b/src/mono/System.Private.CoreLib/src/Mono/SafeGPtrArrayHandle.cs @@ -11,9 +11,11 @@ // using System; +using System.Runtime.InteropServices; namespace Mono { + [StructLayout(LayoutKind.Sequential, Pack = 8)] internal struct SafeGPtrArrayHandle : IDisposable { private RuntimeGPtrArrayHandle handle; diff --git a/src/mono/mono/eglib/glib.h b/src/mono/mono/eglib/glib.h index 6d14a1721b2108..c90f8ce809db49 100644 --- a/src/mono/mono/eglib/glib.h +++ b/src/mono/mono/eglib/glib.h @@ -659,11 +659,16 @@ void g_array_set_size (GArray *array, gint length); * Pointer Array */ -typedef struct _GPtrArray GPtrArray; -struct _GPtrArray { - gpointer *pdata; - guint len; +#if defined(_MSC_VER) +__declspec(align(8)) struct _GPtrArray { +#else +struct __attribute__((aligned(8))) _GPtrArray { +#endif + gpointer *pdata; + guint len; + guint padding; }; +typedef struct _GPtrArray GPtrArray; GPtrArray *g_ptr_array_new (void); GPtrArray *g_ptr_array_sized_new (guint reserved_size); From d140d56dca701c644442c1be041d9330f70e8a75 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 15 Jul 2025 08:31:33 +0100 Subject: [PATCH 122/209] Test method, logging --- .../src/System/RuntimeType.Mono.cs | 30 +++++++++++++++---- src/mono/browser/runtime/runtime.c | 9 ++++-- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs b/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs index ce437768192b43..7f87e5a47430b3 100644 --- a/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs @@ -12,6 +12,7 @@ using System.Runtime.Serialization; using System.Threading; +using Mono; namespace System { // Keep this in sync with FormatFlags defined in typestring.h @@ -2189,7 +2190,7 @@ internal RuntimeMethodInfo[] GetMethodsByName(string? name, BindingFlags binding private static extern IntPtr GetConstructors_native(QCallTypeHandle type, BindingFlags bindingAttr); [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern unsafe IntPtr TestArray_native(); + internal static extern unsafe IntPtr TestArray_native(); public static IntPtr TestArray() { @@ -2197,11 +2198,28 @@ public static IntPtr TestArray() // It is not used in production code and is only for testing purposes. IntPtr result = TestArray_native(); - var h = new Mono.SafeGPtrArrayHandle(result); - var a = h[0]; - var b = h[1]; - var c = h[2]; - var sum = a + b + c; + //var h = new Mono.SafeGPtrArrayHandle(result); + //var h = new Mono.RuntimeGPtrArrayHandle(result); + RuntimeStructs.GPtrArray* myData = (RuntimeStructs.GPtrArray*)result; + + IntPtr* data = myData->data; + long idx = 0x1; + var a = data[idx]; + var b = data[idx]; + var c = data[idx]; + + var sum = c + a; + + IntPtr[] array = new IntPtr[6]; + array[0] = 0x555; + array[1] = 0x666; + array[2] = 0x777; + + var d = array[0]; + var e = array[1]; + var f = array[2]; + + sum = f - d + e; return sum; } diff --git a/src/mono/browser/runtime/runtime.c b/src/mono/browser/runtime/runtime.c index bcd7b5a87b1166..c8824b6765274c 100644 --- a/src/mono/browser/runtime/runtime.c +++ b/src/mono/browser/runtime/runtime.c @@ -100,6 +100,9 @@ mono_install_icall_table_callbacks (const MonoIcallTableCallbacks *cb); #endif #endif +// Comment out FOR COMPILE: +//#define LINK_ICALLS + #ifdef LINK_ICALLS #include "icall-table.h" @@ -126,9 +129,10 @@ icall_table_lookup (MonoMethod *method, char *classname, char *methodname, char *out_flags = 0; const char *image_name = mono_image_get_name (mono_class_get_image (mono_method_get_class (method))); - + #if defined(ICALL_TABLE_corlib) - if (!strcmp (image_name, "System.Private.CoreLib")) { + MH_LOG("Looking for %s with ICALL_TABLE_corlib in %s", methodname, image_name); + if (!strcmp (image_name, "System.Private.CoreLib") || !strcmp (image_name, "Wasm.Advanced.Sample")) { indexes = corlib_icall_indexes; indexes_size = sizeof (corlib_icall_indexes) / 4; flags = corlib_icall_flags; @@ -137,6 +141,7 @@ icall_table_lookup (MonoMethod *method, char *classname, char *methodname, char } #endif #ifdef ICALL_TABLE_System + MH_LOG("Looking for %s with ICALL_TABLE_System in %s", methodname, image_name); if (!strcmp (image_name, "System")) { indexes = System_icall_indexes; indexes_size = sizeof (System_icall_indexes) / 4; From adf3fdaf3d3d5aea333f1fb04f73261615741052 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 15 Jul 2025 18:13:10 +0100 Subject: [PATCH 123/209] Hardcode is64bit to set IntPtr internal size --- .../src/System.Private.CoreLib.Shared.projitems | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems index 9de275bad2cbc8..adf594d45e17cf 100644 --- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems +++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems @@ -21,7 +21,8 @@ .PlatformNotSupported $(MSBuildThisFileDirectory)ILLink\ true - true + + true true true From f1e4a56860c3dcda76ffe54a85b5db13d51dd855 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 15 Jul 2025 18:14:29 +0100 Subject: [PATCH 124/209] More logging before I start rolling back --- .../System.Runtime/ref/System.Runtime.cs | 1 + .../src/System/RuntimeType.Mono.cs | 50 ++++++++++++++++++- src/mono/mono/eglib/gptrarray.c | 4 +- src/mono/mono/metadata/class.c | 6 ++- src/mono/mono/metadata/icall-def.h | 2 +- src/mono/mono/metadata/icall.c | 47 +++++++++++++++-- src/mono/mono/metadata/marshal.c | 6 +++ src/mono/mono/metadata/metadata.c | 2 +- src/mono/mono/metadata/object.c | 4 +- src/mono/mono/mini/interp/interp.c | 9 +++- src/mono/mono/mini/interp/transform.c | 2 +- .../sample/wasm/browser-advanced/Program.cs | 3 +- 12 files changed, 119 insertions(+), 17 deletions(-) diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index d71343c169ed14..e47712404b49fc 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -46,6 +46,7 @@ namespace System public partial class MHTestClass { public static IntPtr RunTestArray() { return 0;} + public static IntPtr RunTestArrayRaw() { return 0; } } public partial class AccessViolationException : System.SystemException { diff --git a/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs b/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs index 7f87e5a47430b3..57418934b214dd 100644 --- a/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs @@ -1,6 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - +#define MH_USE_INTPTR using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; @@ -13,6 +13,7 @@ using System.Threading; using Mono; + namespace System { // Keep this in sync with FormatFlags defined in typestring.h @@ -45,6 +46,10 @@ public static IntPtr RunTestArray() { return RuntimeType.TestArray(); } + public static IntPtr RunTestArrayRaw() + { + return RuntimeType.TestArrayRaw(); + } } internal unsafe partial class RuntimeType { @@ -2190,7 +2195,10 @@ internal RuntimeMethodInfo[] GetMethodsByName(string? name, BindingFlags binding private static extern IntPtr GetConstructors_native(QCallTypeHandle type, BindingFlags bindingAttr); [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern unsafe IntPtr TestArray_native(); + internal static extern unsafe IntPtr TestArray_native(); + + [MethodImpl(MethodImplOptions.InternalCall)] + internal static extern unsafe IntPtr TestArrayRaw_native(); public static IntPtr TestArray() { @@ -2201,6 +2209,7 @@ public static IntPtr TestArray() //var h = new Mono.SafeGPtrArrayHandle(result); //var h = new Mono.RuntimeGPtrArrayHandle(result); RuntimeStructs.GPtrArray* myData = (RuntimeStructs.GPtrArray*)result; + IntPtr* data = myData->data; long idx = 0x1; @@ -2223,6 +2232,43 @@ public static IntPtr TestArray() return sum; } + public static IntPtr TestArrayRaw() + { + int size = Marshal.SizeOf(typeof(IntPtr)); + System.Diagnostics.Debug.Assert(size == 8, "IntPtr is not the expected size of 8"); + + // This is a test method to ensure that the native code can be called correctly. + // It is not used in production code and is only for testing purposes. + //IntPtr* data = (IntPtr*)TestArrayRaw_native(); + +#if MH_USE_INTPTR + IntPtr* data = (IntPtr*)TestArrayRaw_native(); + + long idx0 = 0x0; + long idx1 = 0x1; + long idx2 = 0x2; + + IntPtr a = data[idx0]; + IntPtr b = data[idx1]; + IntPtr c = data[idx2]; + + IntPtr sum = (IntPtr)(b + c + a); +#else + Int64* data = (Int64*)TestArrayRaw_native(); + + long idx0 = 0x0; + long idx1 = 0x1; + long idx2 = 0x2; + + Int64 a = data[idx0]; + Int64 b = data[idx1]; + Int64 c = data[idx2]; + + IntPtr sum = (IntPtr)(b + c + a); +#endif + return sum; + } + private RuntimeConstructorInfo[] GetConstructors_internal(BindingFlags bindingAttr, RuntimeType reflectedType) { var refh = new RuntimeTypeHandle(reflectedType); diff --git a/src/mono/mono/eglib/gptrarray.c b/src/mono/mono/eglib/gptrarray.c index 16ca886ebed2c1..4931da471a1a0b 100644 --- a/src/mono/mono/eglib/gptrarray.c +++ b/src/mono/mono/eglib/gptrarray.c @@ -120,8 +120,8 @@ g_ptr_array_add(GPtrArray *array, gpointer data) g_assert(sizeof(gpointer) == 8); g_ptr_array_grow((GPtrArrayPriv *)array, 1); array->pdata[array->len++] = data; - fprintf(stderr, "MH_LOG_EGLIB: Added %p to gptr_array %p. Length is now %d. Size is now %d. array->pdata is %p." - "address of array is %p. size of GPtrArray struct is %d\n", data, array, array->len, ((GPtrArrayPriv *)array)->size, array->pdata, &array, (int)sizeof(GPtrArray)); + fprintf(stderr, "MH_LOG_EGLIB: Added %p to gptr_array %p. Sizeof gpointer is %zd. Length is now %d. Size is now %d. array->pdata is %p." + "address of array is %p. size of GPtrArray struct is %d\n", data, array, sizeof(gpointer), array->len, ((GPtrArrayPriv *)array)->size, array->pdata, &array, (int)sizeof(GPtrArray)); fflush(stderr); /*for(guint i = 0; i < array->len; i++) { fprintf(stderr, "MH_LOG_EGLIB: gptr_array %p contains %p at index %d\n", array, array->pdata[i], i); diff --git a/src/mono/mono/metadata/class.c b/src/mono/mono/metadata/class.c index 1e71f0a2b9dde3..1365adba141f84 100644 --- a/src/mono/mono/metadata/class.c +++ b/src/mono/mono/metadata/class.c @@ -52,7 +52,7 @@ #include // for dn_simdhash_ght_t #include "../native/containers/dn-simdhash-specializations.h" - +#include MonoStats mono_stats; /* Statistics */ @@ -4799,6 +4799,7 @@ mono_class_array_element_size (MonoClass *klass) case MONO_TYPE_I4: case MONO_TYPE_U4: case MONO_TYPE_R4: + MH_LOG("Got element size 4 for MONO_TYPE_I4/U4/R4."); return 4; case MONO_TYPE_I: case MONO_TYPE_U: @@ -4809,6 +4810,7 @@ mono_class_array_element_size (MonoClass *klass) case MONO_TYPE_OBJECT: case MONO_TYPE_SZARRAY: case MONO_TYPE_ARRAY: + MH_LOG("Got element TARGET_SIZEOF_VOID_P for MONO_TYPE_I/U/etc. size is %d", TARGET_SIZEOF_VOID_P); return TARGET_SIZEOF_VOID_P; case MONO_TYPE_I8: case MONO_TYPE_U8: @@ -4827,7 +4829,7 @@ mono_class_array_element_size (MonoClass *klass) case MONO_TYPE_VAR: case MONO_TYPE_MVAR: { int align; - + MH_LOG("Getting size for VAR/MVAR"); return mono_type_size (type, &align); } case MONO_TYPE_VOID: diff --git a/src/mono/mono/metadata/icall-def.h b/src/mono/mono/metadata/icall-def.h index 04cfc00f7e481c..e0f5572d54a016 100644 --- a/src/mono/mono/metadata/icall-def.h +++ b/src/mono/mono/metadata/icall-def.h @@ -497,7 +497,7 @@ HANDLES(RT_28, "FunctionPointerReturnAndParameterTypes", ves_icall_RuntimeType_F NOHANDLES(ICALL(RT_33, "GetCallingConventionFromFunctionPointerInternal", ves_icall_RuntimeType_GetCallingConventionFromFunctionPointerInternal)) HANDLES(RT_2, "GetConstructors_native", ves_icall_RuntimeType_GetConstructors_native, GPtrArray_ptr, 2, (MonoQCallTypeHandle, guint32)) HANDLES(RT_34, "TestArray_native", ves_icall_RuntimeType_TestArray_Native, GPtrArray_ptr, 0, ()) -HANDLES(RT_35, "TestArrayRaw_native", ves_icall_RuntimeType_TestArray_Raw_Native, gpointer_ptr, 0, ()) +HANDLES(RT_35, "TestArrayRaw_native", ves_icall_RuntimeType_TestArray_Raw_Native, gpointer, 0, ()) HANDLES(RT_30, "GetCorrespondingInflatedMethod", ves_icall_RuntimeType_GetCorrespondingInflatedMethod, MonoReflectionMethod, 2, (MonoQCallTypeHandle, MonoReflectionMethod)) HANDLES(RT_21, "GetDeclaringMethod", ves_icall_RuntimeType_GetDeclaringMethod, void, 2, (MonoQCallTypeHandle, MonoObjectHandleOnStack)) diff --git a/src/mono/mono/metadata/icall.c b/src/mono/mono/metadata/icall.c index 7ecaf6f60ea3c6..9bf02e511bb7c3 100644 --- a/src/mono/mono/metadata/icall.c +++ b/src/mono/mono/metadata/icall.c @@ -4102,9 +4102,20 @@ ves_icall_RuntimeType_TestArray_Native(MonoError *error) return res; } -gpointer_ptr -ves_icall_RuntimeType_TestArray_Raw(MonoError *error) +gpointer +ves_icall_RuntimeType_TestArray_Raw_Native(MonoError *error) { + assert(sizeof(gpointer) == sizeof(gpointer_ptr)); + assert(sizeof(gpointer) == 8); + //bypass GPtrArray + MH_LOG ("allocating new test array. sizeof intptr_t is %zd", sizeof(intptr_t)); + int numElems = 4; + +#define MH_USE_GPTR_ARRAY 1 +#define MH_USER_INT64_ARRAY 0 + #if(0) + int64_t *rawArray = malloc(numElems * sizeof(int64_t)); + memset(rawArray, 0, numElems * sizeof(int64_t)); GPtrArray* res = g_ptr_array_new (); gpointer val1 = (gpointer)0x111; gpointer val2 = (gpointer)0x222; @@ -4116,9 +4127,39 @@ ves_icall_RuntimeType_TestArray_Raw(MonoError *error) g_ptr_array_add (res, val3); g_ptr_array_add (res, val4); + MH_LOG ("gpointer size %zd", sizeof(gpointer)); MH_LOG ("test array values: %p %p %p", res->pdata[0], res->pdata[1], res->pdata[2]); MH_LOG ("test array addresses: %p %p %p", &(res->pdata[0]), &(res->pdata[1]), &(res->pdata[2])); - return &(res->pdata); + return res->pdata; + #elif (MH_USER_INT64_ARRAY) + int64_t *rawArray = malloc(numElems * sizeof(int64_t)); + memset(rawArray, 0, numElems * sizeof(int64_t)); + int64_t val1 = (int64_t)0x111; + int64_t val2 = (int64_t)0x222; + int64_t val3 = (int64_t)0x333; + int64_t val4 = (int64_t)0x444; + rawArray[0] = val1; + rawArray[1] = val2; + rawArray[2] = val3; + rawArray[3] = val4; + #elif (MH_USE_GPTR_ARRAY) + gpointer *rawArray = malloc(numElems * sizeof(gpointer)); + memset(rawArray, 0, numElems * sizeof(gpointer)); + gpointer val1 = (gpointer)0x111; + gpointer val2 = (gpointer)0x222; + gpointer val3 = (gpointer)0x333; + gpointer val4 = (gpointer)0x444; + rawArray[0] = val1; + rawArray[1] = val2; + rawArray[2] = val3; + rawArray[3] = val4; + #endif + // 8 digits for 4 byte value + MH_LOG ("raw array values: %p %p %p", (void*)rawArray[0], (void*)rawArray[1], (void*)rawArray[2]); + MH_LOG ("raw array addresses: %p %p %p", &(rawArray[0]), &(rawArray[1]), &(rawArray[2])); + return (gpointer)rawArray; + + } GPtrArray* diff --git a/src/mono/mono/metadata/marshal.c b/src/mono/mono/metadata/marshal.c index 07d244c89cecfe..31e7367879570f 100644 --- a/src/mono/mono/metadata/marshal.c +++ b/src/mono/mono/metadata/marshal.c @@ -6218,6 +6218,7 @@ mono_marshal_type_size (MonoType *type, MonoMarshalSpec *mspec, guint32 *align, switch (native_type) { case MONO_NATIVE_BOOLEAN: *align = 4; + MH_LOG("size is 4, align is 4 for native type %02x", native_type); return 4; case MONO_NATIVE_I1: case MONO_NATIVE_U1: @@ -6232,6 +6233,7 @@ mono_marshal_type_size (MonoType *type, MonoMarshalSpec *mspec, guint32 *align, case MONO_NATIVE_U4: case MONO_NATIVE_ERROR: *align = 4; + MH_LOG("size is 4, align is 4 for native type %02x", native_type); return 4; case MONO_NATIVE_I8: case MONO_NATIVE_U8: @@ -6261,6 +6263,7 @@ mono_marshal_type_size (MonoType *type, MonoMarshalSpec *mspec, guint32 *align, case MONO_NATIVE_FUNC: case MONO_NATIVE_LPSTRUCT: *align = MONO_ABI_ALIGNOF (gpointer); + MH_LOG("size is %d, for native type %02x", TARGET_SIZEOF_VOID_P, native_type); return TARGET_SIZEOF_VOID_P; case MONO_NATIVE_STRUCT: klass = mono_class_from_mono_type_internal (type); @@ -6272,11 +6275,13 @@ mono_marshal_type_size (MonoType *type, MonoMarshalSpec *mspec, guint32 *align, padded_size = mono_class_native_size (klass, align); if (padded_size == 0) padded_size = 1; + MH_LOG("size is %d, for native type %02x", padded_size, native_type); return padded_size; case MONO_NATIVE_BYVALTSTR: { int esize = unicode ? 2: 1; g_assert (mspec); *align = esize; + MH_LOG("size is %d, for native type %02x", mspec->data.array_data.num_elem * esize, native_type); return mspec->data.array_data.num_elem * esize; } case MONO_NATIVE_BYVALARRAY: { @@ -6290,6 +6295,7 @@ mono_marshal_type_size (MonoType *type, MonoMarshalSpec *mspec, guint32 *align, esize = mono_class_native_size (m_class_get_element_class (klass), align); } g_assert (mspec); + MH_LOG("size is %d, for native type %02x", mspec->data.array_data.num_elem * esize, native_type); return mspec->data.array_data.num_elem * esize; } case MONO_NATIVE_CUSTOM: diff --git a/src/mono/mono/metadata/metadata.c b/src/mono/mono/metadata/metadata.c index d194af42eacdc9..8030bb5a5bdb1b 100644 --- a/src/mono/mono/metadata/metadata.c +++ b/src/mono/mono/metadata/metadata.c @@ -5363,7 +5363,7 @@ mono_type_size (MonoType *t, int *align) *align = MONO_ABI_ALIGNOF (gpointer); return MONO_ABI_SIZEOF (gpointer); case MONO_TYPE_VALUETYPE: { - if (m_class_is_enumtype (m_type_data_get_klass_unchecked (t))) + if (m_class_is_enumtype (m_type_data_get_klass_unchecked (t))) return mono_type_size (mono_class_enum_basetype_internal (m_type_data_get_klass_unchecked (t)), align); else return mono_class_value_size (m_type_data_get_klass_unchecked (t), (guint32*)align); diff --git a/src/mono/mono/metadata/object.c b/src/mono/mono/metadata/object.c index 56408f3387c019..766b973a1f3b25 100644 --- a/src/mono/mono/metadata/object.c +++ b/src/mono/mono/metadata/object.c @@ -57,7 +57,7 @@ #include "monitor.h" #include "icall-decl.h" #include "icall-signatures.h" - +#include #if _MSC_VER #pragma warning(disable:4312) // FIXME pointer cast to different size #endif @@ -7996,7 +7996,7 @@ mono_class_value_size (MonoClass *klass, guint32 *align) g_assert (size >= 0); if (align) *align = m_class_get_min_align (klass); - + MH_LOG("Returning size %d for class %s\n", size, m_class_get_name(klass)); return size; } diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index ecaf1d0e8cddaf..b96b2e0eb4f75d 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -5017,10 +5017,13 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; MONO_DISABLE_WARNING(4127) \ gpointer ptr = LOCAL_VAR (ip [2], gpointer); \ NULL_CHECK (ptr); \ - if (unaligned && ((gsize)ptr % SIZEOF_VOID_P)) \ + if (unaligned && ((gsize)ptr % SIZEOF_VOID_P)) {\ + MH_LOG("LDIND memcpy into %d + %d, from %p, size %zd", locals, ip[1], ptr, sizeof(datatype)); \ memcpy (locals + ip [1], ptr, sizeof (datatype)); \ - else \ + } else {\ + MH_LOG("LDIND LOCAL_VAR (%d, %s) = *(%s*)%p", ip[1], #datatype, #casttype, ptr); \ LOCAL_VAR (ip [1], datatype) = *(casttype*)ptr; \ + } \ ip += 3; \ MONO_RESTORE_WARNING \ } while (0) @@ -5042,8 +5045,10 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; } MINT_IN_CASE(MINT_LDIND_I8) #ifdef NO_UNALIGNED_ACCESS + MH_LOG("doing unaligned access for MINT_LDIND_I8\n"); LDIND(gint64, gint64, TRUE); #else + MH_LOG("doing aligned access for MINT_LDIND_I8\n"); LDIND(gint64, gint64, FALSE); #endif MINT_IN_BREAK; diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index 152c313e6c3786..9de34022a4213f 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -1799,7 +1799,7 @@ interp_emit_ldelema (TransformData *td, MonoClass *array_class, MonoClass *check MonoClass *element_class = m_class_get_element_class (array_class); int rank = m_class_get_rank (array_class); int size = mono_class_array_element_size (element_class); - + MH_LOG("Emiting LDELEMA for %s, size %d\n", m_class_get_name (array_class), size); gboolean bounded = m_class_get_byval_arg (array_class) ? m_class_get_byval_arg (array_class)->type == MONO_TYPE_ARRAY : FALSE; td->sp -= rank + 1; diff --git a/src/mono/sample/wasm/browser-advanced/Program.cs b/src/mono/sample/wasm/browser-advanced/Program.cs index 054c06c7f781ad..e55d69419cd2f4 100644 --- a/src/mono/sample/wasm/browser-advanced/Program.cs +++ b/src/mono/sample/wasm/browser-advanced/Program.cs @@ -91,7 +91,8 @@ internal static bool SimpleTestConsole() internal static void SimpleTestArray() { - var arrayPtr = System.MHTestClass.RunTestArray(); + //var arrayPtr = System.MHTestClass.RunTestArray(); + var arrayPtr = System.MHTestClass.RunTestArrayRaw(); //var h = new Mono.SafeGPtrArrayHandle(arrayPtr); var a = 1;// h[0]; From ad335541e3e60768c350182e08d7d51548e2a052 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 15 Jul 2025 18:14:50 +0100 Subject: [PATCH 125/209] Temporary error if 64bit not set --- src/libraries/System.Private.CoreLib/src/System/IntPtr.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/System.Private.CoreLib/src/System/IntPtr.cs b/src/libraries/System.Private.CoreLib/src/System/IntPtr.cs index 0145ae19695c8f..7013eea4a86b26 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IntPtr.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IntPtr.cs @@ -17,6 +17,7 @@ using nint_t = System.Int64; #else using nint_t = System.Int32; +#error TARGET_64BIT is not defined #endif namespace System From 2418945dfe5e75ac50133a969376f97cc2ea0249 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 29 Jul 2025 12:26:19 +0100 Subject: [PATCH 126/209] Advanced sample working Marshaling changes to gc_handle. lots of logging and checks to remove. --- .gitignore | 4 + .../BinaryPrimitives.ReverseEndianness.cs | 1 + .../System/Collections/Generic/Dictionary.cs | 2 + .../src/System/Collections/Generic/HashSet.cs | 2 + .../src/System/Decimal.DecCalc.cs | 1 + .../src/System/Double.cs | 1 + .../System.Private.CoreLib/src/System/Enum.cs | 3 + .../src/System/Globalization/Ordinal.Utf8.cs | 2 + .../src/System/Globalization/Ordinal.cs | 2 + .../System.Private.CoreLib/src/System/Math.cs | 1 + .../src/System/Memory.cs | 1 + .../src/System/MemoryExtensions.cs | 1 + .../src/System/Number.Formatting.cs | 2 + .../src/System/Numerics/BitOperations.cs | 1 + .../src/System/ReadOnlyMemory.cs | 1 + .../src/System/ReadOnlySpan.cs | 1 + .../Runtime/CompilerServices/CastCache.cs | 1 + .../Runtime/CompilerServices/GenericCache.cs | 1 + .../System/Runtime/InteropServices/Marshal.cs | 2 + .../System/Runtime/InteropServices/NFloat.cs | 1 + .../src/System/Runtime/Intrinsics/Scalar.cs | 1 + .../src/System/Single.cs | 1 + .../System.Private.CoreLib/src/System/Span.cs | 1 + .../src/System/SpanHelpers.Byte.cs | 2 + .../src/System/SpanHelpers.ByteMemOps.cs | 1 + .../src/System/SpanHelpers.Char.cs | 2 + .../src/System/String.Comparison.cs | 1 + .../src/System/String.Manipulation.cs | 1 + .../src/System/String.cs | 1 + .../src/System/Text/UnicodeEncoding.cs | 1 + .../src/System/Threading/Interlocked.cs | 1 + .../src/System/Threading/Volatile.cs | 1 + .../src/System/UIntPtr.cs | 1 + .../JavaScript/JSMarshalerArgument.cs | 36 --- .../Marshaling/JSMarshalerArgument.Task.cs | 2 +- .../src/System/String.Mono.cs | 1 + src/mono/browser/runtime/marshal.ts | 89 ++++---- src/mono/mono/eglib/gptrarray.c | 6 +- src/mono/mono/metadata/loader.c | 3 +- src/mono/mono/metadata/mh_log.c | 2 +- src/mono/mono/metadata/object.c | 8 +- src/mono/mono/mini/interp/interp-icalls.c | 8 +- src/mono/mono/mini/interp/interp.c | 206 +++++++----------- src/mono/mono/mini/interp/transform.c | 14 +- .../sample/wasm/browser-advanced/Program.cs | 18 +- src/mono/sample/wasm/browser-advanced/main.js | 38 +--- 46 files changed, 212 insertions(+), 265 deletions(-) diff --git a/.gitignore b/.gitignore index 88e4f6ab632aee..67ed58451df8de 100644 --- a/.gitignore +++ b/.gitignore @@ -363,3 +363,7 @@ src/coreclr/System.Private.CoreLib/common .dotnet-daily/ run-stress-* test:.cs + +src/mono/System.Private.CoreLib/CompatibilitySuppressions.xml + +src/mono/mono/offsets/wasm64-unknown-none.h diff --git a/src/libraries/System.Private.CoreLib/src/System/Buffers/Binary/BinaryPrimitives.ReverseEndianness.cs b/src/libraries/System.Private.CoreLib/src/System/Buffers/Binary/BinaryPrimitives.ReverseEndianness.cs index 5f8b0a7e5fca7f..9f5f55efd7fb02 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Buffers/Binary/BinaryPrimitives.ReverseEndianness.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Buffers/Binary/BinaryPrimitives.ReverseEndianness.cs @@ -13,6 +13,7 @@ using nint_t = System.Int64; using nuint_t = System.UInt64; #else +#error TARGET_64BIT is not defined using nint_t = System.Int32; using nuint_t = System.UInt32; #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs index c890bbed83c7ef..7aed6184d8cfb3 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs @@ -27,6 +27,8 @@ public class Dictionary : IDictionary, IDictionary, private Entry[]? _entries; #if TARGET_64BIT private ulong _fastModMultiplier; +#else + #error TARGET_64BIT is not defined #endif private int _count; private int _freeList; diff --git a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/HashSet.cs b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/HashSet.cs index 026456617f8997..c4009030a3864a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/HashSet.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/HashSet.cs @@ -41,6 +41,8 @@ public class HashSet : ICollection, ISet, IReadOnlyCollection, IRead private Entry[]? _entries; #if TARGET_64BIT private ulong _fastModMultiplier; +#else + #error TARGET_64BIT is not defined #endif private int _count; private int _freeList; diff --git a/src/libraries/System.Private.CoreLib/src/System/Decimal.DecCalc.cs b/src/libraries/System.Private.CoreLib/src/System/Decimal.DecCalc.cs index 442e00870d4935..266cb3f0aeaf13 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Decimal.DecCalc.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Decimal.DecCalc.cs @@ -271,6 +271,7 @@ private static bool Div96ByConst(ref ulong high64, ref uint low, uint pow) return true; } #else +#error TARGET_64BIT is not defined // 32-bit RyuJIT doesn't convert 64-bit division by constant into multiplication by reciprocal. Do half-width divisions instead. Debug.Assert(pow <= ushort.MaxValue); uint num, mid32, low16, div, rem; diff --git a/src/libraries/System.Private.CoreLib/src/System/Double.cs b/src/libraries/System.Private.CoreLib/src/System/Double.cs index fe89ca49146caf..dd9a796343bb26 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Double.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Double.cs @@ -1448,6 +1448,7 @@ private static bool TryConvertTo(double value, [MaybeNullWhen(false)] ou result = (TOther)(object)actualResult; return true; #else +#error TARGET_64BIT is not defined nuint actualResult = (value >= uint.MaxValue) ? uint.MaxValue : (value <= uint.MinValue) ? uint.MinValue : (nuint)value; result = (TOther)(object)actualResult; diff --git a/src/libraries/System.Private.CoreLib/src/System/Enum.cs b/src/libraries/System.Private.CoreLib/src/System/Enum.cs index aa17ad8a5149c3..126f10f3c2a824 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Enum.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Enum.cs @@ -1571,6 +1571,7 @@ private static unsafe bool TryFormatNumberAsHex(ref byte data, Span(ref byte data, Span> 32) + (((ulong)(uint)(a >> 32)) * b); diff --git a/src/libraries/System.Private.CoreLib/src/System/Memory.cs b/src/libraries/System.Private.CoreLib/src/System/Memory.cs index a0da08ba9a8038..0d6665f956c285 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Memory.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Memory.cs @@ -98,6 +98,7 @@ public Memory(T[]? array, int start, int length) if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)array.Length) ThrowHelper.ThrowArgumentOutOfRangeException(); #else +#error TARGET_64BIT is not defined if ((uint)start > (uint)array.Length || (uint)length > (uint)(array.Length - start)) ThrowHelper.ThrowArgumentOutOfRangeException(); #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs index cae62dc6eb8894..7894fc28dc5baa 100644 --- a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs @@ -202,6 +202,7 @@ public static ReadOnlySpan AsSpan(this string? text, int start, int length if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)text.Length) ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.start); #else +#error TARGET_64BIT is not defined if ((uint)start > (uint)text.Length || (uint)length > (uint)(text.Length - start)) ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.start); #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs b/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs index e22a12d24f6440..40303611f31dc9 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs @@ -1906,6 +1906,8 @@ internal static unsafe bool TryInt64ToHexStr(long value, char hexBase, in #if TARGET_64BIT [MethodImpl(MethodImplOptions.AggressiveInlining)] +#else +#error TARGET_64BIT is not defined #endif private static unsafe TChar* Int64ToHexChars(TChar* buffer, ulong value, int hexBase, int digits) where TChar : unmanaged, IUtfChar { diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs index 498ccc82d7b702..fcf927e5412e14 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs @@ -101,6 +101,7 @@ public static uint RoundUpToPowerOf2(uint value) #if TARGET_64BIT return (uint)(0x1_0000_0000ul >> LeadingZeroCount(value - 1)); #else +#error TARGET_64BIT is not defined int shift = 32 - LeadingZeroCount(value - 1); return (1u ^ (uint)(shift >> 5)) << shift; #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/ReadOnlyMemory.cs b/src/libraries/System.Private.CoreLib/src/System/ReadOnlyMemory.cs index 61bd9314bd26ca..696a0b52204dc3 100644 --- a/src/libraries/System.Private.CoreLib/src/System/ReadOnlyMemory.cs +++ b/src/libraries/System.Private.CoreLib/src/System/ReadOnlyMemory.cs @@ -76,6 +76,7 @@ public ReadOnlyMemory(T[]? array, int start, int length) if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)array.Length) ThrowHelper.ThrowArgumentOutOfRangeException(); #else +#error TARGET_64BIT is not defined if ((uint)start > (uint)array.Length || (uint)length > (uint)(array.Length - start)) ThrowHelper.ThrowArgumentOutOfRangeException(); #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/ReadOnlySpan.cs b/src/libraries/System.Private.CoreLib/src/System/ReadOnlySpan.cs index 1402f8d2a3e4e8..0c5e7536fc110e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/ReadOnlySpan.cs +++ b/src/libraries/System.Private.CoreLib/src/System/ReadOnlySpan.cs @@ -74,6 +74,7 @@ public ReadOnlySpan(T[]? array, int start, int length) if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)array.Length) ThrowHelper.ThrowArgumentOutOfRangeException(); #else +#error TARGET_64BIT is not defined if ((uint)start > (uint)array.Length || (uint)length > (uint)(array.Length - start)) ThrowHelper.ThrowArgumentOutOfRangeException(); #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastCache.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastCache.cs index c5602eff0d2824..3b9eb885f22903 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastCache.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastCache.cs @@ -96,6 +96,7 @@ private static int KeyToBucket(ref int tableData, nuint source, nuint target) #if TARGET_64BIT return (int)((hash * 11400714819323198485ul) >> hashShift); #else +#error TARGET_64BIT is not defined return (int)((hash * 2654435769u) >> hashShift); #endif } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/GenericCache.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/GenericCache.cs index 2b8bd8eea7a223..fdb45d9d1bbe56 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/GenericCache.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/GenericCache.cs @@ -101,6 +101,7 @@ private static int HashToBucket(Entry[] table, int hash) #if TARGET_64BIT return (int)(((ulong)hash * 11400714819323198485ul) >> hashShift); #else +#error TARGET_64BIT is not defined return (int)(((uint)hash * 2654435769u) >> hashShift); #endif } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs index a2b30029b0216f..9c7f3d1aac554e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs @@ -356,6 +356,7 @@ public static IntPtr ReadIntPtr(object ptr, int ofs) #if TARGET_64BIT return (nint)ReadInt64(ptr, ofs); #else // 32 +#error TARGET_64BIT is not defined return (nint)ReadInt32(ptr, ofs); #endif } @@ -473,6 +474,7 @@ public static void WriteIntPtr(IntPtr ptr, int ofs, IntPtr val) #if TARGET_64BIT WriteInt64(ptr, ofs, (long)val); #else // 32 + #pragma warning disable CA2020 // Prevent from behavioral change WriteInt32(ptr, ofs, (int)val); #pragma warning restore CA2020 diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NFloat.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NFloat.cs index 5e2fb905df195c..342008db3da18e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NFloat.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NFloat.cs @@ -880,6 +880,7 @@ static NFloat IBinaryNumber.AllBitsSet [NonVersionable] get => (NFloat)BitConverter.UInt64BitsToDouble(0xFFFF_FFFF_FFFF_FFFF); #else +#error TARGET_64BIT is not defined [NonVersionable] get => BitConverter.UInt32BitsToSingle(0xFFFF_FFFF); #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Scalar.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Scalar.cs index deb6ef6af4d3d7..61e8240f6c1917 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Scalar.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Scalar.cs @@ -524,6 +524,7 @@ public static uint ExtractMostSignificantBit(T value) ulong bits = (ulong)(nint)(object)value; return (uint)(bits >> 63); #else +#error TARGET_64BIT is not defined uint bits = (uint)(nint)(object)value; return bits >> 31; #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/Single.cs b/src/libraries/System.Private.CoreLib/src/System/Single.cs index ce37952076f6b8..5ca8f29057899f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Single.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Single.cs @@ -1467,6 +1467,7 @@ private static bool TryConvertTo(float value, [MaybeNullWhen(false)] out result = (TOther)(object)actualResult; return true; #else +#error TARGET_64BIT is not defined nuint actualResult = (value >= uint.MaxValue) ? uint.MaxValue : (value <= uint.MinValue) ? uint.MinValue : (nuint)value; result = (TOther)(object)actualResult; diff --git a/src/libraries/System.Private.CoreLib/src/System/Span.cs b/src/libraries/System.Private.CoreLib/src/System/Span.cs index 20609fd10bcdb5..106872c785feb6 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Span.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Span.cs @@ -79,6 +79,7 @@ public Span(T[]? array, int start, int length) if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)array.Length) ThrowHelper.ThrowArgumentOutOfRangeException(); #else +#error TARGET_64BIT is not defined if ((uint)start > (uint)array.Length || (uint)length > (uint)(array.Length - start)) ThrowHelper.ThrowArgumentOutOfRangeException(); #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Byte.cs b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Byte.cs index 8f87c9005e578c..c960c94d5e45d2 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Byte.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Byte.cs @@ -772,6 +772,8 @@ public static unsafe bool SequenceEqual(ref byte first, ref byte second, nuint l #if TARGET_64BIT // On 32-bit, this will always be true since sizeof(nuint) == 4 if (length < sizeof(uint)) +#else + #error TARGET_64BIT is not defined #endif { uint differentBits = 0; diff --git a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.ByteMemOps.cs b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.ByteMemOps.cs index 319c23e0bf2152..056205af740481 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.ByteMemOps.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.ByteMemOps.cs @@ -117,6 +117,7 @@ internal static void Memmove(ref byte dest, ref byte src, nuint len) Unsafe.WriteUnaligned(ref dest, Unsafe.ReadUnaligned(ref src)); Unsafe.WriteUnaligned(ref Unsafe.Add(ref destEnd, -8), Unsafe.ReadUnaligned(ref Unsafe.Add(ref srcEnd, -8))); #else +#error TARGET_64BIT is not defined Unsafe.WriteUnaligned(ref dest, Unsafe.ReadUnaligned(ref src)); Unsafe.WriteUnaligned(ref Unsafe.Add(ref dest, 4), Unsafe.ReadUnaligned(ref Unsafe.Add(ref src, 4))); Unsafe.WriteUnaligned(ref Unsafe.Add(ref destEnd, -8), Unsafe.ReadUnaligned(ref Unsafe.Add(ref srcEnd, -8))); diff --git a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Char.cs b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Char.cs index 9cbeccb2f88de1..d5cbca30ae64a0 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Char.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Char.cs @@ -512,6 +512,8 @@ public static unsafe int SequenceCompareTo(ref char first, int firstLength, ref i += sizeof(int) / sizeof(char); } } +#else + #error TARGET_64BIT is not defined #endif while (i < minLength) diff --git a/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs b/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs index f9261106b34c73..51a94244616247 100644 --- a/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs +++ b/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs @@ -132,6 +132,7 @@ private static unsafe int CompareOrdinalHelper(string strA, string strB) length -= 12; a += 12; b += 12; } #else // TARGET_64BIT +#error TARGET_64BIT is not defined while (length >= 10) { if (*(int*)a != *(int*)b) goto DiffOffset0; diff --git a/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs b/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs index 8c4d5f786c597d..c88cc9f784b709 100644 --- a/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs +++ b/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs @@ -2241,6 +2241,7 @@ public string Substring(int startIndex, int length) // See comment in Span.Slice for how this works. if ((ulong)(uint)startIndex + (ulong)(uint)length > (ulong)(uint)Length) #else +#error TARGET_64BIT is not defined if ((uint)startIndex > (uint)Length || (uint)length > (uint)(Length - startIndex)) #endif { diff --git a/src/libraries/System.Private.CoreLib/src/System/String.cs b/src/libraries/System.Private.CoreLib/src/System/String.cs index e94d8778f1cab4..2a73e11931925e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/String.cs +++ b/src/libraries/System.Private.CoreLib/src/System/String.cs @@ -376,6 +376,7 @@ internal bool TryGetSpan(int startIndex, int count, out ReadOnlySpan slice return false; } #else +#error TARGET_64BIT is not defined if ((uint)startIndex > (uint)Length || (uint)count > (uint)(Length - startIndex)) { slice = default; diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/UnicodeEncoding.cs b/src/libraries/System.Private.CoreLib/src/System/Text/UnicodeEncoding.cs index 7eaf078feae5ad..868c361bd31860 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/UnicodeEncoding.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/UnicodeEncoding.cs @@ -401,6 +401,7 @@ internal sealed override unsafe int GetByteCount(char* chars, int count, Encoder #if TARGET_64BIT (unchecked((long)chars) & 7) == 0 && #else +#error TARGET_64BIT is not defined (unchecked((int)chars) & 3) == 0 && #endif charLeftOver == 0) diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Interlocked.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Interlocked.cs index 3f74b53818ffcb..0de0134f238832 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Interlocked.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Interlocked.cs @@ -205,6 +205,7 @@ public static IntPtr Exchange(ref IntPtr location1, IntPtr value) #if TARGET_64BIT return (IntPtr)Interlocked.Exchange(ref Unsafe.As(ref location1), (long)value); #else +#error TARGET_64BIT is not defined return (IntPtr)Exchange(ref Unsafe.As(ref location1), (int)value); #endif #pragma warning restore CA2020 diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Volatile.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Volatile.cs index 508647b0545a93..4822dfed8252b9 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Volatile.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Volatile.cs @@ -91,6 +91,7 @@ public static long Read(ref readonly long location) => #if TARGET_64BIT (long)Unsafe.As(ref Unsafe.AsRef(in location)).Value; #else +#error TARGET_64BIT is not defined // On 32-bit machines, we use Interlocked, since an ordinary volatile read would not be atomic. Interlocked.CompareExchange(ref Unsafe.AsRef(in location), 0, 0); #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs b/src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs index 7ab359b04199bc..bd358ec61fe2b8 100644 --- a/src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs +++ b/src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs @@ -16,6 +16,7 @@ using nuint_t = System.UInt64; #else using nuint_t = System.UInt32; +#error TARGET_64BIT is not defined #endif namespace System diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSMarshalerArgument.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSMarshalerArgument.cs index b4c9879d1cc1ef..4670c5ff60e071 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSMarshalerArgument.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSMarshalerArgument.cs @@ -24,11 +24,7 @@ public partial struct JSMarshalerArgument { internal JSMarshalerArgumentImpl slot; // keep in sync with JSMarshalerArgumentOffsets in marshal.ts -#if WASM64 [StructLayout(LayoutKind.Explicit, Pack = 32, Size = 64)] -#else - [StructLayout(LayoutKind.Explicit, Pack = 32, Size = 32)] -#endif internal struct JSMarshalerArgumentImpl { [FieldOffset(0)] @@ -49,7 +45,6 @@ internal struct JSMarshalerArgumentImpl internal double DoubleValue;// must be aligned to 8 because of Module.HEAPF64 view alignment [FieldOffset(0)] internal IntPtr IntPtrValue; -#if WASM64 [FieldOffset(8)] internal IntPtr JSHandle; [FieldOffset(8)] @@ -79,37 +74,6 @@ internal struct JSMarshalerArgumentImpl [FieldOffset(56)] internal IntPtr SyncDoneSemaphorePtr; #endif -#else - [FieldOffset(4)] - internal IntPtr JSHandle; - [FieldOffset(4)] - internal IntPtr GCHandle; - - [FieldOffset(8)] - internal int Length; - - /// - /// Discriminators - /// - [FieldOffset(12)] - internal MarshalerType Type; - [FieldOffset(13)] - internal MarshalerType ElementType; - - #if FEATURE_WASM_MANAGED_THREADS - [FieldOffset(16)] - internal IntPtr ContextHandle; - - [FieldOffset(20)] - internal bool ReceiverShouldFree; // note this is 1 byte - - [FieldOffset(24)] - internal IntPtr CallerNativeTID; - - [FieldOffset(28)] - internal IntPtr SyncDoneSemaphorePtr; - #endif -#endif } /// diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.Task.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.Task.cs index 99c2730f8fe8dd..bc22d600bfb944 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.Task.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.Task.cs @@ -110,7 +110,7 @@ public unsafe void ToManaged(out Task? value, ArgumentToManagedCallback #if FEATURE_WASM_MANAGED_THREADS lock (ctx) #endif - { + { var holder = ctx.GetPromiseHolder(slot.GCHandle); TaskCompletionSource tcs = new TaskCompletionSource(holder, TaskCreationOptions.RunContinuationsAsynchronously); ToManagedCallback callback = (JSMarshalerArgument* arguments_buffer) => diff --git a/src/mono/System.Private.CoreLib/src/System/String.Mono.cs b/src/mono/System.Private.CoreLib/src/System/String.Mono.cs index 7dedf5a6e536d0..a86e058925fe75 100644 --- a/src/mono/System.Private.CoreLib/src/System/String.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/String.Mono.cs @@ -34,6 +34,7 @@ public static string IsInterned(string str) internal const int OFFSET_TO_STRING = 20; #else internal const int OFFSET_TO_STRING = 12; +#error TARGET_64BIT is not defined #endif // TODO: Should be pointing to Buffer instead diff --git a/src/mono/browser/runtime/marshal.ts b/src/mono/browser/runtime/marshal.ts index 49b25c3e2b6648..c103e7437ddd13 100644 --- a/src/mono/browser/runtime/marshal.ts +++ b/src/mono/browser/runtime/marshal.ts @@ -24,47 +24,26 @@ export const proxy_debug_symbol = Symbol.for("wasm proxy_debug"); export const JavaScriptMarshalerArgSize = isWasm64 ? 64 : 32; // keep in sync with JSMarshalerArgumentImpl offsets -const JSMarshalerArgumentOffsets = isWasm64 ? { - BooleanValue: 0, - ByteValue: 0, - CharValue: 0, - Int16Value: 0, - Int32Value: 0, - Int64Value: 0, - SingleValue: 0, - DoubleValue: 0, - IntPtrValue: 0, - JSHandle: 8, - GCHandle: 8, - Length: 16, - Type: 24, - ElementType: 25, - ContextHandle: 32, - ReceiverShouldFree: 40, - CallerNativeTID: 48, - SyncDoneSemaphorePtr: 56, -} - : - { - BooleanValue: 0, - ByteValue: 0, - CharValue: 0, - Int16Value: 0, - Int32Value: 0, - Int64Value: 0, - SingleValue: 0, - DoubleValue: 0, - IntPtrValue: 0, - JSHandle: 4, - GCHandle: 4, - Length: 8, - Type: 12, - ElementType: 13, - ContextHandle: 16, - ReceiverShouldFree: 20, - CallerNativeTID: 24, - SyncDoneSemaphorePtr: 28, - }; +const enum JSMarshalerArgumentOffsets { + BooleanValue = 0, + ByteValue = 0, + CharValue = 0, + Int16Value = 0, + Int32Value = 0, + Int64Value = 0, + SingleValue = 0, + DoubleValue = 0, + IntPtrValue = 0, + JSHandle = 8, + GCHandle = 8, + Length = 16, + Type = 24, + ElementType = 25, + ContextHandle = 32, + ReceiverShouldFree = 40, + CallerNativeTID = 48, + SyncDoneSemaphorePtr = 56, +} export const JSMarshalerTypeSize = 32; // keep in sync with JSFunctionBinding.JSBindingType @@ -340,7 +319,10 @@ export function set_arg_i32 (arg: JSMarshalerArgument, value: number): void { export function set_arg_intptr (arg: JSMarshalerArgument, value: VoidPtr | bigint | number): void { mono_assert(arg, "Null arg"); if (isWasm64) { - setI64Big(arg, value as bigint); + if (typeof value !== "bigint") + setI64Big(arg, BigInt(value as number)); + else + setI64Big(arg, value as bigint); } else { setU32(arg, value as number); } @@ -383,7 +365,15 @@ export function get_arg_js_handle (arg: JSMarshalerArgument): JSHandle { export function set_arg_proxy_context (arg: JSMarshalerArgument): void { if (!WasmEnableThreads) return; mono_assert(arg, "Null arg"); - setI32(add_offset(arg, JSMarshalerArgumentOffsets.ContextHandle), runtimeHelpers.proxyGCHandle as any); + + if (isWasm64) { + if (typeof runtimeHelpers.proxyGCHandle !== "bigint") + setI64Big(add_offset(arg, JSMarshalerArgumentOffsets.ContextHandle), BigInt(runtimeHelpers.proxyGCHandle as any as number)); + else + setI64Big(add_offset(arg, JSMarshalerArgumentOffsets.ContextHandle), runtimeHelpers.proxyGCHandle as bigint); + } else { + setI32(add_offset(arg, JSMarshalerArgumentOffsets.ContextHandle), runtimeHelpers.proxyGCHandle as any); + } } export function set_js_handle (arg: JSMarshalerArgument, jsHandle: JSHandle): void { @@ -394,12 +384,21 @@ export function set_js_handle (arg: JSMarshalerArgument, jsHandle: JSHandle): vo export function get_arg_gc_handle (arg: JSMarshalerArgument): GCHandle { mono_assert(arg, "Null arg"); - return getI32(add_offset(arg, JSMarshalerArgumentOffsets.GCHandle)) as any; + return isWasm64 ? getI64Big(add_offset(arg, JSMarshalerArgumentOffsets.GCHandle)) as any : getI32(add_offset(arg, JSMarshalerArgumentOffsets.GCHandle)) as any; } export function set_gc_handle (arg: JSMarshalerArgument, gcHandle: GCHandle): void { mono_assert(arg, "Null arg"); - setI32(add_offset(arg, JSMarshalerArgumentOffsets.GCHandle), gcHandle as any); + mono_log_debug(`set_gc_handle(${arg}, ${gcHandle}) at offset ${JSMarshalerArgumentOffsets.GCHandle}`); + + if (isWasm64) { + if (typeof gcHandle !== "bigint") + setI64Big(add_offset(arg, JSMarshalerArgumentOffsets.GCHandle), BigInt(gcHandle as any as number)); + else + setI64Big(add_offset(arg, JSMarshalerArgumentOffsets.GCHandle), gcHandle as bigint); + } else { + setI32(add_offset(arg, JSMarshalerArgumentOffsets.GCHandle), gcHandle as any); + } set_arg_proxy_context(arg); } diff --git a/src/mono/mono/eglib/gptrarray.c b/src/mono/mono/eglib/gptrarray.c index 4931da471a1a0b..ca6a5f71a4258e 100644 --- a/src/mono/mono/eglib/gptrarray.c +++ b/src/mono/mono/eglib/gptrarray.c @@ -120,9 +120,9 @@ g_ptr_array_add(GPtrArray *array, gpointer data) g_assert(sizeof(gpointer) == 8); g_ptr_array_grow((GPtrArrayPriv *)array, 1); array->pdata[array->len++] = data; - fprintf(stderr, "MH_LOG_EGLIB: Added %p to gptr_array %p. Sizeof gpointer is %zd. Length is now %d. Size is now %d. array->pdata is %p." - "address of array is %p. size of GPtrArray struct is %d\n", data, array, sizeof(gpointer), array->len, ((GPtrArrayPriv *)array)->size, array->pdata, &array, (int)sizeof(GPtrArray)); - fflush(stderr); + //fprintf(stderr, "MH_LOG_EGLIB: Added %p to gptr_array %p. Sizeof gpointer is %zd. Length is now %d. Size is now %d. array->pdata is %p." + // "address of array is %p. size of GPtrArray struct is %d\n", data, array, sizeof(gpointer), array->len, ((GPtrArrayPriv *)array)->size, array->pdata, &array, (int)sizeof(GPtrArray)); + //fflush(stderr); /*for(guint i = 0; i < array->len; i++) { fprintf(stderr, "MH_LOG_EGLIB: gptr_array %p contains %p at index %d\n", array, array->pdata[i], i); }*/ diff --git a/src/mono/mono/metadata/loader.c b/src/mono/mono/metadata/loader.c index a8da9d90d0db48..69207106ecb146 100644 --- a/src/mono/mono/metadata/loader.c +++ b/src/mono/mono/metadata/loader.c @@ -406,8 +406,7 @@ mono_field_from_token_checked (MonoImage *image, guint32 token, MonoClass **retk static MonoMethod * find_method_in_class (MonoClass *klass, const char *name, const char *qname, const char *fqname, MonoMethodSignature *sig, MonoClass *from_class, MonoError *error) -{ - MH_LOG("find method %s in class - log return value", name); +{ int i; /* FIXME: method refs from metadata-upate probably end up here */ diff --git a/src/mono/mono/metadata/mh_log.c b/src/mono/mono/metadata/mh_log.c index 858894ccaad8bd..07304c73295a3d 100644 --- a/src/mono/mono/metadata/mh_log.c +++ b/src/mono/mono/metadata/mh_log.c @@ -39,7 +39,7 @@ void log_mono_type(MonoType* type) { default: type_str = "UNKNOWN"; break; } - MH_LOG("MonoType: %s", type_str); + MH_LOG("MonoType: %s (%d)", type_str, type->type); } void log_mono_type_enum(MonoTypeEnum type_enum) { diff --git a/src/mono/mono/metadata/object.c b/src/mono/mono/metadata/object.c index 766b973a1f3b25..9f9a300775da1a 100644 --- a/src/mono/mono/metadata/object.c +++ b/src/mono/mono/metadata/object.c @@ -2559,6 +2559,7 @@ mono_class_get_virtual_method (MonoClass *klass, MonoMethod *method, MonoError * static MonoObject* do_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc, MonoError *error) { + MH_LOG("starting invoke for %s\n", mono_method_full_name (method, TRUE)); MONO_REQ_GC_UNSAFE_MODE; MonoObject *result = NULL; @@ -2568,11 +2569,11 @@ do_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **ex error_init (error); MONO_PROFILER_RAISE (method_begin_invoke, (method)); - + result = callbacks.runtime_invoke (method, obj, params, exc, error); MONO_PROFILER_RAISE (method_end_invoke, (method)); - + MH_LOG("ending invoke for %s\n", mono_method_full_name (method, TRUE)); if (!is_ok (error)) return NULL; @@ -7995,8 +7996,7 @@ mono_class_value_size (MonoClass *klass, guint32 *align) g_assert (size >= 0); if (align) - *align = m_class_get_min_align (klass); - MH_LOG("Returning size %d for class %s\n", size, m_class_get_name(klass)); + *align = m_class_get_min_align (klass); return size; } diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index 71373bbe5f79ec..4411b0eb2bd6b7 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -196,6 +196,10 @@ static char * log_sig(MonoMethodSignature* sig) { char buffer[256]; int offset = 0; + if (!sig) { + MH_LOG("Signature is NULL"); + return NULL; + } MH_LOG_INDENT(); for (int i = 0; i < sig->param_count; ++i) { MonoType* tp = sig->params[i]; @@ -762,7 +766,7 @@ do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval } case MINT_ICALLSIG_PPPPP_V: case MINT_ICALLSIG_PPPPP_P: { - log_sig(sig); // just here for a breakpoint + //log_sig(sig); // just here for a breakpoint if (!strcmp(sigTest,"44444_V")) { typedef void (*T)(I4,I4,I4,I4,I4); T func = (T)ptr; @@ -1247,7 +1251,7 @@ do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval } case MINT_ICALLSIG_PPPPPP_V: case MINT_ICALLSIG_PPPPPP_P: { - log_sig(sig); // just here for a breakpoint + //log_sig(sig); // just here for a breakpoint if (!strcmp(sigTest,"444444_V")) { typedef void (*T)(I4,I4,I4,I4,I4,I4); T func = (T)ptr; diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index b96b2e0eb4f75d..d70ba6693e49da 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -96,7 +96,7 @@ #include #endif -#include +#include /* Arguments that are passed when invoking only a finally/filter clause from the frame */ struct FrameClauseArgs { @@ -798,13 +798,10 @@ stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) { MH_LOG("Converting stackval to data for type %s: ", mono_type_get_name (type)); log_mono_type (type); - - MH_LOG_INDENT(); + if (m_type_is_byref (type)) { gpointer *p = (gpointer*)data; *p = val->data.p; - MH_LOG("Ref value. Assigning %p and returning stack slot size %lu", *p, MINT_STACK_SLOT_SIZE); - MH_LOG_UNINDENT(); return MINT_STACK_SLOT_SIZE; } /* printf ("TODAT0 %p\n", data); */ @@ -813,17 +810,14 @@ stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) case MONO_TYPE_I1: case MONO_TYPE_U1: { guint8 *p = (guint8*)data; - *p = GINT32_TO_UINT8 (val->data.i); - MH_LOG("Bool I1 or U1. Assigning %d and returning stack slot size %lu", *p, MINT_STACK_SLOT_SIZE); - MH_LOG_UNINDENT(); + *p = GINT32_TO_UINT8 (val->data.i); return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_I2: case MONO_TYPE_U2: case MONO_TYPE_CHAR: { guint16 *p = (guint16*)data; - *p = GINT32_TO_UINT16 (val->data.i); - MH_LOG("I2 U2 or Char. Assigning %d and returning stack slot size %lu", *p, MINT_STACK_SLOT_SIZE); + *p = GINT32_TO_UINT16 (val->data.i); return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_I: { @@ -832,42 +826,32 @@ stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) but in practice it sometimes doesn't (a int32 gets dup'd and stloc'd into a native int - both by csc and mcs). Not sure what to do about sign extension as it is outside the spec... doing the obvious */ - *p = (mono_i)val->data.nati; - MH_LOG("MONO_TYPE_I. Assigning %p and returning stack slot size %lu", (void*)*p, MINT_STACK_SLOT_SIZE); - MH_LOG_UNINDENT(); + *p = (mono_i)val->data.nati; return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_U: { mono_u *p = (mono_u*)data; /* see above. */ - *p = (mono_u)val->data.nati; - MH_LOG("MONO_TYPE_U. Assigning %p and returning stack slot size %lu", (void*)*p, MINT_STACK_SLOT_SIZE); - MH_LOG_UNINDENT(); + *p = (mono_u)val->data.nati; return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_I4: case MONO_TYPE_U4: { gint32 *p = (gint32*)data; - *p = val->data.i; - MH_LOG("MONO_TYPE_I4 or U4. Assigning %d and returning stack slot size %lu", *p, MINT_STACK_SLOT_SIZE); - MH_LOG_UNINDENT(); + *p = val->data.i; return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_I8: case MONO_TYPE_U8: { memmove (data, &val->data.l, sizeof (gint64)); - MH_LOG("MONO_TYPE_I8 or U8. Assigning %p and returning stack slot size %lu", (void*)data, MINT_STACK_SLOT_SIZE); - MH_LOG_UNINDENT(); return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_R4: { - /* memmove handles unaligned case */ - MH_LOG("MONO_TYPE_R4. Assigning %f and returning stack slot size %lu", val->data.f_r4, MINT_STACK_SLOT_SIZE); + /* memmove handles unaligned case */ memmove (data, &val->data.f_r4, sizeof (float)); return MINT_STACK_SLOT_SIZE; } - case MONO_TYPE_R8: { - MH_LOG("MONO_TYPE_R8. Assigning %f and returning stack slot size %lu", val->data.f, MINT_STACK_SLOT_SIZE); + case MONO_TYPE_R8: { memmove (data, &val->data.f, sizeof (double)); return MINT_STACK_SLOT_SIZE; } @@ -877,21 +861,16 @@ stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) case MONO_TYPE_OBJECT: case MONO_TYPE_ARRAY: { gpointer *p = (gpointer *) data; - mono_gc_wbarrier_generic_store_internal (p, val->data.o); - MH_LOG("MONO_TYPE_string, object array etc. Assigning %p and returning stack slot size %lu", (void*)*p, MINT_STACK_SLOT_SIZE); - MH_LOG_UNINDENT(); + mono_gc_wbarrier_generic_store_internal (p, val->data.o); return MINT_STACK_SLOT_SIZE; } case MONO_TYPE_PTR: case MONO_TYPE_FNPTR: { gpointer *p = (gpointer *) data; - *p = val->data.p; - MH_LOG("MONO_TYPE_PTR or FNPTR. Assigning %p and returning stack slot size %lu", (void*)*p, MINT_STACK_SLOT_SIZE); - MH_LOG_UNINDENT(); + *p = val->data.p; return MINT_STACK_SLOT_SIZE; } - case MONO_TYPE_VALUETYPE: - MH_LOG("MONO_TYPE_VALUETYPE. Converting to data using stackval_to_data for type %s", mono_type_get_name (type)); + case MONO_TYPE_VALUETYPE: if (m_class_is_enumtype (m_type_data_get_klass_unchecked (type))) { return stackval_to_data (mono_class_enum_basetype_internal (m_type_data_get_klass_unchecked (type)), val, data, pinvoke); } else { @@ -905,8 +884,7 @@ stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) } return ALIGN_TO (size, MINT_STACK_SLOT_SIZE); } - case MONO_TYPE_GENERICINST: { - MH_LOG("MONO_TYPE_GENERICINST. Converting to data using stackval_to_data for type %s", mono_type_get_name (type)); + case MONO_TYPE_GENERICINST: { MonoClass *container_class = m_type_data_get_generic_class_unchecked (type)->container_class; if (m_class_is_valuetype (container_class) && !m_class_is_enumtype (container_class)) { @@ -1229,8 +1207,7 @@ initialize_arg_offsets (InterpMethod *imethod, MonoMethodSignature *csig) sig = mono_method_signature_internal (imethod->method); int arg_count = sig->hasthis + sig->param_count; guint32 *arg_offsets = (guint32*)imethod_alloc0 (imethod, (arg_count + 1) * sizeof (int)); - int index = 0, offset = 0; - MH_LOG("Getting arg offsets with slot size of %lu", MINT_STACK_SLOT_SIZE); + int index = 0, offset = 0; if (sig->hasthis) { arg_offsets [index++] = 0; offset = MINT_STACK_SLOT_SIZE; @@ -1240,8 +1217,7 @@ initialize_arg_offsets (InterpMethod *imethod, MonoMethodSignature *csig) int size, align; log_mono_type(type); log_mint_type(mono_mint_type (type)); - size = mono_interp_type_size (type, mono_mint_type (type), &align); - MH_LOG("calculated size: %d - note includes alignment of %d", size, align); + size = mono_interp_type_size (type, mono_mint_type (type), &align); offset = ALIGN_TO (offset, align); arg_offsets [index++] = offset; offset += size; @@ -1252,11 +1228,7 @@ initialize_arg_offsets (InterpMethod *imethod, MonoMethodSignature *csig) mono_memory_write_barrier (); /* If this fails, the new one is leaked in the mem manager */ - mono_atomic_cas_ptr ((gpointer*)&imethod->arg_offsets, arg_offsets, NULL); - MH_LOG("Offsets:"); - for(int i = 0; i <= arg_count; i++) { - MH_LOG("arg %d: %d", i, arg_offsets [i]); - } + mono_atomic_cas_ptr ((gpointer*)&imethod->arg_offsets, arg_offsets, NULL); return imethod->arg_offsets; } @@ -1505,9 +1477,7 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui margs->fargs = margs->fargs_buf; else margs->fargs = g_malloc0 (sizeof (double) * margs->flen); - } - MH_LOG_INDENT(); - MH_LOG("setting args from signature: %s", mono_signature_full_name (sig)); + } for (int i = 0; i < sig->param_count; i++) { MH_LOG_INDENT(); guint32 offset = get_arg_offset (frame->imethod, sig, i); @@ -1515,39 +1485,34 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui switch (info->arg_types [i]) { case PINVOKE_ARG_INT: - margs->iargs [int_i] = sp_arg->data.p; - MH_LOG("PINVOKE_ARG_INT"); + margs->iargs [int_i] = sp_arg->data.p; #if DEBUG_INTERP g_print ("build_args_from_sig: margs->iargs [%d]: %p (frame @ %d)\n", int_i, margs->iargs [int_i], i); #endif int_i++; break; case PINVOKE_ARG_R4: - * (float *) &(margs->fargs [int_f]) = sp_arg->data.f_r4; - MH_LOG("PINVOKE_ARG_R4"); + * (float *) &(margs->fargs [int_f]) = sp_arg->data.f_r4; #if DEBUG_INTERP g_print ("build_args_from_sig: margs->fargs [%d]: %p (%f) (frame @ %d)\n", int_f, margs->fargs [int_f], margs->fargs [int_f], i); #endif int_f ++; break; case PINVOKE_ARG_R8: - margs->fargs [int_f] = sp_arg->data.f; - MH_LOG("PINVOKE_ARG_R8"); + margs->fargs [int_f] = sp_arg->data.f; #if DEBUG_INTERP g_print ("build_args_from_sig: margs->fargs [%d]: %p (%f) (frame @ %d)\n", int_f, margs->fargs [int_f], margs->fargs [int_f], i); #endif int_f ++; break; case PINVOKE_ARG_VTYPE: - margs->iargs [int_i] = sp_arg; - MH_LOG("PINVOKE_ARG_VTYPE"); + margs->iargs [int_i] = sp_arg; #if DEBUG_INTERP g_print ("build_args_from_sig: margs->iargs [%d]: %p (vt) (frame @ %d)\n", int_i, margs->iargs [int_i], i); #endif int_i++; break; - case PINVOKE_ARG_SCALAR_VTYPE: - MH_LOG("PINVOKE_ARG_SCALAR_VTYPE"); + case PINVOKE_ARG_SCALAR_VTYPE: margs->iargs [int_i] = *(gpointer*)sp_arg; #if DEBUG_INTERP @@ -1555,8 +1520,7 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui #endif int_i++; break; - case PINVOKE_ARG_INT_PAIR: { - MH_LOG("PINVOKE_ARG_INT_PAIR"); + case PINVOKE_ARG_INT_PAIR: { margs->iargs [int_i] = (gpointer)(gssize)sp_arg->data.pair.lo; int_i++; margs->iargs [int_i] = (gpointer)(gssize)sp_arg->data.pair.hi; @@ -1569,16 +1533,11 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui default: g_assert_not_reached (); break; - } - MH_LOG_UNINDENT(); + } } - MH_LOG_UNINDENT(); - - MH_LOG_INDENT(); - MH_LOG("setting ret_pinvoke_type: %s", mono_signature_full_name (sig)); + switch (info->ret_pinvoke_type) { - case PINVOKE_ARG_WASM_VALUETYPE_RESULT: - MH_LOG("PINVOKE_ARG_WASM_VALUETYPE_RESULT"); + case PINVOKE_ARG_WASM_VALUETYPE_RESULT: // We pass the return value address in arg0 so fill it in, we already // reserved space for it earlier. g_assert (frame->retval); @@ -1587,18 +1546,15 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui margs->retval = NULL; margs->is_float_ret = 0; break; - case PINVOKE_ARG_INT: - MH_LOG("PINVOKE_ARG_INT"); + case PINVOKE_ARG_INT: margs->retval = (gpointer*)frame->retval; margs->is_float_ret = 0; break; - case PINVOKE_ARG_R8: - MH_LOG("PINVOKE_ARG_R8"); + case PINVOKE_ARG_R8: margs->retval = (gpointer*)frame->retval; margs->is_float_ret = 1; break; - case PINVOKE_ARG_NONE: - MH_LOG("PINVOKE_ARG_NONE"); + case PINVOKE_ARG_NONE: margs->retval = NULL; break; default: @@ -1708,8 +1664,7 @@ ves_pinvoke_method ( MonoLMFExt ext; gpointer args; - MONO_REQ_GC_UNSAFE_MODE; - MH_LOG_INDENT(); + MONO_REQ_GC_UNSAFE_MODE; MH_LOG("invoking %s", mono_method_full_name(imethod->method, TRUE)); #ifdef HOST_WASM /* @@ -2169,11 +2124,7 @@ interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject sp [1].data.p = params; sp [2].data.p = exc; sp [3].data.p = target_method; - - MH_LOG("Setting up sp: sp [0].data.p : %p ", sp [0].data.p); - MH_LOG("Setting up sp: sp [1].data.p : %p ", sp [1].data.p); - MH_LOG("Setting up sp: sp [2].data.p : %p ", sp [2].data.p); - MH_LOG("Setting up sp: sp [3].data.p : %p ", sp [3].data.p); + InterpMethod *imethod = mono_interp_get_imethod (invoke_wrapper); InterpFrame frame = {0}; @@ -2187,8 +2138,7 @@ interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject // The real top of stack for this method will be set in mono_interp_exec_method once the // method is transformed. context->stack_pointer = (guchar*)(sp + 4); - g_assert (context->stack_pointer < context->stack_end); - MH_LOG_INDENT(); + g_assert (context->stack_pointer < context->stack_end); MH_LOG("calling mono_interp_exec_method for %s : %s", method->name, mono_method_full_name (method, TRUE)); MONO_ENTER_GC_UNSAFE; mono_interp_exec_method (&frame, context, NULL); @@ -2333,19 +2283,26 @@ static MONO_NO_OPTIMIZATION MONO_NEVER_INLINE gpointer do_icall_wrapper (InterpFrame *frame, MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval *sp, gpointer ptr, gboolean save_last_error, gboolean *gc_transitions) { MonoLMFExt ext; - INTERP_PUSH_LMF_WITH_CTX (frame, ext, exit_icall); - MH_LOG_INDENT(); + INTERP_PUSH_LMF_WITH_CTX (frame, ext, exit_icall); if(frame->imethod && frame->imethod->method && frame->imethod->method->name) - printf("MH_LOG: calling do_icall for %s : %s\n", frame->imethod->method->name, mono_method_full_name (frame->imethod->method, TRUE)); + { + MH_LOG("calling do_icall for %s : %s", frame->imethod->method->name, mono_method_full_name (frame->imethod->method, TRUE)); + } else { - printf("** MH_LOG: not getting name:\n"); + MH_LOG("** Not getting method name because:"); if (!frame->imethod) - printf("** MH_LOG: calling do_icall for null imethod\n"); + { + MH_LOG("** called do_icall_wrapper for null imethod"); + } else if (!frame->imethod->method) - printf("** MH_LOG: calling do_icall for imethod %p with no method\n", frame->imethod); + { + MH_LOG("** called do_icall_wrapper for imethod %p with no method", frame->imethod); + } else if (!frame->imethod->method->name) - printf("** MH_LOG: calling do_icall for imethod->method %p with no name\n", frame->imethod->method); + { + MH_LOG("** called do_icall_wrapper for imethod->method %p with no name", frame->imethod->method); + } } fflush(stdout); if (*gc_transitions) { @@ -2355,8 +2312,7 @@ do_icall_wrapper (InterpFrame *frame, MonoMethodSignature *sig, MintICallSig op, *gc_transitions = FALSE; } else { do_icall (sig, op, ret_sp, sp, ptr, save_last_error); - } - MH_LOG_UNINDENT(); + } interp_pop_lmf (&ext); goto exit_icall; // prevent unused label warning in some configurations @@ -2842,24 +2798,17 @@ init_arglist (InterpFrame *frame, MonoMethodSignature *sig, stackval *sp, char * { *(gpointer*)arglist = sig; arglist += sizeof (gpointer); - - MH_LOG("init_arglist: sig %p, sp %p, arglist %p", sig, sp, arglist); - MH_LOG_INDENT(); + for (int i = sig->sentinelpos; i < sig->param_count; i++) { int align, arg_size, sv_size; arg_size = mono_type_stack_size (sig->params [i], &align); - log_mono_type(sig->params [i]); - MH_LOG("arg_size: %d, align %d. arg value before align as ptr %p", arg_size, align, (intptr_t)(*arglist)); - - arglist = (char*)ALIGN_PTR_TO (arglist, align); - MH_LOG("arg_size: %d, align %d. arg value after align as ptr %p", arg_size, align, (intptr_t)(*arglist)); + log_mono_type(sig->params [i]); + arglist = (char*)ALIGN_PTR_TO (arglist, align); sv_size = stackval_to_data (sig->params [i], sp, arglist, FALSE); arglist += arg_size; - sp = STACK_ADD_BYTES (sp, sv_size); - MH_LOG("Added %d bytes to sp, ch is now %p", sv_size, sp); - } - MH_LOG_UNINDENT(); + sp = STACK_ADD_BYTES (sp, sv_size); + } } /* @@ -3967,8 +3916,7 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause // we are being overly conservative with the size here, for simplicity gpointer arglist = frame_data_allocator_alloc (&context->data_stack, frame, params_stack_size + MINT_STACK_SLOT_SIZE); - init_arglist (frame, sig, STACK_ADD_BYTES (frame->stack, ip [2]), (char*)arglist); - MH_LOG("params_stack_size: %d", params_stack_size); + init_arglist (frame, sig, STACK_ADD_BYTES (frame->stack, ip [2]), (char*)arglist); // save the arglist for future access with MINT_ARGLIST LOCAL_VAR (ip [1], gpointer) = arglist; @@ -4103,8 +4051,7 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause ip += 4; MINT_IN_BREAK; } - MINT_IN_CASE(MINT_CALL_DELEGATE) { - MH_LOG("MINT_CALL_DELEGATE"); + MINT_IN_CASE(MINT_CALL_DELEGATE) { return_offset = ip [1]; call_args_offset = ip [2]; MonoDelegate *del = LOCAL_VAR (call_args_offset, MonoDelegate*); @@ -4182,8 +4129,7 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause goto jit_call; } MINT_IN_CASE(MINT_CALLI) { - gboolean need_unbox; - MH_LOG("MINT_CALLI"); + gboolean need_unbox; /* In mixed mode, stay in the interpreter for simplicity even if there is an AOT version of the callee */ cmethod = ftnptr_to_imethod (LOCAL_VAR (ip [2], gpointer), &need_unbox); @@ -4203,8 +4149,7 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause goto jit_call; } - MINT_IN_CASE(MINT_CALLI_NAT_FAST) { - MH_LOG("MINT_CALLI_NAT_FAST"); + MINT_IN_CASE(MINT_CALLI_NAT_FAST) { MintICallSig icall_sig = (MintICallSig)ip [4]; MonoMethodSignature *csignature = (MonoMethodSignature*)frame->imethod->data_items [ip [5]]; gboolean save_last_error = ip [6]; @@ -4244,11 +4189,10 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause gpointer *cache = (gpointer*)&frame->imethod->data_items [ip [7]]; /* for calls, have ip pointing at the start of next instruction */ frame->state.ip = ip + 8; - MH_LOG_INDENT(); + if (imethod->method) MH_LOG ("Calling native method %s with signature %s\n", mono_method_full_name (imethod->method, TRUE), mono_signature_full_name (csignature)); - ves_pinvoke_method (imethod, csignature, (MonoFuncV)code, context, frame, (stackval*)(locals + ip [1]), (stackval*)(locals + ip [3]), save_last_error, cache, &gc_transitions); - MH_LOG_UNINDENT(); + ves_pinvoke_method (imethod, csignature, (MonoFuncV)code, context, frame, (stackval*)(locals + ip [1]), (stackval*)(locals + ip [3]), save_last_error, cache, &gc_transitions); EXCEPTION_CHECKPOINT; CHECK_RESUME_STATE (context); @@ -4451,7 +4395,7 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause goto exit_frame; MINT_IN_CASE(MINT_RET_VT) { memmove (frame->retval, locals + ip [1], ip [2]); - MH_LOG("returning vt, moved %d bytes from offset to give %p", ip[2], ip[1], frame->retval); + MH_LOG("returning vt, moved %d bytes from offset to give %p", ip[2], ip[1]); goto exit_frame; } MINT_IN_CASE(MINT_RET_LOCALLOC) @@ -5017,11 +4961,9 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; MONO_DISABLE_WARNING(4127) \ gpointer ptr = LOCAL_VAR (ip [2], gpointer); \ NULL_CHECK (ptr); \ - if (unaligned && ((gsize)ptr % SIZEOF_VOID_P)) {\ - MH_LOG("LDIND memcpy into %d + %d, from %p, size %zd", locals, ip[1], ptr, sizeof(datatype)); \ + if (unaligned && ((gsize)ptr % SIZEOF_VOID_P)) {\ memcpy (locals + ip [1], ptr, sizeof (datatype)); \ - } else {\ - MH_LOG("LDIND LOCAL_VAR (%d, %s) = *(%s*)%p", ip[1], #datatype, #casttype, ptr); \ + } else {\ LOCAL_VAR (ip [1], datatype) = *(casttype*)ptr; \ } \ ip += 3; \ @@ -6193,12 +6135,12 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; #define LDFLD(datamem, fieldtype) LDFLD_UNALIGNED(datamem, fieldtype, FALSE) - MINT_IN_CASE(MINT_LDFLD_I1) MH_LOG("MINT_LDFLD_I1"); LDFLD(gint32, gint8); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_U1) MH_LOG("MINT_LDFLD_U1"); LDFLD(gint32, guint8); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_I2) MH_LOG("MINT_LDFLD_I2"); LDFLD(gint32, gint16); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_U2) MH_LOG("MINT_LDFLD_U2"); LDFLD(gint32, guint16); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_I4) MH_LOG("MINT_LDFLD_I4"); LDFLD(gint32, gint32); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_I8) MH_LOG("MINT_LDFLD_I8"); do { + MINT_IN_CASE(MINT_LDFLD_I1) LDFLD(gint32, gint8); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_U1) LDFLD(gint32, guint8); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_I2) LDFLD(gint32, gint16); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_U2) LDFLD(gint32, guint16); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_I4) LDFLD(gint32, gint32); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_I8) do { MonoObject* o = (*(MonoObject**)(locals + (ip[2]))); do { if ((!(o))) do { interp_throw_ex_general((interp_get_exception_null_reference(frame, ip)), context, frame, (ip), 0); goto resume; @@ -6213,17 +6155,17 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; ip += 4; } } while (0); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_R4) MH_LOG("MINT_LDFLD_R4"); LDFLD(float, float); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_R8) MH_LOG("MINT_LDFLD_R8"); LDFLD(double, double); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_O) MH_LOG("MINT_LDFLD_O"); do { + MINT_IN_CASE(MINT_LDFLD_R4) LDFLD(float, float); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_R8) LDFLD(double, double); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_O) do { MonoObject* o = (*(MonoObject**)(locals + (ip[2]))); do { if ((!(o))) do { interp_throw_ex_general((interp_get_exception_null_reference(frame, ip)), context, frame, (ip), 0); goto resume; } while (0); } while (0); if (0) memcpy(locals + ip[1], (char*)o + ip[3], sizeof(gpointer)); else (*(gpointer*)(locals + (ip[1]))) = *(gpointer*)((char*)o + ip[3]); ip += 4; } while (0); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_I8_UNALIGNED) MH_LOG("MINT_LDFLD_I8_UNALIGNED"); LDFLD_UNALIGNED(gint64, gint64, TRUE); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_R8_UNALIGNED) MH_LOG("MINT_LDFLD_R8_UNALIGNED"); LDFLD_UNALIGNED(double, double, TRUE); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_I8_UNALIGNED) LDFLD_UNALIGNED(gint64, gint64, TRUE); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_R8_UNALIGNED) LDFLD_UNALIGNED(double, double, TRUE); MINT_IN_BREAK; MINT_IN_CASE(MINT_LDFLD_VT) { MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); @@ -7685,14 +7627,14 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; // Normal moves between locals MINT_IN_CASE(MINT_MOV_4) // TODO: this is hardcoded for x64 - assert(((uintptr_t)locals % 8) == 0 && "locals is not 8-byte aligned"); + //assert(((uintptr_t)locals % 8) == 0 && "locals is not 8-byte aligned"); (*(guint32*)(locals + (ip[1]))) = (*(guint32*)(locals + (ip[2]))); MH_LOG("MINT_MOV_4: %d <- %d: %p\n", ip[1], ip[2], (void*)(*(guint32*)(locals + (ip[1])))); ip += 3;; MINT_IN_BREAK; MINT_IN_CASE(MINT_MOV_8) // TODO: this is hardcoded for x64 - assert(((uintptr_t)locals % 8) == 0 && "locals is not 8-byte aligned"); + //assert(((uintptr_t)locals % 8) == 0 && "locals is not 8-byte aligned"); (*(guint64*)(locals + (ip[1]))) = (*(guint64*)(locals + (ip[2]))); intptr_t result = (*(guint64*)(locals + (ip[1]))); diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index 9de34022a4213f..6edac39803f401 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -119,7 +119,7 @@ interp_add_ins_explicit (TransformData *td, int opcode, int len) td->cbb->last_ins = new_inst; // We should delete this, but is currently used widely to set the args of an instruction td->last_ins = new_inst; - MH_LOG("adding instruction %s at offset %d", mono_interp_opname (opcode), td->current_il_offset); + //MH_LOG("adding instruction %s at offset %d", mono_interp_opname (opcode), td->current_il_offset); return new_inst; } @@ -445,7 +445,7 @@ interp_create_var_explicit (TransformData *td, MonoType *type, int size) local->ext_index = -1; td->vars_size++; - MH_LOG("Creating var of type %s at index %d, size %d", mono_type_full_name (type), td->vars_size - 1, size); + //MH_LOG("Creating var of type %s at index %d, size %d", mono_type_full_name (type), td->vars_size - 1, size); return td->vars_size - 1; } @@ -1799,7 +1799,7 @@ interp_emit_ldelema (TransformData *td, MonoClass *array_class, MonoClass *check MonoClass *element_class = m_class_get_element_class (array_class); int rank = m_class_get_rank (array_class); int size = mono_class_array_element_size (element_class); - MH_LOG("Emiting LDELEMA for %s, size %d\n", m_class_get_name (array_class), size); + //MH_LOG("Emiting LDELEMA for %s, size %d\n", m_class_get_name (array_class), size); gboolean bounded = m_class_get_byval_arg (array_class) ? m_class_get_byval_arg (array_class)->type == MONO_TYPE_ARRAY : FALSE; td->sp -= rank + 1; @@ -3083,7 +3083,7 @@ interp_inline_method (TransformData *td, MonoMethod *target_method, MonoMethodHe } if (td->verbose_level) g_print ("Inline start method %s.%s\n", m_class_get_name (target_method->klass), target_method->name); - MH_LOG("Inline start method %s.%s", m_class_get_name (target_method->klass), target_method->name); + //MH_LOG("Inline start method %s.%s", m_class_get_name (target_method->klass), target_method->name); td->inline_depth++; ret = generate_code (td, target_method, header, generic_context, error); td->inline_depth--; @@ -5269,7 +5269,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, goto_if_nok (error, exit); g_assert (bb); - MH_LOG("Generating code for method %s", mono_method_full_name (method, TRUE)); + //MH_LOG("Generating code for method %s", mono_method_full_name (method, TRUE)); td->il_code = header->code; td->in_start = td->ip = header->code; @@ -5408,7 +5408,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, for (int i = signature->param_count - 1; i >= 0; i--) { MonoType *type = get_type_from_stack (td->sp [-1].type, td->sp [-1].klass); - MH_LOG("Creating local for inlined arg %d: %s", i, mono_type_full_name (type)); + //MH_LOG("Creating local for inlined arg %d: %s", i, mono_type_full_name (type)); local = interp_create_var (td, type); arg_locals [i + !!signature->hasthis] = local; @@ -9929,7 +9929,7 @@ mono_interp_transform_method (InterpMethod *imethod, ThreadContext *context, Mon mono_error_set_invalid_operation (error, "%s", "Could not execute the method because the containing type is not fully instantiated."); return; } - MH_LOG("transforming method %s", method->name); + //MH_LOG("transforming method %s", method->name); // g_printerr ("TRANSFORM(0x%016lx): begin %s::%s\n", mono_thread_current (), method->klass->name, method->name); method_class_vt = mono_class_vtable_checked (imethod->method->klass, error); return_if_nok (error); diff --git a/src/mono/sample/wasm/browser-advanced/Program.cs b/src/mono/sample/wasm/browser-advanced/Program.cs index e55d69419cd2f4..dfe99262bee4ad 100644 --- a/src/mono/sample/wasm/browser-advanced/Program.cs +++ b/src/mono/sample/wasm/browser-advanced/Program.cs @@ -53,9 +53,15 @@ public static async Task Main(string[] args) [JSExport] internal static async Task PrintMeaning(Task meaningPromise) - { + { Console.WriteLine("Meaning of life is " + await meaningPromise); } + + [JSExport] + internal static async Task PrintMeaningDEBUG(int value) + { + Console.WriteLine("Meaning of life is " + value); + } [JSExport] internal static int SimpleTestFunctionInt() { @@ -91,8 +97,8 @@ internal static bool SimpleTestConsole() internal static void SimpleTestArray() { - //var arrayPtr = System.MHTestClass.RunTestArray(); - var arrayPtr = System.MHTestClass.RunTestArrayRaw(); + var arrayPtr = System.MHTestClass.RunTestArray(); + //var arrayPtr = System.MHTestClass.RunTestArrayRaw(); //var h = new Mono.SafeGPtrArrayHandle(arrayPtr); var a = 1;// h[0]; @@ -107,13 +113,13 @@ internal static void SimpleTestArray() internal static void SimpleTestFunctionPrintString() { // write an empty string to the console - Console.WriteLine("Test"); + Console.WriteLine("MH DOING A TEST"); } [JSExport] internal static int TestMeaning() { - // int testSize = 123; - // Console.WriteLine("Size of an int is " + sizeof(int) + " bytes, and test size is " + testSize + " bytes."); + int testSize = 123; + Console.WriteLine("Size of an int is " + sizeof(int) + " bytes, and test size is " + testSize + " bytes."); // call to C code via [DllImport] var half = Fibonacci(8); // call back to JS via [JSImport] diff --git a/src/mono/sample/wasm/browser-advanced/main.js b/src/mono/sample/wasm/browser-advanced/main.js index b808df1ec056d9..d9732c351a9a34 100644 --- a/src/mono/sample/wasm/browser-advanced/main.js +++ b/src/mono/sample/wasm/browser-advanced/main.js @@ -51,7 +51,7 @@ try { // This is called during emscripten `dotnet.wasm` instantiation, after we fetched config. console.log('user code Module.onConfigLoaded'); // config is loaded and could be tweaked before the rest of the runtime startup sequence - config.environmentVariables["MONO_LOG_LEVEL"] = "trace"; + config.environmentVariables["MONO_LOG_LEVEL"] = "debug"; config.browserProfilerOptions = { sampleIntervalMs: 5.15, callSpec: "N:Sample" // needs to match AOT profile @@ -93,28 +93,12 @@ try { const config = getConfig(); const exports = await getAssemblyExports(config.mainAssemblyName); - //const MyStringTest = exports.Sample.Test.SimpleTestFunctionString(); - //console.debug(`MyTest: ${MyStringTest}`); - //const MyTest = exports.Sample.Test.SimpleTestFunctionInt(); - //console.debug(`MyTest: ${MyTest}`); - //const IntSize = exports.Sample.Test.SimpleTestFunctionIntSize(); - //console.debug(`IntSize: ${IntSize}`); - //console.debug("Accessing console:"); - - const arrayTest = exports.Sample.Test.SimpleTestArray(); - console.debug("Made it past arrayTest! Value is: ", "0x" + arrayTest.toString(16)); - - //const consoleTest = exports.Sample.Test.SimpleTestConsole(); + //console.debug("Accessing console:"); + const result = exports.Sample.Test.SimpleTestConsole(); + console.debug(`result: ${result}`); - //console.debug(`consoleTest: ${consoleTest}`); - //console.debug("Printing empty string from C#:"); - //exports.Sample.Test.SimpleTestFunctionPrintEmptyString(); - //console.debug("Printing non-empty string from C#:"); - //exports.Sample.Test.SimpleTestFunctionPrintString(); - //console.debug("Calling TestMeaning:"); const meaning = exports.Sample.Test.TestMeaning(); - console.debug(`meaning: ${meaning}`); if (typeof Module.GL !== "object") { exit(-10, "Can't find GL"); } @@ -125,13 +109,15 @@ try { if (!exports.Sample.Test.IsPrime(meaning)) { document.getElementById("out").innerHTML = `${meaning} as computed on dotnet ver ${runtimeBuildInfo.productVersion}`; } - - exports.Sample.Test.SillyLoop(); - - const deepMeaning = new Promise(resolve => setTimeout(() => resolve(meaning), 100)); + //exports.Sample.Test.SimpleTestFunctionPrintString(); + //const deepMeaning = new Promise(resolve => setTimeout(() => resolve(meaning), 100)); + console.clear(); + const deepMeaning = new Promise(resolve => { + resolve(meaning); + }); exports.Sample.Test.PrintMeaning(deepMeaning); - - + //exports.Sample.Test.PrintMeaningDEBUG(meaning); + exports.Sample.Test.SillyLoop(); let exit_code = await runMain(config.mainAssemblyName, []); exit(exit_code); From 81d3a48683a864cb0718d8b68ad9197eb828def9 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 29 Jul 2025 14:15:26 +0100 Subject: [PATCH 127/209] Remove some logging --- src/mono/browser/runtime/marshal.ts | 26 +++++++++------- src/mono/mono/mini/interp/interp.c | 46 ++++++++++++++--------------- 2 files changed, 39 insertions(+), 33 deletions(-) diff --git a/src/mono/browser/runtime/marshal.ts b/src/mono/browser/runtime/marshal.ts index c103e7437ddd13..8d86b86c27537d 100644 --- a/src/mono/browser/runtime/marshal.ts +++ b/src/mono/browser/runtime/marshal.ts @@ -357,11 +357,25 @@ export function set_arg_f32 (arg: JSMarshalerArgument, value: number): void { setF32(arg, value); } +function set_arg_handle (arg: JSMarshalerArgument, offset: number, handle: JSHandle | GCHandle | undefined): void { + if (isWasm64) { + if (typeof handle !== "bigint") + setI64Big(add_offset(arg, offset), BigInt(handle as any as number)); + else + setI64Big(add_offset(arg, offset), handle as bigint); + } else { + setI32(add_offset(arg, offset), handle as any); + } +} + +function get_arg_handle (arg: JSMarshalerArgument | JSMarshalerArguments, offset: number): GCHandle | JSHandle | undefined { + return isWasm64 ? getI64Big(add_offset(arg, offset)) as any : getI32(add_offset(arg, offset)) as any; +} + export function get_arg_js_handle (arg: JSMarshalerArgument): JSHandle { mono_assert(arg, "Null arg"); return getI32(add_offset(arg, JSMarshalerArgumentOffsets.JSHandle)) as any; } - export function set_arg_proxy_context (arg: JSMarshalerArgument): void { if (!WasmEnableThreads) return; mono_assert(arg, "Null arg"); @@ -390,15 +404,7 @@ export function get_arg_gc_handle (arg: JSMarshalerArgument): GCHandle { export function set_gc_handle (arg: JSMarshalerArgument, gcHandle: GCHandle): void { mono_assert(arg, "Null arg"); mono_log_debug(`set_gc_handle(${arg}, ${gcHandle}) at offset ${JSMarshalerArgumentOffsets.GCHandle}`); - - if (isWasm64) { - if (typeof gcHandle !== "bigint") - setI64Big(add_offset(arg, JSMarshalerArgumentOffsets.GCHandle), BigInt(gcHandle as any as number)); - else - setI64Big(add_offset(arg, JSMarshalerArgumentOffsets.GCHandle), gcHandle as bigint); - } else { - setI32(add_offset(arg, JSMarshalerArgumentOffsets.GCHandle), gcHandle as any); - } + set_arg_handle(arg, JSMarshalerArgumentOffsets.GCHandle, gcHandle); set_arg_proxy_context(arg); } diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index d70ba6693e49da..dd1f29b07dbb6b 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -796,7 +796,7 @@ get_virtual_method_fast (InterpMethod *imethod, MonoVTable *vtable, int offset) static int stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) { - MH_LOG("Converting stackval to data for type %s: ", mono_type_get_name (type)); + //MH_LOG("Converting stackval to data for type %s: ", mono_type_get_name (type)); log_mono_type (type); if (m_type_is_byref (type)) { @@ -1479,7 +1479,7 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui margs->fargs = g_malloc0 (sizeof (double) * margs->flen); } for (int i = 0; i < sig->param_count; i++) { - MH_LOG_INDENT(); + //MH_LOG_INDENT(); guint32 offset = get_arg_offset (frame->imethod, sig, i); stackval *sp_arg = STACK_ADD_BYTES (frame->stack, offset); @@ -1561,7 +1561,7 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui g_assert_not_reached (); break; } - MH_LOG_UNINDENT(); + //MH_LOG_UNINDENT(); } #endif @@ -3529,11 +3529,11 @@ mono_interp_leave (InterpFrame* parent_frame) * to check the abort threshold. For this to work we use frame as a * dummy frame that is stored in the lmf and serves as the transition frame */ - MH_LOG_INDENT(); - MH_LOG("Calling do_icall_wrapper for mono_thread_get_undeniable_exception\n"); + //MH_LOG_INDENT(); + //MH_LOG("Calling do_icall_wrapper for mono_thread_get_undeniable_exception\n"); do_icall_wrapper (&frame, NULL, MINT_ICALLSIG_V_P, &tmp_sp, &tmp_sp, (gpointer)mono_thread_get_undeniable_exception, FALSE, &gc_transitions); - MH_LOG("..Finished calling do_icall_wrapper for mono_thread_get_undeniable_exception\n"); - MH_LOG_UNINDENT(); + //MH_LOG("..Finished calling do_icall_wrapper for mono_thread_get_undeniable_exception\n"); + //MH_LOG_UNINDENT(); return (MonoException*)tmp_sp.data.p; } @@ -4364,38 +4364,38 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause } MINT_IN_CASE(MINT_RET) frame->retval [0] = LOCAL_VAR (ip [1], stackval); - MH_LOG("returning pointer %p or long %lld", frame->retval [0].data.p, frame->retval [0].data.l); + //MH_LOG("returning pointer %p or long %lld", frame->retval [0].data.p, frame->retval [0].data.l); goto exit_frame; MINT_IN_CASE(MINT_RET_I1) frame->retval [0].data.i = (gint8) LOCAL_VAR (ip [1], gint32); - MH_LOG("MINT_RET_I1 %d", frame->retval [0].data.i); + //MH_LOG("MINT_RET_I1 %d", frame->retval [0].data.i); goto exit_frame; MINT_IN_CASE(MINT_RET_U1) frame->retval [0].data.i = (guint8) LOCAL_VAR (ip [1], gint32); - MH_LOG("MINT_RET_U1 %d", frame->retval [0].data.i); + //MH_LOG("MINT_RET_U1 %d", frame->retval [0].data.i); goto exit_frame; MINT_IN_CASE(MINT_RET_I2) frame->retval [0].data.i = (gint16) LOCAL_VAR (ip [1], gint32); - MH_LOG("MINT_RET_I2 %d", frame->retval [0].data.i); + //MH_LOG("MINT_RET_I2 %d", frame->retval [0].data.i); goto exit_frame; MINT_IN_CASE(MINT_RET_U2) frame->retval [0].data.i = (guint16) LOCAL_VAR (ip [1], gint32); - MH_LOG("MINT_RET_U2 %d", frame->retval [0].data.i); + //MH_LOG("MINT_RET_U2 %d", frame->retval [0].data.i); goto exit_frame; MINT_IN_CASE(MINT_RET_I4_IMM) frame->retval [0].data.i = (gint16)ip [1]; - MH_LOG("MINT_RET_I4_IMM"); + //MH_LOG("MINT_RET_I4_IMM"); goto exit_frame; MINT_IN_CASE(MINT_RET_I8_IMM) frame->retval [0].data.l = (gint16)ip [1]; - MH_LOG("MINT_RET_I8_IMM casting to gint16 ip[1] = %lld", frame->retval [0].data.l); + //MH_LOG("MINT_RET_I8_IMM casting to gint16 ip[1] = %lld", frame->retval [0].data.l); goto exit_frame; MINT_IN_CASE(MINT_RET_VOID) - MH_LOG("void returning"); + //MH_LOG("void returning"); goto exit_frame; MINT_IN_CASE(MINT_RET_VT) { memmove (frame->retval, locals + ip [1], ip [2]); - MH_LOG("returning vt, moved %d bytes from offset to give %p", ip[2], ip[1]); + //MH_LOG("returning vt, moved %d bytes from offset to give %p", ip[2], ip[1]); goto exit_frame; } MINT_IN_CASE(MINT_RET_LOCALLOC) @@ -4987,10 +4987,10 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; } MINT_IN_CASE(MINT_LDIND_I8) #ifdef NO_UNALIGNED_ACCESS - MH_LOG("doing unaligned access for MINT_LDIND_I8\n"); + //MH_LOG("doing unaligned access for MINT_LDIND_I8\n"); LDIND(gint64, gint64, TRUE); #else - MH_LOG("doing aligned access for MINT_LDIND_I8\n"); + //MH_LOG("doing aligned access for MINT_LDIND_I8\n"); LDIND(gint64, gint64, FALSE); #endif MINT_IN_BREAK; @@ -7620,7 +7620,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; // stack, no additional conversion is needed. MINT_IN_CASE(MINT_MOV_1) (*(gint8*)(locals + (ip[1]))) = (*(gint8*)(locals + (ip[2]))); - MH_LOG("MINT_MOV_1: %d <- %d: %p\n", ip[1], ip[2], (void*)(*(gint8*)(locals + (ip[1])))); + //MH_LOG("MINT_MOV_1: %d <- %d: %p\n", ip[1], ip[2], (void*)(*(gint8*)(locals + (ip[1])))); ip += 3; MINT_IN_BREAK; MINT_IN_CASE(MINT_MOV_2) MOV(gint16, gint16); MINT_IN_BREAK; @@ -7629,7 +7629,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; // TODO: this is hardcoded for x64 //assert(((uintptr_t)locals % 8) == 0 && "locals is not 8-byte aligned"); (*(guint32*)(locals + (ip[1]))) = (*(guint32*)(locals + (ip[2]))); - MH_LOG("MINT_MOV_4: %d <- %d: %p\n", ip[1], ip[2], (void*)(*(guint32*)(locals + (ip[1])))); + //MH_LOG("MINT_MOV_4: %d <- %d: %p\n", ip[1], ip[2], (void*)(*(guint32*)(locals + (ip[1])))); ip += 3;; MINT_IN_BREAK; MINT_IN_CASE(MINT_MOV_8) @@ -7638,7 +7638,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; (*(guint64*)(locals + (ip[1]))) = (*(guint64*)(locals + (ip[2]))); intptr_t result = (*(guint64*)(locals + (ip[1]))); - MH_LOG("MINT_MOV_8: *(%p + %d) = *(%p + %d): %p", locals, ip[1], locals, ip[2], (void*)result); + //MH_LOG("MINT_MOV_8: *(%p + %d) = *(%p + %d): %p", locals, ip[1], locals, ip[2], (void*)result); ip += 3;; MINT_IN_BREAK; @@ -7955,7 +7955,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; } MINT_IN_CASE(MINT_TIER_ENTER_JITERPRETER) { - MH_LOG("*** Jiterpreter thunk warning location: %p\n", ip); + //MH_LOG("*** Jiterpreter thunk warning location: %p\n", ip); // The fn ptr is encoded in a guint16 relative to the index of the first trace fn ptr, so compute the actual ptr JiterpreterThunk thunk = (JiterpreterThunk)(void *)(((JiterpreterOpcode *)ip)->relative_fn_ptr + mono_jiterp_first_trace_fn_ptr); ptrdiff_t offset = thunk (frame, locals, NULL, ip); @@ -9181,7 +9181,7 @@ mono_jiterp_get_simd_opcode (int arity, int index) EMSCRIPTEN_KEEPALIVE intptr_t mono_jiterp_get_opcode_info (int opcode, int type) { - MH_LOG("Test jiterp opcode %d type %d\n", opcode, type); + //MH_LOG("Test jiterp opcode %d type %d\n", opcode, type); g_assert ((opcode >= 0) && (opcode <= MINT_LASTOP)); switch (type) { case JITERP_OPINFO_TYPE_NAME: From bb013176a8559ce933cd1b637aee3d9ef843133b Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 29 Jul 2025 14:46:08 +0100 Subject: [PATCH 128/209] Undo macro expansions --- src/mono/mono/mini/interp/interp.c | 32 +++--------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index dd1f29b07dbb6b..aae33d83112f44 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -6140,30 +6140,10 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; MINT_IN_CASE(MINT_LDFLD_I2) LDFLD(gint32, gint16); MINT_IN_BREAK; MINT_IN_CASE(MINT_LDFLD_U2) LDFLD(gint32, guint16); MINT_IN_BREAK; MINT_IN_CASE(MINT_LDFLD_I4) LDFLD(gint32, gint32); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_I8) do { - MonoObject* o = (*(MonoObject**)(locals + (ip[2]))); do { - if ((!(o))) do { - interp_throw_ex_general((interp_get_exception_null_reference(frame, ip)), context, frame, (ip), 0); goto resume; - } while (0); - } while (0); - if (0) - memcpy(locals + ip[1], (char*)o + ip[3], sizeof(gint64)); - else - { - MH_LOG("MINT_LDFLD_I8_UNALIGNED *(%p + %d) = %p", (void*)o, ip[3], *(gint64*)((char*)o + ip[3])); - (*(gint64*)(locals + (ip[1]))) = *(gint64*)((char*)o + ip[3]); - ip += 4; - } -} while (0); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_I8) LDFLD(gint64, gint64); MINT_IN_BREAK; MINT_IN_CASE(MINT_LDFLD_R4) LDFLD(float, float); MINT_IN_BREAK; MINT_IN_CASE(MINT_LDFLD_R8) LDFLD(double, double); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_O) do { - MonoObject* o = (*(MonoObject**)(locals + (ip[2]))); do { - if ((!(o))) do { - interp_throw_ex_general((interp_get_exception_null_reference(frame, ip)), context, frame, (ip), 0); goto resume; - } while (0); - } while (0); if (0) memcpy(locals + ip[1], (char*)o + ip[3], sizeof(gpointer)); else (*(gpointer*)(locals + (ip[1]))) = *(gpointer*)((char*)o + ip[3]); ip += 4; -} while (0); MINT_IN_BREAK; + MINT_IN_CASE(MINT_LDFLD_O) LDFLD(gpointer, gpointer); MINT_IN_BREAK; MINT_IN_CASE(MINT_LDFLD_I8_UNALIGNED) LDFLD_UNALIGNED(gint64, gint64, TRUE); MINT_IN_BREAK; MINT_IN_CASE(MINT_LDFLD_R8_UNALIGNED) LDFLD_UNALIGNED(double, double, TRUE); MINT_IN_BREAK; @@ -6195,13 +6175,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; MINT_IN_CASE(MINT_STFLD_I8) STFLD(gint64, gint64); MINT_IN_BREAK; MINT_IN_CASE(MINT_STFLD_R4) STFLD(float, float); MINT_IN_BREAK; MINT_IN_CASE(MINT_STFLD_R8) STFLD(double, double); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STFLD_O) { - MonoObject *o = LOCAL_VAR (ip [1], MonoObject*); - NULL_CHECK (o); - mono_gc_wbarrier_set_field_internal (o, (char*)o + ip [3], LOCAL_VAR (ip [2], MonoObject*)); - ip += 4; - MINT_IN_BREAK; - } + MINT_IN_CASE(MINT_STFLD_O) MINT_IN_CASE(MINT_STFLD_I8_UNALIGNED) STFLD_UNALIGNED(gint64, gint64, TRUE); MINT_IN_BREAK; MINT_IN_CASE(MINT_STFLD_R8_UNALIGNED) STFLD_UNALIGNED(double, double, TRUE); MINT_IN_BREAK; From d444372eace49ad85e76a84f27618102ac09b058 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 29 Jul 2025 14:46:30 +0100 Subject: [PATCH 129/209] More log commenting --- src/mono/mono/mini/interp/interp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index aae33d83112f44..24009cea59ce74 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -246,7 +246,7 @@ reinit_frame (InterpFrame *frame, InterpFrame *parent, InterpMethod *imethod, gp frame->stack = (stackval*)stack; frame->retval = (stackval*)retval; frame->state.ip = NULL; - MH_LOG("Reinitializing frame %p with imethod %s (%p), retval %p, stack %p", frame, mono_method_get_name_full(imethod->method, TRUE, TRUE, MONO_TYPE_NAME_FORMAT_IL), imethod, retval, stack); + //MH_LOG("Reinitializing frame %p with imethod %s (%p), retval %p, stack %p", frame, mono_method_get_name_full(imethod->method, TRUE, TRUE, MONO_TYPE_NAME_FORMAT_IL), imethod, retval, stack); } #define STACK_ADD_ALIGNED_BYTES(sp,bytes) ((stackval*)((char*)(sp) + (bytes))) @@ -1665,7 +1665,7 @@ ves_pinvoke_method ( gpointer args; MONO_REQ_GC_UNSAFE_MODE; - MH_LOG("invoking %s", mono_method_full_name(imethod->method, TRUE)); + //MH_LOG("invoking %s", mono_method_full_name(imethod->method, TRUE)); #ifdef HOST_WASM /* * Use a per-signature entry function. @@ -2139,11 +2139,11 @@ interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject // method is transformed. context->stack_pointer = (guchar*)(sp + 4); g_assert (context->stack_pointer < context->stack_end); - MH_LOG("calling mono_interp_exec_method for %s : %s", method->name, mono_method_full_name (method, TRUE)); + //MH_LOG("calling mono_interp_exec_method for %s : %s", method->name, mono_method_full_name (method, TRUE)); MONO_ENTER_GC_UNSAFE; mono_interp_exec_method (&frame, context, NULL); MONO_EXIT_GC_UNSAFE; - MH_LOG_UNINDENT(); + //MH_LOG_UNINDENT(); context->stack_pointer = (guchar*)sp; if (context->has_resume_state) { @@ -4271,7 +4271,7 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause cmethod = (InterpMethod*)frame->imethod->data_items [ip [3]]; return_offset = ip [1]; call_args_offset = ip [2]; - MH_LOG("MINT_CALL for %s. return offset %d, call_args_offset %d", mono_method_get_name_full(frame->imethod->method, TRUE, TRUE, MONO_TYPE_NAME_FORMAT_IL), return_offset, call_args_offset); + //MH_LOG("MINT_CALL for %s. return offset %d, call_args_offset %d", mono_method_get_name_full(frame->imethod->method, TRUE, TRUE, MONO_TYPE_NAME_FORMAT_IL), return_offset, call_args_offset); #ifdef ENABLE_EXPERIMENT_TIERED ip += 5; #else @@ -7996,7 +7996,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; * a param_area and all calls would inherit the same sp, or if we are full coop. */ context->stack_pointer = (guchar*)frame->stack + frame->imethod->alloca_size; - MH_LOG("exiting frame %p for %s", frame, mono_method_get_name_full(frame->imethod->method, FALSE, TRUE, MONO_TYPE_NAME_FORMAT_IL)); + //MH_LOG("exiting frame %p for %s", frame, mono_method_get_name_full(frame->imethod->method, FALSE, TRUE, MONO_TYPE_NAME_FORMAT_IL)); LOAD_INTERP_STATE (frame); CHECK_RESUME_STATE (context); From 0b79c517387ab95d2c11c30910e23b0f67d64a0c Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 29 Jul 2025 16:08:01 +0100 Subject: [PATCH 130/209] Don't try to strcmp null sig cookie Memset result to 0 instead --- src/mono/mono/mini/interp/interp-icalls.c | 3887 +++++++++++---------- 1 file changed, 1947 insertions(+), 1940 deletions(-) diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index 4411b0eb2bd6b7..2fc5801e5059d6 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -276,1948 +276,1955 @@ do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval if (save_last_error) mono_marshal_clear_last_error (); log_op(op); - char* sigTest = log_sig(sig); - switch (op) { - case MINT_ICALLSIG_V_V: - case MINT_ICALLSIG_V_P: { - if (!strcmp(sigTest,"V_V")) { - typedef void (*T)(void); - T func = (T)ptr; - func(); - }; - if (!strcmp(sigTest,"V_4")) { - typedef I4 (*T)(void); - T func = (T)ptr; - ret_sp->data.i = func(); - }; - if (!strcmp(sigTest,"V_8")) { - typedef I8 (*T)(void); - T func = (T)ptr; - ret_sp->data.p = func(); - }; - break; - } - case MINT_ICALLSIG_P_V: - case MINT_ICALLSIG_P_P: { - if (!strcmp(sigTest,"4_V")) { - typedef void (*T)(I4); - T func = (T)ptr; - func(sp[0].data.i); - }; - if (!strcmp(sigTest,"8_V")) { - typedef void (*T)(I8); - T func = (T)ptr; - func(sp[0].data.p); - }; - if (!strcmp(sigTest,"4_4")) { - typedef I4 (*T)(I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i); - }; - if (!strcmp(sigTest,"8_4")) { - typedef I4 (*T)(I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p); - }; - if (!strcmp(sigTest,"4_8")) { - typedef I8 (*T)(I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i); - }; - if (!strcmp(sigTest,"8_8")) { - typedef I8 (*T)(I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p); - }; - break; - } - case MINT_ICALLSIG_PP_V: - case MINT_ICALLSIG_PP_P: { - if (!strcmp(sigTest,"44_V")) { - typedef void (*T)(I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i); - }; - if (!strcmp(sigTest,"48_V")) { - typedef void (*T)(I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p); - }; - if (!strcmp(sigTest,"84_V")) { - typedef void (*T)(I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i); - }; - if (!strcmp(sigTest,"88_V")) { - typedef void (*T)(I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p); - }; - if (!strcmp(sigTest,"44_4")) { - typedef I4 (*T)(I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i); - }; - if (!strcmp(sigTest,"48_4")) { - typedef I4 (*T)(I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p); - }; - if (!strcmp(sigTest,"84_4")) { - typedef I4 (*T)(I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i); - }; - if (!strcmp(sigTest,"88_4")) { - typedef I4 (*T)(I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p); - }; - if (!strcmp(sigTest,"44_8")) { - typedef I8 (*T)(I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i); - }; - if (!strcmp(sigTest,"48_8")) { - typedef I8 (*T)(I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p); - }; - if (!strcmp(sigTest,"84_8")) { - typedef I8 (*T)(I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i); - }; - if (!strcmp(sigTest,"88_8")) { - typedef I8 (*T)(I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p); - }; - break; - } - case MINT_ICALLSIG_PPP_V: - case MINT_ICALLSIG_PPP_P: { - if (!strcmp(sigTest,"444_V")) { - typedef void (*T)(I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i); - }; - if (!strcmp(sigTest,"448_V")) { - typedef void (*T)(I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p); - }; - if (!strcmp(sigTest,"484_V")) { - typedef void (*T)(I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i); - }; - if (!strcmp(sigTest,"488_V")) { - typedef void (*T)(I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p); - }; - if (!strcmp(sigTest,"844_V")) { - typedef void (*T)(I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i); - }; - if (!strcmp(sigTest,"848_V")) { - typedef void (*T)(I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p); - }; - if (!strcmp(sigTest,"884_V")) { - typedef void (*T)(I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i); - }; - if (!strcmp(sigTest,"888_V")) { - typedef void (*T)(I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p); - }; - if (!strcmp(sigTest,"444_4")) { - typedef I4 (*T)(I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i); - }; - if (!strcmp(sigTest,"448_4")) { - typedef I4 (*T)(I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p); - }; - if (!strcmp(sigTest,"484_4")) { - typedef I4 (*T)(I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i); - }; - if (!strcmp(sigTest,"488_4")) { - typedef I4 (*T)(I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p); - }; - if (!strcmp(sigTest,"844_4")) { - typedef I4 (*T)(I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i); - }; - if (!strcmp(sigTest,"848_4")) { - typedef I4 (*T)(I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p); - }; - if (!strcmp(sigTest,"884_4")) { - typedef I4 (*T)(I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i); - }; - if (!strcmp(sigTest,"888_4")) { - typedef I4 (*T)(I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p); - }; - if (!strcmp(sigTest,"444_8")) { - typedef I8 (*T)(I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i); - }; - if (!strcmp(sigTest,"448_8")) { - typedef I8 (*T)(I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p); - }; - if (!strcmp(sigTest,"484_8")) { - typedef I8 (*T)(I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i); - }; - if (!strcmp(sigTest,"488_8")) { - typedef I8 (*T)(I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p); - }; - if (!strcmp(sigTest,"844_8")) { - typedef I8 (*T)(I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i); - }; - if (!strcmp(sigTest,"848_8")) { - typedef I8 (*T)(I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p); - }; - if (!strcmp(sigTest,"884_8")) { - typedef I8 (*T)(I8,I8,I4); - T func = (T)ptr; - MH_LOG("Calling 884_8 func with: %p %p %d", (void*)sp[0].data.p, (void*)sp[1].data.p, sp[2].data.i); - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i); - }; - if (!strcmp(sigTest,"888_8")) { - typedef I8 (*T)(I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p); - }; - break; - } - case MINT_ICALLSIG_PPPP_V: - case MINT_ICALLSIG_PPPP_P: { - if (!strcmp(sigTest,"4444_V")) { - typedef void (*T)(I4,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"4448_V")) { - typedef void (*T)(I4,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"4484_V")) { - typedef void (*T)(I4,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"4488_V")) { - typedef void (*T)(I4,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"4844_V")) { - typedef void (*T)(I4,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"4848_V")) { - typedef void (*T)(I4,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"4884_V")) { - typedef void (*T)(I4,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"4888_V")) { - typedef void (*T)(I4,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"8444_V")) { - typedef void (*T)(I8,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"8448_V")) { - typedef void (*T)(I8,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"8484_V")) { - typedef void (*T)(I8,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"8488_V")) { - typedef void (*T)(I8,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"8844_V")) { - typedef void (*T)(I8,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"8848_V")) { - typedef void (*T)(I8,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"8884_V")) { - typedef void (*T)(I8,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"8888_V")) { - typedef void (*T)(I8,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"4444_4")) { - typedef I4 (*T)(I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"4448_4")) { - typedef I4 (*T)(I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"4484_4")) { - typedef I4 (*T)(I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"4488_4")) { - typedef I4 (*T)(I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"4844_4")) { - typedef I4 (*T)(I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"4848_4")) { - typedef I4 (*T)(I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"4884_4")) { - typedef I4 (*T)(I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"4888_4")) { - typedef I4 (*T)(I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"8444_4")) { - typedef I4 (*T)(I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"8448_4")) { - typedef I4 (*T)(I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"8484_4")) { - typedef I4 (*T)(I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"8488_4")) { - typedef I4 (*T)(I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"8844_4")) { - typedef I4 (*T)(I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"8848_4")) { - typedef I4 (*T)(I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"8884_4")) { - typedef I4 (*T)(I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"8888_4")) { - typedef I4 (*T)(I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"4444_8")) { - typedef I8 (*T)(I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"4448_8")) { - typedef I8 (*T)(I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"4484_8")) { - typedef I8 (*T)(I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"4488_8")) { - typedef I8 (*T)(I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"4844_8")) { - typedef I8 (*T)(I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"4848_8")) { - typedef I8 (*T)(I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"4884_8")) { - typedef I8 (*T)(I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"4888_8")) { - typedef I8 (*T)(I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"8444_8")) { - typedef I8 (*T)(I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"8448_8")) { - typedef I8 (*T)(I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"8484_8")) { - typedef I8 (*T)(I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"8488_8")) { - typedef I8 (*T)(I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"8844_8")) { - typedef I8 (*T)(I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"8848_8")) { - typedef I8 (*T)(I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"8884_8")) { - typedef I8 (*T)(I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"8888_8")) { - typedef I8 (*T)(I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p); - }; - break; - } - case MINT_ICALLSIG_PPPPP_V: - case MINT_ICALLSIG_PPPPP_P: { - //log_sig(sig); // just here for a breakpoint - if (!strcmp(sigTest,"44444_V")) { - typedef void (*T)(I4,I4,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"44448_V")) { - typedef void (*T)(I4,I4,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"44484_V")) { - typedef void (*T)(I4,I4,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"44488_V")) { - typedef void (*T)(I4,I4,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"44844_V")) { - typedef void (*T)(I4,I4,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"44848_V")) { - typedef void (*T)(I4,I4,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"44884_V")) { - typedef void (*T)(I4,I4,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"44888_V")) { - typedef void (*T)(I4,I4,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"48444_V")) { - typedef void (*T)(I4,I8,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"48448_V")) { - typedef void (*T)(I4,I8,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"48484_V")) { - typedef void (*T)(I4,I8,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"48488_V")) { - typedef void (*T)(I4,I8,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"48844_V")) { - typedef void (*T)(I4,I8,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"48848_V")) { - typedef void (*T)(I4,I8,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"48884_V")) { - typedef void (*T)(I4,I8,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"48888_V")) { - typedef void (*T)(I4,I8,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"84444_V")) { - typedef void (*T)(I8,I4,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"84448_V")) { - typedef void (*T)(I8,I4,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"84484_V")) { - typedef void (*T)(I8,I4,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"84488_V")) { - typedef void (*T)(I8,I4,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"84844_V")) { - typedef void (*T)(I8,I4,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"84848_V")) { - typedef void (*T)(I8,I4,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"84884_V")) { - typedef void (*T)(I8,I4,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"84888_V")) { - typedef void (*T)(I8,I4,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"88444_V")) { - typedef void (*T)(I8,I8,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"88448_V")) { - typedef void (*T)(I8,I8,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"88484_V")) { - typedef void (*T)(I8,I8,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"88488_V")) { - typedef void (*T)(I8,I8,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"88844_V")) { - typedef void (*T)(I8,I8,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"88848_V")) { - typedef void (*T)(I8,I8,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"88884_V")) { - typedef void (*T)(I8,I8,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"88888_V")) { - typedef void (*T)(I8,I8,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"44444_4")) { - typedef I4 (*T)(I4,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"44448_4")) { - typedef I4 (*T)(I4,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"44484_4")) { - typedef I4 (*T)(I4,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"44488_4")) { - typedef I4 (*T)(I4,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"44844_4")) { - typedef I4 (*T)(I4,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"44848_4")) { - typedef I4 (*T)(I4,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"44884_4")) { - typedef I4 (*T)(I4,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"44888_4")) { - typedef I4 (*T)(I4,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"48444_4")) { - typedef I4 (*T)(I4,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"48448_4")) { - typedef I4 (*T)(I4,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"48484_4")) { - typedef I4 (*T)(I4,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"48488_4")) { - typedef I4 (*T)(I4,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"48844_4")) { - typedef I4 (*T)(I4,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"48848_4")) { - typedef I4 (*T)(I4,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"48884_4")) { - typedef I4 (*T)(I4,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"48888_4")) { - typedef I4 (*T)(I4,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"84444_4")) { - typedef I4 (*T)(I8,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"84448_4")) { - typedef I4 (*T)(I8,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"84484_4")) { - typedef I4 (*T)(I8,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"84488_4")) { - typedef I4 (*T)(I8,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"84844_4")) { - typedef I4 (*T)(I8,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"84848_4")) { - typedef I4 (*T)(I8,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"84884_4")) { - typedef I4 (*T)(I8,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"84888_4")) { - typedef I4 (*T)(I8,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"88444_4")) { - typedef I4 (*T)(I8,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"88448_4")) { - typedef I4 (*T)(I8,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"88484_4")) { - typedef I4 (*T)(I8,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"88488_4")) { - typedef I4 (*T)(I8,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"88844_4")) { - typedef I4 (*T)(I8,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"88848_4")) { - typedef I4 (*T)(I8,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"88884_4")) { - typedef I4 (*T)(I8,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"88888_4")) { - typedef I4 (*T)(I8,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"44444_8")) { - typedef I8 (*T)(I4,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"44448_8")) { - typedef I8 (*T)(I4,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"44484_8")) { - typedef I8 (*T)(I4,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"44488_8")) { - typedef I8 (*T)(I4,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"44844_8")) { - typedef I8 (*T)(I4,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"44848_8")) { - typedef I8 (*T)(I4,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"44884_8")) { - typedef I8 (*T)(I4,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"44888_8")) { - typedef I8 (*T)(I4,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"48444_8")) { - typedef I8 (*T)(I4,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"48448_8")) { - typedef I8 (*T)(I4,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"48484_8")) { - typedef I8 (*T)(I4,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"48488_8")) { - typedef I8 (*T)(I4,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"48844_8")) { - typedef I8 (*T)(I4,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"48848_8")) { - typedef I8 (*T)(I4,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"48884_8")) { - typedef I8 (*T)(I4,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"48888_8")) { - typedef I8 (*T)(I4,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"84444_8")) { - typedef I8 (*T)(I8,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"84448_8")) { - typedef I8 (*T)(I8,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"84484_8")) { - typedef I8 (*T)(I8,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"84488_8")) { - typedef I8 (*T)(I8,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"84844_8")) { - typedef I8 (*T)(I8,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"84848_8")) { - typedef I8 (*T)(I8,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"84884_8")) { - typedef I8 (*T)(I8,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"84888_8")) { - typedef I8 (*T)(I8,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"88444_8")) { - typedef I8 (*T)(I8,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"88448_8")) { - typedef I8 (*T)(I8,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"88484_8")) { - typedef I8 (*T)(I8,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"88488_8")) { - typedef I8 (*T)(I8,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"88844_8")) { - typedef I8 (*T)(I8,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"88848_8")) { - typedef I8 (*T)(I8,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"88884_8")) { - typedef I8 (*T)(I8,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"88888_8")) { - typedef I8 (*T)(I8,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - break; - } - case MINT_ICALLSIG_PPPPPP_V: - case MINT_ICALLSIG_PPPPPP_P: { - //log_sig(sig); // just here for a breakpoint - if (!strcmp(sigTest,"444444_V")) { - typedef void (*T)(I4,I4,I4,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"444448_V")) { - typedef void (*T)(I4,I4,I4,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"444484_V")) { - typedef void (*T)(I4,I4,I4,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"444488_V")) { - typedef void (*T)(I4,I4,I4,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"444844_V")) { - typedef void (*T)(I4,I4,I4,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"444848_V")) { - typedef void (*T)(I4,I4,I4,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"444884_V")) { - typedef void (*T)(I4,I4,I4,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"444888_V")) { - typedef void (*T)(I4,I4,I4,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"448444_V")) { - typedef void (*T)(I4,I4,I8,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"448448_V")) { - typedef void (*T)(I4,I4,I8,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"448484_V")) { - typedef void (*T)(I4,I4,I8,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"448488_V")) { - typedef void (*T)(I4,I4,I8,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"448844_V")) { - typedef void (*T)(I4,I4,I8,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"448848_V")) { - typedef void (*T)(I4,I4,I8,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"448884_V")) { - typedef void (*T)(I4,I4,I8,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"448888_V")) { - typedef void (*T)(I4,I4,I8,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"484444_V")) { - typedef void (*T)(I4,I8,I4,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"484448_V")) { - typedef void (*T)(I4,I8,I4,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"484484_V")) { - typedef void (*T)(I4,I8,I4,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"484488_V")) { - typedef void (*T)(I4,I8,I4,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"484844_V")) { - typedef void (*T)(I4,I8,I4,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"484848_V")) { - typedef void (*T)(I4,I8,I4,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"484884_V")) { - typedef void (*T)(I4,I8,I4,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"484888_V")) { - typedef void (*T)(I4,I8,I4,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"488444_V")) { - typedef void (*T)(I4,I8,I8,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"488448_V")) { - typedef void (*T)(I4,I8,I8,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"488484_V")) { - typedef void (*T)(I4,I8,I8,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"488488_V")) { - typedef void (*T)(I4,I8,I8,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"488844_V")) { - typedef void (*T)(I4,I8,I8,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"488848_V")) { - typedef void (*T)(I4,I8,I8,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"488884_V")) { - typedef void (*T)(I4,I8,I8,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"488888_V")) { - typedef void (*T)(I4,I8,I8,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"844444_V")) { - typedef void (*T)(I8,I4,I4,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"844448_V")) { - typedef void (*T)(I8,I4,I4,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"844484_V")) { - typedef void (*T)(I8,I4,I4,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"844488_V")) { - typedef void (*T)(I8,I4,I4,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"844844_V")) { - typedef void (*T)(I8,I4,I4,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"844848_V")) { - typedef void (*T)(I8,I4,I4,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"844884_V")) { - typedef void (*T)(I8,I4,I4,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"844888_V")) { - typedef void (*T)(I8,I4,I4,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"848444_V")) { - typedef void (*T)(I8,I4,I8,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"848448_V")) { - typedef void (*T)(I8,I4,I8,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"848484_V")) { - typedef void (*T)(I8,I4,I8,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"848488_V")) { - typedef void (*T)(I8,I4,I8,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"848844_V")) { - typedef void (*T)(I8,I4,I8,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"848848_V")) { - typedef void (*T)(I8,I4,I8,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"848884_V")) { - typedef void (*T)(I8,I4,I8,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"848888_V")) { - typedef void (*T)(I8,I4,I8,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"884444_V")) { - typedef void (*T)(I8,I8,I4,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"884448_V")) { - typedef void (*T)(I8,I8,I4,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"884484_V")) { - typedef void (*T)(I8,I8,I4,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"884488_V")) { - typedef void (*T)(I8,I8,I4,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"884844_V")) { - typedef void (*T)(I8,I8,I4,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"884848_V")) { - typedef void (*T)(I8,I8,I4,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"884884_V")) { - typedef void (*T)(I8,I8,I4,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"884888_V")) { - typedef void (*T)(I8,I8,I4,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"888444_V")) { - typedef void (*T)(I8,I8,I8,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"888448_V")) { - typedef void (*T)(I8,I8,I8,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"888484_V")) { - typedef void (*T)(I8,I8,I8,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"888488_V")) { - typedef void (*T)(I8,I8,I8,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"888844_V")) { - typedef void (*T)(I8,I8,I8,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"888848_V")) { - typedef void (*T)(I8,I8,I8,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"888884_V")) { - typedef void (*T)(I8,I8,I8,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"888888_V")) { - typedef void (*T)(I8,I8,I8,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"444444_4")) { - typedef I4 (*T)(I4,I4,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"444448_4")) { - typedef I4 (*T)(I4,I4,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"444484_4")) { - typedef I4 (*T)(I4,I4,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"444488_4")) { - typedef I4 (*T)(I4,I4,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"444844_4")) { - typedef I4 (*T)(I4,I4,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"444848_4")) { - typedef I4 (*T)(I4,I4,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"444884_4")) { - typedef I4 (*T)(I4,I4,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"444888_4")) { - typedef I4 (*T)(I4,I4,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"448444_4")) { - typedef I4 (*T)(I4,I4,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"448448_4")) { - typedef I4 (*T)(I4,I4,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"448484_4")) { - typedef I4 (*T)(I4,I4,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"448488_4")) { - typedef I4 (*T)(I4,I4,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"448844_4")) { - typedef I4 (*T)(I4,I4,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"448848_4")) { - typedef I4 (*T)(I4,I4,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"448884_4")) { - typedef I4 (*T)(I4,I4,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"448888_4")) { - typedef I4 (*T)(I4,I4,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"484444_4")) { - typedef I4 (*T)(I4,I8,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"484448_4")) { - typedef I4 (*T)(I4,I8,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"484484_4")) { - typedef I4 (*T)(I4,I8,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"484488_4")) { - typedef I4 (*T)(I4,I8,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"484844_4")) { - typedef I4 (*T)(I4,I8,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"484848_4")) { - typedef I4 (*T)(I4,I8,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"484884_4")) { - typedef I4 (*T)(I4,I8,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"484888_4")) { - typedef I4 (*T)(I4,I8,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"488444_4")) { - typedef I4 (*T)(I4,I8,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"488448_4")) { - typedef I4 (*T)(I4,I8,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"488484_4")) { - typedef I4 (*T)(I4,I8,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"488488_4")) { - typedef I4 (*T)(I4,I8,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"488844_4")) { - typedef I4 (*T)(I4,I8,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"488848_4")) { - typedef I4 (*T)(I4,I8,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"488884_4")) { - typedef I4 (*T)(I4,I8,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"488888_4")) { - typedef I4 (*T)(I4,I8,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"844444_4")) { - typedef I4 (*T)(I8,I4,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"844448_4")) { - typedef I4 (*T)(I8,I4,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"844484_4")) { - typedef I4 (*T)(I8,I4,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"844488_4")) { - typedef I4 (*T)(I8,I4,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"844844_4")) { - typedef I4 (*T)(I8,I4,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"844848_4")) { - typedef I4 (*T)(I8,I4,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"844884_4")) { - typedef I4 (*T)(I8,I4,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"844888_4")) { - typedef I4 (*T)(I8,I4,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"848444_4")) { - typedef I4 (*T)(I8,I4,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"848448_4")) { - typedef I4 (*T)(I8,I4,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"848484_4")) { - typedef I4 (*T)(I8,I4,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"848488_4")) { - typedef I4 (*T)(I8,I4,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"848844_4")) { - typedef I4 (*T)(I8,I4,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"848848_4")) { - typedef I4 (*T)(I8,I4,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"848884_4")) { - typedef I4 (*T)(I8,I4,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"848888_4")) { - typedef I4 (*T)(I8,I4,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"884444_4")) { - typedef I4 (*T)(I8,I8,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"884448_4")) { - typedef I4 (*T)(I8,I8,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"884484_4")) { - typedef I4 (*T)(I8,I8,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"884488_4")) { - typedef I4 (*T)(I8,I8,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"884844_4")) { - typedef I4 (*T)(I8,I8,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"884848_4")) { - typedef I4 (*T)(I8,I8,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"884884_4")) { - typedef I4 (*T)(I8,I8,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"884888_4")) { - typedef I4 (*T)(I8,I8,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"888444_4")) { - typedef I4 (*T)(I8,I8,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"888448_4")) { - typedef I4 (*T)(I8,I8,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"888484_4")) { - typedef I4 (*T)(I8,I8,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"888488_4")) { - typedef I4 (*T)(I8,I8,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"888844_4")) { - typedef I4 (*T)(I8,I8,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"888848_4")) { - typedef I4 (*T)(I8,I8,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"888884_4")) { - typedef I4 (*T)(I8,I8,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"888888_4")) { - typedef I4 (*T)(I8,I8,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"444444_8")) { - typedef I8 (*T)(I4,I4,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"444448_8")) { - typedef I8 (*T)(I4,I4,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"444484_8")) { - typedef I8 (*T)(I4,I4,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"444488_8")) { - typedef I8 (*T)(I4,I4,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"444844_8")) { - typedef I8 (*T)(I4,I4,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"444848_8")) { - typedef I8 (*T)(I4,I4,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"444884_8")) { - typedef I8 (*T)(I4,I4,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"444888_8")) { - typedef I8 (*T)(I4,I4,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"448444_8")) { - typedef I8 (*T)(I4,I4,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"448448_8")) { - typedef I8 (*T)(I4,I4,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"448484_8")) { - typedef I8 (*T)(I4,I4,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"448488_8")) { - typedef I8 (*T)(I4,I4,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"448844_8")) { - typedef I8 (*T)(I4,I4,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"448848_8")) { - typedef I8 (*T)(I4,I4,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"448884_8")) { - typedef I8 (*T)(I4,I4,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"448888_8")) { - typedef I8 (*T)(I4,I4,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"484444_8")) { - typedef I8 (*T)(I4,I8,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"484448_8")) { - typedef I8 (*T)(I4,I8,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"484484_8")) { - typedef I8 (*T)(I4,I8,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"484488_8")) { - typedef I8 (*T)(I4,I8,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"484844_8")) { - typedef I8 (*T)(I4,I8,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"484848_8")) { - typedef I8 (*T)(I4,I8,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"484884_8")) { - typedef I8 (*T)(I4,I8,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"484888_8")) { - typedef I8 (*T)(I4,I8,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"488444_8")) { - typedef I8 (*T)(I4,I8,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"488448_8")) { - typedef I8 (*T)(I4,I8,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"488484_8")) { - typedef I8 (*T)(I4,I8,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"488488_8")) { - typedef I8 (*T)(I4,I8,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"488844_8")) { - typedef I8 (*T)(I4,I8,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"488848_8")) { - typedef I8 (*T)(I4,I8,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"488884_8")) { - typedef I8 (*T)(I4,I8,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"488888_8")) { - typedef I8 (*T)(I4,I8,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"844444_8")) { - typedef I8 (*T)(I8,I4,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"844448_8")) { - typedef I8 (*T)(I8,I4,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"844484_8")) { - typedef I8 (*T)(I8,I4,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"844488_8")) { - typedef I8 (*T)(I8,I4,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"844844_8")) { - typedef I8 (*T)(I8,I4,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"844848_8")) { - typedef I8 (*T)(I8,I4,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"844884_8")) { - typedef I8 (*T)(I8,I4,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"844888_8")) { - typedef I8 (*T)(I8,I4,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"848444_8")) { - typedef I8 (*T)(I8,I4,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"848448_8")) { - typedef I8 (*T)(I8,I4,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"848484_8")) { - typedef I8 (*T)(I8,I4,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"848488_8")) { - typedef I8 (*T)(I8,I4,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"848844_8")) { - typedef I8 (*T)(I8,I4,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"848848_8")) { - typedef I8 (*T)(I8,I4,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"848884_8")) { - typedef I8 (*T)(I8,I4,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"848888_8")) { - typedef I8 (*T)(I8,I4,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"884444_8")) { - typedef I8 (*T)(I8,I8,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"884448_8")) { - typedef I8 (*T)(I8,I8,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"884484_8")) { - typedef I8 (*T)(I8,I8,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"884488_8")) { - typedef I8 (*T)(I8,I8,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"884844_8")) { - typedef I8 (*T)(I8,I8,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"884848_8")) { - typedef I8 (*T)(I8,I8,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"884884_8")) { - typedef I8 (*T)(I8,I8,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"884888_8")) { - typedef I8 (*T)(I8,I8,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"888444_8")) { - typedef I8 (*T)(I8,I8,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"888448_8")) { - typedef I8 (*T)(I8,I8,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"888484_8")) { - typedef I8 (*T)(I8,I8,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"888488_8")) { - typedef I8 (*T)(I8,I8,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"888844_8")) { - typedef I8 (*T)(I8,I8,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"888848_8")) { - typedef I8 (*T)(I8,I8,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"888884_8")) { - typedef I8 (*T)(I8,I8,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"888888_8")) { - typedef I8 (*T)(I8,I8,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - break; + // FIXME: this string/cookie comparison is rubbish - use an enum + char* sigTest = log_sig(sig); // currently must be called to get the cookie! + if (!sigTest) + { + memset(&ret_sp->data, 0, sizeof(stackval)); } - default: - g_assert_not_reached(); + else + { + switch (op) { + case MINT_ICALLSIG_V_V: + case MINT_ICALLSIG_V_P: { + if (!strcmp(sigTest,"V_V")) { + typedef void (*T)(void); + T func = (T)ptr; + func(); + }; + if (!strcmp(sigTest,"V_4")) { + typedef I4 (*T)(void); + T func = (T)ptr; + ret_sp->data.i = func(); + }; + if (!strcmp(sigTest,"V_8")) { + typedef I8 (*T)(void); + T func = (T)ptr; + ret_sp->data.p = func(); + }; + break; + } + case MINT_ICALLSIG_P_V: + case MINT_ICALLSIG_P_P: { + if (!strcmp(sigTest,"4_V")) { + typedef void (*T)(I4); + T func = (T)ptr; + func(sp[0].data.i); + }; + if (!strcmp(sigTest,"8_V")) { + typedef void (*T)(I8); + T func = (T)ptr; + func(sp[0].data.p); + }; + if (!strcmp(sigTest,"4_4")) { + typedef I4 (*T)(I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i); + }; + if (!strcmp(sigTest,"8_4")) { + typedef I4 (*T)(I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p); + }; + if (!strcmp(sigTest,"4_8")) { + typedef I8 (*T)(I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i); + }; + if (!strcmp(sigTest,"8_8")) { + typedef I8 (*T)(I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p); + }; + break; + } + case MINT_ICALLSIG_PP_V: + case MINT_ICALLSIG_PP_P: { + if (!strcmp(sigTest,"44_V")) { + typedef void (*T)(I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i); + }; + if (!strcmp(sigTest,"48_V")) { + typedef void (*T)(I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p); + }; + if (!strcmp(sigTest,"84_V")) { + typedef void (*T)(I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i); + }; + if (!strcmp(sigTest,"88_V")) { + typedef void (*T)(I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p); + }; + if (!strcmp(sigTest,"44_4")) { + typedef I4 (*T)(I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i); + }; + if (!strcmp(sigTest,"48_4")) { + typedef I4 (*T)(I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p); + }; + if (!strcmp(sigTest,"84_4")) { + typedef I4 (*T)(I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i); + }; + if (!strcmp(sigTest,"88_4")) { + typedef I4 (*T)(I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p); + }; + if (!strcmp(sigTest,"44_8")) { + typedef I8 (*T)(I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i); + }; + if (!strcmp(sigTest,"48_8")) { + typedef I8 (*T)(I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p); + }; + if (!strcmp(sigTest,"84_8")) { + typedef I8 (*T)(I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i); + }; + if (!strcmp(sigTest,"88_8")) { + typedef I8 (*T)(I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p); + }; + break; + } + case MINT_ICALLSIG_PPP_V: + case MINT_ICALLSIG_PPP_P: { + if (!strcmp(sigTest,"444_V")) { + typedef void (*T)(I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i); + }; + if (!strcmp(sigTest,"448_V")) { + typedef void (*T)(I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p); + }; + if (!strcmp(sigTest,"484_V")) { + typedef void (*T)(I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i); + }; + if (!strcmp(sigTest,"488_V")) { + typedef void (*T)(I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p); + }; + if (!strcmp(sigTest,"844_V")) { + typedef void (*T)(I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i); + }; + if (!strcmp(sigTest,"848_V")) { + typedef void (*T)(I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p); + }; + if (!strcmp(sigTest,"884_V")) { + typedef void (*T)(I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i); + }; + if (!strcmp(sigTest,"888_V")) { + typedef void (*T)(I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p); + }; + if (!strcmp(sigTest,"444_4")) { + typedef I4 (*T)(I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i); + }; + if (!strcmp(sigTest,"448_4")) { + typedef I4 (*T)(I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p); + }; + if (!strcmp(sigTest,"484_4")) { + typedef I4 (*T)(I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i); + }; + if (!strcmp(sigTest,"488_4")) { + typedef I4 (*T)(I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p); + }; + if (!strcmp(sigTest,"844_4")) { + typedef I4 (*T)(I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i); + }; + if (!strcmp(sigTest,"848_4")) { + typedef I4 (*T)(I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p); + }; + if (!strcmp(sigTest,"884_4")) { + typedef I4 (*T)(I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i); + }; + if (!strcmp(sigTest,"888_4")) { + typedef I4 (*T)(I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p); + }; + if (!strcmp(sigTest,"444_8")) { + typedef I8 (*T)(I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i); + }; + if (!strcmp(sigTest,"448_8")) { + typedef I8 (*T)(I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p); + }; + if (!strcmp(sigTest,"484_8")) { + typedef I8 (*T)(I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i); + }; + if (!strcmp(sigTest,"488_8")) { + typedef I8 (*T)(I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p); + }; + if (!strcmp(sigTest,"844_8")) { + typedef I8 (*T)(I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i); + }; + if (!strcmp(sigTest,"848_8")) { + typedef I8 (*T)(I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p); + }; + if (!strcmp(sigTest,"884_8")) { + typedef I8 (*T)(I8,I8,I4); + T func = (T)ptr; + MH_LOG("Calling 884_8 func with: %p %p %d", (void*)sp[0].data.p, (void*)sp[1].data.p, sp[2].data.i); + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i); + }; + if (!strcmp(sigTest,"888_8")) { + typedef I8 (*T)(I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p); + }; + break; + } + case MINT_ICALLSIG_PPPP_V: + case MINT_ICALLSIG_PPPP_P: { + if (!strcmp(sigTest,"4444_V")) { + typedef void (*T)(I4,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"4448_V")) { + typedef void (*T)(I4,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"4484_V")) { + typedef void (*T)(I4,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"4488_V")) { + typedef void (*T)(I4,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"4844_V")) { + typedef void (*T)(I4,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"4848_V")) { + typedef void (*T)(I4,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"4884_V")) { + typedef void (*T)(I4,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"4888_V")) { + typedef void (*T)(I4,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"8444_V")) { + typedef void (*T)(I8,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"8448_V")) { + typedef void (*T)(I8,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"8484_V")) { + typedef void (*T)(I8,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"8488_V")) { + typedef void (*T)(I8,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"8844_V")) { + typedef void (*T)(I8,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"8848_V")) { + typedef void (*T)(I8,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"8884_V")) { + typedef void (*T)(I8,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"8888_V")) { + typedef void (*T)(I8,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"4444_4")) { + typedef I4 (*T)(I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"4448_4")) { + typedef I4 (*T)(I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"4484_4")) { + typedef I4 (*T)(I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"4488_4")) { + typedef I4 (*T)(I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"4844_4")) { + typedef I4 (*T)(I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"4848_4")) { + typedef I4 (*T)(I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"4884_4")) { + typedef I4 (*T)(I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"4888_4")) { + typedef I4 (*T)(I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"8444_4")) { + typedef I4 (*T)(I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"8448_4")) { + typedef I4 (*T)(I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"8484_4")) { + typedef I4 (*T)(I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"8488_4")) { + typedef I4 (*T)(I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"8844_4")) { + typedef I4 (*T)(I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"8848_4")) { + typedef I4 (*T)(I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"8884_4")) { + typedef I4 (*T)(I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"8888_4")) { + typedef I4 (*T)(I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"4444_8")) { + typedef I8 (*T)(I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"4448_8")) { + typedef I8 (*T)(I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"4484_8")) { + typedef I8 (*T)(I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"4488_8")) { + typedef I8 (*T)(I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"4844_8")) { + typedef I8 (*T)(I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"4848_8")) { + typedef I8 (*T)(I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"4884_8")) { + typedef I8 (*T)(I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"4888_8")) { + typedef I8 (*T)(I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"8444_8")) { + typedef I8 (*T)(I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"8448_8")) { + typedef I8 (*T)(I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"8484_8")) { + typedef I8 (*T)(I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"8488_8")) { + typedef I8 (*T)(I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p); + }; + if (!strcmp(sigTest,"8844_8")) { + typedef I8 (*T)(I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i); + }; + if (!strcmp(sigTest,"8848_8")) { + typedef I8 (*T)(I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p); + }; + if (!strcmp(sigTest,"8884_8")) { + typedef I8 (*T)(I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i); + }; + if (!strcmp(sigTest,"8888_8")) { + typedef I8 (*T)(I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p); + }; + break; + } + case MINT_ICALLSIG_PPPPP_V: + case MINT_ICALLSIG_PPPPP_P: { + //log_sig(sig); // just here for a breakpoint + if (!strcmp(sigTest,"44444_V")) { + typedef void (*T)(I4,I4,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"44448_V")) { + typedef void (*T)(I4,I4,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"44484_V")) { + typedef void (*T)(I4,I4,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"44488_V")) { + typedef void (*T)(I4,I4,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"44844_V")) { + typedef void (*T)(I4,I4,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"44848_V")) { + typedef void (*T)(I4,I4,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"44884_V")) { + typedef void (*T)(I4,I4,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"44888_V")) { + typedef void (*T)(I4,I4,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"48444_V")) { + typedef void (*T)(I4,I8,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"48448_V")) { + typedef void (*T)(I4,I8,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"48484_V")) { + typedef void (*T)(I4,I8,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"48488_V")) { + typedef void (*T)(I4,I8,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"48844_V")) { + typedef void (*T)(I4,I8,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"48848_V")) { + typedef void (*T)(I4,I8,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"48884_V")) { + typedef void (*T)(I4,I8,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"48888_V")) { + typedef void (*T)(I4,I8,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"84444_V")) { + typedef void (*T)(I8,I4,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"84448_V")) { + typedef void (*T)(I8,I4,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"84484_V")) { + typedef void (*T)(I8,I4,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"84488_V")) { + typedef void (*T)(I8,I4,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"84844_V")) { + typedef void (*T)(I8,I4,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"84848_V")) { + typedef void (*T)(I8,I4,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"84884_V")) { + typedef void (*T)(I8,I4,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"84888_V")) { + typedef void (*T)(I8,I4,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"88444_V")) { + typedef void (*T)(I8,I8,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"88448_V")) { + typedef void (*T)(I8,I8,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"88484_V")) { + typedef void (*T)(I8,I8,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"88488_V")) { + typedef void (*T)(I8,I8,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"88844_V")) { + typedef void (*T)(I8,I8,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"88848_V")) { + typedef void (*T)(I8,I8,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"88884_V")) { + typedef void (*T)(I8,I8,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"88888_V")) { + typedef void (*T)(I8,I8,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"44444_4")) { + typedef I4 (*T)(I4,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"44448_4")) { + typedef I4 (*T)(I4,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"44484_4")) { + typedef I4 (*T)(I4,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"44488_4")) { + typedef I4 (*T)(I4,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"44844_4")) { + typedef I4 (*T)(I4,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"44848_4")) { + typedef I4 (*T)(I4,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"44884_4")) { + typedef I4 (*T)(I4,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"44888_4")) { + typedef I4 (*T)(I4,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"48444_4")) { + typedef I4 (*T)(I4,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"48448_4")) { + typedef I4 (*T)(I4,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"48484_4")) { + typedef I4 (*T)(I4,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"48488_4")) { + typedef I4 (*T)(I4,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"48844_4")) { + typedef I4 (*T)(I4,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"48848_4")) { + typedef I4 (*T)(I4,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"48884_4")) { + typedef I4 (*T)(I4,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"48888_4")) { + typedef I4 (*T)(I4,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"84444_4")) { + typedef I4 (*T)(I8,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"84448_4")) { + typedef I4 (*T)(I8,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"84484_4")) { + typedef I4 (*T)(I8,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"84488_4")) { + typedef I4 (*T)(I8,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"84844_4")) { + typedef I4 (*T)(I8,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"84848_4")) { + typedef I4 (*T)(I8,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"84884_4")) { + typedef I4 (*T)(I8,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"84888_4")) { + typedef I4 (*T)(I8,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"88444_4")) { + typedef I4 (*T)(I8,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"88448_4")) { + typedef I4 (*T)(I8,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"88484_4")) { + typedef I4 (*T)(I8,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"88488_4")) { + typedef I4 (*T)(I8,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"88844_4")) { + typedef I4 (*T)(I8,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"88848_4")) { + typedef I4 (*T)(I8,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"88884_4")) { + typedef I4 (*T)(I8,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"88888_4")) { + typedef I4 (*T)(I8,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"44444_8")) { + typedef I8 (*T)(I4,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"44448_8")) { + typedef I8 (*T)(I4,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"44484_8")) { + typedef I8 (*T)(I4,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"44488_8")) { + typedef I8 (*T)(I4,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"44844_8")) { + typedef I8 (*T)(I4,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"44848_8")) { + typedef I8 (*T)(I4,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"44884_8")) { + typedef I8 (*T)(I4,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"44888_8")) { + typedef I8 (*T)(I4,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"48444_8")) { + typedef I8 (*T)(I4,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"48448_8")) { + typedef I8 (*T)(I4,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"48484_8")) { + typedef I8 (*T)(I4,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"48488_8")) { + typedef I8 (*T)(I4,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"48844_8")) { + typedef I8 (*T)(I4,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"48848_8")) { + typedef I8 (*T)(I4,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"48884_8")) { + typedef I8 (*T)(I4,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"48888_8")) { + typedef I8 (*T)(I4,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"84444_8")) { + typedef I8 (*T)(I8,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"84448_8")) { + typedef I8 (*T)(I8,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"84484_8")) { + typedef I8 (*T)(I8,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"84488_8")) { + typedef I8 (*T)(I8,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"84844_8")) { + typedef I8 (*T)(I8,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"84848_8")) { + typedef I8 (*T)(I8,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"84884_8")) { + typedef I8 (*T)(I8,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"84888_8")) { + typedef I8 (*T)(I8,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"88444_8")) { + typedef I8 (*T)(I8,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"88448_8")) { + typedef I8 (*T)(I8,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"88484_8")) { + typedef I8 (*T)(I8,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"88488_8")) { + typedef I8 (*T)(I8,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); + }; + if (!strcmp(sigTest,"88844_8")) { + typedef I8 (*T)(I8,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); + }; + if (!strcmp(sigTest,"88848_8")) { + typedef I8 (*T)(I8,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); + }; + if (!strcmp(sigTest,"88884_8")) { + typedef I8 (*T)(I8,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); + }; + if (!strcmp(sigTest,"88888_8")) { + typedef I8 (*T)(I8,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); + }; + break; + } + case MINT_ICALLSIG_PPPPPP_V: + case MINT_ICALLSIG_PPPPPP_P: { + //log_sig(sig); // just here for a breakpoint + if (!strcmp(sigTest,"444444_V")) { + typedef void (*T)(I4,I4,I4,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"444448_V")) { + typedef void (*T)(I4,I4,I4,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"444484_V")) { + typedef void (*T)(I4,I4,I4,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"444488_V")) { + typedef void (*T)(I4,I4,I4,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"444844_V")) { + typedef void (*T)(I4,I4,I4,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"444848_V")) { + typedef void (*T)(I4,I4,I4,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"444884_V")) { + typedef void (*T)(I4,I4,I4,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"444888_V")) { + typedef void (*T)(I4,I4,I4,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"448444_V")) { + typedef void (*T)(I4,I4,I8,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"448448_V")) { + typedef void (*T)(I4,I4,I8,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"448484_V")) { + typedef void (*T)(I4,I4,I8,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"448488_V")) { + typedef void (*T)(I4,I4,I8,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"448844_V")) { + typedef void (*T)(I4,I4,I8,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"448848_V")) { + typedef void (*T)(I4,I4,I8,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"448884_V")) { + typedef void (*T)(I4,I4,I8,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"448888_V")) { + typedef void (*T)(I4,I4,I8,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"484444_V")) { + typedef void (*T)(I4,I8,I4,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"484448_V")) { + typedef void (*T)(I4,I8,I4,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"484484_V")) { + typedef void (*T)(I4,I8,I4,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"484488_V")) { + typedef void (*T)(I4,I8,I4,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"484844_V")) { + typedef void (*T)(I4,I8,I4,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"484848_V")) { + typedef void (*T)(I4,I8,I4,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"484884_V")) { + typedef void (*T)(I4,I8,I4,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"484888_V")) { + typedef void (*T)(I4,I8,I4,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"488444_V")) { + typedef void (*T)(I4,I8,I8,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"488448_V")) { + typedef void (*T)(I4,I8,I8,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"488484_V")) { + typedef void (*T)(I4,I8,I8,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"488488_V")) { + typedef void (*T)(I4,I8,I8,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"488844_V")) { + typedef void (*T)(I4,I8,I8,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"488848_V")) { + typedef void (*T)(I4,I8,I8,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"488884_V")) { + typedef void (*T)(I4,I8,I8,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"488888_V")) { + typedef void (*T)(I4,I8,I8,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"844444_V")) { + typedef void (*T)(I8,I4,I4,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"844448_V")) { + typedef void (*T)(I8,I4,I4,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"844484_V")) { + typedef void (*T)(I8,I4,I4,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"844488_V")) { + typedef void (*T)(I8,I4,I4,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"844844_V")) { + typedef void (*T)(I8,I4,I4,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"844848_V")) { + typedef void (*T)(I8,I4,I4,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"844884_V")) { + typedef void (*T)(I8,I4,I4,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"844888_V")) { + typedef void (*T)(I8,I4,I4,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"848444_V")) { + typedef void (*T)(I8,I4,I8,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"848448_V")) { + typedef void (*T)(I8,I4,I8,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"848484_V")) { + typedef void (*T)(I8,I4,I8,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"848488_V")) { + typedef void (*T)(I8,I4,I8,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"848844_V")) { + typedef void (*T)(I8,I4,I8,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"848848_V")) { + typedef void (*T)(I8,I4,I8,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"848884_V")) { + typedef void (*T)(I8,I4,I8,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"848888_V")) { + typedef void (*T)(I8,I4,I8,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"884444_V")) { + typedef void (*T)(I8,I8,I4,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"884448_V")) { + typedef void (*T)(I8,I8,I4,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"884484_V")) { + typedef void (*T)(I8,I8,I4,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"884488_V")) { + typedef void (*T)(I8,I8,I4,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"884844_V")) { + typedef void (*T)(I8,I8,I4,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"884848_V")) { + typedef void (*T)(I8,I8,I4,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"884884_V")) { + typedef void (*T)(I8,I8,I4,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"884888_V")) { + typedef void (*T)(I8,I8,I4,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"888444_V")) { + typedef void (*T)(I8,I8,I8,I4,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"888448_V")) { + typedef void (*T)(I8,I8,I8,I4,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"888484_V")) { + typedef void (*T)(I8,I8,I8,I4,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"888488_V")) { + typedef void (*T)(I8,I8,I8,I4,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"888844_V")) { + typedef void (*T)(I8,I8,I8,I8,I4,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"888848_V")) { + typedef void (*T)(I8,I8,I8,I8,I4,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"888884_V")) { + typedef void (*T)(I8,I8,I8,I8,I8,I4); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"888888_V")) { + typedef void (*T)(I8,I8,I8,I8,I8,I8); + T func = (T)ptr; + func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"444444_4")) { + typedef I4 (*T)(I4,I4,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"444448_4")) { + typedef I4 (*T)(I4,I4,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"444484_4")) { + typedef I4 (*T)(I4,I4,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"444488_4")) { + typedef I4 (*T)(I4,I4,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"444844_4")) { + typedef I4 (*T)(I4,I4,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"444848_4")) { + typedef I4 (*T)(I4,I4,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"444884_4")) { + typedef I4 (*T)(I4,I4,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"444888_4")) { + typedef I4 (*T)(I4,I4,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"448444_4")) { + typedef I4 (*T)(I4,I4,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"448448_4")) { + typedef I4 (*T)(I4,I4,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"448484_4")) { + typedef I4 (*T)(I4,I4,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"448488_4")) { + typedef I4 (*T)(I4,I4,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"448844_4")) { + typedef I4 (*T)(I4,I4,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"448848_4")) { + typedef I4 (*T)(I4,I4,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"448884_4")) { + typedef I4 (*T)(I4,I4,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"448888_4")) { + typedef I4 (*T)(I4,I4,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"484444_4")) { + typedef I4 (*T)(I4,I8,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"484448_4")) { + typedef I4 (*T)(I4,I8,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"484484_4")) { + typedef I4 (*T)(I4,I8,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"484488_4")) { + typedef I4 (*T)(I4,I8,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"484844_4")) { + typedef I4 (*T)(I4,I8,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"484848_4")) { + typedef I4 (*T)(I4,I8,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"484884_4")) { + typedef I4 (*T)(I4,I8,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"484888_4")) { + typedef I4 (*T)(I4,I8,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"488444_4")) { + typedef I4 (*T)(I4,I8,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"488448_4")) { + typedef I4 (*T)(I4,I8,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"488484_4")) { + typedef I4 (*T)(I4,I8,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"488488_4")) { + typedef I4 (*T)(I4,I8,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"488844_4")) { + typedef I4 (*T)(I4,I8,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"488848_4")) { + typedef I4 (*T)(I4,I8,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"488884_4")) { + typedef I4 (*T)(I4,I8,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"488888_4")) { + typedef I4 (*T)(I4,I8,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"844444_4")) { + typedef I4 (*T)(I8,I4,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"844448_4")) { + typedef I4 (*T)(I8,I4,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"844484_4")) { + typedef I4 (*T)(I8,I4,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"844488_4")) { + typedef I4 (*T)(I8,I4,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"844844_4")) { + typedef I4 (*T)(I8,I4,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"844848_4")) { + typedef I4 (*T)(I8,I4,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"844884_4")) { + typedef I4 (*T)(I8,I4,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"844888_4")) { + typedef I4 (*T)(I8,I4,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"848444_4")) { + typedef I4 (*T)(I8,I4,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"848448_4")) { + typedef I4 (*T)(I8,I4,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"848484_4")) { + typedef I4 (*T)(I8,I4,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"848488_4")) { + typedef I4 (*T)(I8,I4,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"848844_4")) { + typedef I4 (*T)(I8,I4,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"848848_4")) { + typedef I4 (*T)(I8,I4,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"848884_4")) { + typedef I4 (*T)(I8,I4,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"848888_4")) { + typedef I4 (*T)(I8,I4,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"884444_4")) { + typedef I4 (*T)(I8,I8,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"884448_4")) { + typedef I4 (*T)(I8,I8,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"884484_4")) { + typedef I4 (*T)(I8,I8,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"884488_4")) { + typedef I4 (*T)(I8,I8,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"884844_4")) { + typedef I4 (*T)(I8,I8,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"884848_4")) { + typedef I4 (*T)(I8,I8,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"884884_4")) { + typedef I4 (*T)(I8,I8,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"884888_4")) { + typedef I4 (*T)(I8,I8,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"888444_4")) { + typedef I4 (*T)(I8,I8,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"888448_4")) { + typedef I4 (*T)(I8,I8,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"888484_4")) { + typedef I4 (*T)(I8,I8,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"888488_4")) { + typedef I4 (*T)(I8,I8,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"888844_4")) { + typedef I4 (*T)(I8,I8,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"888848_4")) { + typedef I4 (*T)(I8,I8,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"888884_4")) { + typedef I4 (*T)(I8,I8,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"888888_4")) { + typedef I4 (*T)(I8,I8,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"444444_8")) { + typedef I8 (*T)(I4,I4,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"444448_8")) { + typedef I8 (*T)(I4,I4,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"444484_8")) { + typedef I8 (*T)(I4,I4,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"444488_8")) { + typedef I8 (*T)(I4,I4,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"444844_8")) { + typedef I8 (*T)(I4,I4,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"444848_8")) { + typedef I8 (*T)(I4,I4,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"444884_8")) { + typedef I8 (*T)(I4,I4,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"444888_8")) { + typedef I8 (*T)(I4,I4,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"448444_8")) { + typedef I8 (*T)(I4,I4,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"448448_8")) { + typedef I8 (*T)(I4,I4,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"448484_8")) { + typedef I8 (*T)(I4,I4,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"448488_8")) { + typedef I8 (*T)(I4,I4,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"448844_8")) { + typedef I8 (*T)(I4,I4,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"448848_8")) { + typedef I8 (*T)(I4,I4,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"448884_8")) { + typedef I8 (*T)(I4,I4,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"448888_8")) { + typedef I8 (*T)(I4,I4,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"484444_8")) { + typedef I8 (*T)(I4,I8,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"484448_8")) { + typedef I8 (*T)(I4,I8,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"484484_8")) { + typedef I8 (*T)(I4,I8,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"484488_8")) { + typedef I8 (*T)(I4,I8,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"484844_8")) { + typedef I8 (*T)(I4,I8,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"484848_8")) { + typedef I8 (*T)(I4,I8,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"484884_8")) { + typedef I8 (*T)(I4,I8,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"484888_8")) { + typedef I8 (*T)(I4,I8,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"488444_8")) { + typedef I8 (*T)(I4,I8,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"488448_8")) { + typedef I8 (*T)(I4,I8,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"488484_8")) { + typedef I8 (*T)(I4,I8,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"488488_8")) { + typedef I8 (*T)(I4,I8,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"488844_8")) { + typedef I8 (*T)(I4,I8,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"488848_8")) { + typedef I8 (*T)(I4,I8,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"488884_8")) { + typedef I8 (*T)(I4,I8,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"488888_8")) { + typedef I8 (*T)(I4,I8,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"844444_8")) { + typedef I8 (*T)(I8,I4,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"844448_8")) { + typedef I8 (*T)(I8,I4,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"844484_8")) { + typedef I8 (*T)(I8,I4,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"844488_8")) { + typedef I8 (*T)(I8,I4,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"844844_8")) { + typedef I8 (*T)(I8,I4,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"844848_8")) { + typedef I8 (*T)(I8,I4,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"844884_8")) { + typedef I8 (*T)(I8,I4,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"844888_8")) { + typedef I8 (*T)(I8,I4,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"848444_8")) { + typedef I8 (*T)(I8,I4,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"848448_8")) { + typedef I8 (*T)(I8,I4,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"848484_8")) { + typedef I8 (*T)(I8,I4,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"848488_8")) { + typedef I8 (*T)(I8,I4,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"848844_8")) { + typedef I8 (*T)(I8,I4,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"848848_8")) { + typedef I8 (*T)(I8,I4,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"848884_8")) { + typedef I8 (*T)(I8,I4,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"848888_8")) { + typedef I8 (*T)(I8,I4,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"884444_8")) { + typedef I8 (*T)(I8,I8,I4,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"884448_8")) { + typedef I8 (*T)(I8,I8,I4,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"884484_8")) { + typedef I8 (*T)(I8,I8,I4,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"884488_8")) { + typedef I8 (*T)(I8,I8,I4,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"884844_8")) { + typedef I8 (*T)(I8,I8,I4,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"884848_8")) { + typedef I8 (*T)(I8,I8,I4,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"884884_8")) { + typedef I8 (*T)(I8,I8,I4,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"884888_8")) { + typedef I8 (*T)(I8,I8,I4,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"888444_8")) { + typedef I8 (*T)(I8,I8,I8,I4,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"888448_8")) { + typedef I8 (*T)(I8,I8,I8,I4,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"888484_8")) { + typedef I8 (*T)(I8,I8,I8,I4,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"888488_8")) { + typedef I8 (*T)(I8,I8,I8,I4,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); + }; + if (!strcmp(sigTest,"888844_8")) { + typedef I8 (*T)(I8,I8,I8,I8,I4,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); + }; + if (!strcmp(sigTest,"888848_8")) { + typedef I8 (*T)(I8,I8,I8,I8,I4,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); + }; + if (!strcmp(sigTest,"888884_8")) { + typedef I8 (*T)(I8,I8,I8,I8,I8,I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); + }; + if (!strcmp(sigTest,"888888_8")) { + typedef I8 (*T)(I8,I8,I8,I8,I8,I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); + }; + break; + } + default: + g_assert_not_reached(); + } } - if (save_last_error) mono_marshal_set_last_error (); From dab6a8a11d796ff19d1e679b7e1b240e3c9bd469 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 29 Jul 2025 17:06:43 +0100 Subject: [PATCH 131/209] Update IntPtr arg set/get --- src/mono/browser/runtime/marshal.ts | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/mono/browser/runtime/marshal.ts b/src/mono/browser/runtime/marshal.ts index 8d86b86c27537d..3b23dd364ac599 100644 --- a/src/mono/browser/runtime/marshal.ts +++ b/src/mono/browser/runtime/marshal.ts @@ -97,13 +97,13 @@ export function is_receiver_should_free (args: JSMarshalerArguments): boolean { export function get_sync_done_semaphore_ptr (args: JSMarshalerArguments): VoidPtr { if (!WasmEnableThreads) return VoidPtrNull; mono_assert(args, "Null args"); - return getI32(add_offset(args, JSMarshalerArgumentOffsets.SyncDoneSemaphorePtr)) as any; + return get_arg_handle(args, JSMarshalerArgumentOffsets.SyncDoneSemaphorePtr) as any; } export function get_caller_native_tid (args: JSMarshalerArguments): PThreadPtr { if (!WasmEnableThreads) return PThreadPtrNull; mono_assert(args, "Null args"); - return getI32(add_offset(args, JSMarshalerArgumentOffsets.CallerNativeTID)) as any; + return get_arg_handle(args, JSMarshalerArgumentOffsets.CallerNativeTID) as any; } export function set_receiver_should_free (args: JSMarshalerArguments): void { @@ -368,42 +368,34 @@ function set_arg_handle (arg: JSMarshalerArgument, offset: number, handle: JSHan } } -function get_arg_handle (arg: JSMarshalerArgument | JSMarshalerArguments, offset: number): GCHandle | JSHandle | undefined { +function get_arg_handle (arg: JSMarshalerArgument | JSMarshalerArguments, offset: JSMarshalerArgumentOffsets): GCHandle | JSHandle | undefined { return isWasm64 ? getI64Big(add_offset(arg, offset)) as any : getI32(add_offset(arg, offset)) as any; } export function get_arg_js_handle (arg: JSMarshalerArgument): JSHandle { mono_assert(arg, "Null arg"); - return getI32(add_offset(arg, JSMarshalerArgumentOffsets.JSHandle)) as any; + return get_arg_handle(arg, JSMarshalerArgumentOffsets.JSHandle) as any; + //return getI32(add_offset(arg, JSMarshalerArgumentOffsets.JSHandle)) as any; } export function set_arg_proxy_context (arg: JSMarshalerArgument): void { if (!WasmEnableThreads) return; mono_assert(arg, "Null arg"); - - if (isWasm64) { - if (typeof runtimeHelpers.proxyGCHandle !== "bigint") - setI64Big(add_offset(arg, JSMarshalerArgumentOffsets.ContextHandle), BigInt(runtimeHelpers.proxyGCHandle as any as number)); - else - setI64Big(add_offset(arg, JSMarshalerArgumentOffsets.ContextHandle), runtimeHelpers.proxyGCHandle as bigint); - } else { - setI32(add_offset(arg, JSMarshalerArgumentOffsets.ContextHandle), runtimeHelpers.proxyGCHandle as any); - } + set_arg_handle(arg, JSMarshalerArgumentOffsets.ContextHandle, runtimeHelpers.proxyGCHandle); } export function set_js_handle (arg: JSMarshalerArgument, jsHandle: JSHandle): void { mono_assert(arg, "Null arg"); - setI32(add_offset(arg, JSMarshalerArgumentOffsets.JSHandle), jsHandle as any); + set_arg_handle(arg, JSMarshalerArgumentOffsets.JSHandle, jsHandle); set_arg_proxy_context(arg); } export function get_arg_gc_handle (arg: JSMarshalerArgument): GCHandle { mono_assert(arg, "Null arg"); - return isWasm64 ? getI64Big(add_offset(arg, JSMarshalerArgumentOffsets.GCHandle)) as any : getI32(add_offset(arg, JSMarshalerArgumentOffsets.GCHandle)) as any; + return get_arg_handle(arg, JSMarshalerArgumentOffsets.GCHandle) as any; } export function set_gc_handle (arg: JSMarshalerArgument, gcHandle: GCHandle): void { mono_assert(arg, "Null arg"); - mono_log_debug(`set_gc_handle(${arg}, ${gcHandle}) at offset ${JSMarshalerArgumentOffsets.GCHandle}`); set_arg_handle(arg, JSMarshalerArgumentOffsets.GCHandle, gcHandle); set_arg_proxy_context(arg); } From da7f99e045d6c73febb6637a588d76ef20f78b6e Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 29 Jul 2025 17:07:32 +0100 Subject: [PATCH 132/209] Reverts to delayed meaning resolution Reverts the change that immediately resolved the "meaning" promise. This change reinstates the original behavior of delaying the resolution by 100ms using `setTimeout`. --- src/mono/sample/wasm/browser-advanced/main.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mono/sample/wasm/browser-advanced/main.js b/src/mono/sample/wasm/browser-advanced/main.js index d9732c351a9a34..5576cfb320bae9 100644 --- a/src/mono/sample/wasm/browser-advanced/main.js +++ b/src/mono/sample/wasm/browser-advanced/main.js @@ -110,11 +110,11 @@ try { document.getElementById("out").innerHTML = `${meaning} as computed on dotnet ver ${runtimeBuildInfo.productVersion}`; } //exports.Sample.Test.SimpleTestFunctionPrintString(); - //const deepMeaning = new Promise(resolve => setTimeout(() => resolve(meaning), 100)); - console.clear(); - const deepMeaning = new Promise(resolve => { - resolve(meaning); - }); + const deepMeaning = new Promise(resolve => setTimeout(() => resolve(meaning), 100)); + + //const deepMeaning = new Promise(resolve => { + // resolve(meaning); + //}); exports.Sample.Test.PrintMeaning(deepMeaning); //exports.Sample.Test.PrintMeaningDEBUG(meaning); exports.Sample.Test.SillyLoop(); From ae9cdfb60cc89b5b5bbdadb45d7cf28713e4aba6 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 29 Jul 2025 17:07:44 +0100 Subject: [PATCH 133/209] Comments out interpreter debug logging This commit comments out a debug logging statement in the interpreter to reduce noise during debugging sessions. The logging statement was printing the name and signature of native methods being called, but this information is often not needed and can clutter the logs. --- src/mono/mono/mini/interp/interp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index 24009cea59ce74..d9ff395f899c0b 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -4190,8 +4190,8 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause /* for calls, have ip pointing at the start of next instruction */ frame->state.ip = ip + 8; - if (imethod->method) - MH_LOG ("Calling native method %s with signature %s\n", mono_method_full_name (imethod->method, TRUE), mono_signature_full_name (csignature)); + /*if (imethod->method) + MH_LOG ("Calling native method %s with signature %s\n", mono_method_full_name (imethod->method, TRUE), mono_signature_full_name (csignature));*/ ves_pinvoke_method (imethod, csignature, (MonoFuncV)code, context, frame, (stackval*)(locals + ip [1]), (stackval*)(locals + ip [3]), save_last_error, cache, &gc_transitions); EXCEPTION_CHECKPOINT; CHECK_RESUME_STATE (context); From 7d8818e25b581f489891f8ba0304a57ce030c113 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 31 Jul 2025 16:36:33 +0100 Subject: [PATCH 134/209] Remove test class Used to isolate IntPtr problem and now causing issues with test building (incompat issues) --- src/libraries/System.Runtime/ref/System.Runtime.cs | 7 +------ .../src/System/RuntimeType.Mono.cs | 13 +------------ src/mono/sample/wasm/browser-advanced/Program.cs | 2 +- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index e47712404b49fc..54037383e6a5e1 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -42,12 +42,7 @@ public SafeWaitHandle(System.IntPtr existingHandle, bool ownsHandle) : base (def } } namespace System -{ - public partial class MHTestClass - { - public static IntPtr RunTestArray() { return 0;} - public static IntPtr RunTestArrayRaw() { return 0; } - } +{ public partial class AccessViolationException : System.SystemException { public AccessViolationException() { } diff --git a/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs b/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs index 57418934b214dd..4ab875e945d795 100644 --- a/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs @@ -39,18 +39,7 @@ internal enum TypeNameFormatFlags FormatGenericParam | FormatFullInst } - - public partial class MHTestClass - { - public static IntPtr RunTestArray() - { - return RuntimeType.TestArray(); - } - public static IntPtr RunTestArrayRaw() - { - return RuntimeType.TestArrayRaw(); - } - } + internal unsafe partial class RuntimeType { #region Definitions diff --git a/src/mono/sample/wasm/browser-advanced/Program.cs b/src/mono/sample/wasm/browser-advanced/Program.cs index dfe99262bee4ad..9be6be8f4fa509 100644 --- a/src/mono/sample/wasm/browser-advanced/Program.cs +++ b/src/mono/sample/wasm/browser-advanced/Program.cs @@ -97,7 +97,7 @@ internal static bool SimpleTestConsole() internal static void SimpleTestArray() { - var arrayPtr = System.MHTestClass.RunTestArray(); + //var arrayPtr = System.MHTestClass.RunTestArray(); //var arrayPtr = System.MHTestClass.RunTestArrayRaw(); //var h = new Mono.SafeGPtrArrayHandle(arrayPtr); From 16de776c13cd60a44eec63ec40df35dcb65c6d31 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 5 Aug 2025 18:00:10 +0100 Subject: [PATCH 135/209] Updates to roots.ts for wasm64 --- .../src/System/RuntimeType.Mono.cs | 5 +- src/mono/browser/runtime/roots.ts | 70 ++++++++++++++++--- src/mono/browser/runtime/types/internal.ts | 2 + 3 files changed, 63 insertions(+), 14 deletions(-) diff --git a/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs b/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs index 4ab875e945d795..bfaba793abdb96 100644 --- a/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs @@ -39,7 +39,7 @@ internal enum TypeNameFormatFlags FormatGenericParam | FormatFullInst } - + internal unsafe partial class RuntimeType { #region Definitions @@ -2198,14 +2198,13 @@ public static IntPtr TestArray() //var h = new Mono.SafeGPtrArrayHandle(result); //var h = new Mono.RuntimeGPtrArrayHandle(result); RuntimeStructs.GPtrArray* myData = (RuntimeStructs.GPtrArray*)result; - IntPtr* data = myData->data; long idx = 0x1; var a = data[idx]; var b = data[idx]; var c = data[idx]; - + var sum = c + a; IntPtr[] array = new IntPtr[6]; diff --git a/src/mono/browser/runtime/roots.ts b/src/mono/browser/runtime/roots.ts index e6d6a9cf70f011..9ba7938aa6c364 100644 --- a/src/mono/browser/runtime/roots.ts +++ b/src/mono/browser/runtime/roots.ts @@ -7,7 +7,7 @@ import cwraps from "./cwraps"; import { mono_assert, runtimeHelpers } from "./globals"; import { VoidPtr, ManagedPointer, NativePointer } from "./types/emscripten"; import { MonoObjectRef, MonoObjectRefNull, MonoObject, is_nullish, WasmRoot, WasmRootBuffer } from "./types/internal"; -import { _zero_region, free, localHeapViewU32, malloc } from "./memory"; +import { _zero_region, free, localHeapViewU32, localHeapViewI64Big, malloc } from "./memory"; import { gc_locked } from "./gc-lock"; const maxScratchRoots = 8192; @@ -16,6 +16,7 @@ let _scratch_root_free_indices: Int32Array | null = null; let _scratch_root_free_indices_count = 0; const _scratch_root_free_instances: WasmRoot[] = []; const _external_root_free_instances: WasmExternalRoot[] = []; +// FIXME: set this based on wasm64 / wasm32 build const ptrSize = 8; /** @@ -166,14 +167,22 @@ export class WasmRootBufferImpl implements WasmRootBuffer { private length: number; private __offset: VoidPtr; private __offset32: number; + private __offset64: bigint; private __handle: number; private __ownsAllocation: boolean; constructor (offset: VoidPtr, capacity: number, ownsAllocation: boolean, name?: string) { - const capacityBytes = capacity * 4; + const capacityBytes = capacity * ptrSize; this.__offset = offset; this.__offset32 = offset >>> 2; + if (typeof offset === "bigint") { + this.__offset64 = offset >> 3n; + } else if (typeof offset === "number") { + this.__offset64 = BigInt(offset) >> 3n; + } else { + throw new Error("Invalid offset type: " + typeof offset); + } this.__count = capacity; this.length = capacity; mono_assert(!WasmEnableThreads || !gc_locked, "GC must not be locked when creating a GC root"); @@ -200,13 +209,23 @@ export class WasmRootBufferImpl implements WasmRootBuffer { return this.__offset32 + index; } + get_address_64 (index: number): bigint { + this._check_in_range(index); + return this.__offset64 + BigInt(index); + } + // NOTE: These functions do not use the helpers from memory.ts because WasmRoot.get and WasmRoot.set // are hot-spots when you profile any application that uses the bindings extensively. get (index: number): ManagedPointer { this._check_in_range(index); - const offset = this.get_address_32(index); - return localHeapViewU32()[offset]; + if (ptrSize != 8) { + const offset = this.get_address_32(index); + return localHeapViewU32()[offset]; + } else { + const offset = this.get_address_64(index); + return localHeapViewI64Big()[Number(offset)]; + } } set (index: number, value: ManagedPointer): ManagedPointer { @@ -220,8 +239,11 @@ export class WasmRootBufferImpl implements WasmRootBuffer { cwraps.mono_wasm_copy_managed_pointer(destinationAddress, sourceAddress); } - _unsafe_get (index: number): number { - return localHeapViewU32()[this.__offset32 + index]; + _unsafe_get (index: number): number | bigint { + if (ptrSize === 8) + return localHeapViewI64Big()[Number(this.__offset64 + BigInt(index))]; + else + return localHeapViewU32()[this.__offset32 + index]; } _unsafe_set (index: number, value: ManagedPointer | NativePointer): void { @@ -243,6 +265,7 @@ export class WasmRootBufferImpl implements WasmRootBuffer { } this.__handle = (this.__offset) = this.__count = this.__offset32 = 0; + this.__offset64 = 0n; } toString (): string { @@ -266,6 +289,9 @@ class WasmJsOwnedRoot implements WasmRoot { get_address_32 (): number { return this.__buffer.get_address_32(this.__index); } + get_address_64 (): bigint { + return this.__buffer.get_address_64(this.__index); + } get address (): MonoObjectRef { return this.__buffer.get_address(this.__index); @@ -319,8 +345,13 @@ class WasmJsOwnedRoot implements WasmRoot { clear (): void { // .set performs an expensive write barrier, and that is not necessary in most cases // for clear since clearing a root cannot cause new objects to survive a GC - const address32 = this.__buffer.get_address_32(this.__index); - localHeapViewU32()[address32] = 0; + if (ptrSize === 8) { + const address64 = this.__buffer.get_address_64(this.__index); + localHeapViewI64Big()[Number(address64)] = 0n; + } else { + const address32 = this.__buffer.get_address_32(this.__index); + localHeapViewU32()[address32] = 0; + } } release (): void { @@ -346,6 +377,7 @@ class WasmJsOwnedRoot implements WasmRoot { class WasmExternalRoot implements WasmRoot { private __external_address: MonoObjectRef = MonoObjectRefNull; private __external_address_32: number = 0; + private __external_address_64: bigint = 0n; constructor (address: NativePointer | ManagedPointer) { this._set_address(address); @@ -354,6 +386,10 @@ class WasmExternalRoot implements WasmRoot { _set_address (address: NativePointer | ManagedPointer): void { this.__external_address = address; this.__external_address_32 = address >>> 2; + if (typeof address === "bigint") + this.__external_address_64 = address >> 3n; + else + this.__external_address_64 = BigInt(address) >> 3n; } get address (): MonoObjectRef { @@ -368,9 +404,18 @@ class WasmExternalRoot implements WasmRoot { return this.__external_address_32; } + get_address_64 (): bigint { + return this.__external_address_64; + } + get (): T { - const result = localHeapViewU32()[this.__external_address_32]; - return result; + if (ptrSize === 8) { // wasm64) + const result = localHeapViewI64Big()[Number(this.__external_address_64)]; + return result; + } else { + const result = localHeapViewU32()[this.__external_address_32]; + return result; + } } set (value: T): T { @@ -415,7 +460,10 @@ class WasmExternalRoot implements WasmRoot { clear (): void { // .set performs an expensive write barrier, and that is not necessary in most cases // for clear since clearing a root cannot cause new objects to survive a GC - localHeapViewU32()[this.__external_address >>> 2] = 0; + if (ptrSize === 8) + localHeapViewI64Big()[Number(this.__external_address_64)] = 0n; + else + localHeapViewU32()[this.__external_address >>> 2] = 0; } release (): void { diff --git a/src/mono/browser/runtime/types/internal.ts b/src/mono/browser/runtime/types/internal.ts index 074744f0a18a4a..44508232d22f8d 100644 --- a/src/mono/browser/runtime/types/internal.ts +++ b/src/mono/browser/runtime/types/internal.ts @@ -409,6 +409,7 @@ export type NumberOrPointer = number | VoidPtr | NativePointer | ManagedPointer; export interface WasmRoot { get_address(): MonoObjectRef; get_address_32(): number; + get_address_64(): bigint; get address(): MonoObjectRef; get(): T; set(value: T): T; @@ -427,6 +428,7 @@ export interface WasmRoot { export interface WasmRootBuffer { get_address(index: number): MonoObjectRef get_address_32(index: number): number + get_address_64(index: number): bigint get(index: number): ManagedPointer set(index: number, value: ManagedPointer): ManagedPointer copy_value_from_address(index: number, sourceAddress: MonoObjectRef): void From cddf56dfc326ce3ad0a81b3a0fda0765d4a9c4ab Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 5 Aug 2025 20:27:43 +0100 Subject: [PATCH 136/209] Pass the string length, not the end of the buffer --- src/mono/browser/runtime/strings.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mono/browser/runtime/strings.ts b/src/mono/browser/runtime/strings.ts index 63b8558b75540c..aff493ba38d3d5 100644 --- a/src/mono/browser/runtime/strings.ts +++ b/src/mono/browser/runtime/strings.ts @@ -301,7 +301,8 @@ function stringToMonoStringNewRoot (string: string, result: WasmRoot ? buffer as any as number + bufferLen : (buffer as any as number) + bufferLen; stringToUTF16(buffer as any, bufferEnd as any, string); - cwraps.mono_wasm_string_from_utf16_ref(buffer as any, bufferEnd as any, result.address); + // this function takes the length, not the end pointer + cwraps.mono_wasm_string_from_utf16_ref(buffer as any, bufferLen as any, result.address); free(buffer); } From 410011cee518c07e75aa88cb3ad97a52d2de6353 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 5 Aug 2025 23:21:43 +0100 Subject: [PATCH 137/209] Use string length, not buffer length --- src/mono/browser/runtime/strings.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/browser/runtime/strings.ts b/src/mono/browser/runtime/strings.ts index aff493ba38d3d5..da5a870ce0d39b 100644 --- a/src/mono/browser/runtime/strings.ts +++ b/src/mono/browser/runtime/strings.ts @@ -302,7 +302,7 @@ function stringToMonoStringNewRoot (string: string, result: WasmRoot : (buffer as any as number) + bufferLen; stringToUTF16(buffer as any, bufferEnd as any, string); // this function takes the length, not the end pointer - cwraps.mono_wasm_string_from_utf16_ref(buffer as any, bufferLen as any, result.address); + cwraps.mono_wasm_string_from_utf16_ref(buffer as any, string.length, result.address); free(buffer); } From 8a1b70a90ff117b8bd8cd72a30dbdfe148088a6d Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 6 Aug 2025 13:31:18 +0100 Subject: [PATCH 138/209] Set CMAKE_C_FLAGS to include CONFIGURATION_EMCC_FLAGS This may not be necessary --- src/mono/browser/runtime/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mono/browser/runtime/CMakeLists.txt b/src/mono/browser/runtime/CMakeLists.txt index c0a82970c2cadd..3e609b1c9a6ec8 100644 --- a/src/mono/browser/runtime/CMakeLists.txt +++ b/src/mono/browser/runtime/CMakeLists.txt @@ -51,6 +51,9 @@ if(CMAKE_BUILD_TYPE STREQUAL "Release") COMMENT "Stripping debug symbols from dotnet.native.wasm using wasm-opt") endif() - +if(CONFIGURATION_EMCC_FLAGS) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CONFIGURATION_EMCC_FLAGS}") +endif() +message(STATUS "CONFIGURE CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}") check_type_size("void*" SIZEOF_VOID_P) configure_file(wasm-config.h.in include/wasm/wasm-config.h) From 8f4f4a1654506029b4b6bd626f494de36c0d42e8 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 6 Aug 2025 13:32:18 +0100 Subject: [PATCH 139/209] Remove hardcoded SIZEOF_VOID_P --- src/mono/browser/runtime/driver.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/mono/browser/runtime/driver.c b/src/mono/browser/runtime/driver.c index 76fb137a81e5bd..1e63e9053d7530 100644 --- a/src/mono/browser/runtime/driver.c +++ b/src/mono/browser/runtime/driver.c @@ -75,11 +75,6 @@ wasm_trace_logger (const char *log_domain, const char *log_level, const char *me if (fatal) exit (1); } -//TOOD: HACK -#ifdef SIZEOF_VOID_P -#undef SIZEOF_VOID_P -#endif -#define SIZEOF_VOID_P 8 #ifndef SIZEOF_VOID_P #pragma message ("MRH_LOGGING_DRIVER: SIZEOF_VOID_P is undefined in driver.c") From 4aae68bfef122294d0a9fa423bec71f7be71102c Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 6 Aug 2025 13:37:40 +0100 Subject: [PATCH 140/209] Temporary error out if wrong pointer size --- src/mono/browser/runtime/corebindings.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mono/browser/runtime/corebindings.c b/src/mono/browser/runtime/corebindings.c index 40de61603a6356..403402dbb9fda6 100644 --- a/src/mono/browser/runtime/corebindings.c +++ b/src/mono/browser/runtime/corebindings.c @@ -24,6 +24,7 @@ #if SIZEOF_VOID_P == 4 typedef int32_t cb_handle; +#error "Unexpected 32-bit pointer size. This code expects 64-bit pointers." #else typedef int64_t cb_handle; #endif From 8a5ab8700951005354e591f90c14e8cb082001b7 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 7 Aug 2025 15:15:44 +0100 Subject: [PATCH 141/209] Debug logging Adds some, removes some --- src/mono/browser/runtime/driver.c | 16 +++++++++++----- .../browser/runtime/loader/assetsCache.ts | 2 ++ src/mono/browser/runtime/runtime.c | 6 +++--- src/mono/mono/metadata/appdomain.c | 19 +++++++------------ src/mono/mono/mini/interp/interp-icalls.c | 1 + src/mono/mono/mini/interp/interp.c | 8 ++++---- src/mono/mono/utils/mono-threads-wasm.c | 6 +++--- src/native/public/mono/metadata/mh_log.h | 14 +++++++++++++- 8 files changed, 44 insertions(+), 28 deletions(-) diff --git a/src/mono/browser/runtime/driver.c b/src/mono/browser/runtime/driver.c index 1e63e9053d7530..54ef1b226a648e 100644 --- a/src/mono/browser/runtime/driver.c +++ b/src/mono/browser/runtime/driver.c @@ -13,6 +13,7 @@ #include #include + #include #include #include @@ -24,6 +25,7 @@ #include #include #include + // FIXME: unavailable in emscripten // #include @@ -160,9 +162,7 @@ mono_wasm_add_assembly (const char *name, const unsigned char *data, unsigned in return 1; } char *assembly_name = strdup (name); - assert (assembly_name); - printf("Calling mono_bundled_resources_add_assembly_resource for %s, size %u\n", name, size); - fflush(stdout); + assert (assembly_name); mono_bundled_resources_add_assembly_resource (assembly_name, assembly_name, data, size, bundled_resources_free_func, assembly_name); return mono_has_pdb_checksum ((char*)data, size); } @@ -387,6 +387,10 @@ mono_wasm_string_from_utf16_ref (const mono_unichar2 * chars, int length, MonoSt mono_gc_wbarrier_generic_store_atomic(result, NULL); } MONO_EXIT_GC_UNSAFE; + //FIXME: debug only + MH_LOG("Input length %d, result length: %d", length, mono_string_length(*result)); + char* charString = mono_string_to_utf8(*result); + MH_LOG("Converted string with length %d to: %s", length, charString); } EMSCRIPTEN_KEEPALIVE int @@ -416,8 +420,10 @@ mono_wasm_set_main_args (int argc, char* argv[]) EMSCRIPTEN_KEEPALIVE d_handle mono_wasm_strdup (const char *s) { - MH_LOG("duplicating %s", s); - return (d_handle)strdup (s); + MH_LOG("duplicating: %s (%p)", s, s); + char* result = strdup(s); + MH_LOG("duplicated: %s (%p)", result, result); + return (d_handle)result; } EMSCRIPTEN_KEEPALIVE void diff --git a/src/mono/browser/runtime/loader/assetsCache.ts b/src/mono/browser/runtime/loader/assetsCache.ts index 1be22cfdd1fde5..1b5e3b9c90aa10 100644 --- a/src/mono/browser/runtime/loader/assetsCache.ts +++ b/src/mono/browser/runtime/loader/assetsCache.ts @@ -4,6 +4,7 @@ import type { MonoConfig } from "../types"; import type { AssetEntryInternal } from "../types/internal"; import { ENVIRONMENT_IS_WEB, loaderHelpers } from "./globals"; +import { mono_log_debug } from "./logging"; const usedCacheKeys: { [key: string]: boolean } = {}; const networkLoads: { [name: string]: LoadLogEntry } = {}; @@ -59,6 +60,7 @@ export async function purgeUnusedCacheEntriesAsync (): Promise { const cachedRequests = await cache.keys(); const deletionPromises = cachedRequests.map(async cachedRequest => { if (!(cachedRequest.url in usedCacheKeys)) { + mono_log_debug(`Purging unused cache entry: ${cachedRequest.url}`); await cache.delete(cachedRequest); } }); diff --git a/src/mono/browser/runtime/runtime.c b/src/mono/browser/runtime/runtime.c index c8824b6765274c..09521464bc041d 100644 --- a/src/mono/browser/runtime/runtime.c +++ b/src/mono/browser/runtime/runtime.c @@ -344,10 +344,10 @@ mono_wasm_load_runtime_common (int debug_level, MonoLogCallback log_callback, co interp_opts = "-all"; mono_wasm_enable_debugging (debug_level); } -#endif - printf("about to init_icall_table\n"); +#endif init_icall_table (); - + const bool check_symbol_lookup = false; + if(check_symbol_lookup) { printf("Checking mono_lookup_icall_symbol_internal\n"); const char *p = mono_lookup_icall_symbol_internal (mono_lookup_icall_symbol_internal); diff --git a/src/mono/mono/metadata/appdomain.c b/src/mono/mono/metadata/appdomain.c index 40c5f4e301890d..ca54b9bf979254 100644 --- a/src/mono/mono/metadata/appdomain.c +++ b/src/mono/mono/metadata/appdomain.c @@ -235,8 +235,7 @@ mono_runtime_init (MonoDomain *domain, MonoThreadStartCB start_cb, MonoThreadAtt void mono_runtime_init_checked (MonoDomain *domain, MonoThreadStartCB start_cb, MonoThreadAttachCB attach_cb, MonoError *error) -{ - printf("MH_NATIVE_LOG: calling HANDLE_FUNCTION_ENTER\n");fflush(stdout); +{ HANDLE_FUNCTION_ENTER (); MonoAppDomainHandle ad; @@ -246,14 +245,12 @@ mono_runtime_init_checked (MonoDomain *domain, MonoThreadStartCB start_cb, MonoT mono_gc_base_init (); mono_monitor_init (); mono_marshal_init (); - mono_gc_init_icalls (); - printf("MH_NATIVE_LOG: calling mono_install_assembly_preload_hook_v2\n");fflush(stdout); + mono_gc_init_icalls (); // We have to append here because otherwise this will run before the netcore hook (which is installed first), see https://github.com/dotnet/runtime/issues/34273 mono_install_assembly_preload_hook_v2 (mono_domain_assembly_preload, GUINT_TO_POINTER (FALSE), TRUE); mono_install_assembly_search_hook_v2 (mono_domain_assembly_search, GUINT_TO_POINTER (FALSE), FALSE, FALSE); mono_install_assembly_search_hook_v2 (mono_domain_assembly_postload_search, GUINT_TO_POINTER (FALSE), TRUE, FALSE); - mono_install_assembly_load_hook_v2 (mono_domain_fire_assembly_load, NULL, FALSE); - printf("MH_NATIVE_LOG: calling mono_thread_init\n");fflush(stdout); + mono_install_assembly_load_hook_v2 (mono_domain_fire_assembly_load, NULL, FALSE); mono_thread_init (start_cb, attach_cb); if (!mono_runtime_get_no_exec ()) { @@ -278,9 +275,9 @@ mono_runtime_init_checked (MonoDomain *domain, MonoThreadStartCB start_cb, MonoT mono_component_event_pipe ()->add_rundown_execution_checkpoint ("RuntimeResumed"); mono_component_event_pipe ()->write_event_ee_startup_start (); - printf("MH_NATIVE_LOG: calling mono_type_initialization_init (%p)\n", &mono_type_initialization_init);fflush(stdout); + mono_type_initialization_init (); - printf("MH_NATIVE_LOG: exited mono_type_initialization_init\n");fflush(stdout); + if (!mono_runtime_get_no_exec ()) create_domain_objects (domain); @@ -292,11 +289,9 @@ mono_runtime_init_checked (MonoDomain *domain, MonoThreadStartCB start_cb, MonoT if (!mono_runtime_get_no_exec ()) mono_runtime_install_appctx_properties (); - mono_locks_tracer_init (); - printf("MH_NATIVE_LOG: calling mono_domain_fire_assembly_load\n");fflush(stdout); + mono_locks_tracer_init (); /* mscorlib is loaded before we install the load hook */ - mono_domain_fire_assembly_load (mono_alc_get_default (), mono_defaults.corlib->assembly, NULL, error); - printf("MH_NATIVE_LOG: exited mono_domain_fire_assembly_load. Error code is %s\n", is_ok(error) ? "ok" : "not ok");fflush(stdout); + mono_domain_fire_assembly_load (mono_alc_get_default (), mono_defaults.corlib->assembly, NULL, error); goto_if_nok (error, exit); exit: diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index 2fc5801e5059d6..92ab9c15bd4bdf 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -278,6 +278,7 @@ do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval log_op(op); // FIXME: this string/cookie comparison is rubbish - use an enum char* sigTest = log_sig(sig); // currently must be called to get the cookie! + MH_LOG("Got signature cookie %s", sigTest); if (!sigTest) { memset(&ret_sp->data, 0, sizeof(stackval)); diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index d9ff395f899c0b..19d7eaa9eafd5b 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -1665,7 +1665,7 @@ ves_pinvoke_method ( gpointer args; MONO_REQ_GC_UNSAFE_MODE; - //MH_LOG("invoking %s", mono_method_full_name(imethod->method, TRUE)); + MH_LOG("invoking %s", mono_method_full_name(imethod->method, TRUE)); #ifdef HOST_WASM /* * Use a per-signature entry function. @@ -2139,7 +2139,7 @@ interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject // method is transformed. context->stack_pointer = (guchar*)(sp + 4); g_assert (context->stack_pointer < context->stack_end); - //MH_LOG("calling mono_interp_exec_method for %s : %s", method->name, mono_method_full_name (method, TRUE)); + MH_LOG("calling mono_interp_exec_method for %s : %s", method->name, mono_method_full_name (method, TRUE)); MONO_ENTER_GC_UNSAFE; mono_interp_exec_method (&frame, context, NULL); MONO_EXIT_GC_UNSAFE; @@ -4190,8 +4190,8 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause /* for calls, have ip pointing at the start of next instruction */ frame->state.ip = ip + 8; - /*if (imethod->method) - MH_LOG ("Calling native method %s with signature %s\n", mono_method_full_name (imethod->method, TRUE), mono_signature_full_name (csignature));*/ + if (imethod->method) + MH_LOG ("Calling native method %s with signature %s\n", mono_method_full_name (imethod->method, TRUE), mono_signature_full_name (csignature)); ves_pinvoke_method (imethod, csignature, (MonoFuncV)code, context, frame, (stackval*)(locals + ip [1]), (stackval*)(locals + ip [3]), save_last_error, cache, &gc_transitions); EXCEPTION_CHECKPOINT; CHECK_RESUME_STATE (context); diff --git a/src/mono/mono/utils/mono-threads-wasm.c b/src/mono/mono/utils/mono-threads-wasm.c index 82a0d40be64833..e02940b047589a 100644 --- a/src/mono/mono/utils/mono-threads-wasm.c +++ b/src/mono/mono/utils/mono-threads-wasm.c @@ -383,13 +383,13 @@ mono_wasm_ds_exec (void) for (cur1 = j1; cur1; cur1 = cur1->next) { DsJobRegistration* reg = (DsJobRegistration*)cur1->data; g_assert (reg->cb); - THREADS_DEBUG ("mono_wasm_ds_exec running job %p \n", (gpointer)cb); + THREADS_DEBUG ("mono_wasm_ds_exec running job %p \n", (gpointer)(reg->cb)); gsize done = reg->cb (reg->data); if (done){ - THREADS_DEBUG ("mono_wasm_ds_exec done job %p \n", (gpointer)cb); + THREADS_DEBUG ("mono_wasm_ds_exec done job %p \n", (gpointer)(reg->cb)); g_free (reg); } else { - THREADS_DEBUG ("mono_wasm_ds_exec scheduling job %p again \n", (gpointer)cb); + THREADS_DEBUG ("mono_wasm_ds_exec scheduling job %p again \n", (gpointer)(reg->cb)); jobs_ds = g_slist_prepend (jobs_ds, (gpointer)reg); } } diff --git a/src/native/public/mono/metadata/mh_log.h b/src/native/public/mono/metadata/mh_log.h index 8bb5b0af1cd14f..5fe192fb99847e 100644 --- a/src/native/public/mono/metadata/mh_log.h +++ b/src/native/public/mono/metadata/mh_log.h @@ -3,10 +3,22 @@ #include static int MH_LOG_indent_level = 0; -#if(0) +#if(1) #define MH_LOG(msg, ...) do { } while (0) #define MH_LOG_INDENT() do { } while (0) #define MH_LOG_UNINDENT() do { } while (0) + +#define MH_LOG_ALWAYS(msg, ...) { \ + printf("MH_FORCED_LOG: "); \ + for (int mh_idx = 0; mh_idx < MH_LOG_indent_level; mh_idx++) { \ + printf(" "); \ + } \ + printf("%s : %s | %d :: ", __func__, __FILE__, __LINE__); \ + printf(msg, ##__VA_ARGS__); \ + printf("\n"); \ + fflush(stdout); \ +} + #else #define MH_LOG(msg, ...) { \ printf("MH_NATIVE_LOG: "); \ From 352b46919174d598cf6ea08567c42b5659ce30a8 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 7 Aug 2025 15:16:19 +0100 Subject: [PATCH 142/209] Explicitly handle bigint type in _set_address --- src/mono/browser/runtime/roots.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/mono/browser/runtime/roots.ts b/src/mono/browser/runtime/roots.ts index 9ba7938aa6c364..1a9168d3d72ad2 100644 --- a/src/mono/browser/runtime/roots.ts +++ b/src/mono/browser/runtime/roots.ts @@ -384,12 +384,15 @@ class WasmExternalRoot implements WasmRoot { } _set_address (address: NativePointer | ManagedPointer): void { - this.__external_address = address; - this.__external_address_32 = address >>> 2; - if (typeof address === "bigint") + if (typeof address === "bigint") { + this.__external_address = Number(address); + this.__external_address_32 = Number(address) >>> 2; this.__external_address_64 = address >> 3n; - else + } else { + this.__external_address = address; + this.__external_address_32 = address >>> 2; this.__external_address_64 = BigInt(address) >> 3n; + } } get address (): MonoObjectRef { From 8ad6e87cf56dbcfa8159ac897c3fb4caf3d4e450 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 8 Aug 2025 15:28:59 +0100 Subject: [PATCH 143/209] Test Project (remove before PR) A copy of the browser-advanced sample, set up to accept code from JS interop tests. Makes debugging a lot more straightforward. Project file update for test sample --- .../browser-test-debug/ILLink.Descriptors.xml | 8 + .../JavaScriptTestHelper.cs | 1384 +++++++++++++++++ .../JavaScriptTestHelper.mjs | 493 ++++++ .../sample/wasm/browser-test-debug/Program.cs | 52 + .../Wasm.Test.Debug.Sample.csproj | 46 + .../advanced-sample.lib.module.js | 10 + .../wasm/browser-test-debug/fibonacci.c | 9 + .../sample/wasm/browser-test-debug/index.html | 24 + .../sample/wasm/browser-test-debug/main.js | 72 + 9 files changed, 2098 insertions(+) create mode 100644 src/mono/sample/wasm/browser-test-debug/ILLink.Descriptors.xml create mode 100644 src/mono/sample/wasm/browser-test-debug/JavaScriptTestHelper.cs create mode 100644 src/mono/sample/wasm/browser-test-debug/JavaScriptTestHelper.mjs create mode 100644 src/mono/sample/wasm/browser-test-debug/Program.cs create mode 100644 src/mono/sample/wasm/browser-test-debug/Wasm.Test.Debug.Sample.csproj create mode 100644 src/mono/sample/wasm/browser-test-debug/advanced-sample.lib.module.js create mode 100644 src/mono/sample/wasm/browser-test-debug/fibonacci.c create mode 100644 src/mono/sample/wasm/browser-test-debug/index.html create mode 100644 src/mono/sample/wasm/browser-test-debug/main.js diff --git a/src/mono/sample/wasm/browser-test-debug/ILLink.Descriptors.xml b/src/mono/sample/wasm/browser-test-debug/ILLink.Descriptors.xml new file mode 100644 index 00000000000000..665eae765f7332 --- /dev/null +++ b/src/mono/sample/wasm/browser-test-debug/ILLink.Descriptors.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/mono/sample/wasm/browser-test-debug/JavaScriptTestHelper.cs b/src/mono/sample/wasm/browser-test-debug/JavaScriptTestHelper.cs new file mode 100644 index 00000000000000..307523270a4027 --- /dev/null +++ b/src/mono/sample/wasm/browser-test-debug/JavaScriptTestHelper.cs @@ -0,0 +1,1384 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using System.IO; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices.Marshalling; +using System.Threading.Tasks; +using System.Xml.Serialization; + +[assembly: DisableRuntimeMarshalling] + +namespace System.Runtime.InteropServices.JavaScript.Tests +{ + public partial class JavaScriptTestHelper + { + [JSImport("globalThis.console.log")] + [return: JSMarshalAs] + public static partial void Log([JSMarshalAs] string message); + + [JSImport("globalThis.window.location.toString")] + public static partial string NativeFunctionToString(); + + [JSImport("globalThis.data.echoMemberMethod")] + public static partial string MemberEcho(string message); + + [JSImport("globalThis.rebound.echoMemberMethod")] + public static partial string ReboundMemberEcho(string message); + + [JSExport] + [return: JSMarshalAs] // this means that the message will arrive out of order, especially across threads. + public static void ConsoleWriteLine([JSMarshalAs] string message) + { + Console.WriteLine(message); + } + + [JSImport("delay", "JavaScriptTestHelper")] + public static partial Task Delay(int ms); + + [JSImport("reject", "JavaScriptTestHelper")] + public static partial Task Reject([JSMarshalAs] object what); + + [JSImport("intentionallyMissingImport", "JavaScriptTestHelper")] + public static partial void IntentionallyMissingImport(); + + [JSImport("intentionallyMissingImportAsync", "JavaScriptTestHelper")] + public static partial Task IntentionallyMissingImportAsync(); + + [JSImport("catch1toString", "JavaScriptTestHelper")] + public static partial string catch1toString(string message, string functionName); + + [JSImport("catch1stack", "JavaScriptTestHelper")] + public static partial string catch1stack(string message, string functionName); + + [JSExport] + public static void ThrowFromJSExport(string message) + { + throw new ArgumentException(message); + } + + [JSExport] + [return: JSMarshalAs] + public static DateTime Now() + { + return DateTime.Now; + } + + // the methods in the region have signature for which we have optimized path in the call marshaler + // it's the combination of number of arguments and void vs result + // see mono_wasm_bind_js_function and mono_wasm_bind_cs_function + #region Optimized + + public static int optimizedReached = 0; + [JSExport] + public static void Optimized0V() + { + optimizedReached++; + } + [JSImport("invoke0V", "JavaScriptTestHelper")] + public static partial void invoke0V(); + + [JSExport] + public static void Optimized1V(int a1) + { + optimizedReached += a1; + } + [JSImport("invoke1V", "JavaScriptTestHelper")] + public static partial void invoke1V(int a1); + + [JSExport] + [return: JSMarshalAs] // this means that the message will arrive out of order, especially across threads. + public static void Optimized1O(int a1) + { + optimizedReached += a1; + } + [JSImport("invoke1O", "JavaScriptTestHelper")] + public static partial void invoke1O(int a1); + + [JSExport] + public static int Optimized1R(int a1) + { + optimizedReached += a1; + return a1 + 1; + } + [JSImport("invoke1R", "JavaScriptTestHelper")] + public static partial int invoke1R(int a1); + + [JSExport] + public static int Optimized2R(int a1, int a2) + { + optimizedReached += a1 + a2; + return a1 + a2 + 1; + } + [JSImport("invoke2R", "JavaScriptTestHelper")] + public static partial int invoke2R(int a1, int a2); + + #endregion + + [JSImport("create_function", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + public static partial Func createMath([JSMarshalAs] string a, [JSMarshalAs] string b, [JSMarshalAs] string code); + + [JSImport("getType1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial string getType1(); + + [JSImport("getClass1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial string getClass1(); + + [JSImport("throw0fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial void throw0(); + + [JSImport("returnError", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial object returnError(); + + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial Task echo1_Task([JSMarshalAs>] Task arg1); + + [JSImport("createException", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial Exception createException([JSMarshalAs] string name); + + [JSImport("createData", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial JSObject createData([JSMarshalAs] string name); + + #region relaxed + [JSImport("dummy", "JavaScriptTestHelper")] + internal static partial void Relaxed(string a1, Exception ex, + bool ab, double a6, byte a2, char a3, short a4, float a5, IntPtr a7, + bool? nab, double? na6, byte? na2, char? na3, short? na4, float? na5, IntPtr? na7, + Task ta1, Task tex, + Task tab, Task ta6, Task ta2, Task ta3, Task ta4, Task ta5, Task ta7, + string[] aa1, byte[] aab, double[] aad, int[] aai + ); + + [JSImport("dummy", "JavaScriptTestHelper")] + internal static partial double RelaxedDouble(); + + [JSImport("dummy", "JavaScriptTestHelper")] + internal static partial string RelaxedString(); + + [JSImport("dummy", "JavaScriptTestHelper")] + internal static partial string[] RelaxedStringArray(); + + [JSImport("dummy", "JavaScriptTestHelper")] + internal static partial Exception RelaxedException(); + + [JSImport("dummy", "JavaScriptTestHelper")] + internal static partial bool RelaxedBool(); + + [JSImport("dummy", "JavaScriptTestHelper")] + internal static partial double? RelaxedNullableDouble(); + + [JSImport("dummy", "JavaScriptTestHelper")] + internal static partial bool? RelaxedNullableBool(); + + [JSImport("dummy", "JavaScriptTestHelper")] + internal static partial Task RelaxedTask(); + + [JSImport("dummy", "JavaScriptTestHelper")] + internal static partial Task RelaxedTaskDouble(); + + [JSImport("dummy", "JavaScriptTestHelper")] + internal static partial Task RelaxedTaskString(); + + [JSImport("dummy", "JavaScriptTestHelper")] + internal static partial Task RelaxedTaskException(); + + [JSImport("dummy", "JavaScriptTestHelper")] + internal static partial Task RelaxedTaskBool(); + + + #endregion + + #region Arrays + + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial byte[]? echo1_ByteArray([JSMarshalAs>] byte[]? value); + + [JSImport("storeAt", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial byte? store_ByteArray([JSMarshalAs>] byte[]? value, [JSMarshalAs] int index); + + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial int[]? echo1_Int32Array([JSMarshalAs>] int[]? value); + + [JSImport("storeAt", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial int? store_Int32Array([JSMarshalAs>] int[]? value, [JSMarshalAs] int index); + + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial double[]? echo1_DoubleArray([JSMarshalAs>] double[]? value); + + [JSImport("storeAt", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial double? store_DoubleArray([JSMarshalAs>] double[]? value, [JSMarshalAs] int index); + + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial string[]? echo1_StringArray([JSMarshalAs>] string[]? value); + + [JSImport("storeAt", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial string? store_StringArray([JSMarshalAs>] string[]? value, [JSMarshalAs] int index); + + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial object[]? echo1_ObjectArray([JSMarshalAs>] object[]? value); + + [JSImport("storeAt", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial object? store_ObjectArray([JSMarshalAs>] object[]? value, [JSMarshalAs] int index); + + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial JSObject[]? echo1_JSObjectArray([JSMarshalAs>] JSObject[]? value); + + [JSImport("storeAt", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial JSObject? store_JSObjectArray([JSMarshalAs>] JSObject[]? value, [JSMarshalAs] int index); + + #endregion + + #region Views + + [JSImport("echo1view", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial Span echo1_SpanOfByte([JSMarshalAs] Span value, [JSMarshalAs] bool edit); + + [JSImport("echo1view", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial Span echo1_SpanOfInt32([JSMarshalAs] Span value, [JSMarshalAs] bool edit); + + [JSImport("echo1view", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial Span echo1_SpanOfDouble([JSMarshalAs] Span value, [JSMarshalAs] bool edit); + + [JSImport("echo1view", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial ArraySegment echo1_ArraySegmentOfByte([JSMarshalAs] ArraySegment value, [JSMarshalAs] bool edit); + + [JSImport("echo1view", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial ArraySegment echo1_ArraySegmentOfInt32([JSMarshalAs] ArraySegment value, [JSMarshalAs] bool edit); + + [JSImport("echo1view", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial ArraySegment echo1_ArraySegmentOfDouble([JSMarshalAs] ArraySegment value, [JSMarshalAs] bool edit); + + #endregion + + #region Int32 + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial int echo1_Int32([JSMarshalAs] int value); + [JSImport("store1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial void store1_Int32([JSMarshalAs] int value); + + [JSImport("store1", "JavaScriptTestHelper")] + [return: JSMarshalAs] // this means that the message will arrive out of order, especially across threads. + internal static partial void store1DiscardNoWait_Int32([JSMarshalAs] int value); + + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial int retrieve1_Int32(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_Int32([JSMarshalAs] int value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial int throw1_Int32([JSMarshalAs] int value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial int invoke1_Int32([JSMarshalAs] int value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public static int EchoInt32([JSMarshalAs] int arg1) + { + return arg1; + } + #endregion Int32 + + #region String + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial string echo1_String([JSMarshalAs] string value); + [JSImport("store1", "JavaScriptTestHelper")] + internal static partial void store1_String([JSMarshalAs] string value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial string retrieve1_String(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_String([JSMarshalAs] string value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial string throw1_String([JSMarshalAs] string value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial string invoke1_String([JSMarshalAs] string value, [JSMarshalAs] string name); + [JSImport("invoke2", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial string invoke2_String([JSMarshalAs] string value, [JSMarshalAs] string name); + [JSImport("invokeStructClassRecords", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial string[] invokeStructClassRecords([JSMarshalAs] string value); + [JSExport] + [return: JSMarshalAs] + public static string EchoString([JSMarshalAs] string arg1) + { + return arg1; + } + + [JSImport("echopromise", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial Task echopromise_String([JSMarshalAs] string value); + #endregion String + + #region Object + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial object echo1_Object([JSMarshalAs] object value); + [JSImport("store1", "JavaScriptTestHelper")] + internal static partial void store1_Object([JSMarshalAs] object value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial object retrieve1_Object(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_Object([JSMarshalAs] object value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial object throw1_Object([JSMarshalAs] object value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial object invoke1_Object([JSMarshalAs] object value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public static object EchoObject([JSMarshalAs] object arg1) + { + return arg1; + } + + [JSImport("echopromise", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial Task echopromise_Object([JSMarshalAs] object value); + #endregion Object + + #region Exception + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial Exception echo1_Exception([JSMarshalAs] Exception value); + [JSImport("store1", "JavaScriptTestHelper")] + internal static partial void store1_Exception([JSMarshalAs] Exception value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial Exception retrieve1_Exception(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_Exception([JSMarshalAs] Exception value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial Exception throw1_Exception([JSMarshalAs] Exception value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial Exception invoke1_Exception([JSMarshalAs] Exception value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public static Exception EchoException([JSMarshalAs] Exception arg1) + { + return arg1; + } + [JSImport("echopromise", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial Task echopromise_Exception([JSMarshalAs] Exception value); + #endregion Exception + + #region Task + [JSImport("awaitvoid", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial Task awaitvoid([JSMarshalAs>] Task arg1); + [JSImport("sleep", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial Task sleep([JSMarshalAs] int ms); + [JSImport("forever", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial Task forever(); + [JSImport("sleep", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial Task sleep_Int([JSMarshalAs] int ms); + + [JSImport("sleep", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial Task? sleepMaybe_Int([JSMarshalAs] int ms); + + [JSImport("await2", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial Task await2([JSMarshalAs>] Task arg1); + + [JSImport("thenvoid", "JavaScriptTestHelper")] + internal static partial void thenvoid([JSMarshalAs>] Task arg1); + + [JSImport("await1", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial Task await1([JSMarshalAs>] Task arg1); + [JSImport("await1", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial Task await1_TaskOfException([JSMarshalAs>] Task arg1); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial Task invoke1_TaskOfObject([JSMarshalAs>] Task value, [JSMarshalAs] string name); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial Task invoke1_TaskOfInt([JSMarshalAs>] Task value, [JSMarshalAs] string name); + + [JSImport("returnResolvedPromise", "JavaScriptTestHelper")] + internal static partial Task ReturnResolvedPromise(); + + [JSImport("invokeReturnCompletedTask", "JavaScriptTestHelper")] + internal static partial Task InvokeReturnCompletedTask(); + + [JSExport] + internal static Task ReturnCompletedTask() + { + return Task.CompletedTask; + } + + [JSExport] + [return: JSMarshalAs>] + public static async Task AwaitTaskOfObject([JSMarshalAs>] Task arg1) + { + var res = await arg1; + return res; + } + + #endregion + + #region Action + Func + + [JSImport("back3", "JavaScriptTestHelper")] + internal static partial void back3_Action([JSMarshalAs] Action action); + + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial Action echo1_ActionAction([JSMarshalAs] Action action); + + [JSImport("echo1large", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial Action echo1large_ActionAction([JSMarshalAs] Action action); + + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial Action echo1_ActionIntActionInt([JSMarshalAs>] Action action); + + [JSImport("backback", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial Func backback_FuncIntFuncInt([JSMarshalAs>] Func fun, [JSMarshalAs] int a); + + [JSImport("backback", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial Func backback_FuncIntIntFuncIntInt([JSMarshalAs>] Func fun, [JSMarshalAs] int a, [JSMarshalAs] int b); + + [JSImport("backbackAsync", "JavaScriptTestHelper")] + internal static partial Task backback_FuncIntIntFuncIntIntAsync([JSMarshalAs>] Func fun, [JSMarshalAs] int a, [JSMarshalAs] int b); + + [JSImport("back3", "JavaScriptTestHelper")] + internal static partial void back3_ActionInt([JSMarshalAs>] Action? action, [JSMarshalAs] int a); + + [JSImport("back3", "JavaScriptTestHelper")] + internal static partial void back3_ActionIntInt([JSMarshalAs>] Action? action, [JSMarshalAs] int a, [JSMarshalAs] int b); + + [JSImport("back3", "JavaScriptTestHelper")] + internal static partial void back3_ActionLongLong([JSMarshalAs>] Action? action, [JSMarshalAs] long a, [JSMarshalAs] long b); + + [JSImport("back3", "JavaScriptTestHelper")] + internal static partial void back3_ActionIntLong([JSMarshalAs>] Action? action, [JSMarshalAs] int a, [JSMarshalAs] long b); + + [JSImport("back3", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial int back3_FunctionIntInt([JSMarshalAs>] Func? fun, [JSMarshalAs] int a); + + [JSImport("back4", "JavaScriptTestHelper")] + internal static partial void back4_ActionIntLongDouble([JSMarshalAs>] Action? action, [JSMarshalAs] int a, [JSMarshalAs] long b, [JSMarshalAs] double c); + + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial Func invoke1_FuncOfIntInt([JSMarshalAs>] Func value, [JSMarshalAs] string name); + + [JSExport] + [return: JSMarshalAs>] + public static Func BackFuncOfIntInt([JSMarshalAs>] Func arg1) + { + return (int a) => + { + return arg1(a); + }; + } + + #endregion + + #region Boolean + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool echo1_Boolean([JSMarshalAs] bool value); + [JSImport("store1", "JavaScriptTestHelper")] + internal static partial void store1_Boolean([JSMarshalAs] bool value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool retrieve1_Boolean(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_Boolean([JSMarshalAs] bool value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool throw1_Boolean([JSMarshalAs] bool value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool invoke1_Boolean([JSMarshalAs] bool value, [JSMarshalAs] string name); + + [JSImport("invoke1Async", "JavaScriptTestHelper")] + internal static partial Task invoke1_BooleanAsync(bool value, string name); + + [JSExport] + [return: JSMarshalAs] + public static bool EchoBoolean([JSMarshalAs] bool arg1) + { + return arg1; + } + #endregion Boolean + + #region Char + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial char echo1_Char([JSMarshalAs] char value); + [JSImport("store1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial void store1_Char([JSMarshalAs] char value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial char retrieve1_Char(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_Char([JSMarshalAs] char value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial char throw1_Char([JSMarshalAs] char value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial char invoke1_Char([JSMarshalAs] char value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public static char EchoChar([JSMarshalAs] char arg1) + { + return arg1; + } + #endregion Byte + + #region Byte + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial byte echo1_Byte([JSMarshalAs] byte value); + [JSImport("store1", "JavaScriptTestHelper")] + internal static partial void store1_Byte([JSMarshalAs] byte value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial byte retrieve1_Byte(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_Byte([JSMarshalAs] byte value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial byte throw1_Byte([JSMarshalAs] byte value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial byte invoke1_Byte([JSMarshalAs] byte value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public static byte EchoByte([JSMarshalAs] byte arg1) + { + return arg1; + } + #endregion Byte + + #region Int16 + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial short echo1_Int16([JSMarshalAs] short value); + [JSImport("store1", "JavaScriptTestHelper")] + internal static partial void store1_Int16([JSMarshalAs] short value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial short retrieve1_Int16(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_Int16([JSMarshalAs] short value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial short throw1_Int16([JSMarshalAs] short value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial short invoke1_Int16([JSMarshalAs] short value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public static short EchoInt16([JSMarshalAs] short arg1) + { + return arg1; + } + #endregion Int16 + + #region Int52 + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial long echo1_Int52([JSMarshalAs] long value); + [JSImport("store1", "JavaScriptTestHelper")] + internal static partial void store1_Int52([JSMarshalAs] long value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial long retrieve1_Int52(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_Int52([JSMarshalAs] long value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial long throw1_Int52([JSMarshalAs] long value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial long invoke1_Int52([JSMarshalAs] long value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public static long EchoInt52([JSMarshalAs] long arg1) + { + return arg1; + } + #endregion Int52 + + #region BigInt64 + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial long echo1_BigInt64([JSMarshalAs] long value); + [JSImport("store1", "JavaScriptTestHelper")] + internal static partial void store1_BigInt64([JSMarshalAs] long value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial long retrieve1_BigInt64(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_BigInt64([JSMarshalAs] long value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial long throw1_BigInt64([JSMarshalAs] long value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial long invoke1_BigInt64([JSMarshalAs] long value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public static long EchoBigInt64([JSMarshalAs] long arg1) + { + return arg1; + } + #endregion BigInt64 + + #region Double + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial double echo1_Double([JSMarshalAs] double value); + [JSImport("store1", "JavaScriptTestHelper")] + internal static partial void store1_Double([JSMarshalAs] double value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial double retrieve1_Double(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_Double([JSMarshalAs] double value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial double throw1_Double([JSMarshalAs] double value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial double invoke1_Double([JSMarshalAs] double value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public static double EchoDouble([JSMarshalAs] double arg1) + { + return arg1; + } + #endregion Double + + #region Single + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial float echo1_Single([JSMarshalAs] float value); + [JSImport("store1", "JavaScriptTestHelper")] + internal static partial void store1_Single([JSMarshalAs] float value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial float retrieve1_Single(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_Single([JSMarshalAs] float value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial float throw1_Single([JSMarshalAs] float value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial float invoke1_Single([JSMarshalAs] float value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public static float EchoSingle([JSMarshalAs] float arg1) + { + return arg1; + } + #endregion Single + + #region IntPtr + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial IntPtr echo1_IntPtr([JSMarshalAs] IntPtr value); + [JSImport("store1", "JavaScriptTestHelper")] + internal static partial void store1_IntPtr([JSMarshalAs] IntPtr value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial IntPtr retrieve1_IntPtr(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_IntPtr([JSMarshalAs] IntPtr value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial IntPtr throw1_IntPtr([JSMarshalAs] IntPtr value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial IntPtr invoke1_IntPtr([JSMarshalAs] IntPtr value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public static IntPtr EchoIntPtr([JSMarshalAs] IntPtr arg1) + { + return arg1; + } + #endregion IntPtr + + #region VoidPtr + + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal unsafe static partial void* echo1_VoidPtr([JSMarshalAs] void* value); + [JSImport("store1", "JavaScriptTestHelper")] + internal unsafe static partial void store1_VoidPtr([JSMarshalAs] void* value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal unsafe static partial void* retrieve1_VoidPtr(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal unsafe static partial bool identity1_VoidPtr([JSMarshalAs] void* value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal unsafe static partial void* throw1_VoidPtr([JSMarshalAs] void* value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal unsafe static partial void* invoke1_VoidPtr([JSMarshalAs] void* value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public unsafe static void* EchoVoidPtr([JSMarshalAs] void* arg1) + { + return arg1; + } + #endregion VoidPtr + + #region DateTime + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial DateTime echo1_DateTime([JSMarshalAs] DateTime value); + [JSImport("store1", "JavaScriptTestHelper")] + internal static partial void store1_DateTime([JSMarshalAs] DateTime value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial DateTime retrieve1_DateTime(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_DateTime([JSMarshalAs] DateTime value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial DateTime throw1_DateTime([JSMarshalAs] DateTime value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial DateTime invoke1_DateTime([JSMarshalAs] DateTime value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public static DateTime EchoDateTime([JSMarshalAs] DateTime arg1) + { + return arg1; + } + #endregion DateTime + + #region DateTimeOffset + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial DateTimeOffset echo1_DateTimeOffset([JSMarshalAs] DateTimeOffset value); + [JSImport("store1", "JavaScriptTestHelper")] + internal static partial void store1_DateTimeOffset([JSMarshalAs] DateTimeOffset value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial DateTimeOffset retrieve1_DateTimeOffset(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_DateTimeOffset([JSMarshalAs] DateTimeOffset value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial DateTimeOffset throw1_DateTimeOffset([JSMarshalAs] DateTimeOffset value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial DateTimeOffset invoke1_DateTimeOffset([JSMarshalAs] DateTimeOffset value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public static DateTimeOffset EchoDateTimeOffset([JSMarshalAs] DateTimeOffset arg1) + { + return arg1; + } + #endregion DateTimeOffset + + #region NullableBoolean + + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool? echo1_NullableBoolean([JSMarshalAs] bool? value); + [JSImport("store1", "JavaScriptTestHelper")] + internal static partial void store1_NullableBoolean([JSMarshalAs] bool? value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool? retrieve1_NullableBoolean(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_NullableBoolean([JSMarshalAs] bool? value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool? throw1_NullableBoolean([JSMarshalAs] bool? value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool? invoke1_NullableBoolean([JSMarshalAs] bool? value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public static bool? EchoNullableBoolean([JSMarshalAs] bool? arg1) + { + return arg1; + } + #endregion NullableBoolean + + #region NullableInt32 + + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial int? echo1_NullableInt32([JSMarshalAs] int? value); + [JSImport("store1", "JavaScriptTestHelper")] + internal static partial void store1_NullableInt32([JSMarshalAs] int? value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial int? retrieve1_NullableInt32(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_NullableInt32([JSMarshalAs] int? value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial int? throw1_NullableInt32([JSMarshalAs] int? value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial int? invoke1_NullableInt32([JSMarshalAs] int? value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public static int? EchoNullableInt32([JSMarshalAs] int? arg1) + { + return arg1; + } + #endregion NullableInt32 + + #region NullableBigInt64 + + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial long? echo1_NullableBigInt64([JSMarshalAs] long? value); + [JSImport("store1", "JavaScriptTestHelper")] + internal static partial void store1_NullableBigInt64([JSMarshalAs] long? value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial long? retrieve1_NullableBigInt64(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_NullableBigInt64([JSMarshalAs] long? value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial long? throw1_NullableBigInt64([JSMarshalAs] long? value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial long? invoke1_NullableBigInt64([JSMarshalAs] long? value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public static long? EchoNullableBigInt64([JSMarshalAs] long? arg1) + { + return arg1; + } + #endregion NullableBigInt64 + + #region NullableIntPtr + + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial IntPtr? echo1_NullableIntPtr([JSMarshalAs] IntPtr? value); + [JSImport("store1", "JavaScriptTestHelper")] + internal static partial void store1_NullableIntPtr([JSMarshalAs] IntPtr? value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial IntPtr? retrieve1_NullableIntPtr(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_NullableIntPtr([JSMarshalAs] IntPtr? value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial IntPtr? throw1_NullableIntPtr([JSMarshalAs] IntPtr? value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial IntPtr? invoke1_NullableIntPtr([JSMarshalAs] IntPtr? value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public static IntPtr? EchoNullableIntPtr([JSMarshalAs] IntPtr? arg1) + { + return arg1; + } + #endregion NullableIntPtr + + #region NullableDouble + + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial double? echo1_NullableDouble([JSMarshalAs] double? value); + [JSImport("store1", "JavaScriptTestHelper")] + internal static partial void store1_NullableDouble([JSMarshalAs] double? value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial double? retrieve1_NullableDouble(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_NullableDouble([JSMarshalAs] double? value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial double? throw1_NullableDouble([JSMarshalAs] double? value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial double? invoke1_NullableDouble([JSMarshalAs] double? value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public static double? EchoNullableDouble([JSMarshalAs] double? arg1) + { + return arg1; + } + #endregion NullableDouble + + #region NullableDateTime + + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial DateTime? echo1_NullableDateTime([JSMarshalAs] DateTime? value); + [JSImport("store1", "JavaScriptTestHelper")] + internal static partial void store1_NullableDateTime([JSMarshalAs] DateTime? value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial DateTime? retrieve1_NullableDateTime(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_NullableDateTime([JSMarshalAs] DateTime? value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial DateTime? throw1_NullableDateTime([JSMarshalAs] DateTime? value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial DateTime? invoke1_NullableDateTime([JSMarshalAs] DateTime? value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public static DateTime? EchoNullableDateTime([JSMarshalAs] DateTime? arg1) + { + return arg1; + } + #endregion NullableDateTime + + #region JSObject + [JSImport("echo1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial JSObject echo1_JSObject([JSMarshalAs] JSObject value); + [JSImport("store1", "JavaScriptTestHelper")] + internal static partial void store1_JSObject([JSMarshalAs] JSObject value); + [JSImport("retrieve1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial JSObject retrieve1_JSObject(); + [JSImport("identity1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial bool identity1_JSObject([JSMarshalAs] JSObject value); + [JSImport("throw1fn", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial JSObject throw1_JSObject([JSMarshalAs] JSObject value); + [JSImport("invoke1", "JavaScriptTestHelper")] + [return: JSMarshalAs] + internal static partial JSObject invoke1_JSObject([JSMarshalAs] JSObject value, [JSMarshalAs] string name); + [JSExport] + [return: JSMarshalAs] + public static JSObject EchoIJSObject([JSMarshalAs] JSObject arg1) + { + return arg1; + } + + [JSImport("beforeYield", "JavaScriptTestHelper")] + public static partial void BeforeYield(); + + [JSImport("isSetTimeoutHit", "JavaScriptTestHelper")] + public static partial bool IsSetTimeoutHit(); + + [JSImport("isPromiseThenHit", "JavaScriptTestHelper")] + public static partial bool IsPromiseThenHit(); + + [JSImport("callJavaScriptLibrary", "JavaScriptTestHelper")] + public static partial Task callJavaScriptLibrary(int a, int b); + + [JSImport("echopromise", "JavaScriptTestHelper")] + [return: JSMarshalAs>] + internal static partial Task echopromise_JSObject([JSMarshalAs] JSObject value); + #endregion JSObject + + [JSImport("setup", "JavaScriptTestHelper")] + internal static partial Task Setup(); + + [JSImport("INTERNAL.forceDisposeProxies")] + internal static partial void ForceDisposeProxies(bool disposeMethods, bool verbose); + + static JSObject _module; + public static async Task InitializeAsync() + { + if (_module == null) + { + _module = await JSHost.ImportAsync("JavaScriptTestHelper", "../JavaScriptTestHelper.mjs"); ; + await Setup(); + } + +#if FEATURE_WASM_MANAGED_THREADS + // are we in the UI thread ? + if (Environment.CurrentManagedThreadId == 1) +#endif + { + // this gives browser chance to serve UI thread event loop before every test + await Task.Yield(); + } + } + + public static Task DisposeAsync() + { + _module?.Dispose(); + _module = null; + return Task.CompletedTask; + } + } +} + +namespace JavaScriptTestHelperNamespace +{ + public partial class JavaScriptTestHelper + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) + { + return message + "11"; + } + + private partial class NestedClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "12"; + + private partial class DoubleNestedClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "13"; + } + } + + public partial record class NestedRecordClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "14"; + + public partial record class DoubleNestedRecordClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "15"; + } + } + + public partial struct NestedStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "16"; + + public partial struct DoubleNestedStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "17"; + } + } + + public partial record struct NestedRecordStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "18"; + + public partial record struct DoubleNestedRecordStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "19"; + } + } + } + + public partial class JavaScriptTestHelperStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "21"; + + public partial class NestedClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "22"; + } + + public partial record class NestedRecordClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "23"; + } + + public partial struct NestedStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) + { + return message + "24"; + } + } + + public partial record struct NestedRecordStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "25"; + } + } + + public partial record class JavaScriptTestHelperRecordClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "31"; + + public partial class NestedClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "32"; + } + + public partial record class NestedRecordClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "33"; + } + + public partial struct NestedStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "34"; + } + + public partial record struct NestedRecordStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "35"; + } + } + + public partial record struct JavaScriptTestHelperRecordStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "41"; + + public partial class NestedClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "42"; + } + + public partial record class NestedRecordClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "43"; + } + + public partial struct NestedStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "44"; + } + + public partial record struct NestedRecordStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) + { + return message + "45"; + } + } + } +} + +public partial class JavaScriptTestHelperNoNamespace +{ + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "51"; + + public partial class NestedClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "52"; + + public partial class DoubleNestedClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "53"; + } + } + + public partial record class NestedRecordClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "54"; + + public partial record class DoubleNestedRecordClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "55"; + } + } + + public partial struct NestedStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "56"; + + public partial struct DoubleNestedStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "57"; + } + } + + public partial record struct NestedRecordStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "58"; + + public partial record struct DoubleNestedRecordStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "59"; + } + } +} + +public partial class JavaScriptTestHelperStructNoNamespace +{ + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "61"; + + public partial class NestedClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "62"; + } + + public partial record class NestedRecordClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "63"; + } + + public partial struct NestedStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "64"; + } + + public partial record struct NestedRecordStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "65"; + } +} + +public partial record class JavaScriptTestHelperRecordClassNoNamespace +{ + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "71"; + + public partial class NestedClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "72"; + } + + public partial record class NestedRecordClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "73"; + } + + public partial struct NestedStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "74"; + } + + public partial record struct NestedRecordStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "75"; + } +} + +public partial record struct JavaScriptTestHelperRecordStructNoNamespace +{ + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "81"; + + public partial class NestedClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "82"; + } + + public partial record class NestedRecordClass + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "83"; + } + + public partial struct NestedStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "84"; + } + + public partial record struct NestedRecordStruct + { + [System.Runtime.InteropServices.JavaScript.JSExport] + public static string EchoString(string message) => message + "85"; + } +} diff --git a/src/mono/sample/wasm/browser-test-debug/JavaScriptTestHelper.mjs b/src/mono/sample/wasm/browser-test-debug/JavaScriptTestHelper.mjs new file mode 100644 index 00000000000000..1b5b03829bcf93 --- /dev/null +++ b/src/mono/sample/wasm/browser-test-debug/JavaScriptTestHelper.mjs @@ -0,0 +1,493 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +class JSData { + constructor(name) { + this.name = name; + } + echoMemberMethod(arg1) { + return arg1 + "-w-i-t-h-" + this.name; + } + toString() { + return `JSData("${this.name}")`; + } +} + +class JSTestError extends Error { + constructor(message) { + super(message) + } +} + +export function createData(name) { + //console.log(`createData(name:"${name ? name : ''}")`) + return new JSData(name); +} + +export function createException(name) { + //console.log(`createException(name:"${name ? name : ''}")`) + return new JSTestError(name); +} + +export function echo1(arg1) { + if (globalThis.gc) { + // console.log('globalThis.gc'); + globalThis.gc(); + } + + //console.log(`echo1(arg1:${arg1 !== null ? JSON.stringify(arg1): ''})`) + return arg1; +} + +export function echo1view(arg1, edit) { + if (globalThis.gc) { + // console.log('globalThis.gc'); + globalThis.gc(); + } + + // console.log(`echo1view(arg1:${arg1 !== null ? arg1 : ''})`) + // console.log(`echo1view(arg1:${arg1 !== null ? typeof arg1 : ''})`) + const cpy = arg1.slice(); + if (edit) { + cpy[1] = cpy[0] + arg1.set(cpy); + } + return arg1; +} + +export function echo1array(arg1, edit) { + if (globalThis.gc) { + // console.log('globalThis.gc'); + globalThis.gc(); + } + + // console.log(`echo1view(arg1:${arg1 !== null ? arg1 : ''})`) + // console.log(`echo1view(arg1:${arg1 !== null ? typeof arg1 : ''})`) + if (edit) { + arg1[1] = arg1[0] + } + return arg1; +} + +export function echo1large(arg1) { + try { + arg1._large = new Uint8Array(10000000); + } + catch (ex) { + console.log("echo1large " + ex) + } + if (globalThis.gc) { + // console.log('globalThis.gc'); + globalThis.gc(); + } + + //console.log(`echo1large(arg1:${arg1 !== null ? typeof arg1: ''})`) + return () => { + console.log("don't call me"); + }; +} + +export function store1(arg1) { + //console.log(`store1(arg1:${arg1 !== null ? arg1 : ''})`) + globalThis.javaScriptTestHelper.store1val = arg1; +} + +export function storeAt(arg1, arg2) { + //console.log(`storeAt(arg1:${arg1 !== null ? arg1 : ''})`) + //console.log(`storeAt(arg2:${arg2 !== null ? arg2 : ''})`) + globalThis.javaScriptTestHelper.store1val = arg1[arg2]; + return arg1[arg2]; +} + +export function retrieve1() { + const val = globalThis.javaScriptTestHelper.store1val; + //console.log(`retrieve1(arg1:${val !== null ? val : ''})`) + return val; +} + +export function throw0fn() { + //console.log(`throw0()`) + throw new Error('throw-0-msg'); +} + +export function returnError() { + return new Error('this-is-error'); +} + +export function catch1toString(message, functionName) { + const JavaScriptTestHelper = dllExports.System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper; + const fn = JavaScriptTestHelper[functionName]; + try { + fn(message); + return "bad"; + } catch (err) { + return err.toString(); + } +} + +export function catch1stack(message, functionName) { + const JavaScriptTestHelper = dllExports.System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper; + const fn = JavaScriptTestHelper[functionName]; + try { + fn(message); + return "bad"; + } catch (err) { + return err.stack; + } +} + +export function throw1fn(arg1) { + //console.log(`throw1(arg1:${arg1 !== null ? arg1 : ''})`) + throw new Error('throw1-msg ' + arg1); +} + +export function throwretrieve1() { + const val = globalThis.javaScriptTestHelper.store1val; + //console.log(`retrieve1(arg1:${val !== null ? val : ''})`) + throw new Error('throwretrieve1 ' + val); +} + +export function identity1(arg1) { + const val = globalThis.javaScriptTestHelper.store1val; + //console.log(`compare1(arg1:${arg1 !== null ? arg1 : ''}) with ${val !== null ? val : ''}`) + if (val instanceof Date) { + return arg1.valueOf() == val.valueOf(); + } + if (Number.isNaN(val)) { + return Number.isNaN(arg1); + } + return arg1 === val; +} + +export function getType1() { + const val = globalThis.javaScriptTestHelper.store1val; + const vtype = typeof (val); + // console.log(`getType1(arg1:${vtype !== null ? vtype : ''})`) + return vtype; +} + +export function getClass1() { + const val = globalThis.javaScriptTestHelper.store1val; + const cname = val.constructor.name; + // console.log(`getClass1(arg1:${cname !== null ? cname : ''})`) + return cname; +} +let dllExports; + +export function invoke0V() { + const JavaScriptTestHelper = dllExports.System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper; + const fn = JavaScriptTestHelper['Optimized0V']; + fn(); +} + +export function invoke1V(arg1) { + const JavaScriptTestHelper = dllExports.System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper; + const fn = JavaScriptTestHelper['Optimized1V']; + fn(arg1); +} + +export function invoke1O(arg1) { + const JavaScriptTestHelper = dllExports.System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper; + const fn = JavaScriptTestHelper['Optimized1O']; + fn(arg1); +} + +export function invoke1R(arg1) { + const JavaScriptTestHelper = dllExports.System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper; + const fn = JavaScriptTestHelper['Optimized1R']; + return fn(arg1); +} + +export function invoke2R(arg1, arg2) { + const JavaScriptTestHelper = dllExports.System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper; + const fn = JavaScriptTestHelper['Optimized2R']; + return fn(arg1, arg2); +} + +export function invoke1(arg1, name) { + if (globalThis.gc) { + // console.log('globalThis.gc'); + globalThis.gc(); + } + // console.log(`invoke1: ${name}(arg1:${arg1 !== null ? typeof arg1 : ''})`) + const JavaScriptTestHelper = dllExports.System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper; + const fn = JavaScriptTestHelper[name]; + + // console.log("invoke1:" + typeof fn); + // console.log("invoke1:" + fn.toString()); + const res = fn(arg1); + // console.log(`invoke1: res ${res !== null ? typeof res : ''}`) + return res; +} + +export async function invoke1Async(arg1, name) { + if (globalThis.gc) { + // console.log('globalThis.gc'); + globalThis.gc(); + } + // console.log(`invoke1: ${name}(arg1:${arg1 !== null ? typeof arg1 : ''})`) + const JavaScriptTestHelper = dllExports.System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper; + const fn = JavaScriptTestHelper[name]; + + await delay(10); + + // console.log("invoke1:" + typeof fn); + // console.log("invoke1:" + fn.toString()); + const res = fn(arg1); + // console.log(`invoke1: res ${res !== null ? typeof res : ''}`) + return res; +} + +export function invoke2(arg1, name) { + const fn = dllExports.JavaScriptTestHelperNoNamespace[name]; + //console.log("invoke1:" + fn.toString()); + const res = fn(arg1); + // console.log(`invoke1: res ${res !== null ? typeof res : ''}`) + return res; +} + +export function returnResolvedPromise() { + return Promise.resolve(); +} + +export async function invokeReturnCompletedTask() { + await dllExports.System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper.ReturnCompletedTask(); + return "resolved"; +} + +export function invokeStructClassRecords(arg1) { + return [ + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelper.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelper.NestedClass.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelper.NestedClass.DoubleNestedClass.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelper.NestedRecordClass.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelper.NestedRecordClass.DoubleNestedRecordClass.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelper.NestedStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelper.NestedStruct.DoubleNestedStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelper.NestedRecordStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelper.NestedRecordStruct.DoubleNestedRecordStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperStruct.NestedClass.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperStruct.NestedRecordClass.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperStruct.NestedStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperStruct.NestedRecordStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperRecordClass.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperRecordClass.NestedClass.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperRecordClass.NestedRecordClass.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperRecordClass.NestedStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperRecordClass.NestedRecordStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperRecordStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperRecordStruct.NestedClass.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperRecordStruct.NestedRecordClass.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperRecordStruct.NestedStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperRecordStruct.NestedRecordStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperNoNamespace.EchoString(arg1), + dllExports.JavaScriptTestHelperNoNamespace.NestedClass.EchoString(arg1), + dllExports.JavaScriptTestHelperNoNamespace.NestedClass.DoubleNestedClass.EchoString(arg1), + dllExports.JavaScriptTestHelperNoNamespace.NestedRecordClass.EchoString(arg1), + dllExports.JavaScriptTestHelperNoNamespace.NestedRecordClass.DoubleNestedRecordClass.EchoString(arg1), + dllExports.JavaScriptTestHelperNoNamespace.NestedStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperNoNamespace.NestedStruct.DoubleNestedStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperNoNamespace.NestedRecordStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperNoNamespace.NestedRecordStruct.DoubleNestedRecordStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperStructNoNamespace.EchoString(arg1), + dllExports.JavaScriptTestHelperStructNoNamespace.NestedClass.EchoString(arg1), + dllExports.JavaScriptTestHelperStructNoNamespace.NestedRecordClass.EchoString(arg1), + dllExports.JavaScriptTestHelperStructNoNamespace.NestedStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperStructNoNamespace.NestedRecordStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperRecordClassNoNamespace.EchoString(arg1), + dllExports.JavaScriptTestHelperRecordClassNoNamespace.NestedClass.EchoString(arg1), + dllExports.JavaScriptTestHelperRecordClassNoNamespace.NestedRecordClass.EchoString(arg1), + dllExports.JavaScriptTestHelperRecordClassNoNamespace.NestedStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperRecordClassNoNamespace.NestedRecordStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperRecordStructNoNamespace.EchoString(arg1), + dllExports.JavaScriptTestHelperRecordStructNoNamespace.NestedClass.EchoString(arg1), + dllExports.JavaScriptTestHelperRecordStructNoNamespace.NestedRecordClass.EchoString(arg1), + dllExports.JavaScriptTestHelperRecordStructNoNamespace.NestedStruct.EchoString(arg1), + dllExports.JavaScriptTestHelperRecordStructNoNamespace.NestedRecordStruct.EchoString(arg1), + ]; +} + +export function echopromise(arg1) { + if (globalThis.gc) { + //console.log('globalThis.gc'); + globalThis.gc(); + } + return new Promise(resolve => setTimeout(() => resolve(arg1), 0)); +} + +export async function awaitvoid(arg1) { + // console.log("awaitvoid:" + typeof arg1); + await arg1; + // console.log("awaitvoid done"); +} + +export function thenvoid(arg1) { + //console.log("thenvoid:" + typeof arg1); + arg1.then(() => { + // console.log("thenvoid then done"); + }); + //console.log("thenvoid done"); +} + +export async function await1(arg1) { + try { + // console.log("await1:" + typeof arg1); + const value = await arg1; + // console.log("await1 value:" + value); + return value; + } catch (ex) { + // console.log("await1 ex:" + ex); + throw ex; + } +} + +export async function await2(arg1) { + //console.log("await2-1:" + typeof arg1); + await arg1; + //console.log("await2-2:" + typeof arg1); +} + +export async function sleep(ms) { + if (globalThis.gc) { + // console.log('globalThis.gc'); + globalThis.gc(); + } + // console.log("sleep:" + ms); + await new Promise(resolve => setTimeout(resolve, ms)); + // console.log("sleep2:" + ms); + return ms; +} + +export async function forever() { + if (globalThis.gc) { + // console.log('globalThis.gc'); + globalThis.gc(); + } + // console.log("forever:" + ms); + await new Promise(() => { }); +} + +export function back3(arg1, arg2, arg3) { + if (globalThis.gc) { + // console.log('globalThis.gc'); + globalThis.gc(); + } + try { + if (!(arg1 instanceof Function)) throw new Error('expecting Function!') + //console.log(`back3(arg1:${arg1 !== null ? typeof (arg1) : ''})`) + //console.log(`back3(arg2:${arg2 !== null ? arg2 : ''})`) + //console.log(`back3(arg3:${arg3 !== null ? arg3 : ''})`) + + // call it twice, to make sure it's persistent + arg1(arg2, arg3); + //console.log(`back3(arg2:${arg2 !== null ? arg2 : ''})`) + //console.log(`back3(arg3:${arg3 !== null ? arg3 : ''})`) + + return arg1(arg2, arg3); + } + catch (ex) { + // console.log(`back1 - catch`) + throw ex; + } +} + +export function back4(arg1, arg2, arg3, arg4) { + if (globalThis.gc) { + // console.log('globalThis.gc'); + globalThis.gc(); + } + try { + if (!(arg1 instanceof Function)) throw new Error('expecting Function!') + + return arg1(arg2, arg3, arg4); + } + catch (ex) { + throw ex; + } +} + +export function backback(arg1, arg2, arg3) { + if (globalThis.gc) { + // console.log('globalThis.gc'); + globalThis.gc(); + } + // console.log('backback A') + return (brg1, brg2) => { + // console.log('backback B') + try { + var res = arg1(brg1 + arg2, brg2 + arg3); + // console.log('backback C') + return res + } + catch (e) { + // console.log('backback E ' + e) + throw e; + } + } +} + +export async function backbackAsync(arg1, arg2, arg3) { + if (globalThis.gc) { + // console.log('globalThis.gc'); + globalThis.gc(); + } + await delay(10); + return arg1(arg2, arg3); +} + +export async function callJavaScriptLibrary(a, b) { + const exports = await App.runtime.getAssemblyExports("JavaScriptLibrary.dll"); + return exports.JavaScriptLibrary.JavaScriptInterop.ExportedMethod(a, b); +} + +export const instance = {} + +globalThis.javaScriptTestHelper = instance; +globalThis.data = new JSData("i-n-s-t-a-n-c-e"); +globalThis.rebound = { + // our JSImport will try to bind it to `globalThis.rebound` + // but it would stay bound to globalThis.data + // because once the function is bound, it would stay bound to the first object and can't be re-bound subsequently + // this line is actually the first binding, not the fact it's part of the class JSData + echoMemberMethod: globalThis.data.echoMemberMethod.bind(globalThis.data) +} + +export async function setup() { + dllExports = await App.runtime.getAssemblyExports("Wasm.Test.Debug.Sample.dll"); +} + +// console.log('JavaScriptTestHelper:' Object.keys(globalThis.JavaScriptTestHelper)); + +export function delay(ms) { + return new Promise(resolve => globalThis.setTimeout(resolve, ms)); +} + +export function reject(what) { + return new Promise((_, reject) => globalThis.setTimeout(() => reject(what), 0)); +} + +let setTimeoutHit = false; +let promiseThenHit = false; +export function beforeYield() { + setTimeoutHit = false; + promiseThenHit = false; + setTimeout(() => { + setTimeoutHit = true; + }, 0); + let res; + new Promise((resolve) => { + res = resolve; + }).then(() => { + promiseThenHit = true; + }); + res(); +} + +export function isSetTimeoutHit() { + return setTimeoutHit; +} + +export function isPromiseThenHit() { + return promiseThenHit; +} diff --git a/src/mono/sample/wasm/browser-test-debug/Program.cs b/src/mono/sample/wasm/browser-test-debug/Program.cs new file mode 100644 index 00000000000000..c5a4da967f2142 --- /dev/null +++ b/src/mono/sample/wasm/browser-test-debug/Program.cs @@ -0,0 +1,52 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices.JavaScript; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using System.Runtime.InteropServices.JavaScript.Tests; + +namespace Sample +{ + public partial class Test + { + public static class Assert + { + public static void Equal(T expected, T actual) + { + if (!object.Equals(expected, actual)) + throw new Exception($"AssertHelper.Equal failed. Expected: {expected}. Actual: {actual}."); + } + } + public static async Task Main(string[] args) + { + var rand = new Random(); + Console.WriteLine("Today's lucky number is " + rand.Next(100) + " and " + Guid.NewGuid()); + + return 0; + } + + public static async Task JsExportTaskOfInt(int value) + { + TaskCompletionSource tcs = new TaskCompletionSource(); + + var res = JavaScriptTestHelper.invoke1_TaskOfInt(tcs.Task, nameof(JavaScriptTestHelper.AwaitTaskOfObject)); + tcs.SetResult(value); + await Task.Yield(); + var rr = await res; + await Task.Yield(); + + Assert.Equal(value, rr); + //GC.Collect(); + } + + [JSExport] + public static async Task DoTestMethod() + { + await JavaScriptTestHelper.InitializeAsync(); + await JsExportTaskOfInt(-2147483648); + } + } +} diff --git a/src/mono/sample/wasm/browser-test-debug/Wasm.Test.Debug.Sample.csproj b/src/mono/sample/wasm/browser-test-debug/Wasm.Test.Debug.Sample.csproj new file mode 100644 index 00000000000000..be7b462cb3231b --- /dev/null +++ b/src/mono/sample/wasm/browser-test-debug/Wasm.Test.Debug.Sample.csproj @@ -0,0 +1,46 @@ + + + + false + false + true + true + false + true + true + web,worker + + -s LEGACY_GL_EMULATION=1 -lGL -lSDL -lidbfs.js + + <_ServeHeaders>$(_ServeHeaders) -h "Content-Security-Policy: default-src 'self' 'wasm-unsafe-eval'" -h "Timing-Allow-Origin: *" -h "Cross-Origin-Opener-Policy: same-origin" -h "Cross-Origin-Embedder-Policy: require-corp" + + + + + + ./ + + + + true + false + + + + + + + + + + + + + + + + + + + + diff --git a/src/mono/sample/wasm/browser-test-debug/advanced-sample.lib.module.js b/src/mono/sample/wasm/browser-test-debug/advanced-sample.lib.module.js new file mode 100644 index 00000000000000..be57002195d2f4 --- /dev/null +++ b/src/mono/sample/wasm/browser-test-debug/advanced-sample.lib.module.js @@ -0,0 +1,10 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +export function onRuntimeConfigLoaded(config) { + console.log("advanced-sample onRuntimeConfigLoaded") +} + +export async function onRuntimeReady({ getAssemblyExports, getConfig }) { + console.log("advanced-sample onRuntimeReady") +} \ No newline at end of file diff --git a/src/mono/sample/wasm/browser-test-debug/fibonacci.c b/src/mono/sample/wasm/browser-test-debug/fibonacci.c new file mode 100644 index 00000000000000..657513d7ebb79e --- /dev/null +++ b/src/mono/sample/wasm/browser-test-debug/fibonacci.c @@ -0,0 +1,9 @@ +int Fibonacci(int n) { + int fnow = 0, fnext = 1, tempf; + while(--n>0){ + tempf = fnow + fnext; + fnow = fnext; + fnext = tempf; + } + return fnext; +} \ No newline at end of file diff --git a/src/mono/sample/wasm/browser-test-debug/index.html b/src/mono/sample/wasm/browser-test-debug/index.html new file mode 100644 index 00000000000000..859ae073667beb --- /dev/null +++ b/src/mono/sample/wasm/browser-test-debug/index.html @@ -0,0 +1,24 @@ + + + + + + + Wasm Browser Test Debug Sample + + + + + + + + + + + + + + Answer to the Ultimate Question of Life, the Universe, and Everything is : + + + diff --git a/src/mono/sample/wasm/browser-test-debug/main.js b/src/mono/sample/wasm/browser-test-debug/main.js new file mode 100644 index 00000000000000..ff24fa02bd2029 --- /dev/null +++ b/src/mono/sample/wasm/browser-test-debug/main.js @@ -0,0 +1,72 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +import { dotnet, exit } from './dotnet.js' + +let testAbort = true; +let testError = true; + +try { + dotnet + .withElementOnExit() + // 'withModuleConfig' is internal lower level API + // here we show how emscripten could be further configured + // It is preferred to use specific 'with***' methods instead in all other cases. + .withConfig({ + startupMemoryCache: true, + maxParallelDownloads: 1, + resources: { + modulesAfterConfigLoaded: { + "advanced-sample.lib.module.js": "" + } + } + }) + .withModuleConfig({ + configSrc: "./dotnet.boot.js", + onConfigLoaded: (config) => { + // This is called during emscripten `dotnet.wasm` instantiation, after we fetched config. + console.log('user code Module.onConfigLoaded'); + // config is loaded and could be tweaked before the rest of the runtime startup sequence + config.environmentVariables["MONO_LOG_LEVEL"] = "debug"; + }, + preInit: () => { console.log('user code Module.preInit'); }, + preRun: () => { console.log('user code Module.preRun'); }, + onRuntimeInitialized: () => { + console.log('user code Module.onRuntimeInitialized'); + // here we could use API passed into this callback + // Module.FS.chdir("/"); + }, + onDotnetReady: () => { + // This is called after all assets are loaded. + console.log('user code Module.onDotnetReady'); + }, + postRun: () => { console.log('user code Module.postRun'); }, + out: (text) => { console.log("ADVANCED:" + text) }, + }) + .withResourceLoader((type, name, defaultUri, integrity, behavior) => { + // loadBootResource could return string with unqualified name of resource. It assumes that we resolve it with document.baseURI + return name; + }); + + await dotnet.download(); + + const { runtimeBuildInfo, setModuleImports, getAssemblyExports, runMain, getConfig, Module } = await dotnet.create(); + + globalThis.App = { + runtime: { + getAssemblyExports, + } + }; + + const config = getConfig(); + const exports = await getAssemblyExports(config.mainAssemblyName); + + await exports.Sample.Test.DoTestMethod(); + + let exit_code = await runMain(config.mainAssemblyName, []); + + exit(exit_code); +} +catch (err) { + exit(2, err); +} From 8c625978a973a25a853536dc0322605526b97016 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 8 Aug 2025 16:29:35 +0100 Subject: [PATCH 144/209] Update gc-handles to accept bigints Convert to Number with a validity check (array indices are Numbers) --- src/mono/browser/runtime/gc-handles.ts | 79 ++++++++++++++++---------- 1 file changed, 50 insertions(+), 29 deletions(-) diff --git a/src/mono/browser/runtime/gc-handles.ts b/src/mono/browser/runtime/gc-handles.ts index 30e3f30271451b..7f5fc3b07b8017 100644 --- a/src/mono/browser/runtime/gc-handles.ts +++ b/src/mono/browser/runtime/gc-handles.ts @@ -28,6 +28,18 @@ export const _js_owned_object_table = new Map>(); const _gcv_handle_free_list: GCHandle[] = []; let _next_gcv_handle = -2; +// Convert bigint to number, but throw if it's out of safe integer range. +function normalize_handle (js_handle: JSHandle | GCHandle): any { + const handle = typeof js_handle === "bigint" ? Number(js_handle) : js_handle; + if (!Number.isSafeInteger(handle)) { + if (typeof js_handle === "bigint") { + throw new Error("js_handle value is out of safe integer range. Converted from bigint."); + } else { + throw new Error("js_handle value is out of safe integer range."); + } + } + return handle; +} // GCVHandle is like GCHandle, but it's not tracked and allocated by the mono GC, but just by JS. // It's used when we need to create GCHandle-like identity ahead of time, before calling Mono. // they have negative values, so that they don't collide with GCHandles. @@ -37,19 +49,23 @@ export function alloc_gcv_handle (): GCHandle { } export function free_gcv_handle (gcv_handle: GCHandle): void { - _gcv_handle_free_list.push(gcv_handle); + const handle = normalize_handle(gcv_handle); + _gcv_handle_free_list.push(handle); } export function is_jsv_handle (js_handle: JSHandle): boolean { - return (js_handle as any) < -1; + const handle = normalize_handle(js_handle); + return (handle as any) < -1; } export function is_js_handle (js_handle: JSHandle): boolean { - return (js_handle as any) > 0; + const handle = normalize_handle(js_handle); + return (handle as any) > 0; } export function is_gcv_handle (gc_handle: GCHandle): boolean { - return (gc_handle as any) < -1; + const handle = normalize_handle(gc_handle); + return (handle as any) < -1; } // NOTE: FinalizationRegistry and WeakRef are missing on Safari below 14.1 @@ -61,12 +77,12 @@ export const js_owned_gc_handle_symbol = Symbol.for("wasm js_owned_gc_handle"); export const cs_owned_js_handle_symbol = Symbol.for("wasm cs_owned_js_handle"); export const do_not_force_dispose = Symbol.for("wasm do_not_force_dispose"); - export function mono_wasm_get_jsobj_from_js_handle (js_handle: JSHandle): any { - if (is_js_handle(js_handle)) - return _cs_owned_objects_by_js_handle[js_handle]; - if (is_jsv_handle(js_handle)) - return _cs_owned_objects_by_jsv_handle[0 - js_handle]; + const handle = normalize_handle(js_handle); + if (is_js_handle(handle)) + return _cs_owned_objects_by_js_handle[handle]; + if (is_jsv_handle(handle)) + return _cs_owned_objects_by_jsv_handle[0 - handle]; return null; } @@ -93,24 +109,26 @@ export function mono_wasm_get_js_handle (js_obj: any): JSHandle { export function register_with_jsv_handle (js_obj: any, jsv_handle: JSHandle) { assert_js_interop(); + const handle = normalize_handle(jsv_handle); // note _cs_owned_objects_by_js_handle is list, not Map. That's why we maintain _js_handle_free_list. - _cs_owned_objects_by_jsv_handle[0 - jsv_handle] = js_obj; + _cs_owned_objects_by_jsv_handle[0 - handle] = js_obj; if (Object.isExtensible(js_obj)) { - js_obj[cs_owned_js_handle_symbol] = jsv_handle; + js_obj[cs_owned_js_handle_symbol] = handle; } } // note: in MT, this is called from locked JSProxyContext. Don't call anything that would need locking. export function mono_wasm_release_cs_owned_object (js_handle: JSHandle): void { let obj: any; - if (is_js_handle(js_handle)) { - obj = _cs_owned_objects_by_js_handle[js_handle]; - _cs_owned_objects_by_js_handle[js_handle] = undefined; - _js_handle_free_list.push(js_handle); - } else if (is_jsv_handle(js_handle)) { - obj = _cs_owned_objects_by_jsv_handle[0 - js_handle]; - _cs_owned_objects_by_jsv_handle[0 - js_handle] = undefined; + const handle = normalize_handle(js_handle); + if (is_js_handle(handle)) { + obj = _cs_owned_objects_by_js_handle[handle]; + _cs_owned_objects_by_js_handle[handle] = undefined; + _js_handle_free_list.push(handle); + } else if (is_jsv_handle(handle)) { + obj = _cs_owned_objects_by_jsv_handle[0 - handle]; + _cs_owned_objects_by_jsv_handle[0 - handle] = undefined; // see free list in JSProxyContext.FreeJSVHandle } mono_assert(obj !== undefined && obj !== null, "ObjectDisposedException"); @@ -121,50 +139,53 @@ export function mono_wasm_release_cs_owned_object (js_handle: JSHandle): void { export function setup_managed_proxy (owner: any, gc_handle: GCHandle): void { assert_js_interop(); + const handle = normalize_handle(gc_handle); // keep the gc_handle so that we could easily convert it back to original C# object for roundtrip - owner[js_owned_gc_handle_symbol] = gc_handle; + owner[js_owned_gc_handle_symbol] = handle; // NOTE: this would be leaking C# objects when the browser doesn't support FinalizationRegistry/WeakRef if (_use_finalization_registry) { // register for GC of the C# object after the JS side is done with the object - _js_owned_object_registry.register(owner, gc_handle, owner); + _js_owned_object_registry.register(owner, handle, owner); } // register for instance reuse // NOTE: this would be leaking C# objects when the browser doesn't support FinalizationRegistry/WeakRef const wr = create_weak_ref(owner); - _js_owned_object_table.set(gc_handle, wr); + _js_owned_object_table.set(handle, wr); } export function upgrade_managed_proxy_to_strong_ref (owner: any, gc_handle: GCHandle): void { const sr = create_strong_ref(owner); + const handle = normalize_handle(gc_handle); if (_use_finalization_registry) { _js_owned_object_registry.unregister(owner); } - _js_owned_object_table.set(gc_handle, sr); + _js_owned_object_table.set(handle, sr); } export function teardown_managed_proxy (owner: any, gc_handle: GCHandle, skipManaged?: boolean): void { assert_js_interop(); + let handle = normalize_handle(gc_handle); // The JS object associated with this gc_handle has been collected by the JS GC. // As such, it's not possible for this gc_handle to be invoked by JS anymore, so // we can release the tracking weakref (it's null now, by definition), // and tell the C# side to stop holding a reference to the managed object. // "The FinalizationRegistry callback is called potentially multiple times" if (owner) { - gc_handle = owner[js_owned_gc_handle_symbol]; + handle = owner[js_owned_gc_handle_symbol]; owner[js_owned_gc_handle_symbol] = GCHandleNull; if (_use_finalization_registry) { _js_owned_object_registry.unregister(owner); } } - if (gc_handle !== GCHandleNull && _js_owned_object_table.delete(gc_handle) && !skipManaged) { + if (handle !== GCHandleNull && _js_owned_object_table.delete(handle) && !skipManaged) { if (loaderHelpers.is_runtime_running() && !force_dispose_proxies_in_progress) { - release_js_owned_object_by_gc_handle(gc_handle); + release_js_owned_object_by_gc_handle(handle); } } - if (is_gcv_handle(gc_handle)) { - free_gcv_handle(gc_handle); + if (is_gcv_handle(handle)) { + free_gcv_handle(handle); } } @@ -179,13 +200,13 @@ function _js_owned_object_finalized (gc_handle: GCHandle): void { // We're shutting down, so don't bother doing anything else. return; } - teardown_managed_proxy(null, gc_handle); + teardown_managed_proxy(null, normalize_handle(gc_handle)); } export function _lookup_js_owned_object (gc_handle: GCHandle): any { if (!gc_handle) return null; - const wr = _js_owned_object_table.get(gc_handle); + const wr = _js_owned_object_table.get(normalize_handle(gc_handle)); if (wr) { // this could be null even before _js_owned_object_finalized was called // TODO: are there race condition consequences ? From 9081dcc1f518efd5087506ff7be69cb1e0d9f249 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 8 Aug 2025 16:44:44 +0100 Subject: [PATCH 145/209] Update to testing sample output --- src/mono/sample/wasm/browser-test-debug/index.html | 4 ++-- src/mono/sample/wasm/browser-test-debug/main.js | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mono/sample/wasm/browser-test-debug/index.html b/src/mono/sample/wasm/browser-test-debug/index.html index 859ae073667beb..f1f592555c9329 100644 --- a/src/mono/sample/wasm/browser-test-debug/index.html +++ b/src/mono/sample/wasm/browser-test-debug/index.html @@ -17,8 +17,8 @@ - - Answer to the Ultimate Question of Life, the Universe, and Everything is : + + Test has: diff --git a/src/mono/sample/wasm/browser-test-debug/main.js b/src/mono/sample/wasm/browser-test-debug/main.js index ff24fa02bd2029..eff48a1ac2e086 100644 --- a/src/mono/sample/wasm/browser-test-debug/main.js +++ b/src/mono/sample/wasm/browser-test-debug/main.js @@ -61,7 +61,10 @@ try { const config = getConfig(); const exports = await getAssemblyExports(config.mainAssemblyName); + document.getElementById("out").innerHTML = `NOT PASSED`; + await exports.Sample.Test.DoTestMethod(); + document.getElementById("out").innerHTML = `PASSED`; let exit_code = await runMain(config.mainAssemblyName, []); From 7ab959255ee78a7067ccbdf762b7a2e0780adfcc Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 11 Aug 2025 12:33:25 +0100 Subject: [PATCH 146/209] Don't use bool to hide code --- src/mono/browser/runtime/runtime.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mono/browser/runtime/runtime.c b/src/mono/browser/runtime/runtime.c index 09521464bc041d..6a1a6c166e65dc 100644 --- a/src/mono/browser/runtime/runtime.c +++ b/src/mono/browser/runtime/runtime.c @@ -346,8 +346,9 @@ mono_wasm_load_runtime_common (int debug_level, MonoLogCallback log_callback, co } #endif init_icall_table (); - const bool check_symbol_lookup = false; - if(check_symbol_lookup) + + #undef CHECK_SYMBOL_LOOKUP + #ifdef CHECK_SYMBOL_LOOKUP { printf("Checking mono_lookup_icall_symbol_internal\n"); const char *p = mono_lookup_icall_symbol_internal (mono_lookup_icall_symbol_internal); @@ -356,6 +357,7 @@ mono_wasm_load_runtime_common (int debug_level, MonoLogCallback log_callback, co p = mono_lookup_icall_symbol_internal (ves_icall_System_Environment_get_ProcessorCount); printf ("%s\n", p ? p : "null"); } + #endif mono_ee_interp_init (interp_opts); mono_marshal_ilgen_init(); mono_method_builder_ilgen_init (); From a4dc569c23f8201ff2c00dc0d6c17d76e28c6631 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 11 Aug 2025 14:32:02 +0100 Subject: [PATCH 147/209] Update to marshalling - convert bigint to numbers for array access --- src/mono/browser/runtime/marshal-to-js.ts | 11 +++++++---- src/mono/browser/runtime/marshal.ts | 11 +++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/mono/browser/runtime/marshal-to-js.ts b/src/mono/browser/runtime/marshal-to-js.ts index 3eea9eb76a1d55..6319aac343b997 100644 --- a/src/mono/browser/runtime/marshal-to-js.ts +++ b/src/mono/browser/runtime/marshal-to-js.ts @@ -24,7 +24,7 @@ import { fixupPointer, free, localHeapViewF64, localHeapViewI32, localHeapViewU8 import { call_delegate } from "./managed-exports"; import { mono_log_debug } from "./logging"; import { invoke_later_when_on_ui_thread_async } from "./invoke-js"; -import { add_offset } from "./marshal"; +import { add_offset, normalizePointer } from "./marshal"; export function initialize_marshalers_to_js (): void { if (cs_to_js_marshalers.size == 0) { @@ -527,15 +527,18 @@ function _marshal_array_to_js_impl (arg: JSMarshalerArgument, element_type: Mars } } else if (element_type == MarshalerType.Byte) { const bufferOffset = fixupPointer(buffer_ptr, 0); - const sourceView = localHeapViewU8().subarray(bufferOffset, bufferOffset + length); + const normOffset = normalizePointer(bufferOffset); + const sourceView = localHeapViewU8().subarray(normOffset, normOffset + length); result = sourceView.slice();//copy } else if (element_type == MarshalerType.Int32) { const bufferOffset = fixupPointer(buffer_ptr, 2); - const sourceView = localHeapViewI32().subarray(bufferOffset, bufferOffset + length); + const normOffset = normalizePointer(bufferOffset); + const sourceView = localHeapViewI32().subarray(normOffset, normOffset + length); result = sourceView.slice();//copy } else if (element_type == MarshalerType.Double) { const bufferOffset = fixupPointer(buffer_ptr, 3); - const sourceView = localHeapViewF64().subarray(bufferOffset, bufferOffset + length); + const normOffset = normalizePointer(bufferOffset); + const sourceView = localHeapViewF64().subarray(normOffset, normOffset + length); result = sourceView.slice();//copy } else { throw new Error(`NotImplementedException ${element_type}. ${jsinteropDoc}`); diff --git a/src/mono/browser/runtime/marshal.ts b/src/mono/browser/runtime/marshal.ts index 3b23dd364ac599..a71ace3da1570c 100644 --- a/src/mono/browser/runtime/marshal.ts +++ b/src/mono/browser/runtime/marshal.ts @@ -133,6 +133,17 @@ export function add_offset ( return (ptr as number) + offset; } } +export function normalizePointer (inPtr: bigint | number): any { + const ptr = typeof inPtr === "bigint" ? Number(inPtr) : inPtr; + if (!Number.isSafeInteger(ptr)) { + if (typeof inPtr === "bigint") { + throw new Error("pointer value is out of safe integer range. Converted from bigint."); + } else { + throw new Error("pointer value is out of safe integer range."); + } + } + return ptr; +} export function get_sig (signature: JSFunctionSignature, index: number): JSMarshalerType { mono_assert(signature, "Null signatures"); return add_offset(signature, (index * JSMarshalerTypeSize) + JSMarshalerSignatureHeaderSize) as any; From 7227c04c69f0209cf02c7bfed2bbfdf15a9a7ca5 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 11 Aug 2025 14:32:24 +0100 Subject: [PATCH 148/209] Update test app for array comparison --- .../sample/wasm/browser-test-debug/Program.cs | 77 ++++++++++++++++++- 1 file changed, 75 insertions(+), 2 deletions(-) diff --git a/src/mono/sample/wasm/browser-test-debug/Program.cs b/src/mono/sample/wasm/browser-test-debug/Program.cs index c5a4da967f2142..03f581fa968ace 100644 --- a/src/mono/sample/wasm/browser-test-debug/Program.cs +++ b/src/mono/sample/wasm/browser-test-debug/Program.cs @@ -14,10 +14,58 @@ public partial class Test { public static class Assert { + private static string FormatIfArray(object? obj) + { + if (obj is Array arr) + { + var items = new System.Text.StringBuilder(); + items.Append('['); + for (int i = 0; i < arr.Length; i++) + { + if (i > 0) items.Append(", "); + items.Append(arr.GetValue(i)?.ToString()); + } + items.Append(']'); + return items.ToString(); + } + return obj?.ToString() ?? "null"; + } + public static void Equal(T expected, T actual) { + if (expected is Array expectedArray && actual is Array actualArray) + { + if (expectedArray.Length != actualArray.Length) + { + throw new Exception($"AssertHelper.Equal failed. Array lengths differ. Expected: {expectedArray.Length}, Actual: {actualArray.Length}. Expected: {FormatIfArray(expectedArray)}, Actual: {FormatIfArray(actualArray)}."); + } + for (int i = 0; i < expectedArray.Length; i++) + { + var e = expectedArray.GetValue(i); + var a = actualArray.GetValue(i); + if (!object.Equals(e, a)) + { + throw new Exception($"AssertHelper.Equal failed at index {i}. Expected: {FormatIfArray(expectedArray)}, Actual: {FormatIfArray(actualArray)}."); + } + } + return; + } if (!object.Equals(expected, actual)) - throw new Exception($"AssertHelper.Equal failed. Expected: {expected}. Actual: {actual}."); + { + string expectedStr = FormatIfArray(expected); + string actualStr = FormatIfArray(actual); + throw new Exception($"AssertHelper.Equal failed. Expected: {expectedStr}. Actual: {actualStr}."); + } + } + public static void True(bool condition) + { + if (!condition) + throw new Exception("AssertHelper.True failed. Condition was false."); + } + public static void False(bool condition) + { + if (condition) + throw new Exception("AssertHelper.False failed. Condition was true."); } } public static async Task Main(string[] args) @@ -42,11 +90,36 @@ public static async Task JsExportTaskOfInt(int value) //GC.Collect(); } + public static unsafe void JsExportVoidPtr(IntPtr xvalue) + { + void* value = (void*)xvalue; + void* res = JavaScriptTestHelper.invoke1_VoidPtr(value, nameof(JavaScriptTestHelper.EchoVoidPtr)); + Assert.True(value == res); + } + + public static unsafe void JsImportIntArray(int[]? expected) + { + var actual = JavaScriptTestHelper.echo1_Int32Array(expected); + Assert.Equal(expected, actual); + if (expected != null) for (int i = 0; i < expected.Length; i++) + { + var actualI = JavaScriptTestHelper.store_Int32Array(expected, i); + Assert.Equal(expected[i], actualI); + } + } + [JSExport] public static async Task DoTestMethod() { await JavaScriptTestHelper.InitializeAsync(); - await JsExportTaskOfInt(-2147483648); + int[] testData = new int[] { 1, 2, 3, int.MaxValue, int.MinValue }; + + JsImportIntArray(testData); + //JsExportVoidPtr(-9223372036854775808); //IntPtr.MinValue + //JsExportVoidPtr(IntPtr.MinValue); + //await JsExportTaskOfInt(-2147483648); + //await JsExportTaskOfInt(8); + //await JsExportTaskOfInt(0); } } } From ada5190e23daa3e15a0316acaff6167773183d73 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 11 Aug 2025 16:17:50 +0100 Subject: [PATCH 149/209] Convert bigint to number for array access Modify a test to expect bigint type from IntPtr on wasm64 --- .../Runtime/InteropServices/JavaScript/JSImportTest.cs | 3 ++- src/mono/browser/runtime/marshal.ts | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSImportTest.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSImportTest.cs index f2d45a51123336..133a50adfca3b2 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSImportTest.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSImportTest.cs @@ -781,13 +781,14 @@ public void JsImportNullableBigInt64(long? value) [MemberData(nameof(MarshalNullableIntPtrCases))] public void JsImportNullableIntPtr(IntPtr? value) { + string expectedType = IntPtr.Size == 4 ? "number" : "bigint"; JsImportTest(value, JavaScriptTestHelper.store1_NullableIntPtr, JavaScriptTestHelper.retrieve1_NullableIntPtr, JavaScriptTestHelper.echo1_NullableIntPtr, JavaScriptTestHelper.throw1_NullableIntPtr, JavaScriptTestHelper.identity1_NullableIntPtr, - "number"); + expectedType); } #endregion NullableIntPtr diff --git a/src/mono/browser/runtime/marshal.ts b/src/mono/browser/runtime/marshal.ts index a71ace3da1570c..1906539df933f8 100644 --- a/src/mono/browser/runtime/marshal.ts +++ b/src/mono/browser/runtime/marshal.ts @@ -133,7 +133,7 @@ export function add_offset ( return (ptr as number) + offset; } } -export function normalizePointer (inPtr: bigint | number): any { +export function normalizePointer (inPtr: bigint | number | VoidPtr): any { const ptr = typeof inPtr === "bigint" ? Number(inPtr) : inPtr; if (!Number.isSafeInteger(ptr)) { if (typeof inPtr === "bigint") { @@ -535,9 +535,10 @@ abstract class MemoryView implements IMemoryView { _unsafe_create_view (): TypedArray { // this view must be short lived so that it doesn't fail after wasm memory growth // for that reason we also don't give the view out to end user and provide set/slice/copyTo API instead - const view = this._viewType == MemoryViewType.Byte ? new Uint8Array(localHeapViewU8().buffer, this._pointer, this._length) - : this._viewType == MemoryViewType.Int32 ? new Int32Array(localHeapViewI32().buffer, this._pointer, this._length) - : this._viewType == MemoryViewType.Double ? new Float64Array(localHeapViewF64().buffer, this._pointer, this._length) + + const view = this._viewType == MemoryViewType.Byte ? new Uint8Array(localHeapViewU8().buffer, normalizePointer(this._pointer), this._length) + : this._viewType == MemoryViewType.Int32 ? new Int32Array(localHeapViewI32().buffer, normalizePointer(this._pointer), this._length) + : this._viewType == MemoryViewType.Double ? new Float64Array(localHeapViewF64().buffer, normalizePointer(this._pointer), this._length) : null; if (!view) throw new Error("NotImplementedException"); return view; From 8ee16a0fed775787329531621bc1ed21b857259c Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 12 Aug 2025 08:29:15 +0100 Subject: [PATCH 150/209] Add MH_LOG configurability --- src/mono/mono/mini/interp/interp.c | 10 +-- .../sample/wasm/browser-test-debug/Program.cs | 74 ++++++++++++++++++- .../sample/wasm/browser-test-debug/main.js | 4 +- src/native/public/mono/metadata/mh_log.h | 53 +++++++------ 4 files changed, 109 insertions(+), 32 deletions(-) diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index 19d7eaa9eafd5b..2f72536af1970e 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -2286,22 +2286,22 @@ do_icall_wrapper (InterpFrame *frame, MonoMethodSignature *sig, MintICallSig op, INTERP_PUSH_LMF_WITH_CTX (frame, ext, exit_icall); if(frame->imethod && frame->imethod->method && frame->imethod->method->name) { - MH_LOG("calling do_icall for %s : %s", frame->imethod->method->name, mono_method_full_name (frame->imethod->method, TRUE)); + MH_LOGV(MH_LVL_DEBUG, "calling do_icall for %s : %s", frame->imethod->method->name, mono_method_full_name (frame->imethod->method, TRUE)); } else { - MH_LOG("** Not getting method name because:"); + MH_LOGV(MH_LVL_DEBUG, "** Not getting method name because:"); if (!frame->imethod) { - MH_LOG("** called do_icall_wrapper for null imethod"); + MH_LOGV(MH_LVL_DEBUG, "** called do_icall_wrapper for null imethod"); } else if (!frame->imethod->method) { - MH_LOG("** called do_icall_wrapper for imethod %p with no method", frame->imethod); + MH_LOGV(MH_LVL_DEBUG, "** called do_icall_wrapper for imethod %p with no method", frame->imethod); } else if (!frame->imethod->method->name) { - MH_LOG("** called do_icall_wrapper for imethod->method %p with no name", frame->imethod->method); + MH_LOGV(MH_LVL_DEBUG, "** called do_icall_wrapper for imethod->method %p with no name", frame->imethod->method); } } fflush(stdout); diff --git a/src/mono/sample/wasm/browser-test-debug/Program.cs b/src/mono/sample/wasm/browser-test-debug/Program.cs index 03f581fa968ace..03b39f5567bbf6 100644 --- a/src/mono/sample/wasm/browser-test-debug/Program.cs +++ b/src/mono/sample/wasm/browser-test-debug/Program.cs @@ -31,6 +31,15 @@ private static string FormatIfArray(object? obj) return obj?.ToString() ?? "null"; } + public static void NotEqual(T expected, T actual) + { + if (object.Equals(expected, actual)) + { + string expectedStr = FormatIfArray(expected); + string actualStr = FormatIfArray(actual); + throw new Exception($"AssertHelper.NotEqual failed. Expected: {expectedStr}. Actual: {actualStr}."); + } + } public static void Equal(T expected, T actual) { if (expected is Array expectedArray && actual is Array actualArray) @@ -108,13 +117,74 @@ public static unsafe void JsImportIntArray(int[]? expected) } } + public static unsafe void JsImportArraySegmentOfInt32() + { + var expectedBytes = new int[] { 88, 0, 1, -2, 42, int.MaxValue, int.MinValue }; + ArraySegment expected = new ArraySegment(expectedBytes, 1, 6); + ArraySegment actual = JavaScriptTestHelper.echo1_ArraySegmentOfInt32(expected, false); + Assert.Equal(expected.Count, actual.Count); + Assert.NotEqual(expected[0], expected[1]); + Assert.Equal(expected.Array, actual.Array); + actual = JavaScriptTestHelper.echo1_ArraySegmentOfInt32(expected, true); + Assert.Equal(expected[0], expected[1]); + Assert.Equal(actual[0], actual[1]); + } + + public static unsafe void JsImportArraySegmentOfDouble() + { + var expectedBytes = new double[] { 88.88, 0, 1, -1, double.Pi, 42, double.MaxValue, double.MinValue, double.NaN, double.PositiveInfinity, double.NegativeInfinity }; + ArraySegment expected = new ArraySegment(expectedBytes, 1, 10); + ArraySegment actual = JavaScriptTestHelper.echo1_ArraySegmentOfDouble(expected, false); + Assert.Equal(expected.Count, actual.Count); + Assert.NotEqual(expected[0], expected[1]); + Assert.Equal(expected.Array, actual.Array); + actual = JavaScriptTestHelper.echo1_ArraySegmentOfDouble(expected, true); + Assert.Equal(expected[0], expected[1]); + Assert.Equal(actual[0], actual[1]); + } + + public static unsafe void JsImportSpanOfDouble() + { + var expectedBytes = stackalloc double[] { 0, 1, -1, double.Pi, 42, double.MaxValue, double.MinValue, double.NaN, double.PositiveInfinity, double.NegativeInfinity }; + Span expected = new Span(expectedBytes, 10); + Assert.True(Unsafe.AsPointer(ref expected.GetPinnableReference()) == expectedBytes); + Span actual = JavaScriptTestHelper.echo1_SpanOfDouble(expected, false); + Assert.Equal(expected.Length, actual.Length); + Assert.NotEqual(expected[0], expected[1]); + Assert.Equal(expected.GetPinnableReference(), actual.GetPinnableReference()); + Assert.True(actual.SequenceCompareTo(expected) == 0); + Assert.Equal(expected.ToArray(), actual.ToArray()); + actual = JavaScriptTestHelper.echo1_SpanOfDouble(expected, true); + Assert.Equal(expected[0], expected[1]); + Assert.Equal(actual[0], actual[1]); + } + public static unsafe void JsImportObjectArray(object[]? expected) + { + if (expected?.Length == 1 && expected[0] is string s && s == "JSData") + { + expected = new object[] { new object[] { JavaScriptTestHelper.createData("test"), JavaScriptTestHelper.createException("test") } }; + } + var actual = JavaScriptTestHelper.echo1_ObjectArray(expected); + Assert.Equal(expected, actual); + + if (expected != null) for (int i = 0; i < expected.Length; i++) + { + var actualI = JavaScriptTestHelper.store_ObjectArray(expected, i); + Assert.Equal(expected[i], actualI); + } + } + [JSExport] public static async Task DoTestMethod() { await JavaScriptTestHelper.InitializeAsync(); int[] testData = new int[] { 1, 2, 3, int.MaxValue, int.MinValue }; - - JsImportIntArray(testData); + object[] objectTestData = { new object[] { string.Intern("hello"), string.Empty } }; + JsImportObjectArray(objectTestData); + //JsImportArraySegmentOfInt32(); + //JsImportArraySegmentOfDouble(); + //JsImportSpanOfDouble(); + //JsImportIntArray(testData); //JsExportVoidPtr(-9223372036854775808); //IntPtr.MinValue //JsExportVoidPtr(IntPtr.MinValue); //await JsExportTaskOfInt(-2147483648); diff --git a/src/mono/sample/wasm/browser-test-debug/main.js b/src/mono/sample/wasm/browser-test-debug/main.js index eff48a1ac2e086..7455a37bdd95fa 100644 --- a/src/mono/sample/wasm/browser-test-debug/main.js +++ b/src/mono/sample/wasm/browser-test-debug/main.js @@ -27,7 +27,9 @@ try { // This is called during emscripten `dotnet.wasm` instantiation, after we fetched config. console.log('user code Module.onConfigLoaded'); // config is loaded and could be tweaked before the rest of the runtime startup sequence - config.environmentVariables["MONO_LOG_LEVEL"] = "debug"; + config.environmentVariables["MONO_LOG_LEVEL"] = "debug"; + // 1 or lower = None, 2 = info, 3 = debug, 4 = verbose, 5 = trace + config.environmentVariables["MH_LOG_VERBOSITY"] = "2"; }, preInit: () => { console.log('user code Module.preInit'); }, preRun: () => { console.log('user code Module.preRun'); }, diff --git a/src/native/public/mono/metadata/mh_log.h b/src/native/public/mono/metadata/mh_log.h index 5fe192fb99847e..8b458048259d3d 100644 --- a/src/native/public/mono/metadata/mh_log.h +++ b/src/native/public/mono/metadata/mh_log.h @@ -1,34 +1,39 @@ #pragma once #include #include +#include -static int MH_LOG_indent_level = 0; -#if(1) -#define MH_LOG(msg, ...) do { } while (0) -#define MH_LOG_INDENT() do { } while (0) -#define MH_LOG_UNINDENT() do { } while (0) +#define MH_LVL_TRACE 5 +#define MH_LVL_VERBOSE 4 +#define MH_LVL_DEBUG 3 +#define MH_LVL_INFO 2 -#define MH_LOG_ALWAYS(msg, ...) { \ - printf("MH_FORCED_LOG: "); \ - for (int mh_idx = 0; mh_idx < MH_LOG_indent_level; mh_idx++) { \ - printf(" "); \ - } \ - printf("%s : %s | %d :: ", __func__, __FILE__, __LINE__); \ - printf(msg, ##__VA_ARGS__); \ - printf("\n"); \ - fflush(stdout); \ +static int MH_LOG_indent_level = 0; +static int MH_LOG_verbosity_level = MH_LVL_INFO; +static int get_mh_log_verbosity() { + const char* env = getenv("MH_LOG_VERBOSITY"); + if (env) { + MH_LOG_verbosity_level = atoi(env); + } else { + MH_LOG_verbosity_level = MH_LVL_INFO; // Default verbosity + } + return MH_LOG_verbosity_level; } -#else -#define MH_LOG(msg, ...) { \ - printf("MH_NATIVE_LOG: "); \ - for (int mh_idx = 0; mh_idx < MH_LOG_indent_level; mh_idx++) { \ - printf(" "); \ +// make default verbosity MH_LVL_DEBUG (3). Set MH_LOG_VERBOSITY to this or higher for more verbose logging +#define MH_LOG(msg, ...) MH_LOGV(MH_LVL_TRACE, msg, ##__VA_ARGS__) + +#define MH_LOGV(verbosity, msg, ...) { \ + if ((verbosity) <= get_mh_log_verbosity()) { \ + printf("MH_NATIVE_LOG: "); \ + for (int mh_idx = 0; mh_idx < MH_LOG_indent_level; mh_idx++) { \ + printf(" "); \ + } \ + printf("%s : %s | %d :: ", __func__, __FILE__, __LINE__); \ + printf(msg, ##__VA_ARGS__); \ + printf("\n"); \ + fflush(stdout); \ } \ - printf("%s : %s | %d :: ", __func__, __FILE__, __LINE__); \ - printf(msg, ##__VA_ARGS__); \ - printf("\n"); \ - fflush(stdout); \ } #define MH_LOG_INDENT() { \ @@ -38,7 +43,7 @@ static int MH_LOG_indent_level = 0; #define MH_LOG_UNINDENT() { \ MH_LOG_indent_level--; \ } -#endif + extern void log_mono_type(MonoType* type) ; extern void log_mono_type_enum(MonoTypeEnum type_enum); extern void log_mint_type(int value); From 92766e323760a4ba8acdd10051c728ced5066acd Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 12 Aug 2025 08:46:37 +0100 Subject: [PATCH 151/209] Remove trailing whitespace --- .../JavaScript/Marshaling/JSMarshalerArgument.Task.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.Task.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.Task.cs index bc22d600bfb944..99c2730f8fe8dd 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.Task.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.Task.cs @@ -110,7 +110,7 @@ public unsafe void ToManaged(out Task? value, ArgumentToManagedCallback #if FEATURE_WASM_MANAGED_THREADS lock (ctx) #endif - { + { var holder = ctx.GetPromiseHolder(slot.GCHandle); TaskCompletionSource tcs = new TaskCompletionSource(holder, TaskCreationOptions.RunContinuationsAsynchronously); ToManagedCallback callback = (JSMarshalerArgument* arguments_buffer) => From 69dc1441ed7b47630f3b0178f7629b1def5fb139 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 12 Aug 2025 11:24:39 +0100 Subject: [PATCH 152/209] Address function signature mismatch of RegisterGCRoot --- src/libraries/Common/src/Interop/Browser/Interop.Runtime.cs | 2 +- .../JavaScript/Marshaling/JSMarshalerArgument.Object.cs | 2 +- .../JavaScript/Marshaling/JSMarshalerArgument.String.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libraries/Common/src/Interop/Browser/Interop.Runtime.cs b/src/libraries/Common/src/Interop/Browser/Interop.Runtime.cs index aa35d57828ee3a..d1bd5b36bd3a04 100644 --- a/src/libraries/Common/src/Interop/Browser/Interop.Runtime.cs +++ b/src/libraries/Common/src/Interop/Browser/Interop.Runtime.cs @@ -35,7 +35,7 @@ internal static unsafe partial class Runtime #if !ENABLE_JS_INTEROP_BY_VALUE [MethodImpl(MethodImplOptions.InternalCall)] - public static extern nint RegisterGCRoot(void* start, int bytesSize, IntPtr name); + public static extern int RegisterGCRoot(void* start, nint bytesSize, IntPtr name); [MethodImpl(MethodImplOptions.InternalCall)] public static extern void DeregisterGCRoot(nint handle); #endif diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.Object.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.Object.cs index d9ed7cd4285851..2ce9a74a3860e4 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.Object.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.Object.cs @@ -378,7 +378,7 @@ public unsafe void ToJS(object?[] value) JSMarshalerArgument* payload = (JSMarshalerArgument*)Marshal.AllocHGlobal(bytes); Unsafe.InitBlock(payload, 0, (uint)bytes); #if !ENABLE_JS_INTEROP_BY_VALUE - Interop.Runtime.RegisterGCRoot(payload, bytes, IntPtr.Zero); + Interop.Runtime.RegisterGCRoot(payload, (nint)bytes, IntPtr.Zero); #endif for (int i = 0; i < slot.Length; i++) { diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.String.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.String.cs index d0e2d9cb7f9f71..2ccbb68ac6c033 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.String.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.String.cs @@ -120,7 +120,7 @@ public unsafe void ToJS(string?[] value) JSMarshalerArgument* payload = (JSMarshalerArgument*)Marshal.AllocHGlobal(bytes); Unsafe.InitBlock(payload, 0, (uint)bytes); #if !ENABLE_JS_INTEROP_BY_VALUE - Interop.Runtime.RegisterGCRoot(payload, bytes, IntPtr.Zero); + Interop.Runtime.RegisterGCRoot(payload, (nint)bytes, IntPtr.Zero); #endif for (int i = 0; i < slot.Length; i++) { From 1f68b366acf8a0ffcbc91eddf1efdeff2a1cd8cd Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 12 Aug 2025 11:25:12 +0100 Subject: [PATCH 153/209] Update Assert.True to behave like xunit, increase log verbosity --- .../sample/wasm/browser-test-debug/Program.cs | 57 +++++++++++++++---- .../sample/wasm/browser-test-debug/main.js | 2 +- 2 files changed, 47 insertions(+), 12 deletions(-) diff --git a/src/mono/sample/wasm/browser-test-debug/Program.cs b/src/mono/sample/wasm/browser-test-debug/Program.cs index 03b39f5567bbf6..2d7aa6f4319467 100644 --- a/src/mono/sample/wasm/browser-test-debug/Program.cs +++ b/src/mono/sample/wasm/browser-test-debug/Program.cs @@ -2,11 +2,13 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Collections; +using System.Collections.Generic; using System.Runtime.CompilerServices; -using System.Runtime.InteropServices.JavaScript; using System.Runtime.InteropServices; -using System.Threading.Tasks; +using System.Runtime.InteropServices.JavaScript; using System.Runtime.InteropServices.JavaScript.Tests; +using System.Threading.Tasks; namespace Sample { @@ -23,7 +25,24 @@ private static string FormatIfArray(object? obj) for (int i = 0; i < arr.Length; i++) { if (i > 0) items.Append(", "); - items.Append(arr.GetValue(i)?.ToString()); + var value = arr.GetValue(i); + // Recursively format nested arrays + items.Append(FormatIfArray(value)); + } + items.Append(']'); + return items.ToString(); + } + // For collections (e.g., List) + if (obj is IEnumerable enumerable && !(obj is string)) + { + var items = new System.Text.StringBuilder(); + items.Append('['); + bool first = true; + foreach (var value in enumerable) + { + if (!first) items.Append(", "); + items.Append(FormatIfArray(value)); + first = false; } items.Append(']'); return items.ToString(); @@ -42,28 +61,39 @@ public static void NotEqual(T expected, T actual) } public static void Equal(T expected, T actual) { + // Handle nulls + if (ReferenceEquals(expected, actual)) + return; + if (expected is null || actual is null) + throw new Exception($"AssertHelper.Equal failed. Expected: {FormatIfArray(expected)}, Actual: {FormatIfArray(actual)}."); + + // Recursively compare arrays if (expected is Array expectedArray && actual is Array actualArray) { if (expectedArray.Length != actualArray.Length) - { - throw new Exception($"AssertHelper.Equal failed. Array lengths differ. Expected: {expectedArray.Length}, Actual: {actualArray.Length}. Expected: {FormatIfArray(expectedArray)}, Actual: {FormatIfArray(actualArray)}."); - } + throw new Exception($"AssertHelper.Equal failed. Array lengths differ. Expected: {FormatIfArray(expectedArray)}, Actual: {FormatIfArray(actualArray)}."); + for (int i = 0; i < expectedArray.Length; i++) { var e = expectedArray.GetValue(i); var a = actualArray.GetValue(i); - if (!object.Equals(e, a)) + try { - throw new Exception($"AssertHelper.Equal failed at index {i}. Expected: {FormatIfArray(expectedArray)}, Actual: {FormatIfArray(actualArray)}."); + // Recursively call Equal for nested arrays/objects + Equal(e, a); + } + catch (Exception ex) + { + throw new Exception($"AssertHelper.Equal failed at index {i}. Expected: {FormatIfArray(expectedArray)}, Actual: {FormatIfArray(actualArray)}. Inner: {ex.Message}"); } } return; } + + // Fallback to default equality if (!object.Equals(expected, actual)) { - string expectedStr = FormatIfArray(expected); - string actualStr = FormatIfArray(actual); - throw new Exception($"AssertHelper.Equal failed. Expected: {expectedStr}. Actual: {actualStr}."); + throw new Exception($"AssertHelper.Equal failed. Expected: {FormatIfArray(expected)}, Actual: {FormatIfArray(actual)}."); } } public static void True(bool condition) @@ -165,8 +195,13 @@ public static unsafe void JsImportObjectArray(object[]? expected) expected = new object[] { new object[] { JavaScriptTestHelper.createData("test"), JavaScriptTestHelper.createException("test") } }; } var actual = JavaScriptTestHelper.echo1_ObjectArray(expected); + Console.WriteLine($"Checking two arrays for equality: expected={0}, actual={1}", + expected == null ? "null" : string.Join(", ", expected), + actual == null ? "null" : string.Join(", ", actual)); + Assert.Equal(expected, actual); + Console.WriteLine("Checking element-wise equality of arrays."); if (expected != null) for (int i = 0; i < expected.Length; i++) { var actualI = JavaScriptTestHelper.store_ObjectArray(expected, i); diff --git a/src/mono/sample/wasm/browser-test-debug/main.js b/src/mono/sample/wasm/browser-test-debug/main.js index 7455a37bdd95fa..ef8446964e84c3 100644 --- a/src/mono/sample/wasm/browser-test-debug/main.js +++ b/src/mono/sample/wasm/browser-test-debug/main.js @@ -29,7 +29,7 @@ try { // config is loaded and could be tweaked before the rest of the runtime startup sequence config.environmentVariables["MONO_LOG_LEVEL"] = "debug"; // 1 or lower = None, 2 = info, 3 = debug, 4 = verbose, 5 = trace - config.environmentVariables["MH_LOG_VERBOSITY"] = "2"; + config.environmentVariables["MH_LOG_VERBOSITY"] = "5"; }, preInit: () => { console.log('user code Module.preInit'); }, preRun: () => { console.log('user code Module.preRun'); }, From af7013e5d45c2eee6e92897ab487bd0c97166e9a Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 12 Aug 2025 20:59:22 +0100 Subject: [PATCH 154/209] Update test to check correct type --- .../Runtime/InteropServices/JavaScript/JSImportTest.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSImportTest.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSImportTest.cs index 133a50adfca3b2..7ba7e3f7614d68 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSImportTest.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSImportTest.cs @@ -665,13 +665,14 @@ public void JsImportSingle(float value) [MemberData(nameof(MarshalIntPtrCases))] public void JsImportIntPtr(IntPtr value) { + string expectedType = IntPtr.Size == 4 ? "number" : "bigint"; JsImportTest(value, JavaScriptTestHelper.store1_IntPtr, JavaScriptTestHelper.retrieve1_IntPtr, JavaScriptTestHelper.echo1_IntPtr, JavaScriptTestHelper.throw1_IntPtr, JavaScriptTestHelper.identity1_IntPtr, - "number"); + expectedType); } #endregion IntPtr @@ -691,7 +692,8 @@ public unsafe void JsImportVoidPtr(IntPtr xvalue) Assert.True(value == res); var actualJsType = JavaScriptTestHelper.getType1(); - Assert.Equal("number", actualJsType); + string expectedType = IntPtr.Size == 4 ? "number" : "bigint"; + Assert.Equal(expectedType, actualJsType); } #endregion VoidPtr From efcbd4c9e1d74ca66d3fdfc88164b6999b1b0422 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 12 Aug 2025 21:00:02 +0100 Subject: [PATCH 155/209] Call GC.Collect on test disposal, prevents OOB access errors in later tests --- .../InteropServices/JavaScript/JavaScriptTestHelper.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JavaScriptTestHelper.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JavaScriptTestHelper.cs index 26b81d5bf52273..359a7c4fe8bafc 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JavaScriptTestHelper.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JavaScriptTestHelper.cs @@ -1074,10 +1074,12 @@ public static async Task InitializeAsync() } } - public static Task DisposeAsync() + public static async Task DisposeAsync() { _module?.Dispose(); _module = null; + await Task.Yield(); + GC.Collect(); return Task.CompletedTask; } } From 12ce1f35753bf37d17c2357692780fbee7696013 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 12 Aug 2025 21:00:20 +0100 Subject: [PATCH 156/209] Test app Assert methods --- .../sample/wasm/browser-test-debug/Program.cs | 65 ++++++++++++++++++- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/src/mono/sample/wasm/browser-test-debug/Program.cs b/src/mono/sample/wasm/browser-test-debug/Program.cs index 2d7aa6f4319467..28149e8b8ba87e 100644 --- a/src/mono/sample/wasm/browser-test-debug/Program.cs +++ b/src/mono/sample/wasm/browser-test-debug/Program.cs @@ -96,6 +96,17 @@ public static void Equal(T expected, T actual) throw new Exception($"AssertHelper.Equal failed. Expected: {FormatIfArray(expected)}, Actual: {FormatIfArray(actual)}."); } } + public static void Same(object? expected, object? actual) + { + if (!ReferenceEquals(expected, actual)) + { + string expectedStr = FormatIfArray(expected); + string actualStr = FormatIfArray(actual); + throw new Exception( + $"AssertHelper.Same failed. Expected and actual are not the same reference.\nExpected: {expectedStr}\nActual: {actualStr}" + ); + } + } public static void True(bool condition) { if (!condition) @@ -106,6 +117,14 @@ public static void False(bool condition) if (condition) throw new Exception("AssertHelper.False failed. Condition was true."); } + public static void StartsWith(string expectedStart, string? actual) + { + if (actual == null) + throw new Exception($"AssertHelper.StartsWith failed. Actual string was null. Expected start: \"{expectedStart}\"."); + + if (!actual.StartsWith(expectedStart, StringComparison.Ordinal)) + throw new Exception($"AssertHelper.StartsWith failed. Expected string starting with: \"{expectedStart}\". Actual: \"{actual}\"."); + } } public static async Task Main(string[] args) { @@ -209,13 +228,53 @@ public static unsafe void JsImportObjectArray(object[]? expected) } } + public static unsafe void JsImportVoidPtr(IntPtr xvalue) + { + void* value = (void*)xvalue; + + JavaScriptTestHelper.store1_VoidPtr(value); + void* res = JavaScriptTestHelper.retrieve1_VoidPtr(); + Assert.True(value == res); + res = JavaScriptTestHelper.echo1_VoidPtr(value); + Assert.True(value == res); + + var actualJsType = JavaScriptTestHelper.getType1(); + string expectedType = IntPtr.Size == 4 ? "number" : "bigint"; + Assert.Equal(expectedType, actualJsType); + } + + public static async Task JsImportTaskTypes() + { + for (int i = 0; i < 100; i++) + { + object a = new object(); + Exception e = new Exception(); + JSObject j = JSHost.GlobalThis; + Assert.Equal("test", await JavaScriptTestHelper.echopromise_String("test")); + Assert.Same(a, await JavaScriptTestHelper.echopromise_Object(a)); + Assert.Same(e, await JavaScriptTestHelper.echopromise_Exception(e)); + Assert.Same(j, await JavaScriptTestHelper.echopromise_JSObject(j)); + GC.Collect(); + await Task.Delay(10); + } + } + public static void JsImportInstanceMember() + { + var actual = JavaScriptTestHelper.MemberEcho("t-e-s-t"); + Assert.StartsWith("t-e-s-t-w-i-t-h-i-n-s-t-a-n-c-e", actual); + } [JSExport] public static async Task DoTestMethod() { await JavaScriptTestHelper.InitializeAsync(); - int[] testData = new int[] { 1, 2, 3, int.MaxValue, int.MinValue }; - object[] objectTestData = { new object[] { string.Intern("hello"), string.Empty } }; - JsImportObjectArray(objectTestData); + //int[] testData = new int[] { 1, 2, 3, int.MaxValue, int.MinValue }; + //object[] objectTestData = { new object[] { string.Intern("hello"), string.Empty } }; + JsImportInstanceMember(); + JsImportInstanceMember(); + await JsImportTaskTypes(); + //JsImportVoidPtr((IntPtr)42); + + //JsImportObjectArray(objectTestData); //JsImportArraySegmentOfInt32(); //JsImportArraySegmentOfDouble(); //JsImportSpanOfDouble(); From 4799bea0997fff5170bae490d21ccbb897284228 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 14 Aug 2025 08:49:40 +0100 Subject: [PATCH 157/209] Improve BigInt64 support for JS interop Size of marshalling struct has been increased (for both 32 and 64bit) so modify test. Add marshaling support for bigint --- .../Marshaling/JSMarshalerArgument.Object.cs | 5 +++++ .../Runtime/InteropServices/JavaScript/JSImportTest.cs | 2 +- src/mono/browser/runtime/marshal-to-cs.ts | 10 +++++++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.Object.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.Object.cs index 2ce9a74a3860e4..e1a3925fc9f070 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.Object.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.Object.cs @@ -41,6 +41,11 @@ public unsafe void ToManaged(out object? value) ToManaged(out double v); value = v; } + else if (slot.Type == MarshalerType.BigInt64) + { + ToManagedBig(out long v); + value = v; + } else if (slot.Type == MarshalerType.JSObject) { ToManaged(out JSObject? val); diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSImportTest.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSImportTest.cs index 7ba7e3f7614d68..37bfb17a11680d 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSImportTest.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSImportTest.cs @@ -17,7 +17,7 @@ public class JSImportTest : JSInteropTestBase, IAsyncLifetime [Fact] public unsafe void StructSize() { - Assert.Equal(32, sizeof(JSMarshalerArgument)); + Assert.Equal(64, sizeof(JSMarshalerArgument)); } [Fact] diff --git a/src/mono/browser/runtime/marshal-to-cs.ts b/src/mono/browser/runtime/marshal-to-cs.ts index 3865a4ddbea49b..5e5ba663605d00 100644 --- a/src/mono/browser/runtime/marshal-to-cs.ts +++ b/src/mono/browser/runtime/marshal-to-cs.ts @@ -25,7 +25,8 @@ import { JSMarshalerArgument, JSMarshalerArguments, JSMarshalerType, MarshalerTo import { TypedArray } from "./types/emscripten"; export const jsinteropDoc = "For more information see https://aka.ms/dotnet-wasm-jsinterop"; - +export const MAX_BIGINT64 = 9223372036854775807n; +export const MIN_BIGINT64 = -9223372036854775808n; export function initialize_marshalers_to_cs (): void { if (js_to_cs_marshalers.size == 0) { js_to_cs_marshalers.set(MarshalerType.Array, marshal_array_to_cs); @@ -390,8 +391,11 @@ export function marshal_cs_object_to_cs (arg: JSMarshalerArgument, value: any): set_arg_type(arg, MarshalerType.Double); set_arg_f64(arg, value); } else if (js_type === "bigint") { - // we do it because not all bigint values could fit into Int64 - throw new Error("NotImplementedException: bigint"); + if (value < MIN_BIGINT64 || value > MAX_BIGINT64) { + throw new Error(`bigint value ${value} does not fit in Int64`); + } + set_arg_type(arg, MarshalerType.BigInt64); + set_arg_i64_big(arg, value); } else if (js_type === "boolean") { set_arg_type(arg, MarshalerType.Boolean); set_arg_bool(arg, value); From e79ffac6a2da5ea7830f6f999af4b37f772e1312 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 14 Aug 2025 10:38:18 +0100 Subject: [PATCH 158/209] Check length is defined Implemented like this to let tests continue to pass --- src/mono/browser/runtime/marshal-to-cs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/browser/runtime/marshal-to-cs.ts b/src/mono/browser/runtime/marshal-to-cs.ts index 5e5ba663605d00..9caba9e4e320e4 100644 --- a/src/mono/browser/runtime/marshal-to-cs.ts +++ b/src/mono/browser/runtime/marshal-to-cs.ts @@ -462,7 +462,7 @@ export function marshal_array_to_cs_impl (arg: JSMarshalerArgument, value: Array } else { const element_size = array_element_size(element_type); mono_assert(element_size != -1, () => `Element type ${element_type} not supported`); - const length = value.length; + const length = value.length ?? 1; const buffer_length = element_size * length; const buffer_ptr = malloc(buffer_length) as any; if (element_type == MarshalerType.String) { From 92e8a76fecbdb84bd5076f258be7e14d4aee188b Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 20 Aug 2025 08:31:29 +0100 Subject: [PATCH 159/209] Add ability to set MH_log verbosity from JS --- src/mono/browser/runtime/cwraps.ts | 6 ++++++ src/mono/browser/runtime/debug.ts | 7 +++++++ src/mono/browser/runtime/driver.c | 14 +++++++++++++ src/mono/browser/runtime/exports-internal.ts | 5 ++++- src/mono/mono/metadata/mh_log.c | 20 ++++++++++++++++++ src/native/public/mono/metadata/mh_log.h | 22 ++++++++++---------- 6 files changed, 62 insertions(+), 12 deletions(-) diff --git a/src/mono/browser/runtime/cwraps.ts b/src/mono/browser/runtime/cwraps.ts index e1b9d1c6d2f737..3b9ac190cea824 100644 --- a/src/mono/browser/runtime/cwraps.ts +++ b/src/mono/browser/runtime/cwraps.ts @@ -49,6 +49,9 @@ const fn_signatures: SigLine[] = [ [false, "mono_wasm_load_runtime", null, ["number"]], [true, "mono_wasm_change_debugger_log_level", "void", ["number"]], + [true, "MH_TestVoid", "void", []], + [true, "MH_SetLogVerbosity", "void", ["number"]], + [true, "mono_wasm_assembly_load", "pointer", ["string"]], [true, "mono_wasm_assembly_find_class", "pointer", ["pointer", "string", "string"]], [true, "mono_wasm_assembly_find_method", "pointer", ["pointer", "string", "number"]], @@ -176,6 +179,9 @@ export interface t_Cwraps { mono_wasm_load_runtime(debugLevel: number): void; mono_wasm_change_debugger_log_level(value: number): void; + MH_TestVoid(): void; + MH_SetLogVerbosity(value: number): void; + mono_wasm_assembly_load(name: string): MonoAssembly; mono_wasm_assembly_find_class(assembly: MonoAssembly, namespace: string, name: string): MonoClass; mono_wasm_assembly_find_method(klass: MonoClass, name: string, args: number): MonoMethod; diff --git a/src/mono/browser/runtime/debug.ts b/src/mono/browser/runtime/debug.ts index 522c3c41158b28..2ef74e916997d4 100644 --- a/src/mono/browser/runtime/debug.ts +++ b/src/mono/browser/runtime/debug.ts @@ -123,6 +123,13 @@ export function mono_wasm_change_debugger_log_level (level: number): void { cwraps.mono_wasm_change_debugger_log_level(level); } +export function MH_TestVoid (): void { + cwraps.MH_TestVoid(); +} + +export function MH_SetLogVerbosity (value: number): void { + cwraps.MH_SetLogVerbosity(value); +} /** * Raises an event for the debug proxy */ diff --git a/src/mono/browser/runtime/driver.c b/src/mono/browser/runtime/driver.c index 54ef1b226a648e..b23f195521219a 100644 --- a/src/mono/browser/runtime/driver.c +++ b/src/mono/browser/runtime/driver.c @@ -104,6 +104,20 @@ typedef int32_t d_handle; #include #include +EMSCRIPTEN_KEEPALIVE void MH_TestVoid() +{ + printf("MH_TestVoid called\n"); +} + +EMSCRIPTEN_KEEPALIVE void MH_SetLogVerbosity(int32_t level) +{ + printf("MH_LOG_verbosity_level set to %d\n", level); + const char* envVar = getenv("MH_LOG_VERBOSITY"); + printf("Environment variable MH_LOG_VERBOSITY is: %s\n", envVar ? envVar : "empty"); + mh_log_set_verbosity(level); + printf("Retrieved MH_LOG_VERBOSITY: %d\n", mh_log_get_verbosity()); +} + EMSCRIPTEN_KEEPALIVE void log_message(const char *filename, const char *message) { FILE *file = fopen(filename, "a"); // Open for append, create if doesn't exist if (file == NULL) { diff --git a/src/mono/browser/runtime/exports-internal.ts b/src/mono/browser/runtime/exports-internal.ts index f604363e430e28..b710f647de8a81 100644 --- a/src/mono/browser/runtime/exports-internal.ts +++ b/src/mono/browser/runtime/exports-internal.ts @@ -5,7 +5,7 @@ import WasmEnableThreads from "consts:wasmEnableThreads"; import { MonoObjectNull, type MonoObject } from "./types/internal"; import cwraps, { profiler_c_functions, threads_c_functions as twraps } from "./cwraps"; -import { mono_wasm_send_dbg_command_with_parms, mono_wasm_send_dbg_command, mono_wasm_get_dbg_command_info, mono_wasm_get_details, mono_wasm_release_object, mono_wasm_call_function_on, mono_wasm_debugger_resume, mono_wasm_detach_debugger, mono_wasm_raise_debug_event, mono_wasm_change_debugger_log_level, mono_wasm_debugger_attached } from "./debug"; +import { mono_wasm_send_dbg_command_with_parms, mono_wasm_send_dbg_command, mono_wasm_get_dbg_command_info, mono_wasm_get_details, mono_wasm_release_object, mono_wasm_call_function_on, mono_wasm_debugger_resume, mono_wasm_detach_debugger, mono_wasm_raise_debug_event, mono_wasm_change_debugger_log_level, mono_wasm_debugger_attached, MH_TestVoid, MH_SetLogVerbosity } from "./debug"; import { http_wasm_supports_streaming_request, http_wasm_supports_streaming_response, http_wasm_create_controller, http_wasm_abort, http_wasm_transform_stream_write, http_wasm_transform_stream_close, http_wasm_fetch, http_wasm_fetch_stream, http_wasm_fetch_bytes, http_wasm_get_response_header_names, http_wasm_get_response_header_values, http_wasm_get_response_bytes, http_wasm_get_response_length, http_wasm_get_streamed_response_bytes, http_wasm_get_response_type, http_wasm_get_response_status } from "./http"; import { exportedRuntimeAPI, Module, runtimeHelpers } from "./globals"; import { get_property, set_property, has_property, get_typeof_property, get_global_this, dynamic_import } from "./invoke-js"; @@ -55,6 +55,9 @@ export function export_internal (): any { mono_wasm_runtime_is_ready: runtimeHelpers.mono_wasm_runtime_is_ready, mono_wasm_get_func_id_to_name_mappings, + MH_TestVoid, + MH_SetLogVerbosity, + // interop get_property, set_property, diff --git a/src/mono/mono/metadata/mh_log.c b/src/mono/mono/metadata/mh_log.c index 07304c73295a3d..257b1abedd4412 100644 --- a/src/mono/mono/metadata/mh_log.c +++ b/src/mono/mono/metadata/mh_log.c @@ -1,6 +1,26 @@ #include #include +static int MH_LOG_verbosity_level = MH_LVL_DEBUG; +static int MH_LOG_verbosity_initialized = 0; + +void mh_log_set_verbosity(int verbosity) +{ + MH_LOG_verbosity_level = verbosity; + MH_LOG_verbosity_initialized = 1; +} + +int mh_log_get_verbosity() { + if (!MH_LOG_verbosity_initialized) { + const char* env = getenv("MH_LOG_VERBOSITY"); + if (env) { + MH_LOG_verbosity_level = atoi(env); + } + MH_LOG_verbosity_initialized = 1; + } + return MH_LOG_verbosity_level; +} + void log_mono_type(MonoType* type) { if (!type) { diff --git a/src/native/public/mono/metadata/mh_log.h b/src/native/public/mono/metadata/mh_log.h index 8b458048259d3d..b178616b0e0cc3 100644 --- a/src/native/public/mono/metadata/mh_log.h +++ b/src/native/public/mono/metadata/mh_log.h @@ -3,28 +3,28 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #define MH_LVL_TRACE 5 #define MH_LVL_VERBOSE 4 #define MH_LVL_DEBUG 3 #define MH_LVL_INFO 2 static int MH_LOG_indent_level = 0; -static int MH_LOG_verbosity_level = MH_LVL_INFO; -static int get_mh_log_verbosity() { - const char* env = getenv("MH_LOG_VERBOSITY"); - if (env) { - MH_LOG_verbosity_level = atoi(env); - } else { - MH_LOG_verbosity_level = MH_LVL_INFO; // Default verbosity - } - return MH_LOG_verbosity_level; -} + +extern void mh_log_set_verbosity(int verbosity); +extern int mh_log_get_verbosity(); + +void MH_TestVoid(); +void MH_SetLogVerbosity(int32_t level); // make default verbosity MH_LVL_DEBUG (3). Set MH_LOG_VERBOSITY to this or higher for more verbose logging #define MH_LOG(msg, ...) MH_LOGV(MH_LVL_TRACE, msg, ##__VA_ARGS__) #define MH_LOGV(verbosity, msg, ...) { \ - if ((verbosity) <= get_mh_log_verbosity()) { \ + if ((verbosity) <= mh_log_get_verbosity()) { \ printf("MH_NATIVE_LOG: "); \ for (int mh_idx = 0; mh_idx < MH_LOG_indent_level; mh_idx++) { \ printf(" "); \ From aa33f91f00fd12fb28abd9a48afb7515fdf69eb2 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 20 Aug 2025 08:47:08 +0100 Subject: [PATCH 160/209] Test sample updates --- .../sample/wasm/browser-test-debug/Program.cs | 291 +++++++++++++++++- 1 file changed, 288 insertions(+), 3 deletions(-) diff --git a/src/mono/sample/wasm/browser-test-debug/Program.cs b/src/mono/sample/wasm/browser-test-debug/Program.cs index 28149e8b8ba87e..07c22fdb0124a2 100644 --- a/src/mono/sample/wasm/browser-test-debug/Program.cs +++ b/src/mono/sample/wasm/browser-test-debug/Program.cs @@ -50,6 +50,58 @@ private static string FormatIfArray(object? obj) return obj?.ToString() ?? "null"; } + public static TException Throws(Action action) where TException : Exception + { + try + { + action(); + } + catch (Exception ex) + { + if (ex is TException expected) + return expected; + throw new Exception($"AssertHelper.Throws failed. Expected exception of type {typeof(TException)}, but got {ex.GetType()}.\nMessage: {ex.Message}", ex); + } + throw new Exception($"AssertHelper.Throws failed. No exception was thrown. Expected exception of type {typeof(TException)}."); + } + public static void Contains(T expected, IEnumerable collection) + { + if (collection == null) + throw new Exception("AssertHelper.Contains failed. Collection is null."); + foreach (var item in collection) + { + if (object.Equals(item, expected)) + return; + } + throw new Exception($"AssertHelper.Contains failed. Expected item: {FormatIfArray(expected)} was not found in collection: {FormatIfArray(collection)}."); + } + + public static void Contains(string expectedSubstring, string? actualString) + { + if (actualString == null) + throw new Exception("AssertHelper.Contains failed. Actual string is null."); + if (!actualString.Contains(expectedSubstring, StringComparison.Ordinal)) + throw new Exception($"AssertHelper.Contains failed. Expected substring: \"{expectedSubstring}\" was not found in string: \"{actualString}\"."); + } + + public static void DoesNotContain(T expected, IEnumerable collection) + { + if (collection == null) + throw new Exception("AssertHelper.DoesNotContain failed. Collection is null."); + foreach (var item in collection) + { + if (object.Equals(item, expected)) + throw new Exception($"AssertHelper.DoesNotContain failed. Item: {FormatIfArray(expected)} was found in collection: {FormatIfArray(collection)}."); + } + } + + public static void DoesNotContain(string expectedSubstring, string? actualString) + { + if (actualString == null) + return; + if (actualString.Contains(expectedSubstring, StringComparison.Ordinal)) + throw new Exception($"AssertHelper.DoesNotContain failed. Substring: \"{expectedSubstring}\" was found in string: \"{actualString}\"."); + } public static void NotEqual(T expected, T actual) { if (object.Equals(expected, actual)) @@ -112,6 +164,11 @@ public static void True(bool condition) if (!condition) throw new Exception("AssertHelper.True failed. Condition was false."); } + public static void True(bool condition, string message) + { + if (!condition) + throw new Exception($"AssertHelper.True failed. Condition was false. {message}"); + } public static void False(bool condition) { if (condition) @@ -125,6 +182,11 @@ public static void StartsWith(string expectedStart, string? actual) if (!actual.StartsWith(expectedStart, StringComparison.Ordinal)) throw new Exception($"AssertHelper.StartsWith failed. Expected string starting with: \"{expectedStart}\". Actual: \"{actual}\"."); } + public static void Null(object? expected) + { + if (expected != null) + throw new Exception($"AssertHelper.Null failed. Expected null, but got: {FormatIfArray(expected)}."); + } } public static async Task Main(string[] args) { @@ -263,15 +325,238 @@ public static void JsImportInstanceMember() var actual = JavaScriptTestHelper.MemberEcho("t-e-s-t"); Assert.StartsWith("t-e-s-t-w-i-t-h-i-n-s-t-a-n-c-e", actual); } + + public static void JsImportNullableIntPtr(IntPtr? value) + { + string expectedType = IntPtr.Size == 4 ? "number" : "bigint"; + JsImportTest(value, + JavaScriptTestHelper.store1_NullableIntPtr, + JavaScriptTestHelper.retrieve1_NullableIntPtr, + JavaScriptTestHelper.echo1_NullableIntPtr, + JavaScriptTestHelper.throw1_NullableIntPtr, + JavaScriptTestHelper.identity1_NullableIntPtr, + expectedType); + } + + private static void JsImportTest(T value + , Action store1 + , Func retrieve1 + , Func echo1 + , Func throw1 + , Func identity1 + , string jsType, string? jsClass = null) + { + if (value == null) + { + jsClass = null; + jsType = "object"; + } + + // invoke + store1(value); + var res = retrieve1(); + Assert.Equal(value, res); + res = echo1(value); + Assert.Equal(value, res); + var equals = identity1(value); + Assert.True(equals, "value not equals"); + + var actualJsType = JavaScriptTestHelper.getType1(); + Assert.Equal(jsType, actualJsType); + + if (jsClass != null) + { + var actualJsClass = JavaScriptTestHelper.getClass1(); + Assert.Equal(jsClass, actualJsClass); + } + var exThrow0 = Assert.Throws(() => JavaScriptTestHelper.throw0()); + Assert.Contains("throw-0-msg", exThrow0.Message); + Assert.DoesNotContain(" at ", exThrow0.Message); +#if !FEATURE_WASM_MANAGED_THREADS + Assert.Contains("throw0fn", exThrow0.StackTrace); +#else + Assert.Contains("omitted JavaScript stack trace", exThrow0.StackTrace); +#endif + + var exThrow1 = Assert.Throws(() => throw1(value)); + Assert.Contains("throw1-msg", exThrow1.Message); + Assert.DoesNotContain(" at ", exThrow1.Message); +#if !FEATURE_WASM_MANAGED_THREADS + Assert.Contains("throw1fn", exThrow1.StackTrace); +#else + Assert.Contains("omitted JavaScript stack trace", exThrow0.StackTrace); +#endif + + // anything is a system.object, sometimes it would be JSObject wrapper + if (typeof(T).IsPrimitive) + { + if (typeof(T) != typeof(long)) + { + + object resBoxed = JavaScriptTestHelper.echo1_Object(value); + // js Number always boxes as double + if (typeof(T) == typeof(IntPtr)) + { + //TODO Assert.Equal((IntPtr)(object)value, (IntPtr)(int)(double)resBoxed); + } + else if (typeof(T) == typeof(bool)) + { + Assert.Equal((bool)(object)value, (bool)resBoxed); + } + else if (typeof(T) == typeof(char)) + { + Assert.Equal((char)(object)value, (char)(double)resBoxed); + } + else + { + Assert.Equal(Convert.ToDouble(value), resBoxed); + } + } + + //TODO var task = JavaScriptTestHelper.await1(Task.FromResult((object)value)); + } + else if (typeof(T) == typeof(DateTime)) + { + var resBoxed = JavaScriptTestHelper.echo1_Object(value); + Assert.Equal(value, resBoxed); + } + else if (typeof(T) == typeof(DateTimeOffset)) + { + var resBoxed = JavaScriptTestHelper.echo1_Object(value); + Assert.Equal(((DateTimeOffset)(object)value).UtcDateTime, resBoxed); + } + else if (Nullable.GetUnderlyingType(typeof(T)) != null) + { + var vt = Nullable.GetUnderlyingType(typeof(T)); + if (vt != typeof(long)) + { + var resBoxed = JavaScriptTestHelper.echo1_Object(value); + if (resBoxed != null) + { + if (vt == typeof(bool)) + { + Assert.Equal(((bool?)(object)value).Value, (bool)resBoxed); + } + else if (vt == typeof(char)) + { + Assert.Equal(((char?)(object)value).Value, (char)resBoxed); + } + else if (vt == typeof(DateTime)) + { + Assert.Equal(((DateTime?)(object)value).Value, resBoxed); + } + else if (vt == typeof(DateTimeOffset)) + { + Assert.Equal(((DateTimeOffset?)(object)value).Value.UtcDateTime, resBoxed); + } + else if (vt == typeof(IntPtr)) + { + // TODO Assert.Equal((double)((IntPtr?)(object)value).Value, resBoxed); + } + else + { + Assert.Equal(Convert.ToDouble(value), resBoxed); + } + } + else + { + Assert.Equal(value, default(T)); + } + } + } + else + { + var resObj = JavaScriptTestHelper.retrieve1_Object(); + if (resObj == null || resObj.GetType() != typeof(JSObject)) + { + Assert.Equal(value, resObj); + } + } + + if (typeof(Exception).IsAssignableFrom(typeof(T))) + { + // all exceptions are Exception + var resEx = JavaScriptTestHelper.retrieve1_Exception(); + Assert.Equal((Exception)(object)value, resEx); + } + } + + public static unsafe void BadCast() + { + JSException ex; + JSHost.DotnetInstance.SetProperty("testBool", true); + //ex = Assert.Throws(() => JSHost.DotnetInstance.GetPropertyAsInt32("testBool")); + //Assert.Contains("Value is not an integer", ex.Message); + //ex = Assert.Throws(() => JSHost.DotnetInstance.GetPropertyAsDouble("testBool")); + //Assert.Contains("Value is not a Number", ex.Message); + //ex = Assert.Throws(() => JSHost.DotnetInstance.GetPropertyAsString("testBool")); + //Assert.Contains("Value is not a String", ex.Message); + //ex = Assert.Throws(() => JSHost.DotnetInstance.GetPropertyAsJSObject("testBool")); + //Assert.Contains("JSObject proxy of boolean is not supported", ex.Message); + ex = Assert.Throws(() => JSHost.DotnetInstance.GetPropertyAsByteArray("testBool")); + Assert.Contains("Value is not an Array or Uint8Array", ex.Message); + //JSHost.DotnetInstance.SetProperty("testInt", 42); + //ex = Assert.Throws(() => JSHost.DotnetInstance.GetPropertyAsBoolean("testInt")); + //Assert.Contains("Value is not a Boolean", ex.Message); + } + + + private static bool IsNullOrWin32Atom(IntPtr ptr) + { + const long HIWORDMASK = unchecked((long)0xffffffffffff0000L); + + long lPtr = (long)ptr; + Console.WriteLine($"IsNullOrWin32Atom: {lPtr} ({ptr})"); + return 0 == (lPtr & HIWORDMASK); + } + public static void TestPtrIsAtom(IntPtr ptr) + { + Assert.True(IsNullOrWin32Atom(ptr), $"Expected {ptr} to be <64k but it is not."); + } + + public static unsafe string? MyPtrToStringUTF8(IntPtr ptr) + { + Console.WriteLine($"MyPtrToStringUTF8: {ptr}"); + if (IsNullOrWin32Atom(ptr)) + { + Console.WriteLine($"MyPtrToStringUTF8: returning NULL"); + return null; + } + + return "Junk"; + } + + public static void PtrToStringUTF8_Win32AtomPointer_ReturnsNull() + { + // Windows Marshal has specific checks that does not do + // anything if the ptr is less than 64K. + IntPtr testVal = 1; + string res = Marshal.PtrToStringUTF8(testVal); + //string res = MyPtrToStringUTF8(testVal); + Console.WriteLine($"Marshal.PtrToStringUTF8({testVal}) = {res}"); + Assert.Null(Marshal.PtrToStringUTF8((IntPtr)1)); + } + public static void PtrToStringUTF8_ZeroPointer_ReturnsNull() + { + Assert.Null(Marshal.PtrToStringUTF8(IntPtr.Zero)); + } [JSExport] public static async Task DoTestMethod() { await JavaScriptTestHelper.InitializeAsync(); //int[] testData = new int[] { 1, 2, 3, int.MaxValue, int.MinValue }; //object[] objectTestData = { new object[] { string.Intern("hello"), string.Empty } }; - JsImportInstanceMember(); - JsImportInstanceMember(); - await JsImportTaskTypes(); + + //JsImportNullableIntPtr((IntPtr)42); + //GeneralInterop.MH_SetLogVerbosity(1); // export isn't picked up! + PtrToStringUTF8_ZeroPointer_ReturnsNull(); + //IsNullOrWin32Atom((IntPtr)1); + //PtrToStringUTF8_Win32AtomPointer_ReturnsNull(); + //GetFunctionPointerForDelegate_MarshalledDelegateGeneric_ReturnsExpected(); + //BadCast(); + //JsImportInstanceMember(); + //JsImportInstanceMember(); + //await JsImportTaskTypes(); //JsImportVoidPtr((IntPtr)42); //JsImportObjectArray(objectTestData); From fca7ca152e6e82eac7d4e4d7bb24f747bcb15bf8 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Wed, 20 Aug 2025 08:47:58 +0100 Subject: [PATCH 161/209] minor changes around debug; comments, log jsimport invocation --- src/mono/browser/runtime/driver.c | 2 ++ src/mono/browser/runtime/invoke-js.ts | 9 +++++++++ src/mono/sample/wasm/browser-test-debug/main.js | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mono/browser/runtime/driver.c b/src/mono/browser/runtime/driver.c index b23f195521219a..d36e859fbf51bf 100644 --- a/src/mono/browser/runtime/driver.c +++ b/src/mono/browser/runtime/driver.c @@ -104,11 +104,13 @@ typedef int32_t d_handle; #include #include +// I put these here just to make sure they have access to EMSCRIPTEN_KEEPALIVE EMSCRIPTEN_KEEPALIVE void MH_TestVoid() { printf("MH_TestVoid called\n"); } +// I put these here just to make sure they have access to EMSCRIPTEN_KEEPALIVE EMSCRIPTEN_KEEPALIVE void MH_SetLogVerbosity(int32_t level) { printf("MH_LOG_verbosity_level set to %d\n", level); diff --git a/src/mono/browser/runtime/invoke-js.ts b/src/mono/browser/runtime/invoke-js.ts index d39c269fa13356..0f235aff591ed8 100644 --- a/src/mono/browser/runtime/invoke-js.ts +++ b/src/mono/browser/runtime/invoke-js.ts @@ -86,8 +86,17 @@ export function mono_wasm_invoke_jsimport_MT (signature: JSFunctionSignature, ar bound_fn(args); } +function log_function_name_from_handle (function_handle: JSFnHandle): void { + const bound_fn = js_import_wrapper_by_fn_handle[function_handle]; + const closure = (bound_fn as any)[imported_js_function_symbol]; + if (closure) { + mono_log_debug(() => `Invoking ${closure.fqn}`); + } +} + export function mono_wasm_invoke_jsimport_ST (function_handle: JSFnHandle, args: JSMarshalerArguments): void { if (WasmEnableThreads) return; + log_function_name_from_handle(function_handle); loaderHelpers.assert_runtime_running(); args = fixupPointer(args, 0); const bound_fn = js_import_wrapper_by_fn_handle[function_handle]; diff --git a/src/mono/sample/wasm/browser-test-debug/main.js b/src/mono/sample/wasm/browser-test-debug/main.js index ef8446964e84c3..05ef3a3831b960 100644 --- a/src/mono/sample/wasm/browser-test-debug/main.js +++ b/src/mono/sample/wasm/browser-test-debug/main.js @@ -29,7 +29,7 @@ try { // config is loaded and could be tweaked before the rest of the runtime startup sequence config.environmentVariables["MONO_LOG_LEVEL"] = "debug"; // 1 or lower = None, 2 = info, 3 = debug, 4 = verbose, 5 = trace - config.environmentVariables["MH_LOG_VERBOSITY"] = "5"; + config.environmentVariables["MH_LOG_VERBOSITY"] = "3"; }, preInit: () => { console.log('user code Module.preInit'); }, preRun: () => { console.log('user code Module.preRun'); }, From ada86e2248900d834cb8bc78717b4cd845d03c8f Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 28 Aug 2025 13:05:47 +0100 Subject: [PATCH 162/209] Removed some debugging output that's no longer required --- src/mono/browser/runtime/invoke-cs.ts | 4 ++-- src/mono/browser/runtime/invoke-js.ts | 16 ++++++++-------- src/mono/browser/runtime/marshal.ts | 5 +---- src/mono/browser/runtime/strings.ts | 8 -------- 4 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/mono/browser/runtime/invoke-cs.ts b/src/mono/browser/runtime/invoke-cs.ts index 3b7a869e8661c3..6dd8eba2c10b81 100644 --- a/src/mono/browser/runtime/invoke-cs.ts +++ b/src/mono/browser/runtime/invoke-cs.ts @@ -15,12 +15,12 @@ import { MonoMethod, JSFunctionSignature, BoundMarshalerToCs, BoundMarshalerToJs import { assert_js_interop } from "./invoke-js"; import { startMeasure, MeasuredBlock, endMeasure } from "./profiler"; import { bind_assembly_exports, invoke_async_jsexport, invoke_sync_jsexport } from "./managed-exports"; -import { mono_log_debug } from "./logging"; +//import { mono_log_debug } from "./logging"; export function mono_wasm_bind_cs_function (method: MonoMethod, assemblyName: string, namespaceName: string, shortClassName: string, methodName: string, signatureHash: number, signature: JSFunctionSignature): void { const fullyQualifiedName = `[${assemblyName}] ${namespaceName}.${shortClassName}:${methodName}`; const mark = startMeasure(); - mono_log_debug(() => `Binding [JSExport] ${namespaceName}.${shortClassName}:${methodName} from ${assemblyName} assembly`); + //mono_log_debug(() => `Binding [JSExport] ${namespaceName}.${shortClassName}:${methodName} from ${assemblyName} assembly`); const version = get_signature_version(signature); mono_assert(version === 2, () => `Signature version ${version} mismatch.`); diff --git a/src/mono/browser/runtime/invoke-js.ts b/src/mono/browser/runtime/invoke-js.ts index 0f235aff591ed8..51373a1b0885a0 100644 --- a/src/mono/browser/runtime/invoke-js.ts +++ b/src/mono/browser/runtime/invoke-js.ts @@ -86,17 +86,17 @@ export function mono_wasm_invoke_jsimport_MT (signature: JSFunctionSignature, ar bound_fn(args); } -function log_function_name_from_handle (function_handle: JSFnHandle): void { - const bound_fn = js_import_wrapper_by_fn_handle[function_handle]; - const closure = (bound_fn as any)[imported_js_function_symbol]; - if (closure) { - mono_log_debug(() => `Invoking ${closure.fqn}`); - } -} +//function log_function_name_from_handle (function_handle: JSFnHandle): void { +// const bound_fn = js_import_wrapper_by_fn_handle[function_handle]; +// const closure = (bound_fn as any)[imported_js_function_symbol]; +// if (closure) { +// mono_log_debug(() => `Invoking ${closure.fqn}`); +// } +//} export function mono_wasm_invoke_jsimport_ST (function_handle: JSFnHandle, args: JSMarshalerArguments): void { if (WasmEnableThreads) return; - log_function_name_from_handle(function_handle); + //log_function_name_from_handle(function_handle); loaderHelpers.assert_runtime_running(); args = fixupPointer(args, 0); const bound_fn = js_import_wrapper_by_fn_handle[function_handle]; diff --git a/src/mono/browser/runtime/marshal.ts b/src/mono/browser/runtime/marshal.ts index 1906539df933f8..492a830b23bf3a 100644 --- a/src/mono/browser/runtime/marshal.ts +++ b/src/mono/browser/runtime/marshal.ts @@ -13,7 +13,7 @@ import { GCHandle, JSHandle, MonoObject, MonoString, GCHandleNull, JSMarshalerAr import { TypedArray, VoidPtr } from "./types/emscripten"; import { utf16ToString } from "./strings"; import { get_managed_stack_trace } from "./managed-exports"; -import { mono_log_debug } from "./logging"; +//import { mono_log_debug } from "./logging"; export const cs_to_js_marshalers = new Map(); export const js_to_cs_marshalers = new Map(); @@ -161,19 +161,16 @@ export function get_signature_res_type (sig: JSMarshalerType): MarshalerType { export function get_signature_arg1_type (sig: JSMarshalerType): MarshalerType { mono_assert(sig, "Null sig"); - mono_log_debug(`get_signature_arg1_type for sig '${sig}' is '${getU8(add_offset(sig, JSBindingTypeOffsets.Arg1MarshalerType))}'`); return getU8(add_offset(sig, JSBindingTypeOffsets.Arg1MarshalerType)) as any; } export function get_signature_arg2_type (sig: JSMarshalerType): MarshalerType { mono_assert(sig, "Null sig"); - mono_log_debug(`get_signature_arg3_type for sig '${sig}' is '${getU8(add_offset(sig, JSBindingTypeOffsets.Arg2MarshalerType))}'`); return getU8(add_offset(sig, JSBindingTypeOffsets.Arg2MarshalerType)) as any; } export function get_signature_arg3_type (sig: JSMarshalerType): MarshalerType { mono_assert(sig, "Null sig"); - mono_log_debug(`get_signature_arg3_type for sig '${sig}' is '${getU8(add_offset(sig, JSBindingTypeOffsets.Arg3MarshalerType))}'`); return getU8(add_offset(sig, JSBindingTypeOffsets.Arg3MarshalerType)) as any; } diff --git a/src/mono/browser/runtime/strings.ts b/src/mono/browser/runtime/strings.ts index da5a870ce0d39b..502a9541b49a43 100644 --- a/src/mono/browser/runtime/strings.ts +++ b/src/mono/browser/runtime/strings.ts @@ -10,7 +10,6 @@ import cwraps from "./cwraps"; import { isSharedArrayBuffer, localHeapViewU8, getU32_local, setU16_local, localHeapViewU32, getU16_local, localHeapViewU16, _zero_region, malloc, free } from "./memory"; import { NativePointer, CharPtr, VoidPtr } from "./types/emscripten"; import { safeBigIntToNumber } from "./invoke-js"; -import { mono_log_debug } from "./logging"; export const interned_js_string_table = new Map(); export const mono_wasm_empty_string = ""; @@ -62,11 +61,9 @@ export function stringToUTF8Ptr (str: string): CharPtr { export function utf8ToStringRelaxed (buffer: Uint8Array): string { if (_text_decoder_utf8_relaxed === undefined) { const retval = Module.UTF8ArrayToString(buffer, 0, buffer.byteLength); - mono_log_debug("utf8ToStringRelaxed: UTF8ArrayToString got " + retval); return retval; } const retval = _text_decoder_utf8_relaxed.decode(buffer); - mono_log_debug("utf8ToStringRelaxed: _text_decoder_utf8_relaxed.decode got " + retval); return retval; } @@ -93,17 +90,14 @@ export function utf8BufferToString (heapOrArray: Uint8Array, idx: number, maxByt while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr; if (endPtr - idx <= 16) { const retval = Module.UTF8ArrayToString(heapOrArray, idx, maxBytesToRead); - mono_log_debug("utf8BufferToString: Module.UTF8ArrayToStrin got " + retval); return retval; } if (_text_decoder_utf8_validating === undefined) { const retval = Module.UTF8ArrayToString(heapOrArray, idx, maxBytesToRead); - mono_log_debug("utf8BufferToString: Module.UTF8ArrayToString got " + retval); return retval; } const view = viewOrCopy(heapOrArray, idx as any, endPtr as any); const retval = _text_decoder_utf8_validating.decode(view); - mono_log_debug("utf8BufferToString: _text_decoder_utf8_validating.decode got " + retval); return retval; } @@ -190,8 +184,6 @@ export function stringToMonoStringRoot (string: string, result: WasmRoot Date: Thu, 28 Aug 2025 13:08:40 +0100 Subject: [PATCH 163/209] Debugging changes use local xharness, write out gc log --- .../WasmTestRunner/WasmTestRunner.csproj | 16 +- .../sample/wasm/browser-test-debug/Assert.cs | 180 +++++ .../wasm/browser-test-debug/GCHandleTests.cs | 414 ++++++++++ .../sample/wasm/browser-test-debug/Program.cs | 227 ++---- .../wasm/browser-test-debug/TryWrite.cs | 730 ++++++++++++++++++ .../Wasm.Test.Debug.Sample.csproj | 14 +- .../sample/wasm/browser-test-debug/main.js | 33 +- 7 files changed, 1430 insertions(+), 184 deletions(-) create mode 100644 src/mono/sample/wasm/browser-test-debug/Assert.cs create mode 100644 src/mono/sample/wasm/browser-test-debug/GCHandleTests.cs create mode 100644 src/mono/sample/wasm/browser-test-debug/TryWrite.cs diff --git a/src/libraries/Common/tests/WasmTestRunner/WasmTestRunner.csproj b/src/libraries/Common/tests/WasmTestRunner/WasmTestRunner.csproj index 0175da89d58ce2..77b82de968b577 100644 --- a/src/libraries/Common/tests/WasmTestRunner/WasmTestRunner.csproj +++ b/src/libraries/Common/tests/WasmTestRunner/WasmTestRunner.csproj @@ -3,7 +3,21 @@ Exe enable $(NetCoreAppCurrent)-browser;$(NetCoreAppCurrent)-wasi;$(NetCoreAppCurrent) + + + $(RestoreAdditionalProjectSources); + C:\xr_dev\xharness\artifacts\packages\Debug\Shipping; + C:\Users\mike.hudson\.nuget\packages; + + + + + portable + true + --setenv=MONO_GC_DEBUG=9 + + $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) @@ -12,6 +26,6 @@ - + diff --git a/src/mono/sample/wasm/browser-test-debug/Assert.cs b/src/mono/sample/wasm/browser-test-debug/Assert.cs new file mode 100644 index 00000000000000..f6499725c4be8a --- /dev/null +++ b/src/mono/sample/wasm/browser-test-debug/Assert.cs @@ -0,0 +1,180 @@ +using System; +using System.Collections.Generic; + +namespace Sample +{ + public static class Assert + { + private static string FormatIfArray(object? obj) + { + if (obj is Array arr) + { + var items = new System.Text.StringBuilder(); + items.Append('['); + for (int i = 0; i < arr.Length; i++) + { + if (i > 0) items.Append(", "); + var value = arr.GetValue(i); + // Recursively format nested arrays + items.Append(FormatIfArray(value)); + } + items.Append(']'); + return items.ToString(); + } + // For collections (e.g., List) + if (obj is System.Collections.IEnumerable enumerable && !(obj is string)) + { + var items = new System.Text.StringBuilder(); + items.Append('['); + bool first = true; + foreach (var value in enumerable) + { + if (!first) items.Append(", "); + items.Append(FormatIfArray(value)); + first = false; + } + items.Append(']'); + return items.ToString(); + } + return obj?.ToString() ?? "null"; + } + + public static TException Throws(Action action) where TException : Exception + { + try + { + action(); + } + catch (Exception ex) + { + if (ex is TException expected) + return expected; + throw new Exception($"AssertHelper.Throws failed. Expected exception of type {typeof(TException)}, but got {ex.GetType()}.\nMessage: {ex.Message}", ex); + } + throw new Exception($"AssertHelper.Throws failed. No exception was thrown. Expected exception of type {typeof(TException)}."); + } + public static void Contains(T expected, IEnumerable collection) + { + if (collection == null) + throw new Exception("AssertHelper.Contains failed. Collection is null."); + foreach (var item in collection) + { + if (object.Equals(item, expected)) + return; + } + throw new Exception($"AssertHelper.Contains failed. Expected item: {FormatIfArray(expected)} was not found in collection: {FormatIfArray(collection)}."); + } + + public static void Contains(string expectedSubstring, string? actualString) + { + if (actualString == null) + throw new Exception("AssertHelper.Contains failed. Actual string is null."); + if (!actualString.Contains(expectedSubstring, StringComparison.Ordinal)) + throw new Exception($"AssertHelper.Contains failed. Expected substring: \"{expectedSubstring}\" was not found in string: \"{actualString}\"."); + } + + public static void DoesNotContain(T expected, IEnumerable collection) + { + if (collection == null) + throw new Exception("AssertHelper.DoesNotContain failed. Collection is null."); + foreach (var item in collection) + { + if (object.Equals(item, expected)) + throw new Exception($"AssertHelper.DoesNotContain failed. Item: {FormatIfArray(expected)} was found in collection: {FormatIfArray(collection)}."); + } + } + + public static void DoesNotContain(string expectedSubstring, string? actualString) + { + if (actualString == null) + return; + if (actualString.Contains(expectedSubstring, StringComparison.Ordinal)) + throw new Exception($"AssertHelper.DoesNotContain failed. Substring: \"{expectedSubstring}\" was found in string: \"{actualString}\"."); + } + public static void NotEqual(T expected, T actual) + { + if (object.Equals(expected, actual)) + { + string expectedStr = FormatIfArray(expected); + string actualStr = FormatIfArray(actual); + throw new Exception($"AssertHelper.NotEqual failed. Expected: {expectedStr}. Actual: {actualStr}."); + } + } + public static void Equal(T expected, T actual) + { + // Handle nulls + if (ReferenceEquals(expected, actual)) + return; + if (expected is null || actual is null) + throw new Exception($"AssertHelper.Equal failed. Expected: {FormatIfArray(expected)}, Actual: {FormatIfArray(actual)}."); + + // Recursively compare arrays + if (expected is Array expectedArray && actual is Array actualArray) + { + if (expectedArray.Length != actualArray.Length) + throw new Exception($"AssertHelper.Equal failed. Array lengths differ. Expected: {FormatIfArray(expectedArray)}, Actual: {FormatIfArray(actualArray)}."); + + for (int i = 0; i < expectedArray.Length; i++) + { + var e = expectedArray.GetValue(i); + var a = actualArray.GetValue(i); + try + { + // Recursively call Equal for nested arrays/objects + Equal(e, a); + } + catch (Exception ex) + { + throw new Exception($"AssertHelper.Equal failed at index {i}. Expected: {FormatIfArray(expectedArray)}, Actual: {FormatIfArray(actualArray)}. Inner: {ex.Message}"); + } + } + return; + } + + // Fallback to default equality + if (!object.Equals(expected, actual)) + { + throw new Exception($"AssertHelper.Equal failed. Expected: {FormatIfArray(expected)}, Actual: {FormatIfArray(actual)}."); + } + } + public static void Same(object? expected, object? actual) + { + if (!ReferenceEquals(expected, actual)) + { + string expectedStr = FormatIfArray(expected); + string actualStr = FormatIfArray(actual); + throw new Exception( + $"AssertHelper.Same failed. Expected and actual are not the same reference.\nExpected: {expectedStr}\nActual: {actualStr}" + ); + } + } + public static void True(bool condition) + { + if (!condition) + throw new Exception("AssertHelper.True failed. Condition was false."); + } + public static void True(bool condition, string message) + { + if (!condition) + throw new Exception($"AssertHelper.True failed. Condition was false. {message}"); + } + public static void False(bool condition) + { + if (condition) + throw new Exception("AssertHelper.False failed. Condition was true."); + } + public static void StartsWith(string expectedStart, string? actual) + { + if (actual == null) + throw new Exception($"AssertHelper.StartsWith failed. Actual string was null. Expected start: \"{expectedStart}\"."); + + if (!actual.StartsWith(expectedStart, StringComparison.Ordinal)) + throw new Exception($"AssertHelper.StartsWith failed. Expected string starting with: \"{expectedStart}\". Actual: \"{actual}\"."); + } + public static void Null(object? expected) + { + if (expected != null) + throw new Exception($"AssertHelper.Null failed. Expected null, but got: {FormatIfArray(expected)}."); + } + } +} diff --git a/src/mono/sample/wasm/browser-test-debug/GCHandleTests.cs b/src/mono/sample/wasm/browser-test-debug/GCHandleTests.cs new file mode 100644 index 00000000000000..32e74b429c10d4 --- /dev/null +++ b/src/mono/sample/wasm/browser-test-debug/GCHandleTests.cs @@ -0,0 +1,414 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Sample; + +namespace System.Runtime.InteropServices.Tests +{ + static public class GCHandleTests + { + + static public void Ctor_Default() + { + //var handle = new GCHandle(); + + var handle = new System.Runtime.InteropServices.GCHandle(); + var t = handle.Target; + System.Console.WriteLine(handle.GetType().FullName); + //Assert.Throws(() => handle.Target); + Assert.False(handle.IsAllocated); + + Assert.Equal(IntPtr.Zero, GCHandle.ToIntPtr(handle)); + Assert.Equal(IntPtr.Zero, (IntPtr)handle); + } + + + //static public void Ctor_Default_Generic() + //{ + // var handle = new GCHandle(); + // Assert.Throws(() => handle.Target); + // Assert.False(handle.IsAllocated); + + // Assert.Equal(IntPtr.Zero, GCHandle.ToIntPtr(handle)); + //} + + + //static public void Ctor_Default_Weak() + //{ + // var handle = new WeakGCHandle(); + // Assert.Throws(() => handle.TryGetTarget(out _)); + // Assert.False(handle.IsAllocated); + + // Assert.Equal(IntPtr.Zero, WeakGCHandle.ToIntPtr(handle)); + //} + + + //static public void Ctor_Default_Pinned() + //{ + // var handle = new PinnedGCHandle(); + // Assert.Throws(() => handle.Target); + // Assert.False(handle.IsAllocated); + + // Assert.Equal(IntPtr.Zero, PinnedGCHandle.ToIntPtr(handle)); + //} + + //static public IEnumerable Alloc_TestData() + //{ + // yield return new object[] { null }; + // yield return new object[] { "String" }; + // yield return new object[] { 123 }; + // yield return new object[] { new int[1] }; + // yield return new object[] { new NonBlittable[1] }; + // yield return new object[] { new object[1] }; + // yield return new object[] { new NonBlittable() }; + //} + + ////[Theory] + ////[MemberData(nameof(Alloc_TestData))] + //static public void Alloc_Value_ReturnsExpected(object value) + //{ + // GCHandle handle = GCHandle.Alloc(value); + // ValidateGCHandle(handle, GCHandleType.Normal, value); + //} + + + //static public void Alloc_Value_ReturnsExpected_Genenic() + //{ + // RunTest(null); + // RunTest("String"); + // RunTest(new int[1]); + // RunTest(new object[1]); + // RunTest(new NonBlittable[1]); + // RunTest(new Blittable()); + // RunTest(new NonBlittable()); + // RunTest(new UnmanagedNonBlittable()); + // RunTest(new ClassWithReferences()); + // RunTest(new ClassWithoutReferences()); + + // void RunTest(T value) where T : class + // { + // ValidateGCHandle(new GCHandle(value), value); + // ValidateWeakGCHandle(new WeakGCHandle(value), value); + // ValidateWeakGCHandle(new WeakGCHandle(value, trackResurrection: true), value); + // ValidatePinnedGCHandle(new PinnedGCHandle(value), value); + // } + //} + + //static public IEnumerable Alloc_Type_TestData() + //{ + // foreach (object[] data in Alloc_TestData()) + // { + // yield return new object[] { data[0], GCHandleType.Normal }; + // yield return new object[] { data[0], GCHandleType.Weak }; + // yield return new object[] { data[0], GCHandleType.WeakTrackResurrection }; + // } + + // yield return new object[] { null, GCHandleType.Pinned }; + // yield return new object[] { "", GCHandleType.Pinned }; + // yield return new object[] { 1, GCHandleType.Pinned }; + // yield return new object[] { new object(), GCHandleType.Pinned }; + // yield return new object[] { new Blittable(), GCHandleType.Pinned }; + // yield return new object[] { new Blittable(), GCHandleType.Pinned }; + // yield return new object[] { new Blittable[0], GCHandleType.Pinned }; + // yield return new object[] { new UnmanagedNonBlittable(), GCHandleType.Pinned }; + // yield return new object[] { new UnmanagedNonBlittable[0], GCHandleType.Pinned }; + // yield return new object[] { new ClassWithoutReferences(), GCHandleType.Pinned }; + //} + + ////[Theory] + ////[MemberData(nameof(Alloc_Type_TestData))] + //static public void Alloc_Type_ReturnsExpected(object value, GCHandleType type) + //{ + // GCHandle handle = GCHandle.Alloc(value, type); + // ValidateGCHandle(handle, type, value); + //} + + //static public IEnumerable InvalidPinnedObject_TestData() + //{ + // yield return new object[] { new NonBlittable() }; + // yield return new object[] { new ClassWithReferences() }; + // yield return new object[] { new object[0] }; + // yield return new object[] { new NonBlittable[0] }; + // yield return new object[] { new ClassWithoutReferences[0] }; + //} + + ////[Theory] + ////[MemberData(nameof(InvalidPinnedObject_TestData))] + //static public void Alloc_InvalidPinnedObject_ThrowsArgumentException(object value) + //{ + // Assert.Throws(() => GCHandle.Alloc(value, GCHandleType.Pinned)); + //} + + ////[Theory] + ////[InlineData(GCHandleType.Weak - 1)] + ////[InlineData(GCHandleType.Pinned + 1)] + //static public void Alloc_InvalidGCHandleType_ThrowsArgumentOutOfRangeException(GCHandleType type) + //{ + // AssertExtensions.Throws("type", () => GCHandle.Alloc(new object(), type)); + //} + + + //static public void FromIntPtr_Zero_ThrowsInvalidOperationException() + //{ + // Assert.Throws(() => GCHandle.FromIntPtr(IntPtr.Zero)); + //} + + + //static public void FromIntPtr_Generic_Zero_NoCheck() + //{ + // var handle = GCHandle.FromIntPtr(IntPtr.Zero); + // Assert.False(handle.IsAllocated); + // var weakHandle = WeakGCHandle.FromIntPtr(IntPtr.Zero); + // Assert.False(weakHandle.IsAllocated); + // var pinnedHandle = PinnedGCHandle.FromIntPtr(IntPtr.Zero); + // Assert.False(pinnedHandle.IsAllocated); + //} + + + //static public unsafe void AddrOfPinnedObject_NotInitialized_ThrowsException() + //{ + // var handle = new GCHandle(); + // Assert.Throws(() => handle.AddrOfPinnedObject()); + // var handleOfObject = new PinnedGCHandle(); + // Assert.Throws(() => handleOfObject.GetAddressOfObjectData()); + // var handleOfString = new PinnedGCHandle(); + // Assert.Throws(() => handleOfString.GetAddressOfStringData()); + // var handleOfArray = new PinnedGCHandle(); + // Assert.Throws(() => handleOfArray.GetAddressOfArrayData()); + //} + + + //static public unsafe void AddrOfPinnedObject_ReturnsStringData() + //{ + // string str = "String"; + // fixed (char* ptr = str) + // { + // var handle = GCHandle.Alloc(str, GCHandleType.Pinned); + // try + // { + // Assert.Equal((IntPtr)ptr, handle.AddrOfPinnedObject()); + // using var handleOfString = new PinnedGCHandle(str); + // Assert.NotEqual((IntPtr)ptr, (IntPtr)handleOfString.GetAddressOfObjectData()); + // Assert.Equal((IntPtr)ptr, (IntPtr)handleOfString.GetAddressOfStringData()); + // } + // finally + // { + // handle.Free(); + // } + // } + //} + + + //static public unsafe void AddrOfPinnedObject_ReturnsArrayData() + //{ + // int[] array = new int[1]; + // fixed (int* ptr = array) + // { + // var handle = GCHandle.Alloc(array, GCHandleType.Pinned); + // try + // { + // Assert.Equal((IntPtr)ptr, handle.AddrOfPinnedObject()); + // using var handleOfArray = new PinnedGCHandle(array); + // Assert.NotEqual((IntPtr)ptr, (IntPtr)handleOfArray.GetAddressOfObjectData()); + // Assert.Equal((IntPtr)ptr, (IntPtr)handleOfArray.GetAddressOfArrayData()); + // } + // finally + // { + // handle.Free(); + // } + // } + //} + + + //static public void AddrOfPinnedObject_NotPinned_ThrowsInvalidOperationException() + //{ + // GCHandle handle = GCHandle.Alloc(new object()); + // try + // { + // Assert.Throws(() => handle.AddrOfPinnedObject()); + // } + // finally + // { + // handle.Free(); + // } + //} + + + //static public void Free_NotInitialized_ThrowsInvalidOperationException() + //{ + // var handle = new GCHandle(); + // Assert.Throws(() => handle.Free()); + //} + + + //static public void Dispose_NotInitialized_NoThrow() + //{ + // var handleOfObject = new GCHandle(); + // handleOfObject.Dispose(); + // var weakHandle = new WeakGCHandle(); + // weakHandle.Dispose(); + // var pinnedHandle = new PinnedGCHandle(); + // pinnedHandle.Dispose(); + //} + + //static public IEnumerable Equals_TestData() + //{ + // GCHandle handle = GCHandle.Alloc(new object()); + // yield return new object[] { handle, handle, true }; + // yield return new object[] { GCHandle.Alloc(new object()), GCHandle.Alloc(new object()), false }; + + // yield return new object[] { GCHandle.Alloc(new object()), new object(), false }; + // yield return new object[] { GCHandle.Alloc(new object()), null, false }; + //} + + ////[Theory] + ////[MemberData(nameof(Equals_TestData))] + //static public void Equals_Object_ReturnsExpected(GCHandle handle, object other, bool expected) + //{ + // try + // { + // Assert.Equal(expected, handle.Equals(other)); + // if (other is GCHandle otherHandle) + // { + // Assert.Equal(expected, handle.Equals(otherHandle)); + // Assert.Equal(expected, handle == otherHandle); + // Assert.Equal(!expected, handle != otherHandle); + // } + // } + // finally + // { + // handle.Free(); + // if (other is GCHandle otherHandle && !expected) + // { + // otherHandle.Free(); + // } + // } + //} + + //private static void ValidateGCHandle(GCHandle handle, GCHandleType type, object target) + //{ + // try + // { + // Assert.Equal(target, handle.Target); + // Assert.True(handle.IsAllocated); + + // Assert.NotEqual(IntPtr.Zero, GCHandle.ToIntPtr(handle)); + // Assert.Equal(GCHandle.ToIntPtr(handle), (IntPtr)handle); + // Assert.Equal(((IntPtr)handle).GetHashCode(), handle.GetHashCode()); + + // if (type == GCHandleType.Pinned) + // { + // if (target == null) + // { + // Assert.Equal(IntPtr.Zero, handle.AddrOfPinnedObject()); + // } + // else + // { + // Assert.NotEqual(IntPtr.Zero, handle.AddrOfPinnedObject()); + // } + // } + + // } + // finally + // { + // handle.Free(); + // Assert.False(handle.IsAllocated); + // } + //} + + //private static void ValidateGCHandle(GCHandle handle, T target) + // where T : class + //{ + // try + // { + // Assert.Equal(target, handle.Target); + // Assert.True(handle.IsAllocated); + + // Assert.NotEqual(IntPtr.Zero, GCHandle.ToIntPtr(handle)); + // } + // finally + // { + // handle.Dispose(); + // Assert.False(handle.IsAllocated); + // } + //} + + //private static void ValidateWeakGCHandle(WeakGCHandle handle, T target) where T : class + //{ + // try + // { + // if (target != null) + // { + // Assert.True(handle.TryGetTarget(out T outTarget)); + // Assert.Equal(target, outTarget); + // } + // else + // { + // Assert.False(handle.TryGetTarget(out T outTarget)); + // Assert.Null(outTarget); + // } + // Assert.True(handle.IsAllocated); + + // Assert.NotEqual(IntPtr.Zero, WeakGCHandle.ToIntPtr(handle)); + // } + // finally + // { + // handle.Dispose(); + // Assert.False(handle.IsAllocated); + // } + //} + + //private static unsafe void ValidatePinnedGCHandle(PinnedGCHandle handle, T target) where T : class + //{ + // try + // { + // Assert.Equal(target, handle.Target); + // Assert.True(handle.IsAllocated); + + // Assert.NotEqual(IntPtr.Zero, PinnedGCHandle.ToIntPtr(handle)); + + // if (target == null) + // { + // Assert.Equal(IntPtr.Zero, (IntPtr)handle.GetAddressOfObjectData()); + // } + // else + // { + // Assert.NotEqual(IntPtr.Zero, (IntPtr)handle.GetAddressOfObjectData()); + // } + // } + // finally + // { + // handle.Dispose(); + // Assert.False(handle.IsAllocated); + // } + //} + + //public struct Blittable + //{ + // static public int _field; + //} + + //public class ClassWithoutReferences + //{ + // static public int _field; + //} + + //public struct UnmanagedNonBlittable + //{ + // static public char _field1; + // static public bool _field2; + //} + + //public struct NonBlittable + //{ + // static public string _field; + //} + + //public class ClassWithReferences + //{ + // static public string _field; + //} + } +} diff --git a/src/mono/sample/wasm/browser-test-debug/Program.cs b/src/mono/sample/wasm/browser-test-debug/Program.cs index 07c22fdb0124a2..4ad0bd4e787644 100644 --- a/src/mono/sample/wasm/browser-test-debug/Program.cs +++ b/src/mono/sample/wasm/browser-test-debug/Program.cs @@ -9,185 +9,17 @@ using System.Runtime.InteropServices.JavaScript; using System.Runtime.InteropServices.JavaScript.Tests; using System.Threading.Tasks; - +using System.Security; +using System.Runtime.InteropServices; +using System.Runtime.InteropServices.Tests; +using System.Globalization; +using System.SpanTests; namespace Sample { public partial class Test { - public static class Assert - { - private static string FormatIfArray(object? obj) - { - if (obj is Array arr) - { - var items = new System.Text.StringBuilder(); - items.Append('['); - for (int i = 0; i < arr.Length; i++) - { - if (i > 0) items.Append(", "); - var value = arr.GetValue(i); - // Recursively format nested arrays - items.Append(FormatIfArray(value)); - } - items.Append(']'); - return items.ToString(); - } - // For collections (e.g., List) - if (obj is IEnumerable enumerable && !(obj is string)) - { - var items = new System.Text.StringBuilder(); - items.Append('['); - bool first = true; - foreach (var value in enumerable) - { - if (!first) items.Append(", "); - items.Append(FormatIfArray(value)); - first = false; - } - items.Append(']'); - return items.ToString(); - } - return obj?.ToString() ?? "null"; - } + private char[] _largeBuffer = new char[4096]; - public static TException Throws(Action action) where TException : Exception - { - try - { - action(); - } - catch (Exception ex) - { - if (ex is TException expected) - return expected; - throw new Exception($"AssertHelper.Throws failed. Expected exception of type {typeof(TException)}, but got {ex.GetType()}.\nMessage: {ex.Message}", ex); - } - throw new Exception($"AssertHelper.Throws failed. No exception was thrown. Expected exception of type {typeof(TException)}."); - } - public static void Contains(T expected, IEnumerable collection) - { - if (collection == null) - throw new Exception("AssertHelper.Contains failed. Collection is null."); - foreach (var item in collection) - { - if (object.Equals(item, expected)) - return; - } - throw new Exception($"AssertHelper.Contains failed. Expected item: {FormatIfArray(expected)} was not found in collection: {FormatIfArray(collection)}."); - } - - public static void Contains(string expectedSubstring, string? actualString) - { - if (actualString == null) - throw new Exception("AssertHelper.Contains failed. Actual string is null."); - if (!actualString.Contains(expectedSubstring, StringComparison.Ordinal)) - throw new Exception($"AssertHelper.Contains failed. Expected substring: \"{expectedSubstring}\" was not found in string: \"{actualString}\"."); - } - - public static void DoesNotContain(T expected, IEnumerable collection) - { - if (collection == null) - throw new Exception("AssertHelper.DoesNotContain failed. Collection is null."); - foreach (var item in collection) - { - if (object.Equals(item, expected)) - throw new Exception($"AssertHelper.DoesNotContain failed. Item: {FormatIfArray(expected)} was found in collection: {FormatIfArray(collection)}."); - } - } - - public static void DoesNotContain(string expectedSubstring, string? actualString) - { - if (actualString == null) - return; - if (actualString.Contains(expectedSubstring, StringComparison.Ordinal)) - throw new Exception($"AssertHelper.DoesNotContain failed. Substring: \"{expectedSubstring}\" was found in string: \"{actualString}\"."); - } - public static void NotEqual(T expected, T actual) - { - if (object.Equals(expected, actual)) - { - string expectedStr = FormatIfArray(expected); - string actualStr = FormatIfArray(actual); - throw new Exception($"AssertHelper.NotEqual failed. Expected: {expectedStr}. Actual: {actualStr}."); - } - } - public static void Equal(T expected, T actual) - { - // Handle nulls - if (ReferenceEquals(expected, actual)) - return; - if (expected is null || actual is null) - throw new Exception($"AssertHelper.Equal failed. Expected: {FormatIfArray(expected)}, Actual: {FormatIfArray(actual)}."); - - // Recursively compare arrays - if (expected is Array expectedArray && actual is Array actualArray) - { - if (expectedArray.Length != actualArray.Length) - throw new Exception($"AssertHelper.Equal failed. Array lengths differ. Expected: {FormatIfArray(expectedArray)}, Actual: {FormatIfArray(actualArray)}."); - - for (int i = 0; i < expectedArray.Length; i++) - { - var e = expectedArray.GetValue(i); - var a = actualArray.GetValue(i); - try - { - // Recursively call Equal for nested arrays/objects - Equal(e, a); - } - catch (Exception ex) - { - throw new Exception($"AssertHelper.Equal failed at index {i}. Expected: {FormatIfArray(expectedArray)}, Actual: {FormatIfArray(actualArray)}. Inner: {ex.Message}"); - } - } - return; - } - - // Fallback to default equality - if (!object.Equals(expected, actual)) - { - throw new Exception($"AssertHelper.Equal failed. Expected: {FormatIfArray(expected)}, Actual: {FormatIfArray(actual)}."); - } - } - public static void Same(object? expected, object? actual) - { - if (!ReferenceEquals(expected, actual)) - { - string expectedStr = FormatIfArray(expected); - string actualStr = FormatIfArray(actual); - throw new Exception( - $"AssertHelper.Same failed. Expected and actual are not the same reference.\nExpected: {expectedStr}\nActual: {actualStr}" - ); - } - } - public static void True(bool condition) - { - if (!condition) - throw new Exception("AssertHelper.True failed. Condition was false."); - } - public static void True(bool condition, string message) - { - if (!condition) - throw new Exception($"AssertHelper.True failed. Condition was false. {message}"); - } - public static void False(bool condition) - { - if (condition) - throw new Exception("AssertHelper.False failed. Condition was true."); - } - public static void StartsWith(string expectedStart, string? actual) - { - if (actual == null) - throw new Exception($"AssertHelper.StartsWith failed. Actual string was null. Expected start: \"{expectedStart}\"."); - - if (!actual.StartsWith(expectedStart, StringComparison.Ordinal)) - throw new Exception($"AssertHelper.StartsWith failed. Expected string starting with: \"{expectedStart}\". Actual: \"{actual}\"."); - } - public static void Null(object? expected) - { - if (expected != null) - throw new Exception($"AssertHelper.Null failed. Expected null, but got: {FormatIfArray(expected)}."); - } - } public static async Task Main(string[] args) { var rand = new Random(); @@ -540,16 +372,61 @@ public static void PtrToStringUTF8_ZeroPointer_ReturnsNull() { Assert.Null(Marshal.PtrToStringUTF8(IntPtr.Zero)); } + + public static void ZeroFreeGlobalAllocAnsi_Zero_Nop() + { + Marshal.ZeroFreeGlobalAllocAnsi(IntPtr.Zero); + } + + private static SecureString ToSecureString(string data) + { + var str = new SecureString(); + foreach (char c in data) + { + str.AppendChar(c); + } + str.MakeReadOnly(); + return str; + } + + public static void ZeroFreeGlobalAllocAnsi_ValidPointer_Success() + { + using (SecureString secureString = ToSecureString("hello")) + { + IntPtr ptr = Marshal.SecureStringToGlobalAllocAnsi(secureString); + Marshal.ZeroFreeGlobalAllocAnsi(ptr); + } + } + + [JSExport] public static async Task DoTestMethod() { await JavaScriptTestHelper.InitializeAsync(); + const bool doCollect = true; + if (doCollect) GC.Collect(); + + //ZeroFreeGlobalAllocAnsi_Zero_Nop(); + //if (doCollect) GC.Collect(); + //ZeroFreeGlobalAllocAnsi_ValidPointer_Success(); + //if (doCollect) GC.Collect(); + + //System.SpanTests.TryWriteTests.AppendFormatted_ReferenceTypes_ICustomFormatter(); + //if (doCollect) GC.Collect(); + System.SpanTests.TryWriteTests.AppendFormatted_ValueTypes_CreateProviderFlowed(); + if (doCollect) GC.Collect(); + + + //GCHandleTests.Ctor_Default(); + //if (doCollect) GC.Collect(); + + //int[] testData = new int[] { 1, 2, 3, int.MaxValue, int.MinValue }; //object[] objectTestData = { new object[] { string.Intern("hello"), string.Empty } }; //JsImportNullableIntPtr((IntPtr)42); //GeneralInterop.MH_SetLogVerbosity(1); // export isn't picked up! - PtrToStringUTF8_ZeroPointer_ReturnsNull(); + //PtrToStringUTF8_ZeroPointer_ReturnsNull(); //IsNullOrWin32Atom((IntPtr)1); //PtrToStringUTF8_Win32AtomPointer_ReturnsNull(); //GetFunctionPointerForDelegate_MarshalledDelegateGeneric_ReturnsExpected(); diff --git a/src/mono/sample/wasm/browser-test-debug/TryWrite.cs b/src/mono/sample/wasm/browser-test-debug/TryWrite.cs new file mode 100644 index 00000000000000..b0ebef1ed3a0e8 --- /dev/null +++ b/src/mono/sample/wasm/browser-test-debug/TryWrite.cs @@ -0,0 +1,730 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Diagnostics; +using System.Globalization; +//using System.Tests; +using System.Text; +using Sample; +//using Xunit; + +// TODO: Once compiler support is available, augment tests to exercise interpolated strings. + +namespace System.SpanTests +{ + static public class TryWriteTests + { + public static char[] _largeBuffer = new char[4096]; + + //[Theory] + //[InlineData(0, 0)] + //[InlineData(1, 1)] + //[InlineData(42, 84)] + //[InlineData(-1, 0)] + //[InlineData(-1, -1)] + //[InlineData(-16, 1)] + static public void LengthAndHoleArguments_Valid(int literalLength, int formattedCount) + { + bool shouldAppend; + + new MemoryExtensions.TryWriteInterpolatedStringHandler(literalLength, formattedCount, new char[Math.Max(0, literalLength)], out shouldAppend); + Assert.True(shouldAppend); + + new MemoryExtensions.TryWriteInterpolatedStringHandler(literalLength, formattedCount, new char[1 + Math.Max(0, literalLength)], out shouldAppend); + Assert.True(shouldAppend); + + if (literalLength > 0) + { + new MemoryExtensions.TryWriteInterpolatedStringHandler(literalLength, formattedCount, new char[literalLength - 1], out shouldAppend); + Assert.False(shouldAppend); + } + + foreach (IFormatProvider provider in new IFormatProvider[] { null, new ConcatFormatter(), CultureInfo.InvariantCulture, CultureInfo.CurrentCulture, new CultureInfo("en-US"), new CultureInfo("fr-FR") }) + { + new MemoryExtensions.TryWriteInterpolatedStringHandler(literalLength, formattedCount, new char[Math.Max(0, literalLength)], out shouldAppend); + Assert.True(shouldAppend); + + new MemoryExtensions.TryWriteInterpolatedStringHandler(literalLength, formattedCount, new char[1 + Math.Max(0, literalLength)], out shouldAppend); + Assert.True(shouldAppend); + + if (literalLength > 0) + { + new MemoryExtensions.TryWriteInterpolatedStringHandler(literalLength, formattedCount, new char[literalLength - 1], out shouldAppend); + Assert.False(shouldAppend); + } + } + } + + + static public void AppendLiteral() + { + var expected = new StringBuilder(); + MemoryExtensions.TryWriteInterpolatedStringHandler actual = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, _largeBuffer, out _); + + foreach (string s in new[] { "", "a", "bc", "def", "this is a long string", "!" }) + { + expected.Append(s); + actual.AppendLiteral(s); + } + + Assert.True(MemoryExtensions.TryWrite(_largeBuffer, ref actual, out int charsWritten)); + Assert.Equal(expected.ToString(), _largeBuffer.AsSpan(0, charsWritten).ToString()); + } + + + static public void AppendFormatted_ReadOnlySpanChar() + { + var expected = new StringBuilder(); + MemoryExtensions.TryWriteInterpolatedStringHandler actual = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, _largeBuffer, out _); + + foreach (string s in new[] { "", "a", "bc", "def", "this is a longer string", "!" }) + { + // span + expected.Append(s); + actual.AppendFormatted((ReadOnlySpan)s); + + // span, format + expected.AppendFormat("{0:X2}", s); + actual.AppendFormatted((ReadOnlySpan)s, format: "X2"); + + foreach (int alignment in new[] { 0, 3, -3 }) + { + // span, alignment + expected.AppendFormat("{0," + alignment.ToString(CultureInfo.InvariantCulture) + "}", s); + actual.AppendFormatted((ReadOnlySpan)s, alignment); + + // span, alignment, format + expected.AppendFormat("{0," + alignment.ToString(CultureInfo.InvariantCulture) + ":X2}", s); + actual.AppendFormatted((ReadOnlySpan)s, alignment, "X2"); + } + } + + Assert.True(MemoryExtensions.TryWrite(_largeBuffer, ref actual, out int charsWritten)); + Assert.Equal(expected.ToString(), _largeBuffer.AsSpan(0, charsWritten).ToString()); + } + + + static public void AppendFormatted_String() + { + var expected = new StringBuilder(); + MemoryExtensions.TryWriteInterpolatedStringHandler actual = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, _largeBuffer, out _); + + foreach (string s in new[] { null, "", "a", "bc", "def", "this is a longer string", "!" }) + { + // string + expected.AppendFormat("{0}", s); + actual.AppendFormatted(s); + + // string, format + expected.AppendFormat("{0:X2}", s); + actual.AppendFormatted(s, "X2"); + + foreach (int alignment in new[] { 0, 3, -3 }) + { + // string, alignment + expected.AppendFormat("{0," + alignment.ToString(CultureInfo.InvariantCulture) + "}", s); + actual.AppendFormatted(s, alignment); + + // string, alignment, format + expected.AppendFormat("{0," + alignment.ToString(CultureInfo.InvariantCulture) + ":X2}", s); + actual.AppendFormatted(s, alignment, "X2"); + } + } + + Assert.True(MemoryExtensions.TryWrite(_largeBuffer, ref actual, out int charsWritten)); + Assert.Equal(expected.ToString(), _largeBuffer.AsSpan(0, charsWritten).ToString()); + } + + + static public void AppendFormatted_String_ICustomFormatter() + { + var provider = new ConcatFormatter(); + + var expected = new StringBuilder(); + MemoryExtensions.TryWriteInterpolatedStringHandler actual = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, _largeBuffer, provider, out _); + + foreach (string s in new[] { null, "", "a" }) + { + // string + expected.AppendFormat(provider, "{0}", s); + actual.AppendFormatted(s); + + // string, format + expected.AppendFormat(provider, "{0:X2}", s); + actual.AppendFormatted(s, "X2"); + + // string, alignment + expected.AppendFormat(provider, "{0,3}", s); + actual.AppendFormatted(s, 3); + + // string, alignment, format + expected.AppendFormat(provider, "{0,-3:X2}", s); + actual.AppendFormatted(s, -3, "X2"); + } + + Assert.True(MemoryExtensions.TryWrite(_largeBuffer, ref actual, out int charsWritten)); + Assert.Equal(expected.ToString(), _largeBuffer.AsSpan(0, charsWritten).ToString()); + } + + + static public void AppendFormatted_ReferenceTypes() + { + var expected = new StringBuilder(); + MemoryExtensions.TryWriteInterpolatedStringHandler actual = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, _largeBuffer, out _); + + foreach (string rawInput in new[] { null, "", "a", "bc", "def", "this is a longer string", "!" }) + { + foreach (object o in new object[] + { + rawInput, // raw string directly; ToString will return itself + new StringWrapper(rawInput), // wrapper object that returns string from ToString + new FormattableStringWrapper(rawInput), // IFormattable wrapper around string + new SpanFormattableStringWrapper(rawInput) // ISpanFormattable wrapper around string + }) + { + // object + expected.AppendFormat("{0}", o); + actual.AppendFormatted(o); + if (o is IHasToStringState tss1) + { + Assert.True(string.IsNullOrEmpty(tss1.ToStringState.LastFormat)); + AssertModeMatchesType(tss1); + } + + // object, format + expected.AppendFormat("{0:X2}", o); + actual.AppendFormatted(o, "X2"); + if (o is IHasToStringState tss2) + { + Assert.Equal("X2", tss2.ToStringState.LastFormat); + AssertModeMatchesType(tss2); + } + + foreach (int alignment in new[] { 0, 3, -3 }) + { + // object, alignment + expected.AppendFormat("{0," + alignment.ToString(CultureInfo.InvariantCulture) + "}", o); + actual.AppendFormatted(o, alignment); + if (o is IHasToStringState tss3) + { + Assert.True(string.IsNullOrEmpty(tss3.ToStringState.LastFormat)); + AssertModeMatchesType(tss3); + } + + // object, alignment, format + expected.AppendFormat("{0," + alignment.ToString(CultureInfo.InvariantCulture) + ":X2}", o); + actual.AppendFormatted(o, alignment, "X2"); + if (o is IHasToStringState tss4) + { + Assert.Equal("X2", tss4.ToStringState.LastFormat); + AssertModeMatchesType(tss4); + } + } + } + } + + Assert.True(MemoryExtensions.TryWrite(_largeBuffer, ref actual, out int charsWritten)); + Assert.Equal(expected.ToString(), _largeBuffer.AsSpan(0, charsWritten).ToString()); + } + + + static public void AppendFormatted_ReferenceTypes_CreateProviderFlowed() + { + Console.WriteLine("Starting test AppendFormatted_ReferenceTypes_CreateProviderFlowed"); + var provider = new CultureInfo("en-US"); + MemoryExtensions.TryWriteInterpolatedStringHandler handler = new MemoryExtensions.TryWriteInterpolatedStringHandler(1, 2, _largeBuffer, provider, out _); + + foreach (IHasToStringState tss in new IHasToStringState[] { new FormattableStringWrapper("hello"), new SpanFormattableStringWrapper("hello") }) + { + handler.AppendFormatted(tss); + Assert.Same(provider, tss.ToStringState.LastProvider); + + handler.AppendFormatted(tss, 1); + Assert.Same(provider, tss.ToStringState.LastProvider); + + handler.AppendFormatted(tss, "X2"); + Assert.Same(provider, tss.ToStringState.LastProvider); + + handler.AppendFormatted(tss, 1, "X2"); + Assert.Same(provider, tss.ToStringState.LastProvider); + } + } + + + static public void AppendFormatted_ReferenceTypes_ICustomFormatter() + { + var provider = new ConcatFormatter(); + + var expected = new StringBuilder(); + MemoryExtensions.TryWriteInterpolatedStringHandler actual = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, _largeBuffer, provider, out _); + + foreach (string s in new[] { null, "", "a" }) + { + foreach (IHasToStringState tss in new IHasToStringState[] { new FormattableStringWrapper(s), new SpanFormattableStringWrapper(s) }) + { + void AssertTss(IHasToStringState tss, string format) + { + Assert.Equal(format, tss.ToStringState.LastFormat); + Assert.Same(provider, tss.ToStringState.LastProvider); + Assert.Equal(ToStringMode.ICustomFormatterFormat, tss.ToStringState.ToStringMode); + } + + // object + expected.AppendFormat(provider, "{0}", tss); + actual.AppendFormatted(tss); + AssertTss(tss, null); + + // object, format + expected.AppendFormat(provider, "{0:X2}", tss); + actual.AppendFormatted(tss, "X2"); + AssertTss(tss, "X2"); + + // object, alignment + expected.AppendFormat(provider, "{0,3}", tss); + actual.AppendFormatted(tss, 3); + AssertTss(tss, null); + + // object, alignment, format + expected.AppendFormat(provider, "{0,-3:X2}", tss); + actual.AppendFormatted(tss, -3, "X2"); + AssertTss(tss, "X2"); + } + } + + Assert.True(MemoryExtensions.TryWrite(_largeBuffer, ref actual, out int charsWritten)); + Assert.Equal(expected.ToString(), _largeBuffer.AsSpan(0, charsWritten).ToString()); + } + + + static public void AppendFormatted_ValueTypes() + { + void Test(T t) + { + var expected = new StringBuilder(); + MemoryExtensions.TryWriteInterpolatedStringHandler actual = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, _largeBuffer, out _); + + // struct + expected.AppendFormat("{0}", t); + actual.AppendFormatted(t); + Assert.True(string.IsNullOrEmpty(((IHasToStringState)t).ToStringState.LastFormat)); + AssertModeMatchesType(((IHasToStringState)t)); + + // struct, format + expected.AppendFormat("{0:X2}", t); + actual.AppendFormatted(t, "X2"); + Assert.Equal("X2", ((IHasToStringState)t).ToStringState.LastFormat); + AssertModeMatchesType(((IHasToStringState)t)); + + foreach (int alignment in new[] { 0, 3, -3 }) + { + // struct, alignment + expected.AppendFormat("{0," + alignment.ToString(CultureInfo.InvariantCulture) + "}", t); + actual.AppendFormatted(t, alignment); + Assert.True(string.IsNullOrEmpty(((IHasToStringState)t).ToStringState.LastFormat)); + AssertModeMatchesType(((IHasToStringState)t)); + + // struct, alignment, format + expected.AppendFormat("{0," + alignment.ToString(CultureInfo.InvariantCulture) + ":X2}", t); + actual.AppendFormatted(t, alignment, "X2"); + Assert.Equal("X2", ((IHasToStringState)t).ToStringState.LastFormat); + AssertModeMatchesType(((IHasToStringState)t)); + } + + Assert.True(MemoryExtensions.TryWrite(_largeBuffer, ref actual, out int charsWritten)); + Assert.Equal(expected.ToString(), _largeBuffer.AsSpan(0, charsWritten).ToString()); + } + + Test(new FormattableInt32Wrapper(42)); + Test(new SpanFormattableInt32Wrapper(84)); + Test((FormattableInt32Wrapper?)new FormattableInt32Wrapper(42)); + Test((SpanFormattableInt32Wrapper?)new SpanFormattableInt32Wrapper(84)); + } + + + static public void AppendFormatted_ValueTypes_CreateProviderFlowed() + { + void Test(T t) + { + var provider = new CultureInfo("en-US"); //CultureInfo.InvariantCulture; + MemoryExtensions.TryWriteInterpolatedStringHandler handler = new MemoryExtensions.TryWriteInterpolatedStringHandler(1, 2, _largeBuffer, provider, out _); + + handler.AppendFormatted(t); + Assert.Same(provider, ((IHasToStringState)t).ToStringState.LastProvider); + + handler.AppendFormatted(t, 1); + Assert.Same(provider, ((IHasToStringState)t).ToStringState.LastProvider); + + handler.AppendFormatted(t, "X2"); + Assert.Same(provider, ((IHasToStringState)t).ToStringState.LastProvider); + + handler.AppendFormatted(t, 1, "X2"); + Assert.Same(provider, ((IHasToStringState)t).ToStringState.LastProvider); + } + + Test(new FormattableInt32Wrapper(42)); + Test(new SpanFormattableInt32Wrapper(84)); + Test((FormattableInt32Wrapper?)new FormattableInt32Wrapper(42)); + Test((SpanFormattableInt32Wrapper?)new SpanFormattableInt32Wrapper(84)); + } + + + static public void AppendFormatted_ValueTypes_ICustomFormatter() + { + var provider = new ConcatFormatter(); + + void Test(T t) + { + void AssertTss(T tss, string format) + { + Assert.Equal(format, ((IHasToStringState)tss).ToStringState.LastFormat); + Assert.Same(provider, ((IHasToStringState)tss).ToStringState.LastProvider); + Assert.Equal(ToStringMode.ICustomFormatterFormat, ((IHasToStringState)tss).ToStringState.ToStringMode); + } + + var expected = new StringBuilder(); + MemoryExtensions.TryWriteInterpolatedStringHandler actual = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, _largeBuffer, provider, out _); + + // struct + expected.AppendFormat(provider, "{0}", t); + actual.AppendFormatted(t); + AssertTss(t, null); + + // struct, format + expected.AppendFormat(provider, "{0:X2}", t); + actual.AppendFormatted(t, "X2"); + AssertTss(t, "X2"); + + // struct, alignment + expected.AppendFormat(provider, "{0,3}", t); + actual.AppendFormatted(t, 3); + AssertTss(t, null); + + // struct, alignment, format + expected.AppendFormat(provider, "{0,-3:X2}", t); + actual.AppendFormatted(t, -3, "X2"); + AssertTss(t, "X2"); + + Assert.True(MemoryExtensions.TryWrite(_largeBuffer, ref actual, out int charsWritten)); + Assert.Equal(expected.ToString(), _largeBuffer.AsSpan(0, charsWritten).ToString()); + } + + Test(new FormattableInt32Wrapper(42)); + Test(new SpanFormattableInt32Wrapper(84)); + Test((FormattableInt32Wrapper?)new FormattableInt32Wrapper(42)); + Test((SpanFormattableInt32Wrapper?)new SpanFormattableInt32Wrapper(84)); + } + + + static public void AppendFormatted_EmptyBuffer_ZeroLengthWritesSuccessful() + { + var buffer = new char[100]; + + MemoryExtensions.TryWriteInterpolatedStringHandler b = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, buffer.AsSpan(0, 0), out bool shouldAppend); + Assert.True(shouldAppend); + + Assert.True(b.AppendLiteral("")); + Assert.True(b.AppendFormatted((object)"", alignment: 0, format: "X2")); + Assert.True(b.AppendFormatted(null)); + Assert.True(b.AppendFormatted("")); + Assert.True(b.AppendFormatted("", alignment: 0, format: "X2")); + Assert.True(b.AppendFormatted("")); + Assert.True(b.AppendFormatted("", alignment: 0)); + Assert.True(b.AppendFormatted("", format: "X2")); + Assert.True(b.AppendFormatted("", alignment: 0, format: "X2")); + Assert.True(b.AppendFormatted("".AsSpan())); + Assert.True(b.AppendFormatted("".AsSpan(), alignment: 0, format: "X2")); + + Assert.True(MemoryExtensions.TryWrite(buffer.AsSpan(0, 0), ref b, out int charsWritten)); + Assert.Equal(0, charsWritten); + } + + //[Theory] + //[InlineData(0)] + //[InlineData(100)] + static public void AppendFormatted_BufferTooSmall(int bufferLength) + { + var buffer = new char[bufferLength]; + + for (int i = 0; i <= 29; i++) + { + MemoryExtensions.TryWriteInterpolatedStringHandler b = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, buffer, out bool shouldAppend); + Assert.True(shouldAppend); + + Assert.True(b.AppendLiteral(new string('s', bufferLength))); + + bool result = i switch + { + 0 => b.AppendLiteral(" "), + 1 => b.AppendFormatted((object)" ", alignment: 0, format: "X2"), + 2 => b.AppendFormatted(" "), + 3 => b.AppendFormatted(" ", alignment: 0, format: "X2"), + 4 => b.AppendFormatted(" "), + 5 => b.AppendFormatted(" ", alignment: 0), + 6 => b.AppendFormatted(" ", format: "X2"), + 7 => b.AppendFormatted(" ", alignment: 0, format: "X2"), + 8 => b.AppendFormatted(" ".AsSpan()), + 9 => b.AppendFormatted(" ".AsSpan(), alignment: 0, format: "X2"), + 10 => b.AppendFormatted(new FormattableStringWrapper(" ")), + 11 => b.AppendFormatted(new FormattableStringWrapper(" "), alignment: 0), + 12 => b.AppendFormatted(new FormattableStringWrapper(" "), format: "X2"), + 13 => b.AppendFormatted(new FormattableStringWrapper(" "), alignment: 0, format: "X2"), + 14 => b.AppendFormatted(new SpanFormattableStringWrapper(" ")), + 15 => b.AppendFormatted(new SpanFormattableStringWrapper(" "), alignment: 0), + 16 => b.AppendFormatted(new SpanFormattableStringWrapper(" "), format: "X2"), + 17 => b.AppendFormatted(new SpanFormattableStringWrapper(" "), alignment: 0, format: "X2"), + 18 => b.AppendFormatted(new FormattableInt32Wrapper(1)), + 19 => b.AppendFormatted(new FormattableInt32Wrapper(1), alignment: 0), + 20 => b.AppendFormatted(new FormattableInt32Wrapper(1), format: "X2"), + 21 => b.AppendFormatted(new FormattableInt32Wrapper(1), alignment: 0, format: "X2"), + 22 => b.AppendFormatted(new SpanFormattableInt32Wrapper(1)), + 23 => b.AppendFormatted(new SpanFormattableInt32Wrapper(1), alignment: 0), + 24 => b.AppendFormatted(new SpanFormattableInt32Wrapper(1), format: "X2"), + 25 => b.AppendFormatted(new SpanFormattableInt32Wrapper(1), alignment: 0, format: "X2"), + 26 => b.AppendFormatted("", alignment: 1), + 27 => b.AppendFormatted("", alignment: -1), + 28 => b.AppendFormatted(" ", alignment: 1, format: "X2"), + 29 => b.AppendFormatted(" ", alignment: -1, format: "X2"), + _ => throw new Exception(), + }; + Assert.False(result); + + Assert.False(MemoryExtensions.TryWrite(buffer.AsSpan(0, 0), ref b, out int charsWritten)); + Assert.Equal(0, charsWritten); + } + } + + static public void AppendFormatted_BufferTooSmall_CustomFormatter() + { + var buffer = new char[100]; + var provider = new ConstFormatter(" "); + + { + MemoryExtensions.TryWriteInterpolatedStringHandler b = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, buffer.AsSpan(0, 0), provider, out bool shouldAppend); + Assert.True(shouldAppend); + + // don't use custom formatter + Assert.True(b.AppendLiteral("")); + Assert.True(b.AppendFormatted("".AsSpan())); + Assert.True(b.AppendFormatted("".AsSpan(), alignment: 0, format: "X2")); + + // do use custom formatter + Assert.False(b.AppendFormatted((object)"", alignment: 0, format: "X2")); + Assert.False(b.AppendFormatted(null)); + Assert.False(b.AppendFormatted("")); + Assert.False(b.AppendFormatted("", alignment: 0, format: "X2")); + Assert.False(b.AppendFormatted("")); + Assert.False(b.AppendFormatted("", alignment: 0)); + Assert.False(b.AppendFormatted("", format: "X2")); + Assert.False(b.AppendFormatted("", alignment: 0, format: "X2")); + + Assert.False(MemoryExtensions.TryWrite(buffer.AsSpan(0, 0), ref b, out int charsWritten)); + Assert.Equal(0, charsWritten); + } + } + + private static void AssertModeMatchesType(T tss) where T : IHasToStringState + { + ToStringMode expected = + tss is ISpanFormattable ? ToStringMode.ISpanFormattableTryFormat : + tss is IFormattable ? ToStringMode.IFormattableToString : + ToStringMode.ObjectToString; + Assert.Equal(expected, tss.ToStringState.ToStringMode); + } + + private sealed class SpanFormattableStringWrapper : IFormattable, ISpanFormattable, IHasToStringState + { + private readonly string _value; + public ToStringState ToStringState { get; } = new ToStringState(); + + public SpanFormattableStringWrapper(string value) => _value = value; + + public bool TryFormat(Span destination, out int charsWritten, ReadOnlySpan format, IFormatProvider provider) + { + ToStringState.LastFormat = format.ToString(); + ToStringState.LastProvider = provider; + ToStringState.ToStringMode = ToStringMode.ISpanFormattableTryFormat; + + if (_value is null) + { + charsWritten = 0; + return true; + } + + if (_value.Length > destination.Length) + { + charsWritten = 0; + return false; + } + + charsWritten = _value.Length; + _value.AsSpan().CopyTo(destination); + return true; + } + + public string ToString(string format, IFormatProvider formatProvider) + { + ToStringState.LastFormat = format; + ToStringState.LastProvider = formatProvider; + ToStringState.ToStringMode = ToStringMode.IFormattableToString; + return _value; + } + + public override string ToString() + { + ToStringState.LastFormat = null; + ToStringState.LastProvider = null; + ToStringState.ToStringMode = ToStringMode.ObjectToString; + return _value; + } + } + + private struct SpanFormattableInt32Wrapper : IFormattable, ISpanFormattable, IHasToStringState + { + private readonly int _value; + public ToStringState ToStringState { get; } + + public SpanFormattableInt32Wrapper(int value) + { + ToStringState = new ToStringState(); + _value = value; + } + + public bool TryFormat(Span destination, out int charsWritten, ReadOnlySpan format, IFormatProvider provider) + { + ToStringState.LastFormat = format.ToString(); + ToStringState.LastProvider = provider; + ToStringState.ToStringMode = ToStringMode.ISpanFormattableTryFormat; + + return _value.TryFormat(destination, out charsWritten, format, provider); + } + + public string ToString(string format, IFormatProvider formatProvider) + { + ToStringState.LastFormat = format; + ToStringState.LastProvider = formatProvider; + ToStringState.ToStringMode = ToStringMode.IFormattableToString; + return _value.ToString(format, formatProvider); + } + + public override string ToString() + { + ToStringState.LastFormat = null; + ToStringState.LastProvider = null; + ToStringState.ToStringMode = ToStringMode.ObjectToString; + return _value.ToString(); + } + } + + private sealed class FormattableStringWrapper : IFormattable, IHasToStringState + { + private readonly string _value; + public ToStringState ToStringState { get; } = new ToStringState(); + + public FormattableStringWrapper(string s) => _value = s; + + public string ToString(string format, IFormatProvider formatProvider) + { + ToStringState.LastFormat = format; + ToStringState.LastProvider = formatProvider; + ToStringState.ToStringMode = ToStringMode.IFormattableToString; + return _value; + } + + public override string ToString() + { + ToStringState.LastFormat = null; + ToStringState.LastProvider = null; + ToStringState.ToStringMode = ToStringMode.ObjectToString; + return _value; + } + } + + private struct FormattableInt32Wrapper : IFormattable, IHasToStringState + { + private readonly int _value; + public ToStringState ToStringState { get; } + + public FormattableInt32Wrapper(int i) + { + ToStringState = new ToStringState(); + _value = i; + } + + public string ToString(string format, IFormatProvider formatProvider) + { + ToStringState.LastFormat = format; + ToStringState.LastProvider = formatProvider; + ToStringState.ToStringMode = ToStringMode.IFormattableToString; + return _value.ToString(format, formatProvider); + } + + public override string ToString() + { + ToStringState.LastFormat = null; + ToStringState.LastProvider = null; + ToStringState.ToStringMode = ToStringMode.ObjectToString; + return _value.ToString(); + } + } + + private sealed class ToStringState + { + public string LastFormat { get; set; } + public IFormatProvider LastProvider { get; set; } + public ToStringMode ToStringMode { get; set; } + } + + private interface IHasToStringState + { + ToStringState ToStringState { get; } + } + + private enum ToStringMode + { + ObjectToString, + IFormattableToString, + ISpanFormattableTryFormat, + ICustomFormatterFormat, + } + + private sealed class StringWrapper + { + private readonly string _value; + + public StringWrapper(string s) => _value = s; + + public override string ToString() => _value; + } + + private sealed class ConcatFormatter : IFormatProvider, ICustomFormatter + { + public object GetFormat(Type formatType) => formatType == typeof(ICustomFormatter) ? this : null; + + public string Format(string format, object arg, IFormatProvider formatProvider) + { + string s = format + " " + arg + formatProvider; + + if (arg is IHasToStringState tss) + { + // Set after using arg.ToString() in concat above + tss.ToStringState.LastFormat = format; + tss.ToStringState.LastProvider = formatProvider; + tss.ToStringState.ToStringMode = ToStringMode.ICustomFormatterFormat; + } + + return s; + } + } + + private sealed class ConstFormatter : IFormatProvider, ICustomFormatter + { + private readonly string _value; + + public ConstFormatter(string value) => _value = value; + + public object GetFormat(Type formatType) => formatType == typeof(ICustomFormatter) ? this : null; + + public string Format(string format, object arg, IFormatProvider formatProvider) => _value; + } + } +} diff --git a/src/mono/sample/wasm/browser-test-debug/Wasm.Test.Debug.Sample.csproj b/src/mono/sample/wasm/browser-test-debug/Wasm.Test.Debug.Sample.csproj index be7b462cb3231b..4e97152de3a9df 100644 --- a/src/mono/sample/wasm/browser-test-debug/Wasm.Test.Debug.Sample.csproj +++ b/src/mono/sample/wasm/browser-test-debug/Wasm.Test.Debug.Sample.csproj @@ -22,10 +22,18 @@ - true + true false - + net10.0 + browser-wasm + + + + + portable + true + @@ -40,7 +48,7 @@ - + diff --git a/src/mono/sample/wasm/browser-test-debug/main.js b/src/mono/sample/wasm/browser-test-debug/main.js index 05ef3a3831b960..80430f186f9f7e 100644 --- a/src/mono/sample/wasm/browser-test-debug/main.js +++ b/src/mono/sample/wasm/browser-test-debug/main.js @@ -5,6 +5,24 @@ import { dotnet, exit } from './dotnet.js' let testAbort = true; let testError = true; +let Module; +function printGcLog(Module) { + try { + // List all files in the root directory + const files = Module.FS.readdir("/"); + // Find files matching gc_log.txt or gc_log.txt. + const gcLogPattern = /^gc_log\.txt(\.\d+)?$/; + const gcLogFile = files.find(f => gcLogPattern.test(f)); + if (gcLogFile) { + const contents = Module.FS.readFile(gcLogFile, { encoding: "utf8" }); + console.log(`=== ${gcLogFile} ===\n${contents}`); + } else { + console.log("gc_log.txt (with or without suffix) not found in Emscripten FS."); + } + } catch (e) { + console.error("Error reading gc_log.txt:", e); + } +} try { dotnet @@ -28,8 +46,10 @@ try { console.log('user code Module.onConfigLoaded'); // config is loaded and could be tweaked before the rest of the runtime startup sequence config.environmentVariables["MONO_LOG_LEVEL"] = "debug"; + config.environmentVariables["MONO_LOG_MASK"] = "gc"; + config.environmentVariables["MONO_GC_DEBUG"] = "8:gc_log.txt,print-gchandles,clear-nursery-at-gc"; // 1 or lower = None, 2 = info, 3 = debug, 4 = verbose, 5 = trace - config.environmentVariables["MH_LOG_VERBOSITY"] = "3"; + config.environmentVariables["MH_LOG_VERBOSITY"] = "3"; }, preInit: () => { console.log('user code Module.preInit'); }, preRun: () => { console.log('user code Module.preRun'); }, @@ -52,8 +72,9 @@ try { await dotnet.download(); - const { runtimeBuildInfo, setModuleImports, getAssemblyExports, runMain, getConfig, Module } = await dotnet.create(); - + const { runtimeBuildInfo, setModuleImports, getAssemblyExports, runMain, getConfig, Module: localModule } = await dotnet.create(); + Module = localModule; + globalThis.App = { runtime: { getAssemblyExports, @@ -68,10 +89,12 @@ try { await exports.Sample.Test.DoTestMethod(); document.getElementById("out").innerHTML = `PASSED`; - let exit_code = await runMain(config.mainAssemblyName, []); - + + console.log('user code Module.onRuntimeInitialized'); + printGcLog(Module); exit(exit_code); } catch (err) { + printGcLog(Module); exit(2, err); } From 4451ac5c252d6c0e8dfd99e9350eee4e1d894911 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 8 Sep 2025 12:06:36 +0100 Subject: [PATCH 164/209] WIP --- ...ystem.Runtime.InteropServices.Tests.csproj | 1 + src/mono/browser/runtime/invoke-cs.ts | 4 +- src/mono/browser/runtime/invoke-cs.ts.bak | 383 +++++++++++ src/mono/browser/runtime/invoke-js.ts.bak | 552 +++++++++++++++ src/mono/browser/runtime/marshal.ts | 5 +- src/mono/browser/runtime/marshal.ts.bak | 628 ++++++++++++++++++ src/mono/browser/runtime/runtime.c | 5 +- src/mono/browser/runtime/strings.ts | 8 + src/mono/browser/runtime/strings.ts.bak | 324 +++++++++ src/mono/mono/component/marshal-ilgen.c | 13 +- src/mono/mono/metadata/marshal-shared.c | 7 +- src/mono/mono/metadata/marshal.c | 7 +- src/mono/mono/metadata/object-internals.h | 2 + src/mono/mono/metadata/object.c | 13 +- src/mono/mono/mini/interp/interp-icalls.c | 1 + src/mono/mono/mini/interp/interp.c | 22 +- .../JavaScriptTestHelper.cs | 2 +- .../sample/wasm/browser-test-debug/Program.cs | 20 +- .../wasm/browser-test-debug/StringTests.cs | 11 + .../Wasm.Test.Debug.Sample.csproj | 4 +- .../sample/wasm/browser-test-debug/main.js | 16 +- .../wasm/browser-test-debug/wasmString.c | 8 + .../wasm/browser-test-debug/wasmString.h | 15 + src/native/libs/System.Native/CMakeLists.txt | 6 + src/native/public/mono/metadata/mh_log.h | 1 + 25 files changed, 2027 insertions(+), 31 deletions(-) create mode 100644 src/mono/browser/runtime/invoke-cs.ts.bak create mode 100644 src/mono/browser/runtime/invoke-js.ts.bak create mode 100644 src/mono/browser/runtime/marshal.ts.bak create mode 100644 src/mono/browser/runtime/strings.ts.bak create mode 100644 src/mono/sample/wasm/browser-test-debug/StringTests.cs create mode 100644 src/mono/sample/wasm/browser-test-debug/wasmString.c create mode 100644 src/mono/sample/wasm/browser-test-debug/wasmString.h diff --git a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj index 31369aaca2a4a3..b68856f60f062c 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj @@ -4,6 +4,7 @@ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetCoreAppCurrent)-browser true true + --setenv=MH_LOG_VERBOSITY=0 diff --git a/src/mono/browser/runtime/invoke-cs.ts b/src/mono/browser/runtime/invoke-cs.ts index 6dd8eba2c10b81..3b7a869e8661c3 100644 --- a/src/mono/browser/runtime/invoke-cs.ts +++ b/src/mono/browser/runtime/invoke-cs.ts @@ -15,12 +15,12 @@ import { MonoMethod, JSFunctionSignature, BoundMarshalerToCs, BoundMarshalerToJs import { assert_js_interop } from "./invoke-js"; import { startMeasure, MeasuredBlock, endMeasure } from "./profiler"; import { bind_assembly_exports, invoke_async_jsexport, invoke_sync_jsexport } from "./managed-exports"; -//import { mono_log_debug } from "./logging"; +import { mono_log_debug } from "./logging"; export function mono_wasm_bind_cs_function (method: MonoMethod, assemblyName: string, namespaceName: string, shortClassName: string, methodName: string, signatureHash: number, signature: JSFunctionSignature): void { const fullyQualifiedName = `[${assemblyName}] ${namespaceName}.${shortClassName}:${methodName}`; const mark = startMeasure(); - //mono_log_debug(() => `Binding [JSExport] ${namespaceName}.${shortClassName}:${methodName} from ${assemblyName} assembly`); + mono_log_debug(() => `Binding [JSExport] ${namespaceName}.${shortClassName}:${methodName} from ${assemblyName} assembly`); const version = get_signature_version(signature); mono_assert(version === 2, () => `Signature version ${version} mismatch.`); diff --git a/src/mono/browser/runtime/invoke-cs.ts.bak b/src/mono/browser/runtime/invoke-cs.ts.bak new file mode 100644 index 00000000000000..6dd8eba2c10b81 --- /dev/null +++ b/src/mono/browser/runtime/invoke-cs.ts.bak @@ -0,0 +1,383 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +import BuildConfiguration from "consts:configuration"; +import WasmEnableThreads from "consts:wasmEnableThreads"; + +import { Module, loaderHelpers, mono_assert, runtimeHelpers } from "./globals"; +import { bind_arg_marshal_to_cs } from "./marshal-to-cs"; +import { bind_arg_marshal_to_js, end_marshal_task_to_js } from "./marshal-to-js"; +import { + get_sig, get_signature_argument_count, + bound_cs_function_symbol, get_signature_version, alloc_stack_frame, get_signature_type, +} from "./marshal"; +import { MonoMethod, JSFunctionSignature, BoundMarshalerToCs, BoundMarshalerToJs, MarshalerType } from "./types/internal"; +import { assert_js_interop } from "./invoke-js"; +import { startMeasure, MeasuredBlock, endMeasure } from "./profiler"; +import { bind_assembly_exports, invoke_async_jsexport, invoke_sync_jsexport } from "./managed-exports"; +//import { mono_log_debug } from "./logging"; + +export function mono_wasm_bind_cs_function (method: MonoMethod, assemblyName: string, namespaceName: string, shortClassName: string, methodName: string, signatureHash: number, signature: JSFunctionSignature): void { + const fullyQualifiedName = `[${assemblyName}] ${namespaceName}.${shortClassName}:${methodName}`; + const mark = startMeasure(); + //mono_log_debug(() => `Binding [JSExport] ${namespaceName}.${shortClassName}:${methodName} from ${assemblyName} assembly`); + const version = get_signature_version(signature); + mono_assert(version === 2, () => `Signature version ${version} mismatch.`); + + + const args_count = get_signature_argument_count(signature); + + const arg_marshalers: (BoundMarshalerToCs)[] = new Array(args_count); + for (let index = 0; index < args_count; index++) { + const sig = get_sig(signature, index + 2); + const marshaler_type = get_signature_type(sig); + const arg_marshaler = bind_arg_marshal_to_cs(sig, marshaler_type, index + 2); + mono_assert(arg_marshaler, "ERR43: argument marshaler must be resolved"); + arg_marshalers[index] = arg_marshaler; + } + + const res_sig = get_sig(signature, 1); + let res_marshaler_type = get_signature_type(res_sig); + + // hack until we have public API for JSType.DiscardNoWait + if (WasmEnableThreads && shortClassName === "DefaultWebAssemblyJSRuntime" + && namespaceName === "Microsoft.AspNetCore.Components.WebAssembly.Services" + && (methodName === "BeginInvokeDotNet" || methodName === "EndInvokeJS" || methodName === "ReceiveByteArrayFromJS")) { + res_marshaler_type = MarshalerType.DiscardNoWait; + } + + const is_async = res_marshaler_type == MarshalerType.Task; + const is_discard_no_wait = res_marshaler_type == MarshalerType.DiscardNoWait; + if (is_async) { + res_marshaler_type = MarshalerType.TaskPreCreated; + } + const res_converter = bind_arg_marshal_to_js(res_sig, res_marshaler_type, 1); + + const closure: BindingClosure = { + method, + fullyQualifiedName, + args_count, + arg_marshalers, + res_converter, + is_async, + is_discard_no_wait, + isDisposed: false, + }; + let bound_fn: Function; + + if (is_async) { + if (args_count == 1 && res_converter) { + bound_fn = bind_fn_1RA(closure); + } else if (args_count == 2 && res_converter) { + bound_fn = bind_fn_2RA(closure); + } else { + bound_fn = bind_fn(closure); + } + } else if (is_discard_no_wait) { + bound_fn = bind_fn(closure); + } else { + if (args_count == 0 && !res_converter) { + bound_fn = bind_fn_0V(closure); + } else if (args_count == 1 && !res_converter) { + bound_fn = bind_fn_1V(closure); + } else if (args_count == 1 && res_converter) { + bound_fn = bind_fn_1R(closure); + } else if (args_count == 2 && res_converter) { + bound_fn = bind_fn_2R(closure); + } else { + bound_fn = bind_fn(closure); + } + } + + // this is just to make debugging easier. + // It's not CSP compliant and possibly not performant, that's why it's only enabled in debug builds + // in Release configuration, it would be a trimmed by rollup + if (BuildConfiguration === "Debug" && !runtimeHelpers.cspPolicy) { + try { + const url = `//# sourceURL=https://dotnet/JSExport/${methodName}`; + const body = `return (function JSExport_${methodName}(){ return fn.apply(this, arguments)});`; + bound_fn = new Function("fn", url + "\r\n" + body)(bound_fn); + } catch (ex) { + runtimeHelpers.cspPolicy = true; + } + } + + (bound_fn)[bound_cs_function_symbol] = closure; + + _walk_exports_to_set_function(assemblyName, namespaceName, shortClassName, methodName, signatureHash, bound_fn); + endMeasure(mark, MeasuredBlock.bindCsFunction, fullyQualifiedName); +} + +function bind_fn_0V (closure: BindingClosure) { + const method = closure.method; + const fqn = closure.fullyQualifiedName; + if (!WasmEnableThreads) (closure) = null; + return function bound_fn_0V () { + const mark = startMeasure(); + loaderHelpers.assert_runtime_running(); + mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); + const sp = Module.stackSave(); + try { + const size = 2; + const args = alloc_stack_frame(size); + // call C# side + invoke_sync_jsexport(method, args); + } finally { + Module.stackRestore(sp); + endMeasure(mark, MeasuredBlock.callCsFunction, fqn); + } + }; +} + +function bind_fn_1V (closure: BindingClosure) { + const method = closure.method; + const marshaler1 = closure.arg_marshalers[0]!; + const fqn = closure.fullyQualifiedName; + if (!WasmEnableThreads) (closure) = null; + return function bound_fn_1V (arg1: any) { + const mark = startMeasure(); + loaderHelpers.assert_runtime_running(); + mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); + const sp = Module.stackSave(); + try { + const size = 3; + const args = alloc_stack_frame(size); + marshaler1(args, arg1); + + // call C# side + invoke_sync_jsexport(method, args); + } finally { + Module.stackRestore(sp); + endMeasure(mark, MeasuredBlock.callCsFunction, fqn); + } + }; +} + +function bind_fn_1R (closure: BindingClosure) { + const method = closure.method; + const marshaler1 = closure.arg_marshalers[0]!; + const res_converter = closure.res_converter!; + const fqn = closure.fullyQualifiedName; + if (!WasmEnableThreads) (closure) = null; + return function bound_fn_1R (arg1: any) { + const mark = startMeasure(); + loaderHelpers.assert_runtime_running(); + mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); + const sp = Module.stackSave(); + try { + const size = 3; + const args = alloc_stack_frame(size); + marshaler1(args, arg1); + + // call C# side + invoke_sync_jsexport(method, args); + + const js_result = res_converter(args); + return js_result; + } finally { + Module.stackRestore(sp); + endMeasure(mark, MeasuredBlock.callCsFunction, fqn); + } + }; +} + +function bind_fn_1RA (closure: BindingClosure) { + const method = closure.method; + const marshaler1 = closure.arg_marshalers[0]!; + const res_converter = closure.res_converter!; + const fqn = closure.fullyQualifiedName; + if (!WasmEnableThreads) (closure) = null; + return function bind_fn_1RA (arg1: any) { + const mark = startMeasure(); + loaderHelpers.assert_runtime_running(); + mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); + const sp = Module.stackSave(); + try { + const size = 3; + const args = alloc_stack_frame(size); + marshaler1(args, arg1); + + // pre-allocate the promise + let promise = res_converter(args); + + // call C# side + invoke_async_jsexport(runtimeHelpers.managedThreadTID, method, args, size); + + // in case the C# side returned synchronously + promise = end_marshal_task_to_js(args, undefined, promise); + + return promise; + } finally { + Module.stackRestore(sp); + endMeasure(mark, MeasuredBlock.callCsFunction, fqn); + } + }; +} + +function bind_fn_2R (closure: BindingClosure) { + const method = closure.method; + const marshaler1 = closure.arg_marshalers[0]!; + const marshaler2 = closure.arg_marshalers[1]!; + const res_converter = closure.res_converter!; + const fqn = closure.fullyQualifiedName; + if (!WasmEnableThreads) (closure) = null; + return function bound_fn_2R (arg1: any, arg2: any) { + const mark = startMeasure(); + loaderHelpers.assert_runtime_running(); + mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); + const sp = Module.stackSave(); + try { + const size = 4; + const args = alloc_stack_frame(size); + marshaler1(args, arg1); + marshaler2(args, arg2); + + // call C# side + invoke_sync_jsexport(method, args); + + const js_result = res_converter(args); + return js_result; + } finally { + Module.stackRestore(sp); + endMeasure(mark, MeasuredBlock.callCsFunction, fqn); + } + }; +} + +function bind_fn_2RA (closure: BindingClosure) { + const method = closure.method; + const marshaler1 = closure.arg_marshalers[0]!; + const marshaler2 = closure.arg_marshalers[1]!; + const res_converter = closure.res_converter!; + const fqn = closure.fullyQualifiedName; + if (!WasmEnableThreads) (closure) = null; + return function bind_fn_2RA (arg1: any, arg2: any) { + const mark = startMeasure(); + loaderHelpers.assert_runtime_running(); + mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); + const sp = Module.stackSave(); + try { + const size = 4; + const args = alloc_stack_frame(size); + marshaler1(args, arg1); + marshaler2(args, arg2); + + // pre-allocate the promise + let promise = res_converter(args); + + // call C# side + invoke_async_jsexport(runtimeHelpers.managedThreadTID, method, args, size); + + // in case the C# side returned synchronously + promise = end_marshal_task_to_js(args, undefined, promise); + + return promise; + } finally { + Module.stackRestore(sp); + endMeasure(mark, MeasuredBlock.callCsFunction, fqn); + } + }; +} + +function bind_fn (closure: BindingClosure) { + const args_count = closure.args_count; + const arg_marshalers = closure.arg_marshalers; + const res_converter = closure.res_converter; + const method = closure.method; + const fqn = closure.fullyQualifiedName; + const is_async = closure.is_async; + const is_discard_no_wait = closure.is_discard_no_wait; + if (!WasmEnableThreads) (closure) = null; + return function bound_fn (...js_args: any[]) { + const mark = startMeasure(); + loaderHelpers.assert_runtime_running(); + mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); + const sp = Module.stackSave(); + try { + const size = 2 + args_count; + const args = alloc_stack_frame(size); + for (let index = 0; index < args_count; index++) { + const marshaler = arg_marshalers[index]; + if (marshaler) { + const js_arg = js_args[index]; + marshaler(args, js_arg); + } + } + let js_result = undefined; + if (is_async) { + // pre-allocate the promise + js_result = res_converter!(args); + } + + // call C# side + if (is_async) { + invoke_async_jsexport(runtimeHelpers.managedThreadTID, method, args, size); + // in case the C# side returned synchronously + js_result = end_marshal_task_to_js(args, undefined, js_result); + } else if (is_discard_no_wait) { + // call C# side, fire and forget + invoke_async_jsexport(runtimeHelpers.managedThreadTID, method, args, size); + } else { + invoke_sync_jsexport(method, args); + if (res_converter) { + js_result = res_converter(args); + } + } + return js_result; + } finally { + Module.stackRestore(sp); + endMeasure(mark, MeasuredBlock.callCsFunction, fqn); + } + }; +} + +type BindingClosure = { + fullyQualifiedName: string, + args_count: number, + method: MonoMethod, + arg_marshalers: (BoundMarshalerToCs)[], + res_converter: BoundMarshalerToJs | undefined, + is_async: boolean, + is_discard_no_wait: boolean, + isDisposed: boolean, +} + +export const exportsByAssembly: Map = new Map(); +function _walk_exports_to_set_function (assembly: string, namespace: string, classname: string, methodname: string, signature_hash: number, fn: Function): void { + const parts = `${namespace}.${classname}`.replace(/\//g, ".").split("."); + let scope: any = undefined; + let assemblyScope = exportsByAssembly.get(assembly); + if (!assemblyScope) { + assemblyScope = {}; + exportsByAssembly.set(assembly, assemblyScope); + exportsByAssembly.set(assembly + ".dll", assemblyScope); + } + scope = assemblyScope; + for (let i = 0; i < parts.length; i++) { + const part = parts[i]; + if (part != "") { + let newscope = scope[part]; + if (typeof newscope === "undefined") { + newscope = {}; + scope[part] = newscope; + } + mono_assert(newscope, () => `${part} not found while looking up ${classname}`); + scope = newscope; + } + } + + if (!scope[methodname]) { + scope[methodname] = fn; + } + scope[`${methodname}.${signature_hash}`] = fn; +} + +export async function mono_wasm_get_assembly_exports (assembly: string): Promise { + assert_js_interop(); + const result = exportsByAssembly.get(assembly); + if (!result) { + await bind_assembly_exports(assembly); + } + + return exportsByAssembly.get(assembly) || {}; +} diff --git a/src/mono/browser/runtime/invoke-js.ts.bak b/src/mono/browser/runtime/invoke-js.ts.bak new file mode 100644 index 00000000000000..0f235aff591ed8 --- /dev/null +++ b/src/mono/browser/runtime/invoke-js.ts.bak @@ -0,0 +1,552 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +import WasmEnableThreads from "consts:wasmEnableThreads"; +import BuildConfiguration from "consts:configuration"; +//import isWasm64 from "consts:isWasm64" +const isWasm64 = true; // TODO: remove hardcoding! + +import { marshal_exception_to_cs, bind_arg_marshal_to_cs, marshal_task_to_cs } from "./marshal-to-cs"; +import { get_signature_argument_count, bound_js_function_symbol, get_sig, get_signature_version, get_signature_type, imported_js_function_symbol, get_signature_handle, get_signature_function_name, get_signature_module_name, is_receiver_should_free, get_caller_native_tid, get_sync_done_semaphore_ptr, get_arg } from "./marshal"; +import { fixupPointer, forceThreadMemoryViewRefresh, free } from "./memory"; +import { JSFunctionSignature, JSMarshalerArguments, BoundMarshalerToJs, JSFnHandle, BoundMarshalerToCs, JSHandle, MarshalerType } from "./types/internal"; +import { INTERNAL, Module, loaderHelpers, mono_assert, runtimeHelpers } from "./globals"; +import { bind_arg_marshal_to_js } from "./marshal-to-js"; +import { mono_log_debug, mono_wasm_symbolicate_string } from "./logging"; +import { mono_wasm_get_jsobj_from_js_handle } from "./gc-handles"; +import { endMeasure, MeasuredBlock, startMeasure } from "./profiler"; +import { wrap_as_cancelable_promise } from "./cancelable-promise"; +import { threads_c_functions as tcwraps } from "./cwraps"; +import { monoThreadInfo } from "./pthreads"; +import { stringToUTF16Ptr } from "./strings"; + +export function safeBigIntToNumber (ptr: bigint): number { + if (ptr > BigInt(Number.MAX_SAFE_INTEGER) || ptr < BigInt(Number.MIN_SAFE_INTEGER)) { + throw new Error(`Pointer value ${ptr} is out of safe integer range for JavaScript numbers.`); + } + return Number(ptr); +} + +export const js_import_wrapper_by_fn_handle: Function[] = [null];// 0th slot is dummy, main thread we free them on shutdown. On web worker thread we free them when worker is detached. +function toPointerForWasm (signature: number, wasm64: boolean): number | bigint { + return wasm64 ? BigInt(signature) : signature; +} + +export function mono_wasm_bind_js_import_ST (signature: JSFunctionSignature): number | bigint { + if (WasmEnableThreads) return isWasm64 ? 0n : 0; + assert_js_interop(); + signature = fixupPointer(signature, 0); + try { + bind_js_import(signature); + return isWasm64 ? (BigInt("0") as any) : 0; + } catch (ex: any) { + const ptr = stringToUTF16Ptr(normalize_exception(ex)); + // @ts-expect-error TS2352: convert VoidPtr (number) to bigint for wasm64, or keep it as number for wasm32. + return toPointerForWasm(ptr as number, isWasm64); + } +} + +export function mono_wasm_invoke_jsimport_MT (signature: JSFunctionSignature, args: JSMarshalerArguments) { + if (!WasmEnableThreads) return; + assert_js_interop(); + signature = fixupPointer(signature, 0); + args = fixupPointer(args, 0); + + const function_handle = get_signature_handle(signature); + + let bound_fn = js_import_wrapper_by_fn_handle[function_handle]; + if (bound_fn == undefined) { + // it was not bound yet, let's do it now + try { + bound_fn = bind_js_import(signature); + } catch (ex: any) { + // propagate the exception back to caller, which could be on different thread. Handle both sync and async signatures. + try { + const res_sig = get_sig(signature, 1); + const res_type = get_signature_type(res_sig); + if (res_type === MarshalerType.Task) { + const res = get_arg(args, 1); + marshal_task_to_cs(res, Promise.reject(ex)); + } else { + marshal_exception_to_cs(args, ex); + if (monoThreadInfo.isUI) { + const done_semaphore = get_sync_done_semaphore_ptr(args); + tcwraps.mono_threads_wasm_sync_run_in_target_thread_done(done_semaphore); + } + } + return; + } catch (ex: any) { + loaderHelpers.mono_exit(1, ex); + return; + } + } + } + mono_assert(bound_fn, () => `Imported function handle expected ${function_handle}`); + + bound_fn(args); +} + +function log_function_name_from_handle (function_handle: JSFnHandle): void { + const bound_fn = js_import_wrapper_by_fn_handle[function_handle]; + const closure = (bound_fn as any)[imported_js_function_symbol]; + if (closure) { + mono_log_debug(() => `Invoking ${closure.fqn}`); + } +} + +export function mono_wasm_invoke_jsimport_ST (function_handle: JSFnHandle, args: JSMarshalerArguments): void { + if (WasmEnableThreads) return; + log_function_name_from_handle(function_handle); + loaderHelpers.assert_runtime_running(); + args = fixupPointer(args, 0); + const bound_fn = js_import_wrapper_by_fn_handle[function_handle]; + mono_assert(bound_fn, () => `Imported function handle expected ${function_handle}`); + bound_fn(args); +} + +function bind_js_import (signature: JSFunctionSignature): Function { + assert_js_interop(); + const mark = startMeasure(); + + const version = get_signature_version(signature); + mono_assert(version === 2, () => `Signature version ${version} mismatch.`); + + const js_function_name = get_signature_function_name(signature)!; + const js_module_name = get_signature_module_name(signature)!; + const function_handle = get_signature_handle(signature); + + mono_log_debug(() => `Binding [JSImport] ${js_function_name} from ${js_module_name} module`); + + const fn = mono_wasm_lookup_js_import(js_function_name, js_module_name); + const args_count = get_signature_argument_count(signature); + + const arg_marshalers: (BoundMarshalerToJs)[] = new Array(args_count); + const arg_cleanup: (Function | undefined)[] = new Array(args_count); + let has_cleanup = false; + for (let index = 0; index < args_count; index++) { + const sig = get_sig(signature, index + 2); + const marshaler_type = get_signature_type(sig); + const arg_marshaler = bind_arg_marshal_to_js(sig, marshaler_type, index + 2); + mono_assert(arg_marshaler, "ERR42: argument marshaler must be resolved"); + arg_marshalers[index] = arg_marshaler; + if (marshaler_type === MarshalerType.Span) { + arg_cleanup[index] = (js_arg: any) => { + if (js_arg) { + js_arg.dispose(); + } + }; + has_cleanup = true; + } + } + const res_sig = get_sig(signature, 1); + const res_marshaler_type = get_signature_type(res_sig); + const res_converter = bind_arg_marshal_to_cs(res_sig, res_marshaler_type, 1); + + const is_discard_no_wait = res_marshaler_type == MarshalerType.DiscardNoWait; + const is_async = res_marshaler_type == MarshalerType.Task || res_marshaler_type == MarshalerType.TaskPreCreated; + + const closure: BindingClosure = { + fn, + fqn: js_module_name + ":" + js_function_name, + args_count, + arg_marshalers, + res_converter, + has_cleanup, + arg_cleanup, + is_discard_no_wait, + is_async, + isDisposed: false, + }; + let bound_fn: WrappedJSFunction; + if (is_async || is_discard_no_wait || has_cleanup) { + bound_fn = bind_fn(closure); + } else { + if (args_count == 0 && !res_converter) { + bound_fn = bind_fn_0V(closure); + } else if (args_count == 1 && !res_converter) { + bound_fn = bind_fn_1V(closure); + } else if (args_count == 1 && res_converter) { + bound_fn = bind_fn_1R(closure); + } else if (args_count == 2 && res_converter) { + bound_fn = bind_fn_2R(closure); + } else { + bound_fn = bind_fn(closure); + } + } + + function async_bound_fn (args: JSMarshalerArguments): void { + forceThreadMemoryViewRefresh(); + bound_fn(args); + } + function sync_bound_fn (args: JSMarshalerArguments): void { + const previous = runtimeHelpers.isPendingSynchronousCall; + try { + forceThreadMemoryViewRefresh(); + const caller_tid = get_caller_native_tid(args); + runtimeHelpers.isPendingSynchronousCall = runtimeHelpers.managedThreadTID === caller_tid; + bound_fn(args); + } finally { + runtimeHelpers.isPendingSynchronousCall = previous; + } + } + function async_bound_fn_ui (args: JSMarshalerArguments): void { + invoke_later_when_on_ui_thread_async(() => async_bound_fn(args)); + } + function sync_bound_fn_ui (args: JSMarshalerArguments): void { + invoke_later_when_on_ui_thread_sync(() => sync_bound_fn(args), args); + } + + let wrapped_fn: WrappedJSFunction = bound_fn; + if (WasmEnableThreads) { + if (monoThreadInfo.isUI) { + if (is_async || is_discard_no_wait) { + wrapped_fn = async_bound_fn_ui; + } else { + wrapped_fn = sync_bound_fn_ui; + } + } else { + if (is_async || is_discard_no_wait) { + wrapped_fn = async_bound_fn; + } else { + wrapped_fn = sync_bound_fn; + } + } + } + + // this is just to make debugging easier by naming the function in the stack trace. + // It's not CSP compliant and possibly not performant, that's why it's only enabled in debug builds + // in Release configuration, it would be a trimmed by rollup + if (BuildConfiguration === "Debug" && !runtimeHelpers.cspPolicy) { + try { + const fname = js_function_name.replaceAll(".", "_"); + const url = `//# sourceURL=https://dotnet/JSImport/${fname}`; + const body = `return (function JSImport_${fname}(){ return fn.apply(this, arguments)});`; + wrapped_fn = new Function("fn", url + "\r\n" + body)(wrapped_fn); + } catch (ex) { + runtimeHelpers.cspPolicy = true; + } + } + + (wrapped_fn)[imported_js_function_symbol] = closure; + + js_import_wrapper_by_fn_handle[function_handle] = wrapped_fn; + + endMeasure(mark, MeasuredBlock.bindJsFunction, js_function_name); + + return wrapped_fn; +} + +function bind_fn_0V (closure: BindingClosure) { + const fn = closure.fn; + const fqn = closure.fqn; + if (!WasmEnableThreads) (closure) = null; + return function bound_fn_0V (args: JSMarshalerArguments) { + const mark = startMeasure(); + try { + mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); + // call user function + fn(); + } catch (ex) { + marshal_exception_to_cs(args, ex); + } finally { + endMeasure(mark, MeasuredBlock.callCsFunction, fqn); + } + }; +} + +function bind_fn_1V (closure: BindingClosure) { + const fn = closure.fn; + const marshaler1 = closure.arg_marshalers[0]!; + const fqn = closure.fqn; + if (!WasmEnableThreads) (closure) = null; + return function bound_fn_1V (args: JSMarshalerArguments) { + const mark = startMeasure(); + try { + mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); + const arg1 = marshaler1(args); + // call user function + fn(arg1); + } catch (ex) { + marshal_exception_to_cs(args, ex); + } finally { + endMeasure(mark, MeasuredBlock.callCsFunction, fqn); + } + }; +} + +function bind_fn_1R (closure: BindingClosure) { + const fn = closure.fn; + const marshaler1 = closure.arg_marshalers[0]!; + const res_converter = closure.res_converter!; + const fqn = closure.fqn; + if (!WasmEnableThreads) (closure) = null; + return function bound_fn_1R (args: JSMarshalerArguments) { + const mark = startMeasure(); + try { + mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); + const arg1 = marshaler1(args); + // call user function + const js_result = fn(arg1); + res_converter(args, js_result); + } catch (ex) { + marshal_exception_to_cs(args, ex); + } finally { + endMeasure(mark, MeasuredBlock.callCsFunction, fqn); + } + }; +} + +function bind_fn_2R (closure: BindingClosure) { + const fn = closure.fn; + const marshaler1 = closure.arg_marshalers[0]!; + const marshaler2 = closure.arg_marshalers[1]!; + const res_converter = closure.res_converter!; + const fqn = closure.fqn; + if (!WasmEnableThreads) (closure) = null; + return function bound_fn_2R (args: JSMarshalerArguments) { + const mark = startMeasure(); + try { + mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); + const arg1 = marshaler1(args); + const arg2 = marshaler2(args); + // call user function + const js_result = fn(arg1, arg2); + res_converter(args, js_result); + } catch (ex) { + marshal_exception_to_cs(args, ex); + } finally { + endMeasure(mark, MeasuredBlock.callCsFunction, fqn); + } + }; +} + +function bind_fn (closure: BindingClosure) { + const args_count = closure.args_count; + const arg_marshalers = closure.arg_marshalers; + const res_converter = closure.res_converter; + const arg_cleanup = closure.arg_cleanup; + const has_cleanup = closure.has_cleanup; + const fn = closure.fn; + const fqn = closure.fqn; + if (!WasmEnableThreads) (closure) = null; + return function bound_fn (args: JSMarshalerArguments) { + const receiver_should_free = WasmEnableThreads && is_receiver_should_free(args); + const mark = startMeasure(); + try { + mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); + const js_args = new Array(args_count); + for (let index = 0; index < args_count; index++) { + const marshaler = arg_marshalers[index]!; + const js_arg = marshaler(args); + js_args[index] = js_arg; + } + + // call user function + const js_result = fn(...js_args); + + if (res_converter) { + res_converter(args, js_result); + } + + if (has_cleanup) { + for (let index = 0; index < args_count; index++) { + const cleanup = arg_cleanup[index]; + if (cleanup) { + cleanup(js_args[index]); + } + } + } + } catch (ex) { + marshal_exception_to_cs(args, ex); + } finally { + if (receiver_should_free) { + free(args as any); + } + endMeasure(mark, MeasuredBlock.callCsFunction, fqn); + } + }; +} + +type WrappedJSFunction = (args: JSMarshalerArguments) => void; + +type BindingClosure = { + fn: Function, + fqn: string, + isDisposed: boolean, + args_count: number, + arg_marshalers: (BoundMarshalerToJs)[], + res_converter: BoundMarshalerToCs | undefined, + has_cleanup: boolean, + is_discard_no_wait: boolean, + is_async: boolean, + arg_cleanup: (Function | undefined)[] +} + +export function mono_wasm_invoke_js_function (bound_function_js_handle: JSHandle, args: JSMarshalerArguments): void { + invoke_later_when_on_ui_thread_sync(() => mono_wasm_invoke_js_function_impl(bound_function_js_handle, args), args); +} + +export function mono_wasm_invoke_js_function_impl (bound_function_js_handle: JSHandle, args: JSMarshalerArguments): void { + loaderHelpers.assert_runtime_running(); + const bound_fn = mono_wasm_get_jsobj_from_js_handle(bound_function_js_handle); + mono_assert(bound_fn && typeof (bound_fn) === "function" && bound_fn[bound_js_function_symbol], () => `Bound function handle expected ${bound_function_js_handle}`); + args = fixupPointer(args, 0); + bound_fn(args); +} + +export function mono_wasm_set_module_imports (module_name: string, moduleImports: any) { + importedModules.set(module_name, moduleImports); + mono_log_debug(() => `added module imports '${module_name}'`); +} + +function mono_wasm_lookup_js_import (function_name: string, js_module_name: string | null): Function { + mono_assert(function_name && typeof function_name === "string", "function_name must be string"); + + let scope: any = {}; + const parts = function_name.split("."); + if (js_module_name) { + scope = importedModules.get(js_module_name); + if (WasmEnableThreads) { + mono_assert(scope, () => `ES6 module ${js_module_name} was not imported yet, please call JSHost.ImportAsync() on the UI or JSWebWorker thread first in order to invoke ${function_name}.`); + } else { + mono_assert(scope, () => `ES6 module ${js_module_name} was not imported yet, please call JSHost.ImportAsync() first in order to invoke ${function_name}.`); + } + } else if (parts[0] === "INTERNAL") { + scope = INTERNAL; + parts.shift(); + } else if (parts[0] === "globalThis") { + scope = globalThis; + parts.shift(); + } + + for (let i = 0; i < parts.length - 1; i++) { + const part = parts[i]; + const newscope = scope[part]; + if (!newscope) { + throw new Error(`${part} not found while looking up ${function_name}`); + } + scope = newscope; + } + + const fname = parts[parts.length - 1]; + const fn = scope[fname]; + + if (typeof (fn) !== "function") { + throw new Error(`${function_name} must be a Function but was ${typeof fn}`); + } + + // if the function was already bound to some object it would stay bound to original object. That's good. + return fn.bind(scope); +} + +export function set_property (self: any, name: string, value: any): void { + mono_check(self, "Null reference"); + self[name] = value; +} + +export function get_property (self: any, name: string): any { + mono_check(self, "Null reference"); + return self[name]; +} + +export function has_property (self: any, name: string): boolean { + mono_check(self, "Null reference"); + return name in self; +} + +export function get_typeof_property (self: any, name: string): string { + mono_check(self, "Null reference"); + return typeof self[name]; +} + +export function get_global_this (): any { + return globalThis; +} + +export const importedModulesPromises: Map> = new Map(); +export const importedModules: Map> = new Map(); + +export function dynamic_import (module_name: string, module_url: string): Promise { + assert_js_interop(); + mono_assert(module_name && typeof module_name === "string", "module_name must be string"); + mono_assert(module_url && typeof module_url === "string", "module_url must be string"); + let promise = importedModulesPromises.get(module_name); + const newPromise = !promise; + if (newPromise) { + mono_log_debug(() => `importing ES6 module '${module_name}' from '${module_url}'`); + promise = import(/*! webpackIgnore: true */module_url); + importedModulesPromises.set(module_name, promise); + } + + return wrap_as_cancelable_promise(async () => { + const module = await promise; + if (newPromise) { + importedModules.set(module_name, module); + mono_log_debug(() => `imported ES6 module '${module_name}' from '${module_url}'`); + } + return module; + }); +} + +export function normalize_exception (ex: any) { + let res = "unknown exception"; + if (ex) { + res = ex.toString(); + const stack = ex.stack; + if (stack) { + // Some JS runtimes insert the error message at the top of the stack, some don't, + // so normalize it by using the stack as the result if it already contains the error + if (stack.startsWith(res)) + res = stack; + else + res += "\n" + stack; + } + + res = mono_wasm_symbolicate_string(res); + } + return res; +} + +export function assert_js_interop (): void { + loaderHelpers.assert_runtime_running(); + if (WasmEnableThreads) { + mono_assert(runtimeHelpers.mono_wasm_bindings_is_ready && runtimeHelpers.proxyGCHandle, "Please use dedicated worker for working with JavaScript interop. See https://github.com/dotnet/runtime/blob/main/src/mono/wasm/threads.md#JS-interop-on-dedicated-threads"); + } else { + mono_assert(runtimeHelpers.mono_wasm_bindings_is_ready, "The runtime must be initialized."); + } +} + +export function assert_c_interop (): void { + loaderHelpers.assert_runtime_running(); + if (WasmEnableThreads) { + mono_assert(runtimeHelpers.mono_wasm_bindings_is_ready, "Please use dedicated worker for working with JavaScript interop. See https://github.com/dotnet/runtime/blob/main/src/mono/wasm/threads.md#JS-interop-on-dedicated-threads"); + } else { + mono_assert(runtimeHelpers.mono_wasm_bindings_is_ready, "The runtime must be initialized."); + } +} + +// make sure we are not blocking em_task_queue_execute up the call stack +// so that when we call back to managed, the FS calls could still be processed by the UI thread +// see also emscripten_yield which can process the FS calls inside the spin wait +export function invoke_later_when_on_ui_thread_sync (fn: Function, args: JSMarshalerArguments) { + if (WasmEnableThreads && monoThreadInfo.isUI) { + Module.safeSetTimeout(() => { + fn(); + // see also mono_threads_wasm_sync_run_in_target_thread_vii_cb + const done_semaphore = get_sync_done_semaphore_ptr(args); + tcwraps.mono_threads_wasm_sync_run_in_target_thread_done(done_semaphore); + }, 0); + } else { + fn(); + } +} + +// make sure we are not blocking em_task_queue_execute up the call stack +// so that when we call back to managed, the FS calls could still be processed by the UI thread +export function invoke_later_when_on_ui_thread_async (fn: Function) { + if (WasmEnableThreads && monoThreadInfo.isUI) { + Module.safeSetTimeout(fn, 0); + } else { + fn(); + } +} diff --git a/src/mono/browser/runtime/marshal.ts b/src/mono/browser/runtime/marshal.ts index 492a830b23bf3a..1906539df933f8 100644 --- a/src/mono/browser/runtime/marshal.ts +++ b/src/mono/browser/runtime/marshal.ts @@ -13,7 +13,7 @@ import { GCHandle, JSHandle, MonoObject, MonoString, GCHandleNull, JSMarshalerAr import { TypedArray, VoidPtr } from "./types/emscripten"; import { utf16ToString } from "./strings"; import { get_managed_stack_trace } from "./managed-exports"; -//import { mono_log_debug } from "./logging"; +import { mono_log_debug } from "./logging"; export const cs_to_js_marshalers = new Map(); export const js_to_cs_marshalers = new Map(); @@ -161,16 +161,19 @@ export function get_signature_res_type (sig: JSMarshalerType): MarshalerType { export function get_signature_arg1_type (sig: JSMarshalerType): MarshalerType { mono_assert(sig, "Null sig"); + mono_log_debug(`get_signature_arg1_type for sig '${sig}' is '${getU8(add_offset(sig, JSBindingTypeOffsets.Arg1MarshalerType))}'`); return getU8(add_offset(sig, JSBindingTypeOffsets.Arg1MarshalerType)) as any; } export function get_signature_arg2_type (sig: JSMarshalerType): MarshalerType { mono_assert(sig, "Null sig"); + mono_log_debug(`get_signature_arg3_type for sig '${sig}' is '${getU8(add_offset(sig, JSBindingTypeOffsets.Arg2MarshalerType))}'`); return getU8(add_offset(sig, JSBindingTypeOffsets.Arg2MarshalerType)) as any; } export function get_signature_arg3_type (sig: JSMarshalerType): MarshalerType { mono_assert(sig, "Null sig"); + mono_log_debug(`get_signature_arg3_type for sig '${sig}' is '${getU8(add_offset(sig, JSBindingTypeOffsets.Arg3MarshalerType))}'`); return getU8(add_offset(sig, JSBindingTypeOffsets.Arg3MarshalerType)) as any; } diff --git a/src/mono/browser/runtime/marshal.ts.bak b/src/mono/browser/runtime/marshal.ts.bak new file mode 100644 index 00000000000000..492a830b23bf3a --- /dev/null +++ b/src/mono/browser/runtime/marshal.ts.bak @@ -0,0 +1,628 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +import WasmEnableThreads from "consts:wasmEnableThreads"; +import isWasm64 from "consts:isWasm64"; +//const isWasm64 = true; // TODO: remove hardcoding! + +import { js_owned_gc_handle_symbol, teardown_managed_proxy } from "./gc-handles"; +import { Module, loaderHelpers, mono_assert, runtimeHelpers } from "./globals"; +import { getF32, getF64, getI16, getI32, getI64Big, getU16, getU32, getU8, setF32, setF64, setI16, setI32, setI64Big, setU16, setU32, setU8, localHeapViewF64, localHeapViewI32, localHeapViewU8, _zero_region, forceThreadMemoryViewRefresh, setB8, getB8 } from "./memory"; +import { mono_wasm_new_external_root } from "./roots"; +import { GCHandle, JSHandle, MonoObject, MonoString, GCHandleNull, JSMarshalerArguments, JSFunctionSignature, JSMarshalerType, JSMarshalerArgument, MarshalerToJs, MarshalerToCs, WasmRoot, MarshalerType, PThreadPtr, PThreadPtrNull, VoidPtrNull } from "./types/internal"; +import { TypedArray, VoidPtr } from "./types/emscripten"; +import { utf16ToString } from "./strings"; +import { get_managed_stack_trace } from "./managed-exports"; +//import { mono_log_debug } from "./logging"; + +export const cs_to_js_marshalers = new Map(); +export const js_to_cs_marshalers = new Map(); +export const bound_cs_function_symbol = Symbol.for("wasm bound_cs_function"); +export const bound_js_function_symbol = Symbol.for("wasm bound_js_function"); +export const imported_js_function_symbol = Symbol.for("wasm imported_js_function"); +export const proxy_debug_symbol = Symbol.for("wasm proxy_debug"); +export const JavaScriptMarshalerArgSize = isWasm64 ? 64 : 32; + +// keep in sync with JSMarshalerArgumentImpl offsets +const enum JSMarshalerArgumentOffsets { + BooleanValue = 0, + ByteValue = 0, + CharValue = 0, + Int16Value = 0, + Int32Value = 0, + Int64Value = 0, + SingleValue = 0, + DoubleValue = 0, + IntPtrValue = 0, + JSHandle = 8, + GCHandle = 8, + Length = 16, + Type = 24, + ElementType = 25, + ContextHandle = 32, + ReceiverShouldFree = 40, + CallerNativeTID = 48, + SyncDoneSemaphorePtr = 56, +} + +export const JSMarshalerTypeSize = 32; +// keep in sync with JSFunctionBinding.JSBindingType +const enum JSBindingTypeOffsets { + Type = 0, + ResultMarshalerType = 16, + Arg1MarshalerType = 20, + Arg2MarshalerType = 24, + Arg3MarshalerType = 28, +} +export const JSMarshalerSignatureHeaderSize = 4 * 8; // without Exception and Result +// keep in sync with JSFunctionBinding.JSBindingHeader +const enum JSBindingHeaderOffsets { + Version = 0, + ArgumentCount = 4, + ImportHandle = 8, + FunctionNameOffset = 16, + FunctionNameLength = 20, + ModuleNameOffset = 24, + ModuleNameLength = 28, + Exception = 32, + Result = 64, +} + +export function alloc_stack_frame (size: number): JSMarshalerArguments { + forceThreadMemoryViewRefresh(); + const bytes = JavaScriptMarshalerArgSize * size; + const args = Module.stackAlloc(bytes) as any; + _zero_region(args, bytes); + set_args_context(args); + return args; +} + +export function get_arg (args: JSMarshalerArguments, index: number): JSMarshalerArgument { + mono_assert(args, "Null args"); + return add_offset(args, index * JavaScriptMarshalerArgSize) as any; +} + +export function is_args_exception (args: JSMarshalerArguments): boolean { + mono_assert(args, "Null args"); + const exceptionType = get_arg_type(args); + return exceptionType !== MarshalerType.None; +} + +export function is_receiver_should_free (args: JSMarshalerArguments): boolean { + if (!WasmEnableThreads) return false; + mono_assert(args, "Null args"); + return getB8(add_offset(args, JSMarshalerArgumentOffsets.ReceiverShouldFree)); +} + +export function get_sync_done_semaphore_ptr (args: JSMarshalerArguments): VoidPtr { + if (!WasmEnableThreads) return VoidPtrNull; + mono_assert(args, "Null args"); + return get_arg_handle(args, JSMarshalerArgumentOffsets.SyncDoneSemaphorePtr) as any; +} + +export function get_caller_native_tid (args: JSMarshalerArguments): PThreadPtr { + if (!WasmEnableThreads) return PThreadPtrNull; + mono_assert(args, "Null args"); + return get_arg_handle(args, JSMarshalerArgumentOffsets.CallerNativeTID) as any; +} + +export function set_receiver_should_free (args: JSMarshalerArguments): void { + mono_assert(args, "Null args"); + setB8(add_offset(args, JSMarshalerArgumentOffsets.ReceiverShouldFree), true); +} + +export function set_args_context (args: JSMarshalerArguments): void { + if (!WasmEnableThreads) return; + mono_assert(args, "Null args"); + const exc = get_arg(args, 0); + const res = get_arg(args, 1); + set_arg_proxy_context(exc); + set_arg_proxy_context(res); +} +export function add_offset ( + ptr: JSMarshalerArguments | JSMarshalerArgument | JSFunctionSignature | number | bigint | JSMarshalerType, + offset: number +): number { + if (typeof ptr === "bigint") { + const result = ptr + BigInt(offset); + if (result > BigInt(Number.MAX_SAFE_INTEGER)) { + throw new Error("Offset too large for JavaScript typed arrays/DataView"); + } + return Number(result); + } else { + return (ptr as number) + offset; + } +} +export function normalizePointer (inPtr: bigint | number | VoidPtr): any { + const ptr = typeof inPtr === "bigint" ? Number(inPtr) : inPtr; + if (!Number.isSafeInteger(ptr)) { + if (typeof inPtr === "bigint") { + throw new Error("pointer value is out of safe integer range. Converted from bigint."); + } else { + throw new Error("pointer value is out of safe integer range."); + } + } + return ptr; +} +export function get_sig (signature: JSFunctionSignature, index: number): JSMarshalerType { + mono_assert(signature, "Null signatures"); + return add_offset(signature, (index * JSMarshalerTypeSize) + JSMarshalerSignatureHeaderSize) as any; +} + +export function get_signature_type (sig: JSMarshalerType): MarshalerType { + mono_assert(sig, "Null sig"); + return getU8(add_offset(sig, JSBindingTypeOffsets.Type)) as any; +} + +export function get_signature_res_type (sig: JSMarshalerType): MarshalerType { + mono_assert(sig, "Null sig"); + return getU8(add_offset(sig, JSBindingTypeOffsets.ResultMarshalerType)) as any; +} + +export function get_signature_arg1_type (sig: JSMarshalerType): MarshalerType { + mono_assert(sig, "Null sig"); + return getU8(add_offset(sig, JSBindingTypeOffsets.Arg1MarshalerType)) as any; +} + +export function get_signature_arg2_type (sig: JSMarshalerType): MarshalerType { + mono_assert(sig, "Null sig"); + return getU8(add_offset(sig, JSBindingTypeOffsets.Arg2MarshalerType)) as any; +} + +export function get_signature_arg3_type (sig: JSMarshalerType): MarshalerType { + mono_assert(sig, "Null sig"); + return getU8(add_offset(sig, JSBindingTypeOffsets.Arg3MarshalerType)) as any; +} + +export function get_signature_argument_count (signature: JSFunctionSignature): number { + mono_assert(signature, "Null signatures"); + return getI32(add_offset(signature, JSBindingHeaderOffsets.ArgumentCount)) as any; +} + +export function get_signature_version (signature: JSFunctionSignature): number { + mono_assert(signature, "Null signatures"); + const offset = add_offset(signature, JSBindingHeaderOffsets.Version); + return getI32(offset); +} + +export function get_signature_handle (signature: JSFunctionSignature): number { + mono_assert(signature, "Null signatures"); + return getI32(add_offset(signature, JSBindingHeaderOffsets.ImportHandle)) as any; +} + +export function get_signature_function_name (signature: JSFunctionSignature): string | null { + mono_assert(signature, "Null signatures"); + const functionNameOffset = getI32(add_offset(signature, JSBindingHeaderOffsets.FunctionNameOffset)); + if (functionNameOffset === 0) return null; + const functionNameLength = getI32(add_offset(signature, JSBindingHeaderOffsets.FunctionNameLength)); + mono_assert(functionNameOffset, "Null name"); + return utf16ToString( + add_offset(signature, functionNameOffset), + add_offset(signature, functionNameOffset + functionNameLength) + ); +} + +export function get_signature_module_name (signature: JSFunctionSignature): string | null { + mono_assert(signature, "Null signatures"); + const moduleNameOffset = getI32(add_offset(signature, JSBindingHeaderOffsets.ModuleNameOffset)); + if (moduleNameOffset === 0) return null; + const moduleNameLength = getI32(add_offset(signature, JSBindingHeaderOffsets.ModuleNameLength)); + return utf16ToString( + add_offset(signature, moduleNameOffset), + add_offset(signature, moduleNameOffset + moduleNameLength) + ); +} + +export function get_sig_type (sig: JSMarshalerType): MarshalerType { + mono_assert(sig, "Null signatures"); + return getU8(sig); +} + +export function get_arg_type (arg: JSMarshalerArgument): MarshalerType { + mono_assert(arg, "Null arg"); + const type = getU8(add_offset(arg, JSMarshalerArgumentOffsets.Type)); + return type as any; +} + +export function get_arg_element_type (arg: JSMarshalerArgument): MarshalerType { + mono_assert(arg, "Null arg"); + const type = getU8(add_offset(arg, JSMarshalerArgumentOffsets.ElementType)); + return type as any; +} + +export function set_arg_type (arg: JSMarshalerArgument, type: MarshalerType): void { + mono_assert(arg, "Null arg"); + setU8(add_offset(arg, JSMarshalerArgumentOffsets.Type), type); +} + +export function set_arg_element_type (arg: JSMarshalerArgument, type: MarshalerType): void { + mono_assert(arg, "Null arg"); + setU8(add_offset(arg, JSMarshalerArgumentOffsets.ElementType), type); +} + +export function get_arg_bool (arg: JSMarshalerArgument): boolean { + mono_assert(arg, "Null arg"); + return getB8(arg as any); +} + +export function get_arg_u8 (arg: JSMarshalerArgument): number { + mono_assert(arg, "Null arg"); + return getU8(arg as any); +} + +export function get_arg_u16 (arg: JSMarshalerArgument): number { + mono_assert(arg, "Null arg"); + return getU16(arg); +} + +export function get_arg_i16 (arg: JSMarshalerArgument): number { + mono_assert(arg, "Null arg"); + return getI16(arg); +} + +export function get_arg_i32 (arg: JSMarshalerArgument): number { + mono_assert(arg, "Null arg"); + return getI32(arg); +} + +export function get_arg_intptr (arg: JSMarshalerArgument): number | bigint { + mono_assert(arg, "Null arg"); + return isWasm64 ? getI64Big(arg) : getU32(arg); +} + +export function get_arg_i52 (arg: JSMarshalerArgument): number { + mono_assert(arg, "Null arg"); + // we know that the range check and conversion from Int64 was be done on C# side + return getF64(arg); +} + +export function get_arg_i64_big (arg: JSMarshalerArgument): bigint { + mono_assert(arg, "Null arg"); + return getI64Big(arg); +} + +export function get_arg_date (arg: JSMarshalerArgument): Date { + mono_assert(arg, "Null arg"); + const unixTime = getF64(arg); + const date = new Date(unixTime); + return date; +} + +export function get_arg_f32 (arg: JSMarshalerArgument): number { + mono_assert(arg, "Null arg"); + return getF32(arg); +} + +export function get_arg_f64 (arg: JSMarshalerArgument): number { + mono_assert(arg, "Null arg"); + return getF64(arg); +} + +export function set_arg_bool (arg: JSMarshalerArgument, value: boolean): void { + mono_assert(arg, "Null arg"); + mono_check(typeof value === "boolean", () => `Value is not a Boolean: ${value} (${typeof (value)})`); + setB8(arg, value); +} + +export function set_arg_u8 (arg: JSMarshalerArgument, value: number): void { + mono_assert(arg, "Null arg"); + setU8(arg, value); +} + +export function set_arg_u16 (arg: JSMarshalerArgument, value: number): void { + mono_assert(arg, "Null arg"); + setU16(arg, value); +} + +export function set_arg_i16 (arg: JSMarshalerArgument, value: number): void { + mono_assert(arg, "Null arg"); + setI16(arg, value); +} + +export function set_arg_i32 (arg: JSMarshalerArgument, value: number): void { + mono_assert(arg, "Null arg"); + setI32(arg, value); +} + +export function set_arg_intptr (arg: JSMarshalerArgument, value: VoidPtr | bigint | number): void { + mono_assert(arg, "Null arg"); + if (isWasm64) { + if (typeof value !== "bigint") + setI64Big(arg, BigInt(value as number)); + else + setI64Big(arg, value as bigint); + } else { + setU32(arg, value as number); + } +} + +export function set_arg_i52 (arg: JSMarshalerArgument, value: number): void { + mono_assert(arg, "Null arg"); + mono_check(Number.isSafeInteger(value), () => `Value is not an integer: ${value} (${typeof (value)})`); + // we know that conversion to Int64 would be done on C# side + setF64(arg, value); +} + +export function set_arg_i64_big (arg: JSMarshalerArgument, value: bigint): void { + mono_assert(arg, "Null arg"); + setI64Big(arg, value); +} + +export function set_arg_date (arg: JSMarshalerArgument, value: Date): void { + mono_assert(arg, "Null arg"); + // getTime() is always UTC + const unixTime = value.getTime(); + setF64(arg, unixTime); +} + +export function set_arg_f64 (arg: JSMarshalerArgument, value: number): void { + mono_assert(arg, "Null arg"); + setF64(arg, value); +} + +export function set_arg_f32 (arg: JSMarshalerArgument, value: number): void { + mono_assert(arg, "Null arg"); + setF32(arg, value); +} + +function set_arg_handle (arg: JSMarshalerArgument, offset: number, handle: JSHandle | GCHandle | undefined): void { + if (isWasm64) { + if (typeof handle !== "bigint") + setI64Big(add_offset(arg, offset), BigInt(handle as any as number)); + else + setI64Big(add_offset(arg, offset), handle as bigint); + } else { + setI32(add_offset(arg, offset), handle as any); + } +} + +function get_arg_handle (arg: JSMarshalerArgument | JSMarshalerArguments, offset: JSMarshalerArgumentOffsets): GCHandle | JSHandle | undefined { + return isWasm64 ? getI64Big(add_offset(arg, offset)) as any : getI32(add_offset(arg, offset)) as any; +} + +export function get_arg_js_handle (arg: JSMarshalerArgument): JSHandle { + mono_assert(arg, "Null arg"); + return get_arg_handle(arg, JSMarshalerArgumentOffsets.JSHandle) as any; + //return getI32(add_offset(arg, JSMarshalerArgumentOffsets.JSHandle)) as any; +} +export function set_arg_proxy_context (arg: JSMarshalerArgument): void { + if (!WasmEnableThreads) return; + mono_assert(arg, "Null arg"); + set_arg_handle(arg, JSMarshalerArgumentOffsets.ContextHandle, runtimeHelpers.proxyGCHandle); +} + +export function set_js_handle (arg: JSMarshalerArgument, jsHandle: JSHandle): void { + mono_assert(arg, "Null arg"); + set_arg_handle(arg, JSMarshalerArgumentOffsets.JSHandle, jsHandle); + set_arg_proxy_context(arg); +} + +export function get_arg_gc_handle (arg: JSMarshalerArgument): GCHandle { + mono_assert(arg, "Null arg"); + return get_arg_handle(arg, JSMarshalerArgumentOffsets.GCHandle) as any; +} + +export function set_gc_handle (arg: JSMarshalerArgument, gcHandle: GCHandle): void { + mono_assert(arg, "Null arg"); + set_arg_handle(arg, JSMarshalerArgumentOffsets.GCHandle, gcHandle); + set_arg_proxy_context(arg); +} + +export function get_string_root (arg: JSMarshalerArgument): WasmRoot { + mono_assert(arg, "Null arg"); + return mono_wasm_new_external_root(arg); +} + +export function get_arg_length (arg: JSMarshalerArgument): number { + mono_assert(arg, "Null arg"); + return getI32(add_offset(arg, JSMarshalerArgumentOffsets.Length)) as any; +} + +export function set_arg_length (arg: JSMarshalerArgument, size: number): void { + mono_assert(arg, "Null arg"); + setI32(add_offset(arg, JSMarshalerArgumentOffsets.Length), size); +} + +export function set_root (arg: JSMarshalerArgument, root: WasmRoot): void { + mono_assert(arg, "Null arg"); + setU32(add_offset(arg, 0), root.get_address()); +} + +export interface IDisposable { + dispose(): void; + get isDisposed(): boolean; +} + +export class ManagedObject implements IDisposable { + dispose (): void { + teardown_managed_proxy(this, GCHandleNull); + } + + get isDisposed (): boolean { + return (this)[js_owned_gc_handle_symbol] === GCHandleNull; + } + + toString (): string { + return `CsObject(gc_handle: ${(this)[js_owned_gc_handle_symbol]})`; + } +} + +export class ManagedError extends Error implements IDisposable { + private superStack: any; + private managed_stack: any; + constructor (message: string) { + super(message); + this.superStack = Object.getOwnPropertyDescriptor(this, "stack"); // this works on Chrome + Object.defineProperty(this, "stack", { + get: this.getManageStack, + }); + } + + getSuperStack () { + if (this.superStack) { + if (this.superStack.value !== undefined) + return this.superStack.value; + if (this.superStack.get !== undefined) + return this.superStack.get.call(this); + } + return super.stack; // this works on FF + } + + getManageStack () { + if (this.managed_stack) { + return this.managed_stack; + } + if (!loaderHelpers.is_runtime_running()) { + this.managed_stack = "... omitted managed stack trace.\n" + this.getSuperStack(); + return this.managed_stack; + } + if (!WasmEnableThreads || runtimeHelpers.proxyGCHandle) { + const gc_handle = (this)[js_owned_gc_handle_symbol]; + if (gc_handle !== GCHandleNull) { + const managed_stack = get_managed_stack_trace(gc_handle); + if (managed_stack) { + this.managed_stack = managed_stack + "\n" + this.getSuperStack(); + return this.managed_stack; + } + } + } + return this.getSuperStack(); + } + + dispose (): void { + teardown_managed_proxy(this, GCHandleNull); + } + + get isDisposed (): boolean { + return (this)[js_owned_gc_handle_symbol] === GCHandleNull; + } +} + +export function get_signature_marshaler (signature: JSFunctionSignature, index: number): JSHandle { + mono_assert(signature, "Null signatures"); + const sig = get_sig(signature, index); + return getU32(sig + JSBindingHeaderOffsets.ImportHandle); +} + + +export function array_element_size (element_type: MarshalerType): number { + return element_type == MarshalerType.Byte ? 1 + : element_type == MarshalerType.Int32 ? 4 + : element_type == MarshalerType.Int52 ? 8 + : element_type == MarshalerType.Double ? 8 + : element_type == MarshalerType.String ? JavaScriptMarshalerArgSize + : element_type == MarshalerType.Object ? JavaScriptMarshalerArgSize + : element_type == MarshalerType.JSObject ? JavaScriptMarshalerArgSize + : -1; +} + +export const enum MemoryViewType { + Byte = 0, + Int32 = 1, + Double = 2, +} + +abstract class MemoryView implements IMemoryView { + protected constructor (public _pointer: VoidPtr, public _length: number, public _viewType: MemoryViewType) { + } + + abstract dispose(): void; + abstract get isDisposed(): boolean; + + _unsafe_create_view (): TypedArray { + // this view must be short lived so that it doesn't fail after wasm memory growth + // for that reason we also don't give the view out to end user and provide set/slice/copyTo API instead + + const view = this._viewType == MemoryViewType.Byte ? new Uint8Array(localHeapViewU8().buffer, normalizePointer(this._pointer), this._length) + : this._viewType == MemoryViewType.Int32 ? new Int32Array(localHeapViewI32().buffer, normalizePointer(this._pointer), this._length) + : this._viewType == MemoryViewType.Double ? new Float64Array(localHeapViewF64().buffer, normalizePointer(this._pointer), this._length) + : null; + if (!view) throw new Error("NotImplementedException"); + return view; + } + + set (source: TypedArray, targetOffset?: number): void { + mono_check(!this.isDisposed, "ObjectDisposedException"); + const targetView = this._unsafe_create_view(); + mono_check(source && targetView && source.constructor === targetView.constructor, () => `Expected ${targetView.constructor}`); + targetView.set(source, targetOffset); + // TODO consider memory write barrier + } + + copyTo (target: TypedArray, sourceOffset?: number): void { + mono_check(!this.isDisposed, "ObjectDisposedException"); + const sourceView = this._unsafe_create_view(); + mono_check(target && sourceView && target.constructor === sourceView.constructor, () => `Expected ${sourceView.constructor}`); + const trimmedSource = sourceView.subarray(sourceOffset); + // TODO consider memory read barrier + target.set(trimmedSource); + } + + slice (start?: number, end?: number): TypedArray { + mono_check(!this.isDisposed, "ObjectDisposedException"); + const sourceView = this._unsafe_create_view(); + // TODO consider memory read barrier + return sourceView.slice(start, end); + } + + get length (): number { + mono_check(!this.isDisposed, "ObjectDisposedException"); + return this._length; + } + + get byteLength (): number { + mono_check(!this.isDisposed, "ObjectDisposedException"); + return this._viewType == MemoryViewType.Byte ? this._length + : this._viewType == MemoryViewType.Int32 ? this._length << 2 + : this._viewType == MemoryViewType.Double ? this._length << 3 + : 0; + } +} + +export interface IMemoryView extends IDisposable { + /** + * copies elements from provided source to the wasm memory. + * target has to have the elements of the same type as the underlying C# array. + * same as TypedArray.set() + */ + set(source: TypedArray, targetOffset?: number): void; + /** + * copies elements from wasm memory to provided target. + * target has to have the elements of the same type as the underlying C# array. + */ + copyTo(target: TypedArray, sourceOffset?: number): void; + /** + * same as TypedArray.slice() + */ + slice(start?: number, end?: number): TypedArray; + + get length(): number; + get byteLength(): number; +} + +export class Span extends MemoryView { + private is_disposed = false; + public constructor (pointer: VoidPtr, length: number, viewType: MemoryViewType) { + super(pointer, length, viewType); + } + dispose (): void { + this.is_disposed = true; + } + get isDisposed (): boolean { + return this.is_disposed; + } +} + +export class ArraySegment extends MemoryView { + public constructor (pointer: VoidPtr, length: number, viewType: MemoryViewType) { + super(pointer, length, viewType); + } + + dispose (): void { + teardown_managed_proxy(this, GCHandleNull); + } + + get isDisposed (): boolean { + return (this)[js_owned_gc_handle_symbol] === GCHandleNull; + } +} diff --git a/src/mono/browser/runtime/runtime.c b/src/mono/browser/runtime/runtime.c index 6a1a6c166e65dc..b8009ba68452c7 100644 --- a/src/mono/browser/runtime/runtime.c +++ b/src/mono/browser/runtime/runtime.c @@ -289,7 +289,10 @@ wasm_dl_symbol (void *handle, const char *name, char **err, void *user_data) PinvokeImport key = { name, NULL }; PinvokeImport* result = (PinvokeImport *)bsearch(&key, index->imports, index->count, sizeof(PinvokeImport), import_compare_name); if (!result) { - // *err = g_strdup_printf ("Symbol not found: %s", name); + char buffer [512]; + sprintf (buffer, "Symbol not found: %s", name); + *err = strdup(buffer); + MH_LOGV(MH_LVL_INFO, "Symbol not found: %s", name); return NULL; } return result->func; diff --git a/src/mono/browser/runtime/strings.ts b/src/mono/browser/runtime/strings.ts index 502a9541b49a43..da5a870ce0d39b 100644 --- a/src/mono/browser/runtime/strings.ts +++ b/src/mono/browser/runtime/strings.ts @@ -10,6 +10,7 @@ import cwraps from "./cwraps"; import { isSharedArrayBuffer, localHeapViewU8, getU32_local, setU16_local, localHeapViewU32, getU16_local, localHeapViewU16, _zero_region, malloc, free } from "./memory"; import { NativePointer, CharPtr, VoidPtr } from "./types/emscripten"; import { safeBigIntToNumber } from "./invoke-js"; +import { mono_log_debug } from "./logging"; export const interned_js_string_table = new Map(); export const mono_wasm_empty_string = ""; @@ -61,9 +62,11 @@ export function stringToUTF8Ptr (str: string): CharPtr { export function utf8ToStringRelaxed (buffer: Uint8Array): string { if (_text_decoder_utf8_relaxed === undefined) { const retval = Module.UTF8ArrayToString(buffer, 0, buffer.byteLength); + mono_log_debug("utf8ToStringRelaxed: UTF8ArrayToString got " + retval); return retval; } const retval = _text_decoder_utf8_relaxed.decode(buffer); + mono_log_debug("utf8ToStringRelaxed: _text_decoder_utf8_relaxed.decode got " + retval); return retval; } @@ -90,14 +93,17 @@ export function utf8BufferToString (heapOrArray: Uint8Array, idx: number, maxByt while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr; if (endPtr - idx <= 16) { const retval = Module.UTF8ArrayToString(heapOrArray, idx, maxBytesToRead); + mono_log_debug("utf8BufferToString: Module.UTF8ArrayToStrin got " + retval); return retval; } if (_text_decoder_utf8_validating === undefined) { const retval = Module.UTF8ArrayToString(heapOrArray, idx, maxBytesToRead); + mono_log_debug("utf8BufferToString: Module.UTF8ArrayToString got " + retval); return retval; } const view = viewOrCopy(heapOrArray, idx as any, endPtr as any); const retval = _text_decoder_utf8_validating.decode(view); + mono_log_debug("utf8BufferToString: _text_decoder_utf8_validating.decode got " + retval); return retval; } @@ -184,6 +190,8 @@ export function stringToMonoStringRoot (string: string, result: WasmRoot(); +export const mono_wasm_empty_string = ""; +let mono_wasm_string_decoder_buffer: NativePointer | undefined; +export const interned_string_table = new Map(); +let _empty_string_ptr: MonoString = 0; +const _interned_string_full_root_buffers = []; +let _interned_string_current_root_buffer: WasmRootBuffer | null = null; +let _interned_string_current_root_buffer_count = 0; +let _text_decoder_utf16: TextDecoder | undefined | null; +let _text_decoder_utf8_relaxed: TextDecoder | undefined = undefined; +let _text_decoder_utf8_validating: TextDecoder | undefined = undefined; +let _text_encoder_utf8: TextEncoder | undefined = undefined; + +export function strings_init (): void { + if (!mono_wasm_string_decoder_buffer) { + if (typeof TextDecoder !== "undefined") { + _text_decoder_utf16 = new TextDecoder("utf-16le"); + _text_decoder_utf8_relaxed = new TextDecoder("utf-8", { fatal: false }); + _text_decoder_utf8_validating = new TextDecoder("utf-8"); + _text_encoder_utf8 = new TextEncoder(); + } + mono_wasm_string_decoder_buffer = malloc(12); + } + if (!mono_wasm_string_root) + mono_wasm_string_root = mono_wasm_new_root(); +} + +export function stringToUTF8 (str: string): Uint8Array { + if (_text_encoder_utf8 === undefined) { + const len = Module.lengthBytesUTF8(str); + const buffer = new Uint8Array(len); + Module.stringToUTF8Array(str, buffer, 0, len); + return buffer; + } + return _text_encoder_utf8.encode(str); +} + +export function stringToUTF8Ptr (str: string): CharPtr { + const size = Module.lengthBytesUTF8(str) + 1; + const ptr = malloc(size) as any; + const idx = typeof ptr === "bigint" ? safeBigIntToNumber(ptr) : ptr as number; + const buffer = localHeapViewU8().subarray(idx, idx + size); + Module.stringToUTF8Array(str, buffer, 0, size); + buffer[size - 1] = 0; + return ptr; +} + +export function utf8ToStringRelaxed (buffer: Uint8Array): string { + if (_text_decoder_utf8_relaxed === undefined) { + const retval = Module.UTF8ArrayToString(buffer, 0, buffer.byteLength); + return retval; + } + const retval = _text_decoder_utf8_relaxed.decode(buffer); + return retval; +} + +export function utf8ToString (ptr: CharPtr): string { + if (!ptr) { + return ""; + } + const heapU8 = localHeapViewU8(); + let idx: number; + if (typeof ptr === "bigint") { + idx = safeBigIntToNumber(ptr); + } else { + // @ts-expect-error TS2352 + idx = ptr as number; + } + if (idx === 0) + return ""; + return utf8BufferToString(heapU8, idx, heapU8.length - idx); +} + +export function utf8BufferToString (heapOrArray: Uint8Array, idx: number, maxBytesToRead: number): string { + const endIdx = idx + maxBytesToRead; + let endPtr = idx; + while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr; + if (endPtr - idx <= 16) { + const retval = Module.UTF8ArrayToString(heapOrArray, idx, maxBytesToRead); + return retval; + } + if (_text_decoder_utf8_validating === undefined) { + const retval = Module.UTF8ArrayToString(heapOrArray, idx, maxBytesToRead); + return retval; + } + const view = viewOrCopy(heapOrArray, idx as any, endPtr as any); + const retval = _text_decoder_utf8_validating.decode(view); + return retval; +} + +export function utf16ToString (startPtr: number, endPtr: number): string { + if (_text_decoder_utf16) { + const subArray = viewOrCopy(localHeapViewU8(), startPtr as any, endPtr as any); + return _text_decoder_utf16.decode(subArray); + } else { + return utf16ToStringLoop(startPtr, endPtr); + } +} + +export function utf16ToStringLoop (startPtr: number, endPtr: number): string { + let str = ""; + const heapU16 = localHeapViewU16(); + for (let i = startPtr; i < endPtr; i += 2) { + const char = getU16_local(heapU16, i); + str += String.fromCharCode(char); + } + return str; +} + +export function stringToUTF16 (dstPtr: number, endPtr: number, text: string) { + const heapI16 = localHeapViewU16(); + const len = text.length; + for (let i = 0; i < len; i++) { + setU16_local(heapI16, dstPtr, text.charCodeAt(i)); + dstPtr += 2; + if (dstPtr >= endPtr) break; + } +} + +export function stringToUTF16Ptr (str: string): VoidPtr { + const bytes = (str.length + 1) * 2; + const ptr = malloc(bytes) as any; + _zero_region(ptr, str.length * 2); + const ptrEnd = isWasm64 + ? BigInt(ptr) + BigInt(bytes) + : (ptr as unknown as number) + bytes; + stringToUTF16(ptr, ptrEnd as any, str); + return ptr; + +} + +export function monoStringToString (root: WasmRoot): string | null { + // TODO https://github.com/dotnet/runtime/issues/100411 + // after Blazor stops using monoStringToStringUnsafe + // mono_assert(!WasmEnableThreads, "Marshaling strings by reference is not supported in multithreaded mode"); + + if (root.value === MonoStringNull) + return null; + const ptrSize = isWasm64 ? 8 : 4; + const ppChars = mono_wasm_string_decoder_buffer + 0, + pLengthBytes = mono_wasm_string_decoder_buffer + ptrSize, + pIsInterned = mono_wasm_string_decoder_buffer + 2 * ptrSize; + + cwraps.mono_wasm_string_get_data_ref(root.address, ppChars, pLengthBytes, pIsInterned); + + let result = undefined; + const heapU32 = localHeapViewU32(); + const lengthBytes = getU32_local(heapU32, pLengthBytes), + pChars = getU32_local(heapU32, ppChars), + isInterned = getU32_local(heapU32, pIsInterned); + + if (isInterned) + result = interned_string_table.get(root.value)!; + + if (result === undefined) { + if (lengthBytes && pChars) { + result = utf16ToString(pChars, pChars + lengthBytes); + if (isInterned) + interned_string_table.set(root.value, result); + } else + result = mono_wasm_empty_string; + } + + if (result === undefined) + throw new Error(`internal error when decoding string at location ${root.value}`); + + return result; +} + +export function stringToMonoStringRoot (string: string, result: WasmRoot): void { + if (WasmEnableThreads) return; + result.clear(); + + if (string === null) + return; + else if (typeof (string) === "symbol") + stringToInternedMonoStringRoot(string, result); + else if (typeof (string) !== "string") + throw new Error("Expected string argument, got " + typeof (string)); + else if (string.length === 0) + // Always use an interned pointer for empty strings + stringToInternedMonoStringRoot(string, result); + else { + // Looking up large strings in the intern table will require the JS runtime to + // potentially hash them and then do full byte-by-byte comparisons, which is + // very expensive. Because we can not guarantee it won't happen, try to minimize + // the cost of this and prevent performance issues for large strings + if (string.length <= 256) { + const interned = interned_js_string_table.get(string); + if (interned) { + result.set(interned); + return; + } + } + + stringToMonoStringNewRoot(string, result); + } +} + +function stringToInternedMonoStringRoot (string: string | symbol, result: WasmRoot): void { + let text: string | undefined; + if (typeof (string) === "symbol") { + text = string.description; + if (typeof (text) !== "string") + text = Symbol.keyFor(string); + if (typeof (text) !== "string") + text = ""; + } else if (typeof (string) === "string") { + text = string; + } + + if (typeof (text) !== "string") { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + throw new Error(`Argument to stringToInternedMonoStringRoot must be a string but was ${string}`); + } + + if ((text.length === 0) && _empty_string_ptr) { + result.set(_empty_string_ptr); + return; + } + + const ptr = interned_js_string_table.get(text); + if (ptr) { + result.set(ptr); + return; + } + + stringToMonoStringNewRoot(text, result); + storeStringInInternTable(text, result, true); +} + +function storeStringInInternTable (string: string, root: WasmRoot, internIt: boolean): void { + if (!root.value) + throw new Error("null pointer passed to _store_string_in_intern_table"); + + const internBufferSize = 8192; + + if (_interned_string_current_root_buffer_count >= internBufferSize) { + _interned_string_full_root_buffers.push(_interned_string_current_root_buffer); + _interned_string_current_root_buffer = null; + } + if (!_interned_string_current_root_buffer) { + _interned_string_current_root_buffer = mono_wasm_new_root_buffer(internBufferSize, "interned strings"); + _interned_string_current_root_buffer_count = 0; + } + + const rootBuffer = _interned_string_current_root_buffer; + const index = _interned_string_current_root_buffer_count++; + + // Store the managed string into the managed intern table. This can theoretically + // provide a different managed object than the one we passed in, so update our + // pointer (stored in the root) with the result. + if (internIt) { + cwraps.mono_wasm_intern_string_ref(root.address); + if (!root.value) + throw new Error("mono_wasm_intern_string_ref produced a null pointer"); + } + + interned_js_string_table.set(string, root.value); + interned_string_table.set(root.value, string); + + if ((string.length === 0) && !_empty_string_ptr) + _empty_string_ptr = root.value; + + // Copy the final pointer into our interned string root buffer to ensure the string + // remains rooted. TODO: Is this actually necessary? + rootBuffer.copy_value_from_address(index, root.address); +} + +function stringToMonoStringNewRoot (string: string, result: WasmRoot): void { + const bufferLen = (string.length + 1) * 2; + // TODO this could be stack allocated for small strings + // or temp_malloc/alloca for large strings + // or skip the scratch buffer entirely, and make a new MonoString of size string.length, pin it, and then call stringToUTF16 to write directly into the MonoString's chars + const buffer = malloc(bufferLen); + _zero_region(buffer, bufferLen); + //FIXME: will need to use BigInt when emscripten returns BigInt from malloc + const bufferEnd = isWasm64 + ? buffer as any as number + bufferLen + : (buffer as any as number) + bufferLen; + stringToUTF16(buffer as any, bufferEnd as any, string); + // this function takes the length, not the end pointer + cwraps.mono_wasm_string_from_utf16_ref(buffer as any, string.length, result.address); + free(buffer); +} + +// When threading is enabled, TextDecoder does not accept a view of a +// SharedArrayBuffer, we must make a copy of the array first. +// See https://github.com/whatwg/encoding/issues/172 +export function viewOrCopy (view: Uint8Array, start: CharPtr, end: CharPtr): Uint8Array { + // this condition should be eliminated by rollup on non-threading builds + const needsCopy = isSharedArrayBuffer(view.buffer); + return needsCopy + ? view.slice(start, end) + : view.subarray(start, end); +} + +// below is minimal legacy support for Blazor +let mono_wasm_string_root: any; + +/* @deprecated not GC safe, use monoStringToString */ +export function monoStringToStringUnsafe (mono_string: MonoString): string | null { + if (mono_string === MonoStringNull) + return null; + + mono_wasm_string_root.value = mono_string; + const result = monoStringToString(mono_wasm_string_root); + mono_wasm_string_root.value = MonoStringNull; + return result; +} diff --git a/src/mono/mono/component/marshal-ilgen.c b/src/mono/mono/component/marshal-ilgen.c index 9a74df582f6afd..0eb199c2349503 100644 --- a/src/mono/mono/component/marshal-ilgen.c +++ b/src/mono/mono/component/marshal-ilgen.c @@ -443,6 +443,7 @@ emit_marshal_array_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, if (eklass == cb_to_mono->mono_defaults->string_class) { is_string = TRUE; gboolean need_free; + MH_LOGV(MH_LVL_VERBOSE, "MARSHAL_ACTION_MANAGED_CONV_IN"); conv = cb_to_mono->get_ptr_to_string_conv (m->piinfo, spec, &need_free); } else if (eklass == cb_to_mono->try_get_stringbuilder_class ()) { @@ -1722,6 +1723,7 @@ emit_marshal_string_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, break; case MARSHAL_ACTION_CONV_OUT: + MH_LOGV(MH_LVL_VERBOSE, "MARSHAL_ACTION_CONV_OUT"); conv = cb_to_mono->get_ptr_to_string_conv (m->piinfo, spec, &need_free); if (conv == MONO_MARSHAL_CONV_INVALID) { char *msg = g_strdup_printf ("string marshalling conversion %d not implemented", encoding); @@ -1730,7 +1732,7 @@ emit_marshal_string_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, } if (encoding == MONO_NATIVE_VBBYREFSTR) { - + MH_LOGV(MH_LVL_VERBOSE, "MONO_NATIVE_VBBYREFSTR"); if (!m_type_is_byref (t)) { char *msg = g_strdup ("VBByRefStr marshalling requires a ref parameter."); cb_to_mono->methodBuilder.emit_exception_marshal_directive (mb, msg); @@ -1756,6 +1758,7 @@ emit_marshal_string_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_emit_jit_icall (mb, mono_string_new_len_wrapper); cb_to_mono->methodBuilder.emit_byte (mb, CEE_STIND_REF); } else if (m_type_is_byref (t) && (t->attrs & PARAM_ATTRIBUTE_OUT || !(t->attrs & PARAM_ATTRIBUTE_IN))) { + MH_LOGV(MH_LVL_VERBOSE, "m_type_is_byref (t) && (t->attrs & PARAM_ATTRIBUTE_OUT || !(t->attrs & PARAM_ATTRIBUTE_IN))"); int stind_op; cb_to_mono->methodBuilder.emit_ldarg (mb, argnum); cb_to_mono->methodBuilder.emit_ldloc (mb, conv_arg); @@ -1763,6 +1766,10 @@ emit_marshal_string_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, cb_to_mono->methodBuilder.emit_byte (mb, GINT_TO_UINT8 (stind_op)); need_free = TRUE; } + else + { + MH_LOGV(MH_LVL_VERBOSE, "Met no conditions. Need_free = %s", need_free ? "true" : "false"); + } if (need_free) { cb_to_mono->methodBuilder.emit_ldloc (mb, conv_arg); @@ -1779,7 +1786,7 @@ emit_marshal_string_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, case MARSHAL_ACTION_CONV_RESULT: cb_to_mono->methodBuilder.emit_stloc (mb, 0); - + MH_LOGV(MH_LVL_VERBOSE, "MARSHAL_ACTION_CONV_RESULT"); conv = cb_to_mono->get_ptr_to_string_conv (m->piinfo, spec, &need_free); if (conv == MONO_MARSHAL_CONV_INVALID) { char *msg = g_strdup_printf ("string marshalling conversion %d not implemented", encoding); @@ -1805,7 +1812,7 @@ emit_marshal_string_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, if (t->attrs & PARAM_ATTRIBUTE_OUT) break; } - + MH_LOGV(MH_LVL_VERBOSE, "MARSHAL_ACTION_MANAGED_CONV_IN"); conv = cb_to_mono->get_ptr_to_string_conv (m->piinfo, spec, &need_free); if (conv == MONO_MARSHAL_CONV_INVALID) { char *msg = g_strdup_printf ("string marshalling conversion %d not implemented", encoding); diff --git a/src/mono/mono/metadata/marshal-shared.c b/src/mono/mono/metadata/marshal-shared.c index 7a6beef71a7406..62f7678b8301bd 100644 --- a/src/mono/mono/metadata/marshal-shared.c +++ b/src/mono/mono/metadata/marshal-shared.c @@ -135,6 +135,7 @@ mono_marshal_shared_is_out (const MonoType *t) MonoMarshalConv mono_marshal_shared_conv_str_inverse (MonoMarshalConv conv) { + MH_LOGV(MH_LVL_VERBOSE, "Handling inverse conversion with code: %d", conv); switch (conv) { // AnsiBStr case MONO_MARSHAL_CONV_STR_ANSIBSTR: @@ -152,6 +153,7 @@ mono_marshal_shared_conv_str_inverse (MonoMarshalConv conv) case MONO_MARSHAL_CONV_STR_LPSTR: return MONO_MARSHAL_CONV_LPSTR_STR; case MONO_MARSHAL_CONV_LPSTR_STR: + MH_LOGV(MH_LVL_VERBOSE, "returning MONO_MARSHAL_CONV_STR_LPSTR"); return MONO_MARSHAL_CONV_STR_LPSTR; // LPTStr @@ -367,6 +369,7 @@ mono_marshal_shared_conv_to_icall (MonoMarshalConv conv, int *ind_store_type) // of the wrapper logic. In particular, to produce // volatile stack-based handles. Being data-driven, // from icall-def.h. + MH_LOGV(MH_LVL_VERBOSE, "Got here with conv %d", conv); int dummy; if (!ind_store_type) @@ -393,6 +396,7 @@ mono_marshal_shared_conv_to_icall (MonoMarshalConv conv, int *ind_store_type) return MONO_JIT_ICALL_mono_string_to_utf8str; case MONO_MARSHAL_CONV_LPSTR_STR: *ind_store_type = CEE_STIND_REF; + MH_LOGV(MH_LVL_VERBOSE, "returning MONO_MARSHAL_CONV_STR_LPSTR"); return MONO_JIT_ICALL_ves_icall_string_new_wrapper; case MONO_MARSHAL_CONV_SB_LPSTR: return MONO_JIT_ICALL_mono_string_builder_to_utf8; @@ -477,6 +481,7 @@ mono_marshal_shared_conv_to_icall (MonoMarshalConv conv, int *ind_store_type) void mono_marshal_shared_emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv conv, MonoMarshalSpec *mspec) { + MH_LOGV(MH_LVL_VERBOSE, "Handling conversion with code: %d", conv); switch (conv) { case MONO_MARSHAL_CONV_BOOL_I4: mono_mb_emit_ldloc (mb, 1); @@ -732,7 +737,7 @@ mono_marshal_shared_emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *ty case MONO_MARSHAL_CONV_ARRAY_SAVEARRAY: default: { char *msg = g_strdup_printf ("marshaling conversion %d not implemented", conv); - + MH_LOGV(MH_LVL_INFO, "NOT IMPLEMENTED: %s", msg); mono_marshal_shared_mb_emit_exception_marshal_directive (mb, msg); break; } diff --git a/src/mono/mono/metadata/marshal.c b/src/mono/mono/metadata/marshal.c index 31e7367879570f..f14cc5a61022a1 100644 --- a/src/mono/mono/metadata/marshal.c +++ b/src/mono/mono/metadata/marshal.c @@ -277,6 +277,7 @@ ves_icall_mono_string_to_utf8_impl (MonoStringHandle str, MonoError *error) MonoStringHandle ves_icall_string_new_wrapper_impl (const char *text, MonoError *error) { + MH_LOGV(MH_LVL_VERBOSE, "string_new_wrapper(\"%s\")", text ? text : "(null)"); return text ? mono_string_new_handle (text, error) : NULL_HANDLE_STRING; } @@ -1065,6 +1066,7 @@ mono_string_to_utf8str_impl (MonoStringHandle s, MonoError *error) char * mono_string_to_ansibstr_impl (MonoStringHandle string_obj, MonoError *error) { + MH_LOGV(MH_LVL_VERBOSE, "Got string handle %p", MONO_HANDLE_RAW (string_obj)); if (MONO_HANDLE_IS_NULL (string_obj)) return NULL; @@ -1133,7 +1135,7 @@ mono_string_to_byvalstr_impl (char *dst, MonoStringHandle src, int size, MonoErr { g_assert (dst != NULL); g_assert (size > 0); - + MH_LOGV(MH_LVL_VERBOSE, "Got string handle %p, size %d", MONO_HANDLE_RAW (src), size); memset (dst, 0, size); if (!MONO_HANDLE_BOOL (src)) return; @@ -1536,7 +1538,7 @@ MonoMarshalConv mono_marshal_get_ptr_to_string_conv (MonoMethodPInvoke *piinfo, MonoMarshalSpec *spec, gboolean *need_free) { MonoMarshalNative encoding = mono_marshal_get_string_encoding (piinfo, spec); - + MH_LOGV(MH_LVL_VERBOSE, "Got string encoding %d\n", encoding); *need_free = TRUE; switch (encoding) { @@ -1547,6 +1549,7 @@ mono_marshal_get_ptr_to_string_conv (MonoMethodPInvoke *piinfo, MonoMarshalSpec return MONO_MARSHAL_CONV_UTF8STR_STR; case MONO_NATIVE_LPSTR: case MONO_NATIVE_VBBYREFSTR: + MH_LOGV(MH_LVL_VERBOSE, "returning MONO_MARSHAL_CONV_LPSTR_STR"); return MONO_MARSHAL_CONV_LPSTR_STR; case MONO_NATIVE_LPTSTR: #ifdef TARGET_WIN32 diff --git a/src/mono/mono/metadata/object-internals.h b/src/mono/mono/metadata/object-internals.h index e464c87b9e3b72..e5dd861b721cfc 100644 --- a/src/mono/mono/metadata/object-internals.h +++ b/src/mono/mono/metadata/object-internals.h @@ -26,6 +26,7 @@ #include "mono/utils/mono-tls.h" #include "mono/utils/mono-coop-mutex.h" #include +#include /* Use this as MONO_CHECK_ARG (arg,expr,) in functions returning void */ #define MONO_CHECK_ARG(arg, expr, retval) do { \ @@ -1972,6 +1973,7 @@ static inline gunichar2* mono_string_chars_internal (MonoString *s) { MONO_REQ_GC_UNSAFE_MODE; + MH_LOGV(MH_LVL_VERBOSE, "mono_string_chars_internal: s=%p\n", s); return s->chars; } diff --git a/src/mono/mono/metadata/object.c b/src/mono/mono/metadata/object.c index 9f9a300775da1a..fb7e8f1a93fc0d 100644 --- a/src/mono/mono/metadata/object.c +++ b/src/mono/mono/metadata/object.c @@ -7099,6 +7099,7 @@ mono_ldstr_checked (MonoImage *image, guint32 idx, MonoError *error) MonoStringHandle mono_ldstr_handle (MonoImage *image, guint32 idx, MonoError *error) { + MH_LOGV(MH_LVL_VERBOSE, "Got here"); // FIXME invert mono_ldstr_handle and mono_ldstr_checked. return MONO_HANDLE_NEW (MonoString, mono_ldstr_checked (image, idx, error)); } @@ -7164,6 +7165,7 @@ mono_ldstr_metadata_sig (const char* sig, MonoStringHandleOut string_handle, Mon char* mono_ldstr_utf8 (MonoImage *image, guint32 idx, MonoError *error) { + MH_LOGV(MH_LVL_VERBOSE, "Got here"); const char *str; size_t len2; long written = 0; @@ -7205,6 +7207,7 @@ mono_ldstr_utf8 (MonoImage *image, guint32 idx, MonoError *error) char * mono_string_to_utf8 (MonoString *s) { + MH_LOGV(MH_LVL_VERBOSE, "Got here"); char *result; MONO_ENTER_GC_UNSAFE; ERROR_DECL (error); @@ -7224,6 +7227,7 @@ mono_string_to_utf8 (MonoString *s) char * mono_utf16_to_utf8len (const gunichar2 *s, gsize slength, gsize *utf8_length, MonoError *error) { + MH_LOGV(MH_LVL_VERBOSE, "Got here"); MONO_REQ_GC_UNSAFE_MODE; long written = 0; @@ -7238,7 +7242,7 @@ mono_utf16_to_utf8len (const gunichar2 *s, gsize slength, gsize *utf8_length, Mo if (!slength) return g_strdup (""); - + MH_LOGV(MH_LVL_VERBOSE, "Got string pointer %p", s); as = g_utf16_to_utf8 (s, (glong)slength, NULL, &written, &gerror); *utf8_length = written; if (gerror) { @@ -7268,6 +7272,7 @@ mono_utf16_to_utf8len (const gunichar2 *s, gsize slength, gsize *utf8_length, Mo char * mono_utf16_to_utf8 (const gunichar2 *s, gsize slength, MonoError *error) { + MH_LOGV(MH_LVL_VERBOSE, "Got here"); gsize utf8_length = 0; return mono_utf16_to_utf8len (s, slength, &utf8_length, error); } @@ -7276,7 +7281,7 @@ char * mono_string_to_utf8_checked_internal (MonoString *s, MonoError *error) { MONO_REQ_GC_UNSAFE_MODE; - + MH_LOGV(MH_LVL_VERBOSE, "Got here"); error_init (error); if (s == NULL) @@ -7284,7 +7289,7 @@ mono_string_to_utf8_checked_internal (MonoString *s, MonoError *error) if (!s->length) return g_strdup (""); - + MH_LOGV(MH_LVL_VERBOSE, "Got string pointer %p, length %d", s, s->length); return mono_utf16_to_utf8 (mono_string_chars_internal (s), s->length, error); } @@ -7292,6 +7297,7 @@ char * mono_string_to_utf8len (MonoStringHandle s, gsize *utf8len, MonoError *error) { *utf8len = 0; + MH_LOGV(MH_LVL_VERBOSE, "Got string handle %p", MONO_HANDLE_RAW (s)); if (MONO_HANDLE_IS_NULL (s)) return NULL; @@ -7323,6 +7329,7 @@ mono_string_to_utf8_checked (MonoString *string_obj, MonoError *error) char * mono_string_handle_to_utf8 (MonoStringHandle s, MonoError *error) { + MH_LOGV(MH_LVL_VERBOSE, "Got string handle %p", MONO_HANDLE_RAW (s)); return mono_string_to_utf8_checked_internal (MONO_HANDLE_RAW (s), error); } diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index 92ab9c15bd4bdf..2f4161f3ce2418 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -281,6 +281,7 @@ do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval MH_LOG("Got signature cookie %s", sigTest); if (!sigTest) { + // can't do this. need to handle no sig memset(&ret_sp->data, 0, sizeof(stackval)); } else diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index 2f72536af1970e..e86e92c8abc58b 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -366,7 +366,8 @@ int mono_interp_traceopt = 0; #else #define MINT_IN_SWITCH(op) COUNT_OP(op); switch (opcode = (MintOpcode)(op)) -#define MINT_IN_CASE(x) case x: +//#define MINT_IN_CASE(x) case x: +#define MINT_IN_CASE(x) case x: if (mh_log_get_verbosity() >= MH_LVL_CRIPPLE) { printf("MH_LOG_MINT: %s\n", #x); fflush(stdout); } #define MINT_IN_BREAK break #endif @@ -4961,9 +4962,9 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; MONO_DISABLE_WARNING(4127) \ gpointer ptr = LOCAL_VAR (ip [2], gpointer); \ NULL_CHECK (ptr); \ - if (unaligned && ((gsize)ptr % SIZEOF_VOID_P)) {\ + if (unaligned && ((gsize)ptr % SIZEOF_VOID_P)) {\ memcpy (locals + ip [1], ptr, sizeof (datatype)); \ - } else {\ + } else {\ LOCAL_VAR (ip [1], datatype) = *(casttype*)ptr; \ } \ ip += 3; \ @@ -6441,6 +6442,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; } MINT_IN_CASE(MINT_GETCHR) { MonoString *s = LOCAL_VAR (ip [2], MonoString*); + MH_LOGV(MH_LVL_VERBOSE, "MINT_GETCHR, %p", s); NULL_CHECK (s); int i32 = LOCAL_VAR (ip [3], int); if (i32 < 0 || i32 >= mono_string_length_internal (s)) @@ -7112,7 +7114,11 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; MINT_IN_BREAK; } MINT_IN_CASE(MINT_LDPTR) - LOCAL_VAR (ip [1], gpointer) = frame->imethod->data_items [ip [2]]; + (*(gpointer*)(locals + (ip[1]))) = frame->imethod->data_items [ip [2]]; + { + intptr_t result = (*(guint64*)(locals + (ip[1]))); + MH_LOG("MINT_LDPTR: *(%p + %d) = frame->imethod->data_items [ip [%d]]: %p", locals, ip[1], ip[2], (void*)result); + } ip += 3; MINT_IN_BREAK; MINT_IN_CASE(MINT_MONO_NEWOBJ) @@ -7608,11 +7614,13 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; MINT_IN_BREAK; MINT_IN_CASE(MINT_MOV_8) // TODO: this is hardcoded for x64 - //assert(((uintptr_t)locals % 8) == 0 && "locals is not 8-byte aligned"); + assert(((uintptr_t)locals % 8) == 0 && "locals is not 8-byte aligned"); (*(guint64*)(locals + (ip[1]))) = (*(guint64*)(locals + (ip[2]))); - intptr_t result = (*(guint64*)(locals + (ip[1]))); - //MH_LOG("MINT_MOV_8: *(%p + %d) = *(%p + %d): %p", locals, ip[1], locals, ip[2], (void*)result); + { + intptr_t result = (*(guint64*)(locals + (ip[1]))); + MH_LOG("MINT_MOV_8: *(%p + %d) = *(%p + %d): %p", locals, ip[1], locals, ip[2], (void*)result); + } ip += 3;; MINT_IN_BREAK; diff --git a/src/mono/sample/wasm/browser-test-debug/JavaScriptTestHelper.cs b/src/mono/sample/wasm/browser-test-debug/JavaScriptTestHelper.cs index 307523270a4027..60dcf849114c69 100644 --- a/src/mono/sample/wasm/browser-test-debug/JavaScriptTestHelper.cs +++ b/src/mono/sample/wasm/browser-test-debug/JavaScriptTestHelper.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; using System.Xml.Serialization; -[assembly: DisableRuntimeMarshalling] +//[assembly: DisableRuntimeMarshalling] namespace System.Runtime.InteropServices.JavaScript.Tests { diff --git a/src/mono/sample/wasm/browser-test-debug/Program.cs b/src/mono/sample/wasm/browser-test-debug/Program.cs index 4ad0bd4e787644..3b1bec4a804c3b 100644 --- a/src/mono/sample/wasm/browser-test-debug/Program.cs +++ b/src/mono/sample/wasm/browser-test-debug/Program.cs @@ -402,9 +402,19 @@ public static void ZeroFreeGlobalAllocAnsi_ValidPointer_Success() [JSExport] public static async Task DoTestMethod() { - await JavaScriptTestHelper.InitializeAsync(); - const bool doCollect = true; - if (doCollect) GC.Collect(); + //await JavaScriptTestHelper.InitializeAsync(); + //const bool doCollect = true; + string myTestString = "Hello from .NET"; + unsafe + { + fixed (char* p = myTestString) + { + Console.WriteLine($"Address of x: 0x{(ulong)p:X}"); + StringTests.PrintMyStringFromCSharp(myTestString); + } + } + + //if (doCollect) GC.Collect(); //ZeroFreeGlobalAllocAnsi_Zero_Nop(); //if (doCollect) GC.Collect(); @@ -413,8 +423,8 @@ public static async Task DoTestMethod() //System.SpanTests.TryWriteTests.AppendFormatted_ReferenceTypes_ICustomFormatter(); //if (doCollect) GC.Collect(); - System.SpanTests.TryWriteTests.AppendFormatted_ValueTypes_CreateProviderFlowed(); - if (doCollect) GC.Collect(); + //System.SpanTests.TryWriteTests.AppendFormatted_ValueTypes_CreateProviderFlowed(); + //if (doCollect) GC.Collect(); //GCHandleTests.Ctor_Default(); diff --git a/src/mono/sample/wasm/browser-test-debug/StringTests.cs b/src/mono/sample/wasm/browser-test-debug/StringTests.cs new file mode 100644 index 00000000000000..421578dd40b959 --- /dev/null +++ b/src/mono/sample/wasm/browser-test-debug/StringTests.cs @@ -0,0 +1,11 @@ +using System.Runtime.InteropServices; + +namespace Sample +{ + public class StringTests + { + [DllImport("wasmString", EntryPoint = "printString")] + [DefaultDllImportSearchPaths(DllImportSearchPath.AssemblyDirectory)] + public static extern void PrintMyStringFromCSharp([MarshalAs(UnmanagedType.LPStr)] string _filePath); + } +} diff --git a/src/mono/sample/wasm/browser-test-debug/Wasm.Test.Debug.Sample.csproj b/src/mono/sample/wasm/browser-test-debug/Wasm.Test.Debug.Sample.csproj index 4e97152de3a9df..121e4357ca50f7 100644 --- a/src/mono/sample/wasm/browser-test-debug/Wasm.Test.Debug.Sample.csproj +++ b/src/mono/sample/wasm/browser-test-debug/Wasm.Test.Debug.Sample.csproj @@ -41,9 +41,11 @@ + - + + diff --git a/src/mono/sample/wasm/browser-test-debug/main.js b/src/mono/sample/wasm/browser-test-debug/main.js index 80430f186f9f7e..9ae9a0864c7573 100644 --- a/src/mono/sample/wasm/browser-test-debug/main.js +++ b/src/mono/sample/wasm/browser-test-debug/main.js @@ -6,6 +6,12 @@ import { dotnet, exit } from './dotnet.js' let testAbort = true; let testError = true; let Module; + +function setLogLevel(logLevel) { + + const runtimeApi = globalThis.getDotnetRuntime(0); + runtimeApi.INTERNAL.MH_SetLogVerbosity(logLevel); +} function printGcLog(Module) { try { // List all files in the root directory @@ -49,7 +55,7 @@ try { config.environmentVariables["MONO_LOG_MASK"] = "gc"; config.environmentVariables["MONO_GC_DEBUG"] = "8:gc_log.txt,print-gchandles,clear-nursery-at-gc"; // 1 or lower = None, 2 = info, 3 = debug, 4 = verbose, 5 = trace - config.environmentVariables["MH_LOG_VERBOSITY"] = "3"; + config.environmentVariables["MH_LOG_VERBOSITY"] = "1"; }, preInit: () => { console.log('user code Module.preInit'); }, preRun: () => { console.log('user code Module.preRun'); }, @@ -85,16 +91,18 @@ try { const exports = await getAssemblyExports(config.mainAssemblyName); document.getElementById("out").innerHTML = `NOT PASSED`; - + + setLogLevel(5); await exports.Sample.Test.DoTestMethod(); + setLogLevel(0); document.getElementById("out").innerHTML = `PASSED`; console.log('user code Module.onRuntimeInitialized'); - printGcLog(Module); + //printGcLog(Module); exit(exit_code); } catch (err) { - printGcLog(Module); + //printGcLog(Module); exit(2, err); } diff --git a/src/mono/sample/wasm/browser-test-debug/wasmString.c b/src/mono/sample/wasm/browser-test-debug/wasmString.c new file mode 100644 index 00000000000000..54859de22afd8e --- /dev/null +++ b/src/mono/sample/wasm/browser-test-debug/wasmString.c @@ -0,0 +1,8 @@ +#include "wasmString.h" +#include + +void printString(char* someString) +{ + printf("C file got string: 0x%p: %s\n", someString, someString); + fflush(stdout); +} diff --git a/src/mono/sample/wasm/browser-test-debug/wasmString.h b/src/mono/sample/wasm/browser-test-debug/wasmString.h new file mode 100644 index 00000000000000..bc791b4bc5bbc4 --- /dev/null +++ b/src/mono/sample/wasm/browser-test-debug/wasmString.h @@ -0,0 +1,15 @@ +#pragma once + +#ifdef STRING_DLL +# define API __declspec(dllexport) +#else +# define API +#endif + +#ifdef __cplusplus +extern "C" { +#endif + API void printString(char* someString); +#ifdef __cplusplus +} +#endif diff --git a/src/native/libs/System.Native/CMakeLists.txt b/src/native/libs/System.Native/CMakeLists.txt index f7fde288243659..68015f0ca66620 100644 --- a/src/native/libs/System.Native/CMakeLists.txt +++ b/src/native/libs/System.Native/CMakeLists.txt @@ -21,6 +21,7 @@ set(NATIVE_SOURCES pal_sysctl.c ) + if (NOT CLR_CMAKE_TARGET_WASI) list (APPEND NATIVE_SOURCES pal_dynamicload.c @@ -130,6 +131,11 @@ if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TA set(NATIVE_SOURCES ${NATIVE_SOURCES} entrypoints.c) endif() +# Force all .c files to be compiled as C, not C++ +foreach(source_file ${NATIVE_SOURCES}) + set_source_files_properties(${source_file} PROPERTIES LANGUAGE C) +endforeach() + if (CMAKE_USE_MEMORY64) message("MRH_LOGGING: Building native libs with MEMORY64 enabled") add_compile_options(--target=wasm64) diff --git a/src/native/public/mono/metadata/mh_log.h b/src/native/public/mono/metadata/mh_log.h index b178616b0e0cc3..ecb69065275339 100644 --- a/src/native/public/mono/metadata/mh_log.h +++ b/src/native/public/mono/metadata/mh_log.h @@ -7,6 +7,7 @@ #include #endif +#define MH_LVL_CRIPPLE 6 #define MH_LVL_TRACE 5 #define MH_LVL_VERBOSE 4 #define MH_LVL_DEBUG 3 From 932d210b03540f59b3c87cc69cbfe99390686c80 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 8 Sep 2025 18:39:21 +0100 Subject: [PATCH 165/209] Replace expansion of MINT_ICALLSIG to cookies with signature encoding Previously was "encoding" into a cookie but in do_icall, which relied on having a non-null MonoMethodSignature, which is not always the case. Instead we expand MintIcallSig with all permutations of arg types (generated from an external app) and encode directly to the enum from the MonoMethodSignature (via interp_get_icall_sig) . A decode method provided isn't required here but might be useful for testing methods. --- src/mono/mono/metadata/class.c | 4 +- src/mono/mono/metadata/object-internals.h | 2 +- src/mono/mono/mini/interp/interp-icalls.c | 4290 +++++++++++---------- src/mono/mono/mini/interp/interp-icalls.h | 3 +- src/mono/mono/mini/interp/interp.c | 4 +- src/mono/mono/mini/interp/mintSigs.h | 393 ++ src/mono/mono/mini/interp/mintops.h | 19 +- src/mono/mono/mini/interp/transform.c | 199 +- 8 files changed, 2804 insertions(+), 2110 deletions(-) create mode 100644 src/mono/mono/mini/interp/mintSigs.h diff --git a/src/mono/mono/metadata/class.c b/src/mono/mono/metadata/class.c index 1365adba141f84..bb1ee8d8e86a08 100644 --- a/src/mono/mono/metadata/class.c +++ b/src/mono/mono/metadata/class.c @@ -4799,7 +4799,7 @@ mono_class_array_element_size (MonoClass *klass) case MONO_TYPE_I4: case MONO_TYPE_U4: case MONO_TYPE_R4: - MH_LOG("Got element size 4 for MONO_TYPE_I4/U4/R4."); + MH_LOGV(MH_LVL_CRIPPLE, "Got element size 4 for MONO_TYPE_I4/U4/R4."); return 4; case MONO_TYPE_I: case MONO_TYPE_U: @@ -4810,7 +4810,7 @@ mono_class_array_element_size (MonoClass *klass) case MONO_TYPE_OBJECT: case MONO_TYPE_SZARRAY: case MONO_TYPE_ARRAY: - MH_LOG("Got element TARGET_SIZEOF_VOID_P for MONO_TYPE_I/U/etc. size is %d", TARGET_SIZEOF_VOID_P); + MH_LOGV(MH_LVL_CRIPPLE, "Got element TARGET_SIZEOF_VOID_P for MONO_TYPE_I/U/etc. size is %d", TARGET_SIZEOF_VOID_P); return TARGET_SIZEOF_VOID_P; case MONO_TYPE_I8: case MONO_TYPE_U8: diff --git a/src/mono/mono/metadata/object-internals.h b/src/mono/mono/metadata/object-internals.h index e5dd861b721cfc..25c0f63d641fa5 100644 --- a/src/mono/mono/metadata/object-internals.h +++ b/src/mono/mono/metadata/object-internals.h @@ -1973,7 +1973,7 @@ static inline gunichar2* mono_string_chars_internal (MonoString *s) { MONO_REQ_GC_UNSAFE_MODE; - MH_LOGV(MH_LVL_VERBOSE, "mono_string_chars_internal: s=%p\n", s); + MH_LOGV(MH_LVL_CRIPPLE, "mono_string_chars_internal: s=%p\n", s); return s->chars; } diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index 2f4161f3ce2418..6200cb3154256f 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -7,7 +7,7 @@ typedef gpointer I8; gboolean is_scalar_vtype(MonoType* tp); -static gboolean +gboolean interp_type_as_ptr4 (MonoType *tp) { if(sizeof(gpointer) == 4) @@ -30,7 +30,7 @@ interp_type_as_ptr4 (MonoType *tp) return FALSE; } -static gboolean +gboolean interp_type_as_ptr8 (MonoType *tp) { if(sizeof(gpointer) != 8) @@ -219,2023 +219,2323 @@ static char * log_sig(MonoMethodSignature* sig) } static void log_op(MintICallSig op) { - switch(op) { - case MINT_ICALLSIG_V_V: - MH_LOG("MINT_ICALLSIG_V_V"); + MH_LOGV(MH_LVL_TRACE, "MintIcallSig logging not implemented\n"); +} +void +do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval *sp, gpointer ptr, gboolean save_last_error) +{ + MH_LOG_INDENT(); + MH_LOG("Sig: %p op: %d ret_sp: %p sp: %p ptr: %p, save_last: %s", (void*)sig, op, (void*)ret_sp, (void*)sp, (void*)ptr, save_last_error ? "T" : "F"); + + if (save_last_error) + mono_marshal_clear_last_error(); + MH_LOG("About to execute function, sig enum value is : %d", op); + switch (op) { + case MINT_ICALLSIG_V_V: { + typedef void (*T)(void); + T func = (T)ptr; + func(); break; - case MINT_ICALLSIG_V_P: - MH_LOG("MINT_ICALLSIG_V_P"); + } + case MINT_ICALLSIG_V_4: { + typedef I4(*T)(void); + T func = (T)ptr; + ret_sp->data.i = func(); break; - case MINT_ICALLSIG_P_V: - MH_LOG("MINT_ICALLSIG_P_V"); + } + case MINT_ICALLSIG_V_8: { + typedef I8(*T)(void); + T func = (T)ptr; + ret_sp->data.p = func(); break; - case MINT_ICALLSIG_P_P: - MH_LOG("MINT_ICALLSIG_P_P"); + } + case MINT_ICALLSIG_4_V: { + typedef void (*T)(I4); + T func = (T)ptr; + func(sp[0].data.i); break; - case MINT_ICALLSIG_PP_V: - MH_LOG("MINT_ICALLSIG_PP_V"); + } + case MINT_ICALLSIG_8_V: { + typedef void (*T)(I8); + T func = (T)ptr; + func(sp[0].data.p); break; - case MINT_ICALLSIG_PP_P: - MH_LOG("MINT_ICALLSIG_PP_P"); + } + case MINT_ICALLSIG_4_4: { + typedef I4(*T)(I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i); break; - case MINT_ICALLSIG_PPP_V: - MH_LOG("MINT_ICALLSIG_PPP_V"); + } + case MINT_ICALLSIG_8_4: { + typedef I4(*T)(I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p); break; - case MINT_ICALLSIG_PPP_P: - MH_LOG("MINT_ICALLSIG_PPP_P"); + } + case MINT_ICALLSIG_4_8: { + typedef I8(*T)(I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i); break; - case MINT_ICALLSIG_PPPP_V: - MH_LOG("MINT_ICALLSIG_PPPP_V"); + } + case MINT_ICALLSIG_8_8: { + typedef I8(*T)(I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p); break; - case MINT_ICALLSIG_PPPP_P: - MH_LOG("MINT_ICALLSIG_PPPP_P"); + } + case MINT_ICALLSIG_44_V: { + typedef void (*T)(I4, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i); break; - case MINT_ICALLSIG_PPPPP_V: - MH_LOG("MINT_ICALLSIG_PPPPP_V"); + } + case MINT_ICALLSIG_48_V: { + typedef void (*T)(I4, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p); break; - case MINT_ICALLSIG_PPPPP_P: - MH_LOG("MINT_ICALLSIG_PPPPP_P"); + } + case MINT_ICALLSIG_84_V: { + typedef void (*T)(I8, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i); break; - case MINT_ICALLSIG_PPPPPP_V: - MH_LOG("MINT_ICALLSIG_PPPPPP_V"); + } + case MINT_ICALLSIG_88_V: { + typedef void (*T)(I8, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p); break; - case MINT_ICALLSIG_PPPPPP_P: - MH_LOG("MINT_ICALLSIG_PPPPPP_P"); + } + case MINT_ICALLSIG_44_4: { + typedef I4(*T)(I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i); break; - default: - MH_LOG("Unknown MintICallSig: %d", op); + } + case MINT_ICALLSIG_48_4: { + typedef I4(*T)(I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p); break; } -} -void -do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval *sp, gpointer ptr, gboolean save_last_error) -{ - MH_LOG_INDENT(); - MH_LOG("Sig: %p op: %d ret_sp: %p sp: %p ptr: %p, save_last: %s", (void*)sig, op, (void*)ret_sp, (void*)sp, (void*)ptr, save_last_error ? "T" : "F"); - - if (save_last_error) - mono_marshal_clear_last_error (); - log_op(op); - // FIXME: this string/cookie comparison is rubbish - use an enum - char* sigTest = log_sig(sig); // currently must be called to get the cookie! - MH_LOG("Got signature cookie %s", sigTest); - if (!sigTest) - { - // can't do this. need to handle no sig - memset(&ret_sp->data, 0, sizeof(stackval)); + case MINT_ICALLSIG_84_4: { + typedef I4(*T)(I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i); + break; } - else - { - switch (op) { - case MINT_ICALLSIG_V_V: - case MINT_ICALLSIG_V_P: { - if (!strcmp(sigTest,"V_V")) { - typedef void (*T)(void); - T func = (T)ptr; - func(); - }; - if (!strcmp(sigTest,"V_4")) { - typedef I4 (*T)(void); - T func = (T)ptr; - ret_sp->data.i = func(); - }; - if (!strcmp(sigTest,"V_8")) { - typedef I8 (*T)(void); - T func = (T)ptr; - ret_sp->data.p = func(); - }; + case MINT_ICALLSIG_88_4: { + typedef I4(*T)(I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p); break; - } - case MINT_ICALLSIG_P_V: - case MINT_ICALLSIG_P_P: { - if (!strcmp(sigTest,"4_V")) { - typedef void (*T)(I4); - T func = (T)ptr; - func(sp[0].data.i); - }; - if (!strcmp(sigTest,"8_V")) { - typedef void (*T)(I8); - T func = (T)ptr; - func(sp[0].data.p); - }; - if (!strcmp(sigTest,"4_4")) { - typedef I4 (*T)(I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i); - }; - if (!strcmp(sigTest,"8_4")) { - typedef I4 (*T)(I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p); - }; - if (!strcmp(sigTest,"4_8")) { - typedef I8 (*T)(I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i); - }; - if (!strcmp(sigTest,"8_8")) { - typedef I8 (*T)(I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p); - }; + } + case MINT_ICALLSIG_44_8: { + typedef I8(*T)(I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i); break; - } - case MINT_ICALLSIG_PP_V: - case MINT_ICALLSIG_PP_P: { - if (!strcmp(sigTest,"44_V")) { - typedef void (*T)(I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i); - }; - if (!strcmp(sigTest,"48_V")) { - typedef void (*T)(I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p); - }; - if (!strcmp(sigTest,"84_V")) { - typedef void (*T)(I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i); - }; - if (!strcmp(sigTest,"88_V")) { - typedef void (*T)(I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p); - }; - if (!strcmp(sigTest,"44_4")) { - typedef I4 (*T)(I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i); - }; - if (!strcmp(sigTest,"48_4")) { - typedef I4 (*T)(I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p); - }; - if (!strcmp(sigTest,"84_4")) { - typedef I4 (*T)(I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i); - }; - if (!strcmp(sigTest,"88_4")) { - typedef I4 (*T)(I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p); - }; - if (!strcmp(sigTest,"44_8")) { - typedef I8 (*T)(I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i); - }; - if (!strcmp(sigTest,"48_8")) { - typedef I8 (*T)(I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p); - }; - if (!strcmp(sigTest,"84_8")) { - typedef I8 (*T)(I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i); - }; - if (!strcmp(sigTest,"88_8")) { - typedef I8 (*T)(I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p); - }; + } + case MINT_ICALLSIG_48_8: { + typedef I8(*T)(I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p); break; - } - case MINT_ICALLSIG_PPP_V: - case MINT_ICALLSIG_PPP_P: { - if (!strcmp(sigTest,"444_V")) { - typedef void (*T)(I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i); - }; - if (!strcmp(sigTest,"448_V")) { - typedef void (*T)(I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p); - }; - if (!strcmp(sigTest,"484_V")) { - typedef void (*T)(I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i); - }; - if (!strcmp(sigTest,"488_V")) { - typedef void (*T)(I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p); - }; - if (!strcmp(sigTest,"844_V")) { - typedef void (*T)(I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i); - }; - if (!strcmp(sigTest,"848_V")) { - typedef void (*T)(I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p); - }; - if (!strcmp(sigTest,"884_V")) { - typedef void (*T)(I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i); - }; - if (!strcmp(sigTest,"888_V")) { - typedef void (*T)(I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p); - }; - if (!strcmp(sigTest,"444_4")) { - typedef I4 (*T)(I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i); - }; - if (!strcmp(sigTest,"448_4")) { - typedef I4 (*T)(I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p); - }; - if (!strcmp(sigTest,"484_4")) { - typedef I4 (*T)(I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i); - }; - if (!strcmp(sigTest,"488_4")) { - typedef I4 (*T)(I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p); - }; - if (!strcmp(sigTest,"844_4")) { - typedef I4 (*T)(I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i); - }; - if (!strcmp(sigTest,"848_4")) { - typedef I4 (*T)(I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p); - }; - if (!strcmp(sigTest,"884_4")) { - typedef I4 (*T)(I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i); - }; - if (!strcmp(sigTest,"888_4")) { - typedef I4 (*T)(I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p); - }; - if (!strcmp(sigTest,"444_8")) { - typedef I8 (*T)(I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i); - }; - if (!strcmp(sigTest,"448_8")) { - typedef I8 (*T)(I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p); - }; - if (!strcmp(sigTest,"484_8")) { - typedef I8 (*T)(I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i); - }; - if (!strcmp(sigTest,"488_8")) { - typedef I8 (*T)(I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p); - }; - if (!strcmp(sigTest,"844_8")) { - typedef I8 (*T)(I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i); - }; - if (!strcmp(sigTest,"848_8")) { - typedef I8 (*T)(I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p); - }; - if (!strcmp(sigTest,"884_8")) { - typedef I8 (*T)(I8,I8,I4); - T func = (T)ptr; - MH_LOG("Calling 884_8 func with: %p %p %d", (void*)sp[0].data.p, (void*)sp[1].data.p, sp[2].data.i); - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i); - }; - if (!strcmp(sigTest,"888_8")) { - typedef I8 (*T)(I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p); - }; + } + case MINT_ICALLSIG_84_8: { + typedef I8(*T)(I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i); break; - } - case MINT_ICALLSIG_PPPP_V: - case MINT_ICALLSIG_PPPP_P: { - if (!strcmp(sigTest,"4444_V")) { - typedef void (*T)(I4,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"4448_V")) { - typedef void (*T)(I4,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"4484_V")) { - typedef void (*T)(I4,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"4488_V")) { - typedef void (*T)(I4,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"4844_V")) { - typedef void (*T)(I4,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"4848_V")) { - typedef void (*T)(I4,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"4884_V")) { - typedef void (*T)(I4,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"4888_V")) { - typedef void (*T)(I4,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"8444_V")) { - typedef void (*T)(I8,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"8448_V")) { - typedef void (*T)(I8,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"8484_V")) { - typedef void (*T)(I8,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"8488_V")) { - typedef void (*T)(I8,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"8844_V")) { - typedef void (*T)(I8,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"8848_V")) { - typedef void (*T)(I8,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"8884_V")) { - typedef void (*T)(I8,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"8888_V")) { - typedef void (*T)(I8,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"4444_4")) { - typedef I4 (*T)(I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"4448_4")) { - typedef I4 (*T)(I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"4484_4")) { - typedef I4 (*T)(I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"4488_4")) { - typedef I4 (*T)(I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"4844_4")) { - typedef I4 (*T)(I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"4848_4")) { - typedef I4 (*T)(I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"4884_4")) { - typedef I4 (*T)(I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"4888_4")) { - typedef I4 (*T)(I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"8444_4")) { - typedef I4 (*T)(I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"8448_4")) { - typedef I4 (*T)(I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"8484_4")) { - typedef I4 (*T)(I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"8488_4")) { - typedef I4 (*T)(I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"8844_4")) { - typedef I4 (*T)(I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"8848_4")) { - typedef I4 (*T)(I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"8884_4")) { - typedef I4 (*T)(I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"8888_4")) { - typedef I4 (*T)(I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"4444_8")) { - typedef I8 (*T)(I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"4448_8")) { - typedef I8 (*T)(I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"4484_8")) { - typedef I8 (*T)(I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"4488_8")) { - typedef I8 (*T)(I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"4844_8")) { - typedef I8 (*T)(I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"4848_8")) { - typedef I8 (*T)(I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"4884_8")) { - typedef I8 (*T)(I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"4888_8")) { - typedef I8 (*T)(I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"8444_8")) { - typedef I8 (*T)(I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"8448_8")) { - typedef I8 (*T)(I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"8484_8")) { - typedef I8 (*T)(I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"8488_8")) { - typedef I8 (*T)(I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p); - }; - if (!strcmp(sigTest,"8844_8")) { - typedef I8 (*T)(I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i); - }; - if (!strcmp(sigTest,"8848_8")) { - typedef I8 (*T)(I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p); - }; - if (!strcmp(sigTest,"8884_8")) { - typedef I8 (*T)(I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i); - }; - if (!strcmp(sigTest,"8888_8")) { - typedef I8 (*T)(I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p); - }; + } + case MINT_ICALLSIG_88_8: { + typedef I8(*T)(I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p); break; - } - case MINT_ICALLSIG_PPPPP_V: - case MINT_ICALLSIG_PPPPP_P: { - //log_sig(sig); // just here for a breakpoint - if (!strcmp(sigTest,"44444_V")) { - typedef void (*T)(I4,I4,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"44448_V")) { - typedef void (*T)(I4,I4,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"44484_V")) { - typedef void (*T)(I4,I4,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"44488_V")) { - typedef void (*T)(I4,I4,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"44844_V")) { - typedef void (*T)(I4,I4,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"44848_V")) { - typedef void (*T)(I4,I4,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"44884_V")) { - typedef void (*T)(I4,I4,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"44888_V")) { - typedef void (*T)(I4,I4,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"48444_V")) { - typedef void (*T)(I4,I8,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"48448_V")) { - typedef void (*T)(I4,I8,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"48484_V")) { - typedef void (*T)(I4,I8,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"48488_V")) { - typedef void (*T)(I4,I8,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"48844_V")) { - typedef void (*T)(I4,I8,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"48848_V")) { - typedef void (*T)(I4,I8,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"48884_V")) { - typedef void (*T)(I4,I8,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"48888_V")) { - typedef void (*T)(I4,I8,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"84444_V")) { - typedef void (*T)(I8,I4,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"84448_V")) { - typedef void (*T)(I8,I4,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"84484_V")) { - typedef void (*T)(I8,I4,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"84488_V")) { - typedef void (*T)(I8,I4,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"84844_V")) { - typedef void (*T)(I8,I4,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"84848_V")) { - typedef void (*T)(I8,I4,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"84884_V")) { - typedef void (*T)(I8,I4,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"84888_V")) { - typedef void (*T)(I8,I4,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"88444_V")) { - typedef void (*T)(I8,I8,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"88448_V")) { - typedef void (*T)(I8,I8,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"88484_V")) { - typedef void (*T)(I8,I8,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"88488_V")) { - typedef void (*T)(I8,I8,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"88844_V")) { - typedef void (*T)(I8,I8,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"88848_V")) { - typedef void (*T)(I8,I8,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"88884_V")) { - typedef void (*T)(I8,I8,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"88888_V")) { - typedef void (*T)(I8,I8,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"44444_4")) { - typedef I4 (*T)(I4,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"44448_4")) { - typedef I4 (*T)(I4,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"44484_4")) { - typedef I4 (*T)(I4,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"44488_4")) { - typedef I4 (*T)(I4,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"44844_4")) { - typedef I4 (*T)(I4,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"44848_4")) { - typedef I4 (*T)(I4,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"44884_4")) { - typedef I4 (*T)(I4,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"44888_4")) { - typedef I4 (*T)(I4,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"48444_4")) { - typedef I4 (*T)(I4,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"48448_4")) { - typedef I4 (*T)(I4,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"48484_4")) { - typedef I4 (*T)(I4,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"48488_4")) { - typedef I4 (*T)(I4,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"48844_4")) { - typedef I4 (*T)(I4,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"48848_4")) { - typedef I4 (*T)(I4,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"48884_4")) { - typedef I4 (*T)(I4,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"48888_4")) { - typedef I4 (*T)(I4,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"84444_4")) { - typedef I4 (*T)(I8,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"84448_4")) { - typedef I4 (*T)(I8,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"84484_4")) { - typedef I4 (*T)(I8,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"84488_4")) { - typedef I4 (*T)(I8,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"84844_4")) { - typedef I4 (*T)(I8,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"84848_4")) { - typedef I4 (*T)(I8,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"84884_4")) { - typedef I4 (*T)(I8,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"84888_4")) { - typedef I4 (*T)(I8,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"88444_4")) { - typedef I4 (*T)(I8,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"88448_4")) { - typedef I4 (*T)(I8,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"88484_4")) { - typedef I4 (*T)(I8,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"88488_4")) { - typedef I4 (*T)(I8,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"88844_4")) { - typedef I4 (*T)(I8,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"88848_4")) { - typedef I4 (*T)(I8,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"88884_4")) { - typedef I4 (*T)(I8,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"88888_4")) { - typedef I4 (*T)(I8,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"44444_8")) { - typedef I8 (*T)(I4,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"44448_8")) { - typedef I8 (*T)(I4,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"44484_8")) { - typedef I8 (*T)(I4,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"44488_8")) { - typedef I8 (*T)(I4,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"44844_8")) { - typedef I8 (*T)(I4,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"44848_8")) { - typedef I8 (*T)(I4,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"44884_8")) { - typedef I8 (*T)(I4,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"44888_8")) { - typedef I8 (*T)(I4,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"48444_8")) { - typedef I8 (*T)(I4,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"48448_8")) { - typedef I8 (*T)(I4,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"48484_8")) { - typedef I8 (*T)(I4,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"48488_8")) { - typedef I8 (*T)(I4,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"48844_8")) { - typedef I8 (*T)(I4,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"48848_8")) { - typedef I8 (*T)(I4,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"48884_8")) { - typedef I8 (*T)(I4,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"48888_8")) { - typedef I8 (*T)(I4,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"84444_8")) { - typedef I8 (*T)(I8,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"84448_8")) { - typedef I8 (*T)(I8,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"84484_8")) { - typedef I8 (*T)(I8,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"84488_8")) { - typedef I8 (*T)(I8,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"84844_8")) { - typedef I8 (*T)(I8,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"84848_8")) { - typedef I8 (*T)(I8,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"84884_8")) { - typedef I8 (*T)(I8,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"84888_8")) { - typedef I8 (*T)(I8,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"88444_8")) { - typedef I8 (*T)(I8,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"88448_8")) { - typedef I8 (*T)(I8,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"88484_8")) { - typedef I8 (*T)(I8,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"88488_8")) { - typedef I8 (*T)(I8,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p); - }; - if (!strcmp(sigTest,"88844_8")) { - typedef I8 (*T)(I8,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i); - }; - if (!strcmp(sigTest,"88848_8")) { - typedef I8 (*T)(I8,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p); - }; - if (!strcmp(sigTest,"88884_8")) { - typedef I8 (*T)(I8,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i); - }; - if (!strcmp(sigTest,"88888_8")) { - typedef I8 (*T)(I8,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p); - }; + } + case MINT_ICALLSIG_444_V: { + typedef void (*T)(I4, I4, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.i); break; - } - case MINT_ICALLSIG_PPPPPP_V: - case MINT_ICALLSIG_PPPPPP_P: { - //log_sig(sig); // just here for a breakpoint - if (!strcmp(sigTest,"444444_V")) { - typedef void (*T)(I4,I4,I4,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"444448_V")) { - typedef void (*T)(I4,I4,I4,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"444484_V")) { - typedef void (*T)(I4,I4,I4,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"444488_V")) { - typedef void (*T)(I4,I4,I4,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"444844_V")) { - typedef void (*T)(I4,I4,I4,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"444848_V")) { - typedef void (*T)(I4,I4,I4,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"444884_V")) { - typedef void (*T)(I4,I4,I4,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"444888_V")) { - typedef void (*T)(I4,I4,I4,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"448444_V")) { - typedef void (*T)(I4,I4,I8,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"448448_V")) { - typedef void (*T)(I4,I4,I8,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"448484_V")) { - typedef void (*T)(I4,I4,I8,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"448488_V")) { - typedef void (*T)(I4,I4,I8,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"448844_V")) { - typedef void (*T)(I4,I4,I8,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"448848_V")) { - typedef void (*T)(I4,I4,I8,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"448884_V")) { - typedef void (*T)(I4,I4,I8,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"448888_V")) { - typedef void (*T)(I4,I4,I8,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"484444_V")) { - typedef void (*T)(I4,I8,I4,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"484448_V")) { - typedef void (*T)(I4,I8,I4,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"484484_V")) { - typedef void (*T)(I4,I8,I4,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"484488_V")) { - typedef void (*T)(I4,I8,I4,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"484844_V")) { - typedef void (*T)(I4,I8,I4,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"484848_V")) { - typedef void (*T)(I4,I8,I4,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"484884_V")) { - typedef void (*T)(I4,I8,I4,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"484888_V")) { - typedef void (*T)(I4,I8,I4,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"488444_V")) { - typedef void (*T)(I4,I8,I8,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"488448_V")) { - typedef void (*T)(I4,I8,I8,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"488484_V")) { - typedef void (*T)(I4,I8,I8,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"488488_V")) { - typedef void (*T)(I4,I8,I8,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"488844_V")) { - typedef void (*T)(I4,I8,I8,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"488848_V")) { - typedef void (*T)(I4,I8,I8,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"488884_V")) { - typedef void (*T)(I4,I8,I8,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"488888_V")) { - typedef void (*T)(I4,I8,I8,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"844444_V")) { - typedef void (*T)(I8,I4,I4,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"844448_V")) { - typedef void (*T)(I8,I4,I4,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"844484_V")) { - typedef void (*T)(I8,I4,I4,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"844488_V")) { - typedef void (*T)(I8,I4,I4,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"844844_V")) { - typedef void (*T)(I8,I4,I4,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"844848_V")) { - typedef void (*T)(I8,I4,I4,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"844884_V")) { - typedef void (*T)(I8,I4,I4,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"844888_V")) { - typedef void (*T)(I8,I4,I4,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"848444_V")) { - typedef void (*T)(I8,I4,I8,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"848448_V")) { - typedef void (*T)(I8,I4,I8,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"848484_V")) { - typedef void (*T)(I8,I4,I8,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"848488_V")) { - typedef void (*T)(I8,I4,I8,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"848844_V")) { - typedef void (*T)(I8,I4,I8,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"848848_V")) { - typedef void (*T)(I8,I4,I8,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"848884_V")) { - typedef void (*T)(I8,I4,I8,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"848888_V")) { - typedef void (*T)(I8,I4,I8,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"884444_V")) { - typedef void (*T)(I8,I8,I4,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"884448_V")) { - typedef void (*T)(I8,I8,I4,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"884484_V")) { - typedef void (*T)(I8,I8,I4,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"884488_V")) { - typedef void (*T)(I8,I8,I4,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"884844_V")) { - typedef void (*T)(I8,I8,I4,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"884848_V")) { - typedef void (*T)(I8,I8,I4,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"884884_V")) { - typedef void (*T)(I8,I8,I4,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"884888_V")) { - typedef void (*T)(I8,I8,I4,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"888444_V")) { - typedef void (*T)(I8,I8,I8,I4,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"888448_V")) { - typedef void (*T)(I8,I8,I8,I4,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"888484_V")) { - typedef void (*T)(I8,I8,I8,I4,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"888488_V")) { - typedef void (*T)(I8,I8,I8,I4,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"888844_V")) { - typedef void (*T)(I8,I8,I8,I8,I4,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"888848_V")) { - typedef void (*T)(I8,I8,I8,I8,I4,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"888884_V")) { - typedef void (*T)(I8,I8,I8,I8,I8,I4); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"888888_V")) { - typedef void (*T)(I8,I8,I8,I8,I8,I8); - T func = (T)ptr; - func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"444444_4")) { - typedef I4 (*T)(I4,I4,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"444448_4")) { - typedef I4 (*T)(I4,I4,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"444484_4")) { - typedef I4 (*T)(I4,I4,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"444488_4")) { - typedef I4 (*T)(I4,I4,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"444844_4")) { - typedef I4 (*T)(I4,I4,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"444848_4")) { - typedef I4 (*T)(I4,I4,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"444884_4")) { - typedef I4 (*T)(I4,I4,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"444888_4")) { - typedef I4 (*T)(I4,I4,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"448444_4")) { - typedef I4 (*T)(I4,I4,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"448448_4")) { - typedef I4 (*T)(I4,I4,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"448484_4")) { - typedef I4 (*T)(I4,I4,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"448488_4")) { - typedef I4 (*T)(I4,I4,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"448844_4")) { - typedef I4 (*T)(I4,I4,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"448848_4")) { - typedef I4 (*T)(I4,I4,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"448884_4")) { - typedef I4 (*T)(I4,I4,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"448888_4")) { - typedef I4 (*T)(I4,I4,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"484444_4")) { - typedef I4 (*T)(I4,I8,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"484448_4")) { - typedef I4 (*T)(I4,I8,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"484484_4")) { - typedef I4 (*T)(I4,I8,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"484488_4")) { - typedef I4 (*T)(I4,I8,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"484844_4")) { - typedef I4 (*T)(I4,I8,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"484848_4")) { - typedef I4 (*T)(I4,I8,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"484884_4")) { - typedef I4 (*T)(I4,I8,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"484888_4")) { - typedef I4 (*T)(I4,I8,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"488444_4")) { - typedef I4 (*T)(I4,I8,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"488448_4")) { - typedef I4 (*T)(I4,I8,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"488484_4")) { - typedef I4 (*T)(I4,I8,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"488488_4")) { - typedef I4 (*T)(I4,I8,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"488844_4")) { - typedef I4 (*T)(I4,I8,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"488848_4")) { - typedef I4 (*T)(I4,I8,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"488884_4")) { - typedef I4 (*T)(I4,I8,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"488888_4")) { - typedef I4 (*T)(I4,I8,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"844444_4")) { - typedef I4 (*T)(I8,I4,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"844448_4")) { - typedef I4 (*T)(I8,I4,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"844484_4")) { - typedef I4 (*T)(I8,I4,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"844488_4")) { - typedef I4 (*T)(I8,I4,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"844844_4")) { - typedef I4 (*T)(I8,I4,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"844848_4")) { - typedef I4 (*T)(I8,I4,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"844884_4")) { - typedef I4 (*T)(I8,I4,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"844888_4")) { - typedef I4 (*T)(I8,I4,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"848444_4")) { - typedef I4 (*T)(I8,I4,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"848448_4")) { - typedef I4 (*T)(I8,I4,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"848484_4")) { - typedef I4 (*T)(I8,I4,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"848488_4")) { - typedef I4 (*T)(I8,I4,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"848844_4")) { - typedef I4 (*T)(I8,I4,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"848848_4")) { - typedef I4 (*T)(I8,I4,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"848884_4")) { - typedef I4 (*T)(I8,I4,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"848888_4")) { - typedef I4 (*T)(I8,I4,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"884444_4")) { - typedef I4 (*T)(I8,I8,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"884448_4")) { - typedef I4 (*T)(I8,I8,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"884484_4")) { - typedef I4 (*T)(I8,I8,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"884488_4")) { - typedef I4 (*T)(I8,I8,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"884844_4")) { - typedef I4 (*T)(I8,I8,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"884848_4")) { - typedef I4 (*T)(I8,I8,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"884884_4")) { - typedef I4 (*T)(I8,I8,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"884888_4")) { - typedef I4 (*T)(I8,I8,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"888444_4")) { - typedef I4 (*T)(I8,I8,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"888448_4")) { - typedef I4 (*T)(I8,I8,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"888484_4")) { - typedef I4 (*T)(I8,I8,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"888488_4")) { - typedef I4 (*T)(I8,I8,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"888844_4")) { - typedef I4 (*T)(I8,I8,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"888848_4")) { - typedef I4 (*T)(I8,I8,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"888884_4")) { - typedef I4 (*T)(I8,I8,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"888888_4")) { - typedef I4 (*T)(I8,I8,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.i = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"444444_8")) { - typedef I8 (*T)(I4,I4,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"444448_8")) { - typedef I8 (*T)(I4,I4,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"444484_8")) { - typedef I8 (*T)(I4,I4,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"444488_8")) { - typedef I8 (*T)(I4,I4,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"444844_8")) { - typedef I8 (*T)(I4,I4,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"444848_8")) { - typedef I8 (*T)(I4,I4,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"444884_8")) { - typedef I8 (*T)(I4,I4,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"444888_8")) { - typedef I8 (*T)(I4,I4,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"448444_8")) { - typedef I8 (*T)(I4,I4,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"448448_8")) { - typedef I8 (*T)(I4,I4,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"448484_8")) { - typedef I8 (*T)(I4,I4,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"448488_8")) { - typedef I8 (*T)(I4,I4,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"448844_8")) { - typedef I8 (*T)(I4,I4,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"448848_8")) { - typedef I8 (*T)(I4,I4,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"448884_8")) { - typedef I8 (*T)(I4,I4,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"448888_8")) { - typedef I8 (*T)(I4,I4,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"484444_8")) { - typedef I8 (*T)(I4,I8,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"484448_8")) { - typedef I8 (*T)(I4,I8,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"484484_8")) { - typedef I8 (*T)(I4,I8,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"484488_8")) { - typedef I8 (*T)(I4,I8,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"484844_8")) { - typedef I8 (*T)(I4,I8,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"484848_8")) { - typedef I8 (*T)(I4,I8,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"484884_8")) { - typedef I8 (*T)(I4,I8,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"484888_8")) { - typedef I8 (*T)(I4,I8,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"488444_8")) { - typedef I8 (*T)(I4,I8,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"488448_8")) { - typedef I8 (*T)(I4,I8,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"488484_8")) { - typedef I8 (*T)(I4,I8,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"488488_8")) { - typedef I8 (*T)(I4,I8,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"488844_8")) { - typedef I8 (*T)(I4,I8,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"488848_8")) { - typedef I8 (*T)(I4,I8,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"488884_8")) { - typedef I8 (*T)(I4,I8,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"488888_8")) { - typedef I8 (*T)(I4,I8,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.i,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"844444_8")) { - typedef I8 (*T)(I8,I4,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"844448_8")) { - typedef I8 (*T)(I8,I4,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"844484_8")) { - typedef I8 (*T)(I8,I4,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"844488_8")) { - typedef I8 (*T)(I8,I4,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"844844_8")) { - typedef I8 (*T)(I8,I4,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"844848_8")) { - typedef I8 (*T)(I8,I4,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"844884_8")) { - typedef I8 (*T)(I8,I4,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"844888_8")) { - typedef I8 (*T)(I8,I4,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"848444_8")) { - typedef I8 (*T)(I8,I4,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"848448_8")) { - typedef I8 (*T)(I8,I4,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"848484_8")) { - typedef I8 (*T)(I8,I4,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"848488_8")) { - typedef I8 (*T)(I8,I4,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"848844_8")) { - typedef I8 (*T)(I8,I4,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"848848_8")) { - typedef I8 (*T)(I8,I4,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"848884_8")) { - typedef I8 (*T)(I8,I4,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"848888_8")) { - typedef I8 (*T)(I8,I4,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.i,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"884444_8")) { - typedef I8 (*T)(I8,I8,I4,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"884448_8")) { - typedef I8 (*T)(I8,I8,I4,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"884484_8")) { - typedef I8 (*T)(I8,I8,I4,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"884488_8")) { - typedef I8 (*T)(I8,I8,I4,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"884844_8")) { - typedef I8 (*T)(I8,I8,I4,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"884848_8")) { - typedef I8 (*T)(I8,I8,I4,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"884884_8")) { - typedef I8 (*T)(I8,I8,I4,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"884888_8")) { - typedef I8 (*T)(I8,I8,I4,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.i,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"888444_8")) { - typedef I8 (*T)(I8,I8,I8,I4,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"888448_8")) { - typedef I8 (*T)(I8,I8,I8,I4,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"888484_8")) { - typedef I8 (*T)(I8,I8,I8,I4,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"888488_8")) { - typedef I8 (*T)(I8,I8,I8,I4,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.i,sp[4].data.p,sp[5].data.p); - }; - if (!strcmp(sigTest,"888844_8")) { - typedef I8 (*T)(I8,I8,I8,I8,I4,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.i); - }; - if (!strcmp(sigTest,"888848_8")) { - typedef I8 (*T)(I8,I8,I8,I8,I4,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.i,sp[5].data.p); - }; - if (!strcmp(sigTest,"888884_8")) { - typedef I8 (*T)(I8,I8,I8,I8,I8,I4); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.i); - }; - if (!strcmp(sigTest,"888888_8")) { - typedef I8 (*T)(I8,I8,I8,I8,I8,I8); - T func = (T)ptr; - ret_sp->data.p = func(sp[0].data.p,sp[1].data.p,sp[2].data.p,sp[3].data.p,sp[4].data.p,sp[5].data.p); - }; + } + case MINT_ICALLSIG_448_V: { + typedef void (*T)(I4, I4, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.p); break; - } - default: - g_assert_not_reached(); - } } - if (save_last_error) - mono_marshal_set_last_error (); - - /* convert the native representation to the stackval representation */ - if (sig) - stackval_from_data (sig->ret, ret_sp, (char*) &ret_sp->data.p, sig->pinvoke && !sig->marshalling_disabled); - if(sigTest) - free(sigTest); - MH_LOG("Returning from do_icall with ret_sp: %p", ret_sp->data.p); - MH_LOG_UNINDENT(); + case MINT_ICALLSIG_484_V: { + typedef void (*T)(I4, I8, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.i); + break; + } + case MINT_ICALLSIG_488_V: { + typedef void (*T)(I4, I8, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.p); + break; + } + case MINT_ICALLSIG_844_V: { + typedef void (*T)(I8, I4, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.i); + break; + } + case MINT_ICALLSIG_848_V: { + typedef void (*T)(I8, I4, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.p); + break; + } + case MINT_ICALLSIG_884_V: { + typedef void (*T)(I8, I8, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.i); + break; + } + case MINT_ICALLSIG_888_V: { + typedef void (*T)(I8, I8, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.p); + break; + } + case MINT_ICALLSIG_444_4: { + typedef I4(*T)(I4, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.i); + break; + } + case MINT_ICALLSIG_448_4: { + typedef I4(*T)(I4, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.p); + break; + } + case MINT_ICALLSIG_484_4: { + typedef I4(*T)(I4, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.i); + break; + } + case MINT_ICALLSIG_488_4: { + typedef I4(*T)(I4, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.p); + break; + } + case MINT_ICALLSIG_844_4: { + typedef I4(*T)(I8, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.i); + break; + } + case MINT_ICALLSIG_848_4: { + typedef I4(*T)(I8, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.p); + break; + } + case MINT_ICALLSIG_884_4: { + typedef I4(*T)(I8, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.i); + break; + } + case MINT_ICALLSIG_888_4: { + typedef I4(*T)(I8, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.p); + break; + } + case MINT_ICALLSIG_444_8: { + typedef I8(*T)(I4, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.i); + break; + } + case MINT_ICALLSIG_448_8: { + typedef I8(*T)(I4, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.p); + break; + } + case MINT_ICALLSIG_484_8: { + typedef I8(*T)(I4, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.i); + break; + } + case MINT_ICALLSIG_488_8: { + typedef I8(*T)(I4, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.p); + break; + } + case MINT_ICALLSIG_844_8: { + typedef I8(*T)(I8, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.i); + break; + } + case MINT_ICALLSIG_848_8: { + typedef I8(*T)(I8, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.p); + break; + } + case MINT_ICALLSIG_884_8: { + typedef I8(*T)(I8, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.i); + break; + } + case MINT_ICALLSIG_888_8: { + typedef I8(*T)(I8, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.p); + break; + } + case MINT_ICALLSIG_4444_V: { + typedef void (*T)(I4, I4, I4, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i); + break; + } + case MINT_ICALLSIG_4448_V: { + typedef void (*T)(I4, I4, I4, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p); + break; + } + case MINT_ICALLSIG_4484_V: { + typedef void (*T)(I4, I4, I8, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i); + break; + } + case MINT_ICALLSIG_4488_V: { + typedef void (*T)(I4, I4, I8, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p); + break; + } + case MINT_ICALLSIG_4844_V: { + typedef void (*T)(I4, I8, I4, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i); + break; + } + case MINT_ICALLSIG_4848_V: { + typedef void (*T)(I4, I8, I4, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p); + break; + } + case MINT_ICALLSIG_4884_V: { + typedef void (*T)(I4, I8, I8, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i); + break; + } + case MINT_ICALLSIG_4888_V: { + typedef void (*T)(I4, I8, I8, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p); + break; + } + case MINT_ICALLSIG_8444_V: { + typedef void (*T)(I8, I4, I4, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i); + break; + } + case MINT_ICALLSIG_8448_V: { + typedef void (*T)(I8, I4, I4, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p); + break; + } + case MINT_ICALLSIG_8484_V: { + typedef void (*T)(I8, I4, I8, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i); + break; + } + case MINT_ICALLSIG_8488_V: { + typedef void (*T)(I8, I4, I8, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p); + break; + } + case MINT_ICALLSIG_8844_V: { + typedef void (*T)(I8, I8, I4, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i); + break; + } + case MINT_ICALLSIG_8848_V: { + typedef void (*T)(I8, I8, I4, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p); + break; + } + case MINT_ICALLSIG_8884_V: { + typedef void (*T)(I8, I8, I8, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i); + break; + } + case MINT_ICALLSIG_8888_V: { + typedef void (*T)(I8, I8, I8, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p); + break; + } + case MINT_ICALLSIG_4444_4: { + typedef I4(*T)(I4, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i); + break; + } + case MINT_ICALLSIG_4448_4: { + typedef I4(*T)(I4, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p); + break; + } + case MINT_ICALLSIG_4484_4: { + typedef I4(*T)(I4, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i); + break; + } + case MINT_ICALLSIG_4488_4: { + typedef I4(*T)(I4, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p); + break; + } + case MINT_ICALLSIG_4844_4: { + typedef I4(*T)(I4, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i); + break; + } + case MINT_ICALLSIG_4848_4: { + typedef I4(*T)(I4, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p); + break; + } + case MINT_ICALLSIG_4884_4: { + typedef I4(*T)(I4, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i); + break; + } + case MINT_ICALLSIG_4888_4: { + typedef I4(*T)(I4, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p); + break; + } + case MINT_ICALLSIG_8444_4: { + typedef I4(*T)(I8, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i); + break; + } + case MINT_ICALLSIG_8448_4: { + typedef I4(*T)(I8, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p); + break; + } + case MINT_ICALLSIG_8484_4: { + typedef I4(*T)(I8, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i); + break; + } + case MINT_ICALLSIG_8488_4: { + typedef I4(*T)(I8, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p); + break; + } + case MINT_ICALLSIG_8844_4: { + typedef I4(*T)(I8, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i); + break; + } + case MINT_ICALLSIG_8848_4: { + typedef I4(*T)(I8, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p); + break; + } + case MINT_ICALLSIG_8884_4: { + typedef I4(*T)(I8, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i); + break; + } + case MINT_ICALLSIG_8888_4: { + typedef I4(*T)(I8, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p); + break; + } + case MINT_ICALLSIG_4444_8: { + typedef I8(*T)(I4, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i); + break; + } + case MINT_ICALLSIG_4448_8: { + typedef I8(*T)(I4, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p); + break; + } + case MINT_ICALLSIG_4484_8: { + typedef I8(*T)(I4, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i); + break; + } + case MINT_ICALLSIG_4488_8: { + typedef I8(*T)(I4, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p); + break; + } + case MINT_ICALLSIG_4844_8: { + typedef I8(*T)(I4, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i); + break; + } + case MINT_ICALLSIG_4848_8: { + typedef I8(*T)(I4, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p); + break; + } + case MINT_ICALLSIG_4884_8: { + typedef I8(*T)(I4, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i); + break; + } + case MINT_ICALLSIG_4888_8: { + typedef I8(*T)(I4, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p); + break; + } + case MINT_ICALLSIG_8444_8: { + typedef I8(*T)(I8, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i); + break; + } + case MINT_ICALLSIG_8448_8: { + typedef I8(*T)(I8, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p); + break; + } + case MINT_ICALLSIG_8484_8: { + typedef I8(*T)(I8, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i); + break; + } + case MINT_ICALLSIG_8488_8: { + typedef I8(*T)(I8, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p); + break; + } + case MINT_ICALLSIG_8844_8: { + typedef I8(*T)(I8, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i); + break; + } + case MINT_ICALLSIG_8848_8: { + typedef I8(*T)(I8, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p); + break; + } + case MINT_ICALLSIG_8884_8: { + typedef I8(*T)(I8, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i); + break; + } + case MINT_ICALLSIG_8888_8: { + typedef I8(*T)(I8, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p); + break; + } + case MINT_ICALLSIG_44444_V: { + typedef void (*T)(I4, I4, I4, I4, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_44448_V: { + typedef void (*T)(I4, I4, I4, I4, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_44484_V: { + typedef void (*T)(I4, I4, I4, I8, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_44488_V: { + typedef void (*T)(I4, I4, I4, I8, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_44844_V: { + typedef void (*T)(I4, I4, I8, I4, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_44848_V: { + typedef void (*T)(I4, I4, I8, I4, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_44884_V: { + typedef void (*T)(I4, I4, I8, I8, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_44888_V: { + typedef void (*T)(I4, I4, I8, I8, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_48444_V: { + typedef void (*T)(I4, I8, I4, I4, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_48448_V: { + typedef void (*T)(I4, I8, I4, I4, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_48484_V: { + typedef void (*T)(I4, I8, I4, I8, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_48488_V: { + typedef void (*T)(I4, I8, I4, I8, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_48844_V: { + typedef void (*T)(I4, I8, I8, I4, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_48848_V: { + typedef void (*T)(I4, I8, I8, I4, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_48884_V: { + typedef void (*T)(I4, I8, I8, I8, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_48888_V: { + typedef void (*T)(I4, I8, I8, I8, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_84444_V: { + typedef void (*T)(I8, I4, I4, I4, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_84448_V: { + typedef void (*T)(I8, I4, I4, I4, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_84484_V: { + typedef void (*T)(I8, I4, I4, I8, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_84488_V: { + typedef void (*T)(I8, I4, I4, I8, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_84844_V: { + typedef void (*T)(I8, I4, I8, I4, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_84848_V: { + typedef void (*T)(I8, I4, I8, I4, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_84884_V: { + typedef void (*T)(I8, I4, I8, I8, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_84888_V: { + typedef void (*T)(I8, I4, I8, I8, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_88444_V: { + typedef void (*T)(I8, I8, I4, I4, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_88448_V: { + typedef void (*T)(I8, I8, I4, I4, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_88484_V: { + typedef void (*T)(I8, I8, I4, I8, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_88488_V: { + typedef void (*T)(I8, I8, I4, I8, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_88844_V: { + typedef void (*T)(I8, I8, I8, I4, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_88848_V: { + typedef void (*T)(I8, I8, I8, I4, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_88884_V: { + typedef void (*T)(I8, I8, I8, I8, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_88888_V: { + typedef void (*T)(I8, I8, I8, I8, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_44444_4: { + typedef I4(*T)(I4, I4, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_44448_4: { + typedef I4(*T)(I4, I4, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_44484_4: { + typedef I4(*T)(I4, I4, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_44488_4: { + typedef I4(*T)(I4, I4, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_44844_4: { + typedef I4(*T)(I4, I4, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_44848_4: { + typedef I4(*T)(I4, I4, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_44884_4: { + typedef I4(*T)(I4, I4, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_44888_4: { + typedef I4(*T)(I4, I4, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_48444_4: { + typedef I4(*T)(I4, I8, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_48448_4: { + typedef I4(*T)(I4, I8, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_48484_4: { + typedef I4(*T)(I4, I8, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_48488_4: { + typedef I4(*T)(I4, I8, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_48844_4: { + typedef I4(*T)(I4, I8, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_48848_4: { + typedef I4(*T)(I4, I8, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_48884_4: { + typedef I4(*T)(I4, I8, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_48888_4: { + typedef I4(*T)(I4, I8, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_84444_4: { + typedef I4(*T)(I8, I4, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_84448_4: { + typedef I4(*T)(I8, I4, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_84484_4: { + typedef I4(*T)(I8, I4, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_84488_4: { + typedef I4(*T)(I8, I4, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_84844_4: { + typedef I4(*T)(I8, I4, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_84848_4: { + typedef I4(*T)(I8, I4, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_84884_4: { + typedef I4(*T)(I8, I4, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_84888_4: { + typedef I4(*T)(I8, I4, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_88444_4: { + typedef I4(*T)(I8, I8, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_88448_4: { + typedef I4(*T)(I8, I8, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_88484_4: { + typedef I4(*T)(I8, I8, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_88488_4: { + typedef I4(*T)(I8, I8, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_88844_4: { + typedef I4(*T)(I8, I8, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_88848_4: { + typedef I4(*T)(I8, I8, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_88884_4: { + typedef I4(*T)(I8, I8, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_88888_4: { + typedef I4(*T)(I8, I8, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_44444_8: { + typedef I8(*T)(I4, I4, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_44448_8: { + typedef I8(*T)(I4, I4, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_44484_8: { + typedef I8(*T)(I4, I4, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_44488_8: { + typedef I8(*T)(I4, I4, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_44844_8: { + typedef I8(*T)(I4, I4, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_44848_8: { + typedef I8(*T)(I4, I4, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_44884_8: { + typedef I8(*T)(I4, I4, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_44888_8: { + typedef I8(*T)(I4, I4, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_48444_8: { + typedef I8(*T)(I4, I8, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_48448_8: { + typedef I8(*T)(I4, I8, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_48484_8: { + typedef I8(*T)(I4, I8, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_48488_8: { + typedef I8(*T)(I4, I8, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_48844_8: { + typedef I8(*T)(I4, I8, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_48848_8: { + typedef I8(*T)(I4, I8, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_48884_8: { + typedef I8(*T)(I4, I8, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_48888_8: { + typedef I8(*T)(I4, I8, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_84444_8: { + typedef I8(*T)(I8, I4, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_84448_8: { + typedef I8(*T)(I8, I4, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_84484_8: { + typedef I8(*T)(I8, I4, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_84488_8: { + typedef I8(*T)(I8, I4, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_84844_8: { + typedef I8(*T)(I8, I4, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_84848_8: { + typedef I8(*T)(I8, I4, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_84884_8: { + typedef I8(*T)(I8, I4, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_84888_8: { + typedef I8(*T)(I8, I4, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_88444_8: { + typedef I8(*T)(I8, I8, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_88448_8: { + typedef I8(*T)(I8, I8, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_88484_8: { + typedef I8(*T)(I8, I8, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_88488_8: { + typedef I8(*T)(I8, I8, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_88844_8: { + typedef I8(*T)(I8, I8, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.i); + break; + } + case MINT_ICALLSIG_88848_8: { + typedef I8(*T)(I8, I8, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.p); + break; + } + case MINT_ICALLSIG_88884_8: { + typedef I8(*T)(I8, I8, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.i); + break; + } + case MINT_ICALLSIG_88888_8: { + typedef I8(*T)(I8, I8, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.p); + break; + } + case MINT_ICALLSIG_444444_V: { + typedef void (*T)(I4, I4, I4, I4, I4, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_444448_V: { + typedef void (*T)(I4, I4, I4, I4, I4, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_444484_V: { + typedef void (*T)(I4, I4, I4, I4, I8, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_444488_V: { + typedef void (*T)(I4, I4, I4, I4, I8, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_444844_V: { + typedef void (*T)(I4, I4, I4, I8, I4, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_444848_V: { + typedef void (*T)(I4, I4, I4, I8, I4, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_444884_V: { + typedef void (*T)(I4, I4, I4, I8, I8, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_444888_V: { + typedef void (*T)(I4, I4, I4, I8, I8, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_448444_V: { + typedef void (*T)(I4, I4, I8, I4, I4, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_448448_V: { + typedef void (*T)(I4, I4, I8, I4, I4, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_448484_V: { + typedef void (*T)(I4, I4, I8, I4, I8, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_448488_V: { + typedef void (*T)(I4, I4, I8, I4, I8, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_448844_V: { + typedef void (*T)(I4, I4, I8, I8, I4, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_448848_V: { + typedef void (*T)(I4, I4, I8, I8, I4, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_448884_V: { + typedef void (*T)(I4, I4, I8, I8, I8, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_448888_V: { + typedef void (*T)(I4, I4, I8, I8, I8, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_484444_V: { + typedef void (*T)(I4, I8, I4, I4, I4, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_484448_V: { + typedef void (*T)(I4, I8, I4, I4, I4, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_484484_V: { + typedef void (*T)(I4, I8, I4, I4, I8, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_484488_V: { + typedef void (*T)(I4, I8, I4, I4, I8, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_484844_V: { + typedef void (*T)(I4, I8, I4, I8, I4, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_484848_V: { + typedef void (*T)(I4, I8, I4, I8, I4, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_484884_V: { + typedef void (*T)(I4, I8, I4, I8, I8, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_484888_V: { + typedef void (*T)(I4, I8, I4, I8, I8, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_488444_V: { + typedef void (*T)(I4, I8, I8, I4, I4, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_488448_V: { + typedef void (*T)(I4, I8, I8, I4, I4, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_488484_V: { + typedef void (*T)(I4, I8, I8, I4, I8, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_488488_V: { + typedef void (*T)(I4, I8, I8, I4, I8, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_488844_V: { + typedef void (*T)(I4, I8, I8, I8, I4, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_488848_V: { + typedef void (*T)(I4, I8, I8, I8, I4, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_488884_V: { + typedef void (*T)(I4, I8, I8, I8, I8, I4); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_488888_V: { + typedef void (*T)(I4, I8, I8, I8, I8, I8); + T func = (T)ptr; + func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_844444_V: { + typedef void (*T)(I8, I4, I4, I4, I4, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_844448_V: { + typedef void (*T)(I8, I4, I4, I4, I4, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_844484_V: { + typedef void (*T)(I8, I4, I4, I4, I8, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_844488_V: { + typedef void (*T)(I8, I4, I4, I4, I8, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_844844_V: { + typedef void (*T)(I8, I4, I4, I8, I4, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_844848_V: { + typedef void (*T)(I8, I4, I4, I8, I4, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_844884_V: { + typedef void (*T)(I8, I4, I4, I8, I8, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_844888_V: { + typedef void (*T)(I8, I4, I4, I8, I8, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_848444_V: { + typedef void (*T)(I8, I4, I8, I4, I4, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_848448_V: { + typedef void (*T)(I8, I4, I8, I4, I4, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_848484_V: { + typedef void (*T)(I8, I4, I8, I4, I8, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_848488_V: { + typedef void (*T)(I8, I4, I8, I4, I8, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_848844_V: { + typedef void (*T)(I8, I4, I8, I8, I4, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_848848_V: { + typedef void (*T)(I8, I4, I8, I8, I4, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_848884_V: { + typedef void (*T)(I8, I4, I8, I8, I8, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_848888_V: { + typedef void (*T)(I8, I4, I8, I8, I8, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_884444_V: { + typedef void (*T)(I8, I8, I4, I4, I4, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_884448_V: { + typedef void (*T)(I8, I8, I4, I4, I4, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_884484_V: { + typedef void (*T)(I8, I8, I4, I4, I8, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_884488_V: { + typedef void (*T)(I8, I8, I4, I4, I8, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_884844_V: { + typedef void (*T)(I8, I8, I4, I8, I4, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_884848_V: { + typedef void (*T)(I8, I8, I4, I8, I4, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_884884_V: { + typedef void (*T)(I8, I8, I4, I8, I8, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_884888_V: { + typedef void (*T)(I8, I8, I4, I8, I8, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_888444_V: { + typedef void (*T)(I8, I8, I8, I4, I4, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_888448_V: { + typedef void (*T)(I8, I8, I8, I4, I4, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_888484_V: { + typedef void (*T)(I8, I8, I8, I4, I8, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_888488_V: { + typedef void (*T)(I8, I8, I8, I4, I8, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_888844_V: { + typedef void (*T)(I8, I8, I8, I8, I4, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_888848_V: { + typedef void (*T)(I8, I8, I8, I8, I4, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_888884_V: { + typedef void (*T)(I8, I8, I8, I8, I8, I4); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_888888_V: { + typedef void (*T)(I8, I8, I8, I8, I8, I8); + T func = (T)ptr; + func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_444444_4: { + typedef I4(*T)(I4, I4, I4, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_444448_4: { + typedef I4(*T)(I4, I4, I4, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_444484_4: { + typedef I4(*T)(I4, I4, I4, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_444488_4: { + typedef I4(*T)(I4, I4, I4, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_444844_4: { + typedef I4(*T)(I4, I4, I4, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_444848_4: { + typedef I4(*T)(I4, I4, I4, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_444884_4: { + typedef I4(*T)(I4, I4, I4, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_444888_4: { + typedef I4(*T)(I4, I4, I4, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_448444_4: { + typedef I4(*T)(I4, I4, I8, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_448448_4: { + typedef I4(*T)(I4, I4, I8, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_448484_4: { + typedef I4(*T)(I4, I4, I8, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_448488_4: { + typedef I4(*T)(I4, I4, I8, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_448844_4: { + typedef I4(*T)(I4, I4, I8, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_448848_4: { + typedef I4(*T)(I4, I4, I8, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_448884_4: { + typedef I4(*T)(I4, I4, I8, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_448888_4: { + typedef I4(*T)(I4, I4, I8, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_484444_4: { + typedef I4(*T)(I4, I8, I4, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_484448_4: { + typedef I4(*T)(I4, I8, I4, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_484484_4: { + typedef I4(*T)(I4, I8, I4, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_484488_4: { + typedef I4(*T)(I4, I8, I4, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_484844_4: { + typedef I4(*T)(I4, I8, I4, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_484848_4: { + typedef I4(*T)(I4, I8, I4, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_484884_4: { + typedef I4(*T)(I4, I8, I4, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_484888_4: { + typedef I4(*T)(I4, I8, I4, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_488444_4: { + typedef I4(*T)(I4, I8, I8, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_488448_4: { + typedef I4(*T)(I4, I8, I8, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_488484_4: { + typedef I4(*T)(I4, I8, I8, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_488488_4: { + typedef I4(*T)(I4, I8, I8, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_488844_4: { + typedef I4(*T)(I4, I8, I8, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_488848_4: { + typedef I4(*T)(I4, I8, I8, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_488884_4: { + typedef I4(*T)(I4, I8, I8, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_488888_4: { + typedef I4(*T)(I4, I8, I8, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_844444_4: { + typedef I4(*T)(I8, I4, I4, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_844448_4: { + typedef I4(*T)(I8, I4, I4, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_844484_4: { + typedef I4(*T)(I8, I4, I4, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_844488_4: { + typedef I4(*T)(I8, I4, I4, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_844844_4: { + typedef I4(*T)(I8, I4, I4, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_844848_4: { + typedef I4(*T)(I8, I4, I4, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_844884_4: { + typedef I4(*T)(I8, I4, I4, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_844888_4: { + typedef I4(*T)(I8, I4, I4, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_848444_4: { + typedef I4(*T)(I8, I4, I8, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_848448_4: { + typedef I4(*T)(I8, I4, I8, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_848484_4: { + typedef I4(*T)(I8, I4, I8, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_848488_4: { + typedef I4(*T)(I8, I4, I8, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_848844_4: { + typedef I4(*T)(I8, I4, I8, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_848848_4: { + typedef I4(*T)(I8, I4, I8, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_848884_4: { + typedef I4(*T)(I8, I4, I8, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_848888_4: { + typedef I4(*T)(I8, I4, I8, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_884444_4: { + typedef I4(*T)(I8, I8, I4, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_884448_4: { + typedef I4(*T)(I8, I8, I4, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_884484_4: { + typedef I4(*T)(I8, I8, I4, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_884488_4: { + typedef I4(*T)(I8, I8, I4, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_884844_4: { + typedef I4(*T)(I8, I8, I4, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_884848_4: { + typedef I4(*T)(I8, I8, I4, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_884884_4: { + typedef I4(*T)(I8, I8, I4, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_884888_4: { + typedef I4(*T)(I8, I8, I4, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_888444_4: { + typedef I4(*T)(I8, I8, I8, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_888448_4: { + typedef I4(*T)(I8, I8, I8, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_888484_4: { + typedef I4(*T)(I8, I8, I8, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_888488_4: { + typedef I4(*T)(I8, I8, I8, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_888844_4: { + typedef I4(*T)(I8, I8, I8, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_888848_4: { + typedef I4(*T)(I8, I8, I8, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_888884_4: { + typedef I4(*T)(I8, I8, I8, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_888888_4: { + typedef I4(*T)(I8, I8, I8, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.i = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_444444_8: { + typedef I8(*T)(I4, I4, I4, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_444448_8: { + typedef I8(*T)(I4, I4, I4, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_444484_8: { + typedef I8(*T)(I4, I4, I4, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_444488_8: { + typedef I8(*T)(I4, I4, I4, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_444844_8: { + typedef I8(*T)(I4, I4, I4, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_444848_8: { + typedef I8(*T)(I4, I4, I4, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_444884_8: { + typedef I8(*T)(I4, I4, I4, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_444888_8: { + typedef I8(*T)(I4, I4, I4, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_448444_8: { + typedef I8(*T)(I4, I4, I8, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_448448_8: { + typedef I8(*T)(I4, I4, I8, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_448484_8: { + typedef I8(*T)(I4, I4, I8, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_448488_8: { + typedef I8(*T)(I4, I4, I8, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_448844_8: { + typedef I8(*T)(I4, I4, I8, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_448848_8: { + typedef I8(*T)(I4, I4, I8, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_448884_8: { + typedef I8(*T)(I4, I4, I8, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_448888_8: { + typedef I8(*T)(I4, I4, I8, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_484444_8: { + typedef I8(*T)(I4, I8, I4, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_484448_8: { + typedef I8(*T)(I4, I8, I4, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_484484_8: { + typedef I8(*T)(I4, I8, I4, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_484488_8: { + typedef I8(*T)(I4, I8, I4, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_484844_8: { + typedef I8(*T)(I4, I8, I4, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_484848_8: { + typedef I8(*T)(I4, I8, I4, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_484884_8: { + typedef I8(*T)(I4, I8, I4, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_484888_8: { + typedef I8(*T)(I4, I8, I4, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_488444_8: { + typedef I8(*T)(I4, I8, I8, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_488448_8: { + typedef I8(*T)(I4, I8, I8, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_488484_8: { + typedef I8(*T)(I4, I8, I8, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_488488_8: { + typedef I8(*T)(I4, I8, I8, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_488844_8: { + typedef I8(*T)(I4, I8, I8, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_488848_8: { + typedef I8(*T)(I4, I8, I8, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_488884_8: { + typedef I8(*T)(I4, I8, I8, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_488888_8: { + typedef I8(*T)(I4, I8, I8, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.i, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_844444_8: { + typedef I8(*T)(I8, I4, I4, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_844448_8: { + typedef I8(*T)(I8, I4, I4, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_844484_8: { + typedef I8(*T)(I8, I4, I4, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_844488_8: { + typedef I8(*T)(I8, I4, I4, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_844844_8: { + typedef I8(*T)(I8, I4, I4, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_844848_8: { + typedef I8(*T)(I8, I4, I4, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_844884_8: { + typedef I8(*T)(I8, I4, I4, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_844888_8: { + typedef I8(*T)(I8, I4, I4, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_848444_8: { + typedef I8(*T)(I8, I4, I8, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_848448_8: { + typedef I8(*T)(I8, I4, I8, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_848484_8: { + typedef I8(*T)(I8, I4, I8, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_848488_8: { + typedef I8(*T)(I8, I4, I8, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_848844_8: { + typedef I8(*T)(I8, I4, I8, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_848848_8: { + typedef I8(*T)(I8, I4, I8, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_848884_8: { + typedef I8(*T)(I8, I4, I8, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_848888_8: { + typedef I8(*T)(I8, I4, I8, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.i, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_884444_8: { + typedef I8(*T)(I8, I8, I4, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_884448_8: { + typedef I8(*T)(I8, I8, I4, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_884484_8: { + typedef I8(*T)(I8, I8, I4, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_884488_8: { + typedef I8(*T)(I8, I8, I4, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_884844_8: { + typedef I8(*T)(I8, I8, I4, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_884848_8: { + typedef I8(*T)(I8, I8, I4, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_884884_8: { + typedef I8(*T)(I8, I8, I4, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_884888_8: { + typedef I8(*T)(I8, I8, I4, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.i, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_888444_8: { + typedef I8(*T)(I8, I8, I8, I4, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_888448_8: { + typedef I8(*T)(I8, I8, I8, I4, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_888484_8: { + typedef I8(*T)(I8, I8, I8, I4, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_888488_8: { + typedef I8(*T)(I8, I8, I8, I4, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.i, sp[4].data.p, sp[5].data.p); + break; + } + case MINT_ICALLSIG_888844_8: { + typedef I8(*T)(I8, I8, I8, I8, I4, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.i); + break; + } + case MINT_ICALLSIG_888848_8: { + typedef I8(*T)(I8, I8, I8, I8, I4, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.i, sp[5].data.p); + break; + } + case MINT_ICALLSIG_888884_8: { + typedef I8(*T)(I8, I8, I8, I8, I8, I4); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.i); + break; + } + case MINT_ICALLSIG_888888_8: { + typedef I8(*T)(I8, I8, I8, I8, I8, I8); + T func = (T)ptr; + ret_sp->data.p = func(sp[0].data.p, sp[1].data.p, sp[2].data.p, sp[3].data.p, sp[4].data.p, sp[5].data.p); + break; + } + default: + g_assert_not_reached(); + } + + if (save_last_error) + { + MH_LOG("Setting last error"); + mono_marshal_set_last_error(); + } + /* convert the native representation to the stackval representation */ + if (sig) + { + MH_LOG("Setting stackval from data"); + stackval_from_data(sig->ret, ret_sp, (char*)&ret_sp->data.p, sig->pinvoke && !sig->marshalling_disabled); + MH_LOG("Set stackval from data"); + } + else + MH_LOG("Not trying to set stackval from data - no sig"); + + MH_LOG("Returning from do_icall with ret_sp: %p", ret_sp->data.p); } diff --git a/src/mono/mono/mini/interp/interp-icalls.h b/src/mono/mono/mini/interp/interp-icalls.h index 7bf286a3590977..7a4c461895ab86 100644 --- a/src/mono/mono/mini/interp/interp-icalls.h +++ b/src/mono/mono/mini/interp/interp-icalls.h @@ -7,5 +7,6 @@ #include "interp-internals.h" extern void stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean pinvoke); extern void do_icall(MonoMethodSignature * sig, MintICallSig op, stackval * ret_sp, stackval * sp, gpointer ptr, gboolean save_last_error); - +extern gboolean interp_type_as_ptr4 (MonoType *tp); +extern gboolean interp_type_as_ptr8 (MonoType *tp); #endif diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index e86e92c8abc58b..acf15966cc3265 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -3532,7 +3532,7 @@ mono_interp_leave (InterpFrame* parent_frame) */ //MH_LOG_INDENT(); //MH_LOG("Calling do_icall_wrapper for mono_thread_get_undeniable_exception\n"); - do_icall_wrapper (&frame, NULL, MINT_ICALLSIG_V_P, &tmp_sp, &tmp_sp, (gpointer)mono_thread_get_undeniable_exception, FALSE, &gc_transitions); + do_icall_wrapper (&frame, NULL, SIZEOF_VOID_P == 4 ? MINT_ICALLSIG_V_4 : MINT_ICALLSIG_V_8, &tmp_sp, &tmp_sp, (gpointer)mono_thread_get_undeniable_exception, FALSE, &gc_transitions); //MH_LOG("..Finished calling do_icall_wrapper for mono_thread_get_undeniable_exception\n"); //MH_LOG_UNINDENT(); return (MonoException*)tmp_sp.data.p; @@ -7619,7 +7619,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; (*(guint64*)(locals + (ip[1]))) = (*(guint64*)(locals + (ip[2]))); { intptr_t result = (*(guint64*)(locals + (ip[1]))); - MH_LOG("MINT_MOV_8: *(%p + %d) = *(%p + %d): %p", locals, ip[1], locals, ip[2], (void*)result); + MH_LOGV(MH_LVL_CRIPPLE, "MINT_MOV_8: *(%p + %d) = *(%p + %d): %p", locals, ip[1], locals, ip[2], (void*)result); } ip += 3;; MINT_IN_BREAK; diff --git a/src/mono/mono/mini/interp/mintSigs.h b/src/mono/mono/mini/interp/mintSigs.h new file mode 100644 index 00000000000000..40ff88b155201c --- /dev/null +++ b/src/mono/mono/mini/interp/mintSigs.h @@ -0,0 +1,393 @@ +#ifndef MINTSIGNATURES +typedef enum { + SIG_PARAM_VOID = 0, + SIG_PARAM_4B = 4, + SIG_PARAM_8B = 8, + SIG_PARAM_INVALID = 666 +} param_type_e; +// this enum must fit in a unit16_t +typedef enum { +MINT_ICALLSIG_MAX = 55555, // just a recognisable large number +MINT_ICALLSIG_V_V = 0, +MINT_ICALLSIG_V_4 = 1, +MINT_ICALLSIG_V_8 = 2, +MINT_ICALLSIG_4_V = 4096, +MINT_ICALLSIG_8_V = 8192, +MINT_ICALLSIG_4_4 = 4097, +MINT_ICALLSIG_8_4 = 8193, +MINT_ICALLSIG_4_8 = 4098, +MINT_ICALLSIG_8_8 = 8194, +MINT_ICALLSIG_44_V = 5120, +MINT_ICALLSIG_48_V = 6144, +MINT_ICALLSIG_84_V = 9216, +MINT_ICALLSIG_88_V = 10240, +MINT_ICALLSIG_44_4 = 5121, +MINT_ICALLSIG_48_4 = 6145, +MINT_ICALLSIG_84_4 = 9217, +MINT_ICALLSIG_88_4 = 10241, +MINT_ICALLSIG_44_8 = 5122, +MINT_ICALLSIG_48_8 = 6146, +MINT_ICALLSIG_84_8 = 9218, +MINT_ICALLSIG_88_8 = 10242, +MINT_ICALLSIG_444_V = 5376, +MINT_ICALLSIG_448_V = 5632, +MINT_ICALLSIG_484_V = 6400, +MINT_ICALLSIG_488_V = 6656, +MINT_ICALLSIG_844_V = 9472, +MINT_ICALLSIG_848_V = 9728, +MINT_ICALLSIG_884_V = 10496, +MINT_ICALLSIG_888_V = 10752, +MINT_ICALLSIG_444_4 = 5377, +MINT_ICALLSIG_448_4 = 5633, +MINT_ICALLSIG_484_4 = 6401, +MINT_ICALLSIG_488_4 = 6657, +MINT_ICALLSIG_844_4 = 9473, +MINT_ICALLSIG_848_4 = 9729, +MINT_ICALLSIG_884_4 = 10497, +MINT_ICALLSIG_888_4 = 10753, +MINT_ICALLSIG_444_8 = 5378, +MINT_ICALLSIG_448_8 = 5634, +MINT_ICALLSIG_484_8 = 6402, +MINT_ICALLSIG_488_8 = 6658, +MINT_ICALLSIG_844_8 = 9474, +MINT_ICALLSIG_848_8 = 9730, +MINT_ICALLSIG_884_8 = 10498, +MINT_ICALLSIG_888_8 = 10754, +MINT_ICALLSIG_4444_V = 5440, +MINT_ICALLSIG_4448_V = 5504, +MINT_ICALLSIG_4484_V = 5696, +MINT_ICALLSIG_4488_V = 5760, +MINT_ICALLSIG_4844_V = 6464, +MINT_ICALLSIG_4848_V = 6528, +MINT_ICALLSIG_4884_V = 6720, +MINT_ICALLSIG_4888_V = 6784, +MINT_ICALLSIG_8444_V = 9536, +MINT_ICALLSIG_8448_V = 9600, +MINT_ICALLSIG_8484_V = 9792, +MINT_ICALLSIG_8488_V = 9856, +MINT_ICALLSIG_8844_V = 10560, +MINT_ICALLSIG_8848_V = 10624, +MINT_ICALLSIG_8884_V = 10816, +MINT_ICALLSIG_8888_V = 10880, +MINT_ICALLSIG_4444_4 = 5441, +MINT_ICALLSIG_4448_4 = 5505, +MINT_ICALLSIG_4484_4 = 5697, +MINT_ICALLSIG_4488_4 = 5761, +MINT_ICALLSIG_4844_4 = 6465, +MINT_ICALLSIG_4848_4 = 6529, +MINT_ICALLSIG_4884_4 = 6721, +MINT_ICALLSIG_4888_4 = 6785, +MINT_ICALLSIG_8444_4 = 9537, +MINT_ICALLSIG_8448_4 = 9601, +MINT_ICALLSIG_8484_4 = 9793, +MINT_ICALLSIG_8488_4 = 9857, +MINT_ICALLSIG_8844_4 = 10561, +MINT_ICALLSIG_8848_4 = 10625, +MINT_ICALLSIG_8884_4 = 10817, +MINT_ICALLSIG_8888_4 = 10881, +MINT_ICALLSIG_4444_8 = 5442, +MINT_ICALLSIG_4448_8 = 5506, +MINT_ICALLSIG_4484_8 = 5698, +MINT_ICALLSIG_4488_8 = 5762, +MINT_ICALLSIG_4844_8 = 6466, +MINT_ICALLSIG_4848_8 = 6530, +MINT_ICALLSIG_4884_8 = 6722, +MINT_ICALLSIG_4888_8 = 6786, +MINT_ICALLSIG_8444_8 = 9538, +MINT_ICALLSIG_8448_8 = 9602, +MINT_ICALLSIG_8484_8 = 9794, +MINT_ICALLSIG_8488_8 = 9858, +MINT_ICALLSIG_8844_8 = 10562, +MINT_ICALLSIG_8848_8 = 10626, +MINT_ICALLSIG_8884_8 = 10818, +MINT_ICALLSIG_8888_8 = 10882, +MINT_ICALLSIG_44444_V = 5456, +MINT_ICALLSIG_44448_V = 5472, +MINT_ICALLSIG_44484_V = 5520, +MINT_ICALLSIG_44488_V = 5536, +MINT_ICALLSIG_44844_V = 5712, +MINT_ICALLSIG_44848_V = 5728, +MINT_ICALLSIG_44884_V = 5776, +MINT_ICALLSIG_44888_V = 5792, +MINT_ICALLSIG_48444_V = 6480, +MINT_ICALLSIG_48448_V = 6496, +MINT_ICALLSIG_48484_V = 6544, +MINT_ICALLSIG_48488_V = 6560, +MINT_ICALLSIG_48844_V = 6736, +MINT_ICALLSIG_48848_V = 6752, +MINT_ICALLSIG_48884_V = 6800, +MINT_ICALLSIG_48888_V = 6816, +MINT_ICALLSIG_84444_V = 9552, +MINT_ICALLSIG_84448_V = 9568, +MINT_ICALLSIG_84484_V = 9616, +MINT_ICALLSIG_84488_V = 9632, +MINT_ICALLSIG_84844_V = 9808, +MINT_ICALLSIG_84848_V = 9824, +MINT_ICALLSIG_84884_V = 9872, +MINT_ICALLSIG_84888_V = 9888, +MINT_ICALLSIG_88444_V = 10576, +MINT_ICALLSIG_88448_V = 10592, +MINT_ICALLSIG_88484_V = 10640, +MINT_ICALLSIG_88488_V = 10656, +MINT_ICALLSIG_88844_V = 10832, +MINT_ICALLSIG_88848_V = 10848, +MINT_ICALLSIG_88884_V = 10896, +MINT_ICALLSIG_88888_V = 10912, +MINT_ICALLSIG_44444_4 = 5457, +MINT_ICALLSIG_44448_4 = 5473, +MINT_ICALLSIG_44484_4 = 5521, +MINT_ICALLSIG_44488_4 = 5537, +MINT_ICALLSIG_44844_4 = 5713, +MINT_ICALLSIG_44848_4 = 5729, +MINT_ICALLSIG_44884_4 = 5777, +MINT_ICALLSIG_44888_4 = 5793, +MINT_ICALLSIG_48444_4 = 6481, +MINT_ICALLSIG_48448_4 = 6497, +MINT_ICALLSIG_48484_4 = 6545, +MINT_ICALLSIG_48488_4 = 6561, +MINT_ICALLSIG_48844_4 = 6737, +MINT_ICALLSIG_48848_4 = 6753, +MINT_ICALLSIG_48884_4 = 6801, +MINT_ICALLSIG_48888_4 = 6817, +MINT_ICALLSIG_84444_4 = 9553, +MINT_ICALLSIG_84448_4 = 9569, +MINT_ICALLSIG_84484_4 = 9617, +MINT_ICALLSIG_84488_4 = 9633, +MINT_ICALLSIG_84844_4 = 9809, +MINT_ICALLSIG_84848_4 = 9825, +MINT_ICALLSIG_84884_4 = 9873, +MINT_ICALLSIG_84888_4 = 9889, +MINT_ICALLSIG_88444_4 = 10577, +MINT_ICALLSIG_88448_4 = 10593, +MINT_ICALLSIG_88484_4 = 10641, +MINT_ICALLSIG_88488_4 = 10657, +MINT_ICALLSIG_88844_4 = 10833, +MINT_ICALLSIG_88848_4 = 10849, +MINT_ICALLSIG_88884_4 = 10897, +MINT_ICALLSIG_88888_4 = 10913, +MINT_ICALLSIG_44444_8 = 5458, +MINT_ICALLSIG_44448_8 = 5474, +MINT_ICALLSIG_44484_8 = 5522, +MINT_ICALLSIG_44488_8 = 5538, +MINT_ICALLSIG_44844_8 = 5714, +MINT_ICALLSIG_44848_8 = 5730, +MINT_ICALLSIG_44884_8 = 5778, +MINT_ICALLSIG_44888_8 = 5794, +MINT_ICALLSIG_48444_8 = 6482, +MINT_ICALLSIG_48448_8 = 6498, +MINT_ICALLSIG_48484_8 = 6546, +MINT_ICALLSIG_48488_8 = 6562, +MINT_ICALLSIG_48844_8 = 6738, +MINT_ICALLSIG_48848_8 = 6754, +MINT_ICALLSIG_48884_8 = 6802, +MINT_ICALLSIG_48888_8 = 6818, +MINT_ICALLSIG_84444_8 = 9554, +MINT_ICALLSIG_84448_8 = 9570, +MINT_ICALLSIG_84484_8 = 9618, +MINT_ICALLSIG_84488_8 = 9634, +MINT_ICALLSIG_84844_8 = 9810, +MINT_ICALLSIG_84848_8 = 9826, +MINT_ICALLSIG_84884_8 = 9874, +MINT_ICALLSIG_84888_8 = 9890, +MINT_ICALLSIG_88444_8 = 10578, +MINT_ICALLSIG_88448_8 = 10594, +MINT_ICALLSIG_88484_8 = 10642, +MINT_ICALLSIG_88488_8 = 10658, +MINT_ICALLSIG_88844_8 = 10834, +MINT_ICALLSIG_88848_8 = 10850, +MINT_ICALLSIG_88884_8 = 10898, +MINT_ICALLSIG_88888_8 = 10914, +MINT_ICALLSIG_444444_V = 5460, +MINT_ICALLSIG_444448_V = 5464, +MINT_ICALLSIG_444484_V = 5476, +MINT_ICALLSIG_444488_V = 5480, +MINT_ICALLSIG_444844_V = 5524, +MINT_ICALLSIG_444848_V = 5528, +MINT_ICALLSIG_444884_V = 5540, +MINT_ICALLSIG_444888_V = 5544, +MINT_ICALLSIG_448444_V = 5716, +MINT_ICALLSIG_448448_V = 5720, +MINT_ICALLSIG_448484_V = 5732, +MINT_ICALLSIG_448488_V = 5736, +MINT_ICALLSIG_448844_V = 5780, +MINT_ICALLSIG_448848_V = 5784, +MINT_ICALLSIG_448884_V = 5796, +MINT_ICALLSIG_448888_V = 5800, +MINT_ICALLSIG_484444_V = 6484, +MINT_ICALLSIG_484448_V = 6488, +MINT_ICALLSIG_484484_V = 6500, +MINT_ICALLSIG_484488_V = 6504, +MINT_ICALLSIG_484844_V = 6548, +MINT_ICALLSIG_484848_V = 6552, +MINT_ICALLSIG_484884_V = 6564, +MINT_ICALLSIG_484888_V = 6568, +MINT_ICALLSIG_488444_V = 6740, +MINT_ICALLSIG_488448_V = 6744, +MINT_ICALLSIG_488484_V = 6756, +MINT_ICALLSIG_488488_V = 6760, +MINT_ICALLSIG_488844_V = 6804, +MINT_ICALLSIG_488848_V = 6808, +MINT_ICALLSIG_488884_V = 6820, +MINT_ICALLSIG_488888_V = 6824, +MINT_ICALLSIG_844444_V = 9556, +MINT_ICALLSIG_844448_V = 9560, +MINT_ICALLSIG_844484_V = 9572, +MINT_ICALLSIG_844488_V = 9576, +MINT_ICALLSIG_844844_V = 9620, +MINT_ICALLSIG_844848_V = 9624, +MINT_ICALLSIG_844884_V = 9636, +MINT_ICALLSIG_844888_V = 9640, +MINT_ICALLSIG_848444_V = 9812, +MINT_ICALLSIG_848448_V = 9816, +MINT_ICALLSIG_848484_V = 9828, +MINT_ICALLSIG_848488_V = 9832, +MINT_ICALLSIG_848844_V = 9876, +MINT_ICALLSIG_848848_V = 9880, +MINT_ICALLSIG_848884_V = 9892, +MINT_ICALLSIG_848888_V = 9896, +MINT_ICALLSIG_884444_V = 10580, +MINT_ICALLSIG_884448_V = 10584, +MINT_ICALLSIG_884484_V = 10596, +MINT_ICALLSIG_884488_V = 10600, +MINT_ICALLSIG_884844_V = 10644, +MINT_ICALLSIG_884848_V = 10648, +MINT_ICALLSIG_884884_V = 10660, +MINT_ICALLSIG_884888_V = 10664, +MINT_ICALLSIG_888444_V = 10836, +MINT_ICALLSIG_888448_V = 10840, +MINT_ICALLSIG_888484_V = 10852, +MINT_ICALLSIG_888488_V = 10856, +MINT_ICALLSIG_888844_V = 10900, +MINT_ICALLSIG_888848_V = 10904, +MINT_ICALLSIG_888884_V = 10916, +MINT_ICALLSIG_888888_V = 10920, +MINT_ICALLSIG_444444_4 = 5461, +MINT_ICALLSIG_444448_4 = 5465, +MINT_ICALLSIG_444484_4 = 5477, +MINT_ICALLSIG_444488_4 = 5481, +MINT_ICALLSIG_444844_4 = 5525, +MINT_ICALLSIG_444848_4 = 5529, +MINT_ICALLSIG_444884_4 = 5541, +MINT_ICALLSIG_444888_4 = 5545, +MINT_ICALLSIG_448444_4 = 5717, +MINT_ICALLSIG_448448_4 = 5721, +MINT_ICALLSIG_448484_4 = 5733, +MINT_ICALLSIG_448488_4 = 5737, +MINT_ICALLSIG_448844_4 = 5781, +MINT_ICALLSIG_448848_4 = 5785, +MINT_ICALLSIG_448884_4 = 5797, +MINT_ICALLSIG_448888_4 = 5801, +MINT_ICALLSIG_484444_4 = 6485, +MINT_ICALLSIG_484448_4 = 6489, +MINT_ICALLSIG_484484_4 = 6501, +MINT_ICALLSIG_484488_4 = 6505, +MINT_ICALLSIG_484844_4 = 6549, +MINT_ICALLSIG_484848_4 = 6553, +MINT_ICALLSIG_484884_4 = 6565, +MINT_ICALLSIG_484888_4 = 6569, +MINT_ICALLSIG_488444_4 = 6741, +MINT_ICALLSIG_488448_4 = 6745, +MINT_ICALLSIG_488484_4 = 6757, +MINT_ICALLSIG_488488_4 = 6761, +MINT_ICALLSIG_488844_4 = 6805, +MINT_ICALLSIG_488848_4 = 6809, +MINT_ICALLSIG_488884_4 = 6821, +MINT_ICALLSIG_488888_4 = 6825, +MINT_ICALLSIG_844444_4 = 9557, +MINT_ICALLSIG_844448_4 = 9561, +MINT_ICALLSIG_844484_4 = 9573, +MINT_ICALLSIG_844488_4 = 9577, +MINT_ICALLSIG_844844_4 = 9621, +MINT_ICALLSIG_844848_4 = 9625, +MINT_ICALLSIG_844884_4 = 9637, +MINT_ICALLSIG_844888_4 = 9641, +MINT_ICALLSIG_848444_4 = 9813, +MINT_ICALLSIG_848448_4 = 9817, +MINT_ICALLSIG_848484_4 = 9829, +MINT_ICALLSIG_848488_4 = 9833, +MINT_ICALLSIG_848844_4 = 9877, +MINT_ICALLSIG_848848_4 = 9881, +MINT_ICALLSIG_848884_4 = 9893, +MINT_ICALLSIG_848888_4 = 9897, +MINT_ICALLSIG_884444_4 = 10581, +MINT_ICALLSIG_884448_4 = 10585, +MINT_ICALLSIG_884484_4 = 10597, +MINT_ICALLSIG_884488_4 = 10601, +MINT_ICALLSIG_884844_4 = 10645, +MINT_ICALLSIG_884848_4 = 10649, +MINT_ICALLSIG_884884_4 = 10661, +MINT_ICALLSIG_884888_4 = 10665, +MINT_ICALLSIG_888444_4 = 10837, +MINT_ICALLSIG_888448_4 = 10841, +MINT_ICALLSIG_888484_4 = 10853, +MINT_ICALLSIG_888488_4 = 10857, +MINT_ICALLSIG_888844_4 = 10901, +MINT_ICALLSIG_888848_4 = 10905, +MINT_ICALLSIG_888884_4 = 10917, +MINT_ICALLSIG_888888_4 = 10921, +MINT_ICALLSIG_444444_8 = 5462, +MINT_ICALLSIG_444448_8 = 5466, +MINT_ICALLSIG_444484_8 = 5478, +MINT_ICALLSIG_444488_8 = 5482, +MINT_ICALLSIG_444844_8 = 5526, +MINT_ICALLSIG_444848_8 = 5530, +MINT_ICALLSIG_444884_8 = 5542, +MINT_ICALLSIG_444888_8 = 5546, +MINT_ICALLSIG_448444_8 = 5718, +MINT_ICALLSIG_448448_8 = 5722, +MINT_ICALLSIG_448484_8 = 5734, +MINT_ICALLSIG_448488_8 = 5738, +MINT_ICALLSIG_448844_8 = 5782, +MINT_ICALLSIG_448848_8 = 5786, +MINT_ICALLSIG_448884_8 = 5798, +MINT_ICALLSIG_448888_8 = 5802, +MINT_ICALLSIG_484444_8 = 6486, +MINT_ICALLSIG_484448_8 = 6490, +MINT_ICALLSIG_484484_8 = 6502, +MINT_ICALLSIG_484488_8 = 6506, +MINT_ICALLSIG_484844_8 = 6550, +MINT_ICALLSIG_484848_8 = 6554, +MINT_ICALLSIG_484884_8 = 6566, +MINT_ICALLSIG_484888_8 = 6570, +MINT_ICALLSIG_488444_8 = 6742, +MINT_ICALLSIG_488448_8 = 6746, +MINT_ICALLSIG_488484_8 = 6758, +MINT_ICALLSIG_488488_8 = 6762, +MINT_ICALLSIG_488844_8 = 6806, +MINT_ICALLSIG_488848_8 = 6810, +MINT_ICALLSIG_488884_8 = 6822, +MINT_ICALLSIG_488888_8 = 6826, +MINT_ICALLSIG_844444_8 = 9558, +MINT_ICALLSIG_844448_8 = 9562, +MINT_ICALLSIG_844484_8 = 9574, +MINT_ICALLSIG_844488_8 = 9578, +MINT_ICALLSIG_844844_8 = 9622, +MINT_ICALLSIG_844848_8 = 9626, +MINT_ICALLSIG_844884_8 = 9638, +MINT_ICALLSIG_844888_8 = 9642, +MINT_ICALLSIG_848444_8 = 9814, +MINT_ICALLSIG_848448_8 = 9818, +MINT_ICALLSIG_848484_8 = 9830, +MINT_ICALLSIG_848488_8 = 9834, +MINT_ICALLSIG_848844_8 = 9878, +MINT_ICALLSIG_848848_8 = 9882, +MINT_ICALLSIG_848884_8 = 9894, +MINT_ICALLSIG_848888_8 = 9898, +MINT_ICALLSIG_884444_8 = 10582, +MINT_ICALLSIG_884448_8 = 10586, +MINT_ICALLSIG_884484_8 = 10598, +MINT_ICALLSIG_884488_8 = 10602, +MINT_ICALLSIG_884844_8 = 10646, +MINT_ICALLSIG_884848_8 = 10650, +MINT_ICALLSIG_884884_8 = 10662, +MINT_ICALLSIG_884888_8 = 10666, +MINT_ICALLSIG_888444_8 = 10838, +MINT_ICALLSIG_888448_8 = 10842, +MINT_ICALLSIG_888484_8 = 10854, +MINT_ICALLSIG_888488_8 = 10858, +MINT_ICALLSIG_888844_8 = 10902, +MINT_ICALLSIG_888848_8 = 10906, +MINT_ICALLSIG_888884_8 = 10918, +MINT_ICALLSIG_888888_8 = 10922, +} MintICallSig; +#endif diff --git a/src/mono/mono/mini/interp/mintops.h b/src/mono/mono/mini/interp/mintops.h index 5acc555b3a4eec..b688f511b906aa 100644 --- a/src/mono/mono/mini/interp/mintops.h +++ b/src/mono/mono/mini/interp/mintops.h @@ -245,23 +245,8 @@ typedef enum { #define MINT_MOV_PAIRS_MAX 4 -typedef enum { - MINT_ICALLSIG_V_V = 0, - MINT_ICALLSIG_V_P, - MINT_ICALLSIG_P_V, - MINT_ICALLSIG_P_P, - MINT_ICALLSIG_PP_V, - MINT_ICALLSIG_PP_P, - MINT_ICALLSIG_PPP_V, - MINT_ICALLSIG_PPP_P, - MINT_ICALLSIG_PPPP_V, - MINT_ICALLSIG_PPPP_P, - MINT_ICALLSIG_PPPPP_V, - MINT_ICALLSIG_PPPPP_P, - MINT_ICALLSIG_PPPPPP_V, - MINT_ICALLSIG_PPPPPP_P, - MINT_ICALLSIG_MAX -} MintICallSig; +#define MAX_SIG_PARAMS 6 +#include "mintSigs.h" extern unsigned char const mono_interp_oplen[]; extern int const mono_interp_op_dregs []; diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index 6edac39803f401..0f1eb97696594d 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -32,6 +32,7 @@ #include "mintops.h" #include "interp-internals.h" #include "interp.h" +#include "interp-icalls.h" #include "transform.h" #include "tiering.h" #include "interp-pgo.h" @@ -2817,104 +2818,118 @@ interp_type_as_ptr (MonoType *tp) return FALSE; } +static int +interp_ptr_size (MonoType *tp) +{ + if ((tp)->type == MONO_TYPE_BOOLEAN) + return 4; + if ((tp)->type == MONO_TYPE_CHAR) + return SIZEOF_VOID_P; + if ((tp)->type == MONO_TYPE_VALUETYPE && m_class_is_enumtype (m_type_data_get_klass_unchecked (tp))) + return 4; + if ((tp)->type == MONO_TYPE_I4) + return 4; + if (MONO_TYPE_IS_POINTER (tp)) + return SIZEOF_VOID_P; + if (MONO_TYPE_IS_REFERENCE (tp)) + return SIZEOF_VOID_P; +#if SIZEOF_VOID_P == 8 + if ((tp)->type == MONO_TYPE_I8 || (tp)->type == MONO_TYPE_U8) + return 8; +#endif + + if (is_scalar_vtype (tp)) + return SIZEOF_VOID_P; + MH_LOGV(MH_LVL_INFO, "Don't know what to do with type %s",mono_type_get_name (tp)); + g_assert_not_reached (); +} + #define INTERP_TYPE_AS_PTR(tp) interp_type_as_ptr (tp) +#define DEBUG_ENCODE_SIGNATURE 1 +#define ENCODE_4BYTE 0b01 +#define ENCODE_8BYTE 0b10 + +/* encode with first parameter always shifted left 12 bits */ +static uint16_t encode_signature(const int* params, int param_count, int return_type) { + uint16_t encoded = 0; + // parameters must be either 4 or 8. No params implcitly encodes V + for (int i = 0; i < param_count && i < MAX_SIG_PARAMS; ++i) { + + uint16_t code = (params[i] == SIG_PARAM_4B) ? ENCODE_4BYTE : ENCODE_8BYTE; + encoded |= (code << (2 * (MAX_SIG_PARAMS - i))); + } + + // Encode return type in the last 2 bits + uint16_t ret_code = (return_type == SIG_PARAM_4B) ? ENCODE_4BYTE : (return_type == SIG_PARAM_8B) ? ENCODE_8BYTE : SIG_PARAM_VOID; + encoded |= ret_code; + #ifdef DEBUG_ENCODE_SIGNATURE + { + // 1 elements per param + 2 for _return type + 1 for null terminator + char buff[MAX_SIG_PARAMS + 3] = {}; + int offset =0; + for (int i = 0; i < param_count; i++) + sprintf(buff + i, "%d", params[i]); + if (!param_count) + offset = sprintf(buff, "V"); + + if( return_type) + sprintf(buff + param_count + offset, "_%d", return_type); + else + sprintf(buff + param_count + offset, "_V"); + + MH_LOGV(MH_LVL_TRACE, "Encoded signature %s as %d", buff, encoded); + } + #endif + return encoded; +} +static +void decode_signature(uint16_t encoded, int* params_out, int* param_count_out, int* return_type_out) { + int count = 0; + + for (int i = 0; i < MAX_SIG_PARAMS; ++i) { + uint16_t code = (encoded >> (2 * (MAX_SIG_PARAMS - i))) & 0b11; + if (code == ENCODE_4BYTE) { + params_out[count++] = 4; + } + else if (code == ENCODE_8BYTE) { + params_out[count++] = 8; + } + else { + break; // Stop at first unused param + } + } + + *param_count_out = count; + + uint16_t ret_code = encoded & 0b11; + if (ret_code == ENCODE_4BYTE) { + *return_type_out = 4; + } + else if (ret_code == ENCODE_8BYTE) { + *return_type_out = 8; + } + else { + *return_type_out = 0; + } +} + +#define GET_PARAM_SIZE(tp) (interp_type_as_ptr8(tp) ? SIG_PARAM_8B : interp_type_as_ptr4(tp) ? SIG_PARAM_4B : SIG_PARAM_VOID) static MintICallSig interp_get_icall_sig (MonoMethodSignature *sig) { MintICallSig op = MINT_ICALLSIG_MAX; - switch (sig->param_count) { - case 0: - if (MONO_TYPE_IS_VOID (sig->ret)) - op = MINT_ICALLSIG_V_V; - else if (INTERP_TYPE_AS_PTR (sig->ret)) - op = MINT_ICALLSIG_V_P; - break; - case 1: - if (MONO_TYPE_IS_VOID (sig->ret)) { - if (INTERP_TYPE_AS_PTR (sig->params [0])) - op = MINT_ICALLSIG_P_V; - } else if (INTERP_TYPE_AS_PTR (sig->ret)) { - if (INTERP_TYPE_AS_PTR (sig->params [0])) - op = MINT_ICALLSIG_P_P; - } - break; - case 2: - if (MONO_TYPE_IS_VOID (sig->ret)) { - if (INTERP_TYPE_AS_PTR (sig->params [0]) && - INTERP_TYPE_AS_PTR (sig->params [1])) - op = MINT_ICALLSIG_PP_V; - } else if (INTERP_TYPE_AS_PTR (sig->ret)) { - if (INTERP_TYPE_AS_PTR (sig->params [0]) && - INTERP_TYPE_AS_PTR (sig->params [1])) - op = MINT_ICALLSIG_PP_P; - } - break; - case 3: - if (MONO_TYPE_IS_VOID (sig->ret)) { - if (INTERP_TYPE_AS_PTR (sig->params [0]) && - INTERP_TYPE_AS_PTR (sig->params [1]) && - INTERP_TYPE_AS_PTR (sig->params [2])) - op = MINT_ICALLSIG_PPP_V; - } else if (INTERP_TYPE_AS_PTR (sig->ret)) { - if (INTERP_TYPE_AS_PTR (sig->params [0]) && - INTERP_TYPE_AS_PTR (sig->params [1]) && - INTERP_TYPE_AS_PTR (sig->params [2])) - op = MINT_ICALLSIG_PPP_P; - } - break; - case 4: - if (MONO_TYPE_IS_VOID (sig->ret)) { - if (INTERP_TYPE_AS_PTR (sig->params [0]) && - INTERP_TYPE_AS_PTR (sig->params [1]) && - INTERP_TYPE_AS_PTR (sig->params [2]) && - INTERP_TYPE_AS_PTR (sig->params [3])) - op = MINT_ICALLSIG_PPPP_V; - } else if (INTERP_TYPE_AS_PTR (sig->ret)) { - if (INTERP_TYPE_AS_PTR (sig->params [0]) && - INTERP_TYPE_AS_PTR (sig->params [1]) && - INTERP_TYPE_AS_PTR (sig->params [2]) && - INTERP_TYPE_AS_PTR (sig->params [3])) - op = MINT_ICALLSIG_PPPP_P; - } - break; - case 5: - if (MONO_TYPE_IS_VOID (sig->ret)) { - if (INTERP_TYPE_AS_PTR (sig->params [0]) && - INTERP_TYPE_AS_PTR (sig->params [1]) && - INTERP_TYPE_AS_PTR (sig->params [2]) && - INTERP_TYPE_AS_PTR (sig->params [3]) && - INTERP_TYPE_AS_PTR (sig->params [4])) - op = MINT_ICALLSIG_PPPPP_V; - } else if (INTERP_TYPE_AS_PTR (sig->ret)) { - if (INTERP_TYPE_AS_PTR (sig->params [0]) && - INTERP_TYPE_AS_PTR (sig->params [1]) && - INTERP_TYPE_AS_PTR (sig->params [2]) && - INTERP_TYPE_AS_PTR (sig->params [3]) && - INTERP_TYPE_AS_PTR (sig->params [4])) - op = MINT_ICALLSIG_PPPPP_P; - } - break; - case 6: - if (MONO_TYPE_IS_VOID (sig->ret)) { - if (INTERP_TYPE_AS_PTR (sig->params [0]) && - INTERP_TYPE_AS_PTR (sig->params [1]) && - INTERP_TYPE_AS_PTR (sig->params [2]) && - INTERP_TYPE_AS_PTR (sig->params [3]) && - INTERP_TYPE_AS_PTR (sig->params [4]) && - INTERP_TYPE_AS_PTR (sig->params [5])) - op = MINT_ICALLSIG_PPPPPP_V; - } else if (INTERP_TYPE_AS_PTR (sig->ret)) { - if (INTERP_TYPE_AS_PTR (sig->params [0]) && - INTERP_TYPE_AS_PTR (sig->params [1]) && - INTERP_TYPE_AS_PTR (sig->params [2]) && - INTERP_TYPE_AS_PTR (sig->params [3]) && - INTERP_TYPE_AS_PTR (sig->params [4]) && - INTERP_TYPE_AS_PTR (sig->params [5])) - op = MINT_ICALLSIG_PPPPPP_P; - } - break; - } + int params[MAX_SIG_PARAMS]; + MH_LOGV(MH_LVL_TRACE, "Getting icall sig for method with %d params", sig->param_count); + for (int i = 0; i < sig->param_count && i < MAX_SIG_PARAMS; ++i) { + MonoType *tp = sig->params[i]; + params[i] = GET_PARAM_SIZE(tp); + MH_LOGV(MH_LVL_TRACE, "Type %s encoded as %d", mono_type_get_name(tp), params[i]); + } + // returnType of 0 == void + int returnType = GET_PARAM_SIZE(sig->ret); + MH_LOGV(MH_LVL_TRACE, "return type %s encoded as %d", mono_type_get_name(sig->ret), returnType); + op = encode_signature(params, sig->param_count, returnType); return op; } From 8101e946981b28d9b215581abf6dbbf18b397270 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 8 Sep 2025 20:14:25 +0100 Subject: [PATCH 166/209] Remove unused method --- src/mono/mono/mini/interp/transform.c | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index 0f1eb97696594d..5d511ea8919b8b 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -2818,32 +2818,6 @@ interp_type_as_ptr (MonoType *tp) return FALSE; } -static int -interp_ptr_size (MonoType *tp) -{ - if ((tp)->type == MONO_TYPE_BOOLEAN) - return 4; - if ((tp)->type == MONO_TYPE_CHAR) - return SIZEOF_VOID_P; - if ((tp)->type == MONO_TYPE_VALUETYPE && m_class_is_enumtype (m_type_data_get_klass_unchecked (tp))) - return 4; - if ((tp)->type == MONO_TYPE_I4) - return 4; - if (MONO_TYPE_IS_POINTER (tp)) - return SIZEOF_VOID_P; - if (MONO_TYPE_IS_REFERENCE (tp)) - return SIZEOF_VOID_P; -#if SIZEOF_VOID_P == 8 - if ((tp)->type == MONO_TYPE_I8 || (tp)->type == MONO_TYPE_U8) - return 8; -#endif - - if (is_scalar_vtype (tp)) - return SIZEOF_VOID_P; - MH_LOGV(MH_LVL_INFO, "Don't know what to do with type %s",mono_type_get_name (tp)); - g_assert_not_reached (); -} - #define INTERP_TYPE_AS_PTR(tp) interp_type_as_ptr (tp) #define DEBUG_ENCODE_SIGNATURE 1 #define ENCODE_4BYTE 0b01 From 14d956d784bbdef64420d338fa46f053fbe465d2 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 9 Sep 2025 10:54:40 +0100 Subject: [PATCH 167/209] Use the start address in subarray --- src/mono/browser/runtime/crypto.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/browser/runtime/crypto.ts b/src/mono/browser/runtime/crypto.ts index 24606cf075c9d1..64c90bf752b92b 100644 --- a/src/mono/browser/runtime/crypto.ts +++ b/src/mono/browser/runtime/crypto.ts @@ -17,7 +17,7 @@ export function mono_wasm_browser_entropy (bufferPtr: number, bufferLength: numb const end = BigInt(bufferPtr) + BigInt(bufferLength); targetView = memoryView.subarray(Number(start), Number(end)); } else { - targetView = memoryView.subarray(bufferPtr + bufferLength); + targetView = memoryView.subarray(bufferPtr, bufferPtr + bufferLength); } // When threading is enabled, Chrome doesn't want SharedArrayBuffer to be passed to crypto APIs From 58fcb3e74ec02b059df047f1bcda59f4bc1654ca Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 11 Sep 2025 10:34:02 +0100 Subject: [PATCH 168/209] Replace section of interp.c that was somehow deleted --- src/mono/mono/mini/interp/interp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index acf15966cc3265..3b0a413a941a77 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -6176,7 +6176,13 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; MINT_IN_CASE(MINT_STFLD_I8) STFLD(gint64, gint64); MINT_IN_BREAK; MINT_IN_CASE(MINT_STFLD_R4) STFLD(float, float); MINT_IN_BREAK; MINT_IN_CASE(MINT_STFLD_R8) STFLD(double, double); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STFLD_O) + MINT_IN_CASE(MINT_STFLD_O) { + MonoObject *o = LOCAL_VAR (ip [1], MonoObject*); + NULL_CHECK (o); + mono_gc_wbarrier_set_field_internal (o, (char*)o + ip [3], LOCAL_VAR (ip [2], MonoObject*)); + ip += 4; + MINT_IN_BREAK; + } MINT_IN_CASE(MINT_STFLD_I8_UNALIGNED) STFLD_UNALIGNED(gint64, gint64, TRUE); MINT_IN_BREAK; MINT_IN_CASE(MINT_STFLD_R8_UNALIGNED) STFLD_UNALIGNED(double, double, TRUE); MINT_IN_BREAK; From 6456389be5cae7538bfa7e3d47713fe74f504faa Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 11 Sep 2025 10:50:26 +0100 Subject: [PATCH 169/209] logging --- .../System.Runtime.InteropServices.JavaScript.Tests.csproj | 1 + src/mono/sample/wasm/browser-test-debug/main.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj index c000f916e5ba29..0da87fd1094b9b 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj @@ -7,6 +7,7 @@ true true $(WasmXHarnessArgs) --engine-arg=--expose-gc --web-server-use-cop + --setenv=MH_LOG_VERBOSITY=6 true true true diff --git a/src/mono/sample/wasm/browser-test-debug/main.js b/src/mono/sample/wasm/browser-test-debug/main.js index 9ae9a0864c7573..fbbe9bd7808301 100644 --- a/src/mono/sample/wasm/browser-test-debug/main.js +++ b/src/mono/sample/wasm/browser-test-debug/main.js @@ -55,7 +55,7 @@ try { config.environmentVariables["MONO_LOG_MASK"] = "gc"; config.environmentVariables["MONO_GC_DEBUG"] = "8:gc_log.txt,print-gchandles,clear-nursery-at-gc"; // 1 or lower = None, 2 = info, 3 = debug, 4 = verbose, 5 = trace - config.environmentVariables["MH_LOG_VERBOSITY"] = "1"; + config.environmentVariables["MH_LOG_VERBOSITY"] = "5"; }, preInit: () => { console.log('user code Module.preInit'); }, preRun: () => { console.log('user code Module.preRun'); }, From 69df26a480f53bc9621793d8c62af240c15caac3 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 11 Sep 2025 10:34:02 +0100 Subject: [PATCH 170/209] Replace section of interp.c that was somehow deleted --- src/mono/mono/mini/interp/interp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index e86e92c8abc58b..b44e0052627f10 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -6176,7 +6176,13 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; MINT_IN_CASE(MINT_STFLD_I8) STFLD(gint64, gint64); MINT_IN_BREAK; MINT_IN_CASE(MINT_STFLD_R4) STFLD(float, float); MINT_IN_BREAK; MINT_IN_CASE(MINT_STFLD_R8) STFLD(double, double); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STFLD_O) + MINT_IN_CASE(MINT_STFLD_O) { + MonoObject *o = LOCAL_VAR (ip [1], MonoObject*); + NULL_CHECK (o); + mono_gc_wbarrier_set_field_internal (o, (char*)o + ip [3], LOCAL_VAR (ip [2], MonoObject*)); + ip += 4; + MINT_IN_BREAK; + } MINT_IN_CASE(MINT_STFLD_I8_UNALIGNED) STFLD_UNALIGNED(gint64, gint64, TRUE); MINT_IN_BREAK; MINT_IN_CASE(MINT_STFLD_R8_UNALIGNED) STFLD_UNALIGNED(double, double, TRUE); MINT_IN_BREAK; From 78ffd5123820ae3a28dff07510f2d87d76eda179 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 9 Sep 2025 10:54:40 +0100 Subject: [PATCH 171/209] Use the start address in subarray --- src/mono/browser/runtime/crypto.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/browser/runtime/crypto.ts b/src/mono/browser/runtime/crypto.ts index 24606cf075c9d1..64c90bf752b92b 100644 --- a/src/mono/browser/runtime/crypto.ts +++ b/src/mono/browser/runtime/crypto.ts @@ -17,7 +17,7 @@ export function mono_wasm_browser_entropy (bufferPtr: number, bufferLength: numb const end = BigInt(bufferPtr) + BigInt(bufferLength); targetView = memoryView.subarray(Number(start), Number(end)); } else { - targetView = memoryView.subarray(bufferPtr + bufferLength); + targetView = memoryView.subarray(bufferPtr, bufferPtr + bufferLength); } // When threading is enabled, Chrome doesn't want SharedArrayBuffer to be passed to crypto APIs From c9b9ac6d3f6234cfbe032ab01c5fc8a40b873d79 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 11 Sep 2025 14:46:36 +0100 Subject: [PATCH 172/209] Turn off MH_LOG output --- src/libraries/System.Memory/tests/System.Memory.Tests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/System.Memory/tests/System.Memory.Tests.csproj b/src/libraries/System.Memory/tests/System.Memory.Tests.csproj index 2de051c81fbdba..2b5c56ebd64306 100644 --- a/src/libraries/System.Memory/tests/System.Memory.Tests.csproj +++ b/src/libraries/System.Memory/tests/System.Memory.Tests.csproj @@ -4,6 +4,7 @@ true true $(NetCoreAppCurrent) + --setenv=MH_LOG_VERBOSITY=0 From 965c465352876d6ea423eb1b5a1545e7be9e7556 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 11 Sep 2025 18:06:44 +0100 Subject: [PATCH 173/209] Amend icall logic. resolve string marshalling but breaking interop tests some test code here to verify against original behaviour of interp_type_as_ptr. --- ...ystem.Runtime.InteropServices.Tests.csproj | 2 +- src/mono/browser/runtime/marshal.ts | 2 +- src/mono/mono/mini/interp/interp-icalls.c | 19 +-- src/mono/mono/mini/interp/interp-icalls.h | 1 + src/mono/mono/mini/interp/interp.c | 3 +- src/mono/mono/mini/interp/transform.c | 125 ++++++++++++++---- 6 files changed, 113 insertions(+), 39 deletions(-) diff --git a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj index b68856f60f062c..ee73d2dd11180d 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj @@ -4,7 +4,7 @@ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetCoreAppCurrent)-browser true true - --setenv=MH_LOG_VERBOSITY=0 + --setenv=MH_LOG_VERBOSITY=4 diff --git a/src/mono/browser/runtime/marshal.ts b/src/mono/browser/runtime/marshal.ts index 1906539df933f8..3f3d29cc15c562 100644 --- a/src/mono/browser/runtime/marshal.ts +++ b/src/mono/browser/runtime/marshal.ts @@ -21,7 +21,7 @@ export const bound_cs_function_symbol = Symbol.for("wasm bound_cs_function"); export const bound_js_function_symbol = Symbol.for("wasm bound_js_function"); export const imported_js_function_symbol = Symbol.for("wasm imported_js_function"); export const proxy_debug_symbol = Symbol.for("wasm proxy_debug"); -export const JavaScriptMarshalerArgSize = isWasm64 ? 64 : 32; +export const JavaScriptMarshalerArgSize = 64; // keep in sync with JSMarshalerArgumentImpl offsets const enum JSMarshalerArgumentOffsets { diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index 6200cb3154256f..1f8b10681aeb68 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -7,6 +7,12 @@ typedef gpointer I8; gboolean is_scalar_vtype(MonoType* tp); +gboolean +interp_type_as_ptr (MonoType *tp) +{ + return (interp_type_as_ptr8(tp) || interp_type_as_ptr4(tp)); +} + gboolean interp_type_as_ptr4 (MonoType *tp) { @@ -42,20 +48,17 @@ interp_type_as_ptr8 (MonoType *tp) if (MONO_TYPE_IS_REFERENCE (tp)) return TRUE; if ((tp)->type == MONO_TYPE_I8 || (tp)->type == MONO_TYPE_U8) - return TRUE; + return TRUE; if ((tp)->type == MONO_TYPE_R8) - return TRUE; + return TRUE; // return true for value types that are NOT enums - if ((tp)->type == MONO_TYPE_VALUETYPE && !m_class_is_enumtype (m_type_data_get_klass_unchecked (tp))) + //if ((tp)->type == MONO_TYPE_VALUETYPE && !m_class_is_enumtype (m_type_data_get_klass_unchecked (tp))) + // return TRUE; + if (is_scalar_vtype (tp)) return TRUE; return FALSE; } -static gboolean -interp_type_as_ptr(MonoType *tp) -{ - return (interp_type_as_ptr4(tp) || interp_type_as_ptr8(tp)); -} /* is_scalar_vtype taken from transform.c */ gboolean is_scalar_vtype (MonoType *type) diff --git a/src/mono/mono/mini/interp/interp-icalls.h b/src/mono/mono/mini/interp/interp-icalls.h index 7a4c461895ab86..53c6b9869362f6 100644 --- a/src/mono/mono/mini/interp/interp-icalls.h +++ b/src/mono/mono/mini/interp/interp-icalls.h @@ -7,6 +7,7 @@ #include "interp-internals.h" extern void stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean pinvoke); extern void do_icall(MonoMethodSignature * sig, MintICallSig op, stackval * ret_sp, stackval * sp, gpointer ptr, gboolean save_last_error); +extern gboolean interp_type_as_ptr (MonoType *tp); extern gboolean interp_type_as_ptr4 (MonoType *tp); extern gboolean interp_type_as_ptr8 (MonoType *tp); #endif diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index 3b0a413a941a77..f6a6c421f684c3 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -6447,8 +6447,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; MINT_IN_BREAK; } MINT_IN_CASE(MINT_GETCHR) { - MonoString *s = LOCAL_VAR (ip [2], MonoString*); - MH_LOGV(MH_LVL_VERBOSE, "MINT_GETCHR, %p", s); + MonoString *s = LOCAL_VAR (ip [2], MonoString*); NULL_CHECK (s); int i32 = LOCAL_VAR (ip [3], int); if (i32 < 0 || i32 >= mono_string_length_internal (s)) diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index 5d511ea8919b8b..2fbb2114222f3d 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -2757,9 +2757,6 @@ interp_transform_internal_calls (MonoMethod *method, MonoMethod *target_method, return target_method; } -static gboolean -interp_type_as_ptr (MonoType *tp); - /* Return whenever TYPE represents a vtype with only one scalar member */ static gboolean is_scalar_vtype (MonoType *type) @@ -2793,29 +2790,40 @@ is_scalar_vtype (MonoType *type) return TRUE; } +static gboolean +interp_type_as_ptr_test (MonoType *tp) ; static gboolean -interp_type_as_ptr (MonoType *tp) +is_scalar_vtype_test(MonoType *type) { - if (MONO_TYPE_IS_POINTER (tp)) - return TRUE; - if (MONO_TYPE_IS_REFERENCE (tp)) - return TRUE; - if ((tp)->type == MONO_TYPE_I4) - return TRUE; -#if SIZEOF_VOID_P == 8 - if ((tp)->type == MONO_TYPE_I8 || (tp)->type == MONO_TYPE_U8) - return TRUE; -#endif - if ((tp)->type == MONO_TYPE_BOOLEAN) - return TRUE; - if ((tp)->type == MONO_TYPE_CHAR) - return TRUE; - if ((tp)->type == MONO_TYPE_VALUETYPE && m_class_is_enumtype (m_type_data_get_klass_unchecked (tp))) - return TRUE; - if (is_scalar_vtype (tp)) - return TRUE; - return FALSE; + MonoClass *klass; + MonoClassField *field; + gpointer iter; + + if (!MONO_TYPE_ISSTRUCT (type)) + return FALSE; + klass = mono_class_from_mono_type_internal (type); + mono_class_init_internal (klass); + + int size = mono_class_value_size (klass, NULL); + if (size == 0 || size > SIZEOF_VOID_P) + return FALSE; + + iter = NULL; + int nfields = 0; + field = NULL; + while ((field = mono_class_get_fields_internal (klass, &iter))) { + if (field->type->attrs & FIELD_ATTRIBUTE_STATIC) + continue; + nfields ++; + if (nfields > 1) + return FALSE; + MonoType *t = mini_get_underlying_type (field->type); + if (!interp_type_as_ptr_test (t)) + return FALSE; + } + + return TRUE; } #define INTERP_TYPE_AS_PTR(tp) interp_type_as_ptr (tp) @@ -2827,8 +2835,10 @@ interp_type_as_ptr (MonoType *tp) static uint16_t encode_signature(const int* params, int param_count, int return_type) { uint16_t encoded = 0; // parameters must be either 4 or 8. No params implcitly encodes V + // a zero in any position here means the type is not a pointer type and not suitable for icalls for (int i = 0; i < param_count && i < MAX_SIG_PARAMS; ++i) { - + if (!(params[i])) + return MINT_ICALLSIG_MAX; uint16_t code = (params[i] == SIG_PARAM_4B) ? ENCODE_4BYTE : ENCODE_8BYTE; encoded |= (code << (2 * (MAX_SIG_PARAMS - i))); } @@ -2851,7 +2861,7 @@ static uint16_t encode_signature(const int* params, int param_count, int return_ else sprintf(buff + param_count + offset, "_V"); - MH_LOGV(MH_LVL_TRACE, "Encoded signature %s as %d", buff, encoded); + MH_LOGV(MH_LVL_VERBOSE, "Encoded signature %s as %d", buff, encoded); } #endif return encoded; @@ -2889,6 +2899,56 @@ void decode_signature(uint16_t encoded, int* params_out, int* param_count_out, i #define GET_PARAM_SIZE(tp) (interp_type_as_ptr8(tp) ? SIG_PARAM_8B : interp_type_as_ptr4(tp) ? SIG_PARAM_4B : SIG_PARAM_VOID) +gboolean +interp_type_as_ptr_test (MonoType *tp) +{ + if (MONO_TYPE_IS_POINTER (tp)) { + MH_LOGV(MH_LVL_TRACE, "MONO_TYPE_IS_POINTER evaluated true"); + return TRUE; + } + if (MONO_TYPE_IS_REFERENCE (tp)) { + MH_LOGV(MH_LVL_TRACE, "MONO_TYPE_IS_REFERENCE evaluated true"); + return TRUE; + } + if ((tp)->type == MONO_TYPE_I4) { + MH_LOGV(MH_LVL_TRACE, "tp->type == MONO_TYPE_I4 evaluated true"); + return TRUE; + } +#if SIZEOF_VOID_P == 8 + if ((tp)->type == MONO_TYPE_I8 || (tp)->type == MONO_TYPE_U8) { + MH_LOGV(MH_LVL_TRACE, "tp->type == MONO_TYPE_I8 or tp->type == MONO_TYPE_U8 evaluated true"); + return TRUE; + } +#endif + if ((tp)->type == MONO_TYPE_BOOLEAN) { + MH_LOGV(MH_LVL_TRACE, "tp->type == MONO_TYPE_BOOLEAN evaluated true"); + return TRUE; + } + if ((tp)->type == MONO_TYPE_CHAR) { + MH_LOGV(MH_LVL_TRACE, "tp->type == MONO_TYPE_CHAR evaluated true"); + return TRUE; + } + if ((tp)->type == MONO_TYPE_VALUETYPE && m_class_is_enumtype (m_type_data_get_klass_unchecked (tp))) { + MH_LOGV(MH_LVL_TRACE, "tp->type == MONO_TYPE_VALUETYPE and m_class_is_enumtype() evaluated true"); + return TRUE; + } + if (is_scalar_vtype (tp)) { + MH_LOGV(MH_LVL_TRACE, "is_scalar_vtype(tp) evaluated true"); + return TRUE; + } + else + MH_LOGV(MH_LVL_TRACE, "is_scalar_vtype(tp) evaluated false"); + + if (is_scalar_vtype_test (tp)) { + MH_LOGV(MH_LVL_TRACE, "is_scalar_vtype_test(tp) evaluated true"); + return TRUE; + } + else + MH_LOGV(MH_LVL_TRACE, "is_scalar_vtype_test(tp) evaluated false"); + + return FALSE; +} + static MintICallSig interp_get_icall_sig (MonoMethodSignature *sig) { @@ -2897,8 +2957,19 @@ interp_get_icall_sig (MonoMethodSignature *sig) MH_LOGV(MH_LVL_TRACE, "Getting icall sig for method with %d params", sig->param_count); for (int i = 0; i < sig->param_count && i < MAX_SIG_PARAMS; ++i) { MonoType *tp = sig->params[i]; - params[i] = GET_PARAM_SIZE(tp); - MH_LOGV(MH_LVL_TRACE, "Type %s encoded as %d", mono_type_get_name(tp), params[i]); + params[i] = GET_PARAM_SIZE(tp); + if (params[i] == 0) // this is ok but check logic against old method + { + MH_LOGV(MH_LVL_TRACE, "Type %s encoded as %d. tp->type value is %d. Will check against old method", mono_type_get_name(tp), params[i], tp->type); + gboolean isPtrOld = interp_type_as_ptr_test(tp); + if (isPtrOld) + { + // error + assert(0 && "interp_get_icall_sig: type_as_ptr mismatch between old and new method"); + } + else + return MINT_ICALLSIG_MAX; // not a pointer type - double check + } } // returnType of 0 == void int returnType = GET_PARAM_SIZE(sig->ret); From 73d2a3a01ee648229fc4c6be647c029c367d27f5 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 12 Sep 2025 16:37:27 +0100 Subject: [PATCH 174/209] More logging --- src/mono/browser/runtime/runtime.c | 5 +++-- src/mono/mono/metadata/icall.c | 9 +++++++-- src/mono/mono/mini/interp/interp.c | 2 +- src/mono/mono/mini/interp/transform.c | 4 +++- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/mono/browser/runtime/runtime.c b/src/mono/browser/runtime/runtime.c index b8009ba68452c7..651683602a98a9 100644 --- a/src/mono/browser/runtime/runtime.c +++ b/src/mono/browser/runtime/runtime.c @@ -153,6 +153,7 @@ icall_table_lookup (MonoMethod *method, char *classname, char *methodname, char void *p = bsearch (&token_idx, indexes, indexes_size, 4, compare_int); if (!p) { + MH_LOGV(MH_LVL_INFO, "wasm: Unable to lookup icall: %s (%s)\n", methodname, mono_method_get_name (method)); return NULL; printf ("wasm: Unable to lookup icall: %s\n", mono_method_get_name (method)); exit (1); @@ -160,7 +161,7 @@ icall_table_lookup (MonoMethod *method, char *classname, char *methodname, char uint32_t idx = (int*)p - indexes; *out_flags = flags [idx]; - + MH_LOGV(MH_LVL_TRACE, "Will ICALL: %s %x %d %d\n", methodname, token, idx, (int)(funcs [idx])); //printf ("ICALL: %s %x %d %d\n", methodname, token, idx, (int)(funcs [idx])); return funcs [idx]; @@ -350,7 +351,7 @@ mono_wasm_load_runtime_common (int debug_level, MonoLogCallback log_callback, co #endif init_icall_table (); - #undef CHECK_SYMBOL_LOOKUP + #define CHECK_SYMBOL_LOOKUP #ifdef CHECK_SYMBOL_LOOKUP { printf("Checking mono_lookup_icall_symbol_internal\n"); diff --git a/src/mono/mono/metadata/icall.c b/src/mono/mono/metadata/icall.c index 9bf02e511bb7c3..1ed73e42148601 100644 --- a/src/mono/mono/metadata/icall.c +++ b/src/mono/mono/metadata/icall.c @@ -7053,13 +7053,14 @@ mono_lookup_internal_call_full_with_flags (MonoMethod *method, gboolean warn_on_ mono_icall_lock (); locked = TRUE; - + MH_LOGV(MH_LVL_TRACE, "Looking for method with sig %s", mname); res = g_hash_table_lookup (icall_hash, mname); if (res) { MonoIcallHashTableValue *value = (MonoIcallHashTableValue *)res; if (flags) *flags = value->flags; res = value->method; + MH_LOGV(MH_LVL_TRACE, "Found %p", value->method); goto exit; } @@ -7088,8 +7089,10 @@ mono_lookup_internal_call_full_with_flags (MonoMethod *method, gboolean warn_on_ locked = FALSE; if (res) + { + MH_LOGV(MH_LVL_TRACE, "Found method in icall_table"); goto exit; - + } if (warn_on_missing) { g_warning ("cant resolve internal call to \"%s\" (tested without signature also)", mname); g_print ("\nYour mono runtime and class libraries are out of sync.\n"); @@ -7130,6 +7133,8 @@ mono_lookup_internal_call_full (MonoMethod *method, gboolean warn_on_missing, mo *foreign = FALSE; guint32 flags = MONO_ICALL_FLAGS_NONE; + MH_LOGV(MH_LVL_TRACE, "mono_lookup_internal_call_full: Looking up %s\n", method->name); + gconstpointer addr = mono_lookup_internal_call_full_with_flags (method, warn_on_missing, &flags); if (uses_handles && (flags & MONO_ICALL_FLAGS_USES_HANDLES)) diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index f6a6c421f684c3..53560733cd91be 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -4192,7 +4192,7 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause frame->state.ip = ip + 8; if (imethod->method) - MH_LOG ("Calling native method %s with signature %s\n", mono_method_full_name (imethod->method, TRUE), mono_signature_full_name (csignature)); + MH_LOG ("Calling native method %s with signature %s", mono_method_full_name (imethod->method, TRUE), mono_signature_full_name (csignature)); ves_pinvoke_method (imethod, csignature, (MonoFuncV)code, context, frame, (stackval*)(locals + ip [1]), (stackval*)(locals + ip [3]), save_last_error, cache, &gc_transitions); EXCEPTION_CHECKPOINT; CHECK_RESUME_STATE (context); diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index 2fbb2114222f3d..cef3300de2ff8a 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -2961,7 +2961,7 @@ interp_get_icall_sig (MonoMethodSignature *sig) if (params[i] == 0) // this is ok but check logic against old method { MH_LOGV(MH_LVL_TRACE, "Type %s encoded as %d. tp->type value is %d. Will check against old method", mono_type_get_name(tp), params[i], tp->type); - gboolean isPtrOld = interp_type_as_ptr_test(tp); + gboolean isPtrOld = interp_type_as_ptr_test(tp); if (isPtrOld) { // error @@ -2970,6 +2970,8 @@ interp_get_icall_sig (MonoMethodSignature *sig) else return MINT_ICALLSIG_MAX; // not a pointer type - double check } + else + MH_LOGV(MH_LVL_TRACE, "Type %s encoded as %d. tp->type value is %d", mono_type_get_name(tp), params[i], tp->type); } // returnType of 0 == void int returnType = GET_PARAM_SIZE(sig->ret); From 36ad349dc1435305b6b32c8bebbc39c1aa5a6960 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 12 Sep 2025 16:38:26 +0100 Subject: [PATCH 175/209] Don't interpret MONO_TYPE_R8 as a pointer! --- src/mono/mono/mini/interp/interp-icalls.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index 1f8b10681aeb68..535e0424309bb5 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -48,12 +48,7 @@ interp_type_as_ptr8 (MonoType *tp) if (MONO_TYPE_IS_REFERENCE (tp)) return TRUE; if ((tp)->type == MONO_TYPE_I8 || (tp)->type == MONO_TYPE_U8) - return TRUE; - if ((tp)->type == MONO_TYPE_R8) - return TRUE; - // return true for value types that are NOT enums - //if ((tp)->type == MONO_TYPE_VALUETYPE && !m_class_is_enumtype (m_type_data_get_klass_unchecked (tp))) - // return TRUE; + return TRUE; if (is_scalar_vtype (tp)) return TRUE; return FALSE; @@ -356,7 +351,13 @@ do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval } case MINT_ICALLSIG_88_8: { typedef I8(*T)(I8, I8); + if (!ptr) + MH_LOGV(MH_LVL_INFO, "Function pointer is NULL!"); + T func = (T)ptr; + if (!func) + MH_LOGV(MH_LVL_INFO, "Cast function pointer is NULL!"); + MH_LOGV(MH_LVL_TRACE, "Callig MINT_ICALLSIG_88_8 with pointer %p", ptr); ret_sp->data.p = func(sp[0].data.p, sp[1].data.p); break; } From 337e9ffaa750dde4453568b67f1308e5b77cc575 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 29 Sep 2025 10:58:06 +0100 Subject: [PATCH 176/209] Interpret MONO_TYPE_U4 as 4 byte pointer --- src/mono/mono/mini/interp/interp-icalls.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index 535e0424309bb5..971e401315da43 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -25,6 +25,8 @@ interp_type_as_ptr4 (MonoType *tp) } if ((tp)->type == MONO_TYPE_I4) return TRUE; + if ((tp)->type == MONO_TYPE_U4) // <- is this ok. wasn't in original check + return TRUE; if ((tp)->type == MONO_TYPE_BOOLEAN) return TRUE; if ((tp)->type == MONO_TYPE_CHAR) From b5be87b897c53076005bdade28964d39e2db72a0 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 29 Sep 2025 10:59:21 +0100 Subject: [PATCH 177/209] Logging --- src/mono/mono/metadata/mh_log.c | 2 +- src/mono/mono/mini/interp/transform.c | 4 ++-- src/native/libs/System.Native/pal_datetime.c | 8 +++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mono/mono/metadata/mh_log.c b/src/mono/mono/metadata/mh_log.c index 257b1abedd4412..cb4cccddfb70c1 100644 --- a/src/mono/mono/metadata/mh_log.c +++ b/src/mono/mono/metadata/mh_log.c @@ -1,7 +1,7 @@ #include #include -static int MH_LOG_verbosity_level = MH_LVL_DEBUG; +static int MH_LOG_verbosity_level = MH_LVL_TRACE; static int MH_LOG_verbosity_initialized = 0; void mh_log_set_verbosity(int verbosity) diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index cef3300de2ff8a..c261b905f999ef 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -2961,7 +2961,7 @@ interp_get_icall_sig (MonoMethodSignature *sig) if (params[i] == 0) // this is ok but check logic against old method { MH_LOGV(MH_LVL_TRACE, "Type %s encoded as %d. tp->type value is %d. Will check against old method", mono_type_get_name(tp), params[i], tp->type); - gboolean isPtrOld = interp_type_as_ptr_test(tp); + gboolean isPtrOld = interp_type_as_ptr_test(tp); if (isPtrOld) { // error @@ -2975,7 +2975,7 @@ interp_get_icall_sig (MonoMethodSignature *sig) } // returnType of 0 == void int returnType = GET_PARAM_SIZE(sig->ret); - MH_LOGV(MH_LVL_TRACE, "return type %s encoded as %d", mono_type_get_name(sig->ret), returnType); + MH_LOGV(MH_LVL_TRACE, "return type %s encoded as %d. p->type value is %d", mono_type_get_name(sig->ret), returnType, sig->ret->type); op = encode_signature(params, sig->param_count, returnType); return op; } diff --git a/src/native/libs/System.Native/pal_datetime.c b/src/native/libs/System.Native/pal_datetime.c index d762fe506811eb..ce3b27fb0849cc 100644 --- a/src/native/libs/System.Native/pal_datetime.c +++ b/src/native/libs/System.Native/pal_datetime.c @@ -31,17 +31,23 @@ extern bool mono_bundled_resources_get_data_resource_values (const char *id, con // int64_t SystemNative_GetSystemTimeAsTicks(void) { + printf("In SystemNative_GetSystemTimeAsTicks\n"); fflush(stdout); #if HAVE_CLOCK_REALTIME + printf("In SystemNative_GetSystemTimeAsTicks, using clock_gettime\n"); fflush(stdout); struct timespec time; if (clock_gettime(CLOCK_REALTIME, &time) == 0) { return (int64_t)(time.tv_sec) * TICKS_PER_SECOND + (time.tv_nsec / NANOSECONDS_PER_TICK); } #else + printf("In SystemNative_GetSystemTimeAsTicks, using gettimeofday\n"); fflush(stdout); struct timeval time; if (gettimeofday(&time, NULL) == 0) { - return (int64_t)(time.tv_sec) * TICKS_PER_SECOND + (time.tv_usec * TICKS_PER_MICROSECOND); + printf("called gettimeofday\n"); fflush(stdout); + int64_t result = (int64_t)(time.tv_sec) * TICKS_PER_SECOND + (time.tv_usec * TICKS_PER_MICROSECOND); + printf("Got result %lld\n", result); fflush(stdout); + return result; } #endif // in failure we return 00:00 01 January 1970 UTC (Unix epoch) From d80c8db8d2aca33bb4202231b542d0a69de84687 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 29 Sep 2025 11:00:01 +0100 Subject: [PATCH 178/209] Test/debug --- out.txt | 6910 +++++++++++++++++ .../src/System/Threading/Lock.NonNativeAot.cs | 7 + ...ystem.Runtime.InteropServices.Tests.csproj | 2 +- .../sample/wasm/browser-advanced/Program.cs | 10 + .../sample/wasm/browser-advanced/fibonacci.c | 28 +- src/mono/sample/wasm/browser-advanced/main.js | 9 +- .../sample/wasm/browser-test-debug/Assert.cs | 23 + .../sample/wasm/browser-test-debug/Program.cs | 48 +- .../wasm/browser-test-debug/fibonacci.c | 29 +- .../sample/wasm/browser-test-debug/main.js | 8 +- 10 files changed, 7067 insertions(+), 7 deletions(-) create mode 100644 out.txt diff --git a/out.txt b/out.txt new file mode 100644 index 00000000000000..50e243db24be8a --- /dev/null +++ b/out.txt @@ -0,0 +1,6910 @@ + +C:\xr_dev\dotnetFork\runtime>title Run System Interop Tests 64 + +C:\xr_dev\dotnetFork\runtime>call set_dotnet_env64.cmd + +C:\xr_dev\dotnetFork\runtime>echo *** .NET EMSDK path setup *** +*** .NET EMSDK path setup *** + +C:\xr_dev\dotnetFork\runtime>set EM_CONFIG=C:/emsdk/emscripten.config + +C:\xr_dev\dotnetFork\runtime>set EMSDK_INSTALL_ROOT=C:\emsdk + +C:\xr_dev\dotnetFork\runtime>rem UPDATE emscriptem.config too! + +C:\xr_dev\dotnetFork\runtime>rem set "NODE_VERSION=22.16.0_64bit" + +C:\xr_dev\dotnetFork\runtime>rem set "PYTHON_VERSION=3.13.3_64bit" + +C:\xr_dev\dotnetFork\runtime>set "NODE_VERSION=20.18.0_64bit" + +C:\xr_dev\dotnetFork\runtime>set "PYTHON_VERSION=3.9.2-nuget_64bit" + +C:\xr_dev\dotnetFork\runtime>set "EMSDK_PATH=C:\emsdk\upstream\" + +C:\xr_dev\dotnetFork\runtime>set "DOTNET_EMSCRIPTEN_LLVM_ROOT=C:\emsdk\upstream\bin" + +C:\xr_dev\dotnetFork\runtime>set "DOTNET_EMSCRIPTEN_NODE_JS=C:\emsdk\node\20.18.0_64bit\bin" + +C:\xr_dev\dotnetFork\runtime>set "DOTNET_EMSCRIPTEN_BINARYEN_ROOT=C:\emsdk\upstream" + +C:\xr_dev\dotnetFork\runtime>set "DOTNET_EMSCRIPTEN_NODE_PATH=C:\emsdk\node\20.18.0_64bit\bin" + +C:\xr_dev\dotnetFork\runtime>set "BINARYEN_ROOT=C:\emsdk\upstream" + +C:\xr_dev\dotnetFork\runtime>set "EMSDK_PYTHON=C:\emsdk\python\3.9.2-nuget_64bit\python.exe" + +C:\xr_dev\dotnetFork\runtime>set "EMSDK_NODE=C:\emsdk\node\20.18.0_64bit\bin" + +C:\xr_dev\dotnetFork\runtime>set "WasmEnableMemory64=true" + +C:\xr_dev\dotnetFork\runtime>set "WasmCachePath=C:\xr_dev\cache" + +C:\xr_dev\dotnetFork\runtime>set "MEMORY64=1" + +C:\xr_dev\dotnetFork\runtime>set EmscriptenNodeToolsPath=C:\emsdk\node\20.18.0_64bit\bin\ + +C:\xr_dev\dotnetFork\runtime>set EmscriptenPythonToolsPath=C:\emsdk\python\3.9.2-nuget_64bit\ + +C:\xr_dev\dotnetFork\runtime>call setNewPathDotNet10.bat +C:\xr_dev\dotnetFork\runtime\.dotnet + + Determining projects to restore... + All projects are up-to-date for restore. + TestUtilities -> C:\xr_dev\dotnetFork\runtime\artifacts\bin\TestUtilities\Debug\net8.0\TestUtilities.dll + System.Runtime.InteropServices.Tests -> C:\xr_dev\dotnetFork\runtime\artifacts\bin\System.Runtime.InteropServices.Tests\Debug\net10.0-browser\browser-wasm\System.Runtime.InteropServices.Tests.dll + TestUtilities -> C:\xr_dev\dotnetFork\runtime\artifacts\bin\TestUtilities\Debug\net8.0\TestUtilities.dll + System.Runtime.InteropServices.Tests -> C:\xr_dev\dotnetFork\runtime\artifacts\bin\System.Runtime.InteropServices.Tests\Debug\net10.0-browser\browser-wasm\System.Runtime.InteropServices.Tests.dll + System.Runtime.InteropServices.Tests -> C:\xr_dev\dotnetFork\runtime\artifacts\bin\System.Runtime.InteropServices.Tests\Debug\net10.0-browser\browser-wasm\publish\ + 'export' is not recognized as an internal or external command, + operable program or batch file. + set "SCENARIO=WasmTestOnChrome" + export XUNIT_HIDE_PASSING_OUTPUT_DIAGNOSTICS=1 + set PREPEND_PATH=C:\xr_dev\dotnetFork\runtime\artifacts\bin\chromedriver\chromedriver_win32 + set RuntimeIdentifier=browser-wasm + EXECUTION_DIR=C:\xr_dev\dotnetFork\runtime\artifacts\bin\System.Runtime.InteropServices.Tests\Debug\net10.0-browser\browser-wasm\AppBundle\ + SCENARIO=WasmTestOnChrome + XHARNESS_OUT=C:\xr_dev\dotnetFork\runtime\artifacts\bin\System.Runtime.InteropServices.Tests\Debug\net10.0-browser\browser-wasm\AppBundle\xharness-output + XHARNESS_CLI_PATH= + HARNESS_RUNNER=dotnet.exe xharness + XHARNESS_COMMAND=test-browser + MAIN_JS= + JS_ENGINE= + JS_ENGINE_ARGS=--browser-arg=--js-flags=--stack-trace-limit=1000 --browser-arg=--disable-gpu --pageLoadStrategy=none + XHARNESS_ARGS= --browser-arg=--js-flags=--stack-trace-limit=1000 --browser-arg=--disable-gpu --pageLoadStrategy=none + ----- start 11/09/2025 11:27:33.27 =============== To repro directly: ===================================================== + pushd C:\xr_dev\dotnetFork\runtime\artifacts\bin\System.Runtime.InteropServices.Tests\Debug\net10.0-browser\browser-wasm\AppBundle\ + dotnet.exe xharness wasm test-browser --app=. --output-directory=C:\xr_dev\dotnetFork\runtime\artifacts\bin\System.Runtime.InteropServices.Tests\Debug\net10.0-browser\browser-wasm\AppBundle\xharness-output -s dotnet.native.js.symbols --symbol-patterns wasm-symbol-patterns.txt --symbolicator WasmSymbolicator.dll,Microsoft.WebAssembly.Internal.SymbolicatorWrapperForXHarness "--browser-path=C:\xr_dev\dotnetFork\runtime\artifacts\bin\chrome\chrome-win\chrome.exe" "--timeout=00:30:00" --verbosity=Trace --browser-arg=--js-flags=--stack-trace-limit=1000 --browser-arg=--disable-gpu --pageLoadStrategy=none -- --setenv=MH_LOG_VERBOSITY=0 --setenv=XHARNESS_LOG_TEST_START=true --setenv=XUNIT_RANDOM_ORDER_SEED=666 --run WasmTestRunner.dll System.Runtime.InteropServices.Tests.dll -notrait category=OuterLoop -notrait category=failing + popd + =========================================================================================================== + [10.0.0-prerelease.25167.4+132fdfbd9c8f09f8c51179c1e7742f048f94734c] XHarness command issued: wasm test-browser --app=. --output-directory=C:\xr_dev\dotnetFork\runtime\artifacts\bin\System.Runtime.InteropServices.Tests\Debug\net10.0-browser\browser-wasm\AppBundle\xharness-output -s dotnet.native.js.symbols --symbol-patterns wasm-symbol-patterns.txt --symbolicator WasmSymbolicator.dll,Microsoft.WebAssembly.Internal.SymbolicatorWrapperForXHarness --browser-path=C:\xr_dev\dotnetFork\runtime\artifacts\bin\chrome\chrome-win\chrome.exe --timeout=00:30:00 --verbosity=Trace --browser-arg=--js-flags=--stack-trace-limit=1000 --browser-arg=--disable-gpu --pageLoadStrategy=none -- --setenv=MH_LOG_VERBOSITY=0 --setenv=XHARNESS_LOG_TEST_START=true --setenv=XUNIT_RANDOM_ORDER_SEED=666 --run WasmTestRunner.dll System.Runtime.InteropServices.Tests.dll -notrait category=OuterLoop -notrait category=failing + warn: Cannot find symbols file dotnet.native.js.symbols + dbug: Symbolicator 'Microsoft.WebAssembly.Internal.SymbolicatorWrapperForXHarness'.Init(dotnet.native.js.symbols, wasm-symbol-patterns.txt) returned false + info: Using Chrome from C:\xr_dev\dotnetFork\runtime\artifacts\bin\chrome\chrome-win\chrome.exe + info: Starting chromedriver with args: --js-flags=--stack-trace-limit=1000 --disable-gpu --headless --incognito --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-renderer-backgrounding --enable-features=NetworkService,NetworkServiceInProcess --allow-insecure-localhost --disable-breakpad --disable-component-extensions-with-background-pages --disable-dev-shm-usage --disable-extensions --disable-features=TranslateUI --disable-ipc-flooding-protection --force-color-profile=srgb --metrics-recording-only and load strategy: None + Starting ChromeDriver 135.0.7049.0 (0000000000000000000000000000000000000000-0000000000000000000000000000000000000000) on port 24581 + Only local connections are allowed. + Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. + ChromeDriver was started successfully on port 24581. + dbug: Opening in browser: http://127.0.0.1:63289/index.html?arg=--setenv%3dMH_LOG_VERBOSITY%3d0&arg=--setenv%3dXHARNESS_LOG_TEST_START%3dtrue&arg=--setenv%3dXUNIT_RANDOM_ORDER_SEED%3d666&arg=--run&arg=WasmTestRunner.dll&arg=System.Runtime.InteropServices.Tests.dll&arg=-notrait&arg=category%3dOuterLoop&arg=-notrait&arg=category%3dfailing&arg=-verbosity&arg=Verbose + fail: [out of order message from the browser]: http://127.0.0.1:63289/runArgs.json - Failed to load resource: the server responded with a status of 404 (Not Found) + fail: [out of order message from the browser]: http://127.0.0.1:63289/favicon.ico - Failed to load resource: the server responded with a status of 404 (Not Found) + info: Running in: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/135.0.0.0 Safari/537.36 + info: Running at: http://127.0.0.1:63289/index.html?arg=--setenv%3dMH_LOG_VERBOSITY%3d0&arg=--setenv%3dXHARNESS_LOG_TEST_START%3dtrue&arg=--setenv%3dXUNIT_RANDOM_ORDER_SEED%3d666&arg=--run&arg=WasmTestRunner.dll&arg=System.Runtime.InteropServices.Tests.dll&arg=-notrait&arg=category%3dOuterLoop&arg=-notrait&arg=category%3dfailing&arg=-verbosity&arg=Verbose + info: could not load /runArgs.json: 404. Ignoring + info: Incoming arguments: --setenv=MH_LOG_VERBOSITY=0 --setenv=XHARNESS_LOG_TEST_START=true --setenv=XUNIT_RANDOM_ORDER_SEED=666 --run WasmTestRunner.dll System.Runtime.InteropServices.Tests.dll -notrait category=OuterLoop -notrait category=failing -verbosity Verbose + info: Application arguments: --run WasmTestRunner.dll System.Runtime.InteropServices.Tests.dll -notrait category=OuterLoop -notrait category=failing -verbosity Verbose + info: MONO_WASM: starting script http://127.0.0.1:63289/_framework/dotnet.js + info: MONO_WASM: starting in http://127.0.0.1:63289/_framework/ + info: Initializing dotnet version 10.0.0-dev commit hash 69df26a480f53bc9621793d8c62af240c15caac3 + info: returningUsing locally built threadless Xunit runner 29 Aug 14:52 + info: Discovering: System.Runtime.InteropServices.Tests.dll (method display = ClassAndMethod, method display options = None) + info: Discovered: System.Runtime.InteropServices.Tests.dll (found 889 of 997 test cases) + info: Using random seed for test cases: 666 + info: Using random seed for collections: 666 + info: Starting: System.Runtime.InteropServices.Tests.dll + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_NullString_ReturnsZero + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_NullString_ReturnsZero + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pizza") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pizza") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pepperoni") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pepperoni") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "password") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "password") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "P4ssw0rdAa1") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "P4ssw0rdAa1") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "ßê┤") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "ßê┤") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "´┐¢´┐¢") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "´┐¢´┐¢") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "­ÉÇÇ") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "­ÉÇÇ") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "\0") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "\0") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "abc\0def") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "abc\0def") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GuidAttributeTests.Ctor_Guid(guid: null) + info: [PASS] System.Runtime.InteropServices.Tests.GuidAttributeTests.Ctor_Guid(guid: null) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GuidAttributeTests.Ctor_Guid(guid: "Guid") + info: [PASS] System.Runtime.InteropServices.Tests.GuidAttributeTests.Ctor_Guid(guid: "Guid") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException + info: [PASS] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_NullSource_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_NullSource_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) + info: [PASS] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) + info: [PASS] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) + info: [PASS] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException + info: [PASS] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) + info: [PASS] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ZeroFreeCoTaskMemUTF8Tests.ZeroFreeCoTaskMemUTF8_ValidPointer_Success + info: [PASS] System.Runtime.InteropServices.Tests.ZeroFreeCoTaskMemUTF8Tests.ZeroFreeCoTaskMemUTF8_ValidPointer_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetExceptionPointersTests.GetExceptionPointers_ReturnsExpected + info: [SKIP] System.Runtime.InteropServices.Tests.GetExceptionPointersTests.GetExceptionPointers_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.QueryInterfaceTests.QueryInterface_ZeroPointer_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.QueryInterfaceTests.QueryInterface_ZeroPointer_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException + info: [PASS] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_NullSource_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_NullSource_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) + info: [PASS] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) + info: [PASS] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) + info: [PASS] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException + info: [PASS] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) + info: [PASS] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringUTF8.PtrToStringUTF8_ZeroPointer_ReturnsNull + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringUTF8.PtrToStringUTF8_ZeroPointer_ReturnsNull + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringUTF8.PtrToStringUTF8_Length_Success(s: "", len: 0) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringUTF8.PtrToStringUTF8_Length_Success(s: "", len: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringUTF8.PtrToStringUTF8_Length_Success(s: "hello", len: 0) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringUTF8.PtrToStringUTF8_Length_Success(s: "hello", len: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringUTF8.PtrToStringUTF8_Length_Success(s: "hello", len: 1) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringUTF8.PtrToStringUTF8_Length_Success(s: "hello", len: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringUTF8.PtrToStringUTF8_Length_Success(s: "hello", len: 4) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringUTF8.PtrToStringUTF8_Length_Success(s: "hello", len: 4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.FinalReleaseComObjectTests.FinalReleaseComObject_NullObject_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.FinalReleaseComObjectTests.FinalReleaseComObject_NullObject_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.FinalReleaseComObjectTests.FinalReleaseComObject_Unix_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.Tests.FinalReleaseComObjectTests.FinalReleaseComObject_Unix_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.FinalReleaseComObjectTests.FinalReleaseComObject_NonComObject_ThrowsArgumentException + info: [SKIP] System.Runtime.InteropServices.Tests.FinalReleaseComObjectTests.FinalReleaseComObject_NonComObject_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ManagedToNativeComInteropStubAttributeTests.Ctor_ClassType_MethodName(classType: null, methodName: null) + info: [PASS] System.Runtime.InteropServices.Tests.ManagedToNativeComInteropStubAttributeTests.Ctor_ClassType_MethodName(classType: null, methodName: null) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ManagedToNativeComInteropStubAttributeTests.Ctor_ClassType_MethodName(classType: typeof(int), methodName: "MethodName") + info: [PASS] System.Runtime.InteropServices.Tests.ManagedToNativeComInteropStubAttributeTests.Ctor_ClassType_MethodName(classType: typeof(int), methodName: "MethodName") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_ShortFlags(flags: -1) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_ShortFlags(flags: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_ShortFlags(flags: 0) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_ShortFlags(flags: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_ShortFlags(flags: 4) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_ShortFlags(flags: 4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_TypeLibVarFlags(flags: -1) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_TypeLibVarFlags(flags: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_TypeLibVarFlags(flags: 0) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_TypeLibVarFlags(flags: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_TypeLibVarFlags(flags: FBindable) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_TypeLibVarFlags(flags: FBindable) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetHRForExceptionTests.GetHRForException_CustomException_ReturnsExpected + info: [PASS] System.Runtime.InteropServices.Tests.GetHRForExceptionTests.GetHRForException_CustomException_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetHRForExceptionTests.GetHRForException_ValidException_ReturnsValidHResult + info: [PASS] System.Runtime.InteropServices.Tests.GetHRForExceptionTests.GetHRForException_ValidException_ReturnsValidHResult + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetHRForExceptionTests.GetHRForException_NullException_ReturnsZero + info: [PASS] System.Runtime.InteropServices.Tests.GetHRForExceptionTests.GetHRForException_NullException_ReturnsZero + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetTypeInfoNameTests.GetTypeInfoName_Unix_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.Tests.GetTypeInfoNameTests.GetTypeInfoName_Unix_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetTypeInfoNameTests.GetTypeInfoName_ValidTypeInfo_ReturnsExpected + info: [SKIP] System.Runtime.InteropServices.Tests.GetTypeInfoNameTests.GetTypeInfoName_ValidTypeInfo_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetTypeInfoNameTests.GetTypeInfoName_NullTypeInfo_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.GetTypeInfoNameTests.GetTypeInfoName_NullTypeInfo_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibVersionAttributeTests.Ctor_MajorVersion_MinorVersion(majorVersion: -1, minorVersion: -2) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibVersionAttributeTests.Ctor_MajorVersion_MinorVersion(majorVersion: -1, minorVersion: -2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibVersionAttributeTests.Ctor_MajorVersion_MinorVersion(majorVersion: 0, minorVersion: 0) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibVersionAttributeTests.Ctor_MajorVersion_MinorVersion(majorVersion: 0, minorVersion: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibVersionAttributeTests.Ctor_MajorVersion_MinorVersion(majorVersion: 1, minorVersion: 2) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibVersionAttributeTests.Ctor_MajorVersion_MinorVersion(majorVersion: 1, minorVersion: 2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComRegisterFunctionAttributeTests.Exists + info: [PASS] System.Runtime.InteropServices.Tests.ComRegisterFunctionAttributeTests.Exists + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_ShortFlags(flags: -1) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_ShortFlags(flags: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_ShortFlags(flags: 0) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_ShortFlags(flags: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_ShortFlags(flags: 4) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_ShortFlags(flags: 4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_TypeLibTypeFlags(flags: -1) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_TypeLibTypeFlags(flags: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_TypeLibTypeFlags(flags: 0) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_TypeLibTypeFlags(flags: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_TypeLibTypeFlags(flags: FLicensed) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_TypeLibTypeFlags(flags: FLicensed) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ProgIdAttributeTests.Ctor_ProgId + info: [SKIP] System.Runtime.InteropServices.Tests.ProgIdAttributeTests.Ctor_ProgId + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ProgIdAttributeTests.Exists + info: [SKIP] System.Runtime.InteropServices.Tests.ProgIdAttributeTests.Exists + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetHINSTANCETests.GetHINSTANCE_NullModule_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.GetHINSTANCETests.GetHINSTANCE_NullModule_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetHINSTANCETests.GetHINSTANCE_NormalModule_ReturnsSameInstance + info: [PASS] System.Runtime.InteropServices.Tests.GetHINSTANCETests.GetHINSTANCE_NormalModule_ReturnsSameInstance + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetHINSTANCETests.GetHINSTANCE_ModuleBuilder_ReturnsSameInstance + info: [PASS] System.Runtime.InteropServices.Tests.GetHINSTANCETests.GetHINSTANCE_ModuleBuilder_ReturnsSameInstance + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetHINSTANCETests.GetHINSTANCE_NonRuntimeModule_Returns_IntPtrMinusOne + info: [PASS] System.Runtime.InteropServices.Tests.GetHINSTANCETests.GetHINSTANCE_NonRuntimeModule_Returns_IntPtrMinusOne + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PrelinkTests.Prelink_NullMethod_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.PrelinkTests.Prelink_NullMethod_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PrelinkTests.Prelink_ValidMethod_Success + info: [PASS] System.Runtime.InteropServices.Tests.PrelinkTests.Prelink_ValidMethod_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PrelinkTests.Prelink_RuntimeSuppliedMethod_Success + info: [PASS] System.Runtime.InteropServices.Tests.PrelinkTests.Prelink_RuntimeSuppliedMethod_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PrelinkTests.Prelink_NonRuntimeMethod_ThrowsArgumentException + info: [PASS] System.Runtime.InteropServices.Tests.PrelinkTests.Prelink_NonRuntimeMethod_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.FileTime_Raw + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.FileTime_Raw + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.BStr_String + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.BStr_String + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.VariantBoolFalse + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.VariantBoolFalse + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Storage_Raw + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Storage_Raw + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Vector_Raw + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Vector_Raw + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Int_Raw + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Int_Raw + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.VariantBoolTrue + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.VariantBoolTrue + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.UInt + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.UInt + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Decimal + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Decimal + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Clsid_Raw + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Clsid_Raw + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_I1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_I1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_UI1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_UI1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_I2) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_I2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_UI2) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_UI2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_I4) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_I4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_UI4) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_UI4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_I8) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_I8) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_UI8) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_UI8) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_R4) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_R4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_R8) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_R8) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_BOOL) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_BOOL) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_BLOB) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_BLOB) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: 16387) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: 16387) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_UNKNOWN) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_UNKNOWN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.SByte + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.SByte + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.UShort + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.UShort + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.ByRef_Raw + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.ByRef_Raw + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Float + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Float + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Array_Raw_NonWindows + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Array_Raw_NonWindows + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.StoredObject_Raw + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.StoredObject_Raw + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.BlobObject_Raw + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.BlobObject_Raw + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.LPStr_Raw + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.LPStr_Raw + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Double + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Double + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.BStr_String_Null + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.BStr_String_Null + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Date + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Date + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Long + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Long + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.LPWStr_Raw + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.LPWStr_Raw + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_Int_WrongSize(vt: VT_INT) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_Int_WrongSize(vt: VT_INT) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_Int_WrongSize(vt: VT_UINT) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_Int_WrongSize(vt: VT_UINT) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.StreamedObject_Raw + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.StreamedObject_Raw + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Byte + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Byte + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.BStrWrapper + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.BStrWrapper + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Unknown_NotSupported + info: [SKIP] System.Runtime.InteropServices.Tests.ComVariantTests.Unknown_NotSupported + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.VTVariantNotSupported + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.VTVariantNotSupported + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.DefaultVariantIsEmpty + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.DefaultVariantIsEmpty + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.VersionedStream_Raw + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.VersionedStream_Raw + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Short + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Short + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Record_Raw + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Record_Raw + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Int4 + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Int4 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Blob_Raw + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Blob_Raw + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.ULong + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.ULong + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Currency + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Currency + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Error + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Error + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.NullVariantIsNull + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.NullVariantIsNull + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.ClipData_Raw + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.ClipData_Raw + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Stream_Raw + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Stream_Raw + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.UInt4 + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.UInt4 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException + info: [PASS] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_NullSource_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_NullSource_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) + info: [PASS] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) + info: [PASS] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) + info: [PASS] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException + info: [PASS] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) + info: [PASS] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_Exception(exception: null, expectedErrorCode: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_Exception(exception: null, expectedErrorCode: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_Exception(exception: System.Runtime.InteropServices.Tests.ErrorWrapperTests+SubException: Exception of type 'System.Runtime.InteropServices.Tests.ErrorWrapperTests+SubException' was thrown., expectedErrorCode: 1000) + info: [PASS] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_Exception(exception: System.Runtime.InteropServices.Tests.ErrorWrapperTests+SubException: Exception of type 'System.Runtime.InteropServices.Tests.ErrorWrapperTests+SubException' was thrown., expectedErrorCode: 1000) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_IntErrorCode(value: -1) + info: [PASS] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_IntErrorCode(value: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_IntErrorCode(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_IntErrorCode(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_IntErrorCode(value: 1) + info: [PASS] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_IntErrorCode(value: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_ObjectErrorCode(value: -1) + info: [PASS] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_ObjectErrorCode(value: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_ObjectErrorCode(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_ObjectErrorCode(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_ObjectErrorCode(value: 1) + info: [PASS] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_ObjectErrorCode(value: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_NonIntObjectValue_ThrowsInvalidCastException + info: [PASS] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_NonIntObjectValue_ThrowsInvalidCastException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_ZeroPointer_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_ZeroPointer_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_Length_Success(s: "", len: 0) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_Length_Success(s: "", len: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_Length_Success(s: "hello", len: 0) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_Length_Success(s: "hello", len: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_Length_Success(s: "hello", len: 1) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_Length_Success(s: "hello", len: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_Length_Success(s: "hello", len: 4) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_Length_Success(s: "hello", len: 4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_ZeroPointer_ReturnsNull + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_ZeroPointer_ReturnsNull + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_NegativeLength_ThrowsArgumentOutOfRangeException + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_NegativeLength_ThrowsArgumentOutOfRangeException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_NullType_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_NullType_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(int)) + info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(int)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Math)) + info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Math)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Int32&)) + info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Int32&)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Int32*)) + info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Int32*)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(int[])) + info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(int[])) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.NonGenericClass)) + info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.NonGenericClass)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass)) + info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.AbstractClass)) + info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.AbstractClass)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.NonGenericStruct)) + info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.NonGenericStruct)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericStruct)) + info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericStruct)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.INonGenericInterface)) + info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.INonGenericInterface)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.IGenericInterface)) + info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.IGenericInterface)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass<>)) + info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass<>)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(T)) + info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(T)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.CompilerServices.Tests.IUnknownConstantAttributeTests.Ctor_Default + info: [PASS] System.Runtime.CompilerServices.Tests.IUnknownConstantAttributeTests.Ctor_Default + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ImportedFromTypeLibAttributeTests.Ctor_TlbFile(tlbFile: null) + info: [PASS] System.Runtime.InteropServices.Tests.ImportedFromTypeLibAttributeTests.Ctor_TlbFile(tlbFile: null) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ImportedFromTypeLibAttributeTests.Ctor_TlbFile(tlbFile: "Value") + info: [PASS] System.Runtime.InteropServices.Tests.ImportedFromTypeLibAttributeTests.Ctor_TlbFile(tlbFile: "Value") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ReleaseTests.Release_ZeroPointer_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.ReleaseTests.Release_ZeroPointer_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.AddRefTests.AddRef_ZeroPointer_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.AddRefTests.AddRef_ZeroPointer_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.InitHandleTests.InitHandle_SetsHandle + info: [PASS] System.Runtime.InteropServices.Tests.InitHandleTests.InitHandle_SetsHandle + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetIUnknownForObjectTests.GetIUnknownForObject_NullObject_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.GetIUnknownForObjectTests.GetIUnknownForObject_NullObject_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetIUnknownForObjectTests.GetIUnknownForObject_Unix_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.Tests.GetIUnknownForObjectTests.GetIUnknownForObject_Unix_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.BStrWrapperTests.Ctor_ObjectValue(value: null) + info: [PASS] System.Runtime.InteropServices.Tests.BStrWrapperTests.Ctor_ObjectValue(value: null) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.BStrWrapperTests.Ctor_ObjectValue(value: "Value") + info: [PASS] System.Runtime.InteropServices.Tests.BStrWrapperTests.Ctor_ObjectValue(value: "Value") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.BStrWrapperTests.Ctor_StringValue(value: null) + info: [PASS] System.Runtime.InteropServices.Tests.BStrWrapperTests.Ctor_StringValue(value: null) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.BStrWrapperTests.Ctor_StringValue(value: "Value") + info: [PASS] System.Runtime.InteropServices.Tests.BStrWrapperTests.Ctor_StringValue(value: "Value") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.BStrWrapperTests.Ctor_NonStringObjectValue_ThrowsInvalidCastException + info: [PASS] System.Runtime.InteropServices.Tests.BStrWrapperTests.Ctor_NonStringObjectValue_ThrowsInvalidCastException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.AutomationProxyAttributeTests.Ctor_Val(val: True) + info: [PASS] System.Runtime.InteropServices.Tests.AutomationProxyAttributeTests.Ctor_Val(val: True) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.AutomationProxyAttributeTests.Ctor_Val(val: False) + info: [PASS] System.Runtime.InteropServices.Tests.AutomationProxyAttributeTests.Ctor_Val(val: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrNullRefLinkBreaksOnResize + info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrNullRefLinkBreaksOnResize + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.ListAsSpanValueType + info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.ListAsSpanValueType + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.ListAsSpanClass + info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.ListAsSpanClass + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrAddDefaultClass + info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrAddDefaultClass + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.ListSetCount + info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.ListSetCount + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrNullRefClass + info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrNullRefClass + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.NullListAsSpanClass + info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.NullListAsSpanClass + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrNullRefValueType + info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrNullRefValueType + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.ListAsSpanLinkBreaksOnResize + info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.ListAsSpanLinkBreaksOnResize + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrAddDefaultLinkBreaksOnResize + info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrAddDefaultLinkBreaksOnResize + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrAddDefaultValueType + info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrAddDefaultValueType + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.NullListAsSpanValueType + info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.NullListAsSpanValueType + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_NullString_ReturnsZero + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_NullString_ReturnsZero + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "pizza") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "pizza") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "pepperoni") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "pepperoni") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "password") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "password") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "P4ssw0rdAa1") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "P4ssw0rdAa1") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "ßê┤") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "ßê┤") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "´┐¢´┐¢") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "´┐¢´┐¢") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "­ÉÇÇ") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "­ÉÇÇ") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "\0") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "\0") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "abc\0def") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "abc\0def") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ErrorWrapper_Maps_To_VT_ERROR(hr: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ErrorWrapper_Maps_To_VT_ERROR(hr: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ErrorWrapper_Maps_To_VT_ERROR(hr: 1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ErrorWrapper_Maps_To_VT_ERROR(hr: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ErrorWrapper_Maps_To_VT_ERROR(hr: -2147467259) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ErrorWrapper_Maps_To_VT_ERROR(hr: -2147467259) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ErrorWrapper_Maps_To_VT_ERROR(hr: -2147024891) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ErrorWrapper_Maps_To_VT_ERROR(hr: -2147024891) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int32_Marshals_To_I4(value: -2147483648) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int32_Marshals_To_I4(value: -2147483648) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int32_Marshals_To_I4(value: -1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int32_Marshals_To_I4(value: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int32_Marshals_To_I4(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int32_Marshals_To_I4(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int32_Marshals_To_I4(value: 1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int32_Marshals_To_I4(value: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int32_Marshals_To_I4(value: 2147483647) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int32_Marshals_To_I4(value: 2147483647) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int16_Marshals_To_I2(value: -32768) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int16_Marshals_To_I2(value: -32768) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int16_Marshals_To_I2(value: -1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int16_Marshals_To_I2(value: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int16_Marshals_To_I2(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int16_Marshals_To_I2(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int16_Marshals_To_I2(value: 1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int16_Marshals_To_I2(value: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int16_Marshals_To_I2(value: 32767) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int16_Marshals_To_I2(value: 32767) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Decimal_Marshals_To_DECIMAL(value: -79228162514264337593543950335) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Decimal_Marshals_To_DECIMAL(value: -79228162514264337593543950335) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Decimal_Marshals_To_DECIMAL(value: -1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Decimal_Marshals_To_DECIMAL(value: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Decimal_Marshals_To_DECIMAL(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Decimal_Marshals_To_DECIMAL(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Decimal_Marshals_To_DECIMAL(value: 1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Decimal_Marshals_To_DECIMAL(value: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Decimal_Marshals_To_DECIMAL(value: 79228162514264337593543950335) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Decimal_Marshals_To_DECIMAL(value: 79228162514264337593543950335) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UINT_Marshals_as_UInt(n: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UINT_Marshals_as_UInt(n: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UINT_Marshals_as_UInt(n: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UINT_Marshals_as_UInt(n: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UINT_Marshals_as_UInt(n: 1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UINT_Marshals_as_UInt(n: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UINT_Marshals_as_UInt(n: 4294967295) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UINT_Marshals_as_UInt(n: 4294967295) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: -3.40282347E+38) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: -3.40282347E+38) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: -1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: 1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: 3.40282347E+38) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: 3.40282347E+38) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt32_Marshals_To_UI4(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt32_Marshals_To_UI4(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt32_Marshals_To_UI4(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt32_Marshals_To_UI4(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt32_Marshals_To_UI4(value: 1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt32_Marshals_To_UI4(value: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt32_Marshals_To_UI4(value: 4294967295) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt32_Marshals_To_UI4(value: 4294967295) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: -1.7976931348623157E+308) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: -1.7976931348623157E+308) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: -1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: 1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: 1.7976931348623157E+308) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: 1.7976931348623157E+308) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt16_Marshals_To_UI2(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt16_Marshals_To_UI2(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt16_Marshals_To_UI2(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt16_Marshals_To_UI2(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt16_Marshals_To_UI2(value: 1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt16_Marshals_To_UI2(value: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt16_Marshals_To_UI2(value: 65535) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt16_Marshals_To_UI2(value: 65535) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.INT_Marshals_as_Int(n: -2147483648) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.INT_Marshals_as_Int(n: -2147483648) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.INT_Marshals_as_Int(n: -1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.INT_Marshals_as_Int(n: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.INT_Marshals_as_Int(n: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.INT_Marshals_as_Int(n: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.INT_Marshals_as_Int(n: 1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.INT_Marshals_as_Int(n: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.INT_Marshals_as_Int(n: 2147483647) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.INT_Marshals_as_Int(n: 2147483647) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I1, valueToSet: 42) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I1, valueToSet: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_R8, valueToSet: 42) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_R8, valueToSet: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_R4, valueToSet: 42) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_R4, valueToSet: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI8, valueToSet: 42) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI8, valueToSet: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI8, valueToSet: 42) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI8, valueToSet: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I8, valueToSet: 42) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I8, valueToSet: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I8, valueToSet: 42) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I8, valueToSet: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_ERROR, valueToSet: 42) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_ERROR, valueToSet: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_ERROR, valueToSet: 42) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_ERROR, valueToSet: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI4, valueToSet: 42) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI4, valueToSet: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI4, valueToSet: 42) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI4, valueToSet: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I4, valueToSet: 42) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I4, valueToSet: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I4, valueToSet: 42) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I4, valueToSet: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI2, valueToSet: 42) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI2, valueToSet: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI2, valueToSet: 42) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI2, valueToSet: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I2, valueToSet: 42) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I2, valueToSet: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I2, valueToSet: 42) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I2, valueToSet: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI1, valueToSet: 42) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI1, valueToSet: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI1, valueToSet: 42) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI1, valueToSet: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I1, valueToSet: 42) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I1, valueToSet: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_BOOL, valueToSet: True) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_BOOL, valueToSet: True) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_BOOL, valueToSet: False) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_BOOL, valueToSet: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.SByte_Marshals_To_I1(value: -128) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.SByte_Marshals_To_I1(value: -128) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.SByte_Marshals_To_I1(value: -1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.SByte_Marshals_To_I1(value: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.SByte_Marshals_To_I1(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.SByte_Marshals_To_I1(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.SByte_Marshals_To_I1(value: 1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.SByte_Marshals_To_I1(value: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.SByte_Marshals_To_I1(value: 127) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.SByte_Marshals_To_I1(value: 127) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Byte_Marshals_To_UI1(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Byte_Marshals_To_UI1(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Byte_Marshals_To_UI1(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Byte_Marshals_To_UI1(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Byte_Marshals_To_UI1(value: 1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Byte_Marshals_To_UI1(value: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Byte_Marshals_To_UI1(value: 255) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Byte_Marshals_To_UI1(value: 255) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.CurrencyWrapper_Marshals_To_CY(value: -922337203685477.5808) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.CurrencyWrapper_Marshals_To_CY(value: -922337203685477.5808) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.CurrencyWrapper_Marshals_To_CY(value: -1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.CurrencyWrapper_Marshals_To_CY(value: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.CurrencyWrapper_Marshals_To_CY(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.CurrencyWrapper_Marshals_To_CY(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.CurrencyWrapper_Marshals_To_CY(value: 1) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.CurrencyWrapper_Marshals_To_CY(value: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.CurrencyWrapper_Marshals_To_CY(value: 922337203685477.5807) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.CurrencyWrapper_Marshals_To_CY(value: 922337203685477.5807) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.DBNull_Marshals_To_Null + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.DBNull_Marshals_To_Null + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Date_Marshals_To_DATE + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Date_Marshals_To_DATE + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.VariantWrapper_Throws(obj: null) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.VariantWrapper_Throws(obj: null) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.VariantWrapper_Throws(obj: Object { }) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.VariantWrapper_Throws(obj: Object { }) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.VariantWrapper_Throws(obj: []) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.VariantWrapper_Throws(obj: []) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Boolean_Marshals_To_BOOL(value: True) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Boolean_Marshals_To_BOOL(value: True) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Boolean_Marshals_To_BOOL(value: False) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Boolean_Marshals_To_BOOL(value: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.BStrWrapper_Marshals_To_BStr(value: null) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.BStrWrapper_Marshals_To_BStr(value: null) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.BStrWrapper_Marshals_To_BStr(value: "") + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.BStrWrapper_Marshals_To_BStr(value: "") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.BStrWrapper_Marshals_To_BStr(value: "Hello") + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.BStrWrapper_Marshals_To_BStr(value: "Hello") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Null_Marshals_To_Empty + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Null_Marshals_To_Empty + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.String_Marshals_To_BStr(value: null, expected: VT_EMPTY) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.String_Marshals_To_BStr(value: null, expected: VT_EMPTY) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.String_Marshals_To_BStr(value: "", expected: VT_BSTR) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.String_Marshals_To_BStr(value: "", expected: VT_BSTR) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.String_Marshals_To_BStr(value: "Hello", expected: VT_BSTR) + info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.String_Marshals_To_BStr(value: "Hello", expected: VT_BSTR) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_NullString_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_NullString_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "pizza") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "pizza") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "pepperoni") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "pepperoni") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "password") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "password") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "P4ssw0rdAa1") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "P4ssw0rdAa1") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "ßê┤") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "ßê┤") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "´┐¢´┐¢") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "´┐¢´┐¢") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "­ÉÇÇ") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "­ÉÇÇ") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "\0") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "\0") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "abc\0def") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "abc\0def") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_DisposedString_ThrowsObjectDisposedException + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_DisposedString_ThrowsObjectDisposedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ZeroFreeCoTaskMemAnsiTests.ZeroFreeCoTaskMemAnsi_Zero_Nop + info: [PASS] System.Runtime.InteropServices.Tests.ZeroFreeCoTaskMemAnsiTests.ZeroFreeCoTaskMemAnsi_Zero_Nop + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ZeroFreeCoTaskMemAnsiTests.ZeroFreeCoTaskMemAnsi_ValidPointer_Success + info: [PASS] System.Runtime.InteropServices.Tests.ZeroFreeCoTaskMemAnsiTests.ZeroFreeCoTaskMemAnsi_ValidPointer_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.HandleRefTests.Ctor_Wrapper_Handle(wrapper: null, handle: 0) + info: [PASS] System.Runtime.InteropServices.Tests.HandleRefTests.Ctor_Wrapper_Handle(wrapper: null, handle: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.HandleRefTests.Ctor_Wrapper_Handle(wrapper: "Wrapper", handle: 1337) + info: [PASS] System.Runtime.InteropServices.Tests.HandleRefTests.Ctor_Wrapper_Handle(wrapper: "Wrapper", handle: 1337) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.HandleRefTests.Ctor_Default + info: [PASS] System.Runtime.InteropServices.Tests.HandleRefTests.Ctor_Default + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.FreeBSTRTests.FreeBSTR_Zero_Nop + info: [PASS] System.Runtime.InteropServices.Tests.FreeBSTRTests.FreeBSTR_Zero_Nop + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.FreeBSTRTests.FreeBSTR_ValidPointer_Success + info: [PASS] System.Runtime.InteropServices.Tests.FreeBSTRTests.FreeBSTR_ValidPointer_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CoClassAttributeTests.Ctor_CoClass(coClass: null) + info: [PASS] System.Runtime.InteropServices.Tests.CoClassAttributeTests.Ctor_CoClass(coClass: null) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CoClassAttributeTests.Ctor_CoClass(coClass: typeof(int)) + info: [PASS] System.Runtime.InteropServices.Tests.CoClassAttributeTests.Ctor_CoClass(coClass: typeof(int)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_StructWithBlittableFixedBuffer_In_NonBlittable_Success + info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_StructWithBlittableFixedBuffer_In_NonBlittable_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_NullPtr_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_NullPtr_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_NullStructure_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_NullStructure_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_NonBlittableStruct_WithBlittableFixedBuffer_Success + info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_NonBlittableStruct_WithBlittableFixedBuffer_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_Flat_And_Nested_NonBlittableStructure_Success + info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_Flat_And_Nested_NonBlittableStructure_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_NonBlittable_ThrowsArgumentException(o: NonGenericClass { }) + info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_NonBlittable_ThrowsArgumentException(o: NonGenericClass { }) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_NonBlittable_ThrowsArgumentException(o: "string") + info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_NonBlittable_ThrowsArgumentException(o: "string") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_OverflowByValArrayInStruct_Success + info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_OverflowByValArrayInStruct_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_AutoLayout_ThrowsArgumentException + info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_AutoLayout_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_GenericObject_ThrowsArgumentException(o: GenericClass`1 { }) + info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_GenericObject_ThrowsArgumentException(o: GenericClass`1 { }) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_GenericObject_ThrowsArgumentException(o: System.Runtime.InteropServices.Tests.Common.GenericStruct`1[System.String]) + info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_GenericObject_ThrowsArgumentException(o: System.Runtime.InteropServices.Tests.Common.GenericStruct`1[System.String]) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_OpaqueStruct_In_NonBlittableStructure_Success + info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_OpaqueStruct_In_NonBlittableStructure_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_ByValArrayInStruct_Success + info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_ByValArrayInStruct_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.Int16Tests.WriteInt16_Pointer_Roundtrips(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) + info: [PASS] System.Runtime.InteropServices.Tests.Int16Tests.WriteInt16_Pointer_Roundtrips(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Remove_Unix_ThrowPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Remove_Unix_ThrowPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Combine_NullRcw_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Combine_NullRcw_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Combine_NotComObject_ThrowsArgumentException + info: [SKIP] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Combine_NotComObject_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Remove_NotComObject_ThrowsArgumentException + info: [SKIP] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Remove_NotComObject_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Remove_NullRcw_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Remove_NullRcw_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Combine_Unix_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Combine_Unix_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_NullString_ReturnsZero + info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_NullString_ReturnsZero + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "") + info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "pizza") + info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "pizza") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "pepperoni") + info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "pepperoni") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "password") + info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "password") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "P4ssw0rdAa1") + info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "P4ssw0rdAa1") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "´┐¢´┐¢") + info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "´┐¢´┐¢") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "­ÉÇÇ") + info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "­ÉÇÇ") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "ßê┤") + info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "ßê┤") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "\0") + info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "\0") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "abc\0def") + info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "abc\0def") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.RuntimeEnvironmentTests.GetRuntimeInterfaceAsObject_Invoke_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.RuntimeEnvironmentTests.GetRuntimeInterfaceAsObject_Invoke_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.RuntimeEnvironmentTests.RuntimeEnvironmentSysVersion + info: [PASS] System.Runtime.InteropServices.RuntimeEnvironmentTests.RuntimeEnvironmentSysVersion + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.RuntimeEnvironmentTests.SystemConfigurationFile_Get_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.RuntimeEnvironmentTests.SystemConfigurationFile_Get_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.RuntimeEnvironmentTests.FromGlobalAccessCache_nNvoke_ReturnsFalse + info: [PASS] System.Runtime.InteropServices.RuntimeEnvironmentTests.FromGlobalAccessCache_nNvoke_ReturnsFalse + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.RuntimeEnvironmentTests.GetRuntimeInterfaceAsIntPtr_Invoke_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.RuntimeEnvironmentTests.GetRuntimeInterfaceAsIntPtr_Invoke_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.RuntimeEnvironmentTests.RuntimeEnvironmentRuntimeDirectory + info: [PASS] System.Runtime.InteropServices.RuntimeEnvironmentTests.RuntimeEnvironmentRuntimeDirectory + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException + info: [PASS] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_NullSource_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_NullSource_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) + info: [PASS] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) + info: [PASS] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) + info: [PASS] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException + info: [PASS] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: ['a', 'b', 'c', 'd', 'e', ┬À┬À┬À]) + info: [PASS] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: ['a', 'b', 'c', 'd', 'e', ┬À┬À┬À]) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.IsTypeVisibleFromComTests.IsTypeVisibleFromCom_NullType_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.IsTypeVisibleFromComTests.IsTypeVisibleFromCom_NullType_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GenerateProgIdForTypeTests.GenerateProgIdForType_NullType_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.GenerateProgIdForTypeTests.GenerateProgIdForType_NullType_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GenerateProgIdForTypeTests.GenerateProgIdForType_ValidType_ReturnsExpected + info: [SKIP] System.Runtime.InteropServices.Tests.GenerateProgIdForTypeTests.GenerateProgIdForType_ValidType_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DefaultCharSetAttributeTests.Ctor_CharSet(charSet: -1) + info: [PASS] System.Runtime.InteropServices.Tests.DefaultCharSetAttributeTests.Ctor_CharSet(charSet: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DefaultCharSetAttributeTests.Ctor_CharSet(charSet: Unicode) + info: [PASS] System.Runtime.InteropServices.Tests.DefaultCharSetAttributeTests.Ctor_CharSet(charSet: Unicode) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DefaultCharSetAttributeTests.Ctor_CharSet(charSet: 5) + info: [PASS] System.Runtime.InteropServices.Tests.DefaultCharSetAttributeTests.Ctor_CharSet(charSet: 5) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ShortInterfaceType(interfaceType: -1) + info: [PASS] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ShortInterfaceType(interfaceType: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ShortInterfaceType(interfaceType: 3) + info: [PASS] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ShortInterfaceType(interfaceType: 3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ShortInterfaceType(interfaceType: 5) + info: [PASS] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ShortInterfaceType(interfaceType: 5) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ComInterfaceType(interfaceType: -1) + info: [PASS] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ComInterfaceType(interfaceType: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ComInterfaceType(interfaceType: InterfaceIsIInspectable) + info: [PASS] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ComInterfaceType(interfaceType: InterfaceIsIInspectable) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ComInterfaceType(interfaceType: 5) + info: [PASS] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ComInterfaceType(interfaceType: 5) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringMarshalingTests.TestUTF8String + info: [PASS] System.Runtime.InteropServices.Tests.StringMarshalingTests.TestUTF8String + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringMarshalingTests.StringToCoTaskMemAnsiToString + info: [PASS] System.Runtime.InteropServices.Tests.StringMarshalingTests.StringToCoTaskMemAnsiToString + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringMarshalingTests.StringToCoTaskMemUniToString + info: [PASS] System.Runtime.InteropServices.Tests.StringMarshalingTests.StringToCoTaskMemUniToString + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringMarshalingTests.TestNullString_UTF8 + info: [PASS] System.Runtime.InteropServices.Tests.StringMarshalingTests.TestNullString_UTF8 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringMarshalingTests.TestNullString + info: [PASS] System.Runtime.InteropServices.Tests.StringMarshalingTests.TestNullString + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringMarshalingTests.StringToHGlobalAnsiToString + info: [PASS] System.Runtime.InteropServices.Tests.StringMarshalingTests.StringToHGlobalAnsiToString + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringMarshalingTests.StringToBStrToString + info: [PASS] System.Runtime.InteropServices.Tests.StringMarshalingTests.StringToBStrToString + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringMarshalingTests.StringToHGlobalUniToString + info: [PASS] System.Runtime.InteropServices.Tests.StringMarshalingTests.StringToHGlobalUniToString + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_NullType_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_NullType_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(int)) + info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(int)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Int32*)) + info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Int32*)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Int32&)) + info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Int32&)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(string)) + info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(string)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(string[])) + info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(string[])) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.NonGenericClass)) + info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.NonGenericClass)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass)) + info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.AbstractClass)) + info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.AbstractClass)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.NonGenericStruct)) + info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.NonGenericStruct)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericStruct)) + info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericStruct)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.INonGenericInterface)) + info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.INonGenericInterface)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.IGenericInterface)) + info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.IGenericInterface)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass<>)) + info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass<>)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(T)) + info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(T)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests+ClassWithGuidAttribute)) + info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests+ClassWithGuidAttribute)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(Type)) + info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(Type)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_NotRuntimeType_ThrowsArgumentException + info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_NotRuntimeType_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_NullString_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_NullString_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pizza") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pizza") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pepperoni") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pepperoni") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "password") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "password") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "P4ssw0rdAa1") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "P4ssw0rdAa1") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "ßê┤") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "ßê┤") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "´┐¢´┐¢") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "´┐¢´┐¢") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "­ÉÇÇ") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "­ÉÇÇ") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "\0") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "\0") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "abc\0def") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "abc\0def") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_DisposedString_ThrowsObjectDisposedException + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_DisposedString_ThrowsObjectDisposedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComEventInterfaceAttributeTests.Ctor_DefaultInterface(sourceInterface: null, eventProvider: null) + info: [PASS] System.Runtime.InteropServices.Tests.ComEventInterfaceAttributeTests.Ctor_DefaultInterface(sourceInterface: null, eventProvider: null) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComEventInterfaceAttributeTests.Ctor_DefaultInterface(sourceInterface: typeof(int), eventProvider: typeof(string)) + info: [PASS] System.Runtime.InteropServices.Tests.ComEventInterfaceAttributeTests.Ctor_DefaultInterface(sourceInterface: typeof(int), eventProvider: typeof(string)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_ObjectNoBlittable_ThrowsArgumentException(structure: NonGenericClass { }) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_ObjectNoBlittable_ThrowsArgumentException(structure: NonGenericClass { }) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_GenericObject_ReturnsExpected + info: [FAIL] System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_GenericObject_ReturnsExpected + info: Assert.Equal() Failure: Strings differ + info: Expected: "hello" + info: Actual: null + info: at System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_GenericObject_ReturnsExpected() in C:\xr_dev\dotnetFork\runtime\src\libraries\System.Runtime.InteropServices\tests\System.Runtime.InteropServices.UnitTests\System\Runtime\InteropServices\Marshal\PtrToStructureTests.cs:line 110 + info: at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) in C:\xr_dev\dotnetFork\runtime\src\mono\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.Mono.cs:line 22 + info: at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in C:\xr_dev\dotnetFork\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs:line 57 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_ZeroPointer_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_ZeroPointer_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NullStructureType_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NullStructureType_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NonBlittablType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.PtrToStructureTests+AutoLayoutStruct)) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NonBlittablType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.PtrToStructureTests+AutoLayoutStruct)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NonBlittablType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.NonGenericClass)) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NonBlittablType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.NonGenericClass)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NonBlittablType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.AbstractClass)) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NonBlittablType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.AbstractClass)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericLayoutClass_Generic + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericLayoutClass_Generic + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_ZeroPointerWithType_ReturnsNull + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_ZeroPointerWithType_ReturnsNull + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericLayoutClass + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericLayoutClass + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NullStructure_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NullStructure_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NonRuntimeType_ThrowsArgumentException + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NonRuntimeType_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_CantCreateType_ThrowsArgumentException(structureType: typeof(T), exceptionType: typeof(System.ArgumentException)) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_CantCreateType_ThrowsArgumentException(structureType: typeof(T), exceptionType: typeof(System.ArgumentException)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_CantCreateType_ThrowsArgumentException(structureType: typeof(System.Int32*), exceptionType: typeof(System.MissingMethodException)) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_CantCreateType_ThrowsArgumentException(structureType: typeof(System.Int32*), exceptionType: typeof(System.MissingMethodException)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_CantCreateType_ThrowsArgumentException(structureType: typeof(System.Int32&), exceptionType: typeof(System.MissingMethodException)) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_CantCreateType_ThrowsArgumentException(structureType: typeof(System.Int32&), exceptionType: typeof(System.MissingMethodException)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_NonGenericObject_ReturnsExpected + info: [FAIL] System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_NonGenericObject_ReturnsExpected + info: Assert.Equal() Failure: Strings differ + info: Expected: "hello" + info: Actual: null + info: at System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_NonGenericObject_ReturnsExpected() in C:\xr_dev\dotnetFork\runtime\src\libraries\System.Runtime.InteropServices\tests\System.Runtime.InteropServices.UnitTests\System\Runtime\InteropServices\Marshal\PtrToStructureTests.cs:line 84 + info: at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) in C:\xr_dev\dotnetFork\runtime\src\mono\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.Mono.cs:line 22 + info: at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in C:\xr_dev\dotnetFork\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs:line 57 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_AutoLayoutClass_ThrowsArgumentException + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_AutoLayoutClass_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass)) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass<>)) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass<>)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.GenericStruct)) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.GenericStruct)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.GenericStruct<>)) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.GenericStruct<>)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.IGenericInterface)) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.IGenericInterface)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.IGenericInterface<>)) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.IGenericInterface<>)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_NonGenericType_ReturnsExpected + info: [FAIL] System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_NonGenericType_ReturnsExpected + info: Assert.Equal() Failure: Strings differ + info: Expected: "hello" + info: Actual: null + info: at System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_NonGenericType_ReturnsExpected() in C:\xr_dev\dotnetFork\runtime\src\libraries\System.Runtime.InteropServices\tests\System.Runtime.InteropServices.UnitTests\System\Runtime\InteropServices\Marshal\PtrToStructureTests.cs:line 32 + info: at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) in C:\xr_dev\dotnetFork\runtime\src\mono\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.Mono.cs:line 22 + info: at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in C:\xr_dev\dotnetFork\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs:line 57 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_ObjectNotValueClass_ThrowsArgumentException(structure: System.Runtime.InteropServices.Tests.Common.NonGenericStruct) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_ObjectNotValueClass_ThrowsArgumentException(structure: System.Runtime.InteropServices.Tests.Common.NonGenericStruct) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_ObjectNotValueClass_ThrowsArgumentException(structure: Value1) + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_ObjectNotValueClass_ThrowsArgumentException(structure: Value1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_GenericType_ReturnsExpected + info: [FAIL] System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_GenericType_ReturnsExpected + info: Assert.Equal() Failure: Strings differ + info: Expected: "hello" + info: Actual: null + info: at System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_GenericType_ReturnsExpected() in C:\xr_dev\dotnetFork\runtime\src\libraries\System.Runtime.InteropServices\tests\System.Runtime.InteropServices.UnitTests\System\Runtime\InteropServices\Marshal\PtrToStructureTests.cs:line 58 + info: at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) in C:\xr_dev\dotnetFork\runtime\src\mono\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.Mono.cs:line 22 + info: at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in C:\xr_dev\dotnetFork\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs:line 57 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetExceptionForHRTests.GetExceptionForHR_InvalidHR_ReturnsNull(errorCode: 0) + info: [PASS] System.Runtime.InteropServices.Tests.GetExceptionForHRTests.GetExceptionForHR_InvalidHR_ReturnsNull(errorCode: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetExceptionForHRTests.GetExceptionForHR_InvalidHR_ReturnsNull(errorCode: 1) + info: [PASS] System.Runtime.InteropServices.Tests.GetExceptionForHRTests.GetExceptionForHR_InvalidHR_ReturnsNull(errorCode: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetExceptionForHRTests.GetExceptionForHR_ThrowExceptionForHR_ThrowsSameException + info: [PASS] System.Runtime.InteropServices.Tests.GetExceptionForHRTests.GetExceptionForHR_ThrowExceptionForHR_ThrowsSameException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAutoTests.StringToHGlobalAuto_NullString_ReturnsZero + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAutoTests.StringToHGlobalAuto_NullString_ReturnsZero + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAutoTests.StringToHGlobalAuto_NonNullString_Roundtrips(s: "") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAutoTests.StringToHGlobalAuto_NonNullString_Roundtrips(s: "") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAutoTests.StringToHGlobalAuto_NonNullString_Roundtrips(s: "Hello World") + info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAutoTests.StringToHGlobalAuto_NonNullString_Roundtrips(s: "Hello World") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ReAllocCoTaskMemTests.ReAllocCoTaskMem_PositiveSize(size: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ReAllocCoTaskMemTests.ReAllocCoTaskMem_PositiveSize(size: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ReAllocCoTaskMemTests.ReAllocCoTaskMem_PositiveSize(size: 1) + info: [PASS] System.Runtime.InteropServices.Tests.ReAllocCoTaskMemTests.ReAllocCoTaskMem_PositiveSize(size: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ReAllocCoTaskMemTests.ReAllocCoTaskMem_PositiveSize(size: 100) + info: [PASS] System.Runtime.InteropServices.Tests.ReAllocCoTaskMemTests.ReAllocCoTaskMem_PositiveSize(size: 100) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ReAllocCoTaskMemTests.ReAllocCoTaskMem_Invoke_DataCopied + info: [PASS] System.Runtime.InteropServices.Tests.ReAllocCoTaskMemTests.ReAllocCoTaskMem_Invoke_DataCopied + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ZeroFreeGlobalAllocUnicodeTests.ZeroFreeGlobalAllocUnicode_Zero_Nop + info: [PASS] System.Runtime.InteropServices.Tests.ZeroFreeGlobalAllocUnicodeTests.ZeroFreeGlobalAllocUnicode_Zero_Nop + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ZeroFreeGlobalAllocUnicodeTests.ZeroFreeGlobalAllocUnicode_ValidPointer_Success + info: [PASS] System.Runtime.InteropServices.Tests.ZeroFreeGlobalAllocUnicodeTests.ZeroFreeGlobalAllocUnicode_ValidPointer_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: 0) + info: [PASS] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: 255) + info: [PASS] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: 255) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: 5) + info: [PASS] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: 5) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: 5) + info: [PASS] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: 5) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: "ExpectedValue") + info: [PASS] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: "ExpectedValue") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: null) + info: [PASS] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: null) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_InvalidOffset_ThrowsIndexOutOfRangeException(array: null, offset: -1) + info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_InvalidOffset_ThrowsIndexOutOfRangeException(array: null, offset: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_InvalidOffset_ThrowsIndexOutOfRangeException(array: null, offset: 1) + info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_InvalidOffset_ThrowsIndexOutOfRangeException(array: null, offset: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_InvalidOffset_ThrowsIndexOutOfRangeException(array: [1], offset: 5) + info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_InvalidOffset_ThrowsIndexOutOfRangeException(array: [1], offset: 5) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_InvalidOffset_ThrowsIndexOutOfRangeException(array: [2], offset: -1) + info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_InvalidOffset_ThrowsIndexOutOfRangeException(array: [2], offset: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_NotAnArray_ThrowsArgumentException + info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_NotAnArray_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_MultidimensionalArray_ThrowsArgumentException + info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_MultidimensionalArray_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: True) + info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: True) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: True) + info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: True) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: Object { }, expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: Object { }, expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: null, expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: null, expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_NonPrimitiveArray_ThrowsArgumentException(array: []) + info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_NonPrimitiveArray_ThrowsArgumentException(array: []) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_NonPrimitiveArray_ThrowsArgumentException(array: []) + info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_NonPrimitiveArray_ThrowsArgumentException(array: []) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_Array_Offset(array: null, offset: 0, expectedHashCode: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_Array_Offset(array: null, offset: 0, expectedHashCode: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_Array_Offset(array: [0, 0], offset: 2, expectedHashCode: 8) + info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_Array_Offset(array: [0, 0], offset: 2, expectedHashCode: 8) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_Array_Offset(array: [0, 0], offset: 3, expectedHashCode: 8) + info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_Array_Offset(array: [0, 0], offset: 3, expectedHashCode: 8) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_Array_Offset(array: [0, 0, 0, 0], offset: 1, expectedHashCode: 4) + info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_Array_Offset(array: [0, 0, 0, 0], offset: 1, expectedHashCode: 4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromDoubleTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromDoubleTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MinValueTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MinValueTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MinTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MinTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromNFloatTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromNFloatTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsRealNumberTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsRealNumberTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromIntPtrTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromIntPtrTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.SignTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.SignTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromInt64Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromInt64Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromDecimalTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromDecimalTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsNormalTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsNormalTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.NegativeOneTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.NegativeOneTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromInt128Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromInt128Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromUInt32Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromUInt32Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_SubtractionTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_SubtractionTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.GetExponentShortestBitLengthTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.GetExponentShortestBitLengthTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MinMagnitudeNumberTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MinMagnitudeNumberTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsFiniteTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsFiniteTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsSubnormalTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsSubnormalTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromInt32Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromInt32Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.TryWriteExponentBigEndianTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.TryWriteExponentBigEndianTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MaxTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MaxTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedIncrementTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedIncrementTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromHalfTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromHalfTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromInt16Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromInt16Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_UnaryNegationTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_UnaryNegationTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsNegativeInfinityTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsNegativeInfinityTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromCharTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromCharTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.RadixTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.RadixTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromUInt64Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromUInt64Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromIntPtrTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromIntPtrTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.Log2Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.Log2Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsNegativeTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsNegativeTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_DecrementTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_DecrementTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromDecimalTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromDecimalTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.GetSignificandBitLengthTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.GetSignificandBitLengthTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromUInt32Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromUInt32Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromInt128Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromInt128Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_ModulusTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_ModulusTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromDoubleTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromDoubleTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedDecrementTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedDecrementTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsCanonicalTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsCanonicalTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromSingleTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromSingleTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.GetExponentByteCountTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.GetExponentByteCountTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromUInt64Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromUInt64Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.AllBitsSetTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.AllBitsSetTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MaxNumberTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MaxNumberTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MaxMagnitudeTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MaxMagnitudeTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsPositiveTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsPositiveTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.TryWriteSignificandLittleEndianTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.TryWriteSignificandLittleEndianTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MultiplicativeIdentityTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MultiplicativeIdentityTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromUInt64Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromUInt64Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsOddIntegerTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsOddIntegerTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromSingleTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromSingleTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_InequalityTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_InequalityTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromDoubleTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromDoubleTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromInt32Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromInt32Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromCharTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromCharTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromInt128Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromInt128Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromSByteTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromSByteTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_AdditionTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_AdditionTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsPow2Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsPow2Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedSubtractionTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedSubtractionTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_GreaterThanOrEqualTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_GreaterThanOrEqualTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsZeroTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsZeroTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromUInt128Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromUInt128Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_LessThanTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_LessThanTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.OneTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.OneTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromUInt32Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromUInt32Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromIntPtrTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromIntPtrTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromUInt128Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromUInt128Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_MultiplyTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_MultiplyTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromDecimalTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromDecimalTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromSingleTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromSingleTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromInt32Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromInt32Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromCharTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromCharTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromInt16Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromInt16Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_LessThanOrEqualTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_LessThanOrEqualTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MaxMagnitudeNumberTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MaxMagnitudeNumberTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromUInt128Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromUInt128Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromByteTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromByteTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedUnaryNegationTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedUnaryNegationTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromSByteTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromSByteTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_EqualityTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_EqualityTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MaxValueTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MaxValueTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromUInt16Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromUInt16Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.TryWriteExponentLittleEndianTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.TryWriteExponentLittleEndianTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedMultiplyTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedMultiplyTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MinMagnitudeTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MinMagnitudeTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedDivisionTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedDivisionTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsEvenIntegerTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsEvenIntegerTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsPositiveInfinityTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsPositiveInfinityTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_DivisionTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_DivisionTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromNFloatTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromNFloatTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromByteTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromByteTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_GreaterThanTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_GreaterThanTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsImaginaryNumberTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsImaginaryNumberTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromHalfTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromHalfTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.ClampTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.ClampTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsInfinityTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsInfinityTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_UnaryPlusTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_UnaryPlusTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsNaNTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsNaNTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.GetSignificandByteCountTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.GetSignificandByteCountTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.TryWriteSignificandBigEndianTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.TryWriteSignificandBigEndianTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromByteTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromByteTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsIntegerTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsIntegerTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MinNumberTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MinNumberTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromHalfTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromHalfTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedAdditionTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedAdditionTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromInt64Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromInt64Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsComplexNumberTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsComplexNumberTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.AbsTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.AbsTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromUInt16Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromUInt16Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromUInt16Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromUInt16Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.AdditiveIdentityTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.AdditiveIdentityTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_IncrementTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_IncrementTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromInt16Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromInt16Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromNFloatTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromNFloatTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromSByteTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromSByteTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.ZeroTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.ZeroTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromInt64Test + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromInt64Test + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ClassInterfaceType(classInterfaceType: -1) + info: [PASS] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ClassInterfaceType(classInterfaceType: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ClassInterfaceType(classInterfaceType: None) + info: [PASS] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ClassInterfaceType(classInterfaceType: None) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ClassInterfaceType(classInterfaceType: 4) + info: [PASS] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ClassInterfaceType(classInterfaceType: 4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ShortClassInterfaceType(classInterfaceType: -1) + info: [PASS] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ShortClassInterfaceType(classInterfaceType: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ShortClassInterfaceType(classInterfaceType: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ShortClassInterfaceType(classInterfaceType: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ShortClassInterfaceType(classInterfaceType: 4) + info: [PASS] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ShortClassInterfaceType(classInterfaceType: 4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_InvalidType_ThrowsArgumentException + info: [SKIP] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_InvalidType_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_Unix_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_Unix_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_ZeroUnknown_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_ZeroUnknown_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_UncastableObject_ThrowsInvalidCastException + info: [SKIP] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_UncastableObject_ThrowsInvalidCastException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_ArrayType_ThrowsBadImageFormatException + info: [SKIP] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_ArrayType_ThrowsBadImageFormatException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_NullType_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_NullType_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_ValidPointer_ReturnsExpected + info: [SKIP] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_ValidPointer_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.UnsafeAddrOfPinnedArrayElementTests.UnsafeAddrOfPinnedArrayElement_GenericStructureArray_ReturnsExpected + info: [PASS] System.Runtime.InteropServices.Tests.UnsafeAddrOfPinnedArrayElementTests.UnsafeAddrOfPinnedArrayElement_GenericStructureArray_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.UnsafeAddrOfPinnedArrayElementTests.UnsafeAddrOfPinnedArrayElement_NonGenericPrimitiveArray_ReturnsExpected + info: [PASS] System.Runtime.InteropServices.Tests.UnsafeAddrOfPinnedArrayElementTests.UnsafeAddrOfPinnedArrayElement_NonGenericPrimitiveArray_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.UnsafeAddrOfPinnedArrayElementTests.UnsafeAddrOfPinnedArrayElement_NonGenericStructureArray_ReturnsExpected + info: [PASS] System.Runtime.InteropServices.Tests.UnsafeAddrOfPinnedArrayElementTests.UnsafeAddrOfPinnedArrayElement_NonGenericStructureArray_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.UnsafeAddrOfPinnedArrayElementTests.UnsafeAddrOfPinnedArrayElement_NullArray_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.UnsafeAddrOfPinnedArrayElementTests.UnsafeAddrOfPinnedArrayElement_NullArray_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.UnsafeAddrOfPinnedArrayElementTests.UnsafeAddrOfPinnedArrayElement_GenericPrimitiveArray_ReturnsExpected + info: [PASS] System.Runtime.InteropServices.Tests.UnsafeAddrOfPinnedArrayElementTests.UnsafeAddrOfPinnedArrayElement_GenericPrimitiveArray_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 789, obj: 789, expected: True) + info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 789, obj: 789, expected: True) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 789, obj: 0, expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 789, obj: 0, expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 0, obj: 0, expected: True) + info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 0, obj: 0, expected: True) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 789, obj: null, expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 789, obj: null, expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 789, obj: "789", expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 789, obj: "789", expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 789, obj: 789, expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 789, obj: 789, expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.Ctor_UInt + info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.Ctor_UInt + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.Ctor_NUInt + info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.Ctor_NUInt + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.ToStringTest(value: 0, expected: "0") + info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.ToStringTest(value: 0, expected: "0") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.ToStringTest(value: 4567, expected: "4567") + info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.ToStringTest(value: 4567, expected: "4567") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.ToStringTest(value: 4294967295, expected: "4294967295") + info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.ToStringTest(value: 4294967295, expected: "4294967295") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.Size + info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.Size + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.Ctor_NUInt_OutOfRange + info: [SKIP] System.Runtime.InteropServices.Tests.CULongTests.Ctor_NUInt_OutOfRange + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.Ctor_Empty + info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.Ctor_Empty + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.Ctor_NUInt_LargeValue + info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.Ctor_NUInt_LargeValue + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException + info: [PASS] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_NullSource_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_NullSource_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) + info: [PASS] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) + info: [PASS] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) + info: [PASS] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException + info: [PASS] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) + info: [PASS] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.IntPtrTests.WriteIntPtr_Pointer_Roundtrips(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) + info: [PASS] System.Runtime.InteropServices.Tests.IntPtrTests.WriteIntPtr_Pointer_Roundtrips(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ByteTests.WriteByte_Pointer_Roundtrips(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) + info: [PASS] System.Runtime.InteropServices.Tests.ByteTests.WriteByte_Pointer_Roundtrips(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.LastErrorTests.SetLastPInvokeError_GetLastWin32Error + info: [PASS] System.Runtime.InteropServices.Tests.LastErrorTests.SetLastPInvokeError_GetLastWin32Error + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.LastErrorTests.LastPInvokeError_RoundTrip + info: [PASS] System.Runtime.InteropServices.Tests.LastErrorTests.LastPInvokeError_RoundTrip + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.LastErrorTests.LastSystemError_RoundTrip + info: [PASS] System.Runtime.InteropServices.Tests.LastErrorTests.LastSystemError_RoundTrip + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.LastErrorTests.SetLastSystemError_PInvokeErrorUnchanged + info: [PASS] System.Runtime.InteropServices.Tests.LastErrorTests.SetLastSystemError_PInvokeErrorUnchanged + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.LCIDConversionAttributeTests.Ctor_Lcid(lcid: -1) + info: [PASS] System.Runtime.InteropServices.Tests.LCIDConversionAttributeTests.Ctor_Lcid(lcid: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.LCIDConversionAttributeTests.Ctor_Lcid(lcid: 0) + info: [PASS] System.Runtime.InteropServices.Tests.LCIDConversionAttributeTests.Ctor_Lcid(lcid: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.LCIDConversionAttributeTests.Ctor_Lcid(lcid: 1) + info: [PASS] System.Runtime.InteropServices.Tests.LCIDConversionAttributeTests.Ctor_Lcid(lcid: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.LCIDConversionAttributeTests.Exists + info: [PASS] System.Runtime.InteropServices.Tests.LCIDConversionAttributeTests.Exists + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ReleaseComObjectTests.ReleaseComObject_NullObject_ThrowsNullReferenceException + info: [SKIP] System.Runtime.InteropServices.Tests.ReleaseComObjectTests.ReleaseComObject_NullObject_ThrowsNullReferenceException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ReleaseComObjectTests.ReleaseComObject_Unix_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.Tests.ReleaseComObjectTests.ReleaseComObject_Unix_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ReleaseComObjectTests.ReleaseComObject_NonComObject_ThrowsArgumentException + info: [SKIP] System.Runtime.InteropServices.Tests.ReleaseComObjectTests.ReleaseComObject_NonComObject_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromCLSID_Unix + info: [PASS] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromCLSID_Unix + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromCLSID_CLSIDExists_ReturnsExpected + info: [SKIP] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromCLSID_CLSIDExists_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromCLSID_CLSIDExists_Server_ReturnsExpected + info: [SKIP] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromCLSID_CLSIDExists_Server_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromProgID_ReturnsExpected + info: [SKIP] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromProgID_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromProgID_Unix + info: [PASS] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromProgID_Unix + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromCLSID_NoSuchCLSIDExists_ReturnsExpected + info: [SKIP] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromCLSID_NoSuchCLSIDExists_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ReAllocHGlobalTests.ReAllocHGlobal_PositiveSize(size: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ReAllocHGlobalTests.ReAllocHGlobal_PositiveSize(size: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ReAllocHGlobalTests.ReAllocHGlobal_PositiveSize(size: 1) + info: [PASS] System.Runtime.InteropServices.Tests.ReAllocHGlobalTests.ReAllocHGlobal_PositiveSize(size: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ReAllocHGlobalTests.ReAllocHGlobal_PositiveSize(size: 100) + info: [PASS] System.Runtime.InteropServices.Tests.ReAllocHGlobalTests.ReAllocHGlobal_PositiveSize(size: 100) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ReAllocHGlobalTests.ReAllocHGlobal_Invoke_DataCopied + info: [PASS] System.Runtime.InteropServices.Tests.ReAllocHGlobalTests.ReAllocHGlobal_Invoke_DataCopied + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ReAllocHGlobalTests.ReAllocHGlobal_NegativeSize_ThrowsOutOfMemoryException + info: [PASS] System.Runtime.InteropServices.Tests.ReAllocHGlobalTests.ReAllocHGlobal_NegativeSize_ThrowsOutOfMemoryException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_NullStructureType_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_NullStructureType_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_NonGeneric_Success + info: [PASS] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_NonGeneric_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_Blittable_Success + info: [PASS] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_Blittable_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_AutoLayout_ThrowsArgumentException + info: [PASS] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_AutoLayout_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_NestedNonBlittableStruct_Success + info: [PASS] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_NestedNonBlittableStruct_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_ZeroPointer_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_ZeroPointer_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_Generic_Success + info: [PASS] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_Generic_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringAutoTests.PtrToStringAuto_ZeroPtrWithLength_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringAutoTests.PtrToStringAuto_ZeroPtrWithLength_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringAutoTests.PtrToStringAuto_ZeroPtrNoLength_ReturnsNull + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringAutoTests.PtrToStringAuto_ZeroPtrNoLength_ReturnsNull + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringAutoTests.PtrToStringAuto_NegativeLength_ThrowsArgumentOutOfRangeException + info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringAutoTests.PtrToStringAuto_NegativeLength_ThrowsArgumentOutOfRangeException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.FreeTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.FreeTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocNullPtrOOMTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocNullPtrOOMTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocNonPowerOfTwoAlignmentTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocNonPowerOfTwoAlignmentTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocNullPtrZeroSizeTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocNullPtrZeroSizeTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyEmptyBlockShouldNoOpTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyEmptyBlockShouldNoOpTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedByteCountOOMTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedByteCountOOMTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocZeroSizeTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocZeroSizeTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedElementCountOOMTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedElementCountOOMTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocByteCountTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocByteCountTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithNullPointerAndZeroByteCountTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithNullPointerAndZeroByteCountTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.FillNullMemoryBlockShouldNoOpTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.FillNullMemoryBlockShouldNoOpTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocByteCountOOMTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocByteCountOOMTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroElementCountTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroElementCountTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyToOverlappedMemoryTest(size: 311, offset: 100, byteCount: 50) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyToOverlappedMemoryTest(size: 311, offset: 100, byteCount: 50) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyToOverlappedMemoryTest(size: 33, offset: 0, byteCount: 12) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyToOverlappedMemoryTest(size: 33, offset: 0, byteCount: 12) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyToOverlappedMemoryTest(size: 150, offset: 50, byteCount: 100) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyToOverlappedMemoryTest(size: 150, offset: 50, byteCount: 100) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocOverflowByteCountTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocOverflowByteCountTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 1, destinationSize: 1, byteCount: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 1, destinationSize: 1, byteCount: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 7, destinationSize: 9, byteCount: 5) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 7, destinationSize: 9, byteCount: 5) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 1, destinationSize: 16, byteCount: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 1, destinationSize: 16, byteCount: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 16, destinationSize: 16, byteCount: 16) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 16, destinationSize: 16, byteCount: 16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 29, destinationSize: 37, byteCount: 19) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 29, destinationSize: 37, byteCount: 19) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 1024, destinationSize: 16, byteCount: 16) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 1024, destinationSize: 16, byteCount: 16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocSmallerToLargerTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocSmallerToLargerTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithSizeEqualTo0ShouldNoOpTest(offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithSizeEqualTo0ShouldNoOpTest(offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithSizeEqualTo0ShouldNoOpTest(offset: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithSizeEqualTo0ShouldNoOpTest(offset: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithSizeEqualTo0ShouldNoOpTest(offset: 167) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithSizeEqualTo0ShouldNoOpTest(offset: 167) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedZeroElementSizeTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedZeroElementSizeTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocZeroSizeTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocZeroSizeTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocNullPtrTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocNullPtrTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 1048576) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 1048576) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 65536) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 65536) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 16384) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 16384) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 8192) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 8192) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 4096) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 4096) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 2048) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 2048) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 1024) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 1024) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 2097152) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 2097152) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 512) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 512) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 128) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 128) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 64) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 64) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 32) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 32) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 16) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 8) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 8) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 4) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 2) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 256) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 256) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 4194304) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 4194304) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedByteCountTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedByteCountTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.FillEmptyMemoryBlockShouldNoOpTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.FillEmptyMemoryBlockShouldNoOpTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 1, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 1, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 512, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 512, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 256, offset: 5) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 256, offset: 5) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 256, offset: 3) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 256, offset: 3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 256, offset: 2) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 256, offset: 2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 256, offset: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 256, offset: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 256, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 256, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 128, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 128, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 64, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 64, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 32, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 32, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 16, offset: 7) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 16, offset: 7) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 16, offset: 3) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 16, offset: 3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 16, offset: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 16, offset: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 16, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 16, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 9, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 9, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 8, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 8, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 4, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 4, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 3, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 3, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 2, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 2, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 1, offset: 3) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 1, offset: 3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 1, offset: 2) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 1, offset: 2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 1, offset: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 1, offset: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 547, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 547, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 1024, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 1024, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocElementCountOOMTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocElementCountOOMTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocNullPtrZeroSizeTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocNullPtrZeroSizeTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroByteCountTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroByteCountTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocSmallerToLargerTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocSmallerToLargerTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocLessThanVoidPtrAlignmentTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocLessThanVoidPtrAlignmentTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocZeroSizeTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocZeroSizeTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocOOMTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocOOMTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedZeroElementCountTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedZeroElementCountTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocNonPowerOfTwoAlignmentTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocNonPowerOfTwoAlignmentTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedZeroByteCountTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedZeroByteCountTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocNullPtrTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocNullPtrTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedFreeTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedFreeTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocZeroAlignmentTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocZeroAlignmentTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocZeroAlignmentTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocZeroAlignmentTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 5) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 5) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 3) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 2) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 128, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 128, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 64, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 64, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 32, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 32, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 16, offset: 7) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 16, offset: 7) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 16, offset: 3) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 16, offset: 3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 16, offset: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 16, offset: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 16, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 16, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 9, offset: 289) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 9, offset: 289) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 9, offset: 111) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 9, offset: 111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 9, offset: 2) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 9, offset: 2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 9, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 9, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 8, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 8, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 4, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 4, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 3, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 3, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 2, offset: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 2, offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 367) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 367) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 44) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 44) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 3) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 2) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 67) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 67) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 143) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 143) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocNullPtrOOMTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocNullPtrOOMTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocLessThanVoidPtrAlignmentTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocLessThanVoidPtrAlignmentTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedElementCountTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedElementCountTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 1048576) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 1048576) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 65536) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 65536) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 16384) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 16384) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 8192) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 8192) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 4096) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 4096) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 2048) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 2048) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 1024) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 1024) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 2097152) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 2097152) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 512) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 512) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 128) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 128) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 64) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 64) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 32) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 32) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 16) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 8) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 8) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 4) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 2) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 256) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 256) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 4194304) + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 4194304) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocElementCountTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocElementCountTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyNullBlockShouldNoOpTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyNullBlockShouldNoOpTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroElementSizeTest + info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroElementSizeTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetIDispatchForObjectTests.GetIDispatchForObject_NullObject_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.GetIDispatchForObjectTests.GetIDispatchForObject_NullObject_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetIDispatchForObjectTests.GetIDispatchForObject_NetCore_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.Tests.GetIDispatchForObjectTests.GetIDispatchForObject_NetCore_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetIDispatchForObjectTests.GetIDispatchForObject_NonDispatchObject_ThrowsInvalidCastException + info: [SKIP] System.Runtime.InteropServices.Tests.GetIDispatchForObjectTests.GetIDispatchForObject_NonDispatchObject_ThrowsInvalidCastException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_NullString_ReturnsZero + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_NullString_ReturnsZero + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pizza") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pizza") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pepperoni") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pepperoni") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "password") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "password") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "P4ssw0rdAa1") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "P4ssw0rdAa1") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "ßê┤") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "ßê┤") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "´┐¢´┐¢") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "´┐¢´┐¢") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "­ÉÇÇ") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "­ÉÇÇ") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "\0") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "\0") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "abc\0def") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "abc\0def") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_NullString_ReturnsZero + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_NullString_ReturnsZero + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "pizza") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "pizza") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "pepperoni") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "pepperoni") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "password") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "password") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "P4ssw0rdAa1") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "P4ssw0rdAa1") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "ßê┤") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "ßê┤") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "´┐¢´┐¢") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "´┐¢´┐¢") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "­ÉÇÇ") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "­ÉÇÇ") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "\0") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "\0") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "abc\0def") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "abc\0def") + info: Collecting garbage after test... + info: [STRT] System.Tests.DllNotFoundExceptionTests.Ctor_String + info: [PASS] System.Tests.DllNotFoundExceptionTests.Ctor_String + info: Collecting garbage after test... + info: [STRT] System.Tests.DllNotFoundExceptionTests.Ctor_Default + info: [PASS] System.Tests.DllNotFoundExceptionTests.Ctor_Default + info: Collecting garbage after test... + info: [STRT] System.Tests.DllNotFoundExceptionTests.Ctor_String_Exception + info: [PASS] System.Tests.DllNotFoundExceptionTests.Ctor_String_Exception + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_NullString_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_NullString_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "pizza") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "pizza") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "pepperoni") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "pepperoni") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "password") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "password") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "P4ssw0rdAa1") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "P4ssw0rdAa1") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "ßê┤") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "ßê┤") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "´┐¢´┐¢") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "´┐¢´┐¢") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "­ÉÇÇ") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "­ÉÇÇ") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "\0") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "\0") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "abc\0def") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "abc\0def") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_DisposedString_ThrowsObjectDisposedException + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_DisposedString_ThrowsObjectDisposedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComConversionLossAttributeTests.Exists + info: [PASS] System.Runtime.InteropServices.Tests.ComConversionLossAttributeTests.Exists + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.AddrOfPinnedObject_NotInitialized_ThrowsException + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.AddrOfPinnedObject_NotInitialized_ThrowsException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Ctor_Default_Pinned + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Ctor_Default_Pinned + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected_Genenic + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected_Genenic + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.AddrOfPinnedObject_ReturnsArrayData + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.AddrOfPinnedObject_ReturnsArrayData + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Dispose_NotInitialized_NoThrow + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Dispose_NotInitialized_NoThrow + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.FromIntPtr_Zero_ThrowsInvalidOperationException + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.FromIntPtr_Zero_ThrowsInvalidOperationException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: null) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: null) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: "String") + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: "String") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: 123) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: 123) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: [0]) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: [0]) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: [System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable]) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: [System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable]) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: [null]) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: [null]) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.FromIntPtr_Generic_Zero_NoCheck + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.FromIntPtr_Generic_Zero_NoCheck + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: null, type: Normal) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: null, type: Normal) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: null, type: Weak) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: null, type: Weak) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: null, type: WeakTrackResurrection) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: null, type: WeakTrackResurrection) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: "String", type: Normal) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: "String", type: Normal) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: "String", type: Weak) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: "String", type: Weak) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: "String", type: WeakTrackResurrection) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: "String", type: WeakTrackResurrection) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: 123, type: Normal) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: 123, type: Normal) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: 123, type: Weak) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: 123, type: Weak) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: 123, type: WeakTrackResurrection) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: 123, type: WeakTrackResurrection) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [0], type: Normal) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [0], type: Normal) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [0], type: Weak) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [0], type: Weak) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [0], type: WeakTrackResurrection) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [0], type: WeakTrackResurrection) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable], type: Normal) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable], type: Normal) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable], type: Weak) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable], type: Weak) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable], type: WeakTrackResurrection) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable], type: WeakTrackResurrection) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [null], type: Normal) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [null], type: Normal) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [null], type: Weak) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [null], type: Weak) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [null], type: WeakTrackResurrection) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [null], type: WeakTrackResurrection) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable, type: Normal) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable, type: Normal) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable, type: Weak) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable, type: Weak) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable, type: WeakTrackResurrection) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable, type: WeakTrackResurrection) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: null, type: Pinned) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: null, type: Pinned) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: "", type: Pinned) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: "", type: Pinned) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: 1, type: Pinned) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: 1, type: Pinned) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: Object { }, type: Pinned) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: Object { }, type: Pinned) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+Blittable, type: Pinned) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+Blittable, type: Pinned) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+Blittable, type: Pinned) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+Blittable, type: Pinned) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [], type: Pinned) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [], type: Pinned) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+UnmanagedNonBlittable, type: Pinned) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+UnmanagedNonBlittable, type: Pinned) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [], type: Pinned) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [], type: Pinned) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: ClassWithoutReferences { _field = 0 }, type: Pinned) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: ClassWithoutReferences { _field = 0 }, type: Pinned) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Free_NotInitialized_ThrowsInvalidOperationException + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Free_NotInitialized_ThrowsInvalidOperationException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Equals_Object_ReturnsExpected(handle: System.Runtime.InteropServices.GCHandle, other: System.Runtime.InteropServices.GCHandle, expected: True) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Equals_Object_ReturnsExpected(handle: System.Runtime.InteropServices.GCHandle, other: System.Runtime.InteropServices.GCHandle, expected: True) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Equals_Object_ReturnsExpected(handle: System.Runtime.InteropServices.GCHandle, other: System.Runtime.InteropServices.GCHandle, expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Equals_Object_ReturnsExpected(handle: System.Runtime.InteropServices.GCHandle, other: System.Runtime.InteropServices.GCHandle, expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Equals_Object_ReturnsExpected(handle: System.Runtime.InteropServices.GCHandle, other: Object { }, expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Equals_Object_ReturnsExpected(handle: System.Runtime.InteropServices.GCHandle, other: Object { }, expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Equals_Object_ReturnsExpected(handle: System.Runtime.InteropServices.GCHandle, other: null, expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Equals_Object_ReturnsExpected(handle: System.Runtime.InteropServices.GCHandle, other: null, expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Ctor_Default_Weak + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Ctor_Default_Weak + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidPinnedObject_ThrowsArgumentException(value: System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidPinnedObject_ThrowsArgumentException(value: System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidPinnedObject_ThrowsArgumentException(value: ClassWithReferences { _field = null }) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidPinnedObject_ThrowsArgumentException(value: ClassWithReferences { _field = null }) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidPinnedObject_ThrowsArgumentException(value: []) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidPinnedObject_ThrowsArgumentException(value: []) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidPinnedObject_ThrowsArgumentException(value: []) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidPinnedObject_ThrowsArgumentException(value: []) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidPinnedObject_ThrowsArgumentException(value: []) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidPinnedObject_ThrowsArgumentException(value: []) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.AddrOfPinnedObject_NotPinned_ThrowsInvalidOperationException + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.AddrOfPinnedObject_NotPinned_ThrowsInvalidOperationException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Ctor_Default + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Ctor_Default + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.AddrOfPinnedObject_ReturnsStringData + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.AddrOfPinnedObject_ReturnsStringData + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidGCHandleType_ThrowsArgumentOutOfRangeException(type: -1) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidGCHandleType_ThrowsArgumentOutOfRangeException(type: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidGCHandleType_ThrowsArgumentOutOfRangeException(type: 4) + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidGCHandleType_ThrowsArgumentOutOfRangeException(type: 4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Ctor_Default_Generic + info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Ctor_Default_Generic + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAutoTests.StringToCoTaskMemAuto_NullString_ReturnsZero + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAutoTests.StringToCoTaskMemAuto_NullString_ReturnsZero + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAutoTests.StringToCoTaskMemAuto_NonNullString_Roundtrips(s: "") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAutoTests.StringToCoTaskMemAuto_NonNullString_Roundtrips(s: "") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAutoTests.StringToCoTaskMemAuto_NonNullString_Roundtrips(s: "Hello World") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAutoTests.StringToCoTaskMemAuto_NonNullString_Roundtrips(s: "Hello World") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAutoTests.StringToCoTaskMemAuto_PtrToStringAuto_ReturnsExpected(len: 0) + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAutoTests.StringToCoTaskMemAuto_PtrToStringAuto_ReturnsExpected(len: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAutoTests.StringToCoTaskMemAuto_PtrToStringAuto_ReturnsExpected(len: 5) + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAutoTests.StringToCoTaskMemAuto_PtrToStringAuto_ReturnsExpected(len: 5) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComUnregisterFunctionAttributeTests.Exists + info: [PASS] System.Runtime.InteropServices.Tests.ComUnregisterFunctionAttributeTests.Exists + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DllImportAttributeTests.Ctor_SourceInterfaces(dllName: null) + info: [PASS] System.Runtime.InteropServices.Tests.DllImportAttributeTests.Ctor_SourceInterfaces(dllName: null) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DllImportAttributeTests.Ctor_SourceInterfaces(dllName: "DllName") + info: [PASS] System.Runtime.InteropServices.Tests.DllImportAttributeTests.Ctor_SourceInterfaces(dllName: "DllName") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_ShortFlags(flags: -1) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_ShortFlags(flags: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_ShortFlags(flags: 0) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_ShortFlags(flags: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_ShortFlags(flags: 4) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_ShortFlags(flags: 4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_TypeLibFuncFlags(flags: -1) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_TypeLibFuncFlags(flags: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_TypeLibFuncFlags(flags: 0) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_TypeLibFuncFlags(flags: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_TypeLibFuncFlags(flags: FBindable) + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_TypeLibFuncFlags(flags: FBindable) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComCompatibleVersionAttributeTests.Ctor_Major_Minor_Build_Revision(major: -1, minor: -2, build: -3, revision: -4) + info: [PASS] System.Runtime.InteropServices.Tests.ComCompatibleVersionAttributeTests.Ctor_Major_Minor_Build_Revision(major: -1, minor: -2, build: -3, revision: -4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComCompatibleVersionAttributeTests.Ctor_Major_Minor_Build_Revision(major: 0, minor: 0, build: 0, revision: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ComCompatibleVersionAttributeTests.Ctor_Major_Minor_Build_Revision(major: 0, minor: 0, build: 0, revision: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComCompatibleVersionAttributeTests.Ctor_Major_Minor_Build_Revision(major: 1, minor: 2, build: 3, revision: 4) + info: [PASS] System.Runtime.InteropServices.Tests.ComCompatibleVersionAttributeTests.Ctor_Major_Minor_Build_Revision(major: 1, minor: 2, build: 3, revision: 4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComCompatibleVersionAttributeTests.Exists + info: [PASS] System.Runtime.InteropServices.Tests.ComCompatibleVersionAttributeTests.Exists + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThanOrEqual(left: 789, right: 789) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThanOrEqual(left: 789, right: 789) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThanOrEqual(left: 789, right: -789) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThanOrEqual(left: 789, right: -789) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThanOrEqual(left: 789, right: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThanOrEqual(left: 789, right: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThanOrEqual(left: 789, right: 1000) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThanOrEqual(left: 789, right: 1000) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt64(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt64(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt64(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt64(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt64(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt64(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt64(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt64(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt64(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt64(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.8414709848078965, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.8414709848078965, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.97877093770393309, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.97877093770393309, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 1, expectedResult: 0.5, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 1, expectedResult: 0.5, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.90929742682568171, expectedResult: 0.36338022763241867, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.90929742682568171, expectedResult: 0.36338022763241867, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.82148283122563881, expectedResult: 0.30685281944005471, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.82148283122563881, expectedResult: 0.30685281944005471, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.79569320156748091, expectedResult: 0.29289321881345248, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.79569320156748091, expectedResult: 0.29289321881345248, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.62426595263969908, expectedResult: 0.21460183660255169, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.62426595263969908, expectedResult: 0.21460183660255169, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: -0.3924695585627842, expectedResult: -0.12837916709551256, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: -0.3924695585627842, expectedResult: -0.12837916709551256, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: -0.96390253284987737, expectedResult: -0.41421356237309503, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: -0.96390253284987737, expectedResult: -0.41421356237309503, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: -0.98383852942436245, expectedResult: -0.44269504088896339, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: -0.98383852942436245, expectedResult: -0.44269504088896339, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: -0.97536797208363135, expectedResult: -0.42920367320510339, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: -0.97536797208363135, expectedResult: -0.42920367320510339, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.81376384817462333, expectedResult: 0.30258509299404568, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.81376384817462333, expectedResult: 0.30258509299404568, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.77394268526670829, expectedResult: 0.28171817154095474, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.77394268526670829, expectedResult: 0.28171817154095474, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: -0.43030121700009227, expectedResult: -0.14159265358979323, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: -0.43030121700009227, expectedResult: -0.14159265358979323, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSByte(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSByte(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSByte(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSByte(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSByte(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSByte(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSByte(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSByte(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSByte(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSByte(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NaNEqualsTest + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NaNEqualsTest + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CharToNFloat(value: 'A') + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CharToNFloat(value: 'A') + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CharToNFloat(value: 'B') + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CharToNFloat(value: 'B') + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CharToNFloat(value: 'C') + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CharToNFloat(value: 'C') + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CharToNFloat(value: 'D') + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CharToNFloat(value: 'D') + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CharToNFloat(value: 'E') + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CharToNFloat(value: 'E') + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -Infinity, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -Infinity, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 0, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 0, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 1.0811811619898573, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 1.0811811619898573, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 1.7182818284590451, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 1.7182818284590451, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 3.3313150290214524, expectedResult: 0.63661977236758138, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 3.3313150290214524, expectedResult: 0.63661977236758138, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 3.9334096679145962, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 3.9334096679145962, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 4.0945611704512963, expectedResult: 0.70710678118654757, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 4.0945611704512963, expectedResult: 0.70710678118654757, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 5.1009598002416938, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 5.1009598002416938, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 12.439377934644401, expectedResult: 1.1283791670955126, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 12.439377934644401, expectedResult: 1.1283791670955126, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 24.954553519470082, expectedResult: 1.4142135623730949, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 24.954553519470082, expectedResult: 1.4142135623730949, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 26.713733786437789, expectedResult: 1.4426950408889634, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 26.713733786437789, expectedResult: 1.4426950408889634, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 36.221710484165165, expectedResult: 1.5707963267948966, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 36.221710484165165, expectedResult: 1.5707963267948966, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 199.71743249053009, expectedResult: 2.3025850929940459, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 199.71743249053009, expectedResult: 2.3025850929940459, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 521.73529967043669, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 521.73529967043669, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 9, expectedResult: 1, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 9, expectedResult: 1, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.51950362694813135, expectedResult: -0.31830988618379069, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.51950362694813135, expectedResult: -0.31830988618379069, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.63212055882855767, expectedResult: -0.43429448190325182, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.63212055882855767, expectedResult: -0.43429448190325182, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.76912323548399941, expectedResult: -0.63661977236758138, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.76912323548399941, expectedResult: -0.63661977236758138, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -3.1415926535897931, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -3.1415926535897931, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -2.7182818284590451, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -2.7182818284590451, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -1.4142135623730949, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -1.4142135623730949, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -1, expectedResult: -Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -1, expectedResult: -Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.99808698589777567, expectedResult: -2.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.99808698589777567, expectedResult: -2.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.99501787170355926, expectedResult: -2.3025850929940459, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.99501787170355926, expectedResult: -2.3025850929940459, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.9731339589988639, expectedResult: -1.5707963267948966, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.9731339589988639, expectedResult: -1.5707963267948966, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.9639168071792128, expectedResult: -1.4426950408889634, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.9639168071792128, expectedResult: -1.4426950408889634, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.96147111529967799, expectedResult: -1.4142135623730949, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.96147111529967799, expectedResult: -1.4142135623730949, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.92559179413935733, expectedResult: -1.1283791670955126, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.92559179413935733, expectedResult: -1.1283791670955126, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.90000000000000002, expectedResult: -1, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.90000000000000002, expectedResult: -1, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.83609136386042338, expectedResult: -0.78539816339744828, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.83609136386042338, expectedResult: -0.78539816339744828, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.80371224006494435, expectedResult: -0.70710678118654757, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.80371224006494435, expectedResult: -0.70710678118654757, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.79730043371348269, expectedResult: -0.69314718055994529, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.79730043371348269, expectedResult: -0.69314718055994529, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 1384.4557313670111, expectedResult: 3.1415926535897931, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 1384.4557313670111, expectedResult: 3.1415926535897931, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: -Infinity, value2: -Infinity, amount: 0.5, expectedResult: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: -Infinity, value2: -Infinity, amount: 0.5, expectedResult: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 4, value2: 2, amount: 0.5, expectedResult: 3) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 4, value2: 2, amount: 0.5, expectedResult: 3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 4, value2: 2, amount: 0, expectedResult: 4) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 4, value2: 2, amount: 0, expectedResult: 4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 3, value2: 1, amount: 2, expectedResult: -1) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 3, value2: 1, amount: 2, expectedResult: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 3, value2: 1, amount: 1, expectedResult: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 3, value2: 1, amount: 1, expectedResult: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 3, value2: 1, amount: 0.5, expectedResult: 2) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 3, value2: 1, amount: 0.5, expectedResult: 2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 3, value2: 1, amount: 0, expectedResult: 3) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 3, value2: 1, amount: 0, expectedResult: 3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 2, value2: 4, amount: 2, expectedResult: 6) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 2, value2: 4, amount: 2, expectedResult: 6) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 2, value2: 4, amount: 1, expectedResult: 4) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 2, value2: 4, amount: 1, expectedResult: 4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 2, value2: 4, amount: 0.5, expectedResult: 3) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 2, value2: 4, amount: 0.5, expectedResult: 3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 2, value2: 4, amount: 0, expectedResult: 2) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 2, value2: 4, amount: 0, expectedResult: 2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 1, value2: 3, amount: 2, expectedResult: 5) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 1, value2: 3, amount: 2, expectedResult: 5) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 1, value2: 3, amount: 1, expectedResult: 3) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 1, value2: 3, amount: 1, expectedResult: 3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 1, value2: 3, amount: 0.5, expectedResult: 2) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 1, value2: 3, amount: 0.5, expectedResult: 2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 4, value2: 2, amount: 1, expectedResult: 2) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 4, value2: 2, amount: 1, expectedResult: 2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 1, value2: 3, amount: 0, expectedResult: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 1, value2: 3, amount: 0, expectedResult: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: Infinity, value2: 0, amount: 0.5, expectedResult: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: Infinity, value2: 0, amount: 0.5, expectedResult: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: Infinity, value2: Infinity, amount: 0.5, expectedResult: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: Infinity, value2: Infinity, amount: 0.5, expectedResult: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: Infinity, value2: NaN, amount: 0.5, expectedResult: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: Infinity, value2: NaN, amount: 0.5, expectedResult: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: Infinity, value2: -Infinity, amount: 0.5, expectedResult: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: Infinity, value2: -Infinity, amount: 0.5, expectedResult: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: NaN, value2: 1, amount: 0.5, expectedResult: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: NaN, value2: 1, amount: 0.5, expectedResult: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: NaN, value2: 0, amount: 0.5, expectedResult: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: NaN, value2: 0, amount: 0.5, expectedResult: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: NaN, value2: Infinity, amount: 0.5, expectedResult: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: NaN, value2: Infinity, amount: 0.5, expectedResult: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: NaN, value2: NaN, amount: 0.5, expectedResult: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: NaN, value2: NaN, amount: 0.5, expectedResult: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: NaN, value2: -Infinity, amount: 0.5, expectedResult: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: NaN, value2: -Infinity, amount: 0.5, expectedResult: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: -Infinity, value2: 1, amount: 0.5, expectedResult: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: -Infinity, value2: 1, amount: 0.5, expectedResult: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: -Infinity, value2: 0, amount: 0.5, expectedResult: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: -Infinity, value2: 0, amount: 0.5, expectedResult: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: -Infinity, value2: Infinity, amount: 0.5, expectedResult: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: -Infinity, value2: Infinity, amount: 0.5, expectedResult: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: -Infinity, value2: NaN, amount: 0.5, expectedResult: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: -Infinity, value2: NaN, amount: 0.5, expectedResult: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: Infinity, value2: 1, amount: 0.5, expectedResult: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: Infinity, value2: 1, amount: 0.5, expectedResult: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 4, value2: 2, amount: 2, expectedResult: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 4, value2: 2, amount: 2, expectedResult: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SByteToNFloat(value: -127) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SByteToNFloat(value: -127) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SByteToNFloat(value: -63) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SByteToNFloat(value: -63) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SByteToNFloat(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SByteToNFloat(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SByteToNFloat(value: 63) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SByteToNFloat(value: 63) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SByteToNFloat(value: 127) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SByteToNFloat(value: 127) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDouble(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDouble(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDouble(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDouble(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDouble(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDouble(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDouble(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDouble(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDouble(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDouble(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: -4567, right: 3.1400001) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: -4567, right: 3.1400001) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: -4567.89111, right: 3.14568996) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: -4567.89111, right: 3.14568996) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: 0, right: 3.1400001) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: 0, right: 3.1400001) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: 4567, right: -3.1400001) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: 4567, right: -3.1400001) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: 4567.89111, right: -3.14568996) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: 4567.89111, right: -3.14568996) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -Infinity, expectedResult: -1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -Infinity, expectedResult: -1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 2.7182818284590451, expectedResult: 14.154262241479264, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 2.7182818284590451, expectedResult: 14.154262241479264, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 2.3025850929940459, expectedResult: 9, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 2.3025850929940459, expectedResult: 9, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 1.5707963267948966, expectedResult: 3.8104773809653518, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 1.5707963267948966, expectedResult: 3.8104773809653518, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 1.4426950408889634, expectedResult: 3.2320861065570821, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 1.4426950408889634, expectedResult: 3.2320861065570821, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 1.4142135623730949, expectedResult: 3.1132503787829275, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 1.4142135623730949, expectedResult: 3.1132503787829275, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 1.1283791670955126, expectedResult: 2.0906430223107977, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 1.1283791670955126, expectedResult: 2.0906430223107977, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 1, expectedResult: 1.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 1, expectedResult: 1.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.78539816339744828, expectedResult: 1.1932800507380155, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.78539816339744828, expectedResult: 1.1932800507380155, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.70710678118654757, expectedResult: 1.0281149816474724, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.70710678118654757, expectedResult: 1.0281149816474724, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.69314718055994529, expectedResult: 1, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.69314718055994529, expectedResult: 1, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.63661977236758138, expectedResult: 0.89008116457222197, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.63661977236758138, expectedResult: 0.89008116457222197, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.43429448190325182, expectedResult: 0.54387344397118109, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.43429448190325182, expectedResult: 0.54387344397118109, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.31830988618379069, expectedResult: 0.37480222743935865, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.31830988618379069, expectedResult: 0.37480222743935865, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 3.1415926535897931, expectedResult: 22.14069263277927, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 3.1415926535897931, expectedResult: 22.14069263277927, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.31830988618379069, expectedResult: -0.27262265070478353, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.31830988618379069, expectedResult: -0.27262265070478353, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.43429448190325182, expectedResult: -0.35227851485819933, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.43429448190325182, expectedResult: -0.35227851485819933, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.63661977236758138, expectedResult: -0.47092219173226463, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.63661977236758138, expectedResult: -0.47092219173226463, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.69314718055994529, expectedResult: -0.5, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.69314718055994529, expectedResult: -0.5, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.70710678118654757, expectedResult: -0.50693130860476021, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.70710678118654757, expectedResult: -0.50693130860476021, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.78539816339744828, expectedResult: -0.54406187223400371, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.78539816339744828, expectedResult: -0.54406187223400371, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -1, expectedResult: -0.63212055882855767, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -1, expectedResult: -0.63212055882855767, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -1.1283791670955126, expectedResult: -0.67644273609692895, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -1.1283791670955126, expectedResult: -0.67644273609692895, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -1.4142135623730949, expectedResult: -0.75688326556578578, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -1.4142135623730949, expectedResult: -0.75688326556578578, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -1.4426950408889634, expectedResult: -0.7637099116554773, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -1.4426950408889634, expectedResult: -0.7637099116554773, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -1.5707963267948966, expectedResult: -0.79212042364923807, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -1.5707963267948966, expectedResult: -0.79212042364923807, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -2.3025850929940459, expectedResult: -0.90000000000000002, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -2.3025850929940459, expectedResult: -0.90000000000000002, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -2.7182818284590451, expectedResult: -0.93401196415468746, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -2.7182818284590451, expectedResult: -0.93401196415468746, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -3.1415926535897931, expectedResult: -0.9567860817362277, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -3.1415926535897931, expectedResult: -0.9567860817362277, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 0.58119566361426733, expectedResult: 0.30258509299404568, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 0.58119566361426733, expectedResult: 0.30258509299404568, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 0.22058404074969809, expectedResult: 0.42920367320510339, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 0.22058404074969809, expectedResult: 0.42920367320510339, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.17905794598427577, expectedResult: 0.55730495911103661, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.17905794598427577, expectedResult: 0.55730495911103661, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.26625534204141549, expectedResult: 0.58578643762690497, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.26625534204141549, expectedResult: 0.58578643762690497, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.9197649947685187, expectedResult: 0.87162083290448744, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.9197649947685187, expectedResult: 0.87162083290448744, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -1, expectedResult: 1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -1, expectedResult: 1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.63325565131481998, expectedResult: 0.7182818284590452, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.63325565131481998, expectedResult: 0.7182818284590452, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.78121189211048814, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.78121189211048814, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.5702332487688776, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.5702332487688776, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.41614683654714241, expectedResult: 0.63661977236758138, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.41614683654714241, expectedResult: 0.63661977236758138, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 0, expectedResult: 0.5, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 0, expectedResult: 0.5, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 0.20495719432643394, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 0.20495719432643394, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 0.54030230586813977, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 0.54030230586813977, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 1, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 1, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.6056998670788134, expectedResult: 0.70710678118654757, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.6056998670788134, expectedResult: 0.70710678118654757, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.90268536193307103, expectedResult: 0.85840734641020677, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.90268536193307103, expectedResult: 0.85840734641020677, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: -4567, right: 3.1400001) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: -4567, right: 3.1400001) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: -4567.89111, right: 3.14568996) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: -4567.89111, right: 3.14568996) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: 0, right: 3.1400001) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: 0, right: 3.1400001) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: 4567, right: -3.1400001) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: 4567, right: -3.1400001) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: 4567.89111, right: -3.14568996) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: 4567.89111, right: -3.14568996) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt32(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt32(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt32(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt32(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt32(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt32(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt32(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt32(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt32(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt32(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThanOrEqual(left: 789, right: 789) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThanOrEqual(left: 789, right: 789) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThanOrEqual(left: 789, right: -789) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThanOrEqual(left: 789, right: -789) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThanOrEqual(left: 789, right: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThanOrEqual(left: 789, right: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThanOrEqual(left: 789, right: 1000) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThanOrEqual(left: 789, right: 1000) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: 1.40129846E-45) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: 1.40129846E-45) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 3.1415926535897931, expectedResult: 0.054831135561607541, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 3.1415926535897931, expectedResult: 0.054831135561607541, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 3, expectedResult: 0.052359877559829883, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 3, expectedResult: 0.052359877559829883, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 2.7182818284590451, expectedResult: 0.047442967903742035, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 2.7182818284590451, expectedResult: 0.047442967903742035, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 2.5, expectedResult: 0.043633231299858237, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 2.5, expectedResult: 0.043633231299858237, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 2.3025850929940459, expectedResult: 0.040187691180085916, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 2.3025850929940459, expectedResult: 0.040187691180085916, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 2, expectedResult: 0.034906585039886591, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 2, expectedResult: 0.034906585039886591, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1.5707963267948966, expectedResult: 0.027415567780803771, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1.5707963267948966, expectedResult: 0.027415567780803771, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1.5, expectedResult: 0.026179938779914941, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1.5, expectedResult: 0.026179938779914941, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1.4426950408889634, expectedResult: 0.025179778565706631, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1.4426950408889634, expectedResult: 0.025179778565706631, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 3.5, expectedResult: 0.061086523819801536, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 3.5, expectedResult: 0.061086523819801536, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1.4142135623730949, expectedResult: 0.024682682989768702, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1.4142135623730949, expectedResult: 0.024682682989768702, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1, expectedResult: 0.017453292519943295, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1, expectedResult: 0.017453292519943295, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.78539816339744828, expectedResult: 0.013707783890401885, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.78539816339744828, expectedResult: 0.013707783890401885, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.70710678118654757, expectedResult: 0.012341341494884351, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.70710678118654757, expectedResult: 0.012341341494884351, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.69314718055994529, expectedResult: 0.012097700501686679, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.69314718055994529, expectedResult: 0.012097700501686679, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.63661977236758138, expectedResult: 0.011111111111111112, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.63661977236758138, expectedResult: 0.011111111111111112, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.5, expectedResult: 0.0087266462599716477, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.5, expectedResult: 0.0087266462599716477, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.43429448190325182, expectedResult: 0.0075798686324546737, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.43429448190325182, expectedResult: 0.0075798686324546737, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.31830988618379069, expectedResult: 0.0055555555555555558, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.31830988618379069, expectedResult: 0.0055555555555555558, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1.1283791670955126, expectedResult: 0.019693931676727953, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1.1283791670955126, expectedResult: 0.019693931676727953, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -Infinity, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -Infinity, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 0, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 0, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 0.37480222743935865, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 0.37480222743935865, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 0.54387344397118109, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 0.54387344397118109, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 0.89008116457222197, expectedResult: 0.63661977236758138, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 0.89008116457222197, expectedResult: 0.63661977236758138, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 1, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 1, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 1.0281149816474724, expectedResult: 0.70710678118654757, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 1.0281149816474724, expectedResult: 0.70710678118654757, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 1.1932800507380155, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 1.1932800507380155, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 2.0906430223107977, expectedResult: 1.1283791670955126, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 2.0906430223107977, expectedResult: 1.1283791670955126, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 3.1132503787829275, expectedResult: 1.4142135623730949, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 3.1132503787829275, expectedResult: 1.4142135623730949, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 3.2320861065570821, expectedResult: 1.4426950408889634, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 3.2320861065570821, expectedResult: 1.4426950408889634, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 3.8104773809653518, expectedResult: 1.5707963267948966, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 3.8104773809653518, expectedResult: 1.5707963267948966, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 9, expectedResult: 2.3025850929940459, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 9, expectedResult: 2.3025850929940459, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 14.154262241479264, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 14.154262241479264, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 1.7182818284590451, expectedResult: 1, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 1.7182818284590451, expectedResult: 1, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 22.14069263277927, expectedResult: 3.1415926535897931, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 22.14069263277927, expectedResult: 3.1415926535897931, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.47092219173226463, expectedResult: -0.63661977236758138, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.47092219173226463, expectedResult: -0.63661977236758138, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.50693130860476021, expectedResult: -0.70710678118654757, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.50693130860476021, expectedResult: -0.70710678118654757, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -3.1415926535897931, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -3.1415926535897931, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -2.7182818284590451, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -2.7182818284590451, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -1.4142135623730949, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -1.4142135623730949, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -1, expectedResult: -Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -1, expectedResult: -Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.9567860817362277, expectedResult: -3.1415926535897931, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.9567860817362277, expectedResult: -3.1415926535897931, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.5, expectedResult: -0.69314718055994529, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.5, expectedResult: -0.69314718055994529, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.93401196415468746, expectedResult: -2.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.93401196415468746, expectedResult: -2.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.79212042364923807, expectedResult: -1.5707963267948966, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.79212042364923807, expectedResult: -1.5707963267948966, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.7637099116554773, expectedResult: -1.4426950408889634, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.7637099116554773, expectedResult: -1.4426950408889634, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.75688326556578578, expectedResult: -1.4142135623730949, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.75688326556578578, expectedResult: -1.4142135623730949, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.67644273609692895, expectedResult: -1.1283791670955126, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.67644273609692895, expectedResult: -1.1283791670955126, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.63212055882855767, expectedResult: -1, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.63212055882855767, expectedResult: -1, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.54406187223400371, expectedResult: -0.78539816339744828, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.54406187223400371, expectedResult: -0.78539816339744828, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.90000000000000002, expectedResult: -2.3025850929940459, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.90000000000000002, expectedResult: -2.3025850929940459, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: 1.40129846E-45) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: 1.40129846E-45) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt16(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt16(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt16(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt16(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt16(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt16(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt16(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt16(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt16(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt16(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: 1.40129846E-45) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: 1.40129846E-45) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SingleToNFloat(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SingleToNFloat(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SingleToNFloat(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SingleToNFloat(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SingleToNFloat(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SingleToNFloat(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SingleToNFloat(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SingleToNFloat(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SingleToNFloat(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SingleToNFloat(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Ctor_Double_LargeValue + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Ctor_Double_LargeValue + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -Infinity, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -Infinity, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 5.5808859910179214, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 5.5808859910179214, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 3.9334096679145962, expectedResult: 2.3025850929940459, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 3.9334096679145962, expectedResult: 2.3025850929940459, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 1.9706864235520194, expectedResult: 1.5707963267948966, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 1.9706864235520194, expectedResult: 1.5707963267948966, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 1.7182818284590451, expectedResult: 1.4426950408889634, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 1.7182818284590451, expectedResult: 1.4426950408889634, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 1.6651441426902251, expectedResult: 1.4142135623730949, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 1.6651441426902251, expectedResult: 1.4142135623730949, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 1.1861299583286617, expectedResult: 1.1283791670955126, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 1.1861299583286617, expectedResult: 1.1283791670955126, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 1, expectedResult: 1, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 1, expectedResult: 1, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.72356793412734954, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.72356793412734954, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.63252691943815287, expectedResult: 0.70710678118654757, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.63252691943815287, expectedResult: 0.70710678118654757, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.61680667224167463, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.61680667224167463, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.55468227548210014, expectedResult: 0.63661977236758138, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.55468227548210014, expectedResult: 0.63661977236758138, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.3512498725672672, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.3512498725672672, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.2468689889006383, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.2468689889006383, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.19799112103854805, expectedResult: -0.31830988618379069, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.19799112103854805, expectedResult: -0.31830988618379069, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.2599444260445482, expectedResult: -0.43429448190325182, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.2599444260445482, expectedResult: -0.43429448190325182, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -1, expectedResult: -Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -1, expectedResult: -Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.88668526770323908, expectedResult: -3.1415926535897931, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.88668526770323908, expectedResult: -3.1415926535897931, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.848044776742087, expectedResult: -2.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.848044776742087, expectedResult: -2.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.79730043371348269, expectedResult: -2.3025850929940459, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.79730043371348269, expectedResult: -2.3025850929940459, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.66337746317758095, expectedResult: -1.5707963267948966, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.66337746317758095, expectedResult: -1.5707963267948966, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 7.824977827076288, expectedResult: 3.1415926535897931, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 7.824977827076288, expectedResult: 3.1415926535897931, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.63212055882855767, expectedResult: -1.4426950408889634, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.63212055882855767, expectedResult: -1.4426950408889634, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.5425706526777031, expectedResult: -1.1283791670955126, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.5425706526777031, expectedResult: -1.1283791670955126, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.5, expectedResult: -1, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.5, expectedResult: -1, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.41980818962827554, expectedResult: -0.78539816339744828, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.41980818962827554, expectedResult: -0.78539816339744828, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.38745267346393408, expectedResult: -0.70710678118654757, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.38745267346393408, expectedResult: -0.70710678118654757, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.38149686219842405, expectedResult: -0.69314718055994529, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.38149686219842405, expectedResult: -0.69314718055994529, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.35678175806699514, expectedResult: -0.63661977236758138, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.35678175806699514, expectedResult: -0.63661977236758138, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.62478577275351821, expectedResult: -1.4142135623730949, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.62478577275351821, expectedResult: -1.4142135623730949, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.PositiveInfinity + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.PositiveInfinity + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: -4567, right: 3.1400001) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: -4567, right: 3.1400001) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: -4567.89111, right: 3.14568996) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: -4567.89111, right: 3.14568996) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: 0, right: 3.1400001) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: 0, right: 3.1400001) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: 4567, right: -3.1400001) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: 4567, right: -3.1400001) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: 4567.89111, right: -3.14568996) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: 4567.89111, right: -3.14568996) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThan(left: 789, right: 789) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThan(left: 789, right: 789) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThan(left: 789, right: -789) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThan(left: 789, right: -789) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThan(left: 789, right: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThan(left: 789, right: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThan(left: 789, right: 1000) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThan(left: 789, right: 1000) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int16ToNFloat(value: -255) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int16ToNFloat(value: -255) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int16ToNFloat(value: -127) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int16ToNFloat(value: -127) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int16ToNFloat(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int16ToNFloat(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int16ToNFloat(value: 127) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int16ToNFloat(value: 127) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int16ToNFloat(value: 255) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int16ToNFloat(value: 255) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NegativeInfinity + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NegativeInfinity + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Increment(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Increment(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Increment(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Increment(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Increment(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Increment(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Increment(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Increment(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Increment(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Increment(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -Infinity, y: Infinity, expectedResult: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -Infinity, y: Infinity, expectedResult: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -3, y: 2, expectedResult: -3) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -3, y: 2, expectedResult: -3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: 2, y: -3, expectedResult: -3) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: 2, y: -3, expectedResult: -3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: 0, y: -0, expectedResult: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: 0, y: -0, expectedResult: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -0, y: 0, expectedResult: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -0, y: 0, expectedResult: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: NaN, y: -Infinity, expectedResult: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: NaN, y: -Infinity, expectedResult: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: NaN, y: Infinity, expectedResult: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: NaN, y: Infinity, expectedResult: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: 3, y: -2, expectedResult: 3) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: 3, y: -2, expectedResult: 3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -Infinity, y: NaN, expectedResult: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -Infinity, y: NaN, expectedResult: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: 1, y: NaN, expectedResult: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: 1, y: NaN, expectedResult: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: NaN, y: 1, expectedResult: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: NaN, y: 1, expectedResult: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: NaN, y: NaN, expectedResult: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: NaN, y: NaN, expectedResult: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: 1.7976931348623157E+308, y: -1.7976931348623157E+308, expectedResult: 1.7976931348623157E+308) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: 1.7976931348623157E+308, y: -1.7976931348623157E+308, expectedResult: 1.7976931348623157E+308) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -1.7976931348623157E+308, y: 1.7976931348623157E+308, expectedResult: 1.7976931348623157E+308) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -1.7976931348623157E+308, y: 1.7976931348623157E+308, expectedResult: 1.7976931348623157E+308) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: Infinity, y: -Infinity, expectedResult: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: Infinity, y: -Infinity, expectedResult: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: Infinity, y: NaN, expectedResult: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: Infinity, y: NaN, expectedResult: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -2, y: 3, expectedResult: 3) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -2, y: 3, expectedResult: 3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Ctor_Double_OutOfRange + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.Ctor_Double_OutOfRange + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt16(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt16(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt16(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt16(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt16(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt16(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt16(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt16(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt16(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt16(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 0, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 0, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 1.5574077246549023, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 1.5574077246549023, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 4.7754895402454185, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 4.7754895402454185, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: Infinity, expectedResult: 0.5, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: Infinity, expectedResult: 0.5, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -2.1850398632615189, expectedResult: -0.36338022763241867, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -2.1850398632615189, expectedResult: -0.36338022763241867, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -1.4406084404920341, expectedResult: -0.30685281944005471, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -1.4406084404920341, expectedResult: -0.30685281944005471, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -1.3136757077477541, expectedResult: -0.29289321881345248, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -1.3136757077477541, expectedResult: -0.29289321881345248, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -0.79909939792801821, expectedResult: -0.21460183660255169, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -0.79909939792801821, expectedResult: -0.21460183660255169, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 0.42670634433261806, expectedResult: 0.12837916709551256, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 0.42670634433261806, expectedResult: 0.12837916709551256, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 3.6202185671074507, expectedResult: 0.41421356237309503, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 3.6202185671074507, expectedResult: 0.41421356237309503, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 5.4945259425167299, expectedResult: 0.44269504088896339, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 5.4945259425167299, expectedResult: 0.44269504088896339, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -4.4217522209161286, expectedResult: -0.42920367320510339, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -4.4217522209161286, expectedResult: -0.42920367320510339, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 1.4001547140150528, expectedResult: 0.30258509299404568, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 1.4001547140150528, expectedResult: 0.30258509299404568, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -1.2221646718190067, expectedResult: -0.28171817154095474, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -1.2221646718190067, expectedResult: -0.28171817154095474, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 0.47669014603118892, expectedResult: 0.14159265358979323, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 0.47669014603118892, expectedResult: 0.14159265358979323, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: NaN, y: NaN, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: NaN, y: NaN, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 2.7182818284590451, expectedResult: 3.844231028159117, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 2.7182818284590451, expectedResult: 3.844231028159117, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 3.1415926535897931, expectedResult: 4.1543544023133139, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 3.1415926535897931, expectedResult: 4.1543544023133139, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.31830988618379069, expectedResult: 10.005064776584025, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.31830988618379069, expectedResult: 10.005064776584025, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.43429448190325182, expectedResult: 10.009426142242702, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.43429448190325182, expectedResult: 10.009426142242702, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.63661977236758138, expectedResult: 10.020243746265326, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.63661977236758138, expectedResult: 10.020243746265326, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.69314718055994529, expectedResult: 10.023993865417028, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.69314718055994529, expectedResult: 10.023993865417028, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.70710678118654757, expectedResult: 10.024968827881711, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.70710678118654757, expectedResult: 10.024968827881711, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.78539816339744828, expectedResult: 10.030795096853891, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.78539816339744828, expectedResult: 10.030795096853891, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 1, expectedResult: 10.04987562112089, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 1, expectedResult: 10.04987562112089, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 2.3025850929940459, expectedResult: 3.5624365551415855, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 2.3025850929940459, expectedResult: 3.5624365551415855, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 1.1283791670955126, expectedResult: 10.063460614755501, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 1.1283791670955126, expectedResult: 10.063460614755501, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 1.4426950408889634, expectedResult: 10.103532500121213, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 1.4426950408889634, expectedResult: 10.103532500121213, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 1.5707963267948966, expectedResult: 10.12261829272804, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 1.5707963267948966, expectedResult: 10.12261829272804, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 2.3025850929940459, expectedResult: 10.261671311754164, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 2.3025850929940459, expectedResult: 10.261671311754164, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 2.7182818284590451, expectedResult: 10.362869105558106, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 2.7182818284590451, expectedResult: 10.362869105558106, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 3.1415926535897931, expectedResult: 10.481870272097884, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 3.1415926535897931, expectedResult: 10.481870272097884, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: NaN, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: NaN, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: 0, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: 0, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: 1, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: 1, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: 2.7182818284590451, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: 2.7182818284590451, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 1.4142135623730949, expectedResult: 10.099504938362077, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 1.4142135623730949, expectedResult: 10.099504938362077, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: 10, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: 10, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 1.5707963267948966, expectedResult: 3.139499514126892, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 1.5707963267948966, expectedResult: 3.139499514126892, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 1.4142135623730949, expectedResult: 3.0641566701020122, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 1.4142135623730949, expectedResult: 3.0641566701020122, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: NaN, y: 0, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: NaN, y: 0, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: NaN, y: 1, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: NaN, y: 1, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: NaN, y: 2.7182818284590451, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: NaN, y: 2.7182818284590451, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: NaN, y: 10, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: NaN, y: 10, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 0, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 0, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 1, expectedResult: 1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 1, expectedResult: 1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 1.5707963267948966, expectedResult: 1.5707963267948966, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 1.5707963267948966, expectedResult: 1.5707963267948966, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 2, expectedResult: 2, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 2, expectedResult: 2, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 2.7182818284590451, expectedResult: 2.7182818284590451, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 2.7182818284590451, expectedResult: 2.7182818284590451, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 1.4426950408889634, expectedResult: 3.0774055761202908, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 1.4426950408889634, expectedResult: 3.0774055761202908, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 3, expectedResult: 3, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 3, expectedResult: 3, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 1, y: 1, expectedResult: 1.4142135623730949, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 1, y: 1, expectedResult: 1.4142135623730949, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.31830988618379069, expectedResult: 2.7368553638387594, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.31830988618379069, expectedResult: 2.7368553638387594, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.43429448190325182, expectedResult: 2.752756399673292, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.43429448190325182, expectedResult: 2.752756399673292, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.63661977236758138, expectedResult: 2.7918346715914253, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.63661977236758138, expectedResult: 2.7918346715914253, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.69314718055994529, expectedResult: 2.8052645352709344, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.69314718055994529, expectedResult: 2.8052645352709344, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.70710678118654757, expectedResult: 2.8087463571726534, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.70710678118654757, expectedResult: 2.8087463571726534, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.78539816339744828, expectedResult: 2.8294710413783588, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.78539816339744828, expectedResult: 2.8294710413783588, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 1, expectedResult: 2.8963867315900083, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 1, expectedResult: 2.8963867315900083, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 1.1283791670955126, expectedResult: 2.9431778138036129, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 1.1283791670955126, expectedResult: 2.9431778138036129, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 10, expectedResult: 10, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 10, expectedResult: 10, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Equality(left: 789, right: 789) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Equality(left: 789, right: 789) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Equality(left: 789, right: -789) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Equality(left: 789, right: -789) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Equality(left: 789, right: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Equality(left: 789, right: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Equality(left: 789, right: 1000) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Equality(left: 789, right: 1000) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DoubleToNFloat(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DoubleToNFloat(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DoubleToNFloat(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DoubleToNFloat(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DoubleToNFloat(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DoubleToNFloat(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DoubleToNFloat(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DoubleToNFloat(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DoubleToNFloat(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DoubleToNFloat(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -Infinity, expectedResult: -1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -Infinity, expectedResult: -1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 2.7182818284590451, expectedResult: 521.73529967043669, allowedVariance: 8.8817841970012523E-13) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 2.7182818284590451, expectedResult: 521.73529967043669, allowedVariance: 8.8817841970012523E-13) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 2.3025850929940459, expectedResult: 199.71743249053009, allowedVariance: 8.8817841970012523E-13) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 2.3025850929940459, expectedResult: 199.71743249053009, allowedVariance: 8.8817841970012523E-13) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 1.5707963267948966, expectedResult: 36.221710484165165, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 1.5707963267948966, expectedResult: 36.221710484165165, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 1.4426950408889634, expectedResult: 26.713733786437789, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 1.4426950408889634, expectedResult: 26.713733786437789, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 1.4142135623730949, expectedResult: 24.954553519470082, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 1.4142135623730949, expectedResult: 24.954553519470082, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 1.1283791670955126, expectedResult: 12.439377934644401, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 1.1283791670955126, expectedResult: 12.439377934644401, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 1, expectedResult: 9, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 1, expectedResult: 9, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.78539816339744828, expectedResult: 5.1009598002416938, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.78539816339744828, expectedResult: 5.1009598002416938, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.70710678118654757, expectedResult: 4.0945611704512963, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.70710678118654757, expectedResult: 4.0945611704512963, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.69314718055994529, expectedResult: 3.9334096679145962, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.69314718055994529, expectedResult: 3.9334096679145962, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.63661977236758138, expectedResult: 3.3313150290214524, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.63661977236758138, expectedResult: 3.3313150290214524, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.43429448190325182, expectedResult: 1.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.43429448190325182, expectedResult: 1.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.31830988618379069, expectedResult: 1.0811811619898573, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.31830988618379069, expectedResult: 1.0811811619898573, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 3.1415926535897931, expectedResult: 1384.4557313670111, allowedVariance: 8.8817841970012523E-12) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 3.1415926535897931, expectedResult: 1384.4557313670111, allowedVariance: 8.8817841970012523E-12) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.31830988618379069, expectedResult: -0.51950362694813135, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.31830988618379069, expectedResult: -0.51950362694813135, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.43429448190325182, expectedResult: -0.63212055882855767, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.43429448190325182, expectedResult: -0.63212055882855767, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.63661977236758138, expectedResult: -0.76912323548399941, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.63661977236758138, expectedResult: -0.76912323548399941, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.69314718055994529, expectedResult: -0.79730043371348269, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.69314718055994529, expectedResult: -0.79730043371348269, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.70710678118654757, expectedResult: -0.80371224006494435, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.70710678118654757, expectedResult: -0.80371224006494435, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.78539816339744828, expectedResult: -0.83609136386042338, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.78539816339744828, expectedResult: -0.83609136386042338, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -1, expectedResult: -0.90000000000000002, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -1, expectedResult: -0.90000000000000002, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -1.1283791670955126, expectedResult: -0.92559179413935733, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -1.1283791670955126, expectedResult: -0.92559179413935733, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -1.4142135623730949, expectedResult: -0.96147111529967799, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -1.4142135623730949, expectedResult: -0.96147111529967799, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -1.4426950408889634, expectedResult: -0.9639168071792128, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -1.4426950408889634, expectedResult: -0.9639168071792128, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -1.5707963267948966, expectedResult: -0.9731339589988639, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -1.5707963267948966, expectedResult: -0.9731339589988639, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -2.3025850929940459, expectedResult: -0.99501787170355926, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -2.3025850929940459, expectedResult: -0.99501787170355926, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -2.7182818284590451, expectedResult: -0.99808698589777567, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -2.7182818284590451, expectedResult: -0.99808698589777567, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -3.1415926535897931, expectedResult: -0.99927821584092524, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -3.1415926535897931, expectedResult: -0.99927821584092524, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Decrement(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Decrement(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Decrement(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Decrement(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Decrement(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Decrement(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Decrement(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Decrement(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Decrement(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Decrement(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: 1.40129846E-45) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: 1.40129846E-45) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int64ToNFloat(value: -255) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int64ToNFloat(value: -255) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int64ToNFloat(value: -127) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int64ToNFloat(value: -127) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int64ToNFloat(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int64ToNFloat(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int64ToNFloat(value: 127) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int64ToNFloat(value: 127) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int64ToNFloat(value: 255) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int64ToNFloat(value: 255) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -Infinity, y: Infinity, expectedResult: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -Infinity, y: Infinity, expectedResult: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -3, y: 2, expectedResult: -3) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -3, y: 2, expectedResult: -3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: 2, y: -3, expectedResult: -3) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: 2, y: -3, expectedResult: -3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: 0, y: -0, expectedResult: -0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: 0, y: -0, expectedResult: -0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -0, y: 0, expectedResult: -0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -0, y: 0, expectedResult: -0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: NaN, y: -Infinity, expectedResult: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: NaN, y: -Infinity, expectedResult: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: NaN, y: Infinity, expectedResult: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: NaN, y: Infinity, expectedResult: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: 3, y: -2, expectedResult: -2) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: 3, y: -2, expectedResult: -2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -Infinity, y: NaN, expectedResult: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -Infinity, y: NaN, expectedResult: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: 1, y: NaN, expectedResult: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: 1, y: NaN, expectedResult: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: NaN, y: 1, expectedResult: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: NaN, y: 1, expectedResult: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: NaN, y: NaN, expectedResult: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: NaN, y: NaN, expectedResult: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: 1.7976931348623157E+308, y: -1.7976931348623157E+308, expectedResult: -1.7976931348623157E+308) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: 1.7976931348623157E+308, y: -1.7976931348623157E+308, expectedResult: -1.7976931348623157E+308) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -1.7976931348623157E+308, y: 1.7976931348623157E+308, expectedResult: -1.7976931348623157E+308) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -1.7976931348623157E+308, y: 1.7976931348623157E+308, expectedResult: -1.7976931348623157E+308) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: Infinity, y: -Infinity, expectedResult: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: Infinity, y: -Infinity, expectedResult: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: Infinity, y: NaN, expectedResult: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: Infinity, y: NaN, expectedResult: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -2, y: 3, expectedResult: -2) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -2, y: 3, expectedResult: -2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.RootN32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Ctor_Empty + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Ctor_Empty + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Epsilon + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Epsilon + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinValue + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinValue + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 3.1415926535897931, expectedResult: -0.90268536193307103, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 3.1415926535897931, expectedResult: -0.90268536193307103, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 3, expectedResult: -1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 3, expectedResult: -1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 2.7182818284590451, expectedResult: -0.63325565131481998, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 2.7182818284590451, expectedResult: -0.63325565131481998, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 2.5, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 2.5, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 2.3025850929940459, expectedResult: 0.58119566361426733, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 2.3025850929940459, expectedResult: 0.58119566361426733, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 2, expectedResult: 1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 2, expectedResult: 1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1.5707963267948966, expectedResult: 0.22058404074969809, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1.5707963267948966, expectedResult: 0.22058404074969809, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1.5, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1.5, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1.4426950408889634, expectedResult: -0.17905794598427577, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1.4426950408889634, expectedResult: -0.17905794598427577, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 3.5, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 3.5, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1.4142135623730949, expectedResult: -0.26625534204141549, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1.4142135623730949, expectedResult: -0.26625534204141549, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1, expectedResult: -1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1, expectedResult: -1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.78539816339744828, expectedResult: -0.78121189211048814, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.78539816339744828, expectedResult: -0.78121189211048814, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.70710678118654757, expectedResult: -0.6056998670788134, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.70710678118654757, expectedResult: -0.6056998670788134, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.69314718055994529, expectedResult: -0.5702332487688776, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.69314718055994529, expectedResult: -0.5702332487688776, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.63661977236758138, expectedResult: -0.41614683654714241, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.63661977236758138, expectedResult: -0.41614683654714241, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.5, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.5, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.43429448190325182, expectedResult: 0.20495719432643394, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.43429448190325182, expectedResult: 0.20495719432643394, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.31830988618379069, expectedResult: 0.54030230586813977, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.31830988618379069, expectedResult: 0.54030230586813977, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0, expectedResult: 1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0, expectedResult: 1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1.1283791670955126, expectedResult: -0.9197649947685187, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1.1283791670955126, expectedResult: -0.9197649947685187, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: Infinity, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: Infinity, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NaN + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NaN + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSingle(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSingle(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSingle(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSingle(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSingle(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSingle(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSingle(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSingle(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSingle(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSingle(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.Hypot32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: 1.40129846E-45) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: 1.40129846E-45) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToChar(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToChar(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToChar(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToChar(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToChar(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToChar(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToChar(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToChar(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToChar(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToChar(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: 1.40129846E-45) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: 1.40129846E-45) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt64ToNFloat(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt64ToNFloat(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt64ToNFloat(value: 5) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt64ToNFloat(value: 5) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt64ToNFloat(value: 42) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt64ToNFloat(value: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt64ToNFloat(value: 127) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt64ToNFloat(value: 127) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt64ToNFloat(value: 255) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt64ToNFloat(value: 255) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.EqualsTest(f1: 789, obj: 789, expected: True) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.EqualsTest(f1: 789, obj: 789, expected: True) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.EqualsTest(f1: 789, obj: -789, expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.EqualsTest(f1: 789, obj: -789, expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.EqualsTest(f1: 789, obj: 0, expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.EqualsTest(f1: 789, obj: 0, expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.EqualsTest(f1: 789, obj: 789, expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.EqualsTest(f1: 789, obj: 789, expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.EqualsTest(f1: 789, obj: "789.0", expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.EqualsTest(f1: 789, obj: "789.0", expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ByteToNFloat(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ByteToNFloat(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ByteToNFloat(value: 5) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ByteToNFloat(value: 5) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ByteToNFloat(value: 42) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ByteToNFloat(value: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ByteToNFloat(value: 127) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ByteToNFloat(value: 127) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ByteToNFloat(value: 255) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ByteToNFloat(value: 255) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: 1.40129846E-45) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: 1.40129846E-45) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxValue + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxValue + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: NaN, x: NaN, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: NaN, x: NaN, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: Infinity, x: 1, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: Infinity, x: 1, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: Infinity, x: -1, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: Infinity, x: -1, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 1, x: Infinity, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 1, x: Infinity, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 1, x: -Infinity, expectedResult: 1, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 1, x: -Infinity, expectedResult: 1, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: -0.43030121700009227, x: -0.90268536193307103, expectedResult: -0.85840734641020677, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: -0.43030121700009227, x: -0.90268536193307103, expectedResult: -0.85840734641020677, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.77394268526670829, x: -0.63325565131481998, expectedResult: 0.7182818284590452, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.77394268526670829, x: -0.63325565131481998, expectedResult: 0.7182818284590452, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.81376384817462333, x: 0.58119566361426733, expectedResult: 0.30258509299404568, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.81376384817462333, x: 0.58119566361426733, expectedResult: 0.30258509299404568, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: -0.97536797208363135, x: 0.22058404074969809, expectedResult: -0.42920367320510339, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: -0.97536797208363135, x: 0.22058404074969809, expectedResult: -0.42920367320510339, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: -0.98383852942436245, x: -0.17905794598427577, expectedResult: -0.55730495911103661, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: -0.98383852942436245, x: -0.17905794598427577, expectedResult: -0.55730495911103661, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: -0.96390253284987737, x: -0.26625534204141549, expectedResult: -0.58578643762690497, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: -0.96390253284987737, x: -0.26625534204141549, expectedResult: -0.58578643762690497, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: -0.3924695585627842, x: -0.9197649947685187, expectedResult: -0.87162083290448744, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: -0.3924695585627842, x: -0.9197649947685187, expectedResult: -0.87162083290448744, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.62426595263969908, x: -0.78121189211048814, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.62426595263969908, x: -0.78121189211048814, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.79569320156748091, x: -0.6056998670788134, expectedResult: 0.70710678118654757, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.79569320156748091, x: -0.6056998670788134, expectedResult: 0.70710678118654757, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.82148283122563881, x: -0.5702332487688776, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.82148283122563881, x: -0.5702332487688776, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.90929742682568171, x: -0.41614683654714241, expectedResult: 0.63661977236758138, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.90929742682568171, x: -0.41614683654714241, expectedResult: 0.63661977236758138, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 1, x: 0, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 1, x: 0, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 1, x: -0, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 1, x: -0, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.97877093770393309, x: 0.20495719432643394, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.97877093770393309, x: 0.20495719432643394, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.8414709848078965, x: 0.54030230586813977, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.8414709848078965, x: 0.54030230586813977, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0, x: 1, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0, x: 1, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0, x: 0, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0, x: 0, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0, x: -0, expectedResult: 1, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0, x: -0, expectedResult: 1, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0, x: -1, expectedResult: 1, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0, x: -1, expectedResult: 1, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: Infinity, x: -Infinity, expectedResult: 0.75, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: Infinity, x: -Infinity, expectedResult: 0.75, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: Infinity, x: Infinity, expectedResult: 0.25, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: Infinity, x: Infinity, expectedResult: 0.25, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -Infinity, y: Infinity, expectedResult: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -Infinity, y: Infinity, expectedResult: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -3, y: 2, expectedResult: 2) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -3, y: 2, expectedResult: 2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: 2, y: -3, expectedResult: 2) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: 2, y: -3, expectedResult: 2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: 0, y: -0, expectedResult: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: 0, y: -0, expectedResult: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -0, y: 0, expectedResult: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -0, y: 0, expectedResult: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: NaN, y: -Infinity, expectedResult: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: NaN, y: -Infinity, expectedResult: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: NaN, y: Infinity, expectedResult: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: NaN, y: Infinity, expectedResult: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: 3, y: -2, expectedResult: 3) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: 3, y: -2, expectedResult: 3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -Infinity, y: NaN, expectedResult: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -Infinity, y: NaN, expectedResult: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: 1, y: NaN, expectedResult: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: 1, y: NaN, expectedResult: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: NaN, y: 1, expectedResult: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: NaN, y: 1, expectedResult: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: NaN, y: NaN, expectedResult: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: NaN, y: NaN, expectedResult: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: 1.7976931348623157E+308, y: -1.7976931348623157E+308, expectedResult: 1.7976931348623157E+308) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: 1.7976931348623157E+308, y: -1.7976931348623157E+308, expectedResult: 1.7976931348623157E+308) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -1.7976931348623157E+308, y: 1.7976931348623157E+308, expectedResult: 1.7976931348623157E+308) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -1.7976931348623157E+308, y: 1.7976931348623157E+308, expectedResult: 1.7976931348623157E+308) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: Infinity, y: -Infinity, expectedResult: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: Infinity, y: -Infinity, expectedResult: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: Infinity, y: NaN, expectedResult: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: Infinity, y: NaN, expectedResult: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -2, y: 3, expectedResult: 3) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -2, y: 3, expectedResult: 3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -Infinity, y: Infinity, expectedResult: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -Infinity, y: Infinity, expectedResult: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -3, y: 2, expectedResult: 2) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -3, y: 2, expectedResult: 2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: 2, y: -3, expectedResult: 2) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: 2, y: -3, expectedResult: 2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: 0, y: -0, expectedResult: -0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: 0, y: -0, expectedResult: -0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -0, y: 0, expectedResult: -0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -0, y: 0, expectedResult: -0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: NaN, y: -Infinity, expectedResult: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: NaN, y: -Infinity, expectedResult: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: NaN, y: Infinity, expectedResult: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: NaN, y: Infinity, expectedResult: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: 3, y: -2, expectedResult: -2) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: 3, y: -2, expectedResult: -2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -Infinity, y: NaN, expectedResult: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -Infinity, y: NaN, expectedResult: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: 1, y: NaN, expectedResult: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: 1, y: NaN, expectedResult: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: NaN, y: 1, expectedResult: 1) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: NaN, y: 1, expectedResult: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: NaN, y: NaN, expectedResult: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: NaN, y: NaN, expectedResult: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: 1.7976931348623157E+308, y: -1.7976931348623157E+308, expectedResult: -1.7976931348623157E+308) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: 1.7976931348623157E+308, y: -1.7976931348623157E+308, expectedResult: -1.7976931348623157E+308) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -1.7976931348623157E+308, y: 1.7976931348623157E+308, expectedResult: -1.7976931348623157E+308) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -1.7976931348623157E+308, y: 1.7976931348623157E+308, expectedResult: -1.7976931348623157E+308) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: Infinity, y: -Infinity, expectedResult: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: Infinity, y: -Infinity, expectedResult: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: Infinity, y: NaN, expectedResult: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: Infinity, y: NaN, expectedResult: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -2, y: 3, expectedResult: -2) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -2, y: 3, expectedResult: -2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 3.1415926535897931, expectedResult: 0.47669014603118892, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 3.1415926535897931, expectedResult: 0.47669014603118892, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 3, expectedResult: -0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 3, expectedResult: -0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 2.7182818284590451, expectedResult: -1.2221646718190067, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 2.7182818284590451, expectedResult: -1.2221646718190067, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 2.5, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 2.5, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 2.3025850929940459, expectedResult: 1.4001547140150528, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 2.3025850929940459, expectedResult: 1.4001547140150528, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 2, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 2, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1.5707963267948966, expectedResult: -4.4217522209161286, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1.5707963267948966, expectedResult: -4.4217522209161286, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1.5, expectedResult: -Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1.5, expectedResult: -Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1.4426950408889634, expectedResult: 5.4945259425167299, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1.4426950408889634, expectedResult: 5.4945259425167299, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 3.5, expectedResult: -Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 3.5, expectedResult: -Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1.4142135623730949, expectedResult: 3.6202185671074507, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1.4142135623730949, expectedResult: 3.6202185671074507, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1, expectedResult: -0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1, expectedResult: -0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.78539816339744828, expectedResult: -0.79909939792801821, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.78539816339744828, expectedResult: -0.79909939792801821, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.70710678118654757, expectedResult: -1.3136757077477541, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.70710678118654757, expectedResult: -1.3136757077477541, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.69314718055994529, expectedResult: -1.4406084404920341, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.69314718055994529, expectedResult: -1.4406084404920341, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.63661977236758138, expectedResult: -2.1850398632615189, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.63661977236758138, expectedResult: -2.1850398632615189, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.5, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.5, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.43429448190325182, expectedResult: 4.7754895402454185, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.43429448190325182, expectedResult: 4.7754895402454185, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.31830988618379069, expectedResult: 1.5574077246549023, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.31830988618379069, expectedResult: 1.5574077246549023, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1.1283791670955126, expectedResult: 0.42670634433261806, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1.1283791670955126, expectedResult: 0.42670634433261806, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: Infinity, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: Infinity, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryNegation(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryNegation(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryNegation(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryNegation(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryNegation(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryNegation(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryNegation(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryNegation(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryNegation(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryNegation(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToByte(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToByte(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToByte(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToByte(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToByte(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToByte(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToByte(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToByte(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToByte(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToByte(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Modulus(left: -4567, right: 3.1400001) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Modulus(left: -4567, right: 3.1400001) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Modulus(left: -4567.89111, right: 3.14568996) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Modulus(left: -4567.89111, right: 3.14568996) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Modulus(left: 0, right: 3.1400001) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Modulus(left: 0, right: 3.1400001) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Modulus(left: 4567, right: -3.1400001) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Modulus(left: 4567, right: -3.1400001) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Modulus(left: 4567.89111, right: -3.14568996) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Modulus(left: 4567.89111, right: -3.14568996) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThan(left: 789, right: 789) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThan(left: 789, right: 789) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThan(left: 789, right: -789) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThan(left: 789, right: -789) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThan(left: 789, right: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThan(left: 789, right: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThan(left: 789, right: 1000) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThan(left: 789, right: 1000) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 3.1415926535897931, expectedResult: -0.43030121700009227, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 3.1415926535897931, expectedResult: -0.43030121700009227, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 3, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 3, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 2.7182818284590451, expectedResult: 0.77394268526670829, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 2.7182818284590451, expectedResult: 0.77394268526670829, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 2.5, expectedResult: 1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 2.5, expectedResult: 1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 2.3025850929940459, expectedResult: 0.81376384817462333, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 2.3025850929940459, expectedResult: 0.81376384817462333, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 2, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 2, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1.5707963267948966, expectedResult: -0.97536797208363135, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1.5707963267948966, expectedResult: -0.97536797208363135, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1.5, expectedResult: -1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1.5, expectedResult: -1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1.4426950408889634, expectedResult: -0.98383852942436245, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1.4426950408889634, expectedResult: -0.98383852942436245, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 3.5, expectedResult: -1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 3.5, expectedResult: -1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1.4142135623730949, expectedResult: -0.96390253284987737, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1.4142135623730949, expectedResult: -0.96390253284987737, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.78539816339744828, expectedResult: 0.62426595263969908, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.78539816339744828, expectedResult: 0.62426595263969908, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.70710678118654757, expectedResult: 0.79569320156748091, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.70710678118654757, expectedResult: 0.79569320156748091, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.69314718055994529, expectedResult: 0.82148283122563881, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.69314718055994529, expectedResult: 0.82148283122563881, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.63661977236758138, expectedResult: 0.90929742682568171, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.63661977236758138, expectedResult: 0.90929742682568171, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.5, expectedResult: 1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.5, expectedResult: 1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.43429448190325182, expectedResult: 0.97877093770393309, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.43429448190325182, expectedResult: 0.97877093770393309, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.31830988618379069, expectedResult: 0.8414709848078965, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.31830988618379069, expectedResult: 0.8414709848078965, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1.1283791670955126, expectedResult: -0.3924695585627842, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1.1283791670955126, expectedResult: -0.3924695585627842, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: Infinity, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: Infinity, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryPlus(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryPlus(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryPlus(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryPlus(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryPlus(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryPlus(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryPlus(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryPlus(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryPlus(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryPlus(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: -5, expectedResult: -0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: -5, expectedResult: -0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 0, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 0, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: -1, expectedResult: 1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: -1, expectedResult: 1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: -2, expectedResult: 1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: -2, expectedResult: 1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: -3, expectedResult: 1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: -3, expectedResult: 1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: -4, expectedResult: 1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: -4, expectedResult: 1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: -5, expectedResult: 1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: -5, expectedResult: 1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 5, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 5, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 4, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 4, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 3, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 3, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 2, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 2, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 1, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 1, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 0, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 0, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: -1, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: -1, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: -2, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: -2, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: -3, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: -3, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: -4, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: -4, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: -5, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: -5, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 5, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 5, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 4, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 4, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 3, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 3, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 2, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 2, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 1, expectedResult: 1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 1, expectedResult: 1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 1, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 1, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 2, expectedResult: 1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 2, expectedResult: 1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 4, expectedResult: 1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 4, expectedResult: 1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 3, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 3, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 2, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 2, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 1, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 1, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 0, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 0, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: -1, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: -1, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: -2, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: -2, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: -3, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: -3, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: -4, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: -4, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: -5, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: -5, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 5, expectedResult: 1.2214027581601699, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 5, expectedResult: 1.2214027581601699, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 4, expectedResult: 1.2840254166877414, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 4, expectedResult: 1.2840254166877414, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 3, expectedResult: 1.3956124250860895, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 3, expectedResult: 1.3956124250860895, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 2, expectedResult: 1.6487212707001282, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 2, expectedResult: 1.6487212707001282, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 1, expectedResult: 2.7182818284590451, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 1, expectedResult: 2.7182818284590451, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 0, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 0, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: -1, expectedResult: 0.36787944117144228, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: -1, expectedResult: 0.36787944117144228, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: -2, expectedResult: 0.60653065971263342, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: -2, expectedResult: 0.60653065971263342, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: -3, expectedResult: 0.71653131057378927, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: -3, expectedResult: 0.71653131057378927, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: -4, expectedResult: 0.77880078307140488, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: -4, expectedResult: 0.77880078307140488, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: -5, expectedResult: 0.81873075307798193, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: -5, expectedResult: 0.81873075307798193, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 5, expectedResult: 1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 5, expectedResult: 1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 3, expectedResult: 1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 3, expectedResult: 1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 4, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 4, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 0, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 0, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: -2, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: -2, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 5, expectedResult: -1.2214027581601699, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 5, expectedResult: -1.2214027581601699, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 4, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 4, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 3, expectedResult: -1.3956124250860895, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 3, expectedResult: -1.3956124250860895, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 2, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 2, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 1, expectedResult: -2.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 1, expectedResult: -2.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 0, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 0, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: -1, expectedResult: -0.36787944117144228, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: -1, expectedResult: -0.36787944117144228, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: -2, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: -2, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: -3, expectedResult: -0.71653131057378927, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: -3, expectedResult: -0.71653131057378927, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: -4, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: -4, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: -5, expectedResult: -0.81873075307798193, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: -5, expectedResult: -0.81873075307798193, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 5, expectedResult: -Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 5, expectedResult: -Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 4, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 4, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 3, expectedResult: -Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 3, expectedResult: -Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 2, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 2, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 1, expectedResult: -Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 1, expectedResult: -Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 0, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 0, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: -1, expectedResult: -0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: -1, expectedResult: -0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: -2, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: -2, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: -3, expectedResult: -0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: -3, expectedResult: -0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: -4, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: -4, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: -5, expectedResult: -1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: -5, expectedResult: -1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: -1, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: -1, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: -4, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: -4, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: -2, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: -2, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: -3, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: -3, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: -4, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: -4, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: -5, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: -5, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 5, expectedResult: -0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 5, expectedResult: -0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 4, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 4, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 3, expectedResult: -0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 3, expectedResult: -0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 2, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 2, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 1, expectedResult: -0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 1, expectedResult: -0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 0, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 0, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: -1, expectedResult: -Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: -1, expectedResult: -Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: -2, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: -2, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: -3, expectedResult: -Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: -3, expectedResult: -Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: -4, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: -4, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: -5, expectedResult: -Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: -5, expectedResult: -Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 5, expectedResult: -1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 5, expectedResult: -1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 4, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 4, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 3, expectedResult: -1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 3, expectedResult: -1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 2, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 2, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 1, expectedResult: -1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 1, expectedResult: -1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 0, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 0, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: -1, expectedResult: -1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: -1, expectedResult: -1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: -3, expectedResult: -1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: -3, expectedResult: -1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 5, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 5, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Size + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Size + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt16ToNFloat(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt16ToNFloat(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt16ToNFloat(value: 5) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt16ToNFloat(value: 5) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt16ToNFloat(value: 42) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt16ToNFloat(value: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt16ToNFloat(value: 127) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt16ToNFloat(value: 127) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt16ToNFloat(value: 255) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt16ToNFloat(value: 255) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUIntPtr(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUIntPtr(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUIntPtr(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUIntPtr(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUIntPtr(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUIntPtr(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUIntPtr(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUIntPtr(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUIntPtr(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUIntPtr(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Ctor_Double + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Ctor_Double + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -Infinity, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -Infinity, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 2.7182818284590451, expectedResult: 6.5808859910179214, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 2.7182818284590451, expectedResult: 6.5808859910179214, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 2.3025850929940459, expectedResult: 4.9334096679145967, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 2.3025850929940459, expectedResult: 4.9334096679145967, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 1.5707963267948966, expectedResult: 2.9706864235520194, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 1.5707963267948966, expectedResult: 2.9706864235520194, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 1.4426950408889634, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 1.4426950408889634, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 1.4142135623730949, expectedResult: 2.6651441426902251, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 1.4142135623730949, expectedResult: 2.6651441426902251, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 1.1283791670955126, expectedResult: 2.186129958328662, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 1.1283791670955126, expectedResult: 2.186129958328662, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 1, expectedResult: 2, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 1, expectedResult: 2, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.78539816339744828, expectedResult: 1.7235679341273495, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.78539816339744828, expectedResult: 1.7235679341273495, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.70710678118654757, expectedResult: 1.6325269194381529, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.70710678118654757, expectedResult: 1.6325269194381529, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.69314718055994529, expectedResult: 1.6168066722416747, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.69314718055994529, expectedResult: 1.6168066722416747, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.63661977236758138, expectedResult: 1.5546822754821001, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.63661977236758138, expectedResult: 1.5546822754821001, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.43429448190325182, expectedResult: 1.3512498725672673, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.43429448190325182, expectedResult: 1.3512498725672673, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.31830988618379069, expectedResult: 1.2468689889006384, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.31830988618379069, expectedResult: 1.2468689889006384, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0, expectedResult: 1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0, expectedResult: 1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 3.1415926535897931, expectedResult: 8.8249778270762871, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 3.1415926535897931, expectedResult: 8.8249778270762871, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.31830988618379069, expectedResult: 0.8020088789614519, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.31830988618379069, expectedResult: 0.8020088789614519, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.43429448190325182, expectedResult: 0.74005557395545174, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.43429448190325182, expectedResult: 0.74005557395545174, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.63661977236758138, expectedResult: 0.64321824193300492, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.63661977236758138, expectedResult: 0.64321824193300492, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.69314718055994529, expectedResult: 0.61850313780157595, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.69314718055994529, expectedResult: 0.61850313780157595, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.70710678118654757, expectedResult: 0.61254732653606592, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.70710678118654757, expectedResult: 0.61254732653606592, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.78539816339744828, expectedResult: 0.5801918103717244, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.78539816339744828, expectedResult: 0.5801918103717244, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -1, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -1, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -1.1283791670955126, expectedResult: 0.45742934732229695, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -1.1283791670955126, expectedResult: 0.45742934732229695, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -1.4142135623730949, expectedResult: 0.37521422724648179, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -1.4142135623730949, expectedResult: 0.37521422724648179, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -1.4426950408889634, expectedResult: 0.36787944117144233, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -1.4426950408889634, expectedResult: 0.36787944117144233, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -1.5707963267948966, expectedResult: 0.33662253682241905, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -1.5707963267948966, expectedResult: 0.33662253682241905, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -2.3025850929940459, expectedResult: 0.20269956628651731, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -2.3025850929940459, expectedResult: 0.20269956628651731, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -2.7182818284590451, expectedResult: 0.15195522325791297, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -2.7182818284590451, expectedResult: 0.15195522325791297, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -3.1415926535897931, expectedResult: 0.11331473229676087, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -3.1415926535897931, expectedResult: 0.11331473229676087, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0, expectedResult: 1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0, expectedResult: 1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: -4567) + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: -4567.89111) + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -Infinity, expectedResult: -1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -Infinity, expectedResult: -1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 2.7182818284590451, expectedResult: 5.5808859910179214, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 2.7182818284590451, expectedResult: 5.5808859910179214, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 2.3025850929940459, expectedResult: 3.9334096679145962, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 2.3025850929940459, expectedResult: 3.9334096679145962, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 1.5707963267948966, expectedResult: 1.9706864235520194, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 1.5707963267948966, expectedResult: 1.9706864235520194, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 1.4426950408889634, expectedResult: 1.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 1.4426950408889634, expectedResult: 1.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 1.4142135623730949, expectedResult: 1.6651441426902251, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 1.4142135623730949, expectedResult: 1.6651441426902251, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 1.1283791670955126, expectedResult: 1.1861299583286617, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 1.1283791670955126, expectedResult: 1.1861299583286617, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 1, expectedResult: 1, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 1, expectedResult: 1, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.78539816339744828, expectedResult: 0.72356793412734954, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.78539816339744828, expectedResult: 0.72356793412734954, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.70710678118654757, expectedResult: 0.63252691943815287, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.70710678118654757, expectedResult: 0.63252691943815287, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.69314718055994529, expectedResult: 0.61680667224167463, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.69314718055994529, expectedResult: 0.61680667224167463, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.63661977236758138, expectedResult: 0.55468227548210014, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.63661977236758138, expectedResult: 0.55468227548210014, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.43429448190325182, expectedResult: 0.3512498725672672, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.43429448190325182, expectedResult: 0.3512498725672672, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.31830988618379069, expectedResult: 0.2468689889006383, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.31830988618379069, expectedResult: 0.2468689889006383, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 3.1415926535897931, expectedResult: 7.824977827076288, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 3.1415926535897931, expectedResult: 7.824977827076288, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.31830988618379069, expectedResult: -0.19799112103854805, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.31830988618379069, expectedResult: -0.19799112103854805, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.43429448190325182, expectedResult: -0.2599444260445482, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.43429448190325182, expectedResult: -0.2599444260445482, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.63661977236758138, expectedResult: -0.35678175806699514, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.63661977236758138, expectedResult: -0.35678175806699514, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.69314718055994529, expectedResult: -0.38149686219842405, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.69314718055994529, expectedResult: -0.38149686219842405, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.70710678118654757, expectedResult: -0.38745267346393408, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.70710678118654757, expectedResult: -0.38745267346393408, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.78539816339744828, expectedResult: -0.41980818962827554, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.78539816339744828, expectedResult: -0.41980818962827554, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -1, expectedResult: -0.5, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -1, expectedResult: -0.5, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -1.1283791670955126, expectedResult: -0.5425706526777031, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -1.1283791670955126, expectedResult: -0.5425706526777031, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -1.4142135623730949, expectedResult: -0.62478577275351821, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -1.4142135623730949, expectedResult: -0.62478577275351821, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -1.4426950408889634, expectedResult: -0.63212055882855767, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -1.4426950408889634, expectedResult: -0.63212055882855767, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -1.5707963267948966, expectedResult: -0.66337746317758095, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -1.5707963267948966, expectedResult: -0.66337746317758095, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -2.3025850929940459, expectedResult: -0.79730043371348269, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -2.3025850929940459, expectedResult: -0.79730043371348269, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -2.7182818284590451, expectedResult: -0.848044776742087, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -2.7182818284590451, expectedResult: -0.848044776742087, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -3.1415926535897931, expectedResult: -0.88668526770323908, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -3.1415926535897931, expectedResult: -0.88668526770323908, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.054831135561607541, expectedResult: 3.1415926535897931, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.054831135561607541, expectedResult: 3.1415926535897931, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.052359877559829883, expectedResult: 3, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.052359877559829883, expectedResult: 3, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.047442967903742035, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.047442967903742035, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.043633231299858237, expectedResult: 2.5, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.043633231299858237, expectedResult: 2.5, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.040187691180085916, expectedResult: 2.3025850929940459, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.040187691180085916, expectedResult: 2.3025850929940459, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.034906585039886591, expectedResult: 2, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.034906585039886591, expectedResult: 2, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.027415567780803771, expectedResult: 1.5707963267948966, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.027415567780803771, expectedResult: 1.5707963267948966, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.026179938779914941, expectedResult: 1.5, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.026179938779914941, expectedResult: 1.5, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.025179778565706631, expectedResult: 1.4426950408889634, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.025179778565706631, expectedResult: 1.4426950408889634, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.061086523819801536, expectedResult: 3.5, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.061086523819801536, expectedResult: 3.5, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.024682682989768702, expectedResult: 1.4142135623730949, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.024682682989768702, expectedResult: 1.4142135623730949, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.017453292519943295, expectedResult: 1, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.017453292519943295, expectedResult: 1, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.013707783890401885, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.013707783890401885, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.012341341494884351, expectedResult: 0.70710678118654746, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.012341341494884351, expectedResult: 0.70710678118654746, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.012097700501686679, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.012097700501686679, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.011111111111111112, expectedResult: 0.63661977236758127, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.011111111111111112, expectedResult: 0.63661977236758127, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.0087266462599716477, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.0087266462599716477, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.0075798686324546746, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.0075798686324546746, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.0055555555555555566, expectedResult: 0.31830988618379058, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.0055555555555555566, expectedResult: 0.31830988618379058, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.019693931676727953, expectedResult: 1.1283791670955126, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.019693931676727953, expectedResult: 1.1283791670955126, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -Infinity, expectedResult: 0, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -Infinity, expectedResult: 0, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 2.7182818284590451, expectedResult: 522.73529967043669, allowedVariance: 8.8817841970012523E-13) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 2.7182818284590451, expectedResult: 522.73529967043669, allowedVariance: 8.8817841970012523E-13) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 2.3025850929940459, expectedResult: 200.71743249053009, allowedVariance: 8.8817841970012523E-13) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 2.3025850929940459, expectedResult: 200.71743249053009, allowedVariance: 8.8817841970012523E-13) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 1.5707963267948966, expectedResult: 37.221710484165165, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 1.5707963267948966, expectedResult: 37.221710484165165, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 1.4426950408889634, expectedResult: 27.713733786437789, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 1.4426950408889634, expectedResult: 27.713733786437789, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 1.4142135623730949, expectedResult: 25.954553519470082, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 1.4142135623730949, expectedResult: 25.954553519470082, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 1.1283791670955126, expectedResult: 13.439377934644401, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 1.1283791670955126, expectedResult: 13.439377934644401, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 1, expectedResult: 10, allowedVariance: 8.8817841970012523E-14) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 1, expectedResult: 10, allowedVariance: 8.8817841970012523E-14) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.78539816339744828, expectedResult: 6.1009598002416938, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.78539816339744828, expectedResult: 6.1009598002416938, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.70710678118654757, expectedResult: 5.0945611704512963, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.70710678118654757, expectedResult: 5.0945611704512963, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.69314718055994529, expectedResult: 4.9334096679145967, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.69314718055994529, expectedResult: 4.9334096679145967, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.63661977236758138, expectedResult: 4.3313150290214528, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.63661977236758138, expectedResult: 4.3313150290214528, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.43429448190325182, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.43429448190325182, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.31830988618379069, expectedResult: 2.0811811619898575, allowedVariance: 8.8817841970012523E-15) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.31830988618379069, expectedResult: 2.0811811619898575, allowedVariance: 8.8817841970012523E-15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0, expectedResult: 1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0, expectedResult: 1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 3.1415926535897931, expectedResult: 1385.4557313670111, allowedVariance: 8.8817841970012523E-12) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 3.1415926535897931, expectedResult: 1385.4557313670111, allowedVariance: 8.8817841970012523E-12) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.31830988618379069, expectedResult: 0.48049637305186865, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.31830988618379069, expectedResult: 0.48049637305186865, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.43429448190325182, expectedResult: 0.36787944117144233, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.43429448190325182, expectedResult: 0.36787944117144233, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.63661977236758138, expectedResult: 0.23087676451600056, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.63661977236758138, expectedResult: 0.23087676451600056, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.69314718055994529, expectedResult: 0.20269956628651731, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.69314718055994529, expectedResult: 0.20269956628651731, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.70710678118654757, expectedResult: 0.19628775993505562, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.70710678118654757, expectedResult: 0.19628775993505562, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.78539816339744828, expectedResult: 0.16390863613957665, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.78539816339744828, expectedResult: 0.16390863613957665, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -1, expectedResult: 0.10000000000000001, allowedVariance: 8.8817841970012523E-16) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -1, expectedResult: 0.10000000000000001, allowedVariance: 8.8817841970012523E-16) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -1.1283791670955126, expectedResult: 0.074408205860642729, allowedVariance: 8.8817841970012528E-17) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -1.1283791670955126, expectedResult: 0.074408205860642729, allowedVariance: 8.8817841970012528E-17) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -1.4142135623730949, expectedResult: 0.038528884700322029, allowedVariance: 8.8817841970012528E-17) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -1.4142135623730949, expectedResult: 0.038528884700322029, allowedVariance: 8.8817841970012528E-17) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -1.4426950408889634, expectedResult: 0.036083192820787209, allowedVariance: 8.8817841970012528E-17) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -1.4426950408889634, expectedResult: 0.036083192820787209, allowedVariance: 8.8817841970012528E-17) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -1.5707963267948966, expectedResult: 0.026866041001136133, allowedVariance: 8.8817841970012528E-17) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -1.5707963267948966, expectedResult: 0.026866041001136133, allowedVariance: 8.8817841970012528E-17) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -2.3025850929940459, expectedResult: 0.0049821282964407207, allowedVariance: 8.8817841970012525E-18) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -2.3025850929940459, expectedResult: 0.0049821282964407207, allowedVariance: 8.8817841970012525E-18) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -2.7182818284590451, expectedResult: 0.0019130141022243175, allowedVariance: 8.8817841970012525E-18) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -2.7182818284590451, expectedResult: 0.0019130141022243175, allowedVariance: 8.8817841970012525E-18) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -3.1415926535897931, expectedResult: 0.00072178415907472773, allowedVariance: 8.8817841970012525E-19) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -3.1415926535897931, expectedResult: 0.00072178415907472773, allowedVariance: 8.8817841970012525E-19) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0, expectedResult: 1, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0, expectedResult: 1, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: -4567, right: 3.1400001) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: -4567, right: 3.1400001) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: -4567.89111, right: 3.14568996) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: -4567.89111, right: 3.14568996) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: 0, right: 3.1400001) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: 0, right: 3.1400001) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: 4567, right: -3.1400001) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: 4567, right: -3.1400001) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: 4567.89111, right: -3.14568996) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: 4567.89111, right: -3.14568996) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Inequality(left: 789, right: 789) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Inequality(left: 789, right: 789) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Inequality(left: 789, right: -789) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Inequality(left: 789, right: -789) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Inequality(left: 789, right: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Inequality(left: 789, right: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Inequality(left: 789, right: 1000) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Inequality(left: 789, right: 1000) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UIntPtrToNFloat(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UIntPtrToNFloat(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UIntPtrToNFloat(value: 5) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UIntPtrToNFloat(value: 5) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UIntPtrToNFloat(value: 42) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UIntPtrToNFloat(value: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UIntPtrToNFloat(value: 127) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UIntPtrToNFloat(value: 127) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UIntPtrToNFloat(value: 255) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UIntPtrToNFloat(value: 255) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt32(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt32(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt32(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt32(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt32(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt32(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt32(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt32(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt32(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt32(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt64(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt64(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt64(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt64(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt64(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt64(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt64(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt64(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt64(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt64(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Ctor_Float + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Ctor_Float + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: 1.40129846E-45) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: 1.40129846E-45) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: -Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: -Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: Infinity) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: Infinity) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: NaN) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: NaN) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test32 + info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test32 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int32ToNFloat(value: -255) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int32ToNFloat(value: -255) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int32ToNFloat(value: -127) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int32ToNFloat(value: -127) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int32ToNFloat(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int32ToNFloat(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int32ToNFloat(value: 127) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int32ToNFloat(value: 127) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int32ToNFloat(value: 255) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int32ToNFloat(value: 255) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt32ToNFloat(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt32ToNFloat(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt32ToNFloat(value: 5) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt32ToNFloat(value: 5) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt32ToNFloat(value: 42) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt32ToNFloat(value: 42) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt32ToNFloat(value: 127) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt32ToNFloat(value: 127) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt32ToNFloat(value: 255) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt32ToNFloat(value: 255) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IntPtrToNFloat(value: -255) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IntPtrToNFloat(value: -255) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IntPtrToNFloat(value: -127) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IntPtrToNFloat(value: -127) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IntPtrToNFloat(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IntPtrToNFloat(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IntPtrToNFloat(value: 127) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IntPtrToNFloat(value: 127) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IntPtrToNFloat(value: 255) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IntPtrToNFloat(value: 255) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDecimal(value: -4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDecimal(value: -4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDecimal(value: -4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDecimal(value: -4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDecimal(value: 0) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDecimal(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDecimal(value: 4567) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDecimal(value: 4567) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDecimal(value: 4567.89111) + info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDecimal(value: 4567.89111) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SetComObjectDataTests.SetComObjectData_NullKey_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.SetComObjectDataTests.SetComObjectData_NullKey_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SetComObjectDataTests.SetComObjectData_Unix_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.Tests.SetComObjectDataTests.SetComObjectData_Unix_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SetComObjectDataTests.SetComObjectData_NullObj_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.SetComObjectDataTests.SetComObjectData_NullObj_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SetComObjectDataTests.SetComObjectData_NonComObjectObj_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.SetComObjectDataTests.SetComObjectData_NonComObjectObj_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComAliasNameAttributeTests.Ctor_Alias(alias: null) + info: [PASS] System.Runtime.InteropServices.Tests.ComAliasNameAttributeTests.Ctor_Alias(alias: null) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComAliasNameAttributeTests.Ctor_Alias(alias: "") + info: [PASS] System.Runtime.InteropServices.Tests.ComAliasNameAttributeTests.Ctor_Alias(alias: "") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComAliasNameAttributeTests.Ctor_Alias(alias: "value") + info: [PASS] System.Runtime.InteropServices.Tests.ComAliasNameAttributeTests.Ctor_Alias(alias: "value") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComAliasNameAttributeTests.Exists + info: [PASS] System.Runtime.InteropServices.Tests.ComAliasNameAttributeTests.Exists + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.ULongType + info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.ULongType + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.DoubleType + info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.DoubleType + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.UshortType + info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.UshortType + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.GetObjectsForNativeVariants_Unix_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.GetObjectsForNativeVariants_Unix_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.GetObjectsForNativeVariants_NegativeCount_ThrowsArgumentOutOfRangeException + info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.GetObjectsForNativeVariants_NegativeCount_ThrowsArgumentOutOfRangeException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.UIntType + info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.UIntType + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.ShortType + info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.ShortType + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.LongType + info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.LongType + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.ByteType + info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.ByteType + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.GetObjectsForNativeVariants_ZeroPointer_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.GetObjectsForNativeVariants_ZeroPointer_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.FloatType + info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.FloatType + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.SByteType + info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.SByteType + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.IntType + info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.IntType + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CreateWrapperOfTypeTests.CreateWrapperOfType_NullType_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.CreateWrapperOfTypeTests.CreateWrapperOfType_NullType_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CreateWrapperOfTypeTests.CreateWrapperOfType_Unix_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.Tests.CreateWrapperOfTypeTests.CreateWrapperOfType_Unix_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CallingConventionTests.CallingConvention_Get_ReturnsExpected(convention: Winapi, expected: 1) + info: [PASS] System.Runtime.InteropServices.Tests.CallingConventionTests.CallingConvention_Get_ReturnsExpected(convention: Winapi, expected: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CallingConventionTests.CallingConvention_Get_ReturnsExpected(convention: Cdecl, expected: 2) + info: [PASS] System.Runtime.InteropServices.Tests.CallingConventionTests.CallingConvention_Get_ReturnsExpected(convention: Cdecl, expected: 2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CallingConventionTests.CallingConvention_Get_ReturnsExpected(convention: StdCall, expected: 3) + info: [PASS] System.Runtime.InteropServices.Tests.CallingConventionTests.CallingConvention_Get_ReturnsExpected(convention: StdCall, expected: 3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CallingConventionTests.CallingConvention_Get_ReturnsExpected(convention: ThisCall, expected: 4) + info: [PASS] System.Runtime.InteropServices.Tests.CallingConventionTests.CallingConvention_Get_ReturnsExpected(convention: ThisCall, expected: 4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CallingConventionTests.CallingConvention_Get_ReturnsExpected(convention: FastCall, expected: 5) + info: [PASS] System.Runtime.InteropServices.Tests.CallingConventionTests.CallingConvention_Get_ReturnsExpected(convention: FastCall, expected: 5) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_LayoutKind(layoutKind: -1) + info: [PASS] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_LayoutKind(layoutKind: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_LayoutKind(layoutKind: Sequential) + info: [PASS] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_LayoutKind(layoutKind: Sequential) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_LayoutKind(layoutKind: Auto) + info: [PASS] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_LayoutKind(layoutKind: Auto) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_ShortLayoutKind(layoutKind: -1) + info: [PASS] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_ShortLayoutKind(layoutKind: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_ShortLayoutKind(layoutKind: 0) + info: [PASS] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_ShortLayoutKind(layoutKind: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_ShortLayoutKind(layoutKind: 4) + info: [PASS] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_ShortLayoutKind(layoutKind: 4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUni_NullString_ReturnsZero + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUni_NullString_ReturnsZero + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "FooBAðÇR") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "FooBAðÇR") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "├Çnima╠Çl") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "├Çnima╠Çl") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "Test­ÉÁÁTest") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "Test­ÉÁÁTest") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "─░") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "─░") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "­ÉÁÁ­ÉÁÁ­ÉÁÁ") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "­ÉÁÁ­ÉÁÁ­ÉÁÁ") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "za╠åâ╬▓±Å│┐") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "za╠åâ╬▓±Å│┐") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "#%╬á╬ú") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "#%╬á╬ú") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "├à") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "├à") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "ee├íeeÞÇÇ├íe­ÉÇÇÞÇÇ├íeee") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "ee├íeeÞÇÇ├íe­ÉÇÇÞÇÇ├íeee") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "┬ñ├ÉaR|{AnGe┬ú┬ñ") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "┬ñ├ÉaR|{AnGe┬ú┬ñ") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "­ÉÇÇ­ÉÇÇ­ÉÇÇ") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "­ÉÇÇ­ÉÇÇ­ÉÇÇ") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "­ÉÇÇe­ÉÇÇ") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "­ÉÇÇe­ÉÇÇ") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "") + info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_ShortUnmanagedType(umanagedType: -1) + info: [PASS] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_ShortUnmanagedType(umanagedType: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_ShortUnmanagedType(umanagedType: 47) + info: [PASS] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_ShortUnmanagedType(umanagedType: 47) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_ShortUnmanagedType(umanagedType: 32767) + info: [PASS] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_ShortUnmanagedType(umanagedType: 32767) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_UmanagedTye(unmanagedType: -1) + info: [PASS] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_UmanagedTye(unmanagedType: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_UmanagedTye(unmanagedType: HString) + info: [PASS] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_UmanagedTye(unmanagedType: HString) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_UmanagedTye(unmanagedType: 2147483647) + info: [PASS] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_UmanagedTye(unmanagedType: 2147483647) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeIdentifierAttributetests.Ctor_Scope_Identifier(scope: null, identifier: null) + info: [PASS] System.Runtime.InteropServices.Tests.TypeIdentifierAttributetests.Ctor_Scope_Identifier(scope: null, identifier: null) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeIdentifierAttributetests.Ctor_Scope_Identifier(scope: "scope", identifier: "identifier") + info: [PASS] System.Runtime.InteropServices.Tests.TypeIdentifierAttributetests.Ctor_Scope_Identifier(scope: "scope", identifier: "identifier") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeIdentifierAttributetests.Ctor_Default + info: [PASS] System.Runtime.InteropServices.Tests.TypeIdentifierAttributetests.Ctor_Default + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalContextTests.Cancel_Roundtrips + info: [PASS] System.Tests.PosixSignalContextTests.Cancel_Roundtrips + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalContextTests.Constructor(value: SIGINT) + info: [PASS] System.Tests.PosixSignalContextTests.Constructor(value: SIGINT) + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalContextTests.Constructor(value: 0) + info: [PASS] System.Tests.PosixSignalContextTests.Constructor(value: 0) + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalContextTests.Constructor(value: 1000) + info: [PASS] System.Tests.PosixSignalContextTests.Constructor(value: 1000) + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalContextTests.Constructor(value: -1000) + info: [PASS] System.Tests.PosixSignalContextTests.Constructor(value: -1000) + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.SignalHandlerCalledForRawSignals + info: [SKIP] System.Tests.PosixSignalRegistrationTests.SignalHandlerCalledForRawSignals + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_UninstallableSignal_Throws + info: [SKIP] System.Tests.PosixSignalRegistrationTests.Create_UninstallableSignal_Throws + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_ValidSignal_Success + info: [SKIP] System.Tests.PosixSignalRegistrationTests.Create_ValidSignal_Success + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.SignalHandlerNotCalledWhenDisposed + info: [SKIP] System.Tests.PosixSignalRegistrationTests.SignalHandlerNotCalledWhenDisposed + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.SignalCanCancelTermination + info: [SKIP] System.Tests.PosixSignalRegistrationTests.SignalCanCancelTermination + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.SignalHandlerCalledForKnownSignals + info: [SKIP] System.Tests.PosixSignalRegistrationTests.SignalHandlerCalledForKnownSignals + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGTSTP) + info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGTSTP) + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGTTOU) + info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGTTOU) + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGTTIN) + info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGTTIN) + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGWINCH) + info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGWINCH) + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGCONT) + info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGCONT) + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGCHLD) + info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGCHLD) + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGTERM) + info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGTERM) + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGQUIT) + info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGQUIT) + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGINT) + info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGINT) + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGHUP) + info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGHUP) + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: 0) + info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: 0) + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: -1000) + info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: -1000) + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: 1000) + info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: 1000) + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_RegisterForMultipleSignalsMultipletimes_Success + info: [SKIP] System.Tests.PosixSignalRegistrationTests.Create_RegisterForMultipleSignalsMultipletimes_Success + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.Dispose_Idempotent + info: [SKIP] System.Tests.PosixSignalRegistrationTests.Dispose_Idempotent + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.SignalHandlerNotCalledWhenFinalized + info: [SKIP] System.Tests.PosixSignalRegistrationTests.SignalHandlerNotCalledWhenFinalized + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.SignalHandlerWorksForSecondRegistration + info: [SKIP] System.Tests.PosixSignalRegistrationTests.SignalHandlerWorksForSecondRegistration + info: Collecting garbage after test... + info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_NullHandler_Throws + info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_NullHandler_Throws + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComDefaultInterfaceAttributeTests.Ctor_DefaultInterface(defaultInterface: null) + info: [PASS] System.Runtime.InteropServices.Tests.ComDefaultInterfaceAttributeTests.Ctor_DefaultInterface(defaultInterface: null) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComDefaultInterfaceAttributeTests.Ctor_DefaultInterface(defaultInterface: typeof(int)) + info: [PASS] System.Runtime.InteropServices.Tests.ComDefaultInterfaceAttributeTests.Ctor_DefaultInterface(defaultInterface: typeof(int)) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterface1_SourceInterfaceType2_SourceInterfaceType3 + info: [PASS] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterface1_SourceInterfaceType2_SourceInterfaceType3 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterface1 + info: [PASS] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterface1 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterface1_SourceInterfaceType2 + info: [PASS] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterface1_SourceInterfaceType2 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterface1_SourceInterfaceType2_SourceInterfaceType3_SourceInterfaceType4 + info: [PASS] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterface1_SourceInterfaceType2_SourceInterfaceType3_SourceInterfaceType4 + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_NullSourceInterfaceType4_ThrowsNullReferenceException + info: [PASS] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_NullSourceInterfaceType4_ThrowsNullReferenceException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_NullSourceInterfaceType2_ThrowsNullReferenceException + info: [PASS] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_NullSourceInterfaceType2_ThrowsNullReferenceException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterfaces(sourceInterfaces: null) + info: [PASS] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterfaces(sourceInterfaces: null) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterfaces(sourceInterfaces: "SourceInterfaces") + info: [PASS] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterfaces(sourceInterfaces: "SourceInterfaces") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_NullSourceInterfaceType3_ThrowsNullReferenceException + info: [PASS] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_NullSourceInterfaceType3_ThrowsNullReferenceException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_NullSourceInterfaceType1_ThrowsNullReferenceException + info: [PASS] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_NullSourceInterfaceType1_ThrowsNullReferenceException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_NullString_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_NullString_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pizza") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pizza") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pepperoni") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pepperoni") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "password") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "password") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "P4ssw0rdAa1") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "P4ssw0rdAa1") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "ßê┤") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "ßê┤") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "´┐¢´┐¢") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "´┐¢´┐¢") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "­ÉÇÇ") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "­ÉÇÇ") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "\0") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "\0") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "abc\0def") + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "abc\0def") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_DisposedString_ThrowsObjectDisposedException + info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_DisposedString_ThrowsObjectDisposedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibImportClassAttributeTests.Ctor_NullImportClass_ThrowsNullReferenceException + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibImportClassAttributeTests.Ctor_NullImportClass_ThrowsNullReferenceException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.TypeLibImportClassAttributeTests.Ctor_ImportClass + info: [PASS] System.Runtime.InteropServices.Tests.TypeLibImportClassAttributeTests.Ctor_ImportClass + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.LibraryImportAttributeTests.Ctor(libraryName: null) + info: [PASS] System.Runtime.InteropServices.Tests.LibraryImportAttributeTests.Ctor(libraryName: null) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.LibraryImportAttributeTests.Ctor(libraryName: "LibraryName") + info: [PASS] System.Runtime.InteropServices.Tests.LibraryImportAttributeTests.Ctor(libraryName: "LibraryName") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregateObject_ZeroPointer_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregateObject_ZeroPointer_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregatedObject_NonGeneric_ReturnsExpected + info: [SKIP] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregatedObject_NonGeneric_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregatedObject_Unix_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregatedObject_Unix_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregatedObject_AlreadyHasContainer_ThrowsArgumentException + info: [SKIP] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregatedObject_AlreadyHasContainer_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregateObject_NullObject_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregateObject_NullObject_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregatedObject_Generic_ReturnsExpected + info: [SKIP] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregatedObject_Generic_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.AddRemove_AcrossMultipleGenerations_Success + info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.AddRemove_AcrossMultipleGenerations_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold_MaximumThreshold(name: null, initialThreshold: 0, maximumThreshold: 0) + info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold_MaximumThreshold(name: null, initialThreshold: 0, maximumThreshold: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold_MaximumThreshold(name: "", initialThreshold: 10, maximumThreshold: 15) + info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold_MaximumThreshold(name: "", initialThreshold: 10, maximumThreshold: 15) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold_MaximumThreshold(name: "InitialThreshold", initialThreshold: 1, maximumThreshold: 2) + info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold_MaximumThreshold(name: "InitialThreshold", initialThreshold: 1, maximumThreshold: 2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Ctor_NegativeMaximumThreshold_ThrowsArgumentOutOfRangeException + info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Ctor_NegativeMaximumThreshold_ThrowsArgumentOutOfRangeException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Add_Overflows_ThrowsInvalidOperationException + info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Add_Overflows_ThrowsInvalidOperationException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.TestHandleCollector + info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.TestHandleCollector + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Ctor_InitialThresholdGreaterThanMaximumThreshold_ThrowsArgumentException + info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Ctor_InitialThresholdGreaterThanMaximumThreshold_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold(name: null, initialThreshold: 0) + info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold(name: null, initialThreshold: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold(name: "", initialThreshold: 10) + info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold(name: "", initialThreshold: 10) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold(name: "InitialThreshold", initialThreshold: 2147483647) + info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold(name: "InitialThreshold", initialThreshold: 2147483647) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Remove_EmptyCollection_ThrowsInvalidOperationException + info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Remove_EmptyCollection_ThrowsInvalidOperationException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Ctor_NegativeInitialThreshold_ThrowsArgumentOufORangeException + info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Ctor_NegativeInitialThreshold_ThrowsArgumentOufORangeException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ZeroFreeGlobalAllocAnsiTests.ZeroFreeGlobalAllocAnsi_Zero_Nop + info: [PASS] System.Runtime.InteropServices.Tests.ZeroFreeGlobalAllocAnsiTests.ZeroFreeGlobalAllocAnsi_Zero_Nop + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ZeroFreeGlobalAllocAnsiTests.ZeroFreeGlobalAllocAnsi_ValidPointer_Success + info: [PASS] System.Runtime.InteropServices.Tests.ZeroFreeGlobalAllocAnsiTests.ZeroFreeGlobalAllocAnsi_ValidPointer_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetEndComSlotTests.GetEndComSlot_InvalidGenericType_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.GetEndComSlotTests.GetEndComSlot_InvalidGenericType_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetEndComSlotTests.GetEndComSlot_Unix_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.Tests.GetEndComSlotTests.GetEndComSlot_Unix_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetEndComSlotTests.GetEndComSlot_NullType_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.GetEndComSlotTests.GetEndComSlot_NullType_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetEndComSlotTests.GetEndComSlot_NotComVisibleType_ThrowsArgumentException + info: [SKIP] System.Runtime.InteropServices.Tests.GetEndComSlotTests.GetEndComSlot_NotComVisibleType_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetEndComSlotTests.GetEndComSlot_NotRuntimeType_ThrowsArgumentException + info: [SKIP] System.Runtime.InteropServices.Tests.GetEndComSlotTests.GetEndComSlot_NotRuntimeType_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ChangeWrapperHandleStrengthTests.ChangeWrapperHandleStrength_NullObject_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.ChangeWrapperHandleStrengthTests.ChangeWrapperHandleStrength_NullObject_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ChangeWrapperHandleStrengthTests.ChangeWrapperHandleStrength_ValidObject_Success + info: [SKIP] System.Runtime.InteropServices.Tests.ChangeWrapperHandleStrengthTests.ChangeWrapperHandleStrength_ValidObject_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ChangeWrapperHandleStrengthTests.ChangeWrapperHandleStrength_Unix_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.Tests.ChangeWrapperHandleStrengthTests.ChangeWrapperHandleStrength_Unix_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ZeroFreeCoTaskMemUnicodeTests.ZeroFreeCoTaskMemUnicode_Zero_Nop + info: [PASS] System.Runtime.InteropServices.Tests.ZeroFreeCoTaskMemUnicodeTests.ZeroFreeCoTaskMemUnicode_Zero_Nop + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ZeroFreeCoTaskMemUnicodeTests.ZeroFreeCoTaskMemUnicode_ValidPointer_Success + info: [PASS] System.Runtime.InteropServices.Tests.ZeroFreeCoTaskMemUnicodeTests.ZeroFreeCoTaskMemUnicode_ValidPointer_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.UnmanagedFunctionPointerAttributeTests.Ctor_CallingConvention(callingConvention: -1) + info: [PASS] System.Runtime.InteropServices.Tests.UnmanagedFunctionPointerAttributeTests.Ctor_CallingConvention(callingConvention: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.UnmanagedFunctionPointerAttributeTests.Ctor_CallingConvention(callingConvention: Cdecl) + info: [PASS] System.Runtime.InteropServices.Tests.UnmanagedFunctionPointerAttributeTests.Ctor_CallingConvention(callingConvention: Cdecl) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.UnmanagedFunctionPointerAttributeTests.Ctor_CallingConvention(callingConvention: 2147483647) + info: [PASS] System.Runtime.InteropServices.Tests.UnmanagedFunctionPointerAttributeTests.Ctor_CallingConvention(callingConvention: 2147483647) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.BestFitMappingAttributeTests.Ctor_BestFitMapping(bestFitMapping: True) + info: [PASS] System.Runtime.InteropServices.Tests.BestFitMappingAttributeTests.Ctor_BestFitMapping(bestFitMapping: True) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.BestFitMappingAttributeTests.Ctor_BestFitMapping(bestFitMapping: False) + info: [PASS] System.Runtime.InteropServices.Tests.BestFitMappingAttributeTests.Ctor_BestFitMapping(bestFitMapping: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.FieldOffsetAttributeTests.Ctor_Value(offset: -1) + info: [PASS] System.Runtime.InteropServices.FieldOffsetAttributeTests.Ctor_Value(offset: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.FieldOffsetAttributeTests.Ctor_Value(offset: 0) + info: [PASS] System.Runtime.InteropServices.FieldOffsetAttributeTests.Ctor_Value(offset: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.FieldOffsetAttributeTests.Ctor_Value(offset: 1) + info: [PASS] System.Runtime.InteropServices.FieldOffsetAttributeTests.Ctor_Value(offset: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NullObject_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NullObject_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NonGenericWithValidClass_ReturnsExpected + info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NonGenericWithValidClass_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NonGenericWithValidStruct_ReturnsExpected + info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NonGenericWithValidStruct_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_InvalidType_ThrowsArgumentException + info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_InvalidType_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetTypedObjectForIUnknown_UncastableType_ThrowsInvalidCastException + info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetTypedObjectForIUnknown_UncastableType_ThrowsInvalidCastException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_Unix_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_Unix_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_GenericWithValidStruct_ReturnsExpected + info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_GenericWithValidStruct_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NonGenericCustomQueryInterfaceModeWithValidStruct_ReturnsExpected + info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NonGenericCustomQueryInterfaceModeWithValidStruct_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NonGenericCustomQueryInterfaceModeWithValidClass_ReturnsExpected + info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NonGenericCustomQueryInterfaceModeWithValidClass_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_InvalidObject_ThrowsArgumentException + info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_InvalidObject_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NullType_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NullType_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_GenericWithValidClass_ReturnsExpected + info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_GenericWithValidClass_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.Int64Tests.WriteInt64_Pointer_Roundtrips(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) + info: [PASS] System.Runtime.InteropServices.Tests.Int64Tests.WriteInt64_Pointer_Roundtrips(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ThrowExceptionForHRTests.ThrowExceptionForHR_InvalidHR_Nop(errorCode: 0) + info: [PASS] System.Runtime.InteropServices.Tests.ThrowExceptionForHRTests.ThrowExceptionForHR_InvalidHR_Nop(errorCode: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ThrowExceptionForHRTests.ThrowExceptionForHR_InvalidHR_Nop(errorCode: 1) + info: [PASS] System.Runtime.InteropServices.Tests.ThrowExceptionForHRTests.ThrowExceptionForHR_InvalidHR_Nop(errorCode: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException + info: [PASS] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_NullSource_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_NullSource_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) + info: [PASS] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) + info: [PASS] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) + info: [PASS] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException + info: [PASS] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) + info: [PASS] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 0) + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 1) + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 65538) + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 65538) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 65539) + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 65539) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 65556) + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 65556) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 65565) + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 65565) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: -2147467263) + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: -2147467263) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: -2147467259) + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: -2147467259) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: -2147024809) + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: -2147024809) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: -2147418113) + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: -2147418113) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 0) + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 1) + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 65538) + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 65538) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 65539) + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 65539) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 65556) + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 65556) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 65565) + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 65565) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: -2147467263) + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: -2147467263) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: -2147467259) + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: -2147467259) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: -2147024809) + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: -2147024809) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: -2147418113) + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: -2147418113) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_UniqueMessage_Unix + info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_UniqueMessage_Unix + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.Int32Tests.WriteInt32_Pointer_Roundtrips(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) + info: [PASS] System.Runtime.InteropServices.Tests.Int32Tests.WriteInt32_Pointer_Roundtrips(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.FreeCoTaskMemTests.FreeCoTaskMem_Zero_Nop + info: [PASS] System.Runtime.InteropServices.Tests.FreeCoTaskMemTests.FreeCoTaskMem_Zero_Nop + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.FreeCoTaskMemTests.FreeCoTaskMem_ValidPointer_Success + info: [PASS] System.Runtime.InteropServices.Tests.FreeCoTaskMemTests.FreeCoTaskMem_ValidPointer_Success + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.IsComObjectTests.IsComObject_NullObject_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.IsComObjectTests.IsComObject_NullObject_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.IsComObjectTests.IsComObject_NonComObject_ReturnsFalse + info: [SKIP] System.Runtime.InteropServices.Tests.IsComObjectTests.IsComObject_NonComObject_ReturnsFalse + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetComObjectDataTests.GetComObjectData_NullKey_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.GetComObjectDataTests.GetComObjectData_NullKey_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetComObjectDataTests.GetComObjectData_Unix_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.Tests.GetComObjectDataTests.GetComObjectData_Unix_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetComObjectDataTests.GetComObjectData_NullObj_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.GetComObjectDataTests.GetComObjectData_NullObj_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetComObjectDataTests.GetComObjectData_NonComObjectObj_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.GetComObjectDataTests.GetComObjectData_NonComObjectObj_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetStartComSlotTests.GetStartComSlot_InvalidGenericType_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.GetStartComSlotTests.GetStartComSlot_InvalidGenericType_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetStartComSlotTests.GetStartComSlot_Unix_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.Tests.GetStartComSlotTests.GetStartComSlot_Unix_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetStartComSlotTests.GetStartComSlot_NullType_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.GetStartComSlotTests.GetStartComSlot_NullType_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetStartComSlotTests.GetStartComSlot_NotComVisibleType_ThrowsArgumentException + info: [SKIP] System.Runtime.InteropServices.Tests.GetStartComSlotTests.GetStartComSlot_NotComVisibleType_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetStartComSlotTests.GetStartComSlot_NotRuntimeType_ThrowsArgumentException + info: [SKIP] System.Runtime.InteropServices.Tests.GetStartComSlotTests.GetStartComSlot_NotRuntimeType_ThrowsArgumentException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVisibleAttributeTests.Ctor_Visible + info: [SKIP] System.Runtime.InteropServices.Tests.ComVisibleAttributeTests.Ctor_Visible + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.ComVisibleAttributeTests.Exists + info: [SKIP] System.Runtime.InteropServices.Tests.ComVisibleAttributeTests.Exists + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: 789, expected: True) + info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: 789, expected: True) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: -789, expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: -789, expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: 0, expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: 0, expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 0, obj: 0, expected: True) + info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 0, obj: 0, expected: True) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: -789, obj: -789, expected: True) + info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: -789, obj: -789, expected: True) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: -789, obj: 789, expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: -789, obj: 789, expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: null, expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: null, expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: "789", expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: "789", expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: 789, expected: False) + info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: 789, expected: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.Ctor_Int + info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.Ctor_Int + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.Ctor_NInt + info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.Ctor_NInt + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.ToStringTest(value: -2147483648, expected: "-2147483648") + info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.ToStringTest(value: -2147483648, expected: "-2147483648") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.ToStringTest(value: -4567, expected: "-4567") + info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.ToStringTest(value: -4567, expected: "-4567") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.ToStringTest(value: 0, expected: "0") + info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.ToStringTest(value: 0, expected: "0") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.ToStringTest(value: 4567, expected: "4567") + info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.ToStringTest(value: 4567, expected: "4567") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.ToStringTest(value: 2147483647, expected: "2147483647") + info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.ToStringTest(value: 2147483647, expected: "2147483647") + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.Size + info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.Size + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.Ctor_NInt_OutOfRange + info: [SKIP] System.Runtime.InteropServices.Tests.CLongTests.Ctor_NInt_OutOfRange + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.Ctor_Empty + info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.Ctor_Empty + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.Ctor_NInt_LargeValue + info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.Ctor_NInt_LargeValue + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DefaultDllImportSearchPathsAttributeTests.Ctor_Paths(paths: -1) + info: [PASS] System.Runtime.InteropServices.Tests.DefaultDllImportSearchPathsAttributeTests.Ctor_Paths(paths: -1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DefaultDllImportSearchPathsAttributeTests.Ctor_Paths(paths: AssemblyDirectory) + info: [PASS] System.Runtime.InteropServices.Tests.DefaultDllImportSearchPathsAttributeTests.Ctor_Paths(paths: AssemblyDirectory) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.DefaultDllImportSearchPathsAttributeTests.Ctor_Paths(paths: 2147483647) + info: [PASS] System.Runtime.InteropServices.Tests.DefaultDllImportSearchPathsAttributeTests.Ctor_Paths(paths: 2147483647) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetObjectForIUnknownTests.GetObjectForIUnknown_Unix_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.Tests.GetObjectForIUnknownTests.GetObjectForIUnknown_Unix_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetObjectForIUnknownTests.GetObjectForIUnknown_ValidPointer_ReturnsExpected + info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectForIUnknownTests.GetObjectForIUnknown_ValidPointer_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetObjectForIUnknownTests.GetObjectForIUnknown_NullPointer_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectForIUnknownTests.GetObjectForIUnknown_NullPointer_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetUniqueObjectForIUnknownTests.GetUniqueObjectForIUnknown_Unix_ThrowsPlatformNotSupportedException + info: [PASS] System.Runtime.InteropServices.Tests.GetUniqueObjectForIUnknownTests.GetUniqueObjectForIUnknown_Unix_ThrowsPlatformNotSupportedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetUniqueObjectForIUnknownTests.GetUniqueObjectForIUnknown_ValidPointer_ReturnsExpected + info: [SKIP] System.Runtime.InteropServices.Tests.GetUniqueObjectForIUnknownTests.GetUniqueObjectForIUnknown_ValidPointer_ReturnsExpected + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.GetUniqueObjectForIUnknownTests.GetUniqueObjectForIUnknown_NullPointer_ThrowsArgumentNullException + info: [SKIP] System.Runtime.InteropServices.Tests.GetUniqueObjectForIUnknownTests.GetUniqueObjectForIUnknown_NullPointer_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentOutOfRangeException + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentOutOfRangeException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.AcquirePointer_NotInitialized_ThrowsInvalidOperationException + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.AcquirePointer_NotInitialized_ThrowsInvalidOperationException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReleasePointer_NotInitialized_ThrowsInvalidOperationException + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReleasePointer_NotInitialized_ThrowsInvalidOperationException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 0, index: 1, count: 0) + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 0, index: 1, count: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 0, index: 0, count: 1) + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 0, index: 0, count: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 2, index: 3, count: 0) + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 2, index: 3, count: 0) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 2, index: 2, count: 1) + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 2, index: 2, count: 1) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 2, index: 1, count: 2) + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 2, index: 1, count: 2) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 2, index: 0, count: 3) + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 2, index: 0, count: 3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWrite_RoundTrip + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWrite_RoundTrip + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadArray_NullArray_ThrowsArgumentNullException + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadArray_NullArray_ThrowsArgumentNullException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.AcquirePointer_Disposed_ThrowsObjectDisposedException + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.AcquirePointer_Disposed_ThrowsObjectDisposedException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteSpan_EmptySpan_Passes + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteSpan_EmptySpan_Passes + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWrite_NotInitialized_ThrowsInvalidOperationException + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWrite_NotInitialized_ThrowsInvalidOperationException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ByteLength_GetNotInitialized_ThrowsInvalidOperationException + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ByteLength_GetNotInitialized_ThrowsInvalidOperationException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteSpanArray_RoundTrip + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteSpanArray_RoundTrip + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.Initialize_NumBytesTimesSizeOfEachElement_ThrowsArgumentOutOfRangeExceptionIfNot64Bit + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.Initialize_NumBytesTimesSizeOfEachElement_ThrowsArgumentOutOfRangeExceptionIfNot64Bit + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWrite_NotEnoughSpaceInBuffer_ThrowsArgumentException(byteOffset: 4) + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWrite_NotEnoughSpaceInBuffer_ThrowsArgumentException(byteOffset: 4) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWrite_NotEnoughSpaceInBuffer_ThrowsArgumentException(byteOffset: 3) + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWrite_NotEnoughSpaceInBuffer_ThrowsArgumentException(byteOffset: 3) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWrite_NotEnoughSpaceInBuffer_ThrowsArgumentException(byteOffset: 18446744073709551615) + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWrite_NotEnoughSpaceInBuffer_ThrowsArgumentException(byteOffset: 18446744073709551615) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NotInitialized_ThrowsInvalidOperationException + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NotInitialized_ThrowsInvalidOperationException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.Ctor_Bool(ownsHandle: True) + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.Ctor_Bool(ownsHandle: True) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.Ctor_Bool(ownsHandle: False) + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.Ctor_Bool(ownsHandle: False) + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadArray_NegativeIndex_ThrowsArgumentOutOfRangeException + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadArray_NegativeIndex_ThrowsArgumentOutOfRangeException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.Initialize_InvalidNumBytes_ThrowsArgumentOutOfRangeException + info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.Initialize_InvalidNumBytes_ThrowsArgumentOutOfRangeException + info: Collecting garbage after test... + info: [STRT] System.Runtime.InteropServices.Tests.OffsetOfTests.OffsetOf_NoSuchFieldName_ThrowsArgumentException + fail: MONO_WASM: null function or function signature mismatch + RuntimeError: null function or function signature mismatch + at do_icall (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[251]:0x2e604) + at do_icall_wrapper (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[103]:0x2672e) + at mono_interp_exec_method (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[91]:0x9a99) + at interp_runtime_invoke (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[89]:0x7d9e) + at mono_jit_runtime_invoke (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[7470]:0x3cac33) + at do_runtime_invoke (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[5413]:0x2e3d34) + at mono_runtime_invoke_checked (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[5410]:0x2e38f5) + at mono_runtime_try_invoke_byrefs (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[5568]:0x2f99de) + at ves_icall_InternalInvoke (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[3982]:0x228ded) + at ves_icall_InternalInvoke_raw (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[4204]:0x248217) + at do_icall (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[251]:0x2f393) + at do_icall_wrapper (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[103]:0x2672e) + at mono_interp_exec_method (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[91]:0x9a99) + at interp_entry (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[202]:0x2b746) + at interp_entry_static_0 (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[232]:0x2c35a) + at wasm_native_to_interp_System_Private_CoreLib_System_Threading_ThreadPool_BackgroundJobHandler (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[10572]:0x4e3c6a) + at mono_background_exec (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[1321]:0x98528) + at wf. (http://127.0.0.1:63289/_framework/dotnet.runtime.js:182:24) + at mono_background_exec_until_done (http://127.0.0.1:63289/_framework/dotnet.runtime.js:2709:29) + at callUserCallback (http://127.0.0.1:63289/_framework/dotnet.native.js:7053:9) + at http://127.0.0.1:63289/_framework/dotnet.native.js:7073:9 + fail: Aborted(Assertion failed) + fail: [out of order message from the browser]: http://127.0.0.1:63289/_framework/dotnet.native.js 70:2 Uncaught RuntimeError: null function or function signature mismatch + fail: [out of order message from the browser]: http://127.0.0.1:63289/_framework/dotnet.native.wasm 0:5126439 Uncaught RuntimeError: unreachable + info: WASM EXIT 1 + dbug: Reached wasm exit + dbug: Reading console messages from websocket stopped + info: Waiting to flush log messages with a timeout of 120 secs .. + trce: Looking for `tests_done` element, to get the exit code + fail: Application has finished with exit code TESTS_FAILED but 0 was expected + info: Closing 1 browser tabs before setting the main tab to config page and quitting. + XHarness exit code: 71 (GENERAL_FAILURE) + ----- end 11/09/2025 11:28:08.44 ----- exit code 71 ---------------------------------------------------------- + XHarness artifacts: C:\xr_dev\dotnetFork\runtime\artifacts\bin\System.Runtime.InteropServices.Tests\Debug\net10.0-browser\browser-wasm\AppBundle\xharness-output +C:\xr_dev\dotnetFork\runtime\eng\testing\tests.targets(193,5): error : One or more tests failed while running tests from 'System.Runtime.InteropServices.Tests'. [C:\xr_dev\dotnetFork\runtime\src\libraries\System.Runtime.InteropServices\tests\System.Runtime.InteropServices.UnitTests\System.Runtime.InteropServices.Tests.csproj::TargetFramework=net10.0-browser] + +Build FAILED. + +C:\xr_dev\dotnetFork\runtime\eng\testing\tests.targets(193,5): error : One or more tests failed while running tests from 'System.Runtime.InteropServices.Tests'. [C:\xr_dev\dotnetFork\runtime\src\libraries\System.Runtime.InteropServices\tests\System.Runtime.InteropServices.UnitTests\System.Runtime.InteropServices.Tests.csproj::TargetFramework=net10.0-browser] + 0 Warning(s) + 1 Error(s) + +Time Elapsed 00:00:39.38 diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.NonNativeAot.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.NonNativeAot.cs index bd3a0be6902af9..a7d659ab704e45 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.NonNativeAot.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.NonNativeAot.cs @@ -48,6 +48,13 @@ internal partial struct ThreadId public bool IsInitialized => _id != 0; public static ThreadId Current_NoInitialize => new ThreadId(t_threadId); + public static uint GetCurrentOSThreadIdForTest() + { + var threadId = new ThreadId(0); + threadId.InitializeForCurrentThread(); + return threadId.Id; + } + public void InitializeForCurrentThread() { Debug.Assert(!IsInitialized); diff --git a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj index ee73d2dd11180d..b68856f60f062c 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj @@ -4,7 +4,7 @@ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetCoreAppCurrent)-browser true true - --setenv=MH_LOG_VERBOSITY=4 + --setenv=MH_LOG_VERBOSITY=0 diff --git a/src/mono/sample/wasm/browser-advanced/Program.cs b/src/mono/sample/wasm/browser-advanced/Program.cs index 9be6be8f4fa509..d6b6c65f380502 100644 --- a/src/mono/sample/wasm/browser-advanced/Program.cs +++ b/src/mono/sample/wasm/browser-advanced/Program.cs @@ -44,6 +44,9 @@ public static async Task Main(string[] args) [LibraryImport("fibonacci")] public static partial int Fibonacci(int n); + [LibraryImport("testGLStartup")] + public static partial void testGLStartup(); + [JSImport("Sample.Test.add", "main.js")] internal static partial int Add(int a, int b); @@ -116,12 +119,19 @@ internal static void SimpleTestFunctionPrintString() Console.WriteLine("MH DOING A TEST"); } [JSExport] + internal static void TestGL() + { + testGLStartup(); + } + [JSExport] internal static int TestMeaning() { + testGLStartup(); int testSize = 123; Console.WriteLine("Size of an int is " + sizeof(int) + " bytes, and test size is " + testSize + " bytes."); // call to C code via [DllImport] var half = Fibonacci(8); + // call back to JS via [JSImport] return Add(half, half); } diff --git a/src/mono/sample/wasm/browser-advanced/fibonacci.c b/src/mono/sample/wasm/browser-advanced/fibonacci.c index 657513d7ebb79e..a5f3cc4ff97a1d 100644 --- a/src/mono/sample/wasm/browser-advanced/fibonacci.c +++ b/src/mono/sample/wasm/browser-advanced/fibonacci.c @@ -1,3 +1,5 @@ +#include +#include int Fibonacci(int n) { int fnow = 0, fnext = 1, tempf; while(--n>0){ @@ -6,4 +8,28 @@ int Fibonacci(int n) { fnext = tempf; } return fnext; -} \ No newline at end of file +} +void testGLStartup() +{ + EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = 0; + EmscriptenWebGLContextAttributes attrs; + attrs.depth = 1; + attrs.stencil = 1; + attrs.antialias = 1; + attrs.premultipliedAlpha = 1; + attrs.preserveDrawingBuffer = 0; + attrs.powerPreference = EM_WEBGL_POWER_PREFERENCE_DEFAULT; //EM_WEBGL_POWER_PREFERENCE_HIGH_PERFORMANCE + attrs.failIfMajorPerformanceCaveat = 0; + attrs.majorVersion = 2; + attrs.minorVersion = 0; + attrs.enableExtensionsByDefault = 1; + attrs.explicitSwapControl = 0; + attrs.renderViaOffscreenBackBuffer = 0; + attrs.proxyContextToMainThread = EMSCRIPTEN_WEBGL_CONTEXT_PROXY_DISALLOW; + + emscripten_console_log("Creating webGL context"); + const char* canvasIdStr ="MYCANVASID"; + printf("Canvas id: %s\n", canvasIdStr); fflush(stdout); + context = emscripten_webgl_create_context(canvasIdStr, &attrs); + printf("**OPENGL CONTEXT TEST Context: %d\n", context);fflush(stdout); +} diff --git a/src/mono/sample/wasm/browser-advanced/main.js b/src/mono/sample/wasm/browser-advanced/main.js index 5576cfb320bae9..55c96788d42f01 100644 --- a/src/mono/sample/wasm/browser-advanced/main.js +++ b/src/mono/sample/wasm/browser-advanced/main.js @@ -6,7 +6,11 @@ import { dotnet, exit } from './dotnet.js' function add(a, b) { return a + b; } +function setLogLevel(logLevel) { + const runtimeApi = globalThis.getDotnetRuntime(0); + runtimeApi.INTERNAL.MH_SetLogVerbosity(logLevel); +} function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } @@ -93,10 +97,13 @@ try { const config = getConfig(); const exports = await getAssemblyExports(config.mainAssemblyName); - + console.clear(); //console.debug("Accessing console:"); const result = exports.Sample.Test.SimpleTestConsole(); console.debug(`result: ${result}`); + setLogLevel(3); + console.clear(); + exports.Sample.Test.TestGL(); const meaning = exports.Sample.Test.TestMeaning(); if (typeof Module.GL !== "object") { diff --git a/src/mono/sample/wasm/browser-test-debug/Assert.cs b/src/mono/sample/wasm/browser-test-debug/Assert.cs index f6499725c4be8a..169bafcd10638e 100644 --- a/src/mono/sample/wasm/browser-test-debug/Assert.cs +++ b/src/mono/sample/wasm/browser-test-debug/Assert.cs @@ -53,6 +53,29 @@ public static TException Throws(Action action) where TException : Ex } throw new Exception($"AssertHelper.Throws failed. No exception was thrown. Expected exception of type {typeof(TException)}."); } + public static TException Throws(string? paramName, Action action) where TException : ArgumentException + { + try + { + action(); + } + catch (Exception ex) + { + if (ex is TException expected) + { + if (paramName != null && !string.Equals(expected.ParamName, paramName, StringComparison.Ordinal)) + { + throw new Exception( + $"Assert.Throws failed. Expected ParamName: '{paramName}', but got: '{expected.ParamName}'.\nMessage: {ex.Message}", ex); + } + return expected; + } + throw new Exception( + $"Assert.Throws failed. Expected exception of type {typeof(TException)}, but got {ex.GetType()}.\nMessage: {ex.Message}", ex); + } + throw new Exception( + $"Assert.Throws failed. No exception was thrown. Expected exception of type {typeof(TException)}."); + } public static void Contains(T expected, IEnumerable collection) { if (collection == null) diff --git a/src/mono/sample/wasm/browser-test-debug/Program.cs b/src/mono/sample/wasm/browser-test-debug/Program.cs index 3b1bec4a804c3b..72e43dff14321a 100644 --- a/src/mono/sample/wasm/browser-test-debug/Program.cs +++ b/src/mono/sample/wasm/browser-test-debug/Program.cs @@ -16,6 +16,20 @@ using System.SpanTests; namespace Sample { + [StructLayout(LayoutKind.Sequential)] + public class NonExistField + { + + } + public class SubBuffer : SafeBuffer + { + public SubBuffer(bool ownsHandle) : base(ownsHandle) { } + + protected override bool ReleaseHandle() + { + throw new NotImplementedException(); + } + } public partial class Test { private char[] _largeBuffer = new char[4096]; @@ -397,7 +411,39 @@ public static void ZeroFreeGlobalAllocAnsi_ValidPointer_Success() Marshal.ZeroFreeGlobalAllocAnsi(ptr); } } - + [JSExport] + public static async Task TestMath() + { + // can we call ModF from here? looks like it's an internal call. + double test = Math.Truncate(6.666); + Console.WriteLine($"Math.Truncate(6.666) = {test}"); + } + // should be encoded as 4_V, not V_V + public static uint TestUint_4_V() + { + uint retval = 666; + return retval; + } + [JSExport] + public static async Task TestUint() + { + uint id = TestUint_4_V(); + Console.WriteLine($"TestUint got value {id}"); + } + [JSExport] + public static async Task TestBuffer(string str) + { + //OffsetOf_NoSuchFieldName_ThrowsArgumentException + var buffer = new SubBuffer(true); + //buffer.Initialize(ulong.MaxValue); + Assert.Throws("numBytes", () => buffer.Initialize(ulong.MaxValue)); + } + [JSExport] + public static async Task OffsetOf_NoSuchFieldName_ThrowsArgumentException() + { + Assert.Throws(() => Marshal.OffsetOf(typeof(NonExistField), "NonExistField")); + Assert.Throws(() => Marshal.OffsetOf("NonExistField")); + } [JSExport] public static async Task DoTestMethod() diff --git a/src/mono/sample/wasm/browser-test-debug/fibonacci.c b/src/mono/sample/wasm/browser-test-debug/fibonacci.c index 657513d7ebb79e..0dc111c26cde26 100644 --- a/src/mono/sample/wasm/browser-test-debug/fibonacci.c +++ b/src/mono/sample/wasm/browser-test-debug/fibonacci.c @@ -1,3 +1,6 @@ +#include +#include + int Fibonacci(int n) { int fnow = 0, fnext = 1, tempf; while(--n>0){ @@ -6,4 +9,28 @@ int Fibonacci(int n) { fnext = tempf; } return fnext; -} \ No newline at end of file +} +void testGLStartup() +{ + EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = 0; + EmscriptenWebGLContextAttributes attrs; + attrs.depth = 1; + attrs.stencil = 1; + attrs.antialias = 1; + attrs.premultipliedAlpha = 1; + attrs.preserveDrawingBuffer = 0; + attrs.powerPreference = EM_WEBGL_POWER_PREFERENCE_DEFAULT; //EM_WEBGL_POWER_PREFERENCE_HIGH_PERFORMANCE + attrs.failIfMajorPerformanceCaveat = 0; + attrs.majorVersion = 2; + attrs.minorVersion = 0; + attrs.enableExtensionsByDefault = 1; + attrs.explicitSwapControl = 0; + attrs.renderViaOffscreenBackBuffer = 0; + attrs.proxyContextToMainThread = EMSCRIPTEN_WEBGL_CONTEXT_PROXY_DISALLOW; + + emscripten_console_log("Creating webGL context"); + const char* canvasIdStr = "myCanvasId"; + printf("Canvas id: %s\n", canvasIdStr); fflush(stdout); + context = emscripten_webgl_create_context(canvasIdStr, &attrs); + printf("**OPENGL CONTEXT TEST Context: %d\n", context);fflush(stdout); +} diff --git a/src/mono/sample/wasm/browser-test-debug/main.js b/src/mono/sample/wasm/browser-test-debug/main.js index fbbe9bd7808301..1c896dffc1861d 100644 --- a/src/mono/sample/wasm/browser-test-debug/main.js +++ b/src/mono/sample/wasm/browser-test-debug/main.js @@ -91,9 +91,13 @@ try { const exports = await getAssemblyExports(config.mainAssemblyName); document.getElementById("out").innerHTML = `NOT PASSED`; - + console.clear(); setLogLevel(5); - await exports.Sample.Test.DoTestMethod(); + await exports.Sample.Test.OffsetOf_NoSuchFieldName_ThrowsArgumentException(); + //await exports.Sample.Test.TestBuffer(); + //await exports.Sample.Test.TestUint(); + //await exports.Sample.Test.TestMath(); + // await exports.Sample.Test.DoTestMethod(); setLogLevel(0); document.getElementById("out").innerHTML = `PASSED`; From c3a9634004794fd988f5caae7fbd608c38b2d34a Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 29 Sep 2025 16:01:12 +0100 Subject: [PATCH 179/209] Update definition of icall Marshal_OffsetOf to match class, returning a gpointer --- src/mono/mono/metadata/icall-def.h | 2 +- src/mono/mono/metadata/marshal.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mono/mono/metadata/icall-def.h b/src/mono/mono/metadata/icall-def.h index e0f5572d54a016..115eb8d969b545 100644 --- a/src/mono/mono/metadata/icall-def.h +++ b/src/mono/mono/metadata/icall-def.h @@ -454,7 +454,7 @@ HANDLES(MARSHAL_4, "DestroyStructure", ves_icall_System_Runtime_InteropServices_ HANDLES(MARSHAL_9, "GetDelegateForFunctionPointerInternal", ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal, void, 3, (MonoQCallTypeHandle, gpointer, MonoObjectHandleOnStack)) HANDLES(MARSHAL_10, "GetFunctionPointerForDelegateInternal", ves_icall_System_Runtime_InteropServices_Marshal_GetFunctionPointerForDelegateInternal, gpointer, 1, (MonoDelegate)) NOHANDLES(ICALL(MARSHAL_11, "GetLastPInvokeError", ves_icall_System_Runtime_InteropServices_Marshal_GetLastPInvokeError)) -HANDLES(MARSHAL_12, "OffsetOf", ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf, int, 2, (MonoReflectionType, MonoString)) +HANDLES(MARSHAL_12, "OffsetOf", ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf, gpointer, 2, (MonoReflectionType, MonoString)) HANDLES(MARSHAL_13, "PrelinkInternal", ves_icall_System_Runtime_InteropServices_Marshal_Prelink, void, 1, (MonoReflectionMethod)) HANDLES(MARSHAL_20, "PtrToStructureHelper", ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructureHelper, void, 3, (gconstpointer, MonoObject, MonoBoolean)) NOHANDLES(ICALL(MARSHAL_29a, "SetLastPInvokeError", ves_icall_System_Runtime_InteropServices_Marshal_SetLastPInvokeError)) diff --git a/src/mono/mono/metadata/marshal.c b/src/mono/mono/metadata/marshal.c index f14cc5a61022a1..567754f8199d9a 100644 --- a/src/mono/mono/metadata/marshal.c +++ b/src/mono/mono/metadata/marshal.c @@ -5692,7 +5692,7 @@ ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructureHelper (gconstpoi ptr_to_structure (src, dst, error); } -int +gpointer ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf (MonoReflectionTypeHandle ref_type, MonoStringHandle field_name, MonoError *error) { error_init (error); @@ -5754,7 +5754,7 @@ ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf (MonoReflectionTypeHan MonoMarshalType *info = mono_marshal_load_type_info (klass); MH_LOG("returning offset %d", info->fields [match_index].offset); - return info->fields [match_index].offset; + return GINT_TO_POINTER(info->fields [match_index].offset); } void From e5fbccefa5411231d59bd4b7e760649cdbb75a90 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 29 Sep 2025 16:01:33 +0100 Subject: [PATCH 180/209] Default log level --- src/mono/mono/metadata/mh_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/metadata/mh_log.c b/src/mono/mono/metadata/mh_log.c index cb4cccddfb70c1..62827b6758e215 100644 --- a/src/mono/mono/metadata/mh_log.c +++ b/src/mono/mono/metadata/mh_log.c @@ -1,7 +1,7 @@ #include #include -static int MH_LOG_verbosity_level = MH_LVL_TRACE; +static int MH_LOG_verbosity_level = MH_LVL_INFO; static int MH_LOG_verbosity_initialized = 0; void mh_log_set_verbosity(int verbosity) From 8a57a6afe566e8aa4db6bee565aa7386164dde2a Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 29 Sep 2025 19:53:32 +0100 Subject: [PATCH 181/209] Enforce limit on number of parameters for icall encoding --- src/mono/mono/mini/interp/transform.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index c261b905f999ef..02bb4feab4d475 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -2954,6 +2954,12 @@ interp_get_icall_sig (MonoMethodSignature *sig) { MintICallSig op = MINT_ICALLSIG_MAX; int params[MAX_SIG_PARAMS]; + if (sig->param_count > MAX_SIG_PARAMS) + { + MH_LOGV(MH_LVL_VERBOSE, "Parameter count (%d) too high for icall enum encoding (MAX_SIG_PARAMS is %d)", sig->param_count, MAX_SIG_PARAMS); + return MINT_ICALLSIG_MAX; + } + MH_LOGV(MH_LVL_TRACE, "Getting icall sig for method with %d params", sig->param_count); for (int i = 0; i < sig->param_count && i < MAX_SIG_PARAMS; ++i) { MonoType *tp = sig->params[i]; From 9d33f971c2ac722eba405c47e90fc835e31c8319 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 30 Sep 2025 08:56:06 +0100 Subject: [PATCH 182/209] Test updates --- .../sample/wasm/browser-test-debug/Assert.cs | 8 ++++- .../sample/wasm/browser-test-debug/Program.cs | 32 ++++++++++++++++++- .../sample/wasm/browser-test-debug/main.js | 5 ++- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/src/mono/sample/wasm/browser-test-debug/Assert.cs b/src/mono/sample/wasm/browser-test-debug/Assert.cs index 169bafcd10638e..05ef9a79257364 100644 --- a/src/mono/sample/wasm/browser-test-debug/Assert.cs +++ b/src/mono/sample/wasm/browser-test-debug/Assert.cs @@ -87,7 +87,13 @@ public static void Contains(T expected, IEnumerable collection) } throw new Exception($"AssertHelper.Contains failed. Expected item: {FormatIfArray(expected)} was not found in collection: {FormatIfArray(collection)}."); } - + public static void Contains(string expectedSubstring, string? actualString, StringComparison comparisonType) + { + if (actualString == null) + throw new Exception("AssertHelper.Contains failed. Actual string is null."); + if (!actualString.Contains(expectedSubstring, comparisonType)) + throw new Exception($"AssertHelper.Contains failed. Expected substring: \"{expectedSubstring}\" was not found in string: \"{actualString}\" (comparison: {comparisonType})."); + } public static void Contains(string expectedSubstring, string? actualString) { if (actualString == null) diff --git a/src/mono/sample/wasm/browser-test-debug/Program.cs b/src/mono/sample/wasm/browser-test-debug/Program.cs index 72e43dff14321a..639450b69e05d3 100644 --- a/src/mono/sample/wasm/browser-test-debug/Program.cs +++ b/src/mono/sample/wasm/browser-test-debug/Program.cs @@ -14,6 +14,8 @@ using System.Runtime.InteropServices.Tests; using System.Globalization; using System.SpanTests; +using System.Runtime.ExceptionServices; + namespace Sample { [StructLayout(LayoutKind.Sequential)] @@ -41,7 +43,14 @@ public static async Task Main(string[] args) return 0; } - + private static void ABCDEFGHIJKLMNOPQRSTUVWXYZ(Exception e) + { + Assert.Same(e, ExceptionDispatchInfo.SetCurrentStackTrace(e)); + } + + [LibraryImport("testGLStartup")] + public static partial void testGLStartup(); + public static async Task JsExportTaskOfInt(int value) { TaskCompletionSource tcs = new TaskCompletionSource(); @@ -444,7 +453,28 @@ public static async Task OffsetOf_NoSuchFieldName_ThrowsArgumentException() Assert.Throws(() => Marshal.OffsetOf(typeof(NonExistField), "NonExistField")); Assert.Throws(() => Marshal.OffsetOf("NonExistField")); } + [JSExport] + public static async Task SetCurrentStackTrace_IncludedInExceptionStackTrace() + { + Exception e; + + e = new Exception(); + ABCDEFGHIJKLMNOPQRSTUVWXYZ(e); + Assert.Contains(nameof(ABCDEFGHIJKLMNOPQRSTUVWXYZ), e.StackTrace, StringComparison.Ordinal); + + e = new Exception(); + ABCDEFGHIJKLMNOPQRSTUVWXYZ(e); + try { throw e; } catch { } + Assert.Contains(nameof(ABCDEFGHIJKLMNOPQRSTUVWXYZ), e.StackTrace, StringComparison.Ordinal); + } + + [JSExport] + internal static void TestGL() + { + testGLStartup(); + } + [JSExport] public static async Task DoTestMethod() { diff --git a/src/mono/sample/wasm/browser-test-debug/main.js b/src/mono/sample/wasm/browser-test-debug/main.js index 1c896dffc1861d..337f6ef205c2a1 100644 --- a/src/mono/sample/wasm/browser-test-debug/main.js +++ b/src/mono/sample/wasm/browser-test-debug/main.js @@ -93,7 +93,10 @@ try { document.getElementById("out").innerHTML = `NOT PASSED`; console.clear(); setLogLevel(5); - await exports.Sample.Test.OffsetOf_NoSuchFieldName_ThrowsArgumentException(); + await exports.Sample.Test.SetCurrentStackTrace_IncludedInExceptionStackTrace(); + //await exports.Sample.Test.testGLStartup(); + //await exports.Sample.Test.OffsetOf_NoSuchFieldName_ThrowsArgumentException(); + //await exports.Sample.Test.TestBuffer(); //await exports.Sample.Test.TestUint(); //await exports.Sample.Test.TestMath(); From 925bdaeb94b5aed03e5a44edc540e0667589484f Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Tue, 30 Sep 2025 09:16:18 +0100 Subject: [PATCH 183/209] remove logging from SystemNative_GetSystemTimeAsTicks --- src/native/libs/System.Native/pal_datetime.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/native/libs/System.Native/pal_datetime.c b/src/native/libs/System.Native/pal_datetime.c index ce3b27fb0849cc..7fdb66a0eb1862 100644 --- a/src/native/libs/System.Native/pal_datetime.c +++ b/src/native/libs/System.Native/pal_datetime.c @@ -30,23 +30,18 @@ extern bool mono_bundled_resources_get_data_resource_values (const char *id, con // since 00:00 01 January 1970 UTC (Unix epoch) // int64_t SystemNative_GetSystemTimeAsTicks(void) -{ - printf("In SystemNative_GetSystemTimeAsTicks\n"); fflush(stdout); -#if HAVE_CLOCK_REALTIME - printf("In SystemNative_GetSystemTimeAsTicks, using clock_gettime\n"); fflush(stdout); +{ +#if HAVE_CLOCK_REALTIME struct timespec time; if (clock_gettime(CLOCK_REALTIME, &time) == 0) { return (int64_t)(time.tv_sec) * TICKS_PER_SECOND + (time.tv_nsec / NANOSECONDS_PER_TICK); } -#else - printf("In SystemNative_GetSystemTimeAsTicks, using gettimeofday\n"); fflush(stdout); +#else struct timeval time; if (gettimeofday(&time, NULL) == 0) - { - printf("called gettimeofday\n"); fflush(stdout); - int64_t result = (int64_t)(time.tv_sec) * TICKS_PER_SECOND + (time.tv_usec * TICKS_PER_MICROSECOND); - printf("Got result %lld\n", result); fflush(stdout); + { + int64_t result = (int64_t)(time.tv_sec) * TICKS_PER_SECOND + (time.tv_usec * TICKS_PER_MICROSECOND); return result; } #endif From ad1dfb99ab1307f838a11f40ab7e418fffae5021 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 2 Oct 2025 12:56:52 +0100 Subject: [PATCH 184/209] remove logging --- src/mono/browser/runtime/marshal.ts | 4 ---- src/mono/browser/runtime/strings.ts | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/mono/browser/runtime/marshal.ts b/src/mono/browser/runtime/marshal.ts index 3f3d29cc15c562..e34a4e02b80b79 100644 --- a/src/mono/browser/runtime/marshal.ts +++ b/src/mono/browser/runtime/marshal.ts @@ -13,7 +13,6 @@ import { GCHandle, JSHandle, MonoObject, MonoString, GCHandleNull, JSMarshalerAr import { TypedArray, VoidPtr } from "./types/emscripten"; import { utf16ToString } from "./strings"; import { get_managed_stack_trace } from "./managed-exports"; -import { mono_log_debug } from "./logging"; export const cs_to_js_marshalers = new Map(); export const js_to_cs_marshalers = new Map(); @@ -161,19 +160,16 @@ export function get_signature_res_type (sig: JSMarshalerType): MarshalerType { export function get_signature_arg1_type (sig: JSMarshalerType): MarshalerType { mono_assert(sig, "Null sig"); - mono_log_debug(`get_signature_arg1_type for sig '${sig}' is '${getU8(add_offset(sig, JSBindingTypeOffsets.Arg1MarshalerType))}'`); return getU8(add_offset(sig, JSBindingTypeOffsets.Arg1MarshalerType)) as any; } export function get_signature_arg2_type (sig: JSMarshalerType): MarshalerType { mono_assert(sig, "Null sig"); - mono_log_debug(`get_signature_arg3_type for sig '${sig}' is '${getU8(add_offset(sig, JSBindingTypeOffsets.Arg2MarshalerType))}'`); return getU8(add_offset(sig, JSBindingTypeOffsets.Arg2MarshalerType)) as any; } export function get_signature_arg3_type (sig: JSMarshalerType): MarshalerType { mono_assert(sig, "Null sig"); - mono_log_debug(`get_signature_arg3_type for sig '${sig}' is '${getU8(add_offset(sig, JSBindingTypeOffsets.Arg3MarshalerType))}'`); return getU8(add_offset(sig, JSBindingTypeOffsets.Arg3MarshalerType)) as any; } diff --git a/src/mono/browser/runtime/strings.ts b/src/mono/browser/runtime/strings.ts index da5a870ce0d39b..bd74bd831cf8a1 100644 --- a/src/mono/browser/runtime/strings.ts +++ b/src/mono/browser/runtime/strings.ts @@ -190,7 +190,7 @@ export function stringToMonoStringRoot (string: string, result: WasmRoot Date: Thu, 2 Oct 2025 12:57:55 +0100 Subject: [PATCH 185/209] Correctly reject a return value that isn't a pointer or a MONO_TYPE_VOID Previously we would allow the assigned size of zero (which may indicate no match) to be used as void. --- src/mono/mono/mini/interp/transform.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index 02bb4feab4d475..f0c993f9f3fabc 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -2981,6 +2981,11 @@ interp_get_icall_sig (MonoMethodSignature *sig) } // returnType of 0 == void int returnType = GET_PARAM_SIZE(sig->ret); + if (returnType == 0 && sig->ret->type != MONO_TYPE_VOID) + { + MH_LOGV(MH_LVL_TRACE, "will return MINT_ICALLSIG_MAX: return type %s was encoded as %d. p->type value is %d. rejecting because it's not a pointer type.", mono_type_get_name(sig->ret), returnType, sig->ret->type); + return MINT_ICALLSIG_MAX; + } MH_LOGV(MH_LVL_TRACE, "return type %s encoded as %d. p->type value is %d", mono_type_get_name(sig->ret), returnType, sig->ret->type); op = encode_signature(params, sig->param_count, returnType); return op; From 08360befcd18ee3b5622ebe4a1063b76b4a90409 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Thu, 2 Oct 2025 12:58:52 +0100 Subject: [PATCH 186/209] Test sample changes For testing bool sig mismatch issue, canvas initialization --- .../sample/wasm/browser-advanced/fibonacci.c | 2 +- src/mono/sample/wasm/browser-advanced/main.js | 1 + .../sample/wasm/browser-test-debug/Program.cs | 25 ++++++++++++++++-- .../Wasm.Test.Debug.Sample.csproj | 11 ++++++-- .../wasm/browser-test-debug/fibonacci.c | 26 +++++++++++++++++++ .../sample/wasm/browser-test-debug/index.html | 5 ++-- .../sample/wasm/browser-test-debug/main.js | 8 +++--- 7 files changed, 68 insertions(+), 10 deletions(-) diff --git a/src/mono/sample/wasm/browser-advanced/fibonacci.c b/src/mono/sample/wasm/browser-advanced/fibonacci.c index a5f3cc4ff97a1d..ff269d393dcb6f 100644 --- a/src/mono/sample/wasm/browser-advanced/fibonacci.c +++ b/src/mono/sample/wasm/browser-advanced/fibonacci.c @@ -1,6 +1,6 @@ #include #include -int Fibonacci(int n) { +int Fibonacci(int n) { int fnow = 0, fnext = 1, tempf; while(--n>0){ tempf = fnow + fnext; diff --git a/src/mono/sample/wasm/browser-advanced/main.js b/src/mono/sample/wasm/browser-advanced/main.js index 55c96788d42f01..94fdc87c28650d 100644 --- a/src/mono/sample/wasm/browser-advanced/main.js +++ b/src/mono/sample/wasm/browser-advanced/main.js @@ -103,6 +103,7 @@ try { console.debug(`result: ${result}`); setLogLevel(3); console.clear(); + //exports.Sample.Test.DoTestMethod(); exports.Sample.Test.TestGL(); const meaning = exports.Sample.Test.TestMeaning(); diff --git a/src/mono/sample/wasm/browser-test-debug/Program.cs b/src/mono/sample/wasm/browser-test-debug/Program.cs index 639450b69e05d3..cdbd42f21e0f90 100644 --- a/src/mono/sample/wasm/browser-test-debug/Program.cs +++ b/src/mono/sample/wasm/browser-test-debug/Program.cs @@ -48,7 +48,14 @@ private static void ABCDEFGHIJKLMNOPQRSTUVWXYZ(Exception e) Assert.Same(e, ExceptionDispatchInfo.SetCurrentStackTrace(e)); } - [LibraryImport("testGLStartup")] + [LibraryImport("fibonacci")] + public static partial int Fibonacci(int n); + + [LibraryImport("fibonacci")] + [return: MarshalAs(UnmanagedType.I1)] + public static unsafe partial bool TestBoolReturn(int input, int* outValue); + + [LibraryImport("fibonacci")] public static partial void testGLStartup(); public static async Task JsExportTaskOfInt(int value) @@ -468,10 +475,20 @@ public static async Task SetCurrentStackTrace_IncludedInExceptionStackTrace() Assert.Contains(nameof(ABCDEFGHIJKLMNOPQRSTUVWXYZ), e.StackTrace, StringComparison.Ordinal); } - + [JSExport] + internal static unsafe void TestBool() + { + Console.WriteLine("Calling testbool"); + int retVal = 0; + bool value = TestBoolReturn(1, &retVal); + Console.WriteLine($"TestBoolReturn(1) returned {value} with out param {retVal}"); + } [JSExport] internal static void TestGL() { + Console.WriteLine("Calling testGLStartup"); + var val = Fibonacci(8); + Console.WriteLine($"Fibonacci(8)={val}"); testGLStartup(); } @@ -480,6 +497,10 @@ public static async Task DoTestMethod() { //await JavaScriptTestHelper.InitializeAsync(); //const bool doCollect = true; + + var val = Fibonacci(8); + Console.WriteLine($"Fibonacci(8)={val}"); + //testGLStartup(); string myTestString = "Hello from .NET"; unsafe { diff --git a/src/mono/sample/wasm/browser-test-debug/Wasm.Test.Debug.Sample.csproj b/src/mono/sample/wasm/browser-test-debug/Wasm.Test.Debug.Sample.csproj index 121e4357ca50f7..46fb11d91e55ad 100644 --- a/src/mono/sample/wasm/browser-test-debug/Wasm.Test.Debug.Sample.csproj +++ b/src/mono/sample/wasm/browser-test-debug/Wasm.Test.Debug.Sample.csproj @@ -9,6 +9,9 @@ true true web,worker + + $(EmccFlags) -gsource-map -sMAX_WEBGL_VERSION=2 + -s LEGACY_GL_EMULATION=1 -lGL -lSDL -lidbfs.js @@ -27,12 +30,16 @@ net10.0 browser-wasm + + + true + - + diff --git a/src/mono/sample/wasm/browser-test-debug/fibonacci.c b/src/mono/sample/wasm/browser-test-debug/fibonacci.c index 0dc111c26cde26..70b0f47d3b27b7 100644 --- a/src/mono/sample/wasm/browser-test-debug/fibonacci.c +++ b/src/mono/sample/wasm/browser-test-debug/fibonacci.c @@ -3,6 +3,25 @@ int Fibonacci(int n) { int fnow = 0, fnext = 1, tempf; + printf("In Fibonacci.c\n"); fflush(stdout); + EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = 0; + EmscriptenWebGLContextAttributes attrs; + attrs.depth = 1; + attrs.stencil = 1; + attrs.antialias = 1; + attrs.premultipliedAlpha = 1; + attrs.preserveDrawingBuffer = 0; + attrs.powerPreference = EM_WEBGL_POWER_PREFERENCE_DEFAULT; //EM_WEBGL_POWER_PREFERENCE_HIGH_PERFORMANCE + attrs.failIfMajorPerformanceCaveat = 0; + attrs.majorVersion = 2; + attrs.minorVersion = 0; + attrs.enableExtensionsByDefault = 1; + attrs.explicitSwapControl = 0; + attrs.renderViaOffscreenBackBuffer = 0; + attrs.proxyContextToMainThread = EMSCRIPTEN_WEBGL_CONTEXT_PROXY_DISALLOW; + printf("Have attrs.majorVersion %d\n", attrs.majorVersion); fflush(stdout); + context = emscripten_webgl_create_context("#MyCanvasId", &attrs); + printf("Got context: %d\n", (int)context);fflush(stdout); while(--n>0){ tempf = fnow + fnext; fnow = fnext; @@ -10,6 +29,13 @@ int Fibonacci(int n) { } return fnext; } + +bool TestBoolReturn(int input, int* outValue) +{ + *outValue = input * 2; + return true; +} + void testGLStartup() { EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = 0; diff --git a/src/mono/sample/wasm/browser-test-debug/index.html b/src/mono/sample/wasm/browser-test-debug/index.html index f1f592555c9329..1a060b6c815639 100644 --- a/src/mono/sample/wasm/browser-test-debug/index.html +++ b/src/mono/sample/wasm/browser-test-debug/index.html @@ -17,8 +17,9 @@ - - Test has: + + Test has: + diff --git a/src/mono/sample/wasm/browser-test-debug/main.js b/src/mono/sample/wasm/browser-test-debug/main.js index 337f6ef205c2a1..666bfc49248bdb 100644 --- a/src/mono/sample/wasm/browser-test-debug/main.js +++ b/src/mono/sample/wasm/browser-test-debug/main.js @@ -93,14 +93,16 @@ try { document.getElementById("out").innerHTML = `NOT PASSED`; console.clear(); setLogLevel(5); - await exports.Sample.Test.SetCurrentStackTrace_IncludedInExceptionStackTrace(); - //await exports.Sample.Test.testGLStartup(); + //await exports.Sample.Test.SetCurrentStackTrace_IncludedInExceptionStackTrace(); + await exports.Sample.Test.TestBool(); + //await exports.Sample.Test.DoTestMethod(); + //await exports.Sample.Test.TestGL(); //await exports.Sample.Test.OffsetOf_NoSuchFieldName_ThrowsArgumentException(); //await exports.Sample.Test.TestBuffer(); //await exports.Sample.Test.TestUint(); //await exports.Sample.Test.TestMath(); - // await exports.Sample.Test.DoTestMethod(); + setLogLevel(0); document.getElementById("out").innerHTML = `PASSED`; From a82eccdb81dd376978f1a21735b7b5f6fc86f80e Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 7 Nov 2025 11:13:12 +0000 Subject: [PATCH 187/209] Delete file --- out.txt | 6910 ------------------------------------------------------- 1 file changed, 6910 deletions(-) delete mode 100644 out.txt diff --git a/out.txt b/out.txt deleted file mode 100644 index 50e243db24be8a..00000000000000 --- a/out.txt +++ /dev/null @@ -1,6910 +0,0 @@ - -C:\xr_dev\dotnetFork\runtime>title Run System Interop Tests 64 - -C:\xr_dev\dotnetFork\runtime>call set_dotnet_env64.cmd - -C:\xr_dev\dotnetFork\runtime>echo *** .NET EMSDK path setup *** -*** .NET EMSDK path setup *** - -C:\xr_dev\dotnetFork\runtime>set EM_CONFIG=C:/emsdk/emscripten.config - -C:\xr_dev\dotnetFork\runtime>set EMSDK_INSTALL_ROOT=C:\emsdk - -C:\xr_dev\dotnetFork\runtime>rem UPDATE emscriptem.config too! - -C:\xr_dev\dotnetFork\runtime>rem set "NODE_VERSION=22.16.0_64bit" - -C:\xr_dev\dotnetFork\runtime>rem set "PYTHON_VERSION=3.13.3_64bit" - -C:\xr_dev\dotnetFork\runtime>set "NODE_VERSION=20.18.0_64bit" - -C:\xr_dev\dotnetFork\runtime>set "PYTHON_VERSION=3.9.2-nuget_64bit" - -C:\xr_dev\dotnetFork\runtime>set "EMSDK_PATH=C:\emsdk\upstream\" - -C:\xr_dev\dotnetFork\runtime>set "DOTNET_EMSCRIPTEN_LLVM_ROOT=C:\emsdk\upstream\bin" - -C:\xr_dev\dotnetFork\runtime>set "DOTNET_EMSCRIPTEN_NODE_JS=C:\emsdk\node\20.18.0_64bit\bin" - -C:\xr_dev\dotnetFork\runtime>set "DOTNET_EMSCRIPTEN_BINARYEN_ROOT=C:\emsdk\upstream" - -C:\xr_dev\dotnetFork\runtime>set "DOTNET_EMSCRIPTEN_NODE_PATH=C:\emsdk\node\20.18.0_64bit\bin" - -C:\xr_dev\dotnetFork\runtime>set "BINARYEN_ROOT=C:\emsdk\upstream" - -C:\xr_dev\dotnetFork\runtime>set "EMSDK_PYTHON=C:\emsdk\python\3.9.2-nuget_64bit\python.exe" - -C:\xr_dev\dotnetFork\runtime>set "EMSDK_NODE=C:\emsdk\node\20.18.0_64bit\bin" - -C:\xr_dev\dotnetFork\runtime>set "WasmEnableMemory64=true" - -C:\xr_dev\dotnetFork\runtime>set "WasmCachePath=C:\xr_dev\cache" - -C:\xr_dev\dotnetFork\runtime>set "MEMORY64=1" - -C:\xr_dev\dotnetFork\runtime>set EmscriptenNodeToolsPath=C:\emsdk\node\20.18.0_64bit\bin\ - -C:\xr_dev\dotnetFork\runtime>set EmscriptenPythonToolsPath=C:\emsdk\python\3.9.2-nuget_64bit\ - -C:\xr_dev\dotnetFork\runtime>call setNewPathDotNet10.bat -C:\xr_dev\dotnetFork\runtime\.dotnet - - Determining projects to restore... - All projects are up-to-date for restore. - TestUtilities -> C:\xr_dev\dotnetFork\runtime\artifacts\bin\TestUtilities\Debug\net8.0\TestUtilities.dll - System.Runtime.InteropServices.Tests -> C:\xr_dev\dotnetFork\runtime\artifacts\bin\System.Runtime.InteropServices.Tests\Debug\net10.0-browser\browser-wasm\System.Runtime.InteropServices.Tests.dll - TestUtilities -> C:\xr_dev\dotnetFork\runtime\artifacts\bin\TestUtilities\Debug\net8.0\TestUtilities.dll - System.Runtime.InteropServices.Tests -> C:\xr_dev\dotnetFork\runtime\artifacts\bin\System.Runtime.InteropServices.Tests\Debug\net10.0-browser\browser-wasm\System.Runtime.InteropServices.Tests.dll - System.Runtime.InteropServices.Tests -> C:\xr_dev\dotnetFork\runtime\artifacts\bin\System.Runtime.InteropServices.Tests\Debug\net10.0-browser\browser-wasm\publish\ - 'export' is not recognized as an internal or external command, - operable program or batch file. - set "SCENARIO=WasmTestOnChrome" - export XUNIT_HIDE_PASSING_OUTPUT_DIAGNOSTICS=1 - set PREPEND_PATH=C:\xr_dev\dotnetFork\runtime\artifacts\bin\chromedriver\chromedriver_win32 - set RuntimeIdentifier=browser-wasm - EXECUTION_DIR=C:\xr_dev\dotnetFork\runtime\artifacts\bin\System.Runtime.InteropServices.Tests\Debug\net10.0-browser\browser-wasm\AppBundle\ - SCENARIO=WasmTestOnChrome - XHARNESS_OUT=C:\xr_dev\dotnetFork\runtime\artifacts\bin\System.Runtime.InteropServices.Tests\Debug\net10.0-browser\browser-wasm\AppBundle\xharness-output - XHARNESS_CLI_PATH= - HARNESS_RUNNER=dotnet.exe xharness - XHARNESS_COMMAND=test-browser - MAIN_JS= - JS_ENGINE= - JS_ENGINE_ARGS=--browser-arg=--js-flags=--stack-trace-limit=1000 --browser-arg=--disable-gpu --pageLoadStrategy=none - XHARNESS_ARGS= --browser-arg=--js-flags=--stack-trace-limit=1000 --browser-arg=--disable-gpu --pageLoadStrategy=none - ----- start 11/09/2025 11:27:33.27 =============== To repro directly: ===================================================== - pushd C:\xr_dev\dotnetFork\runtime\artifacts\bin\System.Runtime.InteropServices.Tests\Debug\net10.0-browser\browser-wasm\AppBundle\ - dotnet.exe xharness wasm test-browser --app=. --output-directory=C:\xr_dev\dotnetFork\runtime\artifacts\bin\System.Runtime.InteropServices.Tests\Debug\net10.0-browser\browser-wasm\AppBundle\xharness-output -s dotnet.native.js.symbols --symbol-patterns wasm-symbol-patterns.txt --symbolicator WasmSymbolicator.dll,Microsoft.WebAssembly.Internal.SymbolicatorWrapperForXHarness "--browser-path=C:\xr_dev\dotnetFork\runtime\artifacts\bin\chrome\chrome-win\chrome.exe" "--timeout=00:30:00" --verbosity=Trace --browser-arg=--js-flags=--stack-trace-limit=1000 --browser-arg=--disable-gpu --pageLoadStrategy=none -- --setenv=MH_LOG_VERBOSITY=0 --setenv=XHARNESS_LOG_TEST_START=true --setenv=XUNIT_RANDOM_ORDER_SEED=666 --run WasmTestRunner.dll System.Runtime.InteropServices.Tests.dll -notrait category=OuterLoop -notrait category=failing - popd - =========================================================================================================== - [10.0.0-prerelease.25167.4+132fdfbd9c8f09f8c51179c1e7742f048f94734c] XHarness command issued: wasm test-browser --app=. --output-directory=C:\xr_dev\dotnetFork\runtime\artifacts\bin\System.Runtime.InteropServices.Tests\Debug\net10.0-browser\browser-wasm\AppBundle\xharness-output -s dotnet.native.js.symbols --symbol-patterns wasm-symbol-patterns.txt --symbolicator WasmSymbolicator.dll,Microsoft.WebAssembly.Internal.SymbolicatorWrapperForXHarness --browser-path=C:\xr_dev\dotnetFork\runtime\artifacts\bin\chrome\chrome-win\chrome.exe --timeout=00:30:00 --verbosity=Trace --browser-arg=--js-flags=--stack-trace-limit=1000 --browser-arg=--disable-gpu --pageLoadStrategy=none -- --setenv=MH_LOG_VERBOSITY=0 --setenv=XHARNESS_LOG_TEST_START=true --setenv=XUNIT_RANDOM_ORDER_SEED=666 --run WasmTestRunner.dll System.Runtime.InteropServices.Tests.dll -notrait category=OuterLoop -notrait category=failing - warn: Cannot find symbols file dotnet.native.js.symbols - dbug: Symbolicator 'Microsoft.WebAssembly.Internal.SymbolicatorWrapperForXHarness'.Init(dotnet.native.js.symbols, wasm-symbol-patterns.txt) returned false - info: Using Chrome from C:\xr_dev\dotnetFork\runtime\artifacts\bin\chrome\chrome-win\chrome.exe - info: Starting chromedriver with args: --js-flags=--stack-trace-limit=1000 --disable-gpu --headless --incognito --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-renderer-backgrounding --enable-features=NetworkService,NetworkServiceInProcess --allow-insecure-localhost --disable-breakpad --disable-component-extensions-with-background-pages --disable-dev-shm-usage --disable-extensions --disable-features=TranslateUI --disable-ipc-flooding-protection --force-color-profile=srgb --metrics-recording-only and load strategy: None - Starting ChromeDriver 135.0.7049.0 (0000000000000000000000000000000000000000-0000000000000000000000000000000000000000) on port 24581 - Only local connections are allowed. - Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. - ChromeDriver was started successfully on port 24581. - dbug: Opening in browser: http://127.0.0.1:63289/index.html?arg=--setenv%3dMH_LOG_VERBOSITY%3d0&arg=--setenv%3dXHARNESS_LOG_TEST_START%3dtrue&arg=--setenv%3dXUNIT_RANDOM_ORDER_SEED%3d666&arg=--run&arg=WasmTestRunner.dll&arg=System.Runtime.InteropServices.Tests.dll&arg=-notrait&arg=category%3dOuterLoop&arg=-notrait&arg=category%3dfailing&arg=-verbosity&arg=Verbose - fail: [out of order message from the browser]: http://127.0.0.1:63289/runArgs.json - Failed to load resource: the server responded with a status of 404 (Not Found) - fail: [out of order message from the browser]: http://127.0.0.1:63289/favicon.ico - Failed to load resource: the server responded with a status of 404 (Not Found) - info: Running in: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/135.0.0.0 Safari/537.36 - info: Running at: http://127.0.0.1:63289/index.html?arg=--setenv%3dMH_LOG_VERBOSITY%3d0&arg=--setenv%3dXHARNESS_LOG_TEST_START%3dtrue&arg=--setenv%3dXUNIT_RANDOM_ORDER_SEED%3d666&arg=--run&arg=WasmTestRunner.dll&arg=System.Runtime.InteropServices.Tests.dll&arg=-notrait&arg=category%3dOuterLoop&arg=-notrait&arg=category%3dfailing&arg=-verbosity&arg=Verbose - info: could not load /runArgs.json: 404. Ignoring - info: Incoming arguments: --setenv=MH_LOG_VERBOSITY=0 --setenv=XHARNESS_LOG_TEST_START=true --setenv=XUNIT_RANDOM_ORDER_SEED=666 --run WasmTestRunner.dll System.Runtime.InteropServices.Tests.dll -notrait category=OuterLoop -notrait category=failing -verbosity Verbose - info: Application arguments: --run WasmTestRunner.dll System.Runtime.InteropServices.Tests.dll -notrait category=OuterLoop -notrait category=failing -verbosity Verbose - info: MONO_WASM: starting script http://127.0.0.1:63289/_framework/dotnet.js - info: MONO_WASM: starting in http://127.0.0.1:63289/_framework/ - info: Initializing dotnet version 10.0.0-dev commit hash 69df26a480f53bc9621793d8c62af240c15caac3 - info: returningUsing locally built threadless Xunit runner 29 Aug 14:52 - info: Discovering: System.Runtime.InteropServices.Tests.dll (method display = ClassAndMethod, method display options = None) - info: Discovered: System.Runtime.InteropServices.Tests.dll (found 889 of 997 test cases) - info: Using random seed for test cases: 666 - info: Using random seed for collections: 666 - info: Starting: System.Runtime.InteropServices.Tests.dll - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_NullString_ReturnsZero - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_NullString_ReturnsZero - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pizza") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pizza") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pepperoni") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pepperoni") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "password") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "password") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "P4ssw0rdAa1") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "P4ssw0rdAa1") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "ßê┤") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "ßê┤") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "´┐¢´┐¢") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "´┐¢´┐¢") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "­ÉÇÇ") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "­ÉÇÇ") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "\0") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "\0") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "abc\0def") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAnsiTests.StringToHGlobalAnsi_InvokePtrToStringAnsi_Roundtrips(s: "abc\0def") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GuidAttributeTests.Ctor_Guid(guid: null) - info: [PASS] System.Runtime.InteropServices.Tests.GuidAttributeTests.Ctor_Guid(guid: null) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GuidAttributeTests.Ctor_Guid(guid: "Guid") - info: [PASS] System.Runtime.InteropServices.Tests.GuidAttributeTests.Ctor_Guid(guid: "Guid") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException - info: [PASS] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_NullSource_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_NullSource_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) - info: [PASS] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) - info: [PASS] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) - info: [PASS] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException - info: [PASS] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) - info: [PASS] System.Runtime.InteropServices.Tests.Int16ArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ZeroFreeCoTaskMemUTF8Tests.ZeroFreeCoTaskMemUTF8_ValidPointer_Success - info: [PASS] System.Runtime.InteropServices.Tests.ZeroFreeCoTaskMemUTF8Tests.ZeroFreeCoTaskMemUTF8_ValidPointer_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetExceptionPointersTests.GetExceptionPointers_ReturnsExpected - info: [SKIP] System.Runtime.InteropServices.Tests.GetExceptionPointersTests.GetExceptionPointers_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.QueryInterfaceTests.QueryInterface_ZeroPointer_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.QueryInterfaceTests.QueryInterface_ZeroPointer_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException - info: [PASS] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_NullSource_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_NullSource_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) - info: [PASS] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) - info: [PASS] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) - info: [PASS] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException - info: [PASS] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) - info: [PASS] System.Runtime.InteropServices.Tests.IntPtrArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringUTF8.PtrToStringUTF8_ZeroPointer_ReturnsNull - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringUTF8.PtrToStringUTF8_ZeroPointer_ReturnsNull - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringUTF8.PtrToStringUTF8_Length_Success(s: "", len: 0) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringUTF8.PtrToStringUTF8_Length_Success(s: "", len: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringUTF8.PtrToStringUTF8_Length_Success(s: "hello", len: 0) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringUTF8.PtrToStringUTF8_Length_Success(s: "hello", len: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringUTF8.PtrToStringUTF8_Length_Success(s: "hello", len: 1) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringUTF8.PtrToStringUTF8_Length_Success(s: "hello", len: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringUTF8.PtrToStringUTF8_Length_Success(s: "hello", len: 4) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringUTF8.PtrToStringUTF8_Length_Success(s: "hello", len: 4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.FinalReleaseComObjectTests.FinalReleaseComObject_NullObject_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.FinalReleaseComObjectTests.FinalReleaseComObject_NullObject_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.FinalReleaseComObjectTests.FinalReleaseComObject_Unix_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.Tests.FinalReleaseComObjectTests.FinalReleaseComObject_Unix_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.FinalReleaseComObjectTests.FinalReleaseComObject_NonComObject_ThrowsArgumentException - info: [SKIP] System.Runtime.InteropServices.Tests.FinalReleaseComObjectTests.FinalReleaseComObject_NonComObject_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ManagedToNativeComInteropStubAttributeTests.Ctor_ClassType_MethodName(classType: null, methodName: null) - info: [PASS] System.Runtime.InteropServices.Tests.ManagedToNativeComInteropStubAttributeTests.Ctor_ClassType_MethodName(classType: null, methodName: null) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ManagedToNativeComInteropStubAttributeTests.Ctor_ClassType_MethodName(classType: typeof(int), methodName: "MethodName") - info: [PASS] System.Runtime.InteropServices.Tests.ManagedToNativeComInteropStubAttributeTests.Ctor_ClassType_MethodName(classType: typeof(int), methodName: "MethodName") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_ShortFlags(flags: -1) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_ShortFlags(flags: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_ShortFlags(flags: 0) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_ShortFlags(flags: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_ShortFlags(flags: 4) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_ShortFlags(flags: 4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_TypeLibVarFlags(flags: -1) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_TypeLibVarFlags(flags: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_TypeLibVarFlags(flags: 0) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_TypeLibVarFlags(flags: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_TypeLibVarFlags(flags: FBindable) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibVarAttributeTests.Ctor_TypeLibVarFlags(flags: FBindable) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetHRForExceptionTests.GetHRForException_CustomException_ReturnsExpected - info: [PASS] System.Runtime.InteropServices.Tests.GetHRForExceptionTests.GetHRForException_CustomException_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetHRForExceptionTests.GetHRForException_ValidException_ReturnsValidHResult - info: [PASS] System.Runtime.InteropServices.Tests.GetHRForExceptionTests.GetHRForException_ValidException_ReturnsValidHResult - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetHRForExceptionTests.GetHRForException_NullException_ReturnsZero - info: [PASS] System.Runtime.InteropServices.Tests.GetHRForExceptionTests.GetHRForException_NullException_ReturnsZero - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetTypeInfoNameTests.GetTypeInfoName_Unix_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.Tests.GetTypeInfoNameTests.GetTypeInfoName_Unix_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetTypeInfoNameTests.GetTypeInfoName_ValidTypeInfo_ReturnsExpected - info: [SKIP] System.Runtime.InteropServices.Tests.GetTypeInfoNameTests.GetTypeInfoName_ValidTypeInfo_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetTypeInfoNameTests.GetTypeInfoName_NullTypeInfo_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.GetTypeInfoNameTests.GetTypeInfoName_NullTypeInfo_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibVersionAttributeTests.Ctor_MajorVersion_MinorVersion(majorVersion: -1, minorVersion: -2) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibVersionAttributeTests.Ctor_MajorVersion_MinorVersion(majorVersion: -1, minorVersion: -2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibVersionAttributeTests.Ctor_MajorVersion_MinorVersion(majorVersion: 0, minorVersion: 0) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibVersionAttributeTests.Ctor_MajorVersion_MinorVersion(majorVersion: 0, minorVersion: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibVersionAttributeTests.Ctor_MajorVersion_MinorVersion(majorVersion: 1, minorVersion: 2) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibVersionAttributeTests.Ctor_MajorVersion_MinorVersion(majorVersion: 1, minorVersion: 2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComRegisterFunctionAttributeTests.Exists - info: [PASS] System.Runtime.InteropServices.Tests.ComRegisterFunctionAttributeTests.Exists - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_ShortFlags(flags: -1) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_ShortFlags(flags: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_ShortFlags(flags: 0) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_ShortFlags(flags: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_ShortFlags(flags: 4) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_ShortFlags(flags: 4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_TypeLibTypeFlags(flags: -1) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_TypeLibTypeFlags(flags: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_TypeLibTypeFlags(flags: 0) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_TypeLibTypeFlags(flags: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_TypeLibTypeFlags(flags: FLicensed) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibTypeAttributeTests.Ctor_TypeLibTypeFlags(flags: FLicensed) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ProgIdAttributeTests.Ctor_ProgId - info: [SKIP] System.Runtime.InteropServices.Tests.ProgIdAttributeTests.Ctor_ProgId - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ProgIdAttributeTests.Exists - info: [SKIP] System.Runtime.InteropServices.Tests.ProgIdAttributeTests.Exists - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetHINSTANCETests.GetHINSTANCE_NullModule_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.GetHINSTANCETests.GetHINSTANCE_NullModule_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetHINSTANCETests.GetHINSTANCE_NormalModule_ReturnsSameInstance - info: [PASS] System.Runtime.InteropServices.Tests.GetHINSTANCETests.GetHINSTANCE_NormalModule_ReturnsSameInstance - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetHINSTANCETests.GetHINSTANCE_ModuleBuilder_ReturnsSameInstance - info: [PASS] System.Runtime.InteropServices.Tests.GetHINSTANCETests.GetHINSTANCE_ModuleBuilder_ReturnsSameInstance - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetHINSTANCETests.GetHINSTANCE_NonRuntimeModule_Returns_IntPtrMinusOne - info: [PASS] System.Runtime.InteropServices.Tests.GetHINSTANCETests.GetHINSTANCE_NonRuntimeModule_Returns_IntPtrMinusOne - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PrelinkTests.Prelink_NullMethod_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.PrelinkTests.Prelink_NullMethod_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PrelinkTests.Prelink_ValidMethod_Success - info: [PASS] System.Runtime.InteropServices.Tests.PrelinkTests.Prelink_ValidMethod_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PrelinkTests.Prelink_RuntimeSuppliedMethod_Success - info: [PASS] System.Runtime.InteropServices.Tests.PrelinkTests.Prelink_RuntimeSuppliedMethod_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PrelinkTests.Prelink_NonRuntimeMethod_ThrowsArgumentException - info: [PASS] System.Runtime.InteropServices.Tests.PrelinkTests.Prelink_NonRuntimeMethod_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.FileTime_Raw - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.FileTime_Raw - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.BStr_String - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.BStr_String - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.VariantBoolFalse - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.VariantBoolFalse - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Storage_Raw - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Storage_Raw - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Vector_Raw - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Vector_Raw - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Int_Raw - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Int_Raw - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.VariantBoolTrue - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.VariantBoolTrue - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.UInt - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.UInt - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Decimal - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Decimal - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Clsid_Raw - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Clsid_Raw - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_I1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_I1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_UI1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_UI1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_I2) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_I2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_UI2) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_UI2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_I4) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_I4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_UI4) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_UI4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_I8) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_I8) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_UI8) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_UI8) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_R4) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_R4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_R8) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_R8) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_BOOL) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_BOOL) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_BLOB) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_BLOB) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: 16387) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: 16387) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_UNKNOWN) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_WrongSize(vt: VT_UNKNOWN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.SByte - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.SByte - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.UShort - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.UShort - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.ByRef_Raw - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.ByRef_Raw - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Float - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Float - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Array_Raw_NonWindows - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Array_Raw_NonWindows - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.StoredObject_Raw - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.StoredObject_Raw - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.BlobObject_Raw - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.BlobObject_Raw - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.LPStr_Raw - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.LPStr_Raw - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Double - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Double - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.BStr_String_Null - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.BStr_String_Null - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Date - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Date - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Long - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Long - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.LPWStr_Raw - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.LPWStr_Raw - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_Int_WrongSize(vt: VT_INT) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_Int_WrongSize(vt: VT_INT) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_Int_WrongSize(vt: VT_UINT) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Raw_Int_WrongSize(vt: VT_UINT) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.StreamedObject_Raw - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.StreamedObject_Raw - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Byte - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Byte - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.BStrWrapper - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.BStrWrapper - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Unknown_NotSupported - info: [SKIP] System.Runtime.InteropServices.Tests.ComVariantTests.Unknown_NotSupported - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.VTVariantNotSupported - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.VTVariantNotSupported - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.DefaultVariantIsEmpty - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.DefaultVariantIsEmpty - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.VersionedStream_Raw - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.VersionedStream_Raw - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Short - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Short - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Record_Raw - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Record_Raw - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Int4 - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Int4 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Blob_Raw - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Blob_Raw - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.ULong - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.ULong - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Currency - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Currency - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Error - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Error - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.NullVariantIsNull - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.NullVariantIsNull - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.ClipData_Raw - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.ClipData_Raw - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.Stream_Raw - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.Stream_Raw - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantTests.UInt4 - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantTests.UInt4 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException - info: [PASS] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_NullSource_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_NullSource_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) - info: [PASS] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) - info: [PASS] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) - info: [PASS] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException - info: [PASS] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) - info: [PASS] System.Runtime.InteropServices.Tests.DoubleArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_Exception(exception: null, expectedErrorCode: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_Exception(exception: null, expectedErrorCode: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_Exception(exception: System.Runtime.InteropServices.Tests.ErrorWrapperTests+SubException: Exception of type 'System.Runtime.InteropServices.Tests.ErrorWrapperTests+SubException' was thrown., expectedErrorCode: 1000) - info: [PASS] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_Exception(exception: System.Runtime.InteropServices.Tests.ErrorWrapperTests+SubException: Exception of type 'System.Runtime.InteropServices.Tests.ErrorWrapperTests+SubException' was thrown., expectedErrorCode: 1000) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_IntErrorCode(value: -1) - info: [PASS] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_IntErrorCode(value: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_IntErrorCode(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_IntErrorCode(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_IntErrorCode(value: 1) - info: [PASS] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_IntErrorCode(value: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_ObjectErrorCode(value: -1) - info: [PASS] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_ObjectErrorCode(value: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_ObjectErrorCode(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_ObjectErrorCode(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_ObjectErrorCode(value: 1) - info: [PASS] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_ObjectErrorCode(value: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_NonIntObjectValue_ThrowsInvalidCastException - info: [PASS] System.Runtime.InteropServices.Tests.ErrorWrapperTests.Ctor_NonIntObjectValue_ThrowsInvalidCastException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_ZeroPointer_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_ZeroPointer_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_Length_Success(s: "", len: 0) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_Length_Success(s: "", len: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_Length_Success(s: "hello", len: 0) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_Length_Success(s: "hello", len: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_Length_Success(s: "hello", len: 1) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_Length_Success(s: "hello", len: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_Length_Success(s: "hello", len: 4) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_Length_Success(s: "hello", len: 4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_ZeroPointer_ReturnsNull - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_ZeroPointer_ReturnsNull - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_NegativeLength_ThrowsArgumentOutOfRangeException - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringAnsiTests.PtrToStringAnsi_NegativeLength_ThrowsArgumentOutOfRangeException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_NullType_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_NullType_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(int)) - info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(int)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Math)) - info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Math)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Int32&)) - info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Int32&)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Int32*)) - info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Int32*)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(int[])) - info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(int[])) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.NonGenericClass)) - info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.NonGenericClass)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass)) - info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.AbstractClass)) - info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.AbstractClass)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.NonGenericStruct)) - info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.NonGenericStruct)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericStruct)) - info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericStruct)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.INonGenericInterface)) - info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.INonGenericInterface)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.IGenericInterface)) - info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.IGenericInterface)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass<>)) - info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass<>)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(T)) - info: [PASS] System.Runtime.InteropServices.Tests.PrelinkAllTests.PrelinkAll_ValidType_Success(type: typeof(T)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.CompilerServices.Tests.IUnknownConstantAttributeTests.Ctor_Default - info: [PASS] System.Runtime.CompilerServices.Tests.IUnknownConstantAttributeTests.Ctor_Default - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ImportedFromTypeLibAttributeTests.Ctor_TlbFile(tlbFile: null) - info: [PASS] System.Runtime.InteropServices.Tests.ImportedFromTypeLibAttributeTests.Ctor_TlbFile(tlbFile: null) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ImportedFromTypeLibAttributeTests.Ctor_TlbFile(tlbFile: "Value") - info: [PASS] System.Runtime.InteropServices.Tests.ImportedFromTypeLibAttributeTests.Ctor_TlbFile(tlbFile: "Value") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ReleaseTests.Release_ZeroPointer_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.ReleaseTests.Release_ZeroPointer_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.AddRefTests.AddRef_ZeroPointer_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.AddRefTests.AddRef_ZeroPointer_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.InitHandleTests.InitHandle_SetsHandle - info: [PASS] System.Runtime.InteropServices.Tests.InitHandleTests.InitHandle_SetsHandle - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetIUnknownForObjectTests.GetIUnknownForObject_NullObject_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.GetIUnknownForObjectTests.GetIUnknownForObject_NullObject_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetIUnknownForObjectTests.GetIUnknownForObject_Unix_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.Tests.GetIUnknownForObjectTests.GetIUnknownForObject_Unix_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.BStrWrapperTests.Ctor_ObjectValue(value: null) - info: [PASS] System.Runtime.InteropServices.Tests.BStrWrapperTests.Ctor_ObjectValue(value: null) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.BStrWrapperTests.Ctor_ObjectValue(value: "Value") - info: [PASS] System.Runtime.InteropServices.Tests.BStrWrapperTests.Ctor_ObjectValue(value: "Value") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.BStrWrapperTests.Ctor_StringValue(value: null) - info: [PASS] System.Runtime.InteropServices.Tests.BStrWrapperTests.Ctor_StringValue(value: null) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.BStrWrapperTests.Ctor_StringValue(value: "Value") - info: [PASS] System.Runtime.InteropServices.Tests.BStrWrapperTests.Ctor_StringValue(value: "Value") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.BStrWrapperTests.Ctor_NonStringObjectValue_ThrowsInvalidCastException - info: [PASS] System.Runtime.InteropServices.Tests.BStrWrapperTests.Ctor_NonStringObjectValue_ThrowsInvalidCastException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.AutomationProxyAttributeTests.Ctor_Val(val: True) - info: [PASS] System.Runtime.InteropServices.Tests.AutomationProxyAttributeTests.Ctor_Val(val: True) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.AutomationProxyAttributeTests.Ctor_Val(val: False) - info: [PASS] System.Runtime.InteropServices.Tests.AutomationProxyAttributeTests.Ctor_Val(val: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrNullRefLinkBreaksOnResize - info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrNullRefLinkBreaksOnResize - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.ListAsSpanValueType - info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.ListAsSpanValueType - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.ListAsSpanClass - info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.ListAsSpanClass - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrAddDefaultClass - info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrAddDefaultClass - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.ListSetCount - info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.ListSetCount - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrNullRefClass - info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrNullRefClass - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.NullListAsSpanClass - info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.NullListAsSpanClass - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrNullRefValueType - info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrNullRefValueType - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.ListAsSpanLinkBreaksOnResize - info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.ListAsSpanLinkBreaksOnResize - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrAddDefaultLinkBreaksOnResize - info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrAddDefaultLinkBreaksOnResize - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrAddDefaultValueType - info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.GetValueRefOrAddDefaultValueType - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.NullListAsSpanValueType - info: [PASS] System.Runtime.InteropServices.Tests.CollectionsMarshalTests.NullListAsSpanValueType - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_NullString_ReturnsZero - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_NullString_ReturnsZero - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "pizza") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "pizza") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "pepperoni") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "pepperoni") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "password") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "password") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "P4ssw0rdAa1") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "P4ssw0rdAa1") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "ßê┤") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "ßê┤") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "´┐¢´┐¢") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "´┐¢´┐¢") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "­ÉÇÇ") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "­ÉÇÇ") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "\0") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "\0") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "abc\0def") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalUniTests.StringToHGlobalUni_InvokePtrToStringUni_Roundtrips(s: "abc\0def") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ErrorWrapper_Maps_To_VT_ERROR(hr: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ErrorWrapper_Maps_To_VT_ERROR(hr: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ErrorWrapper_Maps_To_VT_ERROR(hr: 1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ErrorWrapper_Maps_To_VT_ERROR(hr: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ErrorWrapper_Maps_To_VT_ERROR(hr: -2147467259) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ErrorWrapper_Maps_To_VT_ERROR(hr: -2147467259) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ErrorWrapper_Maps_To_VT_ERROR(hr: -2147024891) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ErrorWrapper_Maps_To_VT_ERROR(hr: -2147024891) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int32_Marshals_To_I4(value: -2147483648) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int32_Marshals_To_I4(value: -2147483648) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int32_Marshals_To_I4(value: -1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int32_Marshals_To_I4(value: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int32_Marshals_To_I4(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int32_Marshals_To_I4(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int32_Marshals_To_I4(value: 1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int32_Marshals_To_I4(value: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int32_Marshals_To_I4(value: 2147483647) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int32_Marshals_To_I4(value: 2147483647) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int16_Marshals_To_I2(value: -32768) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int16_Marshals_To_I2(value: -32768) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int16_Marshals_To_I2(value: -1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int16_Marshals_To_I2(value: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int16_Marshals_To_I2(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int16_Marshals_To_I2(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int16_Marshals_To_I2(value: 1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int16_Marshals_To_I2(value: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int16_Marshals_To_I2(value: 32767) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Int16_Marshals_To_I2(value: 32767) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Decimal_Marshals_To_DECIMAL(value: -79228162514264337593543950335) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Decimal_Marshals_To_DECIMAL(value: -79228162514264337593543950335) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Decimal_Marshals_To_DECIMAL(value: -1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Decimal_Marshals_To_DECIMAL(value: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Decimal_Marshals_To_DECIMAL(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Decimal_Marshals_To_DECIMAL(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Decimal_Marshals_To_DECIMAL(value: 1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Decimal_Marshals_To_DECIMAL(value: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Decimal_Marshals_To_DECIMAL(value: 79228162514264337593543950335) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Decimal_Marshals_To_DECIMAL(value: 79228162514264337593543950335) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UINT_Marshals_as_UInt(n: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UINT_Marshals_as_UInt(n: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UINT_Marshals_as_UInt(n: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UINT_Marshals_as_UInt(n: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UINT_Marshals_as_UInt(n: 1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UINT_Marshals_as_UInt(n: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UINT_Marshals_as_UInt(n: 4294967295) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UINT_Marshals_as_UInt(n: 4294967295) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: -3.40282347E+38) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: -3.40282347E+38) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: -1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: 1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: 3.40282347E+38) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Single_Marshals_To_R4(value: 3.40282347E+38) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt32_Marshals_To_UI4(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt32_Marshals_To_UI4(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt32_Marshals_To_UI4(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt32_Marshals_To_UI4(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt32_Marshals_To_UI4(value: 1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt32_Marshals_To_UI4(value: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt32_Marshals_To_UI4(value: 4294967295) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt32_Marshals_To_UI4(value: 4294967295) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: -1.7976931348623157E+308) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: -1.7976931348623157E+308) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: -1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: 1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: 1.7976931348623157E+308) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Double_Marshals_To_R8(value: 1.7976931348623157E+308) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt16_Marshals_To_UI2(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt16_Marshals_To_UI2(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt16_Marshals_To_UI2(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt16_Marshals_To_UI2(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt16_Marshals_To_UI2(value: 1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt16_Marshals_To_UI2(value: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt16_Marshals_To_UI2(value: 65535) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.UInt16_Marshals_To_UI2(value: 65535) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.INT_Marshals_as_Int(n: -2147483648) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.INT_Marshals_as_Int(n: -2147483648) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.INT_Marshals_as_Int(n: -1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.INT_Marshals_as_Int(n: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.INT_Marshals_as_Int(n: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.INT_Marshals_as_Int(n: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.INT_Marshals_as_Int(n: 1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.INT_Marshals_as_Int(n: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.INT_Marshals_as_Int(n: 2147483647) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.INT_Marshals_as_Int(n: 2147483647) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I1, valueToSet: 42) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I1, valueToSet: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_R8, valueToSet: 42) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_R8, valueToSet: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_R4, valueToSet: 42) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_R4, valueToSet: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI8, valueToSet: 42) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI8, valueToSet: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI8, valueToSet: 42) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI8, valueToSet: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I8, valueToSet: 42) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I8, valueToSet: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I8, valueToSet: 42) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I8, valueToSet: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_ERROR, valueToSet: 42) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_ERROR, valueToSet: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_ERROR, valueToSet: 42) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_ERROR, valueToSet: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI4, valueToSet: 42) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI4, valueToSet: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI4, valueToSet: 42) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI4, valueToSet: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I4, valueToSet: 42) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I4, valueToSet: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I4, valueToSet: 42) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I4, valueToSet: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI2, valueToSet: 42) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI2, valueToSet: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI2, valueToSet: 42) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI2, valueToSet: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I2, valueToSet: 42) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I2, valueToSet: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I2, valueToSet: 42) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I2, valueToSet: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI1, valueToSet: 42) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI1, valueToSet: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI1, valueToSet: 42) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_UI1, valueToSet: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I1, valueToSet: 42) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_I1, valueToSet: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_BOOL, valueToSet: True) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_BOOL, valueToSet: True) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_BOOL, valueToSet: False) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.ByRef_Primitives(elementType: VT_BOOL, valueToSet: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.SByte_Marshals_To_I1(value: -128) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.SByte_Marshals_To_I1(value: -128) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.SByte_Marshals_To_I1(value: -1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.SByte_Marshals_To_I1(value: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.SByte_Marshals_To_I1(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.SByte_Marshals_To_I1(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.SByte_Marshals_To_I1(value: 1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.SByte_Marshals_To_I1(value: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.SByte_Marshals_To_I1(value: 127) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.SByte_Marshals_To_I1(value: 127) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Byte_Marshals_To_UI1(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Byte_Marshals_To_UI1(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Byte_Marshals_To_UI1(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Byte_Marshals_To_UI1(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Byte_Marshals_To_UI1(value: 1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Byte_Marshals_To_UI1(value: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Byte_Marshals_To_UI1(value: 255) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Byte_Marshals_To_UI1(value: 255) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.CurrencyWrapper_Marshals_To_CY(value: -922337203685477.5808) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.CurrencyWrapper_Marshals_To_CY(value: -922337203685477.5808) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.CurrencyWrapper_Marshals_To_CY(value: -1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.CurrencyWrapper_Marshals_To_CY(value: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.CurrencyWrapper_Marshals_To_CY(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.CurrencyWrapper_Marshals_To_CY(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.CurrencyWrapper_Marshals_To_CY(value: 1) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.CurrencyWrapper_Marshals_To_CY(value: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.CurrencyWrapper_Marshals_To_CY(value: 922337203685477.5807) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.CurrencyWrapper_Marshals_To_CY(value: 922337203685477.5807) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.DBNull_Marshals_To_Null - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.DBNull_Marshals_To_Null - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Date_Marshals_To_DATE - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Date_Marshals_To_DATE - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.VariantWrapper_Throws(obj: null) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.VariantWrapper_Throws(obj: null) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.VariantWrapper_Throws(obj: Object { }) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.VariantWrapper_Throws(obj: Object { }) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.VariantWrapper_Throws(obj: []) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.VariantWrapper_Throws(obj: []) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Boolean_Marshals_To_BOOL(value: True) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Boolean_Marshals_To_BOOL(value: True) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Boolean_Marshals_To_BOOL(value: False) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Boolean_Marshals_To_BOOL(value: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.BStrWrapper_Marshals_To_BStr(value: null) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.BStrWrapper_Marshals_To_BStr(value: null) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.BStrWrapper_Marshals_To_BStr(value: "") - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.BStrWrapper_Marshals_To_BStr(value: "") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.BStrWrapper_Marshals_To_BStr(value: "Hello") - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.BStrWrapper_Marshals_To_BStr(value: "Hello") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Null_Marshals_To_Empty - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.Null_Marshals_To_Empty - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.String_Marshals_To_BStr(value: null, expected: VT_EMPTY) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.String_Marshals_To_BStr(value: null, expected: VT_EMPTY) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.String_Marshals_To_BStr(value: "", expected: VT_BSTR) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.String_Marshals_To_BStr(value: "", expected: VT_BSTR) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.String_Marshals_To_BStr(value: "Hello", expected: VT_BSTR) - info: [PASS] System.Runtime.InteropServices.Tests.ComVariantMarshallerTests.String_Marshals_To_BStr(value: "Hello", expected: VT_BSTR) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_NullString_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_NullString_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "pizza") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "pizza") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "pepperoni") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "pepperoni") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "password") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "password") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "P4ssw0rdAa1") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "P4ssw0rdAa1") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "ßê┤") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "ßê┤") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "´┐¢´┐¢") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "´┐¢´┐¢") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "­ÉÇÇ") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "­ÉÇÇ") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "\0") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "\0") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "abc\0def") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_InvokePtrToStringUni_Roundtrips(s: "abc\0def") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_DisposedString_ThrowsObjectDisposedException - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocUnicodeTests.SecureStringToGlobalAllocUnicode_DisposedString_ThrowsObjectDisposedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ZeroFreeCoTaskMemAnsiTests.ZeroFreeCoTaskMemAnsi_Zero_Nop - info: [PASS] System.Runtime.InteropServices.Tests.ZeroFreeCoTaskMemAnsiTests.ZeroFreeCoTaskMemAnsi_Zero_Nop - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ZeroFreeCoTaskMemAnsiTests.ZeroFreeCoTaskMemAnsi_ValidPointer_Success - info: [PASS] System.Runtime.InteropServices.Tests.ZeroFreeCoTaskMemAnsiTests.ZeroFreeCoTaskMemAnsi_ValidPointer_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.HandleRefTests.Ctor_Wrapper_Handle(wrapper: null, handle: 0) - info: [PASS] System.Runtime.InteropServices.Tests.HandleRefTests.Ctor_Wrapper_Handle(wrapper: null, handle: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.HandleRefTests.Ctor_Wrapper_Handle(wrapper: "Wrapper", handle: 1337) - info: [PASS] System.Runtime.InteropServices.Tests.HandleRefTests.Ctor_Wrapper_Handle(wrapper: "Wrapper", handle: 1337) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.HandleRefTests.Ctor_Default - info: [PASS] System.Runtime.InteropServices.Tests.HandleRefTests.Ctor_Default - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.FreeBSTRTests.FreeBSTR_Zero_Nop - info: [PASS] System.Runtime.InteropServices.Tests.FreeBSTRTests.FreeBSTR_Zero_Nop - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.FreeBSTRTests.FreeBSTR_ValidPointer_Success - info: [PASS] System.Runtime.InteropServices.Tests.FreeBSTRTests.FreeBSTR_ValidPointer_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CoClassAttributeTests.Ctor_CoClass(coClass: null) - info: [PASS] System.Runtime.InteropServices.Tests.CoClassAttributeTests.Ctor_CoClass(coClass: null) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CoClassAttributeTests.Ctor_CoClass(coClass: typeof(int)) - info: [PASS] System.Runtime.InteropServices.Tests.CoClassAttributeTests.Ctor_CoClass(coClass: typeof(int)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_StructWithBlittableFixedBuffer_In_NonBlittable_Success - info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_StructWithBlittableFixedBuffer_In_NonBlittable_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_NullPtr_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_NullPtr_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_NullStructure_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_NullStructure_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_NonBlittableStruct_WithBlittableFixedBuffer_Success - info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_NonBlittableStruct_WithBlittableFixedBuffer_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_Flat_And_Nested_NonBlittableStructure_Success - info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_Flat_And_Nested_NonBlittableStructure_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_NonBlittable_ThrowsArgumentException(o: NonGenericClass { }) - info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_NonBlittable_ThrowsArgumentException(o: NonGenericClass { }) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_NonBlittable_ThrowsArgumentException(o: "string") - info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_NonBlittable_ThrowsArgumentException(o: "string") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_OverflowByValArrayInStruct_Success - info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_OverflowByValArrayInStruct_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_AutoLayout_ThrowsArgumentException - info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_AutoLayout_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_GenericObject_ThrowsArgumentException(o: GenericClass`1 { }) - info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_GenericObject_ThrowsArgumentException(o: GenericClass`1 { }) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_GenericObject_ThrowsArgumentException(o: System.Runtime.InteropServices.Tests.Common.GenericStruct`1[System.String]) - info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_GenericObject_ThrowsArgumentException(o: System.Runtime.InteropServices.Tests.Common.GenericStruct`1[System.String]) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_OpaqueStruct_In_NonBlittableStructure_Success - info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_OpaqueStruct_In_NonBlittableStructure_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_ByValArrayInStruct_Success - info: [PASS] System.Runtime.InteropServices.Tests.StructureToPtrTests.StructureToPtr_ByValArrayInStruct_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.Int16Tests.WriteInt16_Pointer_Roundtrips(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) - info: [PASS] System.Runtime.InteropServices.Tests.Int16Tests.WriteInt16_Pointer_Roundtrips(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Remove_Unix_ThrowPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Remove_Unix_ThrowPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Combine_NullRcw_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Combine_NullRcw_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Combine_NotComObject_ThrowsArgumentException - info: [SKIP] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Combine_NotComObject_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Remove_NotComObject_ThrowsArgumentException - info: [SKIP] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Remove_NotComObject_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Remove_NullRcw_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Remove_NullRcw_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Combine_Unix_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.Tests.ComEventsHelperTests.Combine_Unix_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_NullString_ReturnsZero - info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_NullString_ReturnsZero - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "") - info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "pizza") - info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "pizza") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "pepperoni") - info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "pepperoni") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "password") - info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "password") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "P4ssw0rdAa1") - info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "P4ssw0rdAa1") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "´┐¢´┐¢") - info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "´┐¢´┐¢") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "­ÉÇÇ") - info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "­ÉÇÇ") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "ßê┤") - info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "ßê┤") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "\0") - info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "\0") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "abc\0def") - info: [PASS] System.Runtime.InteropServices.Tests.StringToBSTRTests.StringToBSTR_InvokePtrToStringBSTR_ReturnsExpected(s: "abc\0def") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.RuntimeEnvironmentTests.GetRuntimeInterfaceAsObject_Invoke_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.RuntimeEnvironmentTests.GetRuntimeInterfaceAsObject_Invoke_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.RuntimeEnvironmentTests.RuntimeEnvironmentSysVersion - info: [PASS] System.Runtime.InteropServices.RuntimeEnvironmentTests.RuntimeEnvironmentSysVersion - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.RuntimeEnvironmentTests.SystemConfigurationFile_Get_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.RuntimeEnvironmentTests.SystemConfigurationFile_Get_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.RuntimeEnvironmentTests.FromGlobalAccessCache_nNvoke_ReturnsFalse - info: [PASS] System.Runtime.InteropServices.RuntimeEnvironmentTests.FromGlobalAccessCache_nNvoke_ReturnsFalse - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.RuntimeEnvironmentTests.GetRuntimeInterfaceAsIntPtr_Invoke_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.RuntimeEnvironmentTests.GetRuntimeInterfaceAsIntPtr_Invoke_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.RuntimeEnvironmentTests.RuntimeEnvironmentRuntimeDirectory - info: [PASS] System.Runtime.InteropServices.RuntimeEnvironmentTests.RuntimeEnvironmentRuntimeDirectory - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException - info: [PASS] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_NullSource_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_NullSource_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) - info: [PASS] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) - info: [PASS] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) - info: [PASS] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException - info: [PASS] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: ['a', 'b', 'c', 'd', 'e', ┬À┬À┬À]) - info: [PASS] System.Runtime.InteropServices.Tests.CharArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: ['a', 'b', 'c', 'd', 'e', ┬À┬À┬À]) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.IsTypeVisibleFromComTests.IsTypeVisibleFromCom_NullType_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.IsTypeVisibleFromComTests.IsTypeVisibleFromCom_NullType_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GenerateProgIdForTypeTests.GenerateProgIdForType_NullType_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.GenerateProgIdForTypeTests.GenerateProgIdForType_NullType_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GenerateProgIdForTypeTests.GenerateProgIdForType_ValidType_ReturnsExpected - info: [SKIP] System.Runtime.InteropServices.Tests.GenerateProgIdForTypeTests.GenerateProgIdForType_ValidType_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DefaultCharSetAttributeTests.Ctor_CharSet(charSet: -1) - info: [PASS] System.Runtime.InteropServices.Tests.DefaultCharSetAttributeTests.Ctor_CharSet(charSet: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DefaultCharSetAttributeTests.Ctor_CharSet(charSet: Unicode) - info: [PASS] System.Runtime.InteropServices.Tests.DefaultCharSetAttributeTests.Ctor_CharSet(charSet: Unicode) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DefaultCharSetAttributeTests.Ctor_CharSet(charSet: 5) - info: [PASS] System.Runtime.InteropServices.Tests.DefaultCharSetAttributeTests.Ctor_CharSet(charSet: 5) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ShortInterfaceType(interfaceType: -1) - info: [PASS] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ShortInterfaceType(interfaceType: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ShortInterfaceType(interfaceType: 3) - info: [PASS] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ShortInterfaceType(interfaceType: 3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ShortInterfaceType(interfaceType: 5) - info: [PASS] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ShortInterfaceType(interfaceType: 5) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ComInterfaceType(interfaceType: -1) - info: [PASS] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ComInterfaceType(interfaceType: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ComInterfaceType(interfaceType: InterfaceIsIInspectable) - info: [PASS] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ComInterfaceType(interfaceType: InterfaceIsIInspectable) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ComInterfaceType(interfaceType: 5) - info: [PASS] System.Runtime.InteropServices.Tests.InterfaceTypeAttributeTests.Ctor_ComInterfaceType(interfaceType: 5) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringMarshalingTests.TestUTF8String - info: [PASS] System.Runtime.InteropServices.Tests.StringMarshalingTests.TestUTF8String - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringMarshalingTests.StringToCoTaskMemAnsiToString - info: [PASS] System.Runtime.InteropServices.Tests.StringMarshalingTests.StringToCoTaskMemAnsiToString - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringMarshalingTests.StringToCoTaskMemUniToString - info: [PASS] System.Runtime.InteropServices.Tests.StringMarshalingTests.StringToCoTaskMemUniToString - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringMarshalingTests.TestNullString_UTF8 - info: [PASS] System.Runtime.InteropServices.Tests.StringMarshalingTests.TestNullString_UTF8 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringMarshalingTests.TestNullString - info: [PASS] System.Runtime.InteropServices.Tests.StringMarshalingTests.TestNullString - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringMarshalingTests.StringToHGlobalAnsiToString - info: [PASS] System.Runtime.InteropServices.Tests.StringMarshalingTests.StringToHGlobalAnsiToString - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringMarshalingTests.StringToBStrToString - info: [PASS] System.Runtime.InteropServices.Tests.StringMarshalingTests.StringToBStrToString - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringMarshalingTests.StringToHGlobalUniToString - info: [PASS] System.Runtime.InteropServices.Tests.StringMarshalingTests.StringToHGlobalUniToString - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_NullType_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_NullType_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(int)) - info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(int)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Int32*)) - info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Int32*)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Int32&)) - info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Int32&)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(string)) - info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(string)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(string[])) - info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(string[])) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.NonGenericClass)) - info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.NonGenericClass)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass)) - info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.AbstractClass)) - info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.AbstractClass)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.NonGenericStruct)) - info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.NonGenericStruct)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericStruct)) - info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericStruct)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.INonGenericInterface)) - info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.INonGenericInterface)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.IGenericInterface)) - info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.IGenericInterface)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass<>)) - info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass<>)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(T)) - info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(T)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests+ClassWithGuidAttribute)) - info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests+ClassWithGuidAttribute)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(Type)) - info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_ValidType_ReturnsExpected(type: typeof(Type)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_NotRuntimeType_ThrowsArgumentException - info: [PASS] System.Runtime.InteropServices.Tests.GenerateGuidForTypeTests.GenerateGuidForType_NotRuntimeType_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_NullString_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_NullString_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pizza") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pizza") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pepperoni") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pepperoni") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "password") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "password") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "P4ssw0rdAa1") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "P4ssw0rdAa1") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "ßê┤") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "ßê┤") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "´┐¢´┐¢") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "´┐¢´┐¢") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "­ÉÇÇ") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "­ÉÇÇ") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "\0") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "\0") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "abc\0def") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_InvokePtrToStringAnsi_Roundtrips(s: "abc\0def") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_DisposedString_ThrowsObjectDisposedException - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToGlobalAllocAnsiTests.SecureStringToGlobalAllocAnsi_DisposedString_ThrowsObjectDisposedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComEventInterfaceAttributeTests.Ctor_DefaultInterface(sourceInterface: null, eventProvider: null) - info: [PASS] System.Runtime.InteropServices.Tests.ComEventInterfaceAttributeTests.Ctor_DefaultInterface(sourceInterface: null, eventProvider: null) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComEventInterfaceAttributeTests.Ctor_DefaultInterface(sourceInterface: typeof(int), eventProvider: typeof(string)) - info: [PASS] System.Runtime.InteropServices.Tests.ComEventInterfaceAttributeTests.Ctor_DefaultInterface(sourceInterface: typeof(int), eventProvider: typeof(string)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_ObjectNoBlittable_ThrowsArgumentException(structure: NonGenericClass { }) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_ObjectNoBlittable_ThrowsArgumentException(structure: NonGenericClass { }) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_GenericObject_ReturnsExpected - info: [FAIL] System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_GenericObject_ReturnsExpected - info: Assert.Equal() Failure: Strings differ - info: Expected: "hello" - info: Actual: null - info: at System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_GenericObject_ReturnsExpected() in C:\xr_dev\dotnetFork\runtime\src\libraries\System.Runtime.InteropServices\tests\System.Runtime.InteropServices.UnitTests\System\Runtime\InteropServices\Marshal\PtrToStructureTests.cs:line 110 - info: at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) in C:\xr_dev\dotnetFork\runtime\src\mono\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.Mono.cs:line 22 - info: at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in C:\xr_dev\dotnetFork\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs:line 57 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_ZeroPointer_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_ZeroPointer_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NullStructureType_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NullStructureType_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NonBlittablType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.PtrToStructureTests+AutoLayoutStruct)) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NonBlittablType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.PtrToStructureTests+AutoLayoutStruct)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NonBlittablType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.NonGenericClass)) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NonBlittablType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.NonGenericClass)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NonBlittablType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.AbstractClass)) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NonBlittablType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.AbstractClass)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericLayoutClass_Generic - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericLayoutClass_Generic - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_ZeroPointerWithType_ReturnsNull - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_ZeroPointerWithType_ReturnsNull - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericLayoutClass - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericLayoutClass - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NullStructure_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NullStructure_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NonRuntimeType_ThrowsArgumentException - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_NonRuntimeType_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_CantCreateType_ThrowsArgumentException(structureType: typeof(T), exceptionType: typeof(System.ArgumentException)) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_CantCreateType_ThrowsArgumentException(structureType: typeof(T), exceptionType: typeof(System.ArgumentException)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_CantCreateType_ThrowsArgumentException(structureType: typeof(System.Int32*), exceptionType: typeof(System.MissingMethodException)) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_CantCreateType_ThrowsArgumentException(structureType: typeof(System.Int32*), exceptionType: typeof(System.MissingMethodException)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_CantCreateType_ThrowsArgumentException(structureType: typeof(System.Int32&), exceptionType: typeof(System.MissingMethodException)) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_CantCreateType_ThrowsArgumentException(structureType: typeof(System.Int32&), exceptionType: typeof(System.MissingMethodException)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_NonGenericObject_ReturnsExpected - info: [FAIL] System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_NonGenericObject_ReturnsExpected - info: Assert.Equal() Failure: Strings differ - info: Expected: "hello" - info: Actual: null - info: at System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_NonGenericObject_ReturnsExpected() in C:\xr_dev\dotnetFork\runtime\src\libraries\System.Runtime.InteropServices\tests\System.Runtime.InteropServices.UnitTests\System\Runtime\InteropServices\Marshal\PtrToStructureTests.cs:line 84 - info: at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) in C:\xr_dev\dotnetFork\runtime\src\mono\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.Mono.cs:line 22 - info: at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in C:\xr_dev\dotnetFork\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs:line 57 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_AutoLayoutClass_ThrowsArgumentException - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_AutoLayoutClass_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass)) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass<>)) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.GenericClass<>)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.GenericStruct)) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.GenericStruct)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.GenericStruct<>)) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.GenericStruct<>)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.IGenericInterface)) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.IGenericInterface)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.IGenericInterface<>)) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_GenericType_ThrowsArgumentException(structureType: typeof(System.Runtime.InteropServices.Tests.Common.IGenericInterface<>)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_NonGenericType_ReturnsExpected - info: [FAIL] System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_NonGenericType_ReturnsExpected - info: Assert.Equal() Failure: Strings differ - info: Expected: "hello" - info: Actual: null - info: at System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_NonGenericType_ReturnsExpected() in C:\xr_dev\dotnetFork\runtime\src\libraries\System.Runtime.InteropServices\tests\System.Runtime.InteropServices.UnitTests\System\Runtime\InteropServices\Marshal\PtrToStructureTests.cs:line 32 - info: at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) in C:\xr_dev\dotnetFork\runtime\src\mono\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.Mono.cs:line 22 - info: at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in C:\xr_dev\dotnetFork\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs:line 57 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_ObjectNotValueClass_ThrowsArgumentException(structure: System.Runtime.InteropServices.Tests.Common.NonGenericStruct) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_ObjectNotValueClass_ThrowsArgumentException(structure: System.Runtime.InteropServices.Tests.Common.NonGenericStruct) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_ObjectNotValueClass_ThrowsArgumentException(structure: Value1) - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStructureTests.PtrToStructure_ObjectNotValueClass_ThrowsArgumentException(structure: Value1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_GenericType_ReturnsExpected - info: [FAIL] System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_GenericType_ReturnsExpected - info: Assert.Equal() Failure: Strings differ - info: Expected: "hello" - info: Actual: null - info: at System.Runtime.InteropServices.Tests.PtrToStructureTests.StructureToPtr_GenericType_ReturnsExpected() in C:\xr_dev\dotnetFork\runtime\src\libraries\System.Runtime.InteropServices\tests\System.Runtime.InteropServices.UnitTests\System\Runtime\InteropServices\Marshal\PtrToStructureTests.cs:line 58 - info: at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) in C:\xr_dev\dotnetFork\runtime\src\mono\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.Mono.cs:line 22 - info: at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in C:\xr_dev\dotnetFork\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs:line 57 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetExceptionForHRTests.GetExceptionForHR_InvalidHR_ReturnsNull(errorCode: 0) - info: [PASS] System.Runtime.InteropServices.Tests.GetExceptionForHRTests.GetExceptionForHR_InvalidHR_ReturnsNull(errorCode: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetExceptionForHRTests.GetExceptionForHR_InvalidHR_ReturnsNull(errorCode: 1) - info: [PASS] System.Runtime.InteropServices.Tests.GetExceptionForHRTests.GetExceptionForHR_InvalidHR_ReturnsNull(errorCode: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetExceptionForHRTests.GetExceptionForHR_ThrowExceptionForHR_ThrowsSameException - info: [PASS] System.Runtime.InteropServices.Tests.GetExceptionForHRTests.GetExceptionForHR_ThrowExceptionForHR_ThrowsSameException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAutoTests.StringToHGlobalAuto_NullString_ReturnsZero - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAutoTests.StringToHGlobalAuto_NullString_ReturnsZero - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAutoTests.StringToHGlobalAuto_NonNullString_Roundtrips(s: "") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAutoTests.StringToHGlobalAuto_NonNullString_Roundtrips(s: "") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToHGlobalAutoTests.StringToHGlobalAuto_NonNullString_Roundtrips(s: "Hello World") - info: [PASS] System.Runtime.InteropServices.Tests.StringToHGlobalAutoTests.StringToHGlobalAuto_NonNullString_Roundtrips(s: "Hello World") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ReAllocCoTaskMemTests.ReAllocCoTaskMem_PositiveSize(size: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ReAllocCoTaskMemTests.ReAllocCoTaskMem_PositiveSize(size: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ReAllocCoTaskMemTests.ReAllocCoTaskMem_PositiveSize(size: 1) - info: [PASS] System.Runtime.InteropServices.Tests.ReAllocCoTaskMemTests.ReAllocCoTaskMem_PositiveSize(size: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ReAllocCoTaskMemTests.ReAllocCoTaskMem_PositiveSize(size: 100) - info: [PASS] System.Runtime.InteropServices.Tests.ReAllocCoTaskMemTests.ReAllocCoTaskMem_PositiveSize(size: 100) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ReAllocCoTaskMemTests.ReAllocCoTaskMem_Invoke_DataCopied - info: [PASS] System.Runtime.InteropServices.Tests.ReAllocCoTaskMemTests.ReAllocCoTaskMem_Invoke_DataCopied - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ZeroFreeGlobalAllocUnicodeTests.ZeroFreeGlobalAllocUnicode_Zero_Nop - info: [PASS] System.Runtime.InteropServices.Tests.ZeroFreeGlobalAllocUnicodeTests.ZeroFreeGlobalAllocUnicode_Zero_Nop - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ZeroFreeGlobalAllocUnicodeTests.ZeroFreeGlobalAllocUnicode_ValidPointer_Success - info: [PASS] System.Runtime.InteropServices.Tests.ZeroFreeGlobalAllocUnicodeTests.ZeroFreeGlobalAllocUnicode_ValidPointer_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: 0) - info: [PASS] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: 255) - info: [PASS] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: 255) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: 5) - info: [PASS] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: 5) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: 5) - info: [PASS] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: 5) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: "ExpectedValue") - info: [PASS] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: "ExpectedValue") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: null) - info: [PASS] System.Runtime.InteropServices.DefaultParameterValueAttributeTests.Ctor_Value(value: null) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_InvalidOffset_ThrowsIndexOutOfRangeException(array: null, offset: -1) - info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_InvalidOffset_ThrowsIndexOutOfRangeException(array: null, offset: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_InvalidOffset_ThrowsIndexOutOfRangeException(array: null, offset: 1) - info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_InvalidOffset_ThrowsIndexOutOfRangeException(array: null, offset: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_InvalidOffset_ThrowsIndexOutOfRangeException(array: [1], offset: 5) - info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_InvalidOffset_ThrowsIndexOutOfRangeException(array: [1], offset: 5) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_InvalidOffset_ThrowsIndexOutOfRangeException(array: [2], offset: -1) - info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_InvalidOffset_ThrowsIndexOutOfRangeException(array: [2], offset: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_NotAnArray_ThrowsArgumentException - info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_NotAnArray_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_MultidimensionalArray_ThrowsArgumentException - info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_MultidimensionalArray_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: True) - info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: True) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: True) - info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: True) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: System.Runtime.InteropServices.ArrayWithOffset, expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: Object { }, expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: Object { }, expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: null, expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Equals_Object_ReturnsExpected(arrayWithOffset: System.Runtime.InteropServices.ArrayWithOffset, other: null, expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_NonPrimitiveArray_ThrowsArgumentException(array: []) - info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_NonPrimitiveArray_ThrowsArgumentException(array: []) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_NonPrimitiveArray_ThrowsArgumentException(array: []) - info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_NonPrimitiveArray_ThrowsArgumentException(array: []) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_Array_Offset(array: null, offset: 0, expectedHashCode: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_Array_Offset(array: null, offset: 0, expectedHashCode: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_Array_Offset(array: [0, 0], offset: 2, expectedHashCode: 8) - info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_Array_Offset(array: [0, 0], offset: 2, expectedHashCode: 8) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_Array_Offset(array: [0, 0], offset: 3, expectedHashCode: 8) - info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_Array_Offset(array: [0, 0], offset: 3, expectedHashCode: 8) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_Array_Offset(array: [0, 0, 0, 0], offset: 1, expectedHashCode: 4) - info: [PASS] System.Runtime.InteropServices.Tests.ArrayWithOffsetTests.Ctor_Array_Offset(array: [0, 0, 0, 0], offset: 1, expectedHashCode: 4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromDoubleTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromDoubleTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MinValueTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MinValueTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MinTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MinTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromNFloatTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromNFloatTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsRealNumberTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsRealNumberTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromIntPtrTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromIntPtrTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.SignTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.SignTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromInt64Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromInt64Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromDecimalTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromDecimalTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsNormalTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsNormalTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.NegativeOneTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.NegativeOneTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromInt128Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromInt128Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromUInt32Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromUInt32Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_SubtractionTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_SubtractionTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.GetExponentShortestBitLengthTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.GetExponentShortestBitLengthTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MinMagnitudeNumberTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MinMagnitudeNumberTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsFiniteTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsFiniteTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsSubnormalTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsSubnormalTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromInt32Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromInt32Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.TryWriteExponentBigEndianTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.TryWriteExponentBigEndianTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MaxTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MaxTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedIncrementTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedIncrementTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromHalfTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromHalfTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromInt16Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromInt16Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_UnaryNegationTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_UnaryNegationTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsNegativeInfinityTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsNegativeInfinityTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromCharTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromCharTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.RadixTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.RadixTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromUInt64Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromUInt64Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromIntPtrTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromIntPtrTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.Log2Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.Log2Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsNegativeTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsNegativeTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_DecrementTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_DecrementTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromDecimalTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromDecimalTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.GetSignificandBitLengthTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.GetSignificandBitLengthTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromUInt32Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromUInt32Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromInt128Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromInt128Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_ModulusTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_ModulusTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromDoubleTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromDoubleTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedDecrementTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedDecrementTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsCanonicalTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsCanonicalTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromSingleTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromSingleTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.GetExponentByteCountTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.GetExponentByteCountTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromUInt64Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromUInt64Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.AllBitsSetTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.AllBitsSetTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MaxNumberTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MaxNumberTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MaxMagnitudeTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MaxMagnitudeTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsPositiveTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsPositiveTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.TryWriteSignificandLittleEndianTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.TryWriteSignificandLittleEndianTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MultiplicativeIdentityTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MultiplicativeIdentityTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromUInt64Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromUInt64Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsOddIntegerTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsOddIntegerTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromSingleTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromSingleTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_InequalityTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_InequalityTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromDoubleTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromDoubleTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromInt32Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromInt32Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromCharTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromCharTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromInt128Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromInt128Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromSByteTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromSByteTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_AdditionTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_AdditionTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsPow2Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsPow2Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedSubtractionTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedSubtractionTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_GreaterThanOrEqualTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_GreaterThanOrEqualTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsZeroTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsZeroTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromUInt128Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromUInt128Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_LessThanTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_LessThanTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.OneTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.OneTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromUInt32Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromUInt32Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromIntPtrTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromIntPtrTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromUInt128Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromUInt128Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_MultiplyTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_MultiplyTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromDecimalTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromDecimalTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromSingleTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromSingleTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromInt32Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromInt32Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromCharTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromCharTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromInt16Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromInt16Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_LessThanOrEqualTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_LessThanOrEqualTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MaxMagnitudeNumberTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MaxMagnitudeNumberTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromUInt128Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromUInt128Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromByteTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromByteTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedUnaryNegationTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedUnaryNegationTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromSByteTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromSByteTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_EqualityTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_EqualityTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MaxValueTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MaxValueTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromUInt16Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromUInt16Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.TryWriteExponentLittleEndianTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.TryWriteExponentLittleEndianTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedMultiplyTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedMultiplyTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MinMagnitudeTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MinMagnitudeTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedDivisionTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedDivisionTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsEvenIntegerTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsEvenIntegerTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsPositiveInfinityTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsPositiveInfinityTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_DivisionTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_DivisionTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromNFloatTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromNFloatTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromByteTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromByteTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_GreaterThanTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_GreaterThanTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsImaginaryNumberTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsImaginaryNumberTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromHalfTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromHalfTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.ClampTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.ClampTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsInfinityTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsInfinityTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_UnaryPlusTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_UnaryPlusTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsNaNTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsNaNTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.GetSignificandByteCountTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.GetSignificandByteCountTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.TryWriteSignificandBigEndianTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.TryWriteSignificandBigEndianTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromByteTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromByteTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsIntegerTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsIntegerTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MinNumberTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.MinNumberTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromHalfTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromHalfTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedAdditionTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_CheckedAdditionTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromInt64Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromInt64Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsComplexNumberTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.IsComplexNumberTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.AbsTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.AbsTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromUInt16Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromUInt16Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromUInt16Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateTruncatingFromUInt16Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.AdditiveIdentityTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.AdditiveIdentityTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_IncrementTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.op_IncrementTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromInt16Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromInt16Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromNFloatTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateSaturatingFromNFloatTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromSByteTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromSByteTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.ZeroTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.ZeroTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromInt64Test - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests_GenericMath.CreateCheckedFromInt64Test - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ClassInterfaceType(classInterfaceType: -1) - info: [PASS] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ClassInterfaceType(classInterfaceType: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ClassInterfaceType(classInterfaceType: None) - info: [PASS] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ClassInterfaceType(classInterfaceType: None) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ClassInterfaceType(classInterfaceType: 4) - info: [PASS] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ClassInterfaceType(classInterfaceType: 4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ShortClassInterfaceType(classInterfaceType: -1) - info: [PASS] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ShortClassInterfaceType(classInterfaceType: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ShortClassInterfaceType(classInterfaceType: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ShortClassInterfaceType(classInterfaceType: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ShortClassInterfaceType(classInterfaceType: 4) - info: [PASS] System.Runtime.InteropServices.Tests.ClassInterfaceAttributeTests.Ctor_ShortClassInterfaceType(classInterfaceType: 4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_InvalidType_ThrowsArgumentException - info: [SKIP] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_InvalidType_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_Unix_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_Unix_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_ZeroUnknown_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_ZeroUnknown_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_UncastableObject_ThrowsInvalidCastException - info: [SKIP] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_UncastableObject_ThrowsInvalidCastException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_ArrayType_ThrowsBadImageFormatException - info: [SKIP] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_ArrayType_ThrowsBadImageFormatException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_NullType_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_NullType_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_ValidPointer_ReturnsExpected - info: [SKIP] System.Runtime.InteropServices.Tests.GetTypedObjectForIUnknownTests.GetTypedObjectForIUnknown_ValidPointer_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.UnsafeAddrOfPinnedArrayElementTests.UnsafeAddrOfPinnedArrayElement_GenericStructureArray_ReturnsExpected - info: [PASS] System.Runtime.InteropServices.Tests.UnsafeAddrOfPinnedArrayElementTests.UnsafeAddrOfPinnedArrayElement_GenericStructureArray_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.UnsafeAddrOfPinnedArrayElementTests.UnsafeAddrOfPinnedArrayElement_NonGenericPrimitiveArray_ReturnsExpected - info: [PASS] System.Runtime.InteropServices.Tests.UnsafeAddrOfPinnedArrayElementTests.UnsafeAddrOfPinnedArrayElement_NonGenericPrimitiveArray_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.UnsafeAddrOfPinnedArrayElementTests.UnsafeAddrOfPinnedArrayElement_NonGenericStructureArray_ReturnsExpected - info: [PASS] System.Runtime.InteropServices.Tests.UnsafeAddrOfPinnedArrayElementTests.UnsafeAddrOfPinnedArrayElement_NonGenericStructureArray_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.UnsafeAddrOfPinnedArrayElementTests.UnsafeAddrOfPinnedArrayElement_NullArray_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.UnsafeAddrOfPinnedArrayElementTests.UnsafeAddrOfPinnedArrayElement_NullArray_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.UnsafeAddrOfPinnedArrayElementTests.UnsafeAddrOfPinnedArrayElement_GenericPrimitiveArray_ReturnsExpected - info: [PASS] System.Runtime.InteropServices.Tests.UnsafeAddrOfPinnedArrayElementTests.UnsafeAddrOfPinnedArrayElement_GenericPrimitiveArray_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 789, obj: 789, expected: True) - info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 789, obj: 789, expected: True) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 789, obj: 0, expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 789, obj: 0, expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 0, obj: 0, expected: True) - info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 0, obj: 0, expected: True) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 789, obj: null, expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 789, obj: null, expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 789, obj: "789", expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 789, obj: "789", expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 789, obj: 789, expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.EqualsTest(culong: 789, obj: 789, expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.Ctor_UInt - info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.Ctor_UInt - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.Ctor_NUInt - info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.Ctor_NUInt - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.ToStringTest(value: 0, expected: "0") - info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.ToStringTest(value: 0, expected: "0") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.ToStringTest(value: 4567, expected: "4567") - info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.ToStringTest(value: 4567, expected: "4567") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.ToStringTest(value: 4294967295, expected: "4294967295") - info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.ToStringTest(value: 4294967295, expected: "4294967295") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.Size - info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.Size - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.Ctor_NUInt_OutOfRange - info: [SKIP] System.Runtime.InteropServices.Tests.CULongTests.Ctor_NUInt_OutOfRange - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.Ctor_Empty - info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.Ctor_Empty - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CULongTests.Ctor_NUInt_LargeValue - info: [PASS] System.Runtime.InteropServices.Tests.CULongTests.Ctor_NUInt_LargeValue - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException - info: [PASS] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_NullSource_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_NullSource_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) - info: [PASS] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) - info: [PASS] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) - info: [PASS] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException - info: [PASS] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) - info: [PASS] System.Runtime.InteropServices.Tests.SingleArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.IntPtrTests.WriteIntPtr_Pointer_Roundtrips(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) - info: [PASS] System.Runtime.InteropServices.Tests.IntPtrTests.WriteIntPtr_Pointer_Roundtrips(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ByteTests.WriteByte_Pointer_Roundtrips(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) - info: [PASS] System.Runtime.InteropServices.Tests.ByteTests.WriteByte_Pointer_Roundtrips(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.LastErrorTests.SetLastPInvokeError_GetLastWin32Error - info: [PASS] System.Runtime.InteropServices.Tests.LastErrorTests.SetLastPInvokeError_GetLastWin32Error - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.LastErrorTests.LastPInvokeError_RoundTrip - info: [PASS] System.Runtime.InteropServices.Tests.LastErrorTests.LastPInvokeError_RoundTrip - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.LastErrorTests.LastSystemError_RoundTrip - info: [PASS] System.Runtime.InteropServices.Tests.LastErrorTests.LastSystemError_RoundTrip - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.LastErrorTests.SetLastSystemError_PInvokeErrorUnchanged - info: [PASS] System.Runtime.InteropServices.Tests.LastErrorTests.SetLastSystemError_PInvokeErrorUnchanged - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.LCIDConversionAttributeTests.Ctor_Lcid(lcid: -1) - info: [PASS] System.Runtime.InteropServices.Tests.LCIDConversionAttributeTests.Ctor_Lcid(lcid: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.LCIDConversionAttributeTests.Ctor_Lcid(lcid: 0) - info: [PASS] System.Runtime.InteropServices.Tests.LCIDConversionAttributeTests.Ctor_Lcid(lcid: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.LCIDConversionAttributeTests.Ctor_Lcid(lcid: 1) - info: [PASS] System.Runtime.InteropServices.Tests.LCIDConversionAttributeTests.Ctor_Lcid(lcid: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.LCIDConversionAttributeTests.Exists - info: [PASS] System.Runtime.InteropServices.Tests.LCIDConversionAttributeTests.Exists - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ReleaseComObjectTests.ReleaseComObject_NullObject_ThrowsNullReferenceException - info: [SKIP] System.Runtime.InteropServices.Tests.ReleaseComObjectTests.ReleaseComObject_NullObject_ThrowsNullReferenceException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ReleaseComObjectTests.ReleaseComObject_Unix_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.Tests.ReleaseComObjectTests.ReleaseComObject_Unix_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ReleaseComObjectTests.ReleaseComObject_NonComObject_ThrowsArgumentException - info: [SKIP] System.Runtime.InteropServices.Tests.ReleaseComObjectTests.ReleaseComObject_NonComObject_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromCLSID_Unix - info: [PASS] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromCLSID_Unix - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromCLSID_CLSIDExists_ReturnsExpected - info: [SKIP] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromCLSID_CLSIDExists_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromCLSID_CLSIDExists_Server_ReturnsExpected - info: [SKIP] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromCLSID_CLSIDExists_Server_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromProgID_ReturnsExpected - info: [SKIP] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromProgID_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromProgID_Unix - info: [PASS] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromProgID_Unix - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromCLSID_NoSuchCLSIDExists_ReturnsExpected - info: [SKIP] System.Runtime.InteropServices.Tests.GetTypeFromCLSIDTests.GetTypeFromCLSID_NoSuchCLSIDExists_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ReAllocHGlobalTests.ReAllocHGlobal_PositiveSize(size: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ReAllocHGlobalTests.ReAllocHGlobal_PositiveSize(size: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ReAllocHGlobalTests.ReAllocHGlobal_PositiveSize(size: 1) - info: [PASS] System.Runtime.InteropServices.Tests.ReAllocHGlobalTests.ReAllocHGlobal_PositiveSize(size: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ReAllocHGlobalTests.ReAllocHGlobal_PositiveSize(size: 100) - info: [PASS] System.Runtime.InteropServices.Tests.ReAllocHGlobalTests.ReAllocHGlobal_PositiveSize(size: 100) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ReAllocHGlobalTests.ReAllocHGlobal_Invoke_DataCopied - info: [PASS] System.Runtime.InteropServices.Tests.ReAllocHGlobalTests.ReAllocHGlobal_Invoke_DataCopied - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ReAllocHGlobalTests.ReAllocHGlobal_NegativeSize_ThrowsOutOfMemoryException - info: [PASS] System.Runtime.InteropServices.Tests.ReAllocHGlobalTests.ReAllocHGlobal_NegativeSize_ThrowsOutOfMemoryException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_NullStructureType_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_NullStructureType_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_NonGeneric_Success - info: [PASS] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_NonGeneric_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_Blittable_Success - info: [PASS] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_Blittable_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_AutoLayout_ThrowsArgumentException - info: [PASS] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_AutoLayout_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_NestedNonBlittableStruct_Success - info: [PASS] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_NestedNonBlittableStruct_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_ZeroPointer_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_ZeroPointer_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_Generic_Success - info: [PASS] System.Runtime.InteropServices.Tests.DestroyStructureTests.DestroyStructure_Generic_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringAutoTests.PtrToStringAuto_ZeroPtrWithLength_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringAutoTests.PtrToStringAuto_ZeroPtrWithLength_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringAutoTests.PtrToStringAuto_ZeroPtrNoLength_ReturnsNull - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringAutoTests.PtrToStringAuto_ZeroPtrNoLength_ReturnsNull - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PtrToStringAutoTests.PtrToStringAuto_NegativeLength_ThrowsArgumentOutOfRangeException - info: [PASS] System.Runtime.InteropServices.Tests.PtrToStringAutoTests.PtrToStringAuto_NegativeLength_ThrowsArgumentOutOfRangeException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.FreeTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.FreeTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocNullPtrOOMTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocNullPtrOOMTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocNonPowerOfTwoAlignmentTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocNonPowerOfTwoAlignmentTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocNullPtrZeroSizeTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocNullPtrZeroSizeTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyEmptyBlockShouldNoOpTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyEmptyBlockShouldNoOpTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedByteCountOOMTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedByteCountOOMTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocZeroSizeTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocZeroSizeTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedElementCountOOMTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedElementCountOOMTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocByteCountTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocByteCountTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithNullPointerAndZeroByteCountTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithNullPointerAndZeroByteCountTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.FillNullMemoryBlockShouldNoOpTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.FillNullMemoryBlockShouldNoOpTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocByteCountOOMTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocByteCountOOMTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroElementCountTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroElementCountTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyToOverlappedMemoryTest(size: 311, offset: 100, byteCount: 50) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyToOverlappedMemoryTest(size: 311, offset: 100, byteCount: 50) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyToOverlappedMemoryTest(size: 33, offset: 0, byteCount: 12) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyToOverlappedMemoryTest(size: 33, offset: 0, byteCount: 12) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyToOverlappedMemoryTest(size: 150, offset: 50, byteCount: 100) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyToOverlappedMemoryTest(size: 150, offset: 50, byteCount: 100) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocOverflowByteCountTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocOverflowByteCountTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 1, destinationSize: 1, byteCount: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 1, destinationSize: 1, byteCount: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 7, destinationSize: 9, byteCount: 5) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 7, destinationSize: 9, byteCount: 5) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 1, destinationSize: 16, byteCount: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 1, destinationSize: 16, byteCount: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 16, destinationSize: 16, byteCount: 16) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 16, destinationSize: 16, byteCount: 16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 29, destinationSize: 37, byteCount: 19) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 29, destinationSize: 37, byteCount: 19) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 1024, destinationSize: 16, byteCount: 16) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyTest(sourceSize: 1024, destinationSize: 16, byteCount: 16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocSmallerToLargerTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocSmallerToLargerTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithSizeEqualTo0ShouldNoOpTest(offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithSizeEqualTo0ShouldNoOpTest(offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithSizeEqualTo0ShouldNoOpTest(offset: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithSizeEqualTo0ShouldNoOpTest(offset: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithSizeEqualTo0ShouldNoOpTest(offset: 167) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithSizeEqualTo0ShouldNoOpTest(offset: 167) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedZeroElementSizeTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedZeroElementSizeTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocZeroSizeTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocZeroSizeTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocNullPtrTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocNullPtrTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 1048576) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 1048576) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 65536) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 65536) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 16384) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 16384) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 8192) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 8192) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 4096) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 4096) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 2048) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 2048) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 1024) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 1024) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 2097152) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 2097152) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 512) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 512) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 128) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 128) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 64) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 64) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 32) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 32) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 16) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 8) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 8) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 4) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 2) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 256) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 256) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 4194304) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocTest(alignment: 4194304) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedByteCountTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedByteCountTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.FillEmptyMemoryBlockShouldNoOpTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.FillEmptyMemoryBlockShouldNoOpTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 1, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 1, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 512, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 512, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 256, offset: 5) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 256, offset: 5) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 256, offset: 3) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 256, offset: 3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 256, offset: 2) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 256, offset: 2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 256, offset: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 256, offset: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 256, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 256, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 128, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 128, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 64, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 64, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 32, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 32, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 16, offset: 7) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 16, offset: 7) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 16, offset: 3) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 16, offset: 3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 16, offset: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 16, offset: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 16, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 16, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 9, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 9, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 8, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 8, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 4, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 4, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 3, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 3, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 2, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 2, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 1, offset: 3) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 1, offset: 3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 1, offset: 2) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 1, offset: 2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 1, offset: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 1, offset: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 547, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 547, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 1024, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearTest(size: 1024, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocElementCountOOMTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocElementCountOOMTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocNullPtrZeroSizeTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocNullPtrZeroSizeTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroByteCountTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroByteCountTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocSmallerToLargerTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocSmallerToLargerTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocLessThanVoidPtrAlignmentTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocLessThanVoidPtrAlignmentTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocZeroSizeTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocZeroSizeTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocOOMTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocOOMTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedZeroElementCountTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedZeroElementCountTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocNonPowerOfTwoAlignmentTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocNonPowerOfTwoAlignmentTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedZeroByteCountTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedZeroByteCountTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocNullPtrTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocNullPtrTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedFreeTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedFreeTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocZeroAlignmentTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocZeroAlignmentTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocZeroAlignmentTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocZeroAlignmentTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 5) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 5) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 3) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 2) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 128, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 128, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 64, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 64, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 32, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 32, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 16, offset: 7) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 16, offset: 7) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 16, offset: 3) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 16, offset: 3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 16, offset: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 16, offset: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 16, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 16, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 9, offset: 289) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 9, offset: 289) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 9, offset: 111) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 9, offset: 111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 9, offset: 2) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 9, offset: 2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 9, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 9, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 8, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 8, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 4, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 4, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 3, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 3, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 2, offset: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 2, offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 367) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 367) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 44) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 44) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 3) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 2) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 1, offset: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 67) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 67) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 143) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ClearWithExactRangeTest(size: 256, offset: 143) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocNullPtrOOMTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.ReallocNullPtrOOMTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocLessThanVoidPtrAlignmentTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedReallocLessThanVoidPtrAlignmentTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedElementCountTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroedElementCountTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 1048576) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 1048576) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 65536) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 65536) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 16384) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 16384) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 8192) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 8192) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 4096) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 4096) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 2048) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 2048) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 1024) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 1024) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 2097152) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 2097152) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 512) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 512) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 128) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 128) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 64) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 64) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 32) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 32) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 16) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 8) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 8) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 4) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 2) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 256) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 256) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 4194304) - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AlignedAllocTest(alignment: 4194304) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocElementCountTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocElementCountTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyNullBlockShouldNoOpTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.CopyNullBlockShouldNoOpTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroElementSizeTest - info: [PASS] System.Runtime.InteropServices.Tests.NativeMemoryTests.AllocZeroElementSizeTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetIDispatchForObjectTests.GetIDispatchForObject_NullObject_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.GetIDispatchForObjectTests.GetIDispatchForObject_NullObject_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetIDispatchForObjectTests.GetIDispatchForObject_NetCore_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.Tests.GetIDispatchForObjectTests.GetIDispatchForObject_NetCore_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetIDispatchForObjectTests.GetIDispatchForObject_NonDispatchObject_ThrowsInvalidCastException - info: [SKIP] System.Runtime.InteropServices.Tests.GetIDispatchForObjectTests.GetIDispatchForObject_NonDispatchObject_ThrowsInvalidCastException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_NullString_ReturnsZero - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_NullString_ReturnsZero - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pizza") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pizza") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pepperoni") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pepperoni") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "password") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "password") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "P4ssw0rdAa1") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "P4ssw0rdAa1") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "ßê┤") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "ßê┤") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "´┐¢´┐¢") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "´┐¢´┐¢") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "­ÉÇÇ") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "­ÉÇÇ") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "\0") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "\0") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "abc\0def") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAnsiTests.StringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "abc\0def") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_NullString_ReturnsZero - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_NullString_ReturnsZero - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "pizza") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "pizza") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "pepperoni") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "pepperoni") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "password") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "password") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "P4ssw0rdAa1") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "P4ssw0rdAa1") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "ßê┤") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "ßê┤") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "´┐¢´┐¢") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "´┐¢´┐¢") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "­ÉÇÇ") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "­ÉÇÇ") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "\0") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "\0") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "abc\0def") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUniTests.StringToCoTaskMemUni_PtrToStringUni_Roundtrips(s: "abc\0def") - info: Collecting garbage after test... - info: [STRT] System.Tests.DllNotFoundExceptionTests.Ctor_String - info: [PASS] System.Tests.DllNotFoundExceptionTests.Ctor_String - info: Collecting garbage after test... - info: [STRT] System.Tests.DllNotFoundExceptionTests.Ctor_Default - info: [PASS] System.Tests.DllNotFoundExceptionTests.Ctor_Default - info: Collecting garbage after test... - info: [STRT] System.Tests.DllNotFoundExceptionTests.Ctor_String_Exception - info: [PASS] System.Tests.DllNotFoundExceptionTests.Ctor_String_Exception - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_NullString_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_NullString_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "pizza") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "pizza") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "pepperoni") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "pepperoni") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "password") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "password") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "P4ssw0rdAa1") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "P4ssw0rdAa1") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "ßê┤") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "ßê┤") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "´┐¢´┐¢") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "´┐¢´┐¢") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "­ÉÇÇ") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "­ÉÇÇ") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "\0") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "\0") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "abc\0def") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_PtrToStringUni_Roundtrips(s: "abc\0def") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_DisposedString_ThrowsObjectDisposedException - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemUnicodeTests.SecureStringToCoTaskMemUnicode_DisposedString_ThrowsObjectDisposedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComConversionLossAttributeTests.Exists - info: [PASS] System.Runtime.InteropServices.Tests.ComConversionLossAttributeTests.Exists - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.AddrOfPinnedObject_NotInitialized_ThrowsException - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.AddrOfPinnedObject_NotInitialized_ThrowsException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Ctor_Default_Pinned - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Ctor_Default_Pinned - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected_Genenic - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected_Genenic - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.AddrOfPinnedObject_ReturnsArrayData - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.AddrOfPinnedObject_ReturnsArrayData - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Dispose_NotInitialized_NoThrow - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Dispose_NotInitialized_NoThrow - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.FromIntPtr_Zero_ThrowsInvalidOperationException - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.FromIntPtr_Zero_ThrowsInvalidOperationException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: null) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: null) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: "String") - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: "String") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: 123) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: 123) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: [0]) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: [0]) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: [System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable]) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: [System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable]) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: [null]) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: [null]) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Value_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.FromIntPtr_Generic_Zero_NoCheck - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.FromIntPtr_Generic_Zero_NoCheck - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: null, type: Normal) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: null, type: Normal) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: null, type: Weak) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: null, type: Weak) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: null, type: WeakTrackResurrection) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: null, type: WeakTrackResurrection) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: "String", type: Normal) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: "String", type: Normal) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: "String", type: Weak) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: "String", type: Weak) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: "String", type: WeakTrackResurrection) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: "String", type: WeakTrackResurrection) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: 123, type: Normal) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: 123, type: Normal) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: 123, type: Weak) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: 123, type: Weak) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: 123, type: WeakTrackResurrection) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: 123, type: WeakTrackResurrection) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [0], type: Normal) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [0], type: Normal) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [0], type: Weak) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [0], type: Weak) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [0], type: WeakTrackResurrection) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [0], type: WeakTrackResurrection) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable], type: Normal) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable], type: Normal) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable], type: Weak) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable], type: Weak) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable], type: WeakTrackResurrection) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable], type: WeakTrackResurrection) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [null], type: Normal) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [null], type: Normal) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [null], type: Weak) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [null], type: Weak) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [null], type: WeakTrackResurrection) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [null], type: WeakTrackResurrection) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable, type: Normal) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable, type: Normal) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable, type: Weak) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable, type: Weak) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable, type: WeakTrackResurrection) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable, type: WeakTrackResurrection) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: null, type: Pinned) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: null, type: Pinned) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: "", type: Pinned) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: "", type: Pinned) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: 1, type: Pinned) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: 1, type: Pinned) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: Object { }, type: Pinned) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: Object { }, type: Pinned) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+Blittable, type: Pinned) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+Blittable, type: Pinned) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+Blittable, type: Pinned) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+Blittable, type: Pinned) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [], type: Pinned) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [], type: Pinned) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+UnmanagedNonBlittable, type: Pinned) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: System.Runtime.InteropServices.Tests.GCHandleTests+UnmanagedNonBlittable, type: Pinned) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [], type: Pinned) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: [], type: Pinned) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: ClassWithoutReferences { _field = 0 }, type: Pinned) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_Type_ReturnsExpected(value: ClassWithoutReferences { _field = 0 }, type: Pinned) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Free_NotInitialized_ThrowsInvalidOperationException - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Free_NotInitialized_ThrowsInvalidOperationException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Equals_Object_ReturnsExpected(handle: System.Runtime.InteropServices.GCHandle, other: System.Runtime.InteropServices.GCHandle, expected: True) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Equals_Object_ReturnsExpected(handle: System.Runtime.InteropServices.GCHandle, other: System.Runtime.InteropServices.GCHandle, expected: True) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Equals_Object_ReturnsExpected(handle: System.Runtime.InteropServices.GCHandle, other: System.Runtime.InteropServices.GCHandle, expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Equals_Object_ReturnsExpected(handle: System.Runtime.InteropServices.GCHandle, other: System.Runtime.InteropServices.GCHandle, expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Equals_Object_ReturnsExpected(handle: System.Runtime.InteropServices.GCHandle, other: Object { }, expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Equals_Object_ReturnsExpected(handle: System.Runtime.InteropServices.GCHandle, other: Object { }, expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Equals_Object_ReturnsExpected(handle: System.Runtime.InteropServices.GCHandle, other: null, expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Equals_Object_ReturnsExpected(handle: System.Runtime.InteropServices.GCHandle, other: null, expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Ctor_Default_Weak - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Ctor_Default_Weak - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidPinnedObject_ThrowsArgumentException(value: System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidPinnedObject_ThrowsArgumentException(value: System.Runtime.InteropServices.Tests.GCHandleTests+NonBlittable) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidPinnedObject_ThrowsArgumentException(value: ClassWithReferences { _field = null }) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidPinnedObject_ThrowsArgumentException(value: ClassWithReferences { _field = null }) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidPinnedObject_ThrowsArgumentException(value: []) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidPinnedObject_ThrowsArgumentException(value: []) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidPinnedObject_ThrowsArgumentException(value: []) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidPinnedObject_ThrowsArgumentException(value: []) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidPinnedObject_ThrowsArgumentException(value: []) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidPinnedObject_ThrowsArgumentException(value: []) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.AddrOfPinnedObject_NotPinned_ThrowsInvalidOperationException - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.AddrOfPinnedObject_NotPinned_ThrowsInvalidOperationException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Ctor_Default - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Ctor_Default - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.AddrOfPinnedObject_ReturnsStringData - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.AddrOfPinnedObject_ReturnsStringData - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidGCHandleType_ThrowsArgumentOutOfRangeException(type: -1) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidGCHandleType_ThrowsArgumentOutOfRangeException(type: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidGCHandleType_ThrowsArgumentOutOfRangeException(type: 4) - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Alloc_InvalidGCHandleType_ThrowsArgumentOutOfRangeException(type: 4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GCHandleTests.Ctor_Default_Generic - info: [PASS] System.Runtime.InteropServices.Tests.GCHandleTests.Ctor_Default_Generic - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAutoTests.StringToCoTaskMemAuto_NullString_ReturnsZero - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAutoTests.StringToCoTaskMemAuto_NullString_ReturnsZero - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAutoTests.StringToCoTaskMemAuto_NonNullString_Roundtrips(s: "") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAutoTests.StringToCoTaskMemAuto_NonNullString_Roundtrips(s: "") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAutoTests.StringToCoTaskMemAuto_NonNullString_Roundtrips(s: "Hello World") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAutoTests.StringToCoTaskMemAuto_NonNullString_Roundtrips(s: "Hello World") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAutoTests.StringToCoTaskMemAuto_PtrToStringAuto_ReturnsExpected(len: 0) - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAutoTests.StringToCoTaskMemAuto_PtrToStringAuto_ReturnsExpected(len: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemAutoTests.StringToCoTaskMemAuto_PtrToStringAuto_ReturnsExpected(len: 5) - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemAutoTests.StringToCoTaskMemAuto_PtrToStringAuto_ReturnsExpected(len: 5) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComUnregisterFunctionAttributeTests.Exists - info: [PASS] System.Runtime.InteropServices.Tests.ComUnregisterFunctionAttributeTests.Exists - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DllImportAttributeTests.Ctor_SourceInterfaces(dllName: null) - info: [PASS] System.Runtime.InteropServices.Tests.DllImportAttributeTests.Ctor_SourceInterfaces(dllName: null) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DllImportAttributeTests.Ctor_SourceInterfaces(dllName: "DllName") - info: [PASS] System.Runtime.InteropServices.Tests.DllImportAttributeTests.Ctor_SourceInterfaces(dllName: "DllName") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_ShortFlags(flags: -1) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_ShortFlags(flags: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_ShortFlags(flags: 0) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_ShortFlags(flags: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_ShortFlags(flags: 4) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_ShortFlags(flags: 4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_TypeLibFuncFlags(flags: -1) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_TypeLibFuncFlags(flags: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_TypeLibFuncFlags(flags: 0) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_TypeLibFuncFlags(flags: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_TypeLibFuncFlags(flags: FBindable) - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibFuncAttributeTests.Ctor_TypeLibFuncFlags(flags: FBindable) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComCompatibleVersionAttributeTests.Ctor_Major_Minor_Build_Revision(major: -1, minor: -2, build: -3, revision: -4) - info: [PASS] System.Runtime.InteropServices.Tests.ComCompatibleVersionAttributeTests.Ctor_Major_Minor_Build_Revision(major: -1, minor: -2, build: -3, revision: -4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComCompatibleVersionAttributeTests.Ctor_Major_Minor_Build_Revision(major: 0, minor: 0, build: 0, revision: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ComCompatibleVersionAttributeTests.Ctor_Major_Minor_Build_Revision(major: 0, minor: 0, build: 0, revision: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComCompatibleVersionAttributeTests.Ctor_Major_Minor_Build_Revision(major: 1, minor: 2, build: 3, revision: 4) - info: [PASS] System.Runtime.InteropServices.Tests.ComCompatibleVersionAttributeTests.Ctor_Major_Minor_Build_Revision(major: 1, minor: 2, build: 3, revision: 4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComCompatibleVersionAttributeTests.Exists - info: [PASS] System.Runtime.InteropServices.Tests.ComCompatibleVersionAttributeTests.Exists - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThanOrEqual(left: 789, right: 789) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThanOrEqual(left: 789, right: 789) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThanOrEqual(left: 789, right: -789) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThanOrEqual(left: 789, right: -789) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThanOrEqual(left: 789, right: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThanOrEqual(left: 789, right: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThanOrEqual(left: 789, right: 1000) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThanOrEqual(left: 789, right: 1000) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt64(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt64(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt64(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt64(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt64(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt64(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt64(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt64(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt64(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt64(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.8414709848078965, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.8414709848078965, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.97877093770393309, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.97877093770393309, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 1, expectedResult: 0.5, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 1, expectedResult: 0.5, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.90929742682568171, expectedResult: 0.36338022763241867, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.90929742682568171, expectedResult: 0.36338022763241867, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.82148283122563881, expectedResult: 0.30685281944005471, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.82148283122563881, expectedResult: 0.30685281944005471, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.79569320156748091, expectedResult: 0.29289321881345248, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.79569320156748091, expectedResult: 0.29289321881345248, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.62426595263969908, expectedResult: 0.21460183660255169, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.62426595263969908, expectedResult: 0.21460183660255169, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: -0.3924695585627842, expectedResult: -0.12837916709551256, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: -0.3924695585627842, expectedResult: -0.12837916709551256, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: -0.96390253284987737, expectedResult: -0.41421356237309503, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: -0.96390253284987737, expectedResult: -0.41421356237309503, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: -0.98383852942436245, expectedResult: -0.44269504088896339, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: -0.98383852942436245, expectedResult: -0.44269504088896339, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: -0.97536797208363135, expectedResult: -0.42920367320510339, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: -0.97536797208363135, expectedResult: -0.42920367320510339, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.81376384817462333, expectedResult: 0.30258509299404568, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.81376384817462333, expectedResult: 0.30258509299404568, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.77394268526670829, expectedResult: 0.28171817154095474, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: 0.77394268526670829, expectedResult: 0.28171817154095474, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: -0.43030121700009227, expectedResult: -0.14159265358979323, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest64(value: -0.43030121700009227, expectedResult: -0.14159265358979323, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest64(value: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSByte(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSByte(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSByte(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSByte(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSByte(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSByte(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSByte(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSByte(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSByte(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSByte(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NaNEqualsTest - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NaNEqualsTest - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CharToNFloat(value: 'A') - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CharToNFloat(value: 'A') - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CharToNFloat(value: 'B') - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CharToNFloat(value: 'B') - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CharToNFloat(value: 'C') - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CharToNFloat(value: 'C') - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CharToNFloat(value: 'D') - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CharToNFloat(value: 'D') - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CharToNFloat(value: 'E') - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CharToNFloat(value: 'E') - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -Infinity, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -Infinity, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 0, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 0, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 1.0811811619898573, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 1.0811811619898573, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 1.7182818284590451, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 1.7182818284590451, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 3.3313150290214524, expectedResult: 0.63661977236758138, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 3.3313150290214524, expectedResult: 0.63661977236758138, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 3.9334096679145962, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 3.9334096679145962, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 4.0945611704512963, expectedResult: 0.70710678118654757, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 4.0945611704512963, expectedResult: 0.70710678118654757, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 5.1009598002416938, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 5.1009598002416938, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 12.439377934644401, expectedResult: 1.1283791670955126, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 12.439377934644401, expectedResult: 1.1283791670955126, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 24.954553519470082, expectedResult: 1.4142135623730949, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 24.954553519470082, expectedResult: 1.4142135623730949, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 26.713733786437789, expectedResult: 1.4426950408889634, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 26.713733786437789, expectedResult: 1.4426950408889634, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 36.221710484165165, expectedResult: 1.5707963267948966, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 36.221710484165165, expectedResult: 1.5707963267948966, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 199.71743249053009, expectedResult: 2.3025850929940459, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 199.71743249053009, expectedResult: 2.3025850929940459, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 521.73529967043669, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 521.73529967043669, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 9, expectedResult: 1, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 9, expectedResult: 1, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.51950362694813135, expectedResult: -0.31830988618379069, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.51950362694813135, expectedResult: -0.31830988618379069, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.63212055882855767, expectedResult: -0.43429448190325182, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.63212055882855767, expectedResult: -0.43429448190325182, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.76912323548399941, expectedResult: -0.63661977236758138, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.76912323548399941, expectedResult: -0.63661977236758138, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -3.1415926535897931, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -3.1415926535897931, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -2.7182818284590451, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -2.7182818284590451, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -1.4142135623730949, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -1.4142135623730949, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -1, expectedResult: -Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -1, expectedResult: -Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.99808698589777567, expectedResult: -2.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.99808698589777567, expectedResult: -2.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.99501787170355926, expectedResult: -2.3025850929940459, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.99501787170355926, expectedResult: -2.3025850929940459, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.9731339589988639, expectedResult: -1.5707963267948966, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.9731339589988639, expectedResult: -1.5707963267948966, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.9639168071792128, expectedResult: -1.4426950408889634, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.9639168071792128, expectedResult: -1.4426950408889634, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.96147111529967799, expectedResult: -1.4142135623730949, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.96147111529967799, expectedResult: -1.4142135623730949, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.92559179413935733, expectedResult: -1.1283791670955126, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.92559179413935733, expectedResult: -1.1283791670955126, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.90000000000000002, expectedResult: -1, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.90000000000000002, expectedResult: -1, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.83609136386042338, expectedResult: -0.78539816339744828, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.83609136386042338, expectedResult: -0.78539816339744828, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.80371224006494435, expectedResult: -0.70710678118654757, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.80371224006494435, expectedResult: -0.70710678118654757, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.79730043371348269, expectedResult: -0.69314718055994529, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: -0.79730043371348269, expectedResult: -0.69314718055994529, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 1384.4557313670111, expectedResult: 3.1415926535897931, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: 1384.4557313670111, expectedResult: 3.1415926535897931, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log10P1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: -Infinity, value2: -Infinity, amount: 0.5, expectedResult: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: -Infinity, value2: -Infinity, amount: 0.5, expectedResult: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 4, value2: 2, amount: 0.5, expectedResult: 3) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 4, value2: 2, amount: 0.5, expectedResult: 3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 4, value2: 2, amount: 0, expectedResult: 4) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 4, value2: 2, amount: 0, expectedResult: 4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 3, value2: 1, amount: 2, expectedResult: -1) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 3, value2: 1, amount: 2, expectedResult: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 3, value2: 1, amount: 1, expectedResult: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 3, value2: 1, amount: 1, expectedResult: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 3, value2: 1, amount: 0.5, expectedResult: 2) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 3, value2: 1, amount: 0.5, expectedResult: 2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 3, value2: 1, amount: 0, expectedResult: 3) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 3, value2: 1, amount: 0, expectedResult: 3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 2, value2: 4, amount: 2, expectedResult: 6) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 2, value2: 4, amount: 2, expectedResult: 6) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 2, value2: 4, amount: 1, expectedResult: 4) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 2, value2: 4, amount: 1, expectedResult: 4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 2, value2: 4, amount: 0.5, expectedResult: 3) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 2, value2: 4, amount: 0.5, expectedResult: 3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 2, value2: 4, amount: 0, expectedResult: 2) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 2, value2: 4, amount: 0, expectedResult: 2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 1, value2: 3, amount: 2, expectedResult: 5) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 1, value2: 3, amount: 2, expectedResult: 5) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 1, value2: 3, amount: 1, expectedResult: 3) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 1, value2: 3, amount: 1, expectedResult: 3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 1, value2: 3, amount: 0.5, expectedResult: 2) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 1, value2: 3, amount: 0.5, expectedResult: 2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 4, value2: 2, amount: 1, expectedResult: 2) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 4, value2: 2, amount: 1, expectedResult: 2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 1, value2: 3, amount: 0, expectedResult: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 1, value2: 3, amount: 0, expectedResult: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: Infinity, value2: 0, amount: 0.5, expectedResult: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: Infinity, value2: 0, amount: 0.5, expectedResult: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: Infinity, value2: Infinity, amount: 0.5, expectedResult: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: Infinity, value2: Infinity, amount: 0.5, expectedResult: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: Infinity, value2: NaN, amount: 0.5, expectedResult: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: Infinity, value2: NaN, amount: 0.5, expectedResult: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: Infinity, value2: -Infinity, amount: 0.5, expectedResult: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: Infinity, value2: -Infinity, amount: 0.5, expectedResult: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: NaN, value2: 1, amount: 0.5, expectedResult: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: NaN, value2: 1, amount: 0.5, expectedResult: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: NaN, value2: 0, amount: 0.5, expectedResult: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: NaN, value2: 0, amount: 0.5, expectedResult: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: NaN, value2: Infinity, amount: 0.5, expectedResult: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: NaN, value2: Infinity, amount: 0.5, expectedResult: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: NaN, value2: NaN, amount: 0.5, expectedResult: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: NaN, value2: NaN, amount: 0.5, expectedResult: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: NaN, value2: -Infinity, amount: 0.5, expectedResult: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: NaN, value2: -Infinity, amount: 0.5, expectedResult: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: -Infinity, value2: 1, amount: 0.5, expectedResult: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: -Infinity, value2: 1, amount: 0.5, expectedResult: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: -Infinity, value2: 0, amount: 0.5, expectedResult: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: -Infinity, value2: 0, amount: 0.5, expectedResult: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: -Infinity, value2: Infinity, amount: 0.5, expectedResult: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: -Infinity, value2: Infinity, amount: 0.5, expectedResult: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: -Infinity, value2: NaN, amount: 0.5, expectedResult: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: -Infinity, value2: NaN, amount: 0.5, expectedResult: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: Infinity, value2: 1, amount: 0.5, expectedResult: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: Infinity, value2: 1, amount: 0.5, expectedResult: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 4, value2: 2, amount: 2, expectedResult: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest64(value1: 4, value2: 2, amount: 2, expectedResult: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SByteToNFloat(value: -127) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SByteToNFloat(value: -127) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SByteToNFloat(value: -63) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SByteToNFloat(value: -63) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SByteToNFloat(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SByteToNFloat(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SByteToNFloat(value: 63) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SByteToNFloat(value: 63) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SByteToNFloat(value: 127) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SByteToNFloat(value: 127) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDouble(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDouble(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDouble(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDouble(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDouble(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDouble(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDouble(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDouble(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDouble(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDouble(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.LerpTest32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: -4567, right: 3.1400001) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: -4567, right: 3.1400001) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: -4567.89111, right: 3.14568996) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: -4567.89111, right: 3.14568996) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: 0, right: 3.1400001) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: 0, right: 3.1400001) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: 4567, right: -3.1400001) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: 4567, right: -3.1400001) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: 4567.89111, right: -3.14568996) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: 4567.89111, right: -3.14568996) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -Infinity, expectedResult: -1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -Infinity, expectedResult: -1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 2.7182818284590451, expectedResult: 14.154262241479264, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 2.7182818284590451, expectedResult: 14.154262241479264, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 2.3025850929940459, expectedResult: 9, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 2.3025850929940459, expectedResult: 9, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 1.5707963267948966, expectedResult: 3.8104773809653518, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 1.5707963267948966, expectedResult: 3.8104773809653518, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 1.4426950408889634, expectedResult: 3.2320861065570821, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 1.4426950408889634, expectedResult: 3.2320861065570821, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 1.4142135623730949, expectedResult: 3.1132503787829275, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 1.4142135623730949, expectedResult: 3.1132503787829275, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 1.1283791670955126, expectedResult: 2.0906430223107977, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 1.1283791670955126, expectedResult: 2.0906430223107977, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 1, expectedResult: 1.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 1, expectedResult: 1.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.78539816339744828, expectedResult: 1.1932800507380155, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.78539816339744828, expectedResult: 1.1932800507380155, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.70710678118654757, expectedResult: 1.0281149816474724, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.70710678118654757, expectedResult: 1.0281149816474724, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.69314718055994529, expectedResult: 1, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.69314718055994529, expectedResult: 1, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.63661977236758138, expectedResult: 0.89008116457222197, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.63661977236758138, expectedResult: 0.89008116457222197, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.43429448190325182, expectedResult: 0.54387344397118109, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.43429448190325182, expectedResult: 0.54387344397118109, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.31830988618379069, expectedResult: 0.37480222743935865, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0.31830988618379069, expectedResult: 0.37480222743935865, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 0, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 3.1415926535897931, expectedResult: 22.14069263277927, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: 3.1415926535897931, expectedResult: 22.14069263277927, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.31830988618379069, expectedResult: -0.27262265070478353, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.31830988618379069, expectedResult: -0.27262265070478353, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.43429448190325182, expectedResult: -0.35227851485819933, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.43429448190325182, expectedResult: -0.35227851485819933, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.63661977236758138, expectedResult: -0.47092219173226463, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.63661977236758138, expectedResult: -0.47092219173226463, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.69314718055994529, expectedResult: -0.5, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.69314718055994529, expectedResult: -0.5, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.70710678118654757, expectedResult: -0.50693130860476021, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.70710678118654757, expectedResult: -0.50693130860476021, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.78539816339744828, expectedResult: -0.54406187223400371, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0.78539816339744828, expectedResult: -0.54406187223400371, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -1, expectedResult: -0.63212055882855767, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -1, expectedResult: -0.63212055882855767, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -1.1283791670955126, expectedResult: -0.67644273609692895, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -1.1283791670955126, expectedResult: -0.67644273609692895, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -1.4142135623730949, expectedResult: -0.75688326556578578, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -1.4142135623730949, expectedResult: -0.75688326556578578, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -1.4426950408889634, expectedResult: -0.7637099116554773, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -1.4426950408889634, expectedResult: -0.7637099116554773, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -1.5707963267948966, expectedResult: -0.79212042364923807, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -1.5707963267948966, expectedResult: -0.79212042364923807, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -2.3025850929940459, expectedResult: -0.90000000000000002, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -2.3025850929940459, expectedResult: -0.90000000000000002, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -2.7182818284590451, expectedResult: -0.93401196415468746, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -2.7182818284590451, expectedResult: -0.93401196415468746, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -3.1415926535897931, expectedResult: -0.9567860817362277, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -3.1415926535897931, expectedResult: -0.9567860817362277, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: -0, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 0.58119566361426733, expectedResult: 0.30258509299404568, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 0.58119566361426733, expectedResult: 0.30258509299404568, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 0.22058404074969809, expectedResult: 0.42920367320510339, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 0.22058404074969809, expectedResult: 0.42920367320510339, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.17905794598427577, expectedResult: 0.55730495911103661, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.17905794598427577, expectedResult: 0.55730495911103661, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.26625534204141549, expectedResult: 0.58578643762690497, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.26625534204141549, expectedResult: 0.58578643762690497, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.9197649947685187, expectedResult: 0.87162083290448744, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.9197649947685187, expectedResult: 0.87162083290448744, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -1, expectedResult: 1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -1, expectedResult: 1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.63325565131481998, expectedResult: 0.7182818284590452, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.63325565131481998, expectedResult: 0.7182818284590452, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.78121189211048814, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.78121189211048814, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.5702332487688776, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.5702332487688776, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.41614683654714241, expectedResult: 0.63661977236758138, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.41614683654714241, expectedResult: 0.63661977236758138, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 0, expectedResult: 0.5, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 0, expectedResult: 0.5, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 0.20495719432643394, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 0.20495719432643394, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 0.54030230586813977, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 0.54030230586813977, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 1, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: 1, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.6056998670788134, expectedResult: 0.70710678118654757, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.6056998670788134, expectedResult: 0.70710678118654757, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.90268536193307103, expectedResult: 0.85840734641020677, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest64(value: -0.90268536193307103, expectedResult: 0.85840734641020677, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: -4567, right: 3.1400001) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: -4567, right: 3.1400001) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: -4567.89111, right: 3.14568996) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: -4567.89111, right: 3.14568996) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: 0, right: 3.1400001) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: 0, right: 3.1400001) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: 4567, right: -3.1400001) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: 4567, right: -3.1400001) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: 4567.89111, right: -3.14568996) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: 4567.89111, right: -3.14568996) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt32(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt32(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt32(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt32(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt32(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt32(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt32(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt32(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt32(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt32(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThanOrEqual(left: 789, right: 789) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThanOrEqual(left: 789, right: 789) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThanOrEqual(left: 789, right: -789) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThanOrEqual(left: 789, right: -789) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThanOrEqual(left: 789, right: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThanOrEqual(left: 789, right: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThanOrEqual(left: 789, right: 1000) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThanOrEqual(left: 789, right: 1000) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: 1.40129846E-45) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: 1.40129846E-45) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsPositiveInfinity(value: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 3.1415926535897931, expectedResult: 0.054831135561607541, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 3.1415926535897931, expectedResult: 0.054831135561607541, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 3, expectedResult: 0.052359877559829883, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 3, expectedResult: 0.052359877559829883, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 2.7182818284590451, expectedResult: 0.047442967903742035, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 2.7182818284590451, expectedResult: 0.047442967903742035, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 2.5, expectedResult: 0.043633231299858237, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 2.5, expectedResult: 0.043633231299858237, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 2.3025850929940459, expectedResult: 0.040187691180085916, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 2.3025850929940459, expectedResult: 0.040187691180085916, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 2, expectedResult: 0.034906585039886591, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 2, expectedResult: 0.034906585039886591, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1.5707963267948966, expectedResult: 0.027415567780803771, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1.5707963267948966, expectedResult: 0.027415567780803771, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1.5, expectedResult: 0.026179938779914941, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1.5, expectedResult: 0.026179938779914941, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1.4426950408889634, expectedResult: 0.025179778565706631, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1.4426950408889634, expectedResult: 0.025179778565706631, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 3.5, expectedResult: 0.061086523819801536, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 3.5, expectedResult: 0.061086523819801536, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1.4142135623730949, expectedResult: 0.024682682989768702, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1.4142135623730949, expectedResult: 0.024682682989768702, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1, expectedResult: 0.017453292519943295, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1, expectedResult: 0.017453292519943295, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.78539816339744828, expectedResult: 0.013707783890401885, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.78539816339744828, expectedResult: 0.013707783890401885, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.70710678118654757, expectedResult: 0.012341341494884351, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.70710678118654757, expectedResult: 0.012341341494884351, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.69314718055994529, expectedResult: 0.012097700501686679, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.69314718055994529, expectedResult: 0.012097700501686679, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.63661977236758138, expectedResult: 0.011111111111111112, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.63661977236758138, expectedResult: 0.011111111111111112, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.5, expectedResult: 0.0087266462599716477, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.5, expectedResult: 0.0087266462599716477, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.43429448190325182, expectedResult: 0.0075798686324546737, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.43429448190325182, expectedResult: 0.0075798686324546737, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.31830988618379069, expectedResult: 0.0055555555555555558, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0.31830988618379069, expectedResult: 0.0055555555555555558, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 0, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1.1283791670955126, expectedResult: 0.019693931676727953, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: 1.1283791670955126, expectedResult: 0.019693931676727953, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DegreesToRadiansTest64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -Infinity, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -Infinity, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 0, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 0, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 0.37480222743935865, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 0.37480222743935865, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 0.54387344397118109, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 0.54387344397118109, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 0.89008116457222197, expectedResult: 0.63661977236758138, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 0.89008116457222197, expectedResult: 0.63661977236758138, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 1, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 1, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 1.0281149816474724, expectedResult: 0.70710678118654757, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 1.0281149816474724, expectedResult: 0.70710678118654757, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 1.1932800507380155, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 1.1932800507380155, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 2.0906430223107977, expectedResult: 1.1283791670955126, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 2.0906430223107977, expectedResult: 1.1283791670955126, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 3.1132503787829275, expectedResult: 1.4142135623730949, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 3.1132503787829275, expectedResult: 1.4142135623730949, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 3.2320861065570821, expectedResult: 1.4426950408889634, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 3.2320861065570821, expectedResult: 1.4426950408889634, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 3.8104773809653518, expectedResult: 1.5707963267948966, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 3.8104773809653518, expectedResult: 1.5707963267948966, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 9, expectedResult: 2.3025850929940459, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 9, expectedResult: 2.3025850929940459, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 14.154262241479264, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 14.154262241479264, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 1.7182818284590451, expectedResult: 1, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 1.7182818284590451, expectedResult: 1, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 22.14069263277927, expectedResult: 3.1415926535897931, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: 22.14069263277927, expectedResult: 3.1415926535897931, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.47092219173226463, expectedResult: -0.63661977236758138, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.47092219173226463, expectedResult: -0.63661977236758138, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.50693130860476021, expectedResult: -0.70710678118654757, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.50693130860476021, expectedResult: -0.70710678118654757, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -3.1415926535897931, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -3.1415926535897931, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -2.7182818284590451, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -2.7182818284590451, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -1.4142135623730949, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -1.4142135623730949, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -1, expectedResult: -Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -1, expectedResult: -Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.9567860817362277, expectedResult: -3.1415926535897931, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.9567860817362277, expectedResult: -3.1415926535897931, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.5, expectedResult: -0.69314718055994529, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.5, expectedResult: -0.69314718055994529, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.93401196415468746, expectedResult: -2.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.93401196415468746, expectedResult: -2.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.79212042364923807, expectedResult: -1.5707963267948966, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.79212042364923807, expectedResult: -1.5707963267948966, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.7637099116554773, expectedResult: -1.4426950408889634, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.7637099116554773, expectedResult: -1.4426950408889634, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.75688326556578578, expectedResult: -1.4142135623730949, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.75688326556578578, expectedResult: -1.4142135623730949, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.67644273609692895, expectedResult: -1.1283791670955126, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.67644273609692895, expectedResult: -1.1283791670955126, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.63212055882855767, expectedResult: -1, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.63212055882855767, expectedResult: -1, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.54406187223400371, expectedResult: -0.78539816339744828, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.54406187223400371, expectedResult: -0.78539816339744828, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.90000000000000002, expectedResult: -2.3025850929940459, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: -0.90000000000000002, expectedResult: -2.3025850929940459, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: 1.40129846E-45) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: 1.40129846E-45) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegative(value: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt16(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt16(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt16(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt16(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt16(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt16(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt16(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt16(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt16(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt16(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: 1.40129846E-45) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: 1.40129846E-45) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsFinite(value: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SingleToNFloat(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SingleToNFloat(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SingleToNFloat(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SingleToNFloat(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SingleToNFloat(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SingleToNFloat(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SingleToNFloat(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SingleToNFloat(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SingleToNFloat(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SingleToNFloat(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Ctor_Double_LargeValue - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Ctor_Double_LargeValue - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -Infinity, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -Infinity, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 5.5808859910179214, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 5.5808859910179214, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 3.9334096679145962, expectedResult: 2.3025850929940459, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 3.9334096679145962, expectedResult: 2.3025850929940459, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 1.9706864235520194, expectedResult: 1.5707963267948966, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 1.9706864235520194, expectedResult: 1.5707963267948966, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 1.7182818284590451, expectedResult: 1.4426950408889634, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 1.7182818284590451, expectedResult: 1.4426950408889634, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 1.6651441426902251, expectedResult: 1.4142135623730949, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 1.6651441426902251, expectedResult: 1.4142135623730949, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 1.1861299583286617, expectedResult: 1.1283791670955126, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 1.1861299583286617, expectedResult: 1.1283791670955126, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 1, expectedResult: 1, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 1, expectedResult: 1, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.72356793412734954, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.72356793412734954, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.63252691943815287, expectedResult: 0.70710678118654757, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.63252691943815287, expectedResult: 0.70710678118654757, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.61680667224167463, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.61680667224167463, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.55468227548210014, expectedResult: 0.63661977236758138, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.55468227548210014, expectedResult: 0.63661977236758138, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.3512498725672672, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.3512498725672672, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.2468689889006383, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0.2468689889006383, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 0, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.19799112103854805, expectedResult: -0.31830988618379069, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.19799112103854805, expectedResult: -0.31830988618379069, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.2599444260445482, expectedResult: -0.43429448190325182, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.2599444260445482, expectedResult: -0.43429448190325182, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -1, expectedResult: -Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -1, expectedResult: -Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.88668526770323908, expectedResult: -3.1415926535897931, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.88668526770323908, expectedResult: -3.1415926535897931, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.848044776742087, expectedResult: -2.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.848044776742087, expectedResult: -2.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.79730043371348269, expectedResult: -2.3025850929940459, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.79730043371348269, expectedResult: -2.3025850929940459, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.66337746317758095, expectedResult: -1.5707963267948966, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.66337746317758095, expectedResult: -1.5707963267948966, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 7.824977827076288, expectedResult: 3.1415926535897931, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: 7.824977827076288, expectedResult: 3.1415926535897931, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.63212055882855767, expectedResult: -1.4426950408889634, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.63212055882855767, expectedResult: -1.4426950408889634, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.5425706526777031, expectedResult: -1.1283791670955126, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.5425706526777031, expectedResult: -1.1283791670955126, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.5, expectedResult: -1, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.5, expectedResult: -1, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.41980818962827554, expectedResult: -0.78539816339744828, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.41980818962827554, expectedResult: -0.78539816339744828, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.38745267346393408, expectedResult: -0.70710678118654757, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.38745267346393408, expectedResult: -0.70710678118654757, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.38149686219842405, expectedResult: -0.69314718055994529, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.38149686219842405, expectedResult: -0.69314718055994529, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.35678175806699514, expectedResult: -0.63661977236758138, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.35678175806699514, expectedResult: -0.63661977236758138, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.62478577275351821, expectedResult: -1.4142135623730949, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: -0.62478577275351821, expectedResult: -1.4142135623730949, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.PositiveInfinity - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.PositiveInfinity - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.ExpM1Test32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: -4567, right: 3.1400001) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: -4567, right: 3.1400001) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: -4567.89111, right: 3.14568996) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: -4567.89111, right: 3.14568996) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: 0, right: 3.1400001) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: 0, right: 3.1400001) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: 4567, right: -3.1400001) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: 4567, right: -3.1400001) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: 4567.89111, right: -3.14568996) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: 4567.89111, right: -3.14568996) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.Log2P1Test32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThan(left: 789, right: 789) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThan(left: 789, right: 789) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThan(left: 789, right: -789) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThan(left: 789, right: -789) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThan(left: 789, right: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThan(left: 789, right: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThan(left: 789, right: 1000) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_LessThan(left: 789, right: 1000) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int16ToNFloat(value: -255) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int16ToNFloat(value: -255) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int16ToNFloat(value: -127) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int16ToNFloat(value: -127) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int16ToNFloat(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int16ToNFloat(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int16ToNFloat(value: 127) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int16ToNFloat(value: 127) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int16ToNFloat(value: 255) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int16ToNFloat(value: 255) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NegativeInfinity - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NegativeInfinity - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.AcosPiTest32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Increment(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Increment(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Increment(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Increment(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Increment(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Increment(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Increment(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Increment(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Increment(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Increment(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -Infinity, y: Infinity, expectedResult: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -Infinity, y: Infinity, expectedResult: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -3, y: 2, expectedResult: -3) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -3, y: 2, expectedResult: -3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: 2, y: -3, expectedResult: -3) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: 2, y: -3, expectedResult: -3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: 0, y: -0, expectedResult: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: 0, y: -0, expectedResult: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -0, y: 0, expectedResult: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -0, y: 0, expectedResult: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: NaN, y: -Infinity, expectedResult: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: NaN, y: -Infinity, expectedResult: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: NaN, y: Infinity, expectedResult: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: NaN, y: Infinity, expectedResult: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: 3, y: -2, expectedResult: 3) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: 3, y: -2, expectedResult: 3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -Infinity, y: NaN, expectedResult: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -Infinity, y: NaN, expectedResult: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: 1, y: NaN, expectedResult: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: 1, y: NaN, expectedResult: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: NaN, y: 1, expectedResult: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: NaN, y: 1, expectedResult: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: NaN, y: NaN, expectedResult: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: NaN, y: NaN, expectedResult: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: 1.7976931348623157E+308, y: -1.7976931348623157E+308, expectedResult: 1.7976931348623157E+308) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: 1.7976931348623157E+308, y: -1.7976931348623157E+308, expectedResult: 1.7976931348623157E+308) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -1.7976931348623157E+308, y: 1.7976931348623157E+308, expectedResult: 1.7976931348623157E+308) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -1.7976931348623157E+308, y: 1.7976931348623157E+308, expectedResult: 1.7976931348623157E+308) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: Infinity, y: -Infinity, expectedResult: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: Infinity, y: -Infinity, expectedResult: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: Infinity, y: NaN, expectedResult: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: Infinity, y: NaN, expectedResult: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -2, y: 3, expectedResult: 3) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest64(x: -2, y: 3, expectedResult: 3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Ctor_Double_OutOfRange - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.Ctor_Double_OutOfRange - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt16(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt16(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt16(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt16(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt16(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt16(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt16(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt16(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt16(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToInt16(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 0, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 0, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 1.5574077246549023, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 1.5574077246549023, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 4.7754895402454185, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 4.7754895402454185, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: Infinity, expectedResult: 0.5, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: Infinity, expectedResult: 0.5, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -2.1850398632615189, expectedResult: -0.36338022763241867, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -2.1850398632615189, expectedResult: -0.36338022763241867, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -1.4406084404920341, expectedResult: -0.30685281944005471, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -1.4406084404920341, expectedResult: -0.30685281944005471, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -1.3136757077477541, expectedResult: -0.29289321881345248, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -1.3136757077477541, expectedResult: -0.29289321881345248, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -0.79909939792801821, expectedResult: -0.21460183660255169, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -0.79909939792801821, expectedResult: -0.21460183660255169, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 0.42670634433261806, expectedResult: 0.12837916709551256, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 0.42670634433261806, expectedResult: 0.12837916709551256, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 3.6202185671074507, expectedResult: 0.41421356237309503, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 3.6202185671074507, expectedResult: 0.41421356237309503, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 5.4945259425167299, expectedResult: 0.44269504088896339, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 5.4945259425167299, expectedResult: 0.44269504088896339, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -4.4217522209161286, expectedResult: -0.42920367320510339, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -4.4217522209161286, expectedResult: -0.42920367320510339, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 1.4001547140150528, expectedResult: 0.30258509299404568, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 1.4001547140150528, expectedResult: 0.30258509299404568, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -1.2221646718190067, expectedResult: -0.28171817154095474, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: -1.2221646718190067, expectedResult: -0.28171817154095474, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 0.47669014603118892, expectedResult: 0.14159265358979323, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest64(value: 0.47669014603118892, expectedResult: 0.14159265358979323, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: NaN, y: NaN, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: NaN, y: NaN, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 2.7182818284590451, expectedResult: 3.844231028159117, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 2.7182818284590451, expectedResult: 3.844231028159117, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 3.1415926535897931, expectedResult: 4.1543544023133139, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 3.1415926535897931, expectedResult: 4.1543544023133139, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.31830988618379069, expectedResult: 10.005064776584025, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.31830988618379069, expectedResult: 10.005064776584025, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.43429448190325182, expectedResult: 10.009426142242702, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.43429448190325182, expectedResult: 10.009426142242702, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.63661977236758138, expectedResult: 10.020243746265326, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.63661977236758138, expectedResult: 10.020243746265326, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.69314718055994529, expectedResult: 10.023993865417028, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.69314718055994529, expectedResult: 10.023993865417028, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.70710678118654757, expectedResult: 10.024968827881711, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.70710678118654757, expectedResult: 10.024968827881711, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.78539816339744828, expectedResult: 10.030795096853891, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 0.78539816339744828, expectedResult: 10.030795096853891, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 1, expectedResult: 10.04987562112089, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 1, expectedResult: 10.04987562112089, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 2.3025850929940459, expectedResult: 3.5624365551415855, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 2.3025850929940459, expectedResult: 3.5624365551415855, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 1.1283791670955126, expectedResult: 10.063460614755501, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 1.1283791670955126, expectedResult: 10.063460614755501, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 1.4426950408889634, expectedResult: 10.103532500121213, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 1.4426950408889634, expectedResult: 10.103532500121213, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 1.5707963267948966, expectedResult: 10.12261829272804, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 1.5707963267948966, expectedResult: 10.12261829272804, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 2.3025850929940459, expectedResult: 10.261671311754164, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 2.3025850929940459, expectedResult: 10.261671311754164, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 2.7182818284590451, expectedResult: 10.362869105558106, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 2.7182818284590451, expectedResult: 10.362869105558106, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 3.1415926535897931, expectedResult: 10.481870272097884, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 3.1415926535897931, expectedResult: 10.481870272097884, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: NaN, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: NaN, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: 0, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: 0, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: 1, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: 1, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: 2.7182818284590451, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: 2.7182818284590451, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 1.4142135623730949, expectedResult: 10.099504938362077, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 10, y: 1.4142135623730949, expectedResult: 10.099504938362077, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: 10, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: 10, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 1.5707963267948966, expectedResult: 3.139499514126892, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 1.5707963267948966, expectedResult: 3.139499514126892, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 1.4142135623730949, expectedResult: 3.0641566701020122, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 1.4142135623730949, expectedResult: 3.0641566701020122, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: NaN, y: 0, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: NaN, y: 0, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: NaN, y: 1, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: NaN, y: 1, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: NaN, y: 2.7182818284590451, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: NaN, y: 2.7182818284590451, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: NaN, y: 10, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: NaN, y: 10, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 0, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 0, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 1, expectedResult: 1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 1, expectedResult: 1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 1.5707963267948966, expectedResult: 1.5707963267948966, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 1.5707963267948966, expectedResult: 1.5707963267948966, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 2, expectedResult: 2, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 2, expectedResult: 2, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 2.7182818284590451, expectedResult: 2.7182818284590451, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 2.7182818284590451, expectedResult: 2.7182818284590451, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 1.4426950408889634, expectedResult: 3.0774055761202908, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 1.4426950408889634, expectedResult: 3.0774055761202908, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 3, expectedResult: 3, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 3, expectedResult: 3, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 1, y: 1, expectedResult: 1.4142135623730949, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 1, y: 1, expectedResult: 1.4142135623730949, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.31830988618379069, expectedResult: 2.7368553638387594, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.31830988618379069, expectedResult: 2.7368553638387594, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.43429448190325182, expectedResult: 2.752756399673292, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.43429448190325182, expectedResult: 2.752756399673292, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.63661977236758138, expectedResult: 2.7918346715914253, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.63661977236758138, expectedResult: 2.7918346715914253, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.69314718055994529, expectedResult: 2.8052645352709344, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.69314718055994529, expectedResult: 2.8052645352709344, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.70710678118654757, expectedResult: 2.8087463571726534, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.70710678118654757, expectedResult: 2.8087463571726534, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.78539816339744828, expectedResult: 2.8294710413783588, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 0.78539816339744828, expectedResult: 2.8294710413783588, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 1, expectedResult: 2.8963867315900083, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 1, expectedResult: 2.8963867315900083, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 1.1283791670955126, expectedResult: 2.9431778138036129, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 2.7182818284590451, y: 1.1283791670955126, expectedResult: 2.9431778138036129, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 10, expectedResult: 10, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: 0, y: 10, expectedResult: 10, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Hypot64(x: Infinity, y: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Equality(left: 789, right: 789) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Equality(left: 789, right: 789) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Equality(left: 789, right: -789) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Equality(left: 789, right: -789) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Equality(left: 789, right: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Equality(left: 789, right: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Equality(left: 789, right: 1000) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Equality(left: 789, right: 1000) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DoubleToNFloat(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DoubleToNFloat(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DoubleToNFloat(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DoubleToNFloat(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DoubleToNFloat(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DoubleToNFloat(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DoubleToNFloat(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DoubleToNFloat(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.DoubleToNFloat(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.DoubleToNFloat(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.AtanPiTest32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -Infinity, expectedResult: -1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -Infinity, expectedResult: -1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 2.7182818284590451, expectedResult: 521.73529967043669, allowedVariance: 8.8817841970012523E-13) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 2.7182818284590451, expectedResult: 521.73529967043669, allowedVariance: 8.8817841970012523E-13) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 2.3025850929940459, expectedResult: 199.71743249053009, allowedVariance: 8.8817841970012523E-13) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 2.3025850929940459, expectedResult: 199.71743249053009, allowedVariance: 8.8817841970012523E-13) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 1.5707963267948966, expectedResult: 36.221710484165165, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 1.5707963267948966, expectedResult: 36.221710484165165, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 1.4426950408889634, expectedResult: 26.713733786437789, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 1.4426950408889634, expectedResult: 26.713733786437789, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 1.4142135623730949, expectedResult: 24.954553519470082, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 1.4142135623730949, expectedResult: 24.954553519470082, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 1.1283791670955126, expectedResult: 12.439377934644401, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 1.1283791670955126, expectedResult: 12.439377934644401, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 1, expectedResult: 9, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 1, expectedResult: 9, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.78539816339744828, expectedResult: 5.1009598002416938, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.78539816339744828, expectedResult: 5.1009598002416938, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.70710678118654757, expectedResult: 4.0945611704512963, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.70710678118654757, expectedResult: 4.0945611704512963, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.69314718055994529, expectedResult: 3.9334096679145962, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.69314718055994529, expectedResult: 3.9334096679145962, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.63661977236758138, expectedResult: 3.3313150290214524, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.63661977236758138, expectedResult: 3.3313150290214524, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.43429448190325182, expectedResult: 1.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.43429448190325182, expectedResult: 1.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.31830988618379069, expectedResult: 1.0811811619898573, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0.31830988618379069, expectedResult: 1.0811811619898573, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 0, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 3.1415926535897931, expectedResult: 1384.4557313670111, allowedVariance: 8.8817841970012523E-12) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: 3.1415926535897931, expectedResult: 1384.4557313670111, allowedVariance: 8.8817841970012523E-12) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.31830988618379069, expectedResult: -0.51950362694813135, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.31830988618379069, expectedResult: -0.51950362694813135, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.43429448190325182, expectedResult: -0.63212055882855767, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.43429448190325182, expectedResult: -0.63212055882855767, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.63661977236758138, expectedResult: -0.76912323548399941, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.63661977236758138, expectedResult: -0.76912323548399941, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.69314718055994529, expectedResult: -0.79730043371348269, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.69314718055994529, expectedResult: -0.79730043371348269, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.70710678118654757, expectedResult: -0.80371224006494435, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.70710678118654757, expectedResult: -0.80371224006494435, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.78539816339744828, expectedResult: -0.83609136386042338, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0.78539816339744828, expectedResult: -0.83609136386042338, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -1, expectedResult: -0.90000000000000002, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -1, expectedResult: -0.90000000000000002, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -1.1283791670955126, expectedResult: -0.92559179413935733, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -1.1283791670955126, expectedResult: -0.92559179413935733, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -1.4142135623730949, expectedResult: -0.96147111529967799, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -1.4142135623730949, expectedResult: -0.96147111529967799, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -1.4426950408889634, expectedResult: -0.9639168071792128, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -1.4426950408889634, expectedResult: -0.9639168071792128, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -1.5707963267948966, expectedResult: -0.9731339589988639, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -1.5707963267948966, expectedResult: -0.9731339589988639, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -2.3025850929940459, expectedResult: -0.99501787170355926, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -2.3025850929940459, expectedResult: -0.99501787170355926, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -2.7182818284590451, expectedResult: -0.99808698589777567, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -2.7182818284590451, expectedResult: -0.99808698589777567, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -3.1415926535897931, expectedResult: -0.99927821584092524, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -3.1415926535897931, expectedResult: -0.99927821584092524, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: -0, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10M1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Decrement(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Decrement(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Decrement(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Decrement(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Decrement(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Decrement(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Decrement(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Decrement(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Decrement(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Decrement(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: 1.40129846E-45) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: 1.40129846E-45) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNegativeInfinity(value: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int64ToNFloat(value: -255) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int64ToNFloat(value: -255) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int64ToNFloat(value: -127) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int64ToNFloat(value: -127) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int64ToNFloat(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int64ToNFloat(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int64ToNFloat(value: 127) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int64ToNFloat(value: 127) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int64ToNFloat(value: 255) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int64ToNFloat(value: 255) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -Infinity, y: Infinity, expectedResult: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -Infinity, y: Infinity, expectedResult: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -3, y: 2, expectedResult: -3) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -3, y: 2, expectedResult: -3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: 2, y: -3, expectedResult: -3) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: 2, y: -3, expectedResult: -3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: 0, y: -0, expectedResult: -0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: 0, y: -0, expectedResult: -0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -0, y: 0, expectedResult: -0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -0, y: 0, expectedResult: -0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: NaN, y: -Infinity, expectedResult: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: NaN, y: -Infinity, expectedResult: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: NaN, y: Infinity, expectedResult: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: NaN, y: Infinity, expectedResult: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: 3, y: -2, expectedResult: -2) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: 3, y: -2, expectedResult: -2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -Infinity, y: NaN, expectedResult: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -Infinity, y: NaN, expectedResult: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: 1, y: NaN, expectedResult: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: 1, y: NaN, expectedResult: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: NaN, y: 1, expectedResult: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: NaN, y: 1, expectedResult: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: NaN, y: NaN, expectedResult: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: NaN, y: NaN, expectedResult: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: 1.7976931348623157E+308, y: -1.7976931348623157E+308, expectedResult: -1.7976931348623157E+308) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: 1.7976931348623157E+308, y: -1.7976931348623157E+308, expectedResult: -1.7976931348623157E+308) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -1.7976931348623157E+308, y: 1.7976931348623157E+308, expectedResult: -1.7976931348623157E+308) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -1.7976931348623157E+308, y: 1.7976931348623157E+308, expectedResult: -1.7976931348623157E+308) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: Infinity, y: -Infinity, expectedResult: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: Infinity, y: -Infinity, expectedResult: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: Infinity, y: NaN, expectedResult: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: Infinity, y: NaN, expectedResult: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -2, y: 3, expectedResult: -2) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinNumberTest64(x: -2, y: 3, expectedResult: -2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.ToStringTest32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.RootN32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Ctor_Empty - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Ctor_Empty - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Epsilon - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Epsilon - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinValue - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinValue - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 3.1415926535897931, expectedResult: -0.90268536193307103, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 3.1415926535897931, expectedResult: -0.90268536193307103, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 3, expectedResult: -1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 3, expectedResult: -1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 2.7182818284590451, expectedResult: -0.63325565131481998, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 2.7182818284590451, expectedResult: -0.63325565131481998, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 2.5, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 2.5, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 2.3025850929940459, expectedResult: 0.58119566361426733, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 2.3025850929940459, expectedResult: 0.58119566361426733, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 2, expectedResult: 1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 2, expectedResult: 1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1.5707963267948966, expectedResult: 0.22058404074969809, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1.5707963267948966, expectedResult: 0.22058404074969809, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1.5, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1.5, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1.4426950408889634, expectedResult: -0.17905794598427577, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1.4426950408889634, expectedResult: -0.17905794598427577, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 3.5, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 3.5, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1.4142135623730949, expectedResult: -0.26625534204141549, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1.4142135623730949, expectedResult: -0.26625534204141549, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1, expectedResult: -1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1, expectedResult: -1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.78539816339744828, expectedResult: -0.78121189211048814, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.78539816339744828, expectedResult: -0.78121189211048814, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.70710678118654757, expectedResult: -0.6056998670788134, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.70710678118654757, expectedResult: -0.6056998670788134, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.69314718055994529, expectedResult: -0.5702332487688776, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.69314718055994529, expectedResult: -0.5702332487688776, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.63661977236758138, expectedResult: -0.41614683654714241, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.63661977236758138, expectedResult: -0.41614683654714241, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.5, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.5, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.43429448190325182, expectedResult: 0.20495719432643394, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.43429448190325182, expectedResult: 0.20495719432643394, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.31830988618379069, expectedResult: 0.54030230586813977, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0.31830988618379069, expectedResult: 0.54030230586813977, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0, expectedResult: 1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 0, expectedResult: 1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1.1283791670955126, expectedResult: -0.9197649947685187, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: 1.1283791670955126, expectedResult: -0.9197649947685187, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: Infinity, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.CosPiTest64(value: Infinity, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NaN - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NaN - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSingle(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSingle(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSingle(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSingle(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSingle(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSingle(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSingle(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSingle(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSingle(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToSingle(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Hypot32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.Hypot32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: 1.40129846E-45) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: 1.40129846E-45) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsInfinity(value: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToChar(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToChar(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToChar(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToChar(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToChar(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToChar(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToChar(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToChar(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToChar(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToChar(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: 1.40129846E-45) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: 1.40129846E-45) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNormal(value: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt64ToNFloat(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt64ToNFloat(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt64ToNFloat(value: 5) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt64ToNFloat(value: 5) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt64ToNFloat(value: 42) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt64ToNFloat(value: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt64ToNFloat(value: 127) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt64ToNFloat(value: 127) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt64ToNFloat(value: 255) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt64ToNFloat(value: 255) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.EqualsTest(f1: 789, obj: 789, expected: True) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.EqualsTest(f1: 789, obj: 789, expected: True) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.EqualsTest(f1: 789, obj: -789, expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.EqualsTest(f1: 789, obj: -789, expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.EqualsTest(f1: 789, obj: 0, expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.EqualsTest(f1: 789, obj: 0, expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.EqualsTest(f1: 789, obj: 789, expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.EqualsTest(f1: 789, obj: 789, expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.EqualsTest(f1: 789, obj: "789.0", expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.EqualsTest(f1: 789, obj: "789.0", expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ByteToNFloat(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ByteToNFloat(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ByteToNFloat(value: 5) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ByteToNFloat(value: 5) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ByteToNFloat(value: 42) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ByteToNFloat(value: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ByteToNFloat(value: 127) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ByteToNFloat(value: 127) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.ByteToNFloat(value: 255) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.ByteToNFloat(value: 255) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: 1.40129846E-45) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: 1.40129846E-45) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsNaN(value: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxValue - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxValue - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: NaN, x: NaN, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: NaN, x: NaN, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: Infinity, x: 1, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: Infinity, x: 1, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: Infinity, x: -1, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: Infinity, x: -1, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 1, x: Infinity, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 1, x: Infinity, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 1, x: -Infinity, expectedResult: 1, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 1, x: -Infinity, expectedResult: 1, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: -0.43030121700009227, x: -0.90268536193307103, expectedResult: -0.85840734641020677, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: -0.43030121700009227, x: -0.90268536193307103, expectedResult: -0.85840734641020677, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.77394268526670829, x: -0.63325565131481998, expectedResult: 0.7182818284590452, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.77394268526670829, x: -0.63325565131481998, expectedResult: 0.7182818284590452, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.81376384817462333, x: 0.58119566361426733, expectedResult: 0.30258509299404568, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.81376384817462333, x: 0.58119566361426733, expectedResult: 0.30258509299404568, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: -0.97536797208363135, x: 0.22058404074969809, expectedResult: -0.42920367320510339, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: -0.97536797208363135, x: 0.22058404074969809, expectedResult: -0.42920367320510339, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: -0.98383852942436245, x: -0.17905794598427577, expectedResult: -0.55730495911103661, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: -0.98383852942436245, x: -0.17905794598427577, expectedResult: -0.55730495911103661, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: -0.96390253284987737, x: -0.26625534204141549, expectedResult: -0.58578643762690497, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: -0.96390253284987737, x: -0.26625534204141549, expectedResult: -0.58578643762690497, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: -0.3924695585627842, x: -0.9197649947685187, expectedResult: -0.87162083290448744, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: -0.3924695585627842, x: -0.9197649947685187, expectedResult: -0.87162083290448744, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.62426595263969908, x: -0.78121189211048814, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.62426595263969908, x: -0.78121189211048814, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.79569320156748091, x: -0.6056998670788134, expectedResult: 0.70710678118654757, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.79569320156748091, x: -0.6056998670788134, expectedResult: 0.70710678118654757, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.82148283122563881, x: -0.5702332487688776, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.82148283122563881, x: -0.5702332487688776, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.90929742682568171, x: -0.41614683654714241, expectedResult: 0.63661977236758138, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.90929742682568171, x: -0.41614683654714241, expectedResult: 0.63661977236758138, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 1, x: 0, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 1, x: 0, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 1, x: -0, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 1, x: -0, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.97877093770393309, x: 0.20495719432643394, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.97877093770393309, x: 0.20495719432643394, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.8414709848078965, x: 0.54030230586813977, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0.8414709848078965, x: 0.54030230586813977, expectedResult: 0.31830988618379069, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0, x: 1, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0, x: 1, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0, x: 0, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0, x: 0, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0, x: -0, expectedResult: 1, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0, x: -0, expectedResult: 1, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0, x: -1, expectedResult: 1, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: 0, x: -1, expectedResult: 1, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: Infinity, x: -Infinity, expectedResult: 0.75, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: Infinity, x: -Infinity, expectedResult: 0.75, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: Infinity, x: Infinity, expectedResult: 0.25, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Atan2PiTest(y: Infinity, x: Infinity, expectedResult: 0.25, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -Infinity, y: Infinity, expectedResult: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -Infinity, y: Infinity, expectedResult: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -3, y: 2, expectedResult: 2) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -3, y: 2, expectedResult: 2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: 2, y: -3, expectedResult: 2) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: 2, y: -3, expectedResult: 2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: 0, y: -0, expectedResult: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: 0, y: -0, expectedResult: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -0, y: 0, expectedResult: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -0, y: 0, expectedResult: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: NaN, y: -Infinity, expectedResult: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: NaN, y: -Infinity, expectedResult: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: NaN, y: Infinity, expectedResult: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: NaN, y: Infinity, expectedResult: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: 3, y: -2, expectedResult: 3) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: 3, y: -2, expectedResult: 3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -Infinity, y: NaN, expectedResult: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -Infinity, y: NaN, expectedResult: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: 1, y: NaN, expectedResult: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: 1, y: NaN, expectedResult: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: NaN, y: 1, expectedResult: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: NaN, y: 1, expectedResult: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: NaN, y: NaN, expectedResult: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: NaN, y: NaN, expectedResult: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: 1.7976931348623157E+308, y: -1.7976931348623157E+308, expectedResult: 1.7976931348623157E+308) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: 1.7976931348623157E+308, y: -1.7976931348623157E+308, expectedResult: 1.7976931348623157E+308) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -1.7976931348623157E+308, y: 1.7976931348623157E+308, expectedResult: 1.7976931348623157E+308) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -1.7976931348623157E+308, y: 1.7976931348623157E+308, expectedResult: 1.7976931348623157E+308) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: Infinity, y: -Infinity, expectedResult: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: Infinity, y: -Infinity, expectedResult: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: Infinity, y: NaN, expectedResult: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: Infinity, y: NaN, expectedResult: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -2, y: 3, expectedResult: 3) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MaxNumberTest64(x: -2, y: 3, expectedResult: 3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -Infinity, y: Infinity, expectedResult: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -Infinity, y: Infinity, expectedResult: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -3, y: 2, expectedResult: 2) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -3, y: 2, expectedResult: 2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: 2, y: -3, expectedResult: 2) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: 2, y: -3, expectedResult: 2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: 0, y: -0, expectedResult: -0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: 0, y: -0, expectedResult: -0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -0, y: 0, expectedResult: -0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -0, y: 0, expectedResult: -0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: NaN, y: -Infinity, expectedResult: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: NaN, y: -Infinity, expectedResult: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: NaN, y: Infinity, expectedResult: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: NaN, y: Infinity, expectedResult: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: 3, y: -2, expectedResult: -2) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: 3, y: -2, expectedResult: -2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -Infinity, y: NaN, expectedResult: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -Infinity, y: NaN, expectedResult: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: 1, y: NaN, expectedResult: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: 1, y: NaN, expectedResult: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: NaN, y: 1, expectedResult: 1) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: NaN, y: 1, expectedResult: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: NaN, y: NaN, expectedResult: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: NaN, y: NaN, expectedResult: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: 1.7976931348623157E+308, y: -1.7976931348623157E+308, expectedResult: -1.7976931348623157E+308) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: 1.7976931348623157E+308, y: -1.7976931348623157E+308, expectedResult: -1.7976931348623157E+308) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -1.7976931348623157E+308, y: 1.7976931348623157E+308, expectedResult: -1.7976931348623157E+308) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -1.7976931348623157E+308, y: 1.7976931348623157E+308, expectedResult: -1.7976931348623157E+308) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: Infinity, y: -Infinity, expectedResult: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: Infinity, y: -Infinity, expectedResult: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: Infinity, y: NaN, expectedResult: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: Infinity, y: NaN, expectedResult: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -2, y: 3, expectedResult: -2) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest64(x: -2, y: 3, expectedResult: -2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 3.1415926535897931, expectedResult: 0.47669014603118892, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 3.1415926535897931, expectedResult: 0.47669014603118892, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 3, expectedResult: -0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 3, expectedResult: -0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 2.7182818284590451, expectedResult: -1.2221646718190067, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 2.7182818284590451, expectedResult: -1.2221646718190067, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 2.5, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 2.5, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 2.3025850929940459, expectedResult: 1.4001547140150528, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 2.3025850929940459, expectedResult: 1.4001547140150528, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 2, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 2, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1.5707963267948966, expectedResult: -4.4217522209161286, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1.5707963267948966, expectedResult: -4.4217522209161286, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1.5, expectedResult: -Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1.5, expectedResult: -Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1.4426950408889634, expectedResult: 5.4945259425167299, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1.4426950408889634, expectedResult: 5.4945259425167299, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 3.5, expectedResult: -Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 3.5, expectedResult: -Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1.4142135623730949, expectedResult: 3.6202185671074507, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1.4142135623730949, expectedResult: 3.6202185671074507, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1, expectedResult: -0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1, expectedResult: -0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.78539816339744828, expectedResult: -0.79909939792801821, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.78539816339744828, expectedResult: -0.79909939792801821, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.70710678118654757, expectedResult: -1.3136757077477541, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.70710678118654757, expectedResult: -1.3136757077477541, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.69314718055994529, expectedResult: -1.4406084404920341, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.69314718055994529, expectedResult: -1.4406084404920341, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.63661977236758138, expectedResult: -2.1850398632615189, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.63661977236758138, expectedResult: -2.1850398632615189, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.5, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.5, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.43429448190325182, expectedResult: 4.7754895402454185, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.43429448190325182, expectedResult: 4.7754895402454185, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.31830988618379069, expectedResult: 1.5574077246549023, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0.31830988618379069, expectedResult: 1.5574077246549023, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 0, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1.1283791670955126, expectedResult: 0.42670634433261806, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: 1.1283791670955126, expectedResult: 0.42670634433261806, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: Infinity, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest64(value: Infinity, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.MaxMagnitudeNumberTest32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryNegation(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryNegation(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryNegation(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryNegation(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryNegation(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryNegation(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryNegation(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryNegation(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryNegation(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryNegation(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToByte(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToByte(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToByte(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToByte(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToByte(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToByte(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToByte(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToByte(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToByte(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToByte(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.MinMagnitudeNumberTest32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Modulus(left: -4567, right: 3.1400001) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Modulus(left: -4567, right: 3.1400001) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Modulus(left: -4567.89111, right: 3.14568996) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Modulus(left: -4567.89111, right: 3.14568996) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Modulus(left: 0, right: 3.1400001) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Modulus(left: 0, right: 3.1400001) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Modulus(left: 4567, right: -3.1400001) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Modulus(left: 4567, right: -3.1400001) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Modulus(left: 4567.89111, right: -3.14568996) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Modulus(left: 4567.89111, right: -3.14568996) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThan(left: 789, right: 789) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThan(left: 789, right: 789) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThan(left: 789, right: -789) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThan(left: 789, right: -789) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThan(left: 789, right: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThan(left: 789, right: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThan(left: 789, right: 1000) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_GreaterThan(left: 789, right: 1000) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 3.1415926535897931, expectedResult: -0.43030121700009227, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 3.1415926535897931, expectedResult: -0.43030121700009227, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 3, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 3, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 2.7182818284590451, expectedResult: 0.77394268526670829, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 2.7182818284590451, expectedResult: 0.77394268526670829, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 2.5, expectedResult: 1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 2.5, expectedResult: 1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 2.3025850929940459, expectedResult: 0.81376384817462333, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 2.3025850929940459, expectedResult: 0.81376384817462333, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 2, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 2, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1.5707963267948966, expectedResult: -0.97536797208363135, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1.5707963267948966, expectedResult: -0.97536797208363135, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1.5, expectedResult: -1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1.5, expectedResult: -1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1.4426950408889634, expectedResult: -0.98383852942436245, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1.4426950408889634, expectedResult: -0.98383852942436245, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 3.5, expectedResult: -1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 3.5, expectedResult: -1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1.4142135623730949, expectedResult: -0.96390253284987737, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1.4142135623730949, expectedResult: -0.96390253284987737, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.78539816339744828, expectedResult: 0.62426595263969908, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.78539816339744828, expectedResult: 0.62426595263969908, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.70710678118654757, expectedResult: 0.79569320156748091, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.70710678118654757, expectedResult: 0.79569320156748091, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.69314718055994529, expectedResult: 0.82148283122563881, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.69314718055994529, expectedResult: 0.82148283122563881, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.63661977236758138, expectedResult: 0.90929742682568171, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.63661977236758138, expectedResult: 0.90929742682568171, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.5, expectedResult: 1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.5, expectedResult: 1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.43429448190325182, expectedResult: 0.97877093770393309, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.43429448190325182, expectedResult: 0.97877093770393309, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.31830988618379069, expectedResult: 0.8414709848078965, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0.31830988618379069, expectedResult: 0.8414709848078965, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 0, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1.1283791670955126, expectedResult: -0.3924695585627842, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: 1.1283791670955126, expectedResult: -0.3924695585627842, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: Infinity, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.SinPiTest64(value: Infinity, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryPlus(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryPlus(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryPlus(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryPlus(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryPlus(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryPlus(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryPlus(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryPlus(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryPlus(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_UnaryPlus(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.TanPiTest32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: -5, expectedResult: -0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: -5, expectedResult: -0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 0, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 0, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: -1, expectedResult: 1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: -1, expectedResult: 1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: -2, expectedResult: 1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: -2, expectedResult: 1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: -3, expectedResult: 1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: -3, expectedResult: 1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: -4, expectedResult: 1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: -4, expectedResult: 1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: -5, expectedResult: 1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: -5, expectedResult: 1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 5, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 5, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 4, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 4, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 3, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 3, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 2, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 2, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 1, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 1, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 0, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: 0, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: -1, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: -1, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: -2, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: -2, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: -3, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: -3, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: -4, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: -4, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: -5, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 0, n: -5, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 5, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 5, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 4, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 4, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 3, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 3, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 2, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 2, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 1, expectedResult: 1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 1, expectedResult: 1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 1, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 1, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 2, expectedResult: 1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 2, expectedResult: 1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 4, expectedResult: 1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 4, expectedResult: 1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 3, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 3, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 2, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 2, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 1, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 1, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 0, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 0, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: -1, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: -1, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: -2, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: -2, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: -3, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: -3, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: -4, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: -4, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: -5, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: -5, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 5, expectedResult: 1.2214027581601699, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 5, expectedResult: 1.2214027581601699, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 4, expectedResult: 1.2840254166877414, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 4, expectedResult: 1.2840254166877414, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 3, expectedResult: 1.3956124250860895, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 3, expectedResult: 1.3956124250860895, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 2, expectedResult: 1.6487212707001282, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 2, expectedResult: 1.6487212707001282, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 1, expectedResult: 2.7182818284590451, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 1, expectedResult: 2.7182818284590451, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 0, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: 0, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: -1, expectedResult: 0.36787944117144228, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: -1, expectedResult: 0.36787944117144228, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: -2, expectedResult: 0.60653065971263342, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: -2, expectedResult: 0.60653065971263342, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: -3, expectedResult: 0.71653131057378927, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: -3, expectedResult: 0.71653131057378927, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: -4, expectedResult: 0.77880078307140488, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: -4, expectedResult: 0.77880078307140488, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: -5, expectedResult: 0.81873075307798193, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 2.7182818284590451, n: -5, expectedResult: 0.81873075307798193, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 5, expectedResult: 1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 5, expectedResult: 1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 3, expectedResult: 1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: 1, n: 3, expectedResult: 1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 4, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 4, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 0, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: 0, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: -2, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: -2, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 5, expectedResult: -1.2214027581601699, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 5, expectedResult: -1.2214027581601699, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 4, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 4, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 3, expectedResult: -1.3956124250860895, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 3, expectedResult: -1.3956124250860895, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 2, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 2, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 1, expectedResult: -2.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 1, expectedResult: -2.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 0, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: 0, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: -1, expectedResult: -0.36787944117144228, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: -1, expectedResult: -0.36787944117144228, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: -2, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: -2, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: -3, expectedResult: -0.71653131057378927, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: -3, expectedResult: -0.71653131057378927, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: -4, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: -4, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: -5, expectedResult: -0.81873075307798193, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -2.7182818284590451, n: -5, expectedResult: -0.81873075307798193, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 5, expectedResult: -Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 5, expectedResult: -Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 4, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 4, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 3, expectedResult: -Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 3, expectedResult: -Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 2, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 2, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 1, expectedResult: -Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 1, expectedResult: -Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 0, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: 0, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: -1, expectedResult: -0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: -1, expectedResult: -0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: -2, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: -2, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: -3, expectedResult: -0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: -3, expectedResult: -0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: -4, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -Infinity, n: -4, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: -5, expectedResult: -1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: -5, expectedResult: -1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: -1, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: -1, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: -4, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: -4, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: -2, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: -2, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: -3, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: -3, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: -4, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: -4, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: -5, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: NaN, n: -5, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 5, expectedResult: -0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 5, expectedResult: -0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 4, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 4, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 3, expectedResult: -0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 3, expectedResult: -0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 2, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 2, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 1, expectedResult: -0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 1, expectedResult: -0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 0, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: 0, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: -1, expectedResult: -Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: -1, expectedResult: -Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: -2, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: -2, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: -3, expectedResult: -Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: -3, expectedResult: -Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: -4, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: -4, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: -5, expectedResult: -Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -0, n: -5, expectedResult: -Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 5, expectedResult: -1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 5, expectedResult: -1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 4, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 4, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 3, expectedResult: -1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 3, expectedResult: -1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 2, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 2, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 1, expectedResult: -1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 1, expectedResult: -1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 0, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: 0, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: -1, expectedResult: -1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: -1, expectedResult: -1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: -3, expectedResult: -1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: -1, n: -3, expectedResult: -1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 5, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RootN64(x: Infinity, n: 5, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Size - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Size - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt16ToNFloat(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt16ToNFloat(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt16ToNFloat(value: 5) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt16ToNFloat(value: 5) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt16ToNFloat(value: 42) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt16ToNFloat(value: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt16ToNFloat(value: 127) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt16ToNFloat(value: 127) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt16ToNFloat(value: 255) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt16ToNFloat(value: 255) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUIntPtr(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUIntPtr(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUIntPtr(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUIntPtr(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUIntPtr(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUIntPtr(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUIntPtr(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUIntPtr(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUIntPtr(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUIntPtr(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Ctor_Double - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Ctor_Double - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -Infinity, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -Infinity, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 2.7182818284590451, expectedResult: 6.5808859910179214, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 2.7182818284590451, expectedResult: 6.5808859910179214, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 2.3025850929940459, expectedResult: 4.9334096679145967, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 2.3025850929940459, expectedResult: 4.9334096679145967, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 1.5707963267948966, expectedResult: 2.9706864235520194, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 1.5707963267948966, expectedResult: 2.9706864235520194, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 1.4426950408889634, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 1.4426950408889634, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 1.4142135623730949, expectedResult: 2.6651441426902251, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 1.4142135623730949, expectedResult: 2.6651441426902251, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 1.1283791670955126, expectedResult: 2.186129958328662, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 1.1283791670955126, expectedResult: 2.186129958328662, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 1, expectedResult: 2, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 1, expectedResult: 2, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.78539816339744828, expectedResult: 1.7235679341273495, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.78539816339744828, expectedResult: 1.7235679341273495, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.70710678118654757, expectedResult: 1.6325269194381529, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.70710678118654757, expectedResult: 1.6325269194381529, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.69314718055994529, expectedResult: 1.6168066722416747, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.69314718055994529, expectedResult: 1.6168066722416747, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.63661977236758138, expectedResult: 1.5546822754821001, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.63661977236758138, expectedResult: 1.5546822754821001, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.43429448190325182, expectedResult: 1.3512498725672673, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.43429448190325182, expectedResult: 1.3512498725672673, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.31830988618379069, expectedResult: 1.2468689889006384, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0.31830988618379069, expectedResult: 1.2468689889006384, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0, expectedResult: 1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 0, expectedResult: 1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 3.1415926535897931, expectedResult: 8.8249778270762871, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: 3.1415926535897931, expectedResult: 8.8249778270762871, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.31830988618379069, expectedResult: 0.8020088789614519, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.31830988618379069, expectedResult: 0.8020088789614519, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.43429448190325182, expectedResult: 0.74005557395545174, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.43429448190325182, expectedResult: 0.74005557395545174, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.63661977236758138, expectedResult: 0.64321824193300492, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.63661977236758138, expectedResult: 0.64321824193300492, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.69314718055994529, expectedResult: 0.61850313780157595, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.69314718055994529, expectedResult: 0.61850313780157595, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.70710678118654757, expectedResult: 0.61254732653606592, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.70710678118654757, expectedResult: 0.61254732653606592, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.78539816339744828, expectedResult: 0.5801918103717244, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0.78539816339744828, expectedResult: 0.5801918103717244, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -1, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -1, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -1.1283791670955126, expectedResult: 0.45742934732229695, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -1.1283791670955126, expectedResult: 0.45742934732229695, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -1.4142135623730949, expectedResult: 0.37521422724648179, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -1.4142135623730949, expectedResult: 0.37521422724648179, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -1.4426950408889634, expectedResult: 0.36787944117144233, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -1.4426950408889634, expectedResult: 0.36787944117144233, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -1.5707963267948966, expectedResult: 0.33662253682241905, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -1.5707963267948966, expectedResult: 0.33662253682241905, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -2.3025850929940459, expectedResult: 0.20269956628651731, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -2.3025850929940459, expectedResult: 0.20269956628651731, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -2.7182818284590451, expectedResult: 0.15195522325791297, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -2.7182818284590451, expectedResult: 0.15195522325791297, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -3.1415926535897931, expectedResult: 0.11331473229676087, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -3.1415926535897931, expectedResult: 0.11331473229676087, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0, expectedResult: 1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: -0, expectedResult: 1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: -4567) - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: -4567.89111) - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToIntPtr(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -Infinity, expectedResult: -1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -Infinity, expectedResult: -1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 2.7182818284590451, expectedResult: 5.5808859910179214, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 2.7182818284590451, expectedResult: 5.5808859910179214, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 2.3025850929940459, expectedResult: 3.9334096679145962, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 2.3025850929940459, expectedResult: 3.9334096679145962, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 1.5707963267948966, expectedResult: 1.9706864235520194, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 1.5707963267948966, expectedResult: 1.9706864235520194, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 1.4426950408889634, expectedResult: 1.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 1.4426950408889634, expectedResult: 1.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 1.4142135623730949, expectedResult: 1.6651441426902251, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 1.4142135623730949, expectedResult: 1.6651441426902251, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 1.1283791670955126, expectedResult: 1.1861299583286617, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 1.1283791670955126, expectedResult: 1.1861299583286617, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 1, expectedResult: 1, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 1, expectedResult: 1, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.78539816339744828, expectedResult: 0.72356793412734954, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.78539816339744828, expectedResult: 0.72356793412734954, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.70710678118654757, expectedResult: 0.63252691943815287, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.70710678118654757, expectedResult: 0.63252691943815287, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.69314718055994529, expectedResult: 0.61680667224167463, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.69314718055994529, expectedResult: 0.61680667224167463, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.63661977236758138, expectedResult: 0.55468227548210014, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.63661977236758138, expectedResult: 0.55468227548210014, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.43429448190325182, expectedResult: 0.3512498725672672, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.43429448190325182, expectedResult: 0.3512498725672672, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.31830988618379069, expectedResult: 0.2468689889006383, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0.31830988618379069, expectedResult: 0.2468689889006383, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 0, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 3.1415926535897931, expectedResult: 7.824977827076288, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: 3.1415926535897931, expectedResult: 7.824977827076288, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.31830988618379069, expectedResult: -0.19799112103854805, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.31830988618379069, expectedResult: -0.19799112103854805, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.43429448190325182, expectedResult: -0.2599444260445482, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.43429448190325182, expectedResult: -0.2599444260445482, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.63661977236758138, expectedResult: -0.35678175806699514, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.63661977236758138, expectedResult: -0.35678175806699514, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.69314718055994529, expectedResult: -0.38149686219842405, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.69314718055994529, expectedResult: -0.38149686219842405, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.70710678118654757, expectedResult: -0.38745267346393408, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.70710678118654757, expectedResult: -0.38745267346393408, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.78539816339744828, expectedResult: -0.41980818962827554, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0.78539816339744828, expectedResult: -0.41980818962827554, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -1, expectedResult: -0.5, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -1, expectedResult: -0.5, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -1.1283791670955126, expectedResult: -0.5425706526777031, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -1.1283791670955126, expectedResult: -0.5425706526777031, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -1.4142135623730949, expectedResult: -0.62478577275351821, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -1.4142135623730949, expectedResult: -0.62478577275351821, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -1.4426950408889634, expectedResult: -0.63212055882855767, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -1.4426950408889634, expectedResult: -0.63212055882855767, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -1.5707963267948966, expectedResult: -0.66337746317758095, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -1.5707963267948966, expectedResult: -0.66337746317758095, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -2.3025850929940459, expectedResult: -0.79730043371348269, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -2.3025850929940459, expectedResult: -0.79730043371348269, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -2.7182818284590451, expectedResult: -0.848044776742087, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -2.7182818284590451, expectedResult: -0.848044776742087, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -3.1415926535897931, expectedResult: -0.88668526770323908, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -3.1415926535897931, expectedResult: -0.88668526770323908, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: -0, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp2M1Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.054831135561607541, expectedResult: 3.1415926535897931, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.054831135561607541, expectedResult: 3.1415926535897931, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.052359877559829883, expectedResult: 3, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.052359877559829883, expectedResult: 3, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.047442967903742035, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.047442967903742035, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.043633231299858237, expectedResult: 2.5, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.043633231299858237, expectedResult: 2.5, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.040187691180085916, expectedResult: 2.3025850929940459, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.040187691180085916, expectedResult: 2.3025850929940459, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.034906585039886591, expectedResult: 2, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.034906585039886591, expectedResult: 2, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.027415567780803771, expectedResult: 1.5707963267948966, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.027415567780803771, expectedResult: 1.5707963267948966, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.026179938779914941, expectedResult: 1.5, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.026179938779914941, expectedResult: 1.5, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.025179778565706631, expectedResult: 1.4426950408889634, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.025179778565706631, expectedResult: 1.4426950408889634, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.061086523819801536, expectedResult: 3.5, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.061086523819801536, expectedResult: 3.5, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.024682682989768702, expectedResult: 1.4142135623730949, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.024682682989768702, expectedResult: 1.4142135623730949, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.017453292519943295, expectedResult: 1, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.017453292519943295, expectedResult: 1, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.013707783890401885, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.013707783890401885, expectedResult: 0.78539816339744828, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.012341341494884351, expectedResult: 0.70710678118654746, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.012341341494884351, expectedResult: 0.70710678118654746, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.012097700501686679, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.012097700501686679, expectedResult: 0.69314718055994529, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.011111111111111112, expectedResult: 0.63661977236758127, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.011111111111111112, expectedResult: 0.63661977236758127, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.0087266462599716477, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.0087266462599716477, expectedResult: 0.5, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.0075798686324546746, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.0075798686324546746, expectedResult: 0.43429448190325182, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.0055555555555555566, expectedResult: 0.31830988618379058, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.0055555555555555566, expectedResult: 0.31830988618379058, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.019693931676727953, expectedResult: 1.1283791670955126, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: 0.019693931676727953, expectedResult: 1.1283791670955126, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.RadiansToDegreesTest64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -Infinity, expectedResult: 0, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -Infinity, expectedResult: 0, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 2.7182818284590451, expectedResult: 522.73529967043669, allowedVariance: 8.8817841970012523E-13) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 2.7182818284590451, expectedResult: 522.73529967043669, allowedVariance: 8.8817841970012523E-13) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 2.3025850929940459, expectedResult: 200.71743249053009, allowedVariance: 8.8817841970012523E-13) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 2.3025850929940459, expectedResult: 200.71743249053009, allowedVariance: 8.8817841970012523E-13) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 1.5707963267948966, expectedResult: 37.221710484165165, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 1.5707963267948966, expectedResult: 37.221710484165165, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 1.4426950408889634, expectedResult: 27.713733786437789, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 1.4426950408889634, expectedResult: 27.713733786437789, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 1.4142135623730949, expectedResult: 25.954553519470082, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 1.4142135623730949, expectedResult: 25.954553519470082, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 1.1283791670955126, expectedResult: 13.439377934644401, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 1.1283791670955126, expectedResult: 13.439377934644401, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 1, expectedResult: 10, allowedVariance: 8.8817841970012523E-14) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 1, expectedResult: 10, allowedVariance: 8.8817841970012523E-14) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.78539816339744828, expectedResult: 6.1009598002416938, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.78539816339744828, expectedResult: 6.1009598002416938, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.70710678118654757, expectedResult: 5.0945611704512963, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.70710678118654757, expectedResult: 5.0945611704512963, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.69314718055994529, expectedResult: 4.9334096679145967, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.69314718055994529, expectedResult: 4.9334096679145967, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.63661977236758138, expectedResult: 4.3313150290214528, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.63661977236758138, expectedResult: 4.3313150290214528, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.43429448190325182, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.43429448190325182, expectedResult: 2.7182818284590451, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.31830988618379069, expectedResult: 2.0811811619898575, allowedVariance: 8.8817841970012523E-15) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0.31830988618379069, expectedResult: 2.0811811619898575, allowedVariance: 8.8817841970012523E-15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0, expectedResult: 1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 0, expectedResult: 1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 3.1415926535897931, expectedResult: 1385.4557313670111, allowedVariance: 8.8817841970012523E-12) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: 3.1415926535897931, expectedResult: 1385.4557313670111, allowedVariance: 8.8817841970012523E-12) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: NaN, expectedResult: NaN, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.31830988618379069, expectedResult: 0.48049637305186865, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.31830988618379069, expectedResult: 0.48049637305186865, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.43429448190325182, expectedResult: 0.36787944117144233, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.43429448190325182, expectedResult: 0.36787944117144233, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.63661977236758138, expectedResult: 0.23087676451600056, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.63661977236758138, expectedResult: 0.23087676451600056, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.69314718055994529, expectedResult: 0.20269956628651731, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.69314718055994529, expectedResult: 0.20269956628651731, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.70710678118654757, expectedResult: 0.19628775993505562, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.70710678118654757, expectedResult: 0.19628775993505562, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.78539816339744828, expectedResult: 0.16390863613957665, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0.78539816339744828, expectedResult: 0.16390863613957665, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -1, expectedResult: 0.10000000000000001, allowedVariance: 8.8817841970012523E-16) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -1, expectedResult: 0.10000000000000001, allowedVariance: 8.8817841970012523E-16) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -1.1283791670955126, expectedResult: 0.074408205860642729, allowedVariance: 8.8817841970012528E-17) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -1.1283791670955126, expectedResult: 0.074408205860642729, allowedVariance: 8.8817841970012528E-17) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -1.4142135623730949, expectedResult: 0.038528884700322029, allowedVariance: 8.8817841970012528E-17) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -1.4142135623730949, expectedResult: 0.038528884700322029, allowedVariance: 8.8817841970012528E-17) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -1.4426950408889634, expectedResult: 0.036083192820787209, allowedVariance: 8.8817841970012528E-17) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -1.4426950408889634, expectedResult: 0.036083192820787209, allowedVariance: 8.8817841970012528E-17) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -1.5707963267948966, expectedResult: 0.026866041001136133, allowedVariance: 8.8817841970012528E-17) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -1.5707963267948966, expectedResult: 0.026866041001136133, allowedVariance: 8.8817841970012528E-17) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -2.3025850929940459, expectedResult: 0.0049821282964407207, allowedVariance: 8.8817841970012525E-18) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -2.3025850929940459, expectedResult: 0.0049821282964407207, allowedVariance: 8.8817841970012525E-18) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -2.7182818284590451, expectedResult: 0.0019130141022243175, allowedVariance: 8.8817841970012525E-18) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -2.7182818284590451, expectedResult: 0.0019130141022243175, allowedVariance: 8.8817841970012525E-18) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -3.1415926535897931, expectedResult: 0.00072178415907472773, allowedVariance: 8.8817841970012525E-19) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -3.1415926535897931, expectedResult: 0.00072178415907472773, allowedVariance: 8.8817841970012525E-19) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0, expectedResult: 1, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: -0, expectedResult: 1, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Exp10Test64(value: Infinity, expectedResult: Infinity, allowedVariance: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: -4567, right: 3.1400001) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: -4567, right: 3.1400001) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: -4567.89111, right: 3.14568996) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: -4567.89111, right: 3.14568996) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: 0, right: 3.1400001) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: 0, right: 3.1400001) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: 4567, right: -3.1400001) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: 4567, right: -3.1400001) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: 4567.89111, right: -3.14568996) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: 4567.89111, right: -3.14568996) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Inequality(left: 789, right: 789) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Inequality(left: 789, right: 789) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Inequality(left: 789, right: -789) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Inequality(left: 789, right: -789) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Inequality(left: 789, right: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Inequality(left: 789, right: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.op_Inequality(left: 789, right: 1000) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.op_Inequality(left: 789, right: 1000) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UIntPtrToNFloat(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UIntPtrToNFloat(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UIntPtrToNFloat(value: 5) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UIntPtrToNFloat(value: 5) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UIntPtrToNFloat(value: 42) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UIntPtrToNFloat(value: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UIntPtrToNFloat(value: 127) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UIntPtrToNFloat(value: 127) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UIntPtrToNFloat(value: 255) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UIntPtrToNFloat(value: 255) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.AsinPiTest32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt32(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt32(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt32(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt32(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt32(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt32(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt32(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt32(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt32(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt32(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt64(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt64(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt64(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt64(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt64(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt64(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt64(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt64(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt64(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToUInt64(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Ctor_Float - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Ctor_Float - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: 1.40129846E-45) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: 1.40129846E-45) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: -Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: -Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: Infinity) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: Infinity) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: NaN) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IsSubnormal(value: NaN) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test32 - info: [SKIP] System.Runtime.InteropServices.Tests.NFloatTests.LogP1Test32 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int32ToNFloat(value: -255) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int32ToNFloat(value: -255) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int32ToNFloat(value: -127) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int32ToNFloat(value: -127) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int32ToNFloat(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int32ToNFloat(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int32ToNFloat(value: 127) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int32ToNFloat(value: 127) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.Int32ToNFloat(value: 255) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.Int32ToNFloat(value: 255) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt32ToNFloat(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt32ToNFloat(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt32ToNFloat(value: 5) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt32ToNFloat(value: 5) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt32ToNFloat(value: 42) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt32ToNFloat(value: 42) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt32ToNFloat(value: 127) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt32ToNFloat(value: 127) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.UInt32ToNFloat(value: 255) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.UInt32ToNFloat(value: 255) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IntPtrToNFloat(value: -255) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IntPtrToNFloat(value: -255) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IntPtrToNFloat(value: -127) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IntPtrToNFloat(value: -127) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IntPtrToNFloat(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IntPtrToNFloat(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IntPtrToNFloat(value: 127) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IntPtrToNFloat(value: 127) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.IntPtrToNFloat(value: 255) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.IntPtrToNFloat(value: 255) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDecimal(value: -4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDecimal(value: -4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDecimal(value: -4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDecimal(value: -4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDecimal(value: 0) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDecimal(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDecimal(value: 4567) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDecimal(value: 4567) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDecimal(value: 4567.89111) - info: [PASS] System.Runtime.InteropServices.Tests.NFloatTests.NFloatToDecimal(value: 4567.89111) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SetComObjectDataTests.SetComObjectData_NullKey_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.SetComObjectDataTests.SetComObjectData_NullKey_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SetComObjectDataTests.SetComObjectData_Unix_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.Tests.SetComObjectDataTests.SetComObjectData_Unix_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SetComObjectDataTests.SetComObjectData_NullObj_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.SetComObjectDataTests.SetComObjectData_NullObj_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SetComObjectDataTests.SetComObjectData_NonComObjectObj_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.SetComObjectDataTests.SetComObjectData_NonComObjectObj_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComAliasNameAttributeTests.Ctor_Alias(alias: null) - info: [PASS] System.Runtime.InteropServices.Tests.ComAliasNameAttributeTests.Ctor_Alias(alias: null) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComAliasNameAttributeTests.Ctor_Alias(alias: "") - info: [PASS] System.Runtime.InteropServices.Tests.ComAliasNameAttributeTests.Ctor_Alias(alias: "") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComAliasNameAttributeTests.Ctor_Alias(alias: "value") - info: [PASS] System.Runtime.InteropServices.Tests.ComAliasNameAttributeTests.Ctor_Alias(alias: "value") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComAliasNameAttributeTests.Exists - info: [PASS] System.Runtime.InteropServices.Tests.ComAliasNameAttributeTests.Exists - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.ULongType - info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.ULongType - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.DoubleType - info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.DoubleType - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.UshortType - info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.UshortType - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.GetObjectsForNativeVariants_Unix_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.GetObjectsForNativeVariants_Unix_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.GetObjectsForNativeVariants_NegativeCount_ThrowsArgumentOutOfRangeException - info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.GetObjectsForNativeVariants_NegativeCount_ThrowsArgumentOutOfRangeException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.UIntType - info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.UIntType - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.ShortType - info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.ShortType - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.LongType - info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.LongType - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.ByteType - info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.ByteType - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.GetObjectsForNativeVariants_ZeroPointer_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.GetObjectsForNativeVariants_ZeroPointer_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.FloatType - info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.FloatType - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.SByteType - info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.SByteType - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.IntType - info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectsForNativeVariantsTests.IntType - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CreateWrapperOfTypeTests.CreateWrapperOfType_NullType_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.CreateWrapperOfTypeTests.CreateWrapperOfType_NullType_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CreateWrapperOfTypeTests.CreateWrapperOfType_Unix_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.Tests.CreateWrapperOfTypeTests.CreateWrapperOfType_Unix_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CallingConventionTests.CallingConvention_Get_ReturnsExpected(convention: Winapi, expected: 1) - info: [PASS] System.Runtime.InteropServices.Tests.CallingConventionTests.CallingConvention_Get_ReturnsExpected(convention: Winapi, expected: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CallingConventionTests.CallingConvention_Get_ReturnsExpected(convention: Cdecl, expected: 2) - info: [PASS] System.Runtime.InteropServices.Tests.CallingConventionTests.CallingConvention_Get_ReturnsExpected(convention: Cdecl, expected: 2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CallingConventionTests.CallingConvention_Get_ReturnsExpected(convention: StdCall, expected: 3) - info: [PASS] System.Runtime.InteropServices.Tests.CallingConventionTests.CallingConvention_Get_ReturnsExpected(convention: StdCall, expected: 3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CallingConventionTests.CallingConvention_Get_ReturnsExpected(convention: ThisCall, expected: 4) - info: [PASS] System.Runtime.InteropServices.Tests.CallingConventionTests.CallingConvention_Get_ReturnsExpected(convention: ThisCall, expected: 4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CallingConventionTests.CallingConvention_Get_ReturnsExpected(convention: FastCall, expected: 5) - info: [PASS] System.Runtime.InteropServices.Tests.CallingConventionTests.CallingConvention_Get_ReturnsExpected(convention: FastCall, expected: 5) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_LayoutKind(layoutKind: -1) - info: [PASS] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_LayoutKind(layoutKind: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_LayoutKind(layoutKind: Sequential) - info: [PASS] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_LayoutKind(layoutKind: Sequential) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_LayoutKind(layoutKind: Auto) - info: [PASS] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_LayoutKind(layoutKind: Auto) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_ShortLayoutKind(layoutKind: -1) - info: [PASS] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_ShortLayoutKind(layoutKind: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_ShortLayoutKind(layoutKind: 0) - info: [PASS] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_ShortLayoutKind(layoutKind: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_ShortLayoutKind(layoutKind: 4) - info: [PASS] System.Runtime.InteropServices.Tests.StructLayoutAttributeTests.Ctor_ShortLayoutKind(layoutKind: 4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUni_NullString_ReturnsZero - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUni_NullString_ReturnsZero - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "FooBAðÇR") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "FooBAðÇR") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "├Çnima╠Çl") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "├Çnima╠Çl") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "Test­ÉÁÁTest") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "Test­ÉÁÁTest") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "─░") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "─░") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "­ÉÁÁ­ÉÁÁ­ÉÁÁ") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "­ÉÁÁ­ÉÁÁ­ÉÁÁ") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "za╠åâ╬▓±Å│┐") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "za╠åâ╬▓±Å│┐") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "#%╬á╬ú") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "#%╬á╬ú") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "├à") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "├à") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "ee├íeeÞÇÇ├íe­ÉÇÇÞÇÇ├íeee") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "ee├íeeÞÇÇ├íe­ÉÇÇÞÇÇ├íeee") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "┬ñ├ÉaR|{AnGe┬ú┬ñ") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "┬ñ├ÉaR|{AnGe┬ú┬ñ") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "­ÉÇÇ­ÉÇÇ­ÉÇÇ") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "­ÉÇÇ­ÉÇÇ­ÉÇÇ") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "­ÉÇÇe­ÉÇÇ") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "­ÉÇÇe­ÉÇÇ") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "") - info: [PASS] System.Runtime.InteropServices.Tests.StringToCoTaskMemUTF8Tests.StringToCoTaskMemUTF8_PtrToStringUTF8_Roundtrips(s: "") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_ShortUnmanagedType(umanagedType: -1) - info: [PASS] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_ShortUnmanagedType(umanagedType: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_ShortUnmanagedType(umanagedType: 47) - info: [PASS] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_ShortUnmanagedType(umanagedType: 47) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_ShortUnmanagedType(umanagedType: 32767) - info: [PASS] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_ShortUnmanagedType(umanagedType: 32767) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_UmanagedTye(unmanagedType: -1) - info: [PASS] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_UmanagedTye(unmanagedType: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_UmanagedTye(unmanagedType: HString) - info: [PASS] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_UmanagedTye(unmanagedType: HString) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_UmanagedTye(unmanagedType: 2147483647) - info: [PASS] System.Runtime.InteropServices.Tests.MarshalAsAttributeTests.Ctor_UmanagedTye(unmanagedType: 2147483647) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeIdentifierAttributetests.Ctor_Scope_Identifier(scope: null, identifier: null) - info: [PASS] System.Runtime.InteropServices.Tests.TypeIdentifierAttributetests.Ctor_Scope_Identifier(scope: null, identifier: null) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeIdentifierAttributetests.Ctor_Scope_Identifier(scope: "scope", identifier: "identifier") - info: [PASS] System.Runtime.InteropServices.Tests.TypeIdentifierAttributetests.Ctor_Scope_Identifier(scope: "scope", identifier: "identifier") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeIdentifierAttributetests.Ctor_Default - info: [PASS] System.Runtime.InteropServices.Tests.TypeIdentifierAttributetests.Ctor_Default - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalContextTests.Cancel_Roundtrips - info: [PASS] System.Tests.PosixSignalContextTests.Cancel_Roundtrips - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalContextTests.Constructor(value: SIGINT) - info: [PASS] System.Tests.PosixSignalContextTests.Constructor(value: SIGINT) - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalContextTests.Constructor(value: 0) - info: [PASS] System.Tests.PosixSignalContextTests.Constructor(value: 0) - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalContextTests.Constructor(value: 1000) - info: [PASS] System.Tests.PosixSignalContextTests.Constructor(value: 1000) - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalContextTests.Constructor(value: -1000) - info: [PASS] System.Tests.PosixSignalContextTests.Constructor(value: -1000) - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.SignalHandlerCalledForRawSignals - info: [SKIP] System.Tests.PosixSignalRegistrationTests.SignalHandlerCalledForRawSignals - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_UninstallableSignal_Throws - info: [SKIP] System.Tests.PosixSignalRegistrationTests.Create_UninstallableSignal_Throws - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_ValidSignal_Success - info: [SKIP] System.Tests.PosixSignalRegistrationTests.Create_ValidSignal_Success - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.SignalHandlerNotCalledWhenDisposed - info: [SKIP] System.Tests.PosixSignalRegistrationTests.SignalHandlerNotCalledWhenDisposed - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.SignalCanCancelTermination - info: [SKIP] System.Tests.PosixSignalRegistrationTests.SignalCanCancelTermination - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.SignalHandlerCalledForKnownSignals - info: [SKIP] System.Tests.PosixSignalRegistrationTests.SignalHandlerCalledForKnownSignals - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGTSTP) - info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGTSTP) - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGTTOU) - info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGTTOU) - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGTTIN) - info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGTTIN) - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGWINCH) - info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGWINCH) - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGCONT) - info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGCONT) - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGCHLD) - info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGCHLD) - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGTERM) - info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGTERM) - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGQUIT) - info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGQUIT) - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGINT) - info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGINT) - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGHUP) - info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: SIGHUP) - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: 0) - info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: 0) - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: -1000) - info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: -1000) - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: 1000) - info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_InvalidSignal_Throws(signal: 1000) - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_RegisterForMultipleSignalsMultipletimes_Success - info: [SKIP] System.Tests.PosixSignalRegistrationTests.Create_RegisterForMultipleSignalsMultipletimes_Success - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.Dispose_Idempotent - info: [SKIP] System.Tests.PosixSignalRegistrationTests.Dispose_Idempotent - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.SignalHandlerNotCalledWhenFinalized - info: [SKIP] System.Tests.PosixSignalRegistrationTests.SignalHandlerNotCalledWhenFinalized - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.SignalHandlerWorksForSecondRegistration - info: [SKIP] System.Tests.PosixSignalRegistrationTests.SignalHandlerWorksForSecondRegistration - info: Collecting garbage after test... - info: [STRT] System.Tests.PosixSignalRegistrationTests.Create_NullHandler_Throws - info: [PASS] System.Tests.PosixSignalRegistrationTests.Create_NullHandler_Throws - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComDefaultInterfaceAttributeTests.Ctor_DefaultInterface(defaultInterface: null) - info: [PASS] System.Runtime.InteropServices.Tests.ComDefaultInterfaceAttributeTests.Ctor_DefaultInterface(defaultInterface: null) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComDefaultInterfaceAttributeTests.Ctor_DefaultInterface(defaultInterface: typeof(int)) - info: [PASS] System.Runtime.InteropServices.Tests.ComDefaultInterfaceAttributeTests.Ctor_DefaultInterface(defaultInterface: typeof(int)) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterface1_SourceInterfaceType2_SourceInterfaceType3 - info: [PASS] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterface1_SourceInterfaceType2_SourceInterfaceType3 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterface1 - info: [PASS] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterface1 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterface1_SourceInterfaceType2 - info: [PASS] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterface1_SourceInterfaceType2 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterface1_SourceInterfaceType2_SourceInterfaceType3_SourceInterfaceType4 - info: [PASS] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterface1_SourceInterfaceType2_SourceInterfaceType3_SourceInterfaceType4 - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_NullSourceInterfaceType4_ThrowsNullReferenceException - info: [PASS] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_NullSourceInterfaceType4_ThrowsNullReferenceException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_NullSourceInterfaceType2_ThrowsNullReferenceException - info: [PASS] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_NullSourceInterfaceType2_ThrowsNullReferenceException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterfaces(sourceInterfaces: null) - info: [PASS] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterfaces(sourceInterfaces: null) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterfaces(sourceInterfaces: "SourceInterfaces") - info: [PASS] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_SourceInterfaces(sourceInterfaces: "SourceInterfaces") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_NullSourceInterfaceType3_ThrowsNullReferenceException - info: [PASS] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_NullSourceInterfaceType3_ThrowsNullReferenceException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_NullSourceInterfaceType1_ThrowsNullReferenceException - info: [PASS] System.Runtime.InteropServices.Tests.ComSourceInterfacesAttributeTests.Ctor_NullSourceInterfaceType1_ThrowsNullReferenceException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_NullString_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_NullString_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pizza") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pizza") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pepperoni") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "pepperoni") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "password") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "password") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "P4ssw0rdAa1") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "P4ssw0rdAa1") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "ßê┤") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "ßê┤") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "´┐¢´┐¢") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "´┐¢´┐¢") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "­ÉÇÇ") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "­ÉÇÇ") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "\0") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "\0") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "abc\0def") - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_InvokePtrToStringAnsi_Roundtrips(s: "abc\0def") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_DisposedString_ThrowsObjectDisposedException - info: [PASS] System.Runtime.InteropServices.Tests.SecureStringToCoTaskMemAnsiTests.SecureStringToCoTaskMemAnsi_DisposedString_ThrowsObjectDisposedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibImportClassAttributeTests.Ctor_NullImportClass_ThrowsNullReferenceException - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibImportClassAttributeTests.Ctor_NullImportClass_ThrowsNullReferenceException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.TypeLibImportClassAttributeTests.Ctor_ImportClass - info: [PASS] System.Runtime.InteropServices.Tests.TypeLibImportClassAttributeTests.Ctor_ImportClass - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.LibraryImportAttributeTests.Ctor(libraryName: null) - info: [PASS] System.Runtime.InteropServices.Tests.LibraryImportAttributeTests.Ctor(libraryName: null) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.LibraryImportAttributeTests.Ctor(libraryName: "LibraryName") - info: [PASS] System.Runtime.InteropServices.Tests.LibraryImportAttributeTests.Ctor(libraryName: "LibraryName") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregateObject_ZeroPointer_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregateObject_ZeroPointer_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregatedObject_NonGeneric_ReturnsExpected - info: [SKIP] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregatedObject_NonGeneric_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregatedObject_Unix_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregatedObject_Unix_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregatedObject_AlreadyHasContainer_ThrowsArgumentException - info: [SKIP] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregatedObject_AlreadyHasContainer_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregateObject_NullObject_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregateObject_NullObject_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregatedObject_Generic_ReturnsExpected - info: [SKIP] System.Runtime.InteropServices.Tests.CreateAggregatedObjectTests.CreateAggregatedObject_Generic_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.AddRemove_AcrossMultipleGenerations_Success - info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.AddRemove_AcrossMultipleGenerations_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold_MaximumThreshold(name: null, initialThreshold: 0, maximumThreshold: 0) - info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold_MaximumThreshold(name: null, initialThreshold: 0, maximumThreshold: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold_MaximumThreshold(name: "", initialThreshold: 10, maximumThreshold: 15) - info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold_MaximumThreshold(name: "", initialThreshold: 10, maximumThreshold: 15) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold_MaximumThreshold(name: "InitialThreshold", initialThreshold: 1, maximumThreshold: 2) - info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold_MaximumThreshold(name: "InitialThreshold", initialThreshold: 1, maximumThreshold: 2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Ctor_NegativeMaximumThreshold_ThrowsArgumentOutOfRangeException - info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Ctor_NegativeMaximumThreshold_ThrowsArgumentOutOfRangeException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Add_Overflows_ThrowsInvalidOperationException - info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Add_Overflows_ThrowsInvalidOperationException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.TestHandleCollector - info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.TestHandleCollector - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Ctor_InitialThresholdGreaterThanMaximumThreshold_ThrowsArgumentException - info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Ctor_InitialThresholdGreaterThanMaximumThreshold_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold(name: null, initialThreshold: 0) - info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold(name: null, initialThreshold: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold(name: "", initialThreshold: 10) - info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold(name: "", initialThreshold: 10) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold(name: "InitialThreshold", initialThreshold: 2147483647) - info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Ctor_Name_InitialThreshold(name: "InitialThreshold", initialThreshold: 2147483647) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Remove_EmptyCollection_ThrowsInvalidOperationException - info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Remove_EmptyCollection_ThrowsInvalidOperationException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.HandleCollectorTests.Ctor_NegativeInitialThreshold_ThrowsArgumentOufORangeException - info: [PASS] System.Runtime.InteropServices.HandleCollectorTests.Ctor_NegativeInitialThreshold_ThrowsArgumentOufORangeException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ZeroFreeGlobalAllocAnsiTests.ZeroFreeGlobalAllocAnsi_Zero_Nop - info: [PASS] System.Runtime.InteropServices.Tests.ZeroFreeGlobalAllocAnsiTests.ZeroFreeGlobalAllocAnsi_Zero_Nop - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ZeroFreeGlobalAllocAnsiTests.ZeroFreeGlobalAllocAnsi_ValidPointer_Success - info: [PASS] System.Runtime.InteropServices.Tests.ZeroFreeGlobalAllocAnsiTests.ZeroFreeGlobalAllocAnsi_ValidPointer_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetEndComSlotTests.GetEndComSlot_InvalidGenericType_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.GetEndComSlotTests.GetEndComSlot_InvalidGenericType_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetEndComSlotTests.GetEndComSlot_Unix_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.Tests.GetEndComSlotTests.GetEndComSlot_Unix_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetEndComSlotTests.GetEndComSlot_NullType_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.GetEndComSlotTests.GetEndComSlot_NullType_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetEndComSlotTests.GetEndComSlot_NotComVisibleType_ThrowsArgumentException - info: [SKIP] System.Runtime.InteropServices.Tests.GetEndComSlotTests.GetEndComSlot_NotComVisibleType_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetEndComSlotTests.GetEndComSlot_NotRuntimeType_ThrowsArgumentException - info: [SKIP] System.Runtime.InteropServices.Tests.GetEndComSlotTests.GetEndComSlot_NotRuntimeType_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ChangeWrapperHandleStrengthTests.ChangeWrapperHandleStrength_NullObject_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.ChangeWrapperHandleStrengthTests.ChangeWrapperHandleStrength_NullObject_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ChangeWrapperHandleStrengthTests.ChangeWrapperHandleStrength_ValidObject_Success - info: [SKIP] System.Runtime.InteropServices.Tests.ChangeWrapperHandleStrengthTests.ChangeWrapperHandleStrength_ValidObject_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ChangeWrapperHandleStrengthTests.ChangeWrapperHandleStrength_Unix_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.Tests.ChangeWrapperHandleStrengthTests.ChangeWrapperHandleStrength_Unix_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ZeroFreeCoTaskMemUnicodeTests.ZeroFreeCoTaskMemUnicode_Zero_Nop - info: [PASS] System.Runtime.InteropServices.Tests.ZeroFreeCoTaskMemUnicodeTests.ZeroFreeCoTaskMemUnicode_Zero_Nop - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ZeroFreeCoTaskMemUnicodeTests.ZeroFreeCoTaskMemUnicode_ValidPointer_Success - info: [PASS] System.Runtime.InteropServices.Tests.ZeroFreeCoTaskMemUnicodeTests.ZeroFreeCoTaskMemUnicode_ValidPointer_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.UnmanagedFunctionPointerAttributeTests.Ctor_CallingConvention(callingConvention: -1) - info: [PASS] System.Runtime.InteropServices.Tests.UnmanagedFunctionPointerAttributeTests.Ctor_CallingConvention(callingConvention: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.UnmanagedFunctionPointerAttributeTests.Ctor_CallingConvention(callingConvention: Cdecl) - info: [PASS] System.Runtime.InteropServices.Tests.UnmanagedFunctionPointerAttributeTests.Ctor_CallingConvention(callingConvention: Cdecl) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.UnmanagedFunctionPointerAttributeTests.Ctor_CallingConvention(callingConvention: 2147483647) - info: [PASS] System.Runtime.InteropServices.Tests.UnmanagedFunctionPointerAttributeTests.Ctor_CallingConvention(callingConvention: 2147483647) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.BestFitMappingAttributeTests.Ctor_BestFitMapping(bestFitMapping: True) - info: [PASS] System.Runtime.InteropServices.Tests.BestFitMappingAttributeTests.Ctor_BestFitMapping(bestFitMapping: True) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.BestFitMappingAttributeTests.Ctor_BestFitMapping(bestFitMapping: False) - info: [PASS] System.Runtime.InteropServices.Tests.BestFitMappingAttributeTests.Ctor_BestFitMapping(bestFitMapping: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.FieldOffsetAttributeTests.Ctor_Value(offset: -1) - info: [PASS] System.Runtime.InteropServices.FieldOffsetAttributeTests.Ctor_Value(offset: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.FieldOffsetAttributeTests.Ctor_Value(offset: 0) - info: [PASS] System.Runtime.InteropServices.FieldOffsetAttributeTests.Ctor_Value(offset: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.FieldOffsetAttributeTests.Ctor_Value(offset: 1) - info: [PASS] System.Runtime.InteropServices.FieldOffsetAttributeTests.Ctor_Value(offset: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NullObject_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NullObject_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NonGenericWithValidClass_ReturnsExpected - info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NonGenericWithValidClass_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NonGenericWithValidStruct_ReturnsExpected - info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NonGenericWithValidStruct_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_InvalidType_ThrowsArgumentException - info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_InvalidType_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetTypedObjectForIUnknown_UncastableType_ThrowsInvalidCastException - info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetTypedObjectForIUnknown_UncastableType_ThrowsInvalidCastException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_Unix_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_Unix_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_GenericWithValidStruct_ReturnsExpected - info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_GenericWithValidStruct_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NonGenericCustomQueryInterfaceModeWithValidStruct_ReturnsExpected - info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NonGenericCustomQueryInterfaceModeWithValidStruct_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NonGenericCustomQueryInterfaceModeWithValidClass_ReturnsExpected - info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NonGenericCustomQueryInterfaceModeWithValidClass_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_InvalidObject_ThrowsArgumentException - info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_InvalidObject_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NullType_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_NullType_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_GenericWithValidClass_ReturnsExpected - info: [SKIP] System.Runtime.InteropServices.Tests.GetComInterfaceForObjectTests.GetComInterfaceForObject_GenericWithValidClass_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.Int64Tests.WriteInt64_Pointer_Roundtrips(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) - info: [PASS] System.Runtime.InteropServices.Tests.Int64Tests.WriteInt64_Pointer_Roundtrips(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ThrowExceptionForHRTests.ThrowExceptionForHR_InvalidHR_Nop(errorCode: 0) - info: [PASS] System.Runtime.InteropServices.Tests.ThrowExceptionForHRTests.ThrowExceptionForHR_InvalidHR_Nop(errorCode: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ThrowExceptionForHRTests.ThrowExceptionForHR_InvalidHR_Nop(errorCode: 1) - info: [PASS] System.Runtime.InteropServices.Tests.ThrowExceptionForHRTests.ThrowExceptionForHR_InvalidHR_Nop(errorCode: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException - info: [PASS] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_NegativeStartIndex_ThrowsArgumentOutOfRangeException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_NullDestination_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_NullSource_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_NullSource_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) - info: [PASS] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 0, length: 11) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) - info: [PASS] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 11, length: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) - info: [PASS] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_InvalidStartIndexLength_ThrowsArgumentOutOfRangeException(startIndex: 2, length: 10) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException - info: [PASS] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_NegativeLength_ThrowsArgumentOutOfRangeException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) - info: [PASS] System.Runtime.InteropServices.Tests.Int32ArrayTests.CopyTo_Roundtrip_MatchesOriginalInput(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 0) - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 1) - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 65538) - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 65538) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 65539) - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 65539) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 65556) - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 65556) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 65565) - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: 65565) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: -2147467263) - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: -2147467263) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: -2147467259) - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: -2147467259) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: -2147024809) - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: -2147024809) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: -2147418113) - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.LastPInvokeErrorMessage_Returns_Correct_Message(error: -2147418113) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 0) - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 1) - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 65538) - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 65538) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 65539) - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 65539) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 65556) - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 65556) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 65565) - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: 65565) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: -2147467263) - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: -2147467263) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: -2147467259) - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: -2147467259) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: -2147024809) - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: -2147024809) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: -2147418113) - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_Win32Exception_Message(error: -2147418113) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_UniqueMessage_Unix - info: [PASS] System.Runtime.InteropServices.Tests.PInvokeErrorMessageTests.PInvokeErrorMessage_Returns_UniqueMessage_Unix - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.Int32Tests.WriteInt32_Pointer_Roundtrips(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) - info: [PASS] System.Runtime.InteropServices.Tests.Int32Tests.WriteInt32_Pointer_Roundtrips(values: [0, 1, 2, 3, 4, ┬À┬À┬À]) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.FreeCoTaskMemTests.FreeCoTaskMem_Zero_Nop - info: [PASS] System.Runtime.InteropServices.Tests.FreeCoTaskMemTests.FreeCoTaskMem_Zero_Nop - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.FreeCoTaskMemTests.FreeCoTaskMem_ValidPointer_Success - info: [PASS] System.Runtime.InteropServices.Tests.FreeCoTaskMemTests.FreeCoTaskMem_ValidPointer_Success - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.IsComObjectTests.IsComObject_NullObject_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.IsComObjectTests.IsComObject_NullObject_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.IsComObjectTests.IsComObject_NonComObject_ReturnsFalse - info: [SKIP] System.Runtime.InteropServices.Tests.IsComObjectTests.IsComObject_NonComObject_ReturnsFalse - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetComObjectDataTests.GetComObjectData_NullKey_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.GetComObjectDataTests.GetComObjectData_NullKey_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetComObjectDataTests.GetComObjectData_Unix_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.Tests.GetComObjectDataTests.GetComObjectData_Unix_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetComObjectDataTests.GetComObjectData_NullObj_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.GetComObjectDataTests.GetComObjectData_NullObj_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetComObjectDataTests.GetComObjectData_NonComObjectObj_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.GetComObjectDataTests.GetComObjectData_NonComObjectObj_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetStartComSlotTests.GetStartComSlot_InvalidGenericType_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.GetStartComSlotTests.GetStartComSlot_InvalidGenericType_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetStartComSlotTests.GetStartComSlot_Unix_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.Tests.GetStartComSlotTests.GetStartComSlot_Unix_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetStartComSlotTests.GetStartComSlot_NullType_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.GetStartComSlotTests.GetStartComSlot_NullType_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetStartComSlotTests.GetStartComSlot_NotComVisibleType_ThrowsArgumentException - info: [SKIP] System.Runtime.InteropServices.Tests.GetStartComSlotTests.GetStartComSlot_NotComVisibleType_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetStartComSlotTests.GetStartComSlot_NotRuntimeType_ThrowsArgumentException - info: [SKIP] System.Runtime.InteropServices.Tests.GetStartComSlotTests.GetStartComSlot_NotRuntimeType_ThrowsArgumentException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVisibleAttributeTests.Ctor_Visible - info: [SKIP] System.Runtime.InteropServices.Tests.ComVisibleAttributeTests.Ctor_Visible - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.ComVisibleAttributeTests.Exists - info: [SKIP] System.Runtime.InteropServices.Tests.ComVisibleAttributeTests.Exists - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: 789, expected: True) - info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: 789, expected: True) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: -789, expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: -789, expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: 0, expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: 0, expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 0, obj: 0, expected: True) - info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 0, obj: 0, expected: True) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: -789, obj: -789, expected: True) - info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: -789, obj: -789, expected: True) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: -789, obj: 789, expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: -789, obj: 789, expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: null, expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: null, expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: "789", expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: "789", expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: 789, expected: False) - info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.EqualsTest(clong: 789, obj: 789, expected: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.Ctor_Int - info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.Ctor_Int - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.Ctor_NInt - info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.Ctor_NInt - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.ToStringTest(value: -2147483648, expected: "-2147483648") - info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.ToStringTest(value: -2147483648, expected: "-2147483648") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.ToStringTest(value: -4567, expected: "-4567") - info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.ToStringTest(value: -4567, expected: "-4567") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.ToStringTest(value: 0, expected: "0") - info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.ToStringTest(value: 0, expected: "0") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.ToStringTest(value: 4567, expected: "4567") - info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.ToStringTest(value: 4567, expected: "4567") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.ToStringTest(value: 2147483647, expected: "2147483647") - info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.ToStringTest(value: 2147483647, expected: "2147483647") - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.Size - info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.Size - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.Ctor_NInt_OutOfRange - info: [SKIP] System.Runtime.InteropServices.Tests.CLongTests.Ctor_NInt_OutOfRange - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.Ctor_Empty - info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.Ctor_Empty - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.CLongTests.Ctor_NInt_LargeValue - info: [PASS] System.Runtime.InteropServices.Tests.CLongTests.Ctor_NInt_LargeValue - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DefaultDllImportSearchPathsAttributeTests.Ctor_Paths(paths: -1) - info: [PASS] System.Runtime.InteropServices.Tests.DefaultDllImportSearchPathsAttributeTests.Ctor_Paths(paths: -1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DefaultDllImportSearchPathsAttributeTests.Ctor_Paths(paths: AssemblyDirectory) - info: [PASS] System.Runtime.InteropServices.Tests.DefaultDllImportSearchPathsAttributeTests.Ctor_Paths(paths: AssemblyDirectory) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.DefaultDllImportSearchPathsAttributeTests.Ctor_Paths(paths: 2147483647) - info: [PASS] System.Runtime.InteropServices.Tests.DefaultDllImportSearchPathsAttributeTests.Ctor_Paths(paths: 2147483647) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetObjectForIUnknownTests.GetObjectForIUnknown_Unix_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.Tests.GetObjectForIUnknownTests.GetObjectForIUnknown_Unix_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetObjectForIUnknownTests.GetObjectForIUnknown_ValidPointer_ReturnsExpected - info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectForIUnknownTests.GetObjectForIUnknown_ValidPointer_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetObjectForIUnknownTests.GetObjectForIUnknown_NullPointer_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.GetObjectForIUnknownTests.GetObjectForIUnknown_NullPointer_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetUniqueObjectForIUnknownTests.GetUniqueObjectForIUnknown_Unix_ThrowsPlatformNotSupportedException - info: [PASS] System.Runtime.InteropServices.Tests.GetUniqueObjectForIUnknownTests.GetUniqueObjectForIUnknown_Unix_ThrowsPlatformNotSupportedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetUniqueObjectForIUnknownTests.GetUniqueObjectForIUnknown_ValidPointer_ReturnsExpected - info: [SKIP] System.Runtime.InteropServices.Tests.GetUniqueObjectForIUnknownTests.GetUniqueObjectForIUnknown_ValidPointer_ReturnsExpected - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.GetUniqueObjectForIUnknownTests.GetUniqueObjectForIUnknown_NullPointer_ThrowsArgumentNullException - info: [SKIP] System.Runtime.InteropServices.Tests.GetUniqueObjectForIUnknownTests.GetUniqueObjectForIUnknown_NullPointer_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentOutOfRangeException - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentOutOfRangeException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.AcquirePointer_NotInitialized_ThrowsInvalidOperationException - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.AcquirePointer_NotInitialized_ThrowsInvalidOperationException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReleasePointer_NotInitialized_ThrowsInvalidOperationException - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReleasePointer_NotInitialized_ThrowsInvalidOperationException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 0, index: 1, count: 0) - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 0, index: 1, count: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 0, index: 0, count: 1) - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 0, index: 0, count: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 2, index: 3, count: 0) - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 2, index: 3, count: 0) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 2, index: 2, count: 1) - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 2, index: 2, count: 1) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 2, index: 1, count: 2) - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 2, index: 1, count: 2) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 2, index: 0, count: 3) - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NegativeCount_ThrowsArgumentException(arrayLength: 2, index: 0, count: 3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWrite_RoundTrip - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWrite_RoundTrip - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadArray_NullArray_ThrowsArgumentNullException - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadArray_NullArray_ThrowsArgumentNullException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.AcquirePointer_Disposed_ThrowsObjectDisposedException - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.AcquirePointer_Disposed_ThrowsObjectDisposedException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteSpan_EmptySpan_Passes - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteSpan_EmptySpan_Passes - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWrite_NotInitialized_ThrowsInvalidOperationException - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWrite_NotInitialized_ThrowsInvalidOperationException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ByteLength_GetNotInitialized_ThrowsInvalidOperationException - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ByteLength_GetNotInitialized_ThrowsInvalidOperationException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteSpanArray_RoundTrip - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteSpanArray_RoundTrip - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.Initialize_NumBytesTimesSizeOfEachElement_ThrowsArgumentOutOfRangeExceptionIfNot64Bit - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.Initialize_NumBytesTimesSizeOfEachElement_ThrowsArgumentOutOfRangeExceptionIfNot64Bit - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWrite_NotEnoughSpaceInBuffer_ThrowsArgumentException(byteOffset: 4) - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWrite_NotEnoughSpaceInBuffer_ThrowsArgumentException(byteOffset: 4) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWrite_NotEnoughSpaceInBuffer_ThrowsArgumentException(byteOffset: 3) - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWrite_NotEnoughSpaceInBuffer_ThrowsArgumentException(byteOffset: 3) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWrite_NotEnoughSpaceInBuffer_ThrowsArgumentException(byteOffset: 18446744073709551615) - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWrite_NotEnoughSpaceInBuffer_ThrowsArgumentException(byteOffset: 18446744073709551615) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NotInitialized_ThrowsInvalidOperationException - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadWriteArray_NotInitialized_ThrowsInvalidOperationException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.Ctor_Bool(ownsHandle: True) - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.Ctor_Bool(ownsHandle: True) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.Ctor_Bool(ownsHandle: False) - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.Ctor_Bool(ownsHandle: False) - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadArray_NegativeIndex_ThrowsArgumentOutOfRangeException - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.ReadArray_NegativeIndex_ThrowsArgumentOutOfRangeException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.SafeBufferTests.Initialize_InvalidNumBytes_ThrowsArgumentOutOfRangeException - info: [PASS] System.Runtime.InteropServices.Tests.SafeBufferTests.Initialize_InvalidNumBytes_ThrowsArgumentOutOfRangeException - info: Collecting garbage after test... - info: [STRT] System.Runtime.InteropServices.Tests.OffsetOfTests.OffsetOf_NoSuchFieldName_ThrowsArgumentException - fail: MONO_WASM: null function or function signature mismatch - RuntimeError: null function or function signature mismatch - at do_icall (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[251]:0x2e604) - at do_icall_wrapper (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[103]:0x2672e) - at mono_interp_exec_method (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[91]:0x9a99) - at interp_runtime_invoke (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[89]:0x7d9e) - at mono_jit_runtime_invoke (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[7470]:0x3cac33) - at do_runtime_invoke (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[5413]:0x2e3d34) - at mono_runtime_invoke_checked (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[5410]:0x2e38f5) - at mono_runtime_try_invoke_byrefs (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[5568]:0x2f99de) - at ves_icall_InternalInvoke (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[3982]:0x228ded) - at ves_icall_InternalInvoke_raw (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[4204]:0x248217) - at do_icall (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[251]:0x2f393) - at do_icall_wrapper (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[103]:0x2672e) - at mono_interp_exec_method (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[91]:0x9a99) - at interp_entry (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[202]:0x2b746) - at interp_entry_static_0 (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[232]:0x2c35a) - at wasm_native_to_interp_System_Private_CoreLib_System_Threading_ThreadPool_BackgroundJobHandler (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[10572]:0x4e3c6a) - at mono_background_exec (http://127.0.0.1:63289/_framework/dotnet.native.wasm:wasm-function[1321]:0x98528) - at wf. (http://127.0.0.1:63289/_framework/dotnet.runtime.js:182:24) - at mono_background_exec_until_done (http://127.0.0.1:63289/_framework/dotnet.runtime.js:2709:29) - at callUserCallback (http://127.0.0.1:63289/_framework/dotnet.native.js:7053:9) - at http://127.0.0.1:63289/_framework/dotnet.native.js:7073:9 - fail: Aborted(Assertion failed) - fail: [out of order message from the browser]: http://127.0.0.1:63289/_framework/dotnet.native.js 70:2 Uncaught RuntimeError: null function or function signature mismatch - fail: [out of order message from the browser]: http://127.0.0.1:63289/_framework/dotnet.native.wasm 0:5126439 Uncaught RuntimeError: unreachable - info: WASM EXIT 1 - dbug: Reached wasm exit - dbug: Reading console messages from websocket stopped - info: Waiting to flush log messages with a timeout of 120 secs .. - trce: Looking for `tests_done` element, to get the exit code - fail: Application has finished with exit code TESTS_FAILED but 0 was expected - info: Closing 1 browser tabs before setting the main tab to config page and quitting. - XHarness exit code: 71 (GENERAL_FAILURE) - ----- end 11/09/2025 11:28:08.44 ----- exit code 71 ---------------------------------------------------------- - XHarness artifacts: C:\xr_dev\dotnetFork\runtime\artifacts\bin\System.Runtime.InteropServices.Tests\Debug\net10.0-browser\browser-wasm\AppBundle\xharness-output -C:\xr_dev\dotnetFork\runtime\eng\testing\tests.targets(193,5): error : One or more tests failed while running tests from 'System.Runtime.InteropServices.Tests'. [C:\xr_dev\dotnetFork\runtime\src\libraries\System.Runtime.InteropServices\tests\System.Runtime.InteropServices.UnitTests\System.Runtime.InteropServices.Tests.csproj::TargetFramework=net10.0-browser] - -Build FAILED. - -C:\xr_dev\dotnetFork\runtime\eng\testing\tests.targets(193,5): error : One or more tests failed while running tests from 'System.Runtime.InteropServices.Tests'. [C:\xr_dev\dotnetFork\runtime\src\libraries\System.Runtime.InteropServices\tests\System.Runtime.InteropServices.UnitTests\System.Runtime.InteropServices.Tests.csproj::TargetFramework=net10.0-browser] - 0 Warning(s) - 1 Error(s) - -Time Elapsed 00:00:39.38 From 6f2dbe6ea48d8f8b1abcb85e333d7d7c4fd7db4f Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 7 Nov 2025 11:19:35 +0000 Subject: [PATCH 188/209] Runtime.c cleanup --- src/mono/browser/runtime/runtime.c | 60 ++++++------------------------ 1 file changed, 12 insertions(+), 48 deletions(-) diff --git a/src/mono/browser/runtime/runtime.c b/src/mono/browser/runtime/runtime.c index 651683602a98a9..35a957f881d5a3 100644 --- a/src/mono/browser/runtime/runtime.c +++ b/src/mono/browser/runtime/runtime.c @@ -130,8 +130,7 @@ icall_table_lookup (MonoMethod *method, char *classname, char *methodname, char const char *image_name = mono_image_get_name (mono_class_get_image (mono_method_get_class (method))); -#if defined(ICALL_TABLE_corlib) - MH_LOG("Looking for %s with ICALL_TABLE_corlib in %s", methodname, image_name); +#if defined(ICALL_TABLE_corlib) if (!strcmp (image_name, "System.Private.CoreLib") || !strcmp (image_name, "Wasm.Advanced.Sample")) { indexes = corlib_icall_indexes; indexes_size = sizeof (corlib_icall_indexes) / 4; @@ -140,8 +139,7 @@ icall_table_lookup (MonoMethod *method, char *classname, char *methodname, char assert (sizeof (corlib_icall_indexes [0]) == 4); } #endif -#ifdef ICALL_TABLE_System - MH_LOG("Looking for %s with ICALL_TABLE_System in %s", methodname, image_name); +#ifdef ICALL_TABLE_System if (!strcmp (image_name, "System")) { indexes = System_icall_indexes; indexes_size = sizeof (System_icall_indexes) / 4; @@ -152,16 +150,13 @@ icall_table_lookup (MonoMethod *method, char *classname, char *methodname, char assert (indexes); void *p = bsearch (&token_idx, indexes, indexes_size, 4, compare_int); - if (!p) { - MH_LOGV(MH_LVL_INFO, "wasm: Unable to lookup icall: %s (%s)\n", methodname, mono_method_get_name (method)); - return NULL; + if (!p) { printf ("wasm: Unable to lookup icall: %s\n", mono_method_get_name (method)); exit (1); } uint32_t idx = (int*)p - indexes; - *out_flags = flags [idx]; - MH_LOGV(MH_LVL_TRACE, "Will ICALL: %s %x %d %d\n", methodname, token, idx, (int)(funcs [idx])); + *out_flags = flags [idx]; //printf ("ICALL: %s %x %d %d\n", methodname, token, idx, (int)(funcs [idx])); return funcs [idx]; @@ -279,8 +274,7 @@ import_compare_name (const void *k1, const void *k2) static void* wasm_dl_symbol (void *handle, const char *name, char **err, void *user_data) { - assert (handle != sysglobal_native_handle); - MH_LOG("."); + assert (handle != sysglobal_native_handle); #if WASM_SUPPORTS_DLOPEN if (!wasm_dl_is_pinvoke_tables (handle)) { return dlsym (handle, name); @@ -289,26 +283,12 @@ wasm_dl_symbol (void *handle, const char *name, char **err, void *user_data) PinvokeTable* index = (PinvokeTable*)handle; PinvokeImport key = { name, NULL }; PinvokeImport* result = (PinvokeImport *)bsearch(&key, index->imports, index->count, sizeof(PinvokeImport), import_compare_name); - if (!result) { - char buffer [512]; - sprintf (buffer, "Symbol not found: %s", name); - *err = strdup(buffer); - MH_LOGV(MH_LVL_INFO, "Symbol not found: %s", name); + if (!result) { return NULL; } return result->func; } -#ifndef ICALL_EXPORT -#define ICALL_EXPORT -#endif -#define TEST_ICALL_SYMBOL_MAP -#ifdef TEST_ICALL_SYMBOL_MAP -const char* -mono_lookup_icall_symbol_internal (gpointer func); -ICALL_EXPORT int ves_icall_System_Environment_get_ProcessorCount (); -#endif - MonoDomain * mono_wasm_load_runtime_common (int debug_level, MonoLogCallback log_callback, const char *interp_opts) { @@ -350,18 +330,7 @@ mono_wasm_load_runtime_common (int debug_level, MonoLogCallback log_callback, co } #endif init_icall_table (); - - #define CHECK_SYMBOL_LOOKUP - #ifdef CHECK_SYMBOL_LOOKUP - { - printf("Checking mono_lookup_icall_symbol_internal\n"); - const char *p = mono_lookup_icall_symbol_internal (mono_lookup_icall_symbol_internal); - printf ("%s\n", p ? p : "null"); - printf("Checking ves_icall_System_Environment_get_ProcessorCount: "); - p = mono_lookup_icall_symbol_internal (ves_icall_System_Environment_get_ProcessorCount); - printf ("%s\n", p ? p : "null"); - } - #endif + mono_ee_interp_init (interp_opts); mono_marshal_ilgen_init(); mono_method_builder_ilgen_init (); @@ -370,16 +339,14 @@ mono_wasm_load_runtime_common (int debug_level, MonoLogCallback log_callback, co mono_trace_init (); mono_trace_set_log_handler (log_callback, NULL); domain = mono_jit_init_version ("mono", NULL); - mono_thread_set_main (mono_thread_current ()); - printf("returning"); + mono_thread_set_main (mono_thread_current ()); return domain; } // TODO https://github.com/dotnet/runtime/issues/98366 EMSCRIPTEN_KEEPALIVE MonoAssembly* mono_wasm_assembly_load (const char *name) -{ - MH_LOG("."); +{ MonoAssembly *res; assert (name); MonoImageOpenStatus status; @@ -394,8 +361,7 @@ mono_wasm_assembly_load (const char *name) // TODO https://github.com/dotnet/runtime/issues/98366 EMSCRIPTEN_KEEPALIVE MonoClass* mono_wasm_assembly_find_class (MonoAssembly *assembly, const char *namespace, const char *name) -{ - MH_LOG("."); +{ assert (assembly); MonoClass *result; MONO_ENTER_GC_UNSAFE; @@ -407,8 +373,7 @@ mono_wasm_assembly_find_class (MonoAssembly *assembly, const char *namespace, co // TODO https://github.com/dotnet/runtime/issues/98366 EMSCRIPTEN_KEEPALIVE MonoMethod* mono_wasm_assembly_find_method (MonoClass *klass, const char *name, int arguments) -{ - MH_LOG("."); +{ assert (klass); MonoMethod* result; MONO_ENTER_GC_UNSAFE; @@ -419,8 +384,7 @@ mono_wasm_assembly_find_method (MonoClass *klass, const char *name, int argument MonoMethod* mono_wasm_get_method_matching (MonoImage *image, uint32_t token, MonoClass *klass, const char* name, int param_count) -{ - MH_LOG("mono_wasm_get_method_matching: %s.%s token=%x name=%s param_count=%d\n", mono_image_get_name (image), mono_class_get_name (klass), token, name, param_count); +{ MonoMethod *result = NULL; MONO_ENTER_GC_UNSAFE; MonoMethod *method = mono_get_method (image, token, klass); From 4579eeb7331404c6b643c80c12d6e9c66bb87325 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 7 Nov 2025 11:32:36 +0000 Subject: [PATCH 189/209] Tidying --- .../tools/aot/ILCompiler.Diagnostics/AssemblyInfo.cs | 1 - src/mono/browser/runtime/runtime.c | 11 ++++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/coreclr/tools/aot/ILCompiler.Diagnostics/AssemblyInfo.cs b/src/coreclr/tools/aot/ILCompiler.Diagnostics/AssemblyInfo.cs index 6212dbd2e400ba..60e68309575e62 100644 --- a/src/coreclr/tools/aot/ILCompiler.Diagnostics/AssemblyInfo.cs +++ b/src/coreclr/tools/aot/ILCompiler.Diagnostics/AssemblyInfo.cs @@ -5,7 +5,6 @@ using System.Runtime.CompilerServices; [assembly: DisableRuntimeMarshalling] -[assembly: InternalsVisibleTo("Wasm.Advanced.Sample")] namespace ILCompiler.Diagnostics { diff --git a/src/mono/browser/runtime/runtime.c b/src/mono/browser/runtime/runtime.c index 35a957f881d5a3..108a7fbfc45d85 100644 --- a/src/mono/browser/runtime/runtime.c +++ b/src/mono/browser/runtime/runtime.c @@ -44,7 +44,6 @@ #include #include -#include #include "wasm-config.h" #include "pinvoke.h" @@ -100,8 +99,6 @@ mono_install_icall_table_callbacks (const MonoIcallTableCallbacks *cb); #endif #endif -// Comment out FOR COMPILE: -//#define LINK_ICALLS #ifdef LINK_ICALLS @@ -131,7 +128,7 @@ icall_table_lookup (MonoMethod *method, char *classname, char *methodname, char const char *image_name = mono_image_get_name (mono_class_get_image (mono_method_get_class (method))); #if defined(ICALL_TABLE_corlib) - if (!strcmp (image_name, "System.Private.CoreLib") || !strcmp (image_name, "Wasm.Advanced.Sample")) { + if (!strcmp (image_name, "System.Private.CoreLib")) { indexes = corlib_icall_indexes; indexes_size = sizeof (corlib_icall_indexes) / 4; flags = corlib_icall_flags; @@ -150,7 +147,8 @@ icall_table_lookup (MonoMethod *method, char *classname, char *methodname, char assert (indexes); void *p = bsearch (&token_idx, indexes, indexes_size, 4, compare_int); - if (!p) { + if (!p) { + return NULL; printf ("wasm: Unable to lookup icall: %s\n", mono_method_get_name (method)); exit (1); } @@ -412,8 +410,7 @@ mono_wasm_get_method_matching (MonoImage *image, uint32_t token, MonoClass *klas */ void mono_wasm_marshal_get_managed_wrapper (const char* assemblyName, const char* namespaceName, const char* typeName, const char* methodName, uint32_t token, int param_count) -{ - MH_LOG("mono_wasm_marshal_get_managed_wrapper: %s.%s.%s::%s token=%x param_count=%d\n", assemblyName, namespaceName, typeName, methodName, token, param_count); +{ MonoError error; mono_error_init (&error); MONO_ENTER_GC_UNSAFE; From 3a3f098a32bba4c47afbc16aefb46037d8c920e3 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 7 Nov 2025 11:48:19 +0000 Subject: [PATCH 190/209] Tidying --- .../WasmTestRunner/WasmTestRunner.csproj | 15 +--------- .../tests/System.Memory.Tests.csproj | 3 +- .../BinaryPrimitives.ReverseEndianness.cs | 1 - .../System/Collections/Generic/Dictionary.cs | 2 -- .../src/System/Collections/Generic/HashSet.cs | 2 -- .../src/System/Decimal.DecCalc.cs | 1 - .../src/System/Double.cs | 1 - .../System.Private.CoreLib/src/System/Enum.cs | 3 -- .../src/System/Globalization/Ordinal.cs | 2 -- .../src/System/IntPtr.cs | 1 - .../System.Private.CoreLib/src/System/Math.cs | 1 - .../src/System/Memory.cs | 1 - .../src/System/MemoryExtensions.cs | 1 - .../src/System/Number.Formatting.cs | 2 -- .../src/System/Numerics/BitOperations.cs | 1 - .../src/System/ReadOnlyMemory.cs | 1 - .../src/System/ReadOnlySpan.cs | 1 - .../Runtime/CompilerServices/CastCache.cs | 1 - .../Runtime/CompilerServices/GenericCache.cs | 1 - .../System/Runtime/InteropServices/Marshal.cs | 1 - .../System/Runtime/InteropServices/NFloat.cs | 1 - .../src/System/Runtime/Intrinsics/Scalar.cs | 1 - .../src/System/Single.cs | 1 - .../System.Private.CoreLib/src/System/Span.cs | 1 - .../src/System/SpanHelpers.Byte.cs | 2 -- .../src/System/SpanHelpers.ByteMemOps.cs | 1 - .../src/System/SpanHelpers.Char.cs | 2 -- .../src/System/String.Comparison.cs | 1 - .../src/System/String.Manipulation.cs | 1 - .../src/System/String.cs | 1 - .../src/System/Text/UnicodeEncoding.cs | 1 - .../src/System/Threading/Interlocked.cs | 1 - .../src/System/Threading/Volatile.cs | 1 - .../src/System/UIntPtr.cs | 1 - ...me.InteropServices.JavaScript.Tests.csproj | 3 +- ...ystem.Runtime.InteropServices.Tests.csproj | 3 +- .../src/System/String.Mono.cs | 1 - src/mono/browser/runtime/corebindings.c | 3 +- src/mono/browser/runtime/driver.c | 29 +++---------------- 39 files changed, 9 insertions(+), 88 deletions(-) diff --git a/src/libraries/Common/tests/WasmTestRunner/WasmTestRunner.csproj b/src/libraries/Common/tests/WasmTestRunner/WasmTestRunner.csproj index 77b82de968b577..3988ce50fd4734 100644 --- a/src/libraries/Common/tests/WasmTestRunner/WasmTestRunner.csproj +++ b/src/libraries/Common/tests/WasmTestRunner/WasmTestRunner.csproj @@ -3,21 +3,8 @@ Exe enable $(NetCoreAppCurrent)-browser;$(NetCoreAppCurrent)-wasi;$(NetCoreAppCurrent) - - - $(RestoreAdditionalProjectSources); - C:\xr_dev\xharness\artifacts\packages\Debug\Shipping; - C:\Users\mike.hudson\.nuget\packages; - - - - - portable - true - --setenv=MONO_GC_DEBUG=9 - - + $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) diff --git a/src/libraries/System.Memory/tests/System.Memory.Tests.csproj b/src/libraries/System.Memory/tests/System.Memory.Tests.csproj index 2b5c56ebd64306..ce9e4324144a9a 100644 --- a/src/libraries/System.Memory/tests/System.Memory.Tests.csproj +++ b/src/libraries/System.Memory/tests/System.Memory.Tests.csproj @@ -3,8 +3,7 @@ true true true - $(NetCoreAppCurrent) - --setenv=MH_LOG_VERBOSITY=0 + $(NetCoreAppCurrent) diff --git a/src/libraries/System.Private.CoreLib/src/System/Buffers/Binary/BinaryPrimitives.ReverseEndianness.cs b/src/libraries/System.Private.CoreLib/src/System/Buffers/Binary/BinaryPrimitives.ReverseEndianness.cs index 9f5f55efd7fb02..5f8b0a7e5fca7f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Buffers/Binary/BinaryPrimitives.ReverseEndianness.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Buffers/Binary/BinaryPrimitives.ReverseEndianness.cs @@ -13,7 +13,6 @@ using nint_t = System.Int64; using nuint_t = System.UInt64; #else -#error TARGET_64BIT is not defined using nint_t = System.Int32; using nuint_t = System.UInt32; #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs index 7aed6184d8cfb3..c890bbed83c7ef 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs @@ -27,8 +27,6 @@ public class Dictionary : IDictionary, IDictionary, private Entry[]? _entries; #if TARGET_64BIT private ulong _fastModMultiplier; -#else - #error TARGET_64BIT is not defined #endif private int _count; private int _freeList; diff --git a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/HashSet.cs b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/HashSet.cs index c4009030a3864a..026456617f8997 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/HashSet.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/HashSet.cs @@ -41,8 +41,6 @@ public class HashSet : ICollection, ISet, IReadOnlyCollection, IRead private Entry[]? _entries; #if TARGET_64BIT private ulong _fastModMultiplier; -#else - #error TARGET_64BIT is not defined #endif private int _count; private int _freeList; diff --git a/src/libraries/System.Private.CoreLib/src/System/Decimal.DecCalc.cs b/src/libraries/System.Private.CoreLib/src/System/Decimal.DecCalc.cs index 266cb3f0aeaf13..442e00870d4935 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Decimal.DecCalc.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Decimal.DecCalc.cs @@ -271,7 +271,6 @@ private static bool Div96ByConst(ref ulong high64, ref uint low, uint pow) return true; } #else -#error TARGET_64BIT is not defined // 32-bit RyuJIT doesn't convert 64-bit division by constant into multiplication by reciprocal. Do half-width divisions instead. Debug.Assert(pow <= ushort.MaxValue); uint num, mid32, low16, div, rem; diff --git a/src/libraries/System.Private.CoreLib/src/System/Double.cs b/src/libraries/System.Private.CoreLib/src/System/Double.cs index dd9a796343bb26..fe89ca49146caf 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Double.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Double.cs @@ -1448,7 +1448,6 @@ private static bool TryConvertTo(double value, [MaybeNullWhen(false)] ou result = (TOther)(object)actualResult; return true; #else -#error TARGET_64BIT is not defined nuint actualResult = (value >= uint.MaxValue) ? uint.MaxValue : (value <= uint.MinValue) ? uint.MinValue : (nuint)value; result = (TOther)(object)actualResult; diff --git a/src/libraries/System.Private.CoreLib/src/System/Enum.cs b/src/libraries/System.Private.CoreLib/src/System/Enum.cs index 126f10f3c2a824..aa17ad8a5149c3 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Enum.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Enum.cs @@ -1571,7 +1571,6 @@ private static unsafe bool TryFormatNumberAsHex(ref byte data, Span(ref byte data, Span> 32) + (((ulong)(uint)(a >> 32)) * b); diff --git a/src/libraries/System.Private.CoreLib/src/System/Memory.cs b/src/libraries/System.Private.CoreLib/src/System/Memory.cs index 0d6665f956c285..a0da08ba9a8038 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Memory.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Memory.cs @@ -98,7 +98,6 @@ public Memory(T[]? array, int start, int length) if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)array.Length) ThrowHelper.ThrowArgumentOutOfRangeException(); #else -#error TARGET_64BIT is not defined if ((uint)start > (uint)array.Length || (uint)length > (uint)(array.Length - start)) ThrowHelper.ThrowArgumentOutOfRangeException(); #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs index 7894fc28dc5baa..cae62dc6eb8894 100644 --- a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs @@ -202,7 +202,6 @@ public static ReadOnlySpan AsSpan(this string? text, int start, int length if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)text.Length) ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.start); #else -#error TARGET_64BIT is not defined if ((uint)start > (uint)text.Length || (uint)length > (uint)(text.Length - start)) ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.start); #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs b/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs index 40303611f31dc9..e22a12d24f6440 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs @@ -1906,8 +1906,6 @@ internal static unsafe bool TryInt64ToHexStr(long value, char hexBase, in #if TARGET_64BIT [MethodImpl(MethodImplOptions.AggressiveInlining)] -#else -#error TARGET_64BIT is not defined #endif private static unsafe TChar* Int64ToHexChars(TChar* buffer, ulong value, int hexBase, int digits) where TChar : unmanaged, IUtfChar { diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs index fcf927e5412e14..498ccc82d7b702 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs @@ -101,7 +101,6 @@ public static uint RoundUpToPowerOf2(uint value) #if TARGET_64BIT return (uint)(0x1_0000_0000ul >> LeadingZeroCount(value - 1)); #else -#error TARGET_64BIT is not defined int shift = 32 - LeadingZeroCount(value - 1); return (1u ^ (uint)(shift >> 5)) << shift; #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/ReadOnlyMemory.cs b/src/libraries/System.Private.CoreLib/src/System/ReadOnlyMemory.cs index 696a0b52204dc3..61bd9314bd26ca 100644 --- a/src/libraries/System.Private.CoreLib/src/System/ReadOnlyMemory.cs +++ b/src/libraries/System.Private.CoreLib/src/System/ReadOnlyMemory.cs @@ -76,7 +76,6 @@ public ReadOnlyMemory(T[]? array, int start, int length) if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)array.Length) ThrowHelper.ThrowArgumentOutOfRangeException(); #else -#error TARGET_64BIT is not defined if ((uint)start > (uint)array.Length || (uint)length > (uint)(array.Length - start)) ThrowHelper.ThrowArgumentOutOfRangeException(); #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/ReadOnlySpan.cs b/src/libraries/System.Private.CoreLib/src/System/ReadOnlySpan.cs index 0c5e7536fc110e..1402f8d2a3e4e8 100644 --- a/src/libraries/System.Private.CoreLib/src/System/ReadOnlySpan.cs +++ b/src/libraries/System.Private.CoreLib/src/System/ReadOnlySpan.cs @@ -74,7 +74,6 @@ public ReadOnlySpan(T[]? array, int start, int length) if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)array.Length) ThrowHelper.ThrowArgumentOutOfRangeException(); #else -#error TARGET_64BIT is not defined if ((uint)start > (uint)array.Length || (uint)length > (uint)(array.Length - start)) ThrowHelper.ThrowArgumentOutOfRangeException(); #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastCache.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastCache.cs index 3b9eb885f22903..c5602eff0d2824 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastCache.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastCache.cs @@ -96,7 +96,6 @@ private static int KeyToBucket(ref int tableData, nuint source, nuint target) #if TARGET_64BIT return (int)((hash * 11400714819323198485ul) >> hashShift); #else -#error TARGET_64BIT is not defined return (int)((hash * 2654435769u) >> hashShift); #endif } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/GenericCache.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/GenericCache.cs index fdb45d9d1bbe56..2b8bd8eea7a223 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/GenericCache.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/GenericCache.cs @@ -101,7 +101,6 @@ private static int HashToBucket(Entry[] table, int hash) #if TARGET_64BIT return (int)(((ulong)hash * 11400714819323198485ul) >> hashShift); #else -#error TARGET_64BIT is not defined return (int)(((uint)hash * 2654435769u) >> hashShift); #endif } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs index 9c7f3d1aac554e..47b61aa936ff41 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs @@ -356,7 +356,6 @@ public static IntPtr ReadIntPtr(object ptr, int ofs) #if TARGET_64BIT return (nint)ReadInt64(ptr, ofs); #else // 32 -#error TARGET_64BIT is not defined return (nint)ReadInt32(ptr, ofs); #endif } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NFloat.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NFloat.cs index 342008db3da18e..5e2fb905df195c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NFloat.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NFloat.cs @@ -880,7 +880,6 @@ static NFloat IBinaryNumber.AllBitsSet [NonVersionable] get => (NFloat)BitConverter.UInt64BitsToDouble(0xFFFF_FFFF_FFFF_FFFF); #else -#error TARGET_64BIT is not defined [NonVersionable] get => BitConverter.UInt32BitsToSingle(0xFFFF_FFFF); #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Scalar.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Scalar.cs index 61e8240f6c1917..deb6ef6af4d3d7 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Scalar.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Scalar.cs @@ -524,7 +524,6 @@ public static uint ExtractMostSignificantBit(T value) ulong bits = (ulong)(nint)(object)value; return (uint)(bits >> 63); #else -#error TARGET_64BIT is not defined uint bits = (uint)(nint)(object)value; return bits >> 31; #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/Single.cs b/src/libraries/System.Private.CoreLib/src/System/Single.cs index 5ca8f29057899f..ce37952076f6b8 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Single.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Single.cs @@ -1467,7 +1467,6 @@ private static bool TryConvertTo(float value, [MaybeNullWhen(false)] out result = (TOther)(object)actualResult; return true; #else -#error TARGET_64BIT is not defined nuint actualResult = (value >= uint.MaxValue) ? uint.MaxValue : (value <= uint.MinValue) ? uint.MinValue : (nuint)value; result = (TOther)(object)actualResult; diff --git a/src/libraries/System.Private.CoreLib/src/System/Span.cs b/src/libraries/System.Private.CoreLib/src/System/Span.cs index 106872c785feb6..20609fd10bcdb5 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Span.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Span.cs @@ -79,7 +79,6 @@ public Span(T[]? array, int start, int length) if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)array.Length) ThrowHelper.ThrowArgumentOutOfRangeException(); #else -#error TARGET_64BIT is not defined if ((uint)start > (uint)array.Length || (uint)length > (uint)(array.Length - start)) ThrowHelper.ThrowArgumentOutOfRangeException(); #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Byte.cs b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Byte.cs index c960c94d5e45d2..8f87c9005e578c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Byte.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Byte.cs @@ -772,8 +772,6 @@ public static unsafe bool SequenceEqual(ref byte first, ref byte second, nuint l #if TARGET_64BIT // On 32-bit, this will always be true since sizeof(nuint) == 4 if (length < sizeof(uint)) -#else - #error TARGET_64BIT is not defined #endif { uint differentBits = 0; diff --git a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.ByteMemOps.cs b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.ByteMemOps.cs index 056205af740481..319c23e0bf2152 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.ByteMemOps.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.ByteMemOps.cs @@ -117,7 +117,6 @@ internal static void Memmove(ref byte dest, ref byte src, nuint len) Unsafe.WriteUnaligned(ref dest, Unsafe.ReadUnaligned(ref src)); Unsafe.WriteUnaligned(ref Unsafe.Add(ref destEnd, -8), Unsafe.ReadUnaligned(ref Unsafe.Add(ref srcEnd, -8))); #else -#error TARGET_64BIT is not defined Unsafe.WriteUnaligned(ref dest, Unsafe.ReadUnaligned(ref src)); Unsafe.WriteUnaligned(ref Unsafe.Add(ref dest, 4), Unsafe.ReadUnaligned(ref Unsafe.Add(ref src, 4))); Unsafe.WriteUnaligned(ref Unsafe.Add(ref destEnd, -8), Unsafe.ReadUnaligned(ref Unsafe.Add(ref srcEnd, -8))); diff --git a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Char.cs b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Char.cs index d5cbca30ae64a0..9cbeccb2f88de1 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Char.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Char.cs @@ -512,8 +512,6 @@ public static unsafe int SequenceCompareTo(ref char first, int firstLength, ref i += sizeof(int) / sizeof(char); } } -#else - #error TARGET_64BIT is not defined #endif while (i < minLength) diff --git a/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs b/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs index 51a94244616247..f9261106b34c73 100644 --- a/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs +++ b/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs @@ -132,7 +132,6 @@ private static unsafe int CompareOrdinalHelper(string strA, string strB) length -= 12; a += 12; b += 12; } #else // TARGET_64BIT -#error TARGET_64BIT is not defined while (length >= 10) { if (*(int*)a != *(int*)b) goto DiffOffset0; diff --git a/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs b/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs index c88cc9f784b709..8c4d5f786c597d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs +++ b/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs @@ -2241,7 +2241,6 @@ public string Substring(int startIndex, int length) // See comment in Span.Slice for how this works. if ((ulong)(uint)startIndex + (ulong)(uint)length > (ulong)(uint)Length) #else -#error TARGET_64BIT is not defined if ((uint)startIndex > (uint)Length || (uint)length > (uint)(Length - startIndex)) #endif { diff --git a/src/libraries/System.Private.CoreLib/src/System/String.cs b/src/libraries/System.Private.CoreLib/src/System/String.cs index 2a73e11931925e..e94d8778f1cab4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/String.cs +++ b/src/libraries/System.Private.CoreLib/src/System/String.cs @@ -376,7 +376,6 @@ internal bool TryGetSpan(int startIndex, int count, out ReadOnlySpan slice return false; } #else -#error TARGET_64BIT is not defined if ((uint)startIndex > (uint)Length || (uint)count > (uint)(Length - startIndex)) { slice = default; diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/UnicodeEncoding.cs b/src/libraries/System.Private.CoreLib/src/System/Text/UnicodeEncoding.cs index 868c361bd31860..7eaf078feae5ad 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/UnicodeEncoding.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/UnicodeEncoding.cs @@ -401,7 +401,6 @@ internal sealed override unsafe int GetByteCount(char* chars, int count, Encoder #if TARGET_64BIT (unchecked((long)chars) & 7) == 0 && #else -#error TARGET_64BIT is not defined (unchecked((int)chars) & 3) == 0 && #endif charLeftOver == 0) diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Interlocked.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Interlocked.cs index 0de0134f238832..3f74b53818ffcb 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Interlocked.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Interlocked.cs @@ -205,7 +205,6 @@ public static IntPtr Exchange(ref IntPtr location1, IntPtr value) #if TARGET_64BIT return (IntPtr)Interlocked.Exchange(ref Unsafe.As(ref location1), (long)value); #else -#error TARGET_64BIT is not defined return (IntPtr)Exchange(ref Unsafe.As(ref location1), (int)value); #endif #pragma warning restore CA2020 diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Volatile.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Volatile.cs index 4822dfed8252b9..508647b0545a93 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Volatile.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Volatile.cs @@ -91,7 +91,6 @@ public static long Read(ref readonly long location) => #if TARGET_64BIT (long)Unsafe.As(ref Unsafe.AsRef(in location)).Value; #else -#error TARGET_64BIT is not defined // On 32-bit machines, we use Interlocked, since an ordinary volatile read would not be atomic. Interlocked.CompareExchange(ref Unsafe.AsRef(in location), 0, 0); #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs b/src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs index bd358ec61fe2b8..7ab359b04199bc 100644 --- a/src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs +++ b/src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs @@ -16,7 +16,6 @@ using nuint_t = System.UInt64; #else using nuint_t = System.UInt32; -#error TARGET_64BIT is not defined #endif namespace System diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj index 0da87fd1094b9b..c939e47969d794 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj @@ -6,8 +6,7 @@ $(NetCoreAppCurrent)-browser true true - $(WasmXHarnessArgs) --engine-arg=--expose-gc --web-server-use-cop - --setenv=MH_LOG_VERBOSITY=6 + $(WasmXHarnessArgs) --engine-arg=--expose-gc --web-server-use-cop true true true diff --git a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj index b68856f60f062c..70fc4570107221 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj @@ -3,8 +3,7 @@ true $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetCoreAppCurrent)-browser true - true - --setenv=MH_LOG_VERBOSITY=0 + true diff --git a/src/mono/System.Private.CoreLib/src/System/String.Mono.cs b/src/mono/System.Private.CoreLib/src/System/String.Mono.cs index a86e058925fe75..7dedf5a6e536d0 100644 --- a/src/mono/System.Private.CoreLib/src/System/String.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/String.Mono.cs @@ -34,7 +34,6 @@ public static string IsInterned(string str) internal const int OFFSET_TO_STRING = 20; #else internal const int OFFSET_TO_STRING = 12; -#error TARGET_64BIT is not defined #endif // TODO: Should be pointing to Buffer instead diff --git a/src/mono/browser/runtime/corebindings.c b/src/mono/browser/runtime/corebindings.c index 403402dbb9fda6..7884c8c34d67f6 100644 --- a/src/mono/browser/runtime/corebindings.c +++ b/src/mono/browser/runtime/corebindings.c @@ -110,8 +110,7 @@ void bindings_initialize_internals (void) static MonoAssembly* _mono_wasm_assembly_load (char *assembly_name) { assert (assembly_name); - MonoImageOpenStatus status; - MH_LOG("Got assembly name %s", assembly_name); + MonoImageOpenStatus status; MonoAssemblyName* aname = mono_assembly_name_new (assembly_name); assert (aname); MonoAssembly *res = mono_assembly_load (aname, NULL, &status); diff --git a/src/mono/browser/runtime/driver.c b/src/mono/browser/runtime/driver.c index d36e859fbf51bf..7e8849648c7275 100644 --- a/src/mono/browser/runtime/driver.c +++ b/src/mono/browser/runtime/driver.c @@ -104,22 +104,6 @@ typedef int32_t d_handle; #include #include -// I put these here just to make sure they have access to EMSCRIPTEN_KEEPALIVE -EMSCRIPTEN_KEEPALIVE void MH_TestVoid() -{ - printf("MH_TestVoid called\n"); -} - -// I put these here just to make sure they have access to EMSCRIPTEN_KEEPALIVE -EMSCRIPTEN_KEEPALIVE void MH_SetLogVerbosity(int32_t level) -{ - printf("MH_LOG_verbosity_level set to %d\n", level); - const char* envVar = getenv("MH_LOG_VERBOSITY"); - printf("Environment variable MH_LOG_VERBOSITY is: %s\n", envVar ? envVar : "empty"); - mh_log_set_verbosity(level); - printf("Retrieved MH_LOG_VERBOSITY: %d\n", mh_log_get_verbosity()); -} - EMSCRIPTEN_KEEPALIVE void log_message(const char *filename, const char *message) { FILE *file = fopen(filename, "a"); // Open for append, create if doesn't exist if (file == NULL) { @@ -402,11 +386,8 @@ mono_wasm_string_from_utf16_ref (const mono_unichar2 * chars, int length, MonoSt } else { mono_gc_wbarrier_generic_store_atomic(result, NULL); } - MONO_EXIT_GC_UNSAFE; - //FIXME: debug only - MH_LOG("Input length %d, result length: %d", length, mono_string_length(*result)); - char* charString = mono_string_to_utf8(*result); - MH_LOG("Converted string with length %d to: %s", length, charString); + MONO_EXIT_GC_UNSAFE; + char* charString = mono_string_to_utf8(*result); } EMSCRIPTEN_KEEPALIVE int @@ -435,10 +416,8 @@ mono_wasm_set_main_args (int argc, char* argv[]) EMSCRIPTEN_KEEPALIVE d_handle mono_wasm_strdup (const char *s) -{ - MH_LOG("duplicating: %s (%p)", s, s); - char* result = strdup(s); - MH_LOG("duplicated: %s (%p)", result, result); +{ + char* result = strdup(s); return (d_handle)result; } From 79ea870de18f2b0908c3232f3e5c097bb31671b7 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 7 Nov 2025 12:25:46 +0000 Subject: [PATCH 191/209] Tidying --- src/mono/CMakeLists.txt | 27 ++----- .../src/System/RuntimeType.Mono.cs | 77 +------------------ src/mono/browser/build/BrowserWasmApp.targets | 3 +- src/mono/browser/runtime/corebindings.c | 1 - src/mono/browser/runtime/debug.ts | 7 -- src/mono/browser/runtime/driver.c | 30 -------- src/mono/browser/runtime/exports-internal.ts | 6 +- 7 files changed, 8 insertions(+), 143 deletions(-) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index a0c9048f8b9c45..0a1099fac8bd90 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -121,7 +121,6 @@ endif() ###################################### # AOT CROSS COMPILER SUPPORT ###################################### -message("MRH_LOGGING: AOT_TARGET_TRIPLE IS '${AOT_TARGET_TRIPLE}'") if(NOT AOT_TARGET_TRIPLE STREQUAL "") set(MONO_CROSS_COMPILE 1) if(NOT AOT_OFFSETS_FILE STREQUAL "") @@ -172,7 +171,6 @@ if(NOT AOT_TARGET_TRIPLE STREQUAL "") message(FATAL_ERROR "AOT target '${AOT_TARGET_TRIPLE}' not supported.") endif() endif() -message("MRH_LOGGING: TARGET_ARCH IS '${TARGET_ARCH}'") ###################################### # HOST OS CHECKS ###################################### @@ -419,32 +417,19 @@ endif() # TARGET ARCH CHECKS ###################################### -function(DUMP_CMAKE_VARIABLES) - message("MRH_LOGGING: DUMP_CMAKE_VARIABLES:") - get_cmake_property(_variableNames VARIABLES) - list (SORT _variableNames) - foreach (_variableName ${_variableNames}) - message(STATUS "${_variableName}=${${_variableName}}") - endforeach() -endfunction() if (CMAKE_C_FLAGS MATCHES "wasm64") - set(USES_MEM64 TRUE) - message("MRH_LOGGING: SET USES_MEM64 due to wasm64") + set(USES_MEM64 TRUE) endif() if (CMAKE_C_FLAGS MATCHES "MEMORY64") set(USES_MEM64 TRUE) - message("MRH_LOGGING: SET USES_MEM64 due to MEMORY64") endif() if(NOT TARGET_ARCH) if (CMAKE_SYSTEM_PROCESSOR STREQUAL "wasm" AND USES_MEM64) - set(TARGET_ARCH "wasm64") - message("MRH_LOGGING: SET TARGET_ARCH to wasm64") + set(TARGET_ARCH "wasm64") else() - set(TARGET_ARCH "${CMAKE_SYSTEM_PROCESSOR}") - message("MRH_LOGGING: SET TARGET_ARCH to CMAKE_SYSTEM_PROCESSOR:=${TARGET_ARCH}") - DUMP_CMAKE_VARIABLES() + set(TARGET_ARCH "${CMAKE_SYSTEM_PROCESSOR}") endif() endif() @@ -509,14 +494,12 @@ elseif(TARGET_ARCH STREQUAL "s390x") set(MONO_ARCHITECTURE "\"s390x\"") set(TARGET_SIZEOF_VOID_P 8) set(SIZEOF_REGISTER 8) -elseif(TARGET_ARCH STREQUAL "wasm" OR TARGET_ARCH STREQUAL "wasm32") - message ("MRH_LOGGING: setting wasm32! - target arch is '${TARGET_ARCH}'") +elseif(TARGET_ARCH STREQUAL "wasm" OR TARGET_ARCH STREQUAL "wasm32") set(TARGET_WASM 1) set(MONO_ARCHITECTURE "\"wasm\"") set(TARGET_SIZEOF_VOID_P 4) set(SIZEOF_REGISTER 4) -elseif(TARGET_ARCH STREQUAL "wasm64" ) - message ("MRH_LOGGING: setting wasm64!") +elseif(TARGET_ARCH STREQUAL "wasm64" ) set(TARGET_WASM 1) set(MONO_ARCHITECTURE "\"wasm\"") set(TARGET_SIZEOF_VOID_P 8) diff --git a/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs b/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs index bfaba793abdb96..68b70591576fb6 100644 --- a/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs @@ -1,6 +1,5 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#define MH_USE_INTPTR using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; @@ -2182,81 +2181,7 @@ internal RuntimeMethodInfo[] GetMethodsByName(string? name, BindingFlags binding [MethodImplAttribute(MethodImplOptions.InternalCall)] private static extern IntPtr GetConstructors_native(QCallTypeHandle type, BindingFlags bindingAttr); - - [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern unsafe IntPtr TestArray_native(); - - [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern unsafe IntPtr TestArrayRaw_native(); - - public static IntPtr TestArray() - { - // This is a test method to ensure that the native code can be called correctly. - // It is not used in production code and is only for testing purposes. - IntPtr result = TestArray_native(); - - //var h = new Mono.SafeGPtrArrayHandle(result); - //var h = new Mono.RuntimeGPtrArrayHandle(result); - RuntimeStructs.GPtrArray* myData = (RuntimeStructs.GPtrArray*)result; - - IntPtr* data = myData->data; - long idx = 0x1; - var a = data[idx]; - var b = data[idx]; - var c = data[idx]; - - var sum = c + a; - - IntPtr[] array = new IntPtr[6]; - array[0] = 0x555; - array[1] = 0x666; - array[2] = 0x777; - - var d = array[0]; - var e = array[1]; - var f = array[2]; - - sum = f - d + e; - return sum; - } - - public static IntPtr TestArrayRaw() - { - int size = Marshal.SizeOf(typeof(IntPtr)); - System.Diagnostics.Debug.Assert(size == 8, "IntPtr is not the expected size of 8"); - - // This is a test method to ensure that the native code can be called correctly. - // It is not used in production code and is only for testing purposes. - //IntPtr* data = (IntPtr*)TestArrayRaw_native(); - -#if MH_USE_INTPTR - IntPtr* data = (IntPtr*)TestArrayRaw_native(); - - long idx0 = 0x0; - long idx1 = 0x1; - long idx2 = 0x2; - - IntPtr a = data[idx0]; - IntPtr b = data[idx1]; - IntPtr c = data[idx2]; - - IntPtr sum = (IntPtr)(b + c + a); -#else - Int64* data = (Int64*)TestArrayRaw_native(); - - long idx0 = 0x0; - long idx1 = 0x1; - long idx2 = 0x2; - - Int64 a = data[idx0]; - Int64 b = data[idx1]; - Int64 c = data[idx2]; - - IntPtr sum = (IntPtr)(b + c + a); -#endif - return sum; - } - + private RuntimeConstructorInfo[] GetConstructors_internal(BindingFlags bindingAttr, RuntimeType reflectedType) { var refh = new RuntimeTypeHandle(reflectedType); diff --git a/src/mono/browser/build/BrowserWasmApp.targets b/src/mono/browser/build/BrowserWasmApp.targets index b6e98867e6a486..00b52d6db75e2b 100644 --- a/src/mono/browser/build/BrowserWasmApp.targets +++ b/src/mono/browser/build/BrowserWasmApp.targets @@ -56,8 +56,7 @@ <_WasmDefaultFlags Condition="'$(WasmEnableExceptionHandling)' == 'false'">-fexceptions <_WasmDefaultFlags Condition="'$(WasmEnableExceptionHandling)' != 'false'">-fwasm-exceptions <_WasmDefaultFlags Condition="'$(WasmEnableSIMD)' == 'true'">-msimd128 - <_WasmDefaultFlags>-g - + <_WasmOutputFileName Condition="'$(WasmSingleFileBundle)' != 'true'">dotnet.native.wasm true diff --git a/src/mono/browser/runtime/corebindings.c b/src/mono/browser/runtime/corebindings.c index 7884c8c34d67f6..96d87e70ef58ea 100644 --- a/src/mono/browser/runtime/corebindings.c +++ b/src/mono/browser/runtime/corebindings.c @@ -24,7 +24,6 @@ #if SIZEOF_VOID_P == 4 typedef int32_t cb_handle; -#error "Unexpected 32-bit pointer size. This code expects 64-bit pointers." #else typedef int64_t cb_handle; #endif diff --git a/src/mono/browser/runtime/debug.ts b/src/mono/browser/runtime/debug.ts index 2ef74e916997d4..522c3c41158b28 100644 --- a/src/mono/browser/runtime/debug.ts +++ b/src/mono/browser/runtime/debug.ts @@ -123,13 +123,6 @@ export function mono_wasm_change_debugger_log_level (level: number): void { cwraps.mono_wasm_change_debugger_log_level(level); } -export function MH_TestVoid (): void { - cwraps.MH_TestVoid(); -} - -export function MH_SetLogVerbosity (value: number): void { - cwraps.MH_SetLogVerbosity(value); -} /** * Raises an event for the debug proxy */ diff --git a/src/mono/browser/runtime/driver.c b/src/mono/browser/runtime/driver.c index 7e8849648c7275..05731bef1c213e 100644 --- a/src/mono/browser/runtime/driver.c +++ b/src/mono/browser/runtime/driver.c @@ -24,7 +24,6 @@ #include #include #include -#include // FIXME: unavailable in emscripten // #include @@ -79,48 +78,20 @@ wasm_trace_logger (const char *log_domain, const char *log_level, const char *me } #ifndef SIZEOF_VOID_P -#pragma message ("MRH_LOGGING_DRIVER: SIZEOF_VOID_P is undefined in driver.c") #define SIZEOF_VOID_P @SIZEOF_VOID_P@ #endif #if SIZEOF_VOID_P == 4 -#pragma message ("MRH_LOGGING_DRIVER: SIZEOF_VOID_P is 4 in driver.c.") typedef uint32_t target_mword; typedef int32_t d_handle; #elif SIZEOF_VOID_P == 8 -#pragma message ("MRH_LOGGING_DRIVER: SIZEOF_VOID_P is 8 in driver.c") typedef uint64_t target_mword; typedef int64_t d_handle; #else -#pragma message ("MRH_LOGGING_DRIVER: SIZEOF_VOID_P is still undefined in driver.c") typedef uint32_t target_mword; typedef int32_t d_handle; #endif - -#include -#include - -#include -#include - -EMSCRIPTEN_KEEPALIVE void log_message(const char *filename, const char *message) { - FILE *file = fopen(filename, "a"); // Open for append, create if doesn't exist - if (file == NULL) { - perror("Error opening file"); - return; - } - - fprintf(file, "%s\n", message); // Write message followed by newline - fclose(file); // Close the file -} - -EMSCRIPTEN_KEEPALIVE void debug_log(const char* msg) { - EM_ASM({ - console.log(UTF8ToString($0)); - }, msg); -} - typedef target_mword SgenDescriptor; typedef SgenDescriptor MonoGCDescriptor; MONO_API int mono_gc_register_root (char *start, size_t size, MonoGCDescriptor descr, MonoGCRootSource source, void *key, const char *msg); @@ -387,7 +358,6 @@ mono_wasm_string_from_utf16_ref (const mono_unichar2 * chars, int length, MonoSt mono_gc_wbarrier_generic_store_atomic(result, NULL); } MONO_EXIT_GC_UNSAFE; - char* charString = mono_string_to_utf8(*result); } EMSCRIPTEN_KEEPALIVE int diff --git a/src/mono/browser/runtime/exports-internal.ts b/src/mono/browser/runtime/exports-internal.ts index b710f647de8a81..32480e9237b9df 100644 --- a/src/mono/browser/runtime/exports-internal.ts +++ b/src/mono/browser/runtime/exports-internal.ts @@ -5,7 +5,7 @@ import WasmEnableThreads from "consts:wasmEnableThreads"; import { MonoObjectNull, type MonoObject } from "./types/internal"; import cwraps, { profiler_c_functions, threads_c_functions as twraps } from "./cwraps"; -import { mono_wasm_send_dbg_command_with_parms, mono_wasm_send_dbg_command, mono_wasm_get_dbg_command_info, mono_wasm_get_details, mono_wasm_release_object, mono_wasm_call_function_on, mono_wasm_debugger_resume, mono_wasm_detach_debugger, mono_wasm_raise_debug_event, mono_wasm_change_debugger_log_level, mono_wasm_debugger_attached, MH_TestVoid, MH_SetLogVerbosity } from "./debug"; +import { mono_wasm_send_dbg_command_with_parms, mono_wasm_send_dbg_command, mono_wasm_get_dbg_command_info, mono_wasm_get_details, mono_wasm_release_object, mono_wasm_call_function_on, mono_wasm_debugger_resume, mono_wasm_detach_debugger, mono_wasm_raise_debug_event, mono_wasm_change_debugger_log_level, mono_wasm_debugger_attached } from "./debug"; import { http_wasm_supports_streaming_request, http_wasm_supports_streaming_response, http_wasm_create_controller, http_wasm_abort, http_wasm_transform_stream_write, http_wasm_transform_stream_close, http_wasm_fetch, http_wasm_fetch_stream, http_wasm_fetch_bytes, http_wasm_get_response_header_names, http_wasm_get_response_header_values, http_wasm_get_response_bytes, http_wasm_get_response_length, http_wasm_get_streamed_response_bytes, http_wasm_get_response_type, http_wasm_get_response_status } from "./http"; import { exportedRuntimeAPI, Module, runtimeHelpers } from "./globals"; import { get_property, set_property, has_property, get_typeof_property, get_global_this, dynamic_import } from "./invoke-js"; @@ -54,10 +54,6 @@ export function export_internal (): any { mono_wasm_debugger_attached, mono_wasm_runtime_is_ready: runtimeHelpers.mono_wasm_runtime_is_ready, mono_wasm_get_func_id_to_name_mappings, - - MH_TestVoid, - MH_SetLogVerbosity, - // interop get_property, set_property, From c40c6823640da5da77f7d0b9b958caa9efeb8714 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 7 Nov 2025 12:27:35 +0000 Subject: [PATCH 192/209] Delete .bak files --- src/mono/browser/runtime/invoke-cs.ts.bak | 383 ------------- src/mono/browser/runtime/invoke-js.ts.bak | 552 ------------------- src/mono/browser/runtime/marshal.ts.bak | 628 ---------------------- src/mono/browser/runtime/strings.ts.bak | 324 ----------- 4 files changed, 1887 deletions(-) delete mode 100644 src/mono/browser/runtime/invoke-cs.ts.bak delete mode 100644 src/mono/browser/runtime/invoke-js.ts.bak delete mode 100644 src/mono/browser/runtime/marshal.ts.bak delete mode 100644 src/mono/browser/runtime/strings.ts.bak diff --git a/src/mono/browser/runtime/invoke-cs.ts.bak b/src/mono/browser/runtime/invoke-cs.ts.bak deleted file mode 100644 index 6dd8eba2c10b81..00000000000000 --- a/src/mono/browser/runtime/invoke-cs.ts.bak +++ /dev/null @@ -1,383 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -import BuildConfiguration from "consts:configuration"; -import WasmEnableThreads from "consts:wasmEnableThreads"; - -import { Module, loaderHelpers, mono_assert, runtimeHelpers } from "./globals"; -import { bind_arg_marshal_to_cs } from "./marshal-to-cs"; -import { bind_arg_marshal_to_js, end_marshal_task_to_js } from "./marshal-to-js"; -import { - get_sig, get_signature_argument_count, - bound_cs_function_symbol, get_signature_version, alloc_stack_frame, get_signature_type, -} from "./marshal"; -import { MonoMethod, JSFunctionSignature, BoundMarshalerToCs, BoundMarshalerToJs, MarshalerType } from "./types/internal"; -import { assert_js_interop } from "./invoke-js"; -import { startMeasure, MeasuredBlock, endMeasure } from "./profiler"; -import { bind_assembly_exports, invoke_async_jsexport, invoke_sync_jsexport } from "./managed-exports"; -//import { mono_log_debug } from "./logging"; - -export function mono_wasm_bind_cs_function (method: MonoMethod, assemblyName: string, namespaceName: string, shortClassName: string, methodName: string, signatureHash: number, signature: JSFunctionSignature): void { - const fullyQualifiedName = `[${assemblyName}] ${namespaceName}.${shortClassName}:${methodName}`; - const mark = startMeasure(); - //mono_log_debug(() => `Binding [JSExport] ${namespaceName}.${shortClassName}:${methodName} from ${assemblyName} assembly`); - const version = get_signature_version(signature); - mono_assert(version === 2, () => `Signature version ${version} mismatch.`); - - - const args_count = get_signature_argument_count(signature); - - const arg_marshalers: (BoundMarshalerToCs)[] = new Array(args_count); - for (let index = 0; index < args_count; index++) { - const sig = get_sig(signature, index + 2); - const marshaler_type = get_signature_type(sig); - const arg_marshaler = bind_arg_marshal_to_cs(sig, marshaler_type, index + 2); - mono_assert(arg_marshaler, "ERR43: argument marshaler must be resolved"); - arg_marshalers[index] = arg_marshaler; - } - - const res_sig = get_sig(signature, 1); - let res_marshaler_type = get_signature_type(res_sig); - - // hack until we have public API for JSType.DiscardNoWait - if (WasmEnableThreads && shortClassName === "DefaultWebAssemblyJSRuntime" - && namespaceName === "Microsoft.AspNetCore.Components.WebAssembly.Services" - && (methodName === "BeginInvokeDotNet" || methodName === "EndInvokeJS" || methodName === "ReceiveByteArrayFromJS")) { - res_marshaler_type = MarshalerType.DiscardNoWait; - } - - const is_async = res_marshaler_type == MarshalerType.Task; - const is_discard_no_wait = res_marshaler_type == MarshalerType.DiscardNoWait; - if (is_async) { - res_marshaler_type = MarshalerType.TaskPreCreated; - } - const res_converter = bind_arg_marshal_to_js(res_sig, res_marshaler_type, 1); - - const closure: BindingClosure = { - method, - fullyQualifiedName, - args_count, - arg_marshalers, - res_converter, - is_async, - is_discard_no_wait, - isDisposed: false, - }; - let bound_fn: Function; - - if (is_async) { - if (args_count == 1 && res_converter) { - bound_fn = bind_fn_1RA(closure); - } else if (args_count == 2 && res_converter) { - bound_fn = bind_fn_2RA(closure); - } else { - bound_fn = bind_fn(closure); - } - } else if (is_discard_no_wait) { - bound_fn = bind_fn(closure); - } else { - if (args_count == 0 && !res_converter) { - bound_fn = bind_fn_0V(closure); - } else if (args_count == 1 && !res_converter) { - bound_fn = bind_fn_1V(closure); - } else if (args_count == 1 && res_converter) { - bound_fn = bind_fn_1R(closure); - } else if (args_count == 2 && res_converter) { - bound_fn = bind_fn_2R(closure); - } else { - bound_fn = bind_fn(closure); - } - } - - // this is just to make debugging easier. - // It's not CSP compliant and possibly not performant, that's why it's only enabled in debug builds - // in Release configuration, it would be a trimmed by rollup - if (BuildConfiguration === "Debug" && !runtimeHelpers.cspPolicy) { - try { - const url = `//# sourceURL=https://dotnet/JSExport/${methodName}`; - const body = `return (function JSExport_${methodName}(){ return fn.apply(this, arguments)});`; - bound_fn = new Function("fn", url + "\r\n" + body)(bound_fn); - } catch (ex) { - runtimeHelpers.cspPolicy = true; - } - } - - (bound_fn)[bound_cs_function_symbol] = closure; - - _walk_exports_to_set_function(assemblyName, namespaceName, shortClassName, methodName, signatureHash, bound_fn); - endMeasure(mark, MeasuredBlock.bindCsFunction, fullyQualifiedName); -} - -function bind_fn_0V (closure: BindingClosure) { - const method = closure.method; - const fqn = closure.fullyQualifiedName; - if (!WasmEnableThreads) (closure) = null; - return function bound_fn_0V () { - const mark = startMeasure(); - loaderHelpers.assert_runtime_running(); - mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); - const sp = Module.stackSave(); - try { - const size = 2; - const args = alloc_stack_frame(size); - // call C# side - invoke_sync_jsexport(method, args); - } finally { - Module.stackRestore(sp); - endMeasure(mark, MeasuredBlock.callCsFunction, fqn); - } - }; -} - -function bind_fn_1V (closure: BindingClosure) { - const method = closure.method; - const marshaler1 = closure.arg_marshalers[0]!; - const fqn = closure.fullyQualifiedName; - if (!WasmEnableThreads) (closure) = null; - return function bound_fn_1V (arg1: any) { - const mark = startMeasure(); - loaderHelpers.assert_runtime_running(); - mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); - const sp = Module.stackSave(); - try { - const size = 3; - const args = alloc_stack_frame(size); - marshaler1(args, arg1); - - // call C# side - invoke_sync_jsexport(method, args); - } finally { - Module.stackRestore(sp); - endMeasure(mark, MeasuredBlock.callCsFunction, fqn); - } - }; -} - -function bind_fn_1R (closure: BindingClosure) { - const method = closure.method; - const marshaler1 = closure.arg_marshalers[0]!; - const res_converter = closure.res_converter!; - const fqn = closure.fullyQualifiedName; - if (!WasmEnableThreads) (closure) = null; - return function bound_fn_1R (arg1: any) { - const mark = startMeasure(); - loaderHelpers.assert_runtime_running(); - mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); - const sp = Module.stackSave(); - try { - const size = 3; - const args = alloc_stack_frame(size); - marshaler1(args, arg1); - - // call C# side - invoke_sync_jsexport(method, args); - - const js_result = res_converter(args); - return js_result; - } finally { - Module.stackRestore(sp); - endMeasure(mark, MeasuredBlock.callCsFunction, fqn); - } - }; -} - -function bind_fn_1RA (closure: BindingClosure) { - const method = closure.method; - const marshaler1 = closure.arg_marshalers[0]!; - const res_converter = closure.res_converter!; - const fqn = closure.fullyQualifiedName; - if (!WasmEnableThreads) (closure) = null; - return function bind_fn_1RA (arg1: any) { - const mark = startMeasure(); - loaderHelpers.assert_runtime_running(); - mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); - const sp = Module.stackSave(); - try { - const size = 3; - const args = alloc_stack_frame(size); - marshaler1(args, arg1); - - // pre-allocate the promise - let promise = res_converter(args); - - // call C# side - invoke_async_jsexport(runtimeHelpers.managedThreadTID, method, args, size); - - // in case the C# side returned synchronously - promise = end_marshal_task_to_js(args, undefined, promise); - - return promise; - } finally { - Module.stackRestore(sp); - endMeasure(mark, MeasuredBlock.callCsFunction, fqn); - } - }; -} - -function bind_fn_2R (closure: BindingClosure) { - const method = closure.method; - const marshaler1 = closure.arg_marshalers[0]!; - const marshaler2 = closure.arg_marshalers[1]!; - const res_converter = closure.res_converter!; - const fqn = closure.fullyQualifiedName; - if (!WasmEnableThreads) (closure) = null; - return function bound_fn_2R (arg1: any, arg2: any) { - const mark = startMeasure(); - loaderHelpers.assert_runtime_running(); - mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); - const sp = Module.stackSave(); - try { - const size = 4; - const args = alloc_stack_frame(size); - marshaler1(args, arg1); - marshaler2(args, arg2); - - // call C# side - invoke_sync_jsexport(method, args); - - const js_result = res_converter(args); - return js_result; - } finally { - Module.stackRestore(sp); - endMeasure(mark, MeasuredBlock.callCsFunction, fqn); - } - }; -} - -function bind_fn_2RA (closure: BindingClosure) { - const method = closure.method; - const marshaler1 = closure.arg_marshalers[0]!; - const marshaler2 = closure.arg_marshalers[1]!; - const res_converter = closure.res_converter!; - const fqn = closure.fullyQualifiedName; - if (!WasmEnableThreads) (closure) = null; - return function bind_fn_2RA (arg1: any, arg2: any) { - const mark = startMeasure(); - loaderHelpers.assert_runtime_running(); - mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); - const sp = Module.stackSave(); - try { - const size = 4; - const args = alloc_stack_frame(size); - marshaler1(args, arg1); - marshaler2(args, arg2); - - // pre-allocate the promise - let promise = res_converter(args); - - // call C# side - invoke_async_jsexport(runtimeHelpers.managedThreadTID, method, args, size); - - // in case the C# side returned synchronously - promise = end_marshal_task_to_js(args, undefined, promise); - - return promise; - } finally { - Module.stackRestore(sp); - endMeasure(mark, MeasuredBlock.callCsFunction, fqn); - } - }; -} - -function bind_fn (closure: BindingClosure) { - const args_count = closure.args_count; - const arg_marshalers = closure.arg_marshalers; - const res_converter = closure.res_converter; - const method = closure.method; - const fqn = closure.fullyQualifiedName; - const is_async = closure.is_async; - const is_discard_no_wait = closure.is_discard_no_wait; - if (!WasmEnableThreads) (closure) = null; - return function bound_fn (...js_args: any[]) { - const mark = startMeasure(); - loaderHelpers.assert_runtime_running(); - mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); - const sp = Module.stackSave(); - try { - const size = 2 + args_count; - const args = alloc_stack_frame(size); - for (let index = 0; index < args_count; index++) { - const marshaler = arg_marshalers[index]; - if (marshaler) { - const js_arg = js_args[index]; - marshaler(args, js_arg); - } - } - let js_result = undefined; - if (is_async) { - // pre-allocate the promise - js_result = res_converter!(args); - } - - // call C# side - if (is_async) { - invoke_async_jsexport(runtimeHelpers.managedThreadTID, method, args, size); - // in case the C# side returned synchronously - js_result = end_marshal_task_to_js(args, undefined, js_result); - } else if (is_discard_no_wait) { - // call C# side, fire and forget - invoke_async_jsexport(runtimeHelpers.managedThreadTID, method, args, size); - } else { - invoke_sync_jsexport(method, args); - if (res_converter) { - js_result = res_converter(args); - } - } - return js_result; - } finally { - Module.stackRestore(sp); - endMeasure(mark, MeasuredBlock.callCsFunction, fqn); - } - }; -} - -type BindingClosure = { - fullyQualifiedName: string, - args_count: number, - method: MonoMethod, - arg_marshalers: (BoundMarshalerToCs)[], - res_converter: BoundMarshalerToJs | undefined, - is_async: boolean, - is_discard_no_wait: boolean, - isDisposed: boolean, -} - -export const exportsByAssembly: Map = new Map(); -function _walk_exports_to_set_function (assembly: string, namespace: string, classname: string, methodname: string, signature_hash: number, fn: Function): void { - const parts = `${namespace}.${classname}`.replace(/\//g, ".").split("."); - let scope: any = undefined; - let assemblyScope = exportsByAssembly.get(assembly); - if (!assemblyScope) { - assemblyScope = {}; - exportsByAssembly.set(assembly, assemblyScope); - exportsByAssembly.set(assembly + ".dll", assemblyScope); - } - scope = assemblyScope; - for (let i = 0; i < parts.length; i++) { - const part = parts[i]; - if (part != "") { - let newscope = scope[part]; - if (typeof newscope === "undefined") { - newscope = {}; - scope[part] = newscope; - } - mono_assert(newscope, () => `${part} not found while looking up ${classname}`); - scope = newscope; - } - } - - if (!scope[methodname]) { - scope[methodname] = fn; - } - scope[`${methodname}.${signature_hash}`] = fn; -} - -export async function mono_wasm_get_assembly_exports (assembly: string): Promise { - assert_js_interop(); - const result = exportsByAssembly.get(assembly); - if (!result) { - await bind_assembly_exports(assembly); - } - - return exportsByAssembly.get(assembly) || {}; -} diff --git a/src/mono/browser/runtime/invoke-js.ts.bak b/src/mono/browser/runtime/invoke-js.ts.bak deleted file mode 100644 index 0f235aff591ed8..00000000000000 --- a/src/mono/browser/runtime/invoke-js.ts.bak +++ /dev/null @@ -1,552 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -import WasmEnableThreads from "consts:wasmEnableThreads"; -import BuildConfiguration from "consts:configuration"; -//import isWasm64 from "consts:isWasm64" -const isWasm64 = true; // TODO: remove hardcoding! - -import { marshal_exception_to_cs, bind_arg_marshal_to_cs, marshal_task_to_cs } from "./marshal-to-cs"; -import { get_signature_argument_count, bound_js_function_symbol, get_sig, get_signature_version, get_signature_type, imported_js_function_symbol, get_signature_handle, get_signature_function_name, get_signature_module_name, is_receiver_should_free, get_caller_native_tid, get_sync_done_semaphore_ptr, get_arg } from "./marshal"; -import { fixupPointer, forceThreadMemoryViewRefresh, free } from "./memory"; -import { JSFunctionSignature, JSMarshalerArguments, BoundMarshalerToJs, JSFnHandle, BoundMarshalerToCs, JSHandle, MarshalerType } from "./types/internal"; -import { INTERNAL, Module, loaderHelpers, mono_assert, runtimeHelpers } from "./globals"; -import { bind_arg_marshal_to_js } from "./marshal-to-js"; -import { mono_log_debug, mono_wasm_symbolicate_string } from "./logging"; -import { mono_wasm_get_jsobj_from_js_handle } from "./gc-handles"; -import { endMeasure, MeasuredBlock, startMeasure } from "./profiler"; -import { wrap_as_cancelable_promise } from "./cancelable-promise"; -import { threads_c_functions as tcwraps } from "./cwraps"; -import { monoThreadInfo } from "./pthreads"; -import { stringToUTF16Ptr } from "./strings"; - -export function safeBigIntToNumber (ptr: bigint): number { - if (ptr > BigInt(Number.MAX_SAFE_INTEGER) || ptr < BigInt(Number.MIN_SAFE_INTEGER)) { - throw new Error(`Pointer value ${ptr} is out of safe integer range for JavaScript numbers.`); - } - return Number(ptr); -} - -export const js_import_wrapper_by_fn_handle: Function[] = [null];// 0th slot is dummy, main thread we free them on shutdown. On web worker thread we free them when worker is detached. -function toPointerForWasm (signature: number, wasm64: boolean): number | bigint { - return wasm64 ? BigInt(signature) : signature; -} - -export function mono_wasm_bind_js_import_ST (signature: JSFunctionSignature): number | bigint { - if (WasmEnableThreads) return isWasm64 ? 0n : 0; - assert_js_interop(); - signature = fixupPointer(signature, 0); - try { - bind_js_import(signature); - return isWasm64 ? (BigInt("0") as any) : 0; - } catch (ex: any) { - const ptr = stringToUTF16Ptr(normalize_exception(ex)); - // @ts-expect-error TS2352: convert VoidPtr (number) to bigint for wasm64, or keep it as number for wasm32. - return toPointerForWasm(ptr as number, isWasm64); - } -} - -export function mono_wasm_invoke_jsimport_MT (signature: JSFunctionSignature, args: JSMarshalerArguments) { - if (!WasmEnableThreads) return; - assert_js_interop(); - signature = fixupPointer(signature, 0); - args = fixupPointer(args, 0); - - const function_handle = get_signature_handle(signature); - - let bound_fn = js_import_wrapper_by_fn_handle[function_handle]; - if (bound_fn == undefined) { - // it was not bound yet, let's do it now - try { - bound_fn = bind_js_import(signature); - } catch (ex: any) { - // propagate the exception back to caller, which could be on different thread. Handle both sync and async signatures. - try { - const res_sig = get_sig(signature, 1); - const res_type = get_signature_type(res_sig); - if (res_type === MarshalerType.Task) { - const res = get_arg(args, 1); - marshal_task_to_cs(res, Promise.reject(ex)); - } else { - marshal_exception_to_cs(args, ex); - if (monoThreadInfo.isUI) { - const done_semaphore = get_sync_done_semaphore_ptr(args); - tcwraps.mono_threads_wasm_sync_run_in_target_thread_done(done_semaphore); - } - } - return; - } catch (ex: any) { - loaderHelpers.mono_exit(1, ex); - return; - } - } - } - mono_assert(bound_fn, () => `Imported function handle expected ${function_handle}`); - - bound_fn(args); -} - -function log_function_name_from_handle (function_handle: JSFnHandle): void { - const bound_fn = js_import_wrapper_by_fn_handle[function_handle]; - const closure = (bound_fn as any)[imported_js_function_symbol]; - if (closure) { - mono_log_debug(() => `Invoking ${closure.fqn}`); - } -} - -export function mono_wasm_invoke_jsimport_ST (function_handle: JSFnHandle, args: JSMarshalerArguments): void { - if (WasmEnableThreads) return; - log_function_name_from_handle(function_handle); - loaderHelpers.assert_runtime_running(); - args = fixupPointer(args, 0); - const bound_fn = js_import_wrapper_by_fn_handle[function_handle]; - mono_assert(bound_fn, () => `Imported function handle expected ${function_handle}`); - bound_fn(args); -} - -function bind_js_import (signature: JSFunctionSignature): Function { - assert_js_interop(); - const mark = startMeasure(); - - const version = get_signature_version(signature); - mono_assert(version === 2, () => `Signature version ${version} mismatch.`); - - const js_function_name = get_signature_function_name(signature)!; - const js_module_name = get_signature_module_name(signature)!; - const function_handle = get_signature_handle(signature); - - mono_log_debug(() => `Binding [JSImport] ${js_function_name} from ${js_module_name} module`); - - const fn = mono_wasm_lookup_js_import(js_function_name, js_module_name); - const args_count = get_signature_argument_count(signature); - - const arg_marshalers: (BoundMarshalerToJs)[] = new Array(args_count); - const arg_cleanup: (Function | undefined)[] = new Array(args_count); - let has_cleanup = false; - for (let index = 0; index < args_count; index++) { - const sig = get_sig(signature, index + 2); - const marshaler_type = get_signature_type(sig); - const arg_marshaler = bind_arg_marshal_to_js(sig, marshaler_type, index + 2); - mono_assert(arg_marshaler, "ERR42: argument marshaler must be resolved"); - arg_marshalers[index] = arg_marshaler; - if (marshaler_type === MarshalerType.Span) { - arg_cleanup[index] = (js_arg: any) => { - if (js_arg) { - js_arg.dispose(); - } - }; - has_cleanup = true; - } - } - const res_sig = get_sig(signature, 1); - const res_marshaler_type = get_signature_type(res_sig); - const res_converter = bind_arg_marshal_to_cs(res_sig, res_marshaler_type, 1); - - const is_discard_no_wait = res_marshaler_type == MarshalerType.DiscardNoWait; - const is_async = res_marshaler_type == MarshalerType.Task || res_marshaler_type == MarshalerType.TaskPreCreated; - - const closure: BindingClosure = { - fn, - fqn: js_module_name + ":" + js_function_name, - args_count, - arg_marshalers, - res_converter, - has_cleanup, - arg_cleanup, - is_discard_no_wait, - is_async, - isDisposed: false, - }; - let bound_fn: WrappedJSFunction; - if (is_async || is_discard_no_wait || has_cleanup) { - bound_fn = bind_fn(closure); - } else { - if (args_count == 0 && !res_converter) { - bound_fn = bind_fn_0V(closure); - } else if (args_count == 1 && !res_converter) { - bound_fn = bind_fn_1V(closure); - } else if (args_count == 1 && res_converter) { - bound_fn = bind_fn_1R(closure); - } else if (args_count == 2 && res_converter) { - bound_fn = bind_fn_2R(closure); - } else { - bound_fn = bind_fn(closure); - } - } - - function async_bound_fn (args: JSMarshalerArguments): void { - forceThreadMemoryViewRefresh(); - bound_fn(args); - } - function sync_bound_fn (args: JSMarshalerArguments): void { - const previous = runtimeHelpers.isPendingSynchronousCall; - try { - forceThreadMemoryViewRefresh(); - const caller_tid = get_caller_native_tid(args); - runtimeHelpers.isPendingSynchronousCall = runtimeHelpers.managedThreadTID === caller_tid; - bound_fn(args); - } finally { - runtimeHelpers.isPendingSynchronousCall = previous; - } - } - function async_bound_fn_ui (args: JSMarshalerArguments): void { - invoke_later_when_on_ui_thread_async(() => async_bound_fn(args)); - } - function sync_bound_fn_ui (args: JSMarshalerArguments): void { - invoke_later_when_on_ui_thread_sync(() => sync_bound_fn(args), args); - } - - let wrapped_fn: WrappedJSFunction = bound_fn; - if (WasmEnableThreads) { - if (monoThreadInfo.isUI) { - if (is_async || is_discard_no_wait) { - wrapped_fn = async_bound_fn_ui; - } else { - wrapped_fn = sync_bound_fn_ui; - } - } else { - if (is_async || is_discard_no_wait) { - wrapped_fn = async_bound_fn; - } else { - wrapped_fn = sync_bound_fn; - } - } - } - - // this is just to make debugging easier by naming the function in the stack trace. - // It's not CSP compliant and possibly not performant, that's why it's only enabled in debug builds - // in Release configuration, it would be a trimmed by rollup - if (BuildConfiguration === "Debug" && !runtimeHelpers.cspPolicy) { - try { - const fname = js_function_name.replaceAll(".", "_"); - const url = `//# sourceURL=https://dotnet/JSImport/${fname}`; - const body = `return (function JSImport_${fname}(){ return fn.apply(this, arguments)});`; - wrapped_fn = new Function("fn", url + "\r\n" + body)(wrapped_fn); - } catch (ex) { - runtimeHelpers.cspPolicy = true; - } - } - - (wrapped_fn)[imported_js_function_symbol] = closure; - - js_import_wrapper_by_fn_handle[function_handle] = wrapped_fn; - - endMeasure(mark, MeasuredBlock.bindJsFunction, js_function_name); - - return wrapped_fn; -} - -function bind_fn_0V (closure: BindingClosure) { - const fn = closure.fn; - const fqn = closure.fqn; - if (!WasmEnableThreads) (closure) = null; - return function bound_fn_0V (args: JSMarshalerArguments) { - const mark = startMeasure(); - try { - mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); - // call user function - fn(); - } catch (ex) { - marshal_exception_to_cs(args, ex); - } finally { - endMeasure(mark, MeasuredBlock.callCsFunction, fqn); - } - }; -} - -function bind_fn_1V (closure: BindingClosure) { - const fn = closure.fn; - const marshaler1 = closure.arg_marshalers[0]!; - const fqn = closure.fqn; - if (!WasmEnableThreads) (closure) = null; - return function bound_fn_1V (args: JSMarshalerArguments) { - const mark = startMeasure(); - try { - mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); - const arg1 = marshaler1(args); - // call user function - fn(arg1); - } catch (ex) { - marshal_exception_to_cs(args, ex); - } finally { - endMeasure(mark, MeasuredBlock.callCsFunction, fqn); - } - }; -} - -function bind_fn_1R (closure: BindingClosure) { - const fn = closure.fn; - const marshaler1 = closure.arg_marshalers[0]!; - const res_converter = closure.res_converter!; - const fqn = closure.fqn; - if (!WasmEnableThreads) (closure) = null; - return function bound_fn_1R (args: JSMarshalerArguments) { - const mark = startMeasure(); - try { - mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); - const arg1 = marshaler1(args); - // call user function - const js_result = fn(arg1); - res_converter(args, js_result); - } catch (ex) { - marshal_exception_to_cs(args, ex); - } finally { - endMeasure(mark, MeasuredBlock.callCsFunction, fqn); - } - }; -} - -function bind_fn_2R (closure: BindingClosure) { - const fn = closure.fn; - const marshaler1 = closure.arg_marshalers[0]!; - const marshaler2 = closure.arg_marshalers[1]!; - const res_converter = closure.res_converter!; - const fqn = closure.fqn; - if (!WasmEnableThreads) (closure) = null; - return function bound_fn_2R (args: JSMarshalerArguments) { - const mark = startMeasure(); - try { - mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); - const arg1 = marshaler1(args); - const arg2 = marshaler2(args); - // call user function - const js_result = fn(arg1, arg2); - res_converter(args, js_result); - } catch (ex) { - marshal_exception_to_cs(args, ex); - } finally { - endMeasure(mark, MeasuredBlock.callCsFunction, fqn); - } - }; -} - -function bind_fn (closure: BindingClosure) { - const args_count = closure.args_count; - const arg_marshalers = closure.arg_marshalers; - const res_converter = closure.res_converter; - const arg_cleanup = closure.arg_cleanup; - const has_cleanup = closure.has_cleanup; - const fn = closure.fn; - const fqn = closure.fqn; - if (!WasmEnableThreads) (closure) = null; - return function bound_fn (args: JSMarshalerArguments) { - const receiver_should_free = WasmEnableThreads && is_receiver_should_free(args); - const mark = startMeasure(); - try { - mono_assert(!WasmEnableThreads || !closure.isDisposed, "The function was already disposed"); - const js_args = new Array(args_count); - for (let index = 0; index < args_count; index++) { - const marshaler = arg_marshalers[index]!; - const js_arg = marshaler(args); - js_args[index] = js_arg; - } - - // call user function - const js_result = fn(...js_args); - - if (res_converter) { - res_converter(args, js_result); - } - - if (has_cleanup) { - for (let index = 0; index < args_count; index++) { - const cleanup = arg_cleanup[index]; - if (cleanup) { - cleanup(js_args[index]); - } - } - } - } catch (ex) { - marshal_exception_to_cs(args, ex); - } finally { - if (receiver_should_free) { - free(args as any); - } - endMeasure(mark, MeasuredBlock.callCsFunction, fqn); - } - }; -} - -type WrappedJSFunction = (args: JSMarshalerArguments) => void; - -type BindingClosure = { - fn: Function, - fqn: string, - isDisposed: boolean, - args_count: number, - arg_marshalers: (BoundMarshalerToJs)[], - res_converter: BoundMarshalerToCs | undefined, - has_cleanup: boolean, - is_discard_no_wait: boolean, - is_async: boolean, - arg_cleanup: (Function | undefined)[] -} - -export function mono_wasm_invoke_js_function (bound_function_js_handle: JSHandle, args: JSMarshalerArguments): void { - invoke_later_when_on_ui_thread_sync(() => mono_wasm_invoke_js_function_impl(bound_function_js_handle, args), args); -} - -export function mono_wasm_invoke_js_function_impl (bound_function_js_handle: JSHandle, args: JSMarshalerArguments): void { - loaderHelpers.assert_runtime_running(); - const bound_fn = mono_wasm_get_jsobj_from_js_handle(bound_function_js_handle); - mono_assert(bound_fn && typeof (bound_fn) === "function" && bound_fn[bound_js_function_symbol], () => `Bound function handle expected ${bound_function_js_handle}`); - args = fixupPointer(args, 0); - bound_fn(args); -} - -export function mono_wasm_set_module_imports (module_name: string, moduleImports: any) { - importedModules.set(module_name, moduleImports); - mono_log_debug(() => `added module imports '${module_name}'`); -} - -function mono_wasm_lookup_js_import (function_name: string, js_module_name: string | null): Function { - mono_assert(function_name && typeof function_name === "string", "function_name must be string"); - - let scope: any = {}; - const parts = function_name.split("."); - if (js_module_name) { - scope = importedModules.get(js_module_name); - if (WasmEnableThreads) { - mono_assert(scope, () => `ES6 module ${js_module_name} was not imported yet, please call JSHost.ImportAsync() on the UI or JSWebWorker thread first in order to invoke ${function_name}.`); - } else { - mono_assert(scope, () => `ES6 module ${js_module_name} was not imported yet, please call JSHost.ImportAsync() first in order to invoke ${function_name}.`); - } - } else if (parts[0] === "INTERNAL") { - scope = INTERNAL; - parts.shift(); - } else if (parts[0] === "globalThis") { - scope = globalThis; - parts.shift(); - } - - for (let i = 0; i < parts.length - 1; i++) { - const part = parts[i]; - const newscope = scope[part]; - if (!newscope) { - throw new Error(`${part} not found while looking up ${function_name}`); - } - scope = newscope; - } - - const fname = parts[parts.length - 1]; - const fn = scope[fname]; - - if (typeof (fn) !== "function") { - throw new Error(`${function_name} must be a Function but was ${typeof fn}`); - } - - // if the function was already bound to some object it would stay bound to original object. That's good. - return fn.bind(scope); -} - -export function set_property (self: any, name: string, value: any): void { - mono_check(self, "Null reference"); - self[name] = value; -} - -export function get_property (self: any, name: string): any { - mono_check(self, "Null reference"); - return self[name]; -} - -export function has_property (self: any, name: string): boolean { - mono_check(self, "Null reference"); - return name in self; -} - -export function get_typeof_property (self: any, name: string): string { - mono_check(self, "Null reference"); - return typeof self[name]; -} - -export function get_global_this (): any { - return globalThis; -} - -export const importedModulesPromises: Map> = new Map(); -export const importedModules: Map> = new Map(); - -export function dynamic_import (module_name: string, module_url: string): Promise { - assert_js_interop(); - mono_assert(module_name && typeof module_name === "string", "module_name must be string"); - mono_assert(module_url && typeof module_url === "string", "module_url must be string"); - let promise = importedModulesPromises.get(module_name); - const newPromise = !promise; - if (newPromise) { - mono_log_debug(() => `importing ES6 module '${module_name}' from '${module_url}'`); - promise = import(/*! webpackIgnore: true */module_url); - importedModulesPromises.set(module_name, promise); - } - - return wrap_as_cancelable_promise(async () => { - const module = await promise; - if (newPromise) { - importedModules.set(module_name, module); - mono_log_debug(() => `imported ES6 module '${module_name}' from '${module_url}'`); - } - return module; - }); -} - -export function normalize_exception (ex: any) { - let res = "unknown exception"; - if (ex) { - res = ex.toString(); - const stack = ex.stack; - if (stack) { - // Some JS runtimes insert the error message at the top of the stack, some don't, - // so normalize it by using the stack as the result if it already contains the error - if (stack.startsWith(res)) - res = stack; - else - res += "\n" + stack; - } - - res = mono_wasm_symbolicate_string(res); - } - return res; -} - -export function assert_js_interop (): void { - loaderHelpers.assert_runtime_running(); - if (WasmEnableThreads) { - mono_assert(runtimeHelpers.mono_wasm_bindings_is_ready && runtimeHelpers.proxyGCHandle, "Please use dedicated worker for working with JavaScript interop. See https://github.com/dotnet/runtime/blob/main/src/mono/wasm/threads.md#JS-interop-on-dedicated-threads"); - } else { - mono_assert(runtimeHelpers.mono_wasm_bindings_is_ready, "The runtime must be initialized."); - } -} - -export function assert_c_interop (): void { - loaderHelpers.assert_runtime_running(); - if (WasmEnableThreads) { - mono_assert(runtimeHelpers.mono_wasm_bindings_is_ready, "Please use dedicated worker for working with JavaScript interop. See https://github.com/dotnet/runtime/blob/main/src/mono/wasm/threads.md#JS-interop-on-dedicated-threads"); - } else { - mono_assert(runtimeHelpers.mono_wasm_bindings_is_ready, "The runtime must be initialized."); - } -} - -// make sure we are not blocking em_task_queue_execute up the call stack -// so that when we call back to managed, the FS calls could still be processed by the UI thread -// see also emscripten_yield which can process the FS calls inside the spin wait -export function invoke_later_when_on_ui_thread_sync (fn: Function, args: JSMarshalerArguments) { - if (WasmEnableThreads && monoThreadInfo.isUI) { - Module.safeSetTimeout(() => { - fn(); - // see also mono_threads_wasm_sync_run_in_target_thread_vii_cb - const done_semaphore = get_sync_done_semaphore_ptr(args); - tcwraps.mono_threads_wasm_sync_run_in_target_thread_done(done_semaphore); - }, 0); - } else { - fn(); - } -} - -// make sure we are not blocking em_task_queue_execute up the call stack -// so that when we call back to managed, the FS calls could still be processed by the UI thread -export function invoke_later_when_on_ui_thread_async (fn: Function) { - if (WasmEnableThreads && monoThreadInfo.isUI) { - Module.safeSetTimeout(fn, 0); - } else { - fn(); - } -} diff --git a/src/mono/browser/runtime/marshal.ts.bak b/src/mono/browser/runtime/marshal.ts.bak deleted file mode 100644 index 492a830b23bf3a..00000000000000 --- a/src/mono/browser/runtime/marshal.ts.bak +++ /dev/null @@ -1,628 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -import WasmEnableThreads from "consts:wasmEnableThreads"; -import isWasm64 from "consts:isWasm64"; -//const isWasm64 = true; // TODO: remove hardcoding! - -import { js_owned_gc_handle_symbol, teardown_managed_proxy } from "./gc-handles"; -import { Module, loaderHelpers, mono_assert, runtimeHelpers } from "./globals"; -import { getF32, getF64, getI16, getI32, getI64Big, getU16, getU32, getU8, setF32, setF64, setI16, setI32, setI64Big, setU16, setU32, setU8, localHeapViewF64, localHeapViewI32, localHeapViewU8, _zero_region, forceThreadMemoryViewRefresh, setB8, getB8 } from "./memory"; -import { mono_wasm_new_external_root } from "./roots"; -import { GCHandle, JSHandle, MonoObject, MonoString, GCHandleNull, JSMarshalerArguments, JSFunctionSignature, JSMarshalerType, JSMarshalerArgument, MarshalerToJs, MarshalerToCs, WasmRoot, MarshalerType, PThreadPtr, PThreadPtrNull, VoidPtrNull } from "./types/internal"; -import { TypedArray, VoidPtr } from "./types/emscripten"; -import { utf16ToString } from "./strings"; -import { get_managed_stack_trace } from "./managed-exports"; -//import { mono_log_debug } from "./logging"; - -export const cs_to_js_marshalers = new Map(); -export const js_to_cs_marshalers = new Map(); -export const bound_cs_function_symbol = Symbol.for("wasm bound_cs_function"); -export const bound_js_function_symbol = Symbol.for("wasm bound_js_function"); -export const imported_js_function_symbol = Symbol.for("wasm imported_js_function"); -export const proxy_debug_symbol = Symbol.for("wasm proxy_debug"); -export const JavaScriptMarshalerArgSize = isWasm64 ? 64 : 32; - -// keep in sync with JSMarshalerArgumentImpl offsets -const enum JSMarshalerArgumentOffsets { - BooleanValue = 0, - ByteValue = 0, - CharValue = 0, - Int16Value = 0, - Int32Value = 0, - Int64Value = 0, - SingleValue = 0, - DoubleValue = 0, - IntPtrValue = 0, - JSHandle = 8, - GCHandle = 8, - Length = 16, - Type = 24, - ElementType = 25, - ContextHandle = 32, - ReceiverShouldFree = 40, - CallerNativeTID = 48, - SyncDoneSemaphorePtr = 56, -} - -export const JSMarshalerTypeSize = 32; -// keep in sync with JSFunctionBinding.JSBindingType -const enum JSBindingTypeOffsets { - Type = 0, - ResultMarshalerType = 16, - Arg1MarshalerType = 20, - Arg2MarshalerType = 24, - Arg3MarshalerType = 28, -} -export const JSMarshalerSignatureHeaderSize = 4 * 8; // without Exception and Result -// keep in sync with JSFunctionBinding.JSBindingHeader -const enum JSBindingHeaderOffsets { - Version = 0, - ArgumentCount = 4, - ImportHandle = 8, - FunctionNameOffset = 16, - FunctionNameLength = 20, - ModuleNameOffset = 24, - ModuleNameLength = 28, - Exception = 32, - Result = 64, -} - -export function alloc_stack_frame (size: number): JSMarshalerArguments { - forceThreadMemoryViewRefresh(); - const bytes = JavaScriptMarshalerArgSize * size; - const args = Module.stackAlloc(bytes) as any; - _zero_region(args, bytes); - set_args_context(args); - return args; -} - -export function get_arg (args: JSMarshalerArguments, index: number): JSMarshalerArgument { - mono_assert(args, "Null args"); - return add_offset(args, index * JavaScriptMarshalerArgSize) as any; -} - -export function is_args_exception (args: JSMarshalerArguments): boolean { - mono_assert(args, "Null args"); - const exceptionType = get_arg_type(args); - return exceptionType !== MarshalerType.None; -} - -export function is_receiver_should_free (args: JSMarshalerArguments): boolean { - if (!WasmEnableThreads) return false; - mono_assert(args, "Null args"); - return getB8(add_offset(args, JSMarshalerArgumentOffsets.ReceiverShouldFree)); -} - -export function get_sync_done_semaphore_ptr (args: JSMarshalerArguments): VoidPtr { - if (!WasmEnableThreads) return VoidPtrNull; - mono_assert(args, "Null args"); - return get_arg_handle(args, JSMarshalerArgumentOffsets.SyncDoneSemaphorePtr) as any; -} - -export function get_caller_native_tid (args: JSMarshalerArguments): PThreadPtr { - if (!WasmEnableThreads) return PThreadPtrNull; - mono_assert(args, "Null args"); - return get_arg_handle(args, JSMarshalerArgumentOffsets.CallerNativeTID) as any; -} - -export function set_receiver_should_free (args: JSMarshalerArguments): void { - mono_assert(args, "Null args"); - setB8(add_offset(args, JSMarshalerArgumentOffsets.ReceiverShouldFree), true); -} - -export function set_args_context (args: JSMarshalerArguments): void { - if (!WasmEnableThreads) return; - mono_assert(args, "Null args"); - const exc = get_arg(args, 0); - const res = get_arg(args, 1); - set_arg_proxy_context(exc); - set_arg_proxy_context(res); -} -export function add_offset ( - ptr: JSMarshalerArguments | JSMarshalerArgument | JSFunctionSignature | number | bigint | JSMarshalerType, - offset: number -): number { - if (typeof ptr === "bigint") { - const result = ptr + BigInt(offset); - if (result > BigInt(Number.MAX_SAFE_INTEGER)) { - throw new Error("Offset too large for JavaScript typed arrays/DataView"); - } - return Number(result); - } else { - return (ptr as number) + offset; - } -} -export function normalizePointer (inPtr: bigint | number | VoidPtr): any { - const ptr = typeof inPtr === "bigint" ? Number(inPtr) : inPtr; - if (!Number.isSafeInteger(ptr)) { - if (typeof inPtr === "bigint") { - throw new Error("pointer value is out of safe integer range. Converted from bigint."); - } else { - throw new Error("pointer value is out of safe integer range."); - } - } - return ptr; -} -export function get_sig (signature: JSFunctionSignature, index: number): JSMarshalerType { - mono_assert(signature, "Null signatures"); - return add_offset(signature, (index * JSMarshalerTypeSize) + JSMarshalerSignatureHeaderSize) as any; -} - -export function get_signature_type (sig: JSMarshalerType): MarshalerType { - mono_assert(sig, "Null sig"); - return getU8(add_offset(sig, JSBindingTypeOffsets.Type)) as any; -} - -export function get_signature_res_type (sig: JSMarshalerType): MarshalerType { - mono_assert(sig, "Null sig"); - return getU8(add_offset(sig, JSBindingTypeOffsets.ResultMarshalerType)) as any; -} - -export function get_signature_arg1_type (sig: JSMarshalerType): MarshalerType { - mono_assert(sig, "Null sig"); - return getU8(add_offset(sig, JSBindingTypeOffsets.Arg1MarshalerType)) as any; -} - -export function get_signature_arg2_type (sig: JSMarshalerType): MarshalerType { - mono_assert(sig, "Null sig"); - return getU8(add_offset(sig, JSBindingTypeOffsets.Arg2MarshalerType)) as any; -} - -export function get_signature_arg3_type (sig: JSMarshalerType): MarshalerType { - mono_assert(sig, "Null sig"); - return getU8(add_offset(sig, JSBindingTypeOffsets.Arg3MarshalerType)) as any; -} - -export function get_signature_argument_count (signature: JSFunctionSignature): number { - mono_assert(signature, "Null signatures"); - return getI32(add_offset(signature, JSBindingHeaderOffsets.ArgumentCount)) as any; -} - -export function get_signature_version (signature: JSFunctionSignature): number { - mono_assert(signature, "Null signatures"); - const offset = add_offset(signature, JSBindingHeaderOffsets.Version); - return getI32(offset); -} - -export function get_signature_handle (signature: JSFunctionSignature): number { - mono_assert(signature, "Null signatures"); - return getI32(add_offset(signature, JSBindingHeaderOffsets.ImportHandle)) as any; -} - -export function get_signature_function_name (signature: JSFunctionSignature): string | null { - mono_assert(signature, "Null signatures"); - const functionNameOffset = getI32(add_offset(signature, JSBindingHeaderOffsets.FunctionNameOffset)); - if (functionNameOffset === 0) return null; - const functionNameLength = getI32(add_offset(signature, JSBindingHeaderOffsets.FunctionNameLength)); - mono_assert(functionNameOffset, "Null name"); - return utf16ToString( - add_offset(signature, functionNameOffset), - add_offset(signature, functionNameOffset + functionNameLength) - ); -} - -export function get_signature_module_name (signature: JSFunctionSignature): string | null { - mono_assert(signature, "Null signatures"); - const moduleNameOffset = getI32(add_offset(signature, JSBindingHeaderOffsets.ModuleNameOffset)); - if (moduleNameOffset === 0) return null; - const moduleNameLength = getI32(add_offset(signature, JSBindingHeaderOffsets.ModuleNameLength)); - return utf16ToString( - add_offset(signature, moduleNameOffset), - add_offset(signature, moduleNameOffset + moduleNameLength) - ); -} - -export function get_sig_type (sig: JSMarshalerType): MarshalerType { - mono_assert(sig, "Null signatures"); - return getU8(sig); -} - -export function get_arg_type (arg: JSMarshalerArgument): MarshalerType { - mono_assert(arg, "Null arg"); - const type = getU8(add_offset(arg, JSMarshalerArgumentOffsets.Type)); - return type as any; -} - -export function get_arg_element_type (arg: JSMarshalerArgument): MarshalerType { - mono_assert(arg, "Null arg"); - const type = getU8(add_offset(arg, JSMarshalerArgumentOffsets.ElementType)); - return type as any; -} - -export function set_arg_type (arg: JSMarshalerArgument, type: MarshalerType): void { - mono_assert(arg, "Null arg"); - setU8(add_offset(arg, JSMarshalerArgumentOffsets.Type), type); -} - -export function set_arg_element_type (arg: JSMarshalerArgument, type: MarshalerType): void { - mono_assert(arg, "Null arg"); - setU8(add_offset(arg, JSMarshalerArgumentOffsets.ElementType), type); -} - -export function get_arg_bool (arg: JSMarshalerArgument): boolean { - mono_assert(arg, "Null arg"); - return getB8(arg as any); -} - -export function get_arg_u8 (arg: JSMarshalerArgument): number { - mono_assert(arg, "Null arg"); - return getU8(arg as any); -} - -export function get_arg_u16 (arg: JSMarshalerArgument): number { - mono_assert(arg, "Null arg"); - return getU16(arg); -} - -export function get_arg_i16 (arg: JSMarshalerArgument): number { - mono_assert(arg, "Null arg"); - return getI16(arg); -} - -export function get_arg_i32 (arg: JSMarshalerArgument): number { - mono_assert(arg, "Null arg"); - return getI32(arg); -} - -export function get_arg_intptr (arg: JSMarshalerArgument): number | bigint { - mono_assert(arg, "Null arg"); - return isWasm64 ? getI64Big(arg) : getU32(arg); -} - -export function get_arg_i52 (arg: JSMarshalerArgument): number { - mono_assert(arg, "Null arg"); - // we know that the range check and conversion from Int64 was be done on C# side - return getF64(arg); -} - -export function get_arg_i64_big (arg: JSMarshalerArgument): bigint { - mono_assert(arg, "Null arg"); - return getI64Big(arg); -} - -export function get_arg_date (arg: JSMarshalerArgument): Date { - mono_assert(arg, "Null arg"); - const unixTime = getF64(arg); - const date = new Date(unixTime); - return date; -} - -export function get_arg_f32 (arg: JSMarshalerArgument): number { - mono_assert(arg, "Null arg"); - return getF32(arg); -} - -export function get_arg_f64 (arg: JSMarshalerArgument): number { - mono_assert(arg, "Null arg"); - return getF64(arg); -} - -export function set_arg_bool (arg: JSMarshalerArgument, value: boolean): void { - mono_assert(arg, "Null arg"); - mono_check(typeof value === "boolean", () => `Value is not a Boolean: ${value} (${typeof (value)})`); - setB8(arg, value); -} - -export function set_arg_u8 (arg: JSMarshalerArgument, value: number): void { - mono_assert(arg, "Null arg"); - setU8(arg, value); -} - -export function set_arg_u16 (arg: JSMarshalerArgument, value: number): void { - mono_assert(arg, "Null arg"); - setU16(arg, value); -} - -export function set_arg_i16 (arg: JSMarshalerArgument, value: number): void { - mono_assert(arg, "Null arg"); - setI16(arg, value); -} - -export function set_arg_i32 (arg: JSMarshalerArgument, value: number): void { - mono_assert(arg, "Null arg"); - setI32(arg, value); -} - -export function set_arg_intptr (arg: JSMarshalerArgument, value: VoidPtr | bigint | number): void { - mono_assert(arg, "Null arg"); - if (isWasm64) { - if (typeof value !== "bigint") - setI64Big(arg, BigInt(value as number)); - else - setI64Big(arg, value as bigint); - } else { - setU32(arg, value as number); - } -} - -export function set_arg_i52 (arg: JSMarshalerArgument, value: number): void { - mono_assert(arg, "Null arg"); - mono_check(Number.isSafeInteger(value), () => `Value is not an integer: ${value} (${typeof (value)})`); - // we know that conversion to Int64 would be done on C# side - setF64(arg, value); -} - -export function set_arg_i64_big (arg: JSMarshalerArgument, value: bigint): void { - mono_assert(arg, "Null arg"); - setI64Big(arg, value); -} - -export function set_arg_date (arg: JSMarshalerArgument, value: Date): void { - mono_assert(arg, "Null arg"); - // getTime() is always UTC - const unixTime = value.getTime(); - setF64(arg, unixTime); -} - -export function set_arg_f64 (arg: JSMarshalerArgument, value: number): void { - mono_assert(arg, "Null arg"); - setF64(arg, value); -} - -export function set_arg_f32 (arg: JSMarshalerArgument, value: number): void { - mono_assert(arg, "Null arg"); - setF32(arg, value); -} - -function set_arg_handle (arg: JSMarshalerArgument, offset: number, handle: JSHandle | GCHandle | undefined): void { - if (isWasm64) { - if (typeof handle !== "bigint") - setI64Big(add_offset(arg, offset), BigInt(handle as any as number)); - else - setI64Big(add_offset(arg, offset), handle as bigint); - } else { - setI32(add_offset(arg, offset), handle as any); - } -} - -function get_arg_handle (arg: JSMarshalerArgument | JSMarshalerArguments, offset: JSMarshalerArgumentOffsets): GCHandle | JSHandle | undefined { - return isWasm64 ? getI64Big(add_offset(arg, offset)) as any : getI32(add_offset(arg, offset)) as any; -} - -export function get_arg_js_handle (arg: JSMarshalerArgument): JSHandle { - mono_assert(arg, "Null arg"); - return get_arg_handle(arg, JSMarshalerArgumentOffsets.JSHandle) as any; - //return getI32(add_offset(arg, JSMarshalerArgumentOffsets.JSHandle)) as any; -} -export function set_arg_proxy_context (arg: JSMarshalerArgument): void { - if (!WasmEnableThreads) return; - mono_assert(arg, "Null arg"); - set_arg_handle(arg, JSMarshalerArgumentOffsets.ContextHandle, runtimeHelpers.proxyGCHandle); -} - -export function set_js_handle (arg: JSMarshalerArgument, jsHandle: JSHandle): void { - mono_assert(arg, "Null arg"); - set_arg_handle(arg, JSMarshalerArgumentOffsets.JSHandle, jsHandle); - set_arg_proxy_context(arg); -} - -export function get_arg_gc_handle (arg: JSMarshalerArgument): GCHandle { - mono_assert(arg, "Null arg"); - return get_arg_handle(arg, JSMarshalerArgumentOffsets.GCHandle) as any; -} - -export function set_gc_handle (arg: JSMarshalerArgument, gcHandle: GCHandle): void { - mono_assert(arg, "Null arg"); - set_arg_handle(arg, JSMarshalerArgumentOffsets.GCHandle, gcHandle); - set_arg_proxy_context(arg); -} - -export function get_string_root (arg: JSMarshalerArgument): WasmRoot { - mono_assert(arg, "Null arg"); - return mono_wasm_new_external_root(arg); -} - -export function get_arg_length (arg: JSMarshalerArgument): number { - mono_assert(arg, "Null arg"); - return getI32(add_offset(arg, JSMarshalerArgumentOffsets.Length)) as any; -} - -export function set_arg_length (arg: JSMarshalerArgument, size: number): void { - mono_assert(arg, "Null arg"); - setI32(add_offset(arg, JSMarshalerArgumentOffsets.Length), size); -} - -export function set_root (arg: JSMarshalerArgument, root: WasmRoot): void { - mono_assert(arg, "Null arg"); - setU32(add_offset(arg, 0), root.get_address()); -} - -export interface IDisposable { - dispose(): void; - get isDisposed(): boolean; -} - -export class ManagedObject implements IDisposable { - dispose (): void { - teardown_managed_proxy(this, GCHandleNull); - } - - get isDisposed (): boolean { - return (this)[js_owned_gc_handle_symbol] === GCHandleNull; - } - - toString (): string { - return `CsObject(gc_handle: ${(this)[js_owned_gc_handle_symbol]})`; - } -} - -export class ManagedError extends Error implements IDisposable { - private superStack: any; - private managed_stack: any; - constructor (message: string) { - super(message); - this.superStack = Object.getOwnPropertyDescriptor(this, "stack"); // this works on Chrome - Object.defineProperty(this, "stack", { - get: this.getManageStack, - }); - } - - getSuperStack () { - if (this.superStack) { - if (this.superStack.value !== undefined) - return this.superStack.value; - if (this.superStack.get !== undefined) - return this.superStack.get.call(this); - } - return super.stack; // this works on FF - } - - getManageStack () { - if (this.managed_stack) { - return this.managed_stack; - } - if (!loaderHelpers.is_runtime_running()) { - this.managed_stack = "... omitted managed stack trace.\n" + this.getSuperStack(); - return this.managed_stack; - } - if (!WasmEnableThreads || runtimeHelpers.proxyGCHandle) { - const gc_handle = (this)[js_owned_gc_handle_symbol]; - if (gc_handle !== GCHandleNull) { - const managed_stack = get_managed_stack_trace(gc_handle); - if (managed_stack) { - this.managed_stack = managed_stack + "\n" + this.getSuperStack(); - return this.managed_stack; - } - } - } - return this.getSuperStack(); - } - - dispose (): void { - teardown_managed_proxy(this, GCHandleNull); - } - - get isDisposed (): boolean { - return (this)[js_owned_gc_handle_symbol] === GCHandleNull; - } -} - -export function get_signature_marshaler (signature: JSFunctionSignature, index: number): JSHandle { - mono_assert(signature, "Null signatures"); - const sig = get_sig(signature, index); - return getU32(sig + JSBindingHeaderOffsets.ImportHandle); -} - - -export function array_element_size (element_type: MarshalerType): number { - return element_type == MarshalerType.Byte ? 1 - : element_type == MarshalerType.Int32 ? 4 - : element_type == MarshalerType.Int52 ? 8 - : element_type == MarshalerType.Double ? 8 - : element_type == MarshalerType.String ? JavaScriptMarshalerArgSize - : element_type == MarshalerType.Object ? JavaScriptMarshalerArgSize - : element_type == MarshalerType.JSObject ? JavaScriptMarshalerArgSize - : -1; -} - -export const enum MemoryViewType { - Byte = 0, - Int32 = 1, - Double = 2, -} - -abstract class MemoryView implements IMemoryView { - protected constructor (public _pointer: VoidPtr, public _length: number, public _viewType: MemoryViewType) { - } - - abstract dispose(): void; - abstract get isDisposed(): boolean; - - _unsafe_create_view (): TypedArray { - // this view must be short lived so that it doesn't fail after wasm memory growth - // for that reason we also don't give the view out to end user and provide set/slice/copyTo API instead - - const view = this._viewType == MemoryViewType.Byte ? new Uint8Array(localHeapViewU8().buffer, normalizePointer(this._pointer), this._length) - : this._viewType == MemoryViewType.Int32 ? new Int32Array(localHeapViewI32().buffer, normalizePointer(this._pointer), this._length) - : this._viewType == MemoryViewType.Double ? new Float64Array(localHeapViewF64().buffer, normalizePointer(this._pointer), this._length) - : null; - if (!view) throw new Error("NotImplementedException"); - return view; - } - - set (source: TypedArray, targetOffset?: number): void { - mono_check(!this.isDisposed, "ObjectDisposedException"); - const targetView = this._unsafe_create_view(); - mono_check(source && targetView && source.constructor === targetView.constructor, () => `Expected ${targetView.constructor}`); - targetView.set(source, targetOffset); - // TODO consider memory write barrier - } - - copyTo (target: TypedArray, sourceOffset?: number): void { - mono_check(!this.isDisposed, "ObjectDisposedException"); - const sourceView = this._unsafe_create_view(); - mono_check(target && sourceView && target.constructor === sourceView.constructor, () => `Expected ${sourceView.constructor}`); - const trimmedSource = sourceView.subarray(sourceOffset); - // TODO consider memory read barrier - target.set(trimmedSource); - } - - slice (start?: number, end?: number): TypedArray { - mono_check(!this.isDisposed, "ObjectDisposedException"); - const sourceView = this._unsafe_create_view(); - // TODO consider memory read barrier - return sourceView.slice(start, end); - } - - get length (): number { - mono_check(!this.isDisposed, "ObjectDisposedException"); - return this._length; - } - - get byteLength (): number { - mono_check(!this.isDisposed, "ObjectDisposedException"); - return this._viewType == MemoryViewType.Byte ? this._length - : this._viewType == MemoryViewType.Int32 ? this._length << 2 - : this._viewType == MemoryViewType.Double ? this._length << 3 - : 0; - } -} - -export interface IMemoryView extends IDisposable { - /** - * copies elements from provided source to the wasm memory. - * target has to have the elements of the same type as the underlying C# array. - * same as TypedArray.set() - */ - set(source: TypedArray, targetOffset?: number): void; - /** - * copies elements from wasm memory to provided target. - * target has to have the elements of the same type as the underlying C# array. - */ - copyTo(target: TypedArray, sourceOffset?: number): void; - /** - * same as TypedArray.slice() - */ - slice(start?: number, end?: number): TypedArray; - - get length(): number; - get byteLength(): number; -} - -export class Span extends MemoryView { - private is_disposed = false; - public constructor (pointer: VoidPtr, length: number, viewType: MemoryViewType) { - super(pointer, length, viewType); - } - dispose (): void { - this.is_disposed = true; - } - get isDisposed (): boolean { - return this.is_disposed; - } -} - -export class ArraySegment extends MemoryView { - public constructor (pointer: VoidPtr, length: number, viewType: MemoryViewType) { - super(pointer, length, viewType); - } - - dispose (): void { - teardown_managed_proxy(this, GCHandleNull); - } - - get isDisposed (): boolean { - return (this)[js_owned_gc_handle_symbol] === GCHandleNull; - } -} diff --git a/src/mono/browser/runtime/strings.ts.bak b/src/mono/browser/runtime/strings.ts.bak deleted file mode 100644 index 502a9541b49a43..00000000000000 --- a/src/mono/browser/runtime/strings.ts.bak +++ /dev/null @@ -1,324 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -import WasmEnableThreads from "consts:wasmEnableThreads"; -import isWasm64 from "consts:isWasm64"; -import { mono_wasm_new_root, mono_wasm_new_root_buffer } from "./roots"; -import { MonoString, MonoStringNull, WasmRoot, WasmRootBuffer } from "./types/internal"; -import { Module } from "./globals"; -import cwraps from "./cwraps"; -import { isSharedArrayBuffer, localHeapViewU8, getU32_local, setU16_local, localHeapViewU32, getU16_local, localHeapViewU16, _zero_region, malloc, free } from "./memory"; -import { NativePointer, CharPtr, VoidPtr } from "./types/emscripten"; -import { safeBigIntToNumber } from "./invoke-js"; - -export const interned_js_string_table = new Map(); -export const mono_wasm_empty_string = ""; -let mono_wasm_string_decoder_buffer: NativePointer | undefined; -export const interned_string_table = new Map(); -let _empty_string_ptr: MonoString = 0; -const _interned_string_full_root_buffers = []; -let _interned_string_current_root_buffer: WasmRootBuffer | null = null; -let _interned_string_current_root_buffer_count = 0; -let _text_decoder_utf16: TextDecoder | undefined | null; -let _text_decoder_utf8_relaxed: TextDecoder | undefined = undefined; -let _text_decoder_utf8_validating: TextDecoder | undefined = undefined; -let _text_encoder_utf8: TextEncoder | undefined = undefined; - -export function strings_init (): void { - if (!mono_wasm_string_decoder_buffer) { - if (typeof TextDecoder !== "undefined") { - _text_decoder_utf16 = new TextDecoder("utf-16le"); - _text_decoder_utf8_relaxed = new TextDecoder("utf-8", { fatal: false }); - _text_decoder_utf8_validating = new TextDecoder("utf-8"); - _text_encoder_utf8 = new TextEncoder(); - } - mono_wasm_string_decoder_buffer = malloc(12); - } - if (!mono_wasm_string_root) - mono_wasm_string_root = mono_wasm_new_root(); -} - -export function stringToUTF8 (str: string): Uint8Array { - if (_text_encoder_utf8 === undefined) { - const len = Module.lengthBytesUTF8(str); - const buffer = new Uint8Array(len); - Module.stringToUTF8Array(str, buffer, 0, len); - return buffer; - } - return _text_encoder_utf8.encode(str); -} - -export function stringToUTF8Ptr (str: string): CharPtr { - const size = Module.lengthBytesUTF8(str) + 1; - const ptr = malloc(size) as any; - const idx = typeof ptr === "bigint" ? safeBigIntToNumber(ptr) : ptr as number; - const buffer = localHeapViewU8().subarray(idx, idx + size); - Module.stringToUTF8Array(str, buffer, 0, size); - buffer[size - 1] = 0; - return ptr; -} - -export function utf8ToStringRelaxed (buffer: Uint8Array): string { - if (_text_decoder_utf8_relaxed === undefined) { - const retval = Module.UTF8ArrayToString(buffer, 0, buffer.byteLength); - return retval; - } - const retval = _text_decoder_utf8_relaxed.decode(buffer); - return retval; -} - -export function utf8ToString (ptr: CharPtr): string { - if (!ptr) { - return ""; - } - const heapU8 = localHeapViewU8(); - let idx: number; - if (typeof ptr === "bigint") { - idx = safeBigIntToNumber(ptr); - } else { - // @ts-expect-error TS2352 - idx = ptr as number; - } - if (idx === 0) - return ""; - return utf8BufferToString(heapU8, idx, heapU8.length - idx); -} - -export function utf8BufferToString (heapOrArray: Uint8Array, idx: number, maxBytesToRead: number): string { - const endIdx = idx + maxBytesToRead; - let endPtr = idx; - while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr; - if (endPtr - idx <= 16) { - const retval = Module.UTF8ArrayToString(heapOrArray, idx, maxBytesToRead); - return retval; - } - if (_text_decoder_utf8_validating === undefined) { - const retval = Module.UTF8ArrayToString(heapOrArray, idx, maxBytesToRead); - return retval; - } - const view = viewOrCopy(heapOrArray, idx as any, endPtr as any); - const retval = _text_decoder_utf8_validating.decode(view); - return retval; -} - -export function utf16ToString (startPtr: number, endPtr: number): string { - if (_text_decoder_utf16) { - const subArray = viewOrCopy(localHeapViewU8(), startPtr as any, endPtr as any); - return _text_decoder_utf16.decode(subArray); - } else { - return utf16ToStringLoop(startPtr, endPtr); - } -} - -export function utf16ToStringLoop (startPtr: number, endPtr: number): string { - let str = ""; - const heapU16 = localHeapViewU16(); - for (let i = startPtr; i < endPtr; i += 2) { - const char = getU16_local(heapU16, i); - str += String.fromCharCode(char); - } - return str; -} - -export function stringToUTF16 (dstPtr: number, endPtr: number, text: string) { - const heapI16 = localHeapViewU16(); - const len = text.length; - for (let i = 0; i < len; i++) { - setU16_local(heapI16, dstPtr, text.charCodeAt(i)); - dstPtr += 2; - if (dstPtr >= endPtr) break; - } -} - -export function stringToUTF16Ptr (str: string): VoidPtr { - const bytes = (str.length + 1) * 2; - const ptr = malloc(bytes) as any; - _zero_region(ptr, str.length * 2); - const ptrEnd = isWasm64 - ? BigInt(ptr) + BigInt(bytes) - : (ptr as unknown as number) + bytes; - stringToUTF16(ptr, ptrEnd as any, str); - return ptr; - -} - -export function monoStringToString (root: WasmRoot): string | null { - // TODO https://github.com/dotnet/runtime/issues/100411 - // after Blazor stops using monoStringToStringUnsafe - // mono_assert(!WasmEnableThreads, "Marshaling strings by reference is not supported in multithreaded mode"); - - if (root.value === MonoStringNull) - return null; - const ptrSize = isWasm64 ? 8 : 4; - const ppChars = mono_wasm_string_decoder_buffer + 0, - pLengthBytes = mono_wasm_string_decoder_buffer + ptrSize, - pIsInterned = mono_wasm_string_decoder_buffer + 2 * ptrSize; - - cwraps.mono_wasm_string_get_data_ref(root.address, ppChars, pLengthBytes, pIsInterned); - - let result = undefined; - const heapU32 = localHeapViewU32(); - const lengthBytes = getU32_local(heapU32, pLengthBytes), - pChars = getU32_local(heapU32, ppChars), - isInterned = getU32_local(heapU32, pIsInterned); - - if (isInterned) - result = interned_string_table.get(root.value)!; - - if (result === undefined) { - if (lengthBytes && pChars) { - result = utf16ToString(pChars, pChars + lengthBytes); - if (isInterned) - interned_string_table.set(root.value, result); - } else - result = mono_wasm_empty_string; - } - - if (result === undefined) - throw new Error(`internal error when decoding string at location ${root.value}`); - - return result; -} - -export function stringToMonoStringRoot (string: string, result: WasmRoot): void { - if (WasmEnableThreads) return; - result.clear(); - - if (string === null) - return; - else if (typeof (string) === "symbol") - stringToInternedMonoStringRoot(string, result); - else if (typeof (string) !== "string") - throw new Error("Expected string argument, got " + typeof (string)); - else if (string.length === 0) - // Always use an interned pointer for empty strings - stringToInternedMonoStringRoot(string, result); - else { - // Looking up large strings in the intern table will require the JS runtime to - // potentially hash them and then do full byte-by-byte comparisons, which is - // very expensive. Because we can not guarantee it won't happen, try to minimize - // the cost of this and prevent performance issues for large strings - if (string.length <= 256) { - const interned = interned_js_string_table.get(string); - if (interned) { - result.set(interned); - return; - } - } - - stringToMonoStringNewRoot(string, result); - } -} - -function stringToInternedMonoStringRoot (string: string | symbol, result: WasmRoot): void { - let text: string | undefined; - if (typeof (string) === "symbol") { - text = string.description; - if (typeof (text) !== "string") - text = Symbol.keyFor(string); - if (typeof (text) !== "string") - text = ""; - } else if (typeof (string) === "string") { - text = string; - } - - if (typeof (text) !== "string") { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - throw new Error(`Argument to stringToInternedMonoStringRoot must be a string but was ${string}`); - } - - if ((text.length === 0) && _empty_string_ptr) { - result.set(_empty_string_ptr); - return; - } - - const ptr = interned_js_string_table.get(text); - if (ptr) { - result.set(ptr); - return; - } - - stringToMonoStringNewRoot(text, result); - storeStringInInternTable(text, result, true); -} - -function storeStringInInternTable (string: string, root: WasmRoot, internIt: boolean): void { - if (!root.value) - throw new Error("null pointer passed to _store_string_in_intern_table"); - - const internBufferSize = 8192; - - if (_interned_string_current_root_buffer_count >= internBufferSize) { - _interned_string_full_root_buffers.push(_interned_string_current_root_buffer); - _interned_string_current_root_buffer = null; - } - if (!_interned_string_current_root_buffer) { - _interned_string_current_root_buffer = mono_wasm_new_root_buffer(internBufferSize, "interned strings"); - _interned_string_current_root_buffer_count = 0; - } - - const rootBuffer = _interned_string_current_root_buffer; - const index = _interned_string_current_root_buffer_count++; - - // Store the managed string into the managed intern table. This can theoretically - // provide a different managed object than the one we passed in, so update our - // pointer (stored in the root) with the result. - if (internIt) { - cwraps.mono_wasm_intern_string_ref(root.address); - if (!root.value) - throw new Error("mono_wasm_intern_string_ref produced a null pointer"); - } - - interned_js_string_table.set(string, root.value); - interned_string_table.set(root.value, string); - - if ((string.length === 0) && !_empty_string_ptr) - _empty_string_ptr = root.value; - - // Copy the final pointer into our interned string root buffer to ensure the string - // remains rooted. TODO: Is this actually necessary? - rootBuffer.copy_value_from_address(index, root.address); -} - -function stringToMonoStringNewRoot (string: string, result: WasmRoot): void { - const bufferLen = (string.length + 1) * 2; - // TODO this could be stack allocated for small strings - // or temp_malloc/alloca for large strings - // or skip the scratch buffer entirely, and make a new MonoString of size string.length, pin it, and then call stringToUTF16 to write directly into the MonoString's chars - const buffer = malloc(bufferLen); - _zero_region(buffer, bufferLen); - //FIXME: will need to use BigInt when emscripten returns BigInt from malloc - const bufferEnd = isWasm64 - ? buffer as any as number + bufferLen - : (buffer as any as number) + bufferLen; - stringToUTF16(buffer as any, bufferEnd as any, string); - // this function takes the length, not the end pointer - cwraps.mono_wasm_string_from_utf16_ref(buffer as any, string.length, result.address); - free(buffer); -} - -// When threading is enabled, TextDecoder does not accept a view of a -// SharedArrayBuffer, we must make a copy of the array first. -// See https://github.com/whatwg/encoding/issues/172 -export function viewOrCopy (view: Uint8Array, start: CharPtr, end: CharPtr): Uint8Array { - // this condition should be eliminated by rollup on non-threading builds - const needsCopy = isSharedArrayBuffer(view.buffer); - return needsCopy - ? view.slice(start, end) - : view.subarray(start, end); -} - -// below is minimal legacy support for Blazor -let mono_wasm_string_root: any; - -/* @deprecated not GC safe, use monoStringToString */ -export function monoStringToStringUnsafe (mono_string: MonoString): string | null { - if (mono_string === MonoStringNull) - return null; - - mono_wasm_string_root.value = mono_string; - const result = monoStringToString(mono_wasm_string_root); - mono_wasm_string_root.value = MonoStringNull; - return result; -} From 8392d654df8001e4ad7fe7ed761628825a90d7f9 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 7 Nov 2025 12:37:14 +0000 Subject: [PATCH 193/209] more tidying --- src/mono/browser/runtime/invoke-js.ts | 4 ++-- src/mono/browser/runtime/loader/assets.ts | 7 ------- src/mono/browser/runtime/loader/assetsCache.ts | 2 -- src/mono/browser/runtime/marshal.ts | 4 +--- 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/mono/browser/runtime/invoke-js.ts b/src/mono/browser/runtime/invoke-js.ts index 51373a1b0885a0..f302d60963d11a 100644 --- a/src/mono/browser/runtime/invoke-js.ts +++ b/src/mono/browser/runtime/invoke-js.ts @@ -3,8 +3,8 @@ import WasmEnableThreads from "consts:wasmEnableThreads"; import BuildConfiguration from "consts:configuration"; -//import isWasm64 from "consts:isWasm64" -const isWasm64 = true; // TODO: remove hardcoding! +// FIXME: remove hardcoding! +const isWasm64 = true; import { marshal_exception_to_cs, bind_arg_marshal_to_cs, marshal_task_to_cs } from "./marshal-to-cs"; import { get_signature_argument_count, bound_js_function_symbol, get_sig, get_signature_version, get_signature_type, imported_js_function_symbol, get_signature_handle, get_signature_function_name, get_signature_module_name, is_receiver_should_free, get_caller_native_tid, get_sync_done_semaphore_ptr, get_arg } from "./marshal"; diff --git a/src/mono/browser/runtime/loader/assets.ts b/src/mono/browser/runtime/loader/assets.ts index fa03a7f6c982e5..2f05054130ca93 100644 --- a/src/mono/browser/runtime/loader/assets.ts +++ b/src/mono/browser/runtime/loader/assets.ts @@ -198,19 +198,12 @@ export async function mono_download_assets (): Promise { mono_assert(typeof asset.resolvedUrl === "string", "resolvedUrl must be string"); const url = asset.resolvedUrl!; const buffer = await asset.buffer; - mono_log_debug("URL: " + url); - mono_log_debug("Type: " + typeof buffer); // should be 'object' - mono_log_debug(buffer instanceof ArrayBuffer ? "is ArrayBuffer" : "is not ArrayBuffer"); - mono_log_debug("Constructor: " + (buffer as any)?.constructor?.name); - mono_log_debug("Creating array:"); const data = new Uint8Array(buffer); - mono_log_debug("Created array:"); cleanupAsset(asset); // wait till after onRuntimeInitialized await runtimeHelpers.beforeOnRuntimeInitialized.promise; - mono_log_debug("Instantiating asset:" + url); runtimeHelpers.instantiate_asset(asset, url, data); } } else { diff --git a/src/mono/browser/runtime/loader/assetsCache.ts b/src/mono/browser/runtime/loader/assetsCache.ts index 1b5e3b9c90aa10..1be22cfdd1fde5 100644 --- a/src/mono/browser/runtime/loader/assetsCache.ts +++ b/src/mono/browser/runtime/loader/assetsCache.ts @@ -4,7 +4,6 @@ import type { MonoConfig } from "../types"; import type { AssetEntryInternal } from "../types/internal"; import { ENVIRONMENT_IS_WEB, loaderHelpers } from "./globals"; -import { mono_log_debug } from "./logging"; const usedCacheKeys: { [key: string]: boolean } = {}; const networkLoads: { [name: string]: LoadLogEntry } = {}; @@ -60,7 +59,6 @@ export async function purgeUnusedCacheEntriesAsync (): Promise { const cachedRequests = await cache.keys(); const deletionPromises = cachedRequests.map(async cachedRequest => { if (!(cachedRequest.url in usedCacheKeys)) { - mono_log_debug(`Purging unused cache entry: ${cachedRequest.url}`); await cache.delete(cachedRequest); } }); diff --git a/src/mono/browser/runtime/marshal.ts b/src/mono/browser/runtime/marshal.ts index e34a4e02b80b79..8594eaad9dc442 100644 --- a/src/mono/browser/runtime/marshal.ts +++ b/src/mono/browser/runtime/marshal.ts @@ -3,7 +3,6 @@ import WasmEnableThreads from "consts:wasmEnableThreads"; import isWasm64 from "consts:isWasm64"; -//const isWasm64 = true; // TODO: remove hardcoding! import { js_owned_gc_handle_symbol, teardown_managed_proxy } from "./gc-handles"; import { Module, loaderHelpers, mono_assert, runtimeHelpers } from "./globals"; @@ -381,8 +380,7 @@ function get_arg_handle (arg: JSMarshalerArgument | JSMarshalerArguments, offset export function get_arg_js_handle (arg: JSMarshalerArgument): JSHandle { mono_assert(arg, "Null arg"); - return get_arg_handle(arg, JSMarshalerArgumentOffsets.JSHandle) as any; - //return getI32(add_offset(arg, JSMarshalerArgumentOffsets.JSHandle)) as any; + return get_arg_handle(arg, JSMarshalerArgumentOffsets.JSHandle) as any; } export function set_arg_proxy_context (arg: JSMarshalerArgument): void { if (!WasmEnableThreads) return; From 2ef447ca042b04469191c670862d11370e6ed3e7 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 7 Nov 2025 12:53:44 +0000 Subject: [PATCH 194/209] Remove all mh_log header includes --- src/mono/browser/runtime/invoke-js.ts | 9 -- src/mono/browser/runtime/marshal.ts | 2 +- src/mono/browser/runtime/startup.ts | 1 + src/mono/browser/runtime/strings.ts | 2 - src/mono/cmake/configure.cmake | 6 - src/mono/mono.proj | 26 +--- src/mono/mono/component/marshal-ilgen.c | 20 +-- src/mono/mono/eglib/gptrarray.c | 12 +- src/mono/mono/metadata/CMakeLists.txt | 3 +- src/mono/mono/metadata/appdomain.c | 1 - src/mono/mono/metadata/assembly.c | 1 - src/mono/mono/metadata/class.c | 1 - src/mono/mono/metadata/debug-helpers.c | 1 - src/mono/mono/metadata/gc.c | 1 - src/mono/mono/metadata/icall.c | 1 - src/mono/mono/metadata/loader.c | 1 - src/mono/mono/metadata/marshal.c | 1 - src/mono/mono/metadata/mh_log.c | 146 --------------------- src/mono/mono/metadata/object-internals.h | 1 - src/mono/mono/metadata/object.c | 1 - src/mono/mono/mini/aot-runtime-wasm.c | 1 - src/mono/mono/mini/interp/interp-icalls.c | 1 - src/mono/mono/mini/interp/interp-pinvoke.c | 1 - src/mono/mono/mini/interp/interp.c | 1 - src/mono/mono/profiler/browser.c | 1 - src/native/public/mono/metadata/mh_log.h | 50 ------- 26 files changed, 14 insertions(+), 278 deletions(-) delete mode 100644 src/mono/mono/metadata/mh_log.c delete mode 100644 src/native/public/mono/metadata/mh_log.h diff --git a/src/mono/browser/runtime/invoke-js.ts b/src/mono/browser/runtime/invoke-js.ts index f302d60963d11a..960def447d50e9 100644 --- a/src/mono/browser/runtime/invoke-js.ts +++ b/src/mono/browser/runtime/invoke-js.ts @@ -86,17 +86,8 @@ export function mono_wasm_invoke_jsimport_MT (signature: JSFunctionSignature, ar bound_fn(args); } -//function log_function_name_from_handle (function_handle: JSFnHandle): void { -// const bound_fn = js_import_wrapper_by_fn_handle[function_handle]; -// const closure = (bound_fn as any)[imported_js_function_symbol]; -// if (closure) { -// mono_log_debug(() => `Invoking ${closure.fqn}`); -// } -//} - export function mono_wasm_invoke_jsimport_ST (function_handle: JSFnHandle, args: JSMarshalerArguments): void { if (WasmEnableThreads) return; - //log_function_name_from_handle(function_handle); loaderHelpers.assert_runtime_running(); args = fixupPointer(args, 0); const bound_fn = js_import_wrapper_by_fn_handle[function_handle]; diff --git a/src/mono/browser/runtime/marshal.ts b/src/mono/browser/runtime/marshal.ts index 8594eaad9dc442..2c725bdeaa1bbc 100644 --- a/src/mono/browser/runtime/marshal.ts +++ b/src/mono/browser/runtime/marshal.ts @@ -380,7 +380,7 @@ function get_arg_handle (arg: JSMarshalerArgument | JSMarshalerArguments, offset export function get_arg_js_handle (arg: JSMarshalerArgument): JSHandle { mono_assert(arg, "Null arg"); - return get_arg_handle(arg, JSMarshalerArgumentOffsets.JSHandle) as any; + return get_arg_handle(arg, JSMarshalerArgumentOffsets.JSHandle) as any; } export function set_arg_proxy_context (arg: JSMarshalerArgument): void { if (!WasmEnableThreads) return; diff --git a/src/mono/browser/runtime/startup.ts b/src/mono/browser/runtime/startup.ts index 5aa307483fb771..712d542b381834 100644 --- a/src/mono/browser/runtime/startup.ts +++ b/src/mono/browser/runtime/startup.ts @@ -34,6 +34,7 @@ import { runtimeList } from "./exports"; import { nativeAbort, nativeExit } from "./run"; import { replaceEmscriptenPThreadInit } from "./pthreads/worker-thread"; +//FIXME: remove hardcoding const ptrSize = 8; export async function configureRuntimeStartup (module: DotnetModuleInternal): Promise { diff --git a/src/mono/browser/runtime/strings.ts b/src/mono/browser/runtime/strings.ts index bd74bd831cf8a1..e3430c2f7c307e 100644 --- a/src/mono/browser/runtime/strings.ts +++ b/src/mono/browser/runtime/strings.ts @@ -190,8 +190,6 @@ export function stringToMonoStringRoot (string: string, result: WasmRoot - - - - - - - <_MonoLLVMTargetArchitecture Condition="'$(TargetArchitecture)' == 'wasm'">$(BuildArchitecture) <_MonoLLVMTargetArchitecture Condition="'$(TargetArchitecture)' != 'wasm'">$(TargetArchitecture) <_MonoLLVMHostArchitecture Condition="'$(AotHostArchitecture)' != ''">$(AotHostArchitecture) - - - - - + <_MonoCMakeArgs Condition="'$(_MonoUseNinja)' == 'true'" Include="-G Ninja"/> <_MonoCMakeArgs Include="-DCMAKE_INSTALL_PREFIX="$(MonoObjDir.Replace('\','/'))out""/> @@ -575,8 +564,7 @@ JS_ENGINES = [NODE_JS] wasm64-unknown-none - - + <_MonoCMakeArgs Include="-DENABLE_MINIMAL=jit,sgen_major_marksweep_conc,sgen_split_nursery,sgen_gc_bridge,sgen_toggleref,sgen_debug_helpers,sgen_binary_protocol,logging,interpreter,qcalls$(_MonoMinimal)"/> <_MonoCMakeArgs Include="-DENABLE_INTERP_LIB=1"/> @@ -826,9 +814,7 @@ JS_ENGINES = [NODE_JS] - - - + $(BuildArchitecture) @@ -915,11 +901,7 @@ JS_ENGINES = [NODE_JS] <_MonoAOTCXXFLAGS Condition="'$(WasmEnableMemory64)' == 'true'" Include="-DMEMORY64=1 --target=wasm64 -g -O0" /> - - - - - + <_MonoAOTCPPFLAGS Include="-DHOST_WIN32" /> diff --git a/src/mono/mono/component/marshal-ilgen.c b/src/mono/mono/component/marshal-ilgen.c index 0eb199c2349503..3d8cdbf4c23be2 100644 --- a/src/mono/mono/component/marshal-ilgen.c +++ b/src/mono/mono/component/marshal-ilgen.c @@ -442,8 +442,7 @@ emit_marshal_array_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, if (eklass == cb_to_mono->mono_defaults->string_class) { is_string = TRUE; - gboolean need_free; - MH_LOGV(MH_LVL_VERBOSE, "MARSHAL_ACTION_MANAGED_CONV_IN"); + gboolean need_free; conv = cb_to_mono->get_ptr_to_string_conv (m->piinfo, spec, &need_free); } else if (eklass == cb_to_mono->try_get_stringbuilder_class ()) { @@ -1722,8 +1721,7 @@ emit_marshal_string_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, } break; - case MARSHAL_ACTION_CONV_OUT: - MH_LOGV(MH_LVL_VERBOSE, "MARSHAL_ACTION_CONV_OUT"); + case MARSHAL_ACTION_CONV_OUT: conv = cb_to_mono->get_ptr_to_string_conv (m->piinfo, spec, &need_free); if (conv == MONO_MARSHAL_CONV_INVALID) { char *msg = g_strdup_printf ("string marshalling conversion %d not implemented", encoding); @@ -1732,7 +1730,6 @@ emit_marshal_string_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, } if (encoding == MONO_NATIVE_VBBYREFSTR) { - MH_LOGV(MH_LVL_VERBOSE, "MONO_NATIVE_VBBYREFSTR"); if (!m_type_is_byref (t)) { char *msg = g_strdup ("VBByRefStr marshalling requires a ref parameter."); cb_to_mono->methodBuilder.emit_exception_marshal_directive (mb, msg); @@ -1757,8 +1754,7 @@ emit_marshal_string_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, cb_to_mono->methodBuilder.emit_managed_call (mb, method, NULL); mono_mb_emit_jit_icall (mb, mono_string_new_len_wrapper); cb_to_mono->methodBuilder.emit_byte (mb, CEE_STIND_REF); - } else if (m_type_is_byref (t) && (t->attrs & PARAM_ATTRIBUTE_OUT || !(t->attrs & PARAM_ATTRIBUTE_IN))) { - MH_LOGV(MH_LVL_VERBOSE, "m_type_is_byref (t) && (t->attrs & PARAM_ATTRIBUTE_OUT || !(t->attrs & PARAM_ATTRIBUTE_IN))"); + } else if (m_type_is_byref (t) && (t->attrs & PARAM_ATTRIBUTE_OUT || !(t->attrs & PARAM_ATTRIBUTE_IN))) { int stind_op; cb_to_mono->methodBuilder.emit_ldarg (mb, argnum); cb_to_mono->methodBuilder.emit_ldloc (mb, conv_arg); @@ -1766,10 +1762,6 @@ emit_marshal_string_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, cb_to_mono->methodBuilder.emit_byte (mb, GINT_TO_UINT8 (stind_op)); need_free = TRUE; } - else - { - MH_LOGV(MH_LVL_VERBOSE, "Met no conditions. Need_free = %s", need_free ? "true" : "false"); - } if (need_free) { cb_to_mono->methodBuilder.emit_ldloc (mb, conv_arg); @@ -1785,8 +1777,7 @@ emit_marshal_string_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, break; case MARSHAL_ACTION_CONV_RESULT: - cb_to_mono->methodBuilder.emit_stloc (mb, 0); - MH_LOGV(MH_LVL_VERBOSE, "MARSHAL_ACTION_CONV_RESULT"); + cb_to_mono->methodBuilder.emit_stloc (mb, 0); conv = cb_to_mono->get_ptr_to_string_conv (m->piinfo, spec, &need_free); if (conv == MONO_MARSHAL_CONV_INVALID) { char *msg = g_strdup_printf ("string marshalling conversion %d not implemented", encoding); @@ -1811,8 +1802,7 @@ emit_marshal_string_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, if (m_type_is_byref (t)) { if (t->attrs & PARAM_ATTRIBUTE_OUT) break; - } - MH_LOGV(MH_LVL_VERBOSE, "MARSHAL_ACTION_MANAGED_CONV_IN"); + } conv = cb_to_mono->get_ptr_to_string_conv (m->piinfo, spec, &need_free); if (conv == MONO_MARSHAL_CONV_INVALID) { char *msg = g_strdup_printf ("string marshalling conversion %d not implemented", encoding); diff --git a/src/mono/mono/eglib/gptrarray.c b/src/mono/mono/eglib/gptrarray.c index ca6a5f71a4258e..bfde54c200c902 100644 --- a/src/mono/mono/eglib/gptrarray.c +++ b/src/mono/mono/eglib/gptrarray.c @@ -59,9 +59,7 @@ g_ptr_array_grow(GPtrArrayPriv *array, guint length) GPtrArray * g_ptr_array_new(void) -{ - //printf("MH_LOG_EGLIB: Creating g_ptr_array\n"); - +{ return g_ptr_array_sized_new(0); } @@ -119,13 +117,7 @@ g_ptr_array_add(GPtrArray *array, gpointer data) g_assert (array); g_assert(sizeof(gpointer) == 8); g_ptr_array_grow((GPtrArrayPriv *)array, 1); - array->pdata[array->len++] = data; - //fprintf(stderr, "MH_LOG_EGLIB: Added %p to gptr_array %p. Sizeof gpointer is %zd. Length is now %d. Size is now %d. array->pdata is %p." - // "address of array is %p. size of GPtrArray struct is %d\n", data, array, sizeof(gpointer), array->len, ((GPtrArrayPriv *)array)->size, array->pdata, &array, (int)sizeof(GPtrArray)); - //fflush(stderr); - /*for(guint i = 0; i < array->len; i++) { - fprintf(stderr, "MH_LOG_EGLIB: gptr_array %p contains %p at index %d\n", array, array->pdata[i], i); - }*/ + array->pdata[array->len++] = data; } gpointer diff --git a/src/mono/mono/metadata/CMakeLists.txt b/src/mono/mono/metadata/CMakeLists.txt index 381c37d02489ae..64ce99ac5df473 100644 --- a/src/mono/mono/metadata/CMakeLists.txt +++ b/src/mono/mono/metadata/CMakeLists.txt @@ -99,8 +99,7 @@ set(metadata_common_sources metadata-update.c method-builder.h method-builder-internals.h - method-builder.c - mh_log.c + method-builder.c mono-basic-block.c mono-basic-block.h mono-config.c diff --git a/src/mono/mono/metadata/appdomain.c b/src/mono/mono/metadata/appdomain.c index ca54b9bf979254..32f975191a3873 100644 --- a/src/mono/mono/metadata/appdomain.c +++ b/src/mono/mono/metadata/appdomain.c @@ -57,7 +57,6 @@ #include #include #include -#include #ifdef HOST_WIN32 #include diff --git a/src/mono/mono/metadata/assembly.c b/src/mono/mono/metadata/assembly.c index aeb19748ec4016..f027ff4d572d2a 100644 --- a/src/mono/mono/metadata/assembly.c +++ b/src/mono/mono/metadata/assembly.c @@ -44,7 +44,6 @@ #include #include #include -#include #ifndef HOST_WIN32 #include diff --git a/src/mono/mono/metadata/class.c b/src/mono/mono/metadata/class.c index bb1ee8d8e86a08..80803ffcd9c0a3 100644 --- a/src/mono/mono/metadata/class.c +++ b/src/mono/mono/metadata/class.c @@ -52,7 +52,6 @@ #include // for dn_simdhash_ght_t #include "../native/containers/dn-simdhash-specializations.h" -#include MonoStats mono_stats; /* Statistics */ diff --git a/src/mono/mono/metadata/debug-helpers.c b/src/mono/mono/metadata/debug-helpers.c index cebb65f53b9081..5fac5220a80295 100644 --- a/src/mono/mono/metadata/debug-helpers.c +++ b/src/mono/mono/metadata/debug-helpers.c @@ -21,7 +21,6 @@ #include "mono/metadata/appdomain.h" #include "mono/metadata/abi-details.h" -#include #ifdef MONO_CLASS_DEF_PRIVATE /* Rationale: we want the functions in this file to work even when everything diff --git a/src/mono/mono/metadata/gc.c b/src/mono/mono/metadata/gc.c index ea1f368d805023..57bf7d6b2e5fdf 100644 --- a/src/mono/mono/metadata/gc.c +++ b/src/mono/mono/metadata/gc.c @@ -9,7 +9,6 @@ * Copyright 2012 Xamarin Inc (http://www.xamarin.com) * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ -#include #include #include #include diff --git a/src/mono/mono/metadata/icall.c b/src/mono/mono/metadata/icall.c index 1ed73e42148601..10f5faf339e86c 100644 --- a/src/mono/mono/metadata/icall.c +++ b/src/mono/mono/metadata/icall.c @@ -75,7 +75,6 @@ #include #include #include -#include #include #include #include diff --git a/src/mono/mono/metadata/loader.c b/src/mono/mono/metadata/loader.c index 69207106ecb146..140efed6d66a2b 100644 --- a/src/mono/mono/metadata/loader.c +++ b/src/mono/mono/metadata/loader.c @@ -51,7 +51,6 @@ #include #include #include -#include /* * This lock protects the hash tables inside MonoImage used by the metadata * loading functions in class.c and loader.c. diff --git a/src/mono/mono/metadata/marshal.c b/src/mono/mono/metadata/marshal.c index 567754f8199d9a..37eeb3f6df6bad 100644 --- a/src/mono/mono/metadata/marshal.c +++ b/src/mono/mono/metadata/marshal.c @@ -77,7 +77,6 @@ MONO_PRAGMA_WARNING_POP() #include #include "icall-decl.h" #include "icall-signatures.h" -#include static void mono_string_utf16len_to_builder (MonoStringBuilderHandle sb, const gunichar2 *text, gsize len, MonoError *error); diff --git a/src/mono/mono/metadata/mh_log.c b/src/mono/mono/metadata/mh_log.c deleted file mode 100644 index 62827b6758e215..00000000000000 --- a/src/mono/mono/metadata/mh_log.c +++ /dev/null @@ -1,146 +0,0 @@ -#include -#include - -static int MH_LOG_verbosity_level = MH_LVL_INFO; -static int MH_LOG_verbosity_initialized = 0; - -void mh_log_set_verbosity(int verbosity) -{ - MH_LOG_verbosity_level = verbosity; - MH_LOG_verbosity_initialized = 1; -} - -int mh_log_get_verbosity() { - if (!MH_LOG_verbosity_initialized) { - const char* env = getenv("MH_LOG_VERBOSITY"); - if (env) { - MH_LOG_verbosity_level = atoi(env); - } - MH_LOG_verbosity_initialized = 1; - } - return MH_LOG_verbosity_level; -} - - -void log_mono_type(MonoType* type) { - if (!type) { - MH_LOG("MonoType: NULL"); - return; - } - - const char* type_str = NULL; - - switch (type->type) { - case MONO_TYPE_VOID: type_str = "VOID"; break; - case MONO_TYPE_BOOLEAN: type_str = "BOOLEAN"; break; - case MONO_TYPE_CHAR: type_str = "CHAR"; break; - case MONO_TYPE_I1: type_str = "I1"; break; - case MONO_TYPE_U1: type_str = "U1"; break; - case MONO_TYPE_I2: type_str = "I2"; break; - case MONO_TYPE_U2: type_str = "U2"; break; - case MONO_TYPE_I4: type_str = "I4"; break; - case MONO_TYPE_U4: type_str = "U4"; break; - case MONO_TYPE_I8: type_str = "I8"; break; - case MONO_TYPE_U8: type_str = "U8"; break; - case MONO_TYPE_R4: type_str = "R4"; break; - case MONO_TYPE_R8: type_str = "R8"; break; - case MONO_TYPE_STRING: type_str = "STRING"; break; - case MONO_TYPE_PTR: type_str = "PTR"; break; - case MONO_TYPE_BYREF: type_str = "BYREF"; break; - case MONO_TYPE_VALUETYPE: type_str = "VALUETYPE"; break; - case MONO_TYPE_CLASS: type_str = "CLASS"; break; - case MONO_TYPE_ARRAY: type_str = "ARRAY"; break; - case MONO_TYPE_SZARRAY: type_str = "SZARRAY"; break; - case MONO_TYPE_OBJECT: type_str = "OBJECT"; break; - case MONO_TYPE_VAR: type_str = "VAR"; break; - case MONO_TYPE_MVAR: type_str = "MVAR"; break; - case MONO_TYPE_GENERICINST: type_str = "GENERICINST"; break; - case MONO_TYPE_FNPTR: type_str = "FNPTR"; break; - default: type_str = "UNKNOWN"; break; - } - - MH_LOG("MonoType: %s (%d)", type_str, type->type); -} - -void log_mono_type_enum(MonoTypeEnum type_enum) { - const char* type_str = NULL; - - switch (type_enum) { - case MONO_TYPE_END: type_str = "END"; break; - case MONO_TYPE_VOID: type_str = "VOID"; break; - case MONO_TYPE_BOOLEAN: type_str = "BOOLEAN"; break; - case MONO_TYPE_CHAR: type_str = "CHAR"; break; - case MONO_TYPE_I1: type_str = "I1"; break; - case MONO_TYPE_U1: type_str = "U1"; break; - case MONO_TYPE_I2: type_str = "I2"; break; - case MONO_TYPE_U2: type_str = "U2"; break; - case MONO_TYPE_I4: type_str = "I4"; break; - case MONO_TYPE_U4: type_str = "U4"; break; - case MONO_TYPE_I8: type_str = "I8"; break; - case MONO_TYPE_U8: type_str = "U8"; break; - case MONO_TYPE_R4: type_str = "R4"; break; - case MONO_TYPE_R8: type_str = "R8"; break; - case MONO_TYPE_STRING: type_str = "STRING"; break; - case MONO_TYPE_PTR: type_str = "PTR"; break; - case MONO_TYPE_BYREF: type_str = "BYREF"; break; - case MONO_TYPE_VALUETYPE: type_str = "VALUETYPE"; break; - case MONO_TYPE_CLASS: type_str = "CLASS"; break; - case MONO_TYPE_VAR: type_str = "VAR"; break; - case MONO_TYPE_ARRAY: type_str = "ARRAY"; break; - case MONO_TYPE_GENERICINST: type_str = "GENERICINST"; break; - case MONO_TYPE_TYPEDBYREF: type_str = "TYPEDBYREF"; break; - case MONO_TYPE_I: type_str = "I"; break; - case MONO_TYPE_U: type_str = "U"; break; - case MONO_TYPE_FNPTR: type_str = "FNPTR"; break; - case MONO_TYPE_OBJECT: type_str = "OBJECT"; break; - case MONO_TYPE_SZARRAY: type_str = "SZARRAY"; break; - case MONO_TYPE_MVAR: type_str = "MVAR"; break; - case MONO_TYPE_CMOD_REQD: type_str = "CMOD_REQD"; break; - case MONO_TYPE_CMOD_OPT: type_str = "CMOD_OPT"; break; - case MONO_TYPE_INTERNAL: type_str = "INTERNAL"; break; - case MONO_TYPE_MODIFIER: type_str = "MODIFIER"; break; - case MONO_TYPE_SENTINEL: type_str = "SENTINEL"; break; - case MONO_TYPE_PINNED: type_str = "PINNED"; break; - case MONO_TYPE_ENUM: type_str = "MONO_TYPE_ENUM"; break; - default: type_str = "UNKNOWN"; break; - } - - MH_LOG("MonoTypeEnum: %s (0x%x)", type_str, (int)type_enum); -} - -#ifndef MH_MINT_TYPES_DEFINED -#define MH_MINT_TYPES_DEFINED -// mirror those in interp-internals.h -#define MH_MINT_TYPE_I1 0 -#define MH_MINT_TYPE_U1 1 -#define MH_MINT_TYPE_I2 2 -#define MH_MINT_TYPE_U2 3 -#define MH_MINT_TYPE_I4 4 -#define MH_MINT_TYPE_I8 5 -#define MH_MINT_TYPE_R4 6 -#define MH_MINT_TYPE_R8 7 -#define MH_MINT_TYPE_O 8 -#define MH_MINT_TYPE_VT 9 -#define MH_MINT_TYPE_VOID 10 -#endif -void log_mint_type(int value) -{ - const char* type_str = NULL; - switch (value) - { -case MH_MINT_TYPE_I1: type_str = "MINT_TYPE_I1";break; -case MH_MINT_TYPE_U1: type_str = "MINT_TYPE_U1";break; -case MH_MINT_TYPE_I2: type_str = "MINT_TYPE_I2";break; -case MH_MINT_TYPE_U2: type_str = "MINT_TYPE_U2";break; -case MH_MINT_TYPE_I4: type_str = "MINT_TYPE_I4";break; -case MH_MINT_TYPE_I8: type_str = "MINT_TYPE_I8";break; -case MH_MINT_TYPE_R4: type_str = "MINT_TYPE_R4";break; -case MH_MINT_TYPE_R8: type_str = "MINT_TYPE_R8";break; -case MH_MINT_TYPE_O : type_str = "MINT_TYPE_O";break; -case MH_MINT_TYPE_VT: type_str = "MINT_TYPE_VT";break; -case MH_MINT_TYPE_VOID: type_str = "MINT_TYPE_VOID"; break; - default: - type_str = "UNKNOWN"; - } - MH_LOG("MintType: %s (%d)", type_str, value); -} diff --git a/src/mono/mono/metadata/object-internals.h b/src/mono/mono/metadata/object-internals.h index 25c0f63d641fa5..c54992a45a84f3 100644 --- a/src/mono/mono/metadata/object-internals.h +++ b/src/mono/mono/metadata/object-internals.h @@ -26,7 +26,6 @@ #include "mono/utils/mono-tls.h" #include "mono/utils/mono-coop-mutex.h" #include -#include /* Use this as MONO_CHECK_ARG (arg,expr,) in functions returning void */ #define MONO_CHECK_ARG(arg, expr, retval) do { \ diff --git a/src/mono/mono/metadata/object.c b/src/mono/mono/metadata/object.c index fb7e8f1a93fc0d..959def389d7d39 100644 --- a/src/mono/mono/metadata/object.c +++ b/src/mono/mono/metadata/object.c @@ -57,7 +57,6 @@ #include "monitor.h" #include "icall-decl.h" #include "icall-signatures.h" -#include #if _MSC_VER #pragma warning(disable:4312) // FIXME pointer cast to different size #endif diff --git a/src/mono/mono/mini/aot-runtime-wasm.c b/src/mono/mono/mini/aot-runtime-wasm.c index 281c0d0001f17f..271831364f15ab 100644 --- a/src/mono/mono/mini/aot-runtime-wasm.c +++ b/src/mono/mono/mini/aot-runtime-wasm.c @@ -11,7 +11,6 @@ #include #include "interp/interp.h" #include "aot-runtime.h" -#include #ifdef HOST_WASM #if SIZEOF_VOID_P == 4 diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index 971e401315da43..7760f60bc92c9a 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -1,5 +1,4 @@ #include "interp-icalls.h" -#include #include typedef gint32 I4; diff --git a/src/mono/mono/mini/interp/interp-pinvoke.c b/src/mono/mono/mini/interp/interp-pinvoke.c index 19eb769a828205..7a8e8ff23b89b4 100644 --- a/src/mono/mono/mini/interp/interp-pinvoke.c +++ b/src/mono/mono/mini/interp/interp-pinvoke.c @@ -96,7 +96,6 @@ #include #endif -#include /* Arguments that are passed when invoking only a finally/filter clause from the frame */ struct FrameClauseArgs { diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index 53560733cd91be..55c045520cf2f3 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -96,7 +96,6 @@ #include #endif -#include /* Arguments that are passed when invoking only a finally/filter clause from the frame */ struct FrameClauseArgs { diff --git a/src/mono/mono/profiler/browser.c b/src/mono/mono/profiler/browser.c index f2fcf4a873dc7c..ab37df50372b52 100644 --- a/src/mono/mono/profiler/browser.c +++ b/src/mono/mono/profiler/browser.c @@ -25,7 +25,6 @@ #include #include #include -#include struct _MonoProfiler { gboolean verbose; diff --git a/src/native/public/mono/metadata/mh_log.h b/src/native/public/mono/metadata/mh_log.h deleted file mode 100644 index ecb69065275339..00000000000000 --- a/src/native/public/mono/metadata/mh_log.h +++ /dev/null @@ -1,50 +0,0 @@ -#pragma once -#include -#include -#include - -#ifdef __EMSCRIPTEN__ -#include -#endif - -#define MH_LVL_CRIPPLE 6 -#define MH_LVL_TRACE 5 -#define MH_LVL_VERBOSE 4 -#define MH_LVL_DEBUG 3 -#define MH_LVL_INFO 2 - -static int MH_LOG_indent_level = 0; - -extern void mh_log_set_verbosity(int verbosity); -extern int mh_log_get_verbosity(); - -void MH_TestVoid(); -void MH_SetLogVerbosity(int32_t level); - -// make default verbosity MH_LVL_DEBUG (3). Set MH_LOG_VERBOSITY to this or higher for more verbose logging -#define MH_LOG(msg, ...) MH_LOGV(MH_LVL_TRACE, msg, ##__VA_ARGS__) - -#define MH_LOGV(verbosity, msg, ...) { \ - if ((verbosity) <= mh_log_get_verbosity()) { \ - printf("MH_NATIVE_LOG: "); \ - for (int mh_idx = 0; mh_idx < MH_LOG_indent_level; mh_idx++) { \ - printf(" "); \ - } \ - printf("%s : %s | %d :: ", __func__, __FILE__, __LINE__); \ - printf(msg, ##__VA_ARGS__); \ - printf("\n"); \ - fflush(stdout); \ - } \ -} - -#define MH_LOG_INDENT() { \ - MH_LOG_indent_level++; \ -} - -#define MH_LOG_UNINDENT() { \ - MH_LOG_indent_level--; \ -} - -extern void log_mono_type(MonoType* type) ; -extern void log_mono_type_enum(MonoTypeEnum type_enum); -extern void log_mint_type(int value); From 0aff8ed8d9f522be786aa5611d518501d8853660 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 7 Nov 2025 13:10:09 +0000 Subject: [PATCH 195/209] Remove MH_LOG --- src/mono/mono/metadata/appdomain.c | 7 ---- src/mono/mono/metadata/assembly.c | 1 - src/mono/mono/metadata/class.c | 3 -- src/mono/mono/metadata/gc.c | 10 ----- src/mono/mono/metadata/icall.c | 23 ------------ src/mono/mono/metadata/marshal-shared.c | 6 --- src/mono/mono/metadata/marshal.c | 43 ---------------------- src/mono/mono/metadata/object-internals.h | 1 - src/mono/mono/metadata/object.c | 6 +-- src/mono/mono/mini/aot-runtime-wasm.c | 25 ------------- src/mono/mono/mini/interp/interp-icalls.c | 28 -------------- src/mono/mono/mini/interp/interp-pinvoke.c | 42 --------------------- src/mono/mono/mini/interp/interp.c | 28 +------------- src/mono/mono/mini/interp/transform.c | 20 ---------- src/mono/mono/profiler/browser.c | 8 ---- src/native/public/monoapi.cmake | 1 - 16 files changed, 3 insertions(+), 249 deletions(-) diff --git a/src/mono/mono/metadata/appdomain.c b/src/mono/mono/metadata/appdomain.c index 32f975191a3873..ada70d4a5f748b 100644 --- a/src/mono/mono/metadata/appdomain.c +++ b/src/mono/mono/metadata/appdomain.c @@ -279,12 +279,8 @@ mono_runtime_init_checked (MonoDomain *domain, MonoThreadStartCB start_cb, MonoT if (!mono_runtime_get_no_exec ()) create_domain_objects (domain); - - MH_LOG("Calling mono_gc_init %p", &mono_gc_init); /* GC init has to happen after thread init */ mono_gc_init (); - - MH_LOG("mono_runtime_get_no_exec"); if (!mono_runtime_get_no_exec ()) mono_runtime_install_appctx_properties (); @@ -858,13 +854,10 @@ mono_runtime_install_appctx_properties (void) guint32 *combined_value_lengths; MonoFileMap *runtimeconfig_json_map = NULL; gpointer runtimeconfig_json_map_handle = NULL; - MH_LOG("Calling runtimeconfig_json_get_buffer"); const char *buffer_start = runtimeconfig_json_get_buffer (runtime_config_arg, &runtimeconfig_json_map, &runtimeconfig_json_map_handle); const char *buffer = buffer_start; - MH_LOG("Got buffer. calling mono_class_get_method_from_name_checked"); MonoMethod *setup = mono_class_get_method_from_name_checked (mono_class_get_appctx_class (), "Setup", 5, 0, error); g_assert (setup); - MH_LOG("Got Setup method"); // FIXME: TRUSTED_PLATFORM_ASSEMBLIES is very large // Combine and convert properties diff --git a/src/mono/mono/metadata/assembly.c b/src/mono/mono/metadata/assembly.c index f027ff4d572d2a..49eca9772f481e 100644 --- a/src/mono/mono/metadata/assembly.c +++ b/src/mono/mono/metadata/assembly.c @@ -2855,7 +2855,6 @@ mono_assembly_load (MonoAssemblyName *aname, const char *basedir, MonoImageOpenS { MonoAssembly *result = NULL; MONO_ENTER_GC_UNSAFE; - MH_LOG("Loading assembly %s from basedir %s", aname->name, basedir ? basedir : "NULL"); MonoAssemblyByNameRequest req; mono_assembly_request_prepare_byname (&req, mono_alc_get_default ()); req.requesting_assembly = NULL; diff --git a/src/mono/mono/metadata/class.c b/src/mono/mono/metadata/class.c index 80803ffcd9c0a3..d9081272c906ef 100644 --- a/src/mono/mono/metadata/class.c +++ b/src/mono/mono/metadata/class.c @@ -4798,7 +4798,6 @@ mono_class_array_element_size (MonoClass *klass) case MONO_TYPE_I4: case MONO_TYPE_U4: case MONO_TYPE_R4: - MH_LOGV(MH_LVL_CRIPPLE, "Got element size 4 for MONO_TYPE_I4/U4/R4."); return 4; case MONO_TYPE_I: case MONO_TYPE_U: @@ -4809,7 +4808,6 @@ mono_class_array_element_size (MonoClass *klass) case MONO_TYPE_OBJECT: case MONO_TYPE_SZARRAY: case MONO_TYPE_ARRAY: - MH_LOGV(MH_LVL_CRIPPLE, "Got element TARGET_SIZEOF_VOID_P for MONO_TYPE_I/U/etc. size is %d", TARGET_SIZEOF_VOID_P); return TARGET_SIZEOF_VOID_P; case MONO_TYPE_I8: case MONO_TYPE_U8: @@ -4828,7 +4826,6 @@ mono_class_array_element_size (MonoClass *klass) case MONO_TYPE_VAR: case MONO_TYPE_MVAR: { int align; - MH_LOG("Getting size for VAR/MVAR"); return mono_type_size (type, &align); } case MONO_TYPE_VOID: diff --git a/src/mono/mono/metadata/gc.c b/src/mono/mono/metadata/gc.c index 57bf7d6b2e5fdf..4f794238e7597e 100644 --- a/src/mono/mono/metadata/gc.c +++ b/src/mono/mono/metadata/gc.c @@ -918,7 +918,6 @@ finalizer_thread (gpointer unused) static void init_finalizer_thread (void) { - MH_LOG("inside init_finalizer_thread"); ERROR_DECL (error); gc_thread = mono_thread_create_internal ((MonoThreadStart)finalizer_thread, NULL, MONO_THREAD_CREATE_FLAGS_NONE, error); mono_error_assert_ok (error); @@ -953,23 +952,15 @@ reference_queue_mutex_init (void) void mono_gc_init (void) { - MH_LOG("Calling mono_lazy_initialize %p", &reference_queue_mutex_inited); mono_lazy_initialize (&reference_queue_mutex_inited, reference_queue_mutex_init); - MH_LOG("Calling mono_coop_mutex_init_recursive"); mono_coop_mutex_init_recursive (&finalizer_mutex); - MH_LOG("Calling mono_coop_mutex_init_recursive"); mono_os_mutex_init_recursive (&finalizable_objects_hash_lock); - MH_LOG("Creating new hash table"); finalizable_objects_hash = g_hash_table_new (mono_aligned_addr_hash, NULL); - - MH_LOG("Calling mono_counters_register"); mono_counters_register ("Minor GC collections", MONO_COUNTER_GC | MONO_COUNTER_INT, &mono_gc_stats.minor_gc_count); mono_counters_register ("Major GC collections", MONO_COUNTER_GC | MONO_COUNTER_INT, &mono_gc_stats.major_gc_count); mono_counters_register ("Minor GC time", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &mono_gc_stats.minor_gc_time); mono_counters_register ("Major GC time", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &mono_gc_stats.major_gc_time); mono_counters_register ("Major GC time concurrent", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &mono_gc_stats.major_gc_time_concurrent); - - MH_LOG("mono_gc_base_init"); mono_gc_base_init (); if (mono_gc_is_disabled ()) { @@ -987,7 +978,6 @@ mono_gc_init (void) mono_coop_cond_init (&exited_cond); mono_coop_sem_init (&finalizer_sem, 0); - MH_LOG("Exiting mono_gc_init"); #ifndef LAZY_GC_THREAD_CREATION if (!mono_runtime_get_no_exec ()) init_finalizer_thread (); diff --git a/src/mono/mono/metadata/icall.c b/src/mono/mono/metadata/icall.c index 10f5faf339e86c..f634c067c42c59 100644 --- a/src/mono/mono/metadata/icall.c +++ b/src/mono/mono/metadata/icall.c @@ -4095,9 +4095,6 @@ ves_icall_RuntimeType_TestArray_Native(MonoError *error) g_ptr_array_add (res, val2); g_ptr_array_add (res, val3); g_ptr_array_add (res, val4); - - MH_LOG ("test array values: %p %p %p", res->pdata[0], res->pdata[1], res->pdata[2]); - MH_LOG ("test array addresses: %p %p %p", &(res->pdata[0]), &(res->pdata[1]), &(res->pdata[2])); return res; } @@ -4107,7 +4104,6 @@ ves_icall_RuntimeType_TestArray_Raw_Native(MonoError *error) assert(sizeof(gpointer) == sizeof(gpointer_ptr)); assert(sizeof(gpointer) == 8); //bypass GPtrArray - MH_LOG ("allocating new test array. sizeof intptr_t is %zd", sizeof(intptr_t)); int numElems = 4; #define MH_USE_GPTR_ARRAY 1 @@ -4125,10 +4121,6 @@ ves_icall_RuntimeType_TestArray_Raw_Native(MonoError *error) g_ptr_array_add (res, val2); g_ptr_array_add (res, val3); g_ptr_array_add (res, val4); - - MH_LOG ("gpointer size %zd", sizeof(gpointer)); - MH_LOG ("test array values: %p %p %p", res->pdata[0], res->pdata[1], res->pdata[2]); - MH_LOG ("test array addresses: %p %p %p", &(res->pdata[0]), &(res->pdata[1]), &(res->pdata[2])); return res->pdata; #elif (MH_USER_INT64_ARRAY) int64_t *rawArray = malloc(numElems * sizeof(int64_t)); @@ -4154,8 +4146,6 @@ ves_icall_RuntimeType_TestArray_Raw_Native(MonoError *error) rawArray[3] = val4; #endif // 8 digits for 4 byte value - MH_LOG ("raw array values: %p %p %p", (void*)rawArray[0], (void*)rawArray[1], (void*)rawArray[2]); - MH_LOG ("raw array addresses: %p %p %p", &(rawArray[0]), &(rawArray[1]), &(rawArray[2])); return (gpointer)rawArray; @@ -4165,10 +4155,8 @@ GPtrArray* ves_icall_RuntimeType_GetConstructors_native (MonoQCallTypeHandle type_handle, guint32 bflags, MonoError *error) { MonoType *type = type_handle.type; - MH_LOG("Getting constructors for type %s\n", mono_type_get_name (type)); if (m_type_is_byref (type)) { GPtrArray* res = g_ptr_array_new (); - MH_LOG("Allocated array %p", (void*)res); return res; } @@ -4183,7 +4171,6 @@ ves_icall_RuntimeType_GetConstructors_native (MonoQCallTypeHandle type_handle, g GPtrArray *res_array = g_ptr_array_sized_new (4); /* FIXME, guestimating */ - MH_LOG("Allocated array %p \n", (void*)res_array); MonoMethod *method; gpointer iter = NULL; @@ -4820,13 +4807,11 @@ ves_icall_System_Reflection_Assembly_InternalGetReferencedAssemblies (MonoReflec } GPtrArray *result = g_ptr_array_sized_new (count); - MH_LOG("Created referenced assembly array %p", (void*)result); for (int i = 0; i < count; i++) { MonoAssemblyName *aname = create_referenced_assembly_name (image, i, error); if (!is_ok (error)) break; monoeg_g_ptr_array_add (result, aname); - MH_LOG("Added assembly %s to referenced assembly array %p", aname->name, (void*)result); } return result; } @@ -5145,7 +5130,6 @@ ves_icall_GetCurrentMethod (MonoError *error) static MonoMethod* mono_method_get_equivalent_method (MonoMethod *method, MonoClass *klass) { - MH_LOG("mono_method_get_equivalent_method called for method %s\n", method->name); int offset = -1, i; if (method->is_inflated && ((MonoMethodInflated*)method)->context.method_inst) { @@ -5162,7 +5146,6 @@ mono_method_get_equivalent_method (MonoMethod *method, MonoClass *klass) ctx.class_inst = mono_class_get_generic_container (klass)->context.class_inst; result = mono_class_inflate_generic_method_full_checked (inflated->declaring, klass, &ctx, error); g_assert (is_ok (error)); /* FIXME don't swallow the error */ - MH_LOG("returning %p", result); return result; } @@ -5202,8 +5185,6 @@ ves_icall_System_Reflection_RuntimeMethodInfo_GetMethodFromHandleInternalType_na klass = mono_class_from_mono_type_internal (type); else klass = method->klass; - - MH_LOG("About to get object handle for method %s in class %s\n", mono_method_full_name (method, true), mono_class_full_name (klass)); return mono_method_get_object_handle (method, klass, error); @@ -7052,14 +7033,12 @@ mono_lookup_internal_call_full_with_flags (MonoMethod *method, gboolean warn_on_ mono_icall_lock (); locked = TRUE; - MH_LOGV(MH_LVL_TRACE, "Looking for method with sig %s", mname); res = g_hash_table_lookup (icall_hash, mname); if (res) { MonoIcallHashTableValue *value = (MonoIcallHashTableValue *)res; if (flags) *flags = value->flags; res = value->method; - MH_LOGV(MH_LVL_TRACE, "Found %p", value->method); goto exit; } @@ -7089,7 +7068,6 @@ mono_lookup_internal_call_full_with_flags (MonoMethod *method, gboolean warn_on_ if (res) { - MH_LOGV(MH_LVL_TRACE, "Found method in icall_table"); goto exit; } if (warn_on_missing) { @@ -7132,7 +7110,6 @@ mono_lookup_internal_call_full (MonoMethod *method, gboolean warn_on_missing, mo *foreign = FALSE; guint32 flags = MONO_ICALL_FLAGS_NONE; - MH_LOGV(MH_LVL_TRACE, "mono_lookup_internal_call_full: Looking up %s\n", method->name); gconstpointer addr = mono_lookup_internal_call_full_with_flags (method, warn_on_missing, &flags); diff --git a/src/mono/mono/metadata/marshal-shared.c b/src/mono/mono/metadata/marshal-shared.c index 62f7678b8301bd..2e243c63bafab2 100644 --- a/src/mono/mono/metadata/marshal-shared.c +++ b/src/mono/mono/metadata/marshal-shared.c @@ -135,7 +135,6 @@ mono_marshal_shared_is_out (const MonoType *t) MonoMarshalConv mono_marshal_shared_conv_str_inverse (MonoMarshalConv conv) { - MH_LOGV(MH_LVL_VERBOSE, "Handling inverse conversion with code: %d", conv); switch (conv) { // AnsiBStr case MONO_MARSHAL_CONV_STR_ANSIBSTR: @@ -153,7 +152,6 @@ mono_marshal_shared_conv_str_inverse (MonoMarshalConv conv) case MONO_MARSHAL_CONV_STR_LPSTR: return MONO_MARSHAL_CONV_LPSTR_STR; case MONO_MARSHAL_CONV_LPSTR_STR: - MH_LOGV(MH_LVL_VERBOSE, "returning MONO_MARSHAL_CONV_STR_LPSTR"); return MONO_MARSHAL_CONV_STR_LPSTR; // LPTStr @@ -369,7 +367,6 @@ mono_marshal_shared_conv_to_icall (MonoMarshalConv conv, int *ind_store_type) // of the wrapper logic. In particular, to produce // volatile stack-based handles. Being data-driven, // from icall-def.h. - MH_LOGV(MH_LVL_VERBOSE, "Got here with conv %d", conv); int dummy; if (!ind_store_type) @@ -396,7 +393,6 @@ mono_marshal_shared_conv_to_icall (MonoMarshalConv conv, int *ind_store_type) return MONO_JIT_ICALL_mono_string_to_utf8str; case MONO_MARSHAL_CONV_LPSTR_STR: *ind_store_type = CEE_STIND_REF; - MH_LOGV(MH_LVL_VERBOSE, "returning MONO_MARSHAL_CONV_STR_LPSTR"); return MONO_JIT_ICALL_ves_icall_string_new_wrapper; case MONO_MARSHAL_CONV_SB_LPSTR: return MONO_JIT_ICALL_mono_string_builder_to_utf8; @@ -481,7 +477,6 @@ mono_marshal_shared_conv_to_icall (MonoMarshalConv conv, int *ind_store_type) void mono_marshal_shared_emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv conv, MonoMarshalSpec *mspec) { - MH_LOGV(MH_LVL_VERBOSE, "Handling conversion with code: %d", conv); switch (conv) { case MONO_MARSHAL_CONV_BOOL_I4: mono_mb_emit_ldloc (mb, 1); @@ -737,7 +732,6 @@ mono_marshal_shared_emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *ty case MONO_MARSHAL_CONV_ARRAY_SAVEARRAY: default: { char *msg = g_strdup_printf ("marshaling conversion %d not implemented", conv); - MH_LOGV(MH_LVL_INFO, "NOT IMPLEMENTED: %s", msg); mono_marshal_shared_mb_emit_exception_marshal_directive (mb, msg); break; } diff --git a/src/mono/mono/metadata/marshal.c b/src/mono/mono/metadata/marshal.c index 37eeb3f6df6bad..3234f1c50e3fef 100644 --- a/src/mono/mono/metadata/marshal.c +++ b/src/mono/mono/metadata/marshal.c @@ -276,7 +276,6 @@ ves_icall_mono_string_to_utf8_impl (MonoStringHandle str, MonoError *error) MonoStringHandle ves_icall_string_new_wrapper_impl (const char *text, MonoError *error) { - MH_LOGV(MH_LVL_VERBOSE, "string_new_wrapper(\"%s\")", text ? text : "(null)"); return text ? mono_string_new_handle (text, error) : NULL_HANDLE_STRING; } @@ -1065,7 +1064,6 @@ mono_string_to_utf8str_impl (MonoStringHandle s, MonoError *error) char * mono_string_to_ansibstr_impl (MonoStringHandle string_obj, MonoError *error) { - MH_LOGV(MH_LVL_VERBOSE, "Got string handle %p", MONO_HANDLE_RAW (string_obj)); if (MONO_HANDLE_IS_NULL (string_obj)) return NULL; @@ -1134,7 +1132,6 @@ mono_string_to_byvalstr_impl (char *dst, MonoStringHandle src, int size, MonoErr { g_assert (dst != NULL); g_assert (size > 0); - MH_LOGV(MH_LVL_VERBOSE, "Got string handle %p, size %d", MONO_HANDLE_RAW (src), size); memset (dst, 0, size); if (!MONO_HANDLE_BOOL (src)) return; @@ -1537,7 +1534,6 @@ MonoMarshalConv mono_marshal_get_ptr_to_string_conv (MonoMethodPInvoke *piinfo, MonoMarshalSpec *spec, gboolean *need_free) { MonoMarshalNative encoding = mono_marshal_get_string_encoding (piinfo, spec); - MH_LOGV(MH_LVL_VERBOSE, "Got string encoding %d\n", encoding); *need_free = TRUE; switch (encoding) { @@ -1548,7 +1544,6 @@ mono_marshal_get_ptr_to_string_conv (MonoMethodPInvoke *piinfo, MonoMarshalSpec return MONO_MARSHAL_CONV_UTF8STR_STR; case MONO_NATIVE_LPSTR: case MONO_NATIVE_VBBYREFSTR: - MH_LOGV(MH_LVL_VERBOSE, "returning MONO_MARSHAL_CONV_LPSTR_STR"); return MONO_MARSHAL_CONV_LPSTR_STR; case MONO_NATIVE_LPTSTR: #ifdef TARGET_WIN32 @@ -1994,9 +1989,6 @@ mono_marshal_get_delegate_begin_invoke (MonoMethod *method) char *name; MonoGenericContext *ctx = NULL; MonoMethod *orig_method = NULL; - MH_LOG_INDENT(); - MH_LOG("."); - MH_LOG_UNINDENT(); g_assert (method && m_class_get_parent (method->klass) == mono_defaults.multicastdelegate_class && !strcmp (method->name, "BeginInvoke")); @@ -2374,9 +2366,6 @@ mono_marshal_get_delegate_invoke (MonoMethod *method, MonoDelegate *del) MonoMethodSignature *sig; sig = mono_signature_no_pinvoke (method); - MH_LOG_INDENT(); - MH_LOG("."); - MH_LOG_UNINDENT(); if (del && !del->target && del->method && mono_method_signature_internal (del->method)->hasthis) { if (!(del->method->flags & METHOD_ATTRIBUTE_VIRTUAL) && !m_class_is_valuetype (del->method->klass) && sig->param_count == mono_method_signature_internal (del->method)->param_count + 1) { /* The first argument of the delegate is passed as this, the normal invoke code can handle this */ @@ -2979,9 +2968,6 @@ mono_marshal_get_icall_wrapper (MonoJitICallInfo *callinfo, gboolean check_excep MonoMethodSignature *const sig = callinfo->sig; g_assert (sig->pinvoke); - MH_LOG_INDENT(); - MH_LOG("."); - MH_LOG_UNINDENT(); char *const name = g_strdup_printf ("__icall_wrapper_%s", callinfo->name); mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_MANAGED_TO_NATIVE); @@ -4127,8 +4113,6 @@ marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass, Mono g_assert (method != NULL); error_init (error); - - MH_LOG("Getting managed wrapper for method %s\n", mono_method_full_name (method, TRUE)); if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) { mono_error_set_invalid_program (error, "Failed because method (%s) marked PInvokeCallback (managed method) and extern (unmanaged) simultaneously.", mono_method_full_name (method, TRUE)); @@ -4395,8 +4379,6 @@ mono_marshal_get_vtfixup_ftnptr (MonoImage *image, guint32 token, guint16 type) int i, param_count; g_assert (token); - - MH_LOG("mono_marshal_get_vtfixup_ftnptr"); method = mono_get_method_checked (image, token, NULL, NULL, error); if (!method) @@ -4588,7 +4570,6 @@ mono_marshal_get_struct_to_ptr (MonoClass *klass) mono_marshal_load_type_info (klass); MonoMarshalType *marshal_info = mono_class_get_marshal_info (klass); - MH_LOG("mono_marshal_get_struct_to_ptr"); if ((res = marshal_info->str_to_ptr)) return res; @@ -4617,7 +4598,6 @@ mono_marshal_get_struct_to_ptr (MonoClass *klass) else res = marshal_info->str_to_ptr; mono_marshal_unlock (); - MH_LOG("returning %p", res); return res; } @@ -4635,7 +4615,6 @@ mono_marshal_get_ptr_to_struct (MonoClass *klass) WrapperInfo *info; g_assert (klass != NULL); - MH_LOG("mono_marshal_get_ptr_to_struct for class TODO"); mono_marshal_load_type_info (klass); MonoMarshalType *marshal_info = mono_class_get_marshal_info (klass); @@ -4669,7 +4648,6 @@ mono_marshal_get_ptr_to_struct (MonoClass *klass) else res = marshal_info->ptr_to_str; mono_marshal_unlock (); - MH_LOG("returning %p", res); return res; } @@ -4713,7 +4691,6 @@ mono_marshal_get_synchronized_inner_wrapper (MonoMethod *method) res = mono_class_inflate_generic_method_checked (res, ctx, error); g_assert (is_ok (error)); /* FIXME don't swallow the error */ } - MH_LOG("returning %p", res); return res; } @@ -4758,14 +4735,12 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method) res = check_generic_wrapper_cache (cache, orig_method, orig_method, method); if (res) { - MH_LOG("returning %p", res); return res; } } else { cache = get_cache (&get_method_image (method)->wrapper_caches.synchronized_cache, mono_aligned_addr_hash, NULL); if ((res = mono_marshal_find_in_cache (cache, method))) { - MH_LOG("returning %p", res); return res; } } @@ -4815,7 +4790,6 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method) mb, sig, sig->param_count + 16, info, NULL); } mono_mb_free (mb); - MH_LOG("returning %p", res); return res; } @@ -4851,7 +4825,6 @@ mono_marshal_get_unbox_wrapper (MonoMethod *method) mono_mb_free (mb); /* mono_method_print_code (res); */ - MH_LOG("returning %p", res); return res; } @@ -4977,7 +4950,6 @@ mono_marshal_get_virtual_stelemref_wrapper (MonoStelemrefKind kind) } mono_mb_free (mb); - MH_LOG("returning %p", cached_methods [kind]); return cached_methods [kind]; } @@ -5002,7 +4974,6 @@ mono_marshal_get_virtual_stelemref_wrappers (int *nwrappers) res = (MonoMethod **)g_malloc0 (STELEMREF_KIND_COUNT * sizeof (MonoMethod*)); for (i = 0; i < STELEMREF_KIND_COUNT; ++i) res [i] = mono_marshal_get_virtual_stelemref_wrapper ((MonoStelemrefKind)i); - MH_LOG("returning %p", res); return res; } @@ -5040,7 +5011,6 @@ mono_marshal_get_stelemref (void) mono_mb_free (mb); MONO_STATIC_POINTER_INIT_END (MonoMethod, ret) - MH_LOG("returning %p", ret); return ret; } @@ -5073,7 +5043,6 @@ mono_marshal_get_gsharedvt_in_wrapper (void) mono_mb_free (mb); MONO_STATIC_POINTER_INIT_END (MonoMethod, ret) - MH_LOG("returning %p", ret); return ret; } @@ -5106,7 +5075,6 @@ mono_marshal_get_gsharedvt_out_wrapper (void) mono_mb_free (mb); MONO_STATIC_POINTER_INIT_END (MonoMethod, ret) - MH_LOG("returning %p", ret); return ret; } @@ -5205,7 +5173,6 @@ mono_marshal_get_array_address (int rank, int elem_size) elem_addr_cache_next ++; } mono_marshal_unlock (); - MH_LOG("returning %p", ret); return ret; } @@ -5262,7 +5229,6 @@ mono_marshal_get_array_accessor_wrapper (MonoMethod *method) info, NULL); } mono_mb_free (mb); - MH_LOG("returning %p", res); return res; } @@ -5441,7 +5407,6 @@ mono_marshal_get_unsafe_accessor_wrapper (MonoMethod *accessor_method, MonoUnsaf mono_mb_free (mb); /* mono_method_print_code (res); */ - MH_LOG("returning %p", res); return res; } @@ -5752,7 +5717,6 @@ ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf (MonoReflectionTypeHan } MonoMarshalType *info = mono_marshal_load_type_info (klass); - MH_LOG("returning offset %d", info->fields [match_index].offset); return GINT_TO_POINTER(info->fields [match_index].offset); } @@ -6118,7 +6082,6 @@ mono_class_native_size (MonoClass *klass, guint32 *align) if (align) *align = info->min_align; - MH_LOG("klass native size %d, min_align: %d", info->native_size, info->min_align); return info->native_size; } @@ -6220,7 +6183,6 @@ mono_marshal_type_size (MonoType *type, MonoMarshalSpec *mspec, guint32 *align, switch (native_type) { case MONO_NATIVE_BOOLEAN: *align = 4; - MH_LOG("size is 4, align is 4 for native type %02x", native_type); return 4; case MONO_NATIVE_I1: case MONO_NATIVE_U1: @@ -6235,7 +6197,6 @@ mono_marshal_type_size (MonoType *type, MonoMarshalSpec *mspec, guint32 *align, case MONO_NATIVE_U4: case MONO_NATIVE_ERROR: *align = 4; - MH_LOG("size is 4, align is 4 for native type %02x", native_type); return 4; case MONO_NATIVE_I8: case MONO_NATIVE_U8: @@ -6265,7 +6226,6 @@ mono_marshal_type_size (MonoType *type, MonoMarshalSpec *mspec, guint32 *align, case MONO_NATIVE_FUNC: case MONO_NATIVE_LPSTRUCT: *align = MONO_ABI_ALIGNOF (gpointer); - MH_LOG("size is %d, for native type %02x", TARGET_SIZEOF_VOID_P, native_type); return TARGET_SIZEOF_VOID_P; case MONO_NATIVE_STRUCT: klass = mono_class_from_mono_type_internal (type); @@ -6277,13 +6237,11 @@ mono_marshal_type_size (MonoType *type, MonoMarshalSpec *mspec, guint32 *align, padded_size = mono_class_native_size (klass, align); if (padded_size == 0) padded_size = 1; - MH_LOG("size is %d, for native type %02x", padded_size, native_type); return padded_size; case MONO_NATIVE_BYVALTSTR: { int esize = unicode ? 2: 1; g_assert (mspec); *align = esize; - MH_LOG("size is %d, for native type %02x", mspec->data.array_data.num_elem * esize, native_type); return mspec->data.array_data.num_elem * esize; } case MONO_NATIVE_BYVALARRAY: { @@ -6297,7 +6255,6 @@ mono_marshal_type_size (MonoType *type, MonoMarshalSpec *mspec, guint32 *align, esize = mono_class_native_size (m_class_get_element_class (klass), align); } g_assert (mspec); - MH_LOG("size is %d, for native type %02x", mspec->data.array_data.num_elem * esize, native_type); return mspec->data.array_data.num_elem * esize; } case MONO_NATIVE_CUSTOM: diff --git a/src/mono/mono/metadata/object-internals.h b/src/mono/mono/metadata/object-internals.h index c54992a45a84f3..e464c87b9e3b72 100644 --- a/src/mono/mono/metadata/object-internals.h +++ b/src/mono/mono/metadata/object-internals.h @@ -1972,7 +1972,6 @@ static inline gunichar2* mono_string_chars_internal (MonoString *s) { MONO_REQ_GC_UNSAFE_MODE; - MH_LOGV(MH_LVL_CRIPPLE, "mono_string_chars_internal: s=%p\n", s); return s->chars; } diff --git a/src/mono/mono/metadata/object.c b/src/mono/mono/metadata/object.c index 959def389d7d39..a517f2efe329ee 100644 --- a/src/mono/mono/metadata/object.c +++ b/src/mono/mono/metadata/object.c @@ -2558,7 +2558,7 @@ mono_class_get_virtual_method (MonoClass *klass, MonoMethod *method, MonoError * static MonoObject* do_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc, MonoError *error) { - MH_LOG("starting invoke for %s\n", mono_method_full_name (method, TRUE)); + MONO_REQ_GC_UNSAFE_MODE; MonoObject *result = NULL; @@ -2572,7 +2572,7 @@ do_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **ex result = callbacks.runtime_invoke (method, obj, params, exc, error); MONO_PROFILER_RAISE (method_end_invoke, (method)); - MH_LOG("ending invoke for %s\n", mono_method_full_name (method, TRUE)); + if (!is_ok (error)) return NULL; @@ -7098,7 +7098,6 @@ mono_ldstr_checked (MonoImage *image, guint32 idx, MonoError *error) MonoStringHandle mono_ldstr_handle (MonoImage *image, guint32 idx, MonoError *error) { - MH_LOGV(MH_LVL_VERBOSE, "Got here"); // FIXME invert mono_ldstr_handle and mono_ldstr_checked. return MONO_HANDLE_NEW (MonoString, mono_ldstr_checked (image, idx, error)); } @@ -7164,7 +7163,6 @@ mono_ldstr_metadata_sig (const char* sig, MonoStringHandleOut string_handle, Mon char* mono_ldstr_utf8 (MonoImage *image, guint32 idx, MonoError *error) { - MH_LOGV(MH_LVL_VERBOSE, "Got here"); const char *str; size_t len2; long written = 0; diff --git a/src/mono/mono/mini/aot-runtime-wasm.c b/src/mono/mono/mini/aot-runtime-wasm.c index 271831364f15ab..60d1fe9cd2c553 100644 --- a/src/mono/mono/mini/aot-runtime-wasm.c +++ b/src/mono/mono/mini/aot-runtime-wasm.c @@ -61,8 +61,6 @@ type_to_c (MonoType *t, gboolean *is_byref_return) case MONO_TYPE_VOID: return 'V'; case MONO_TYPE_VALUETYPE: { - MH_LOG_INDENT(); - MH_LOG("Handling valuetype %s", mono_type_full_name (t)); if (m_class_is_enumtype (m_type_data_get_klass_unchecked (t))) { t = mono_class_enum_basetype_internal (m_type_data_get_klass_unchecked (t)); goto handle_enum; @@ -115,17 +113,10 @@ get_long_arg (InterpMethodArguments *margs, int idx) { #if SIZEOF_VOID_P == 4 interp_pair p; - MH_LOG_INDENT(); - MH_LOG("Getting long arg [%d]", idx); p.pair.lo = (gint32)(gssize)margs->iargs [idx]; p.pair.hi = (gint32)(gssize)margs->iargs [idx + 1]; - MH_LOG("Got pair %d %d", p.pair.lo, p.pair.hi); - MH_LOG_UNINDENT(); return p.l; #else - MH_LOG_INDENT(); - MH_LOG("Getting long arg [%d]: %lld", idx, (gint64)(gssize)margs->iargs [idx]); - MH_LOG_UNINDENT(); return (gint64)(gssize)margs->iargs [idx]; #endif } @@ -141,11 +132,7 @@ mono_wasm_install_interp_to_native_callback (MonoWasmNativeToInterpCallback cb) int mono_wasm_interp_method_args_get_iarg (InterpMethodArguments *margs, int i) { - MH_LOG_INDENT(); - MH_LOG("Looking for iarg[%d]", i); int retval = (int)(gssize)margs->iargs[i]; - MH_LOG("Got %d", retval); - MH_LOG_UNINDENT(); return retval; } @@ -180,7 +167,6 @@ compare_icall_tramp (const void *key, const void *elem) } static void logCookie (int c_count, const char *cookie) { - MH_LOG("WASM ICALL COOKIE: %s\n", cookie); } gpointer mono_wasm_get_interp_to_native_trampoline (MonoMethodSignature *sig) @@ -191,8 +177,6 @@ mono_wasm_get_interp_to_native_trampoline (MonoMethodSignature *sig) memset (cookie, 0, 32); cookie [0] = type_to_c (sig->ret, &is_byref_return); - MH_LOG_INDENT(); - MH_LOG("Parameter cookie[0] = %c (from type: %s (enum: %d))\n", cookie [0], mono_type_get_name_full(sig->ret, MONO_TYPE_NAME_FORMAT_FULL_NAME), (int)sig->ret->type); c_count = sig->param_count + sig->hasthis + is_byref_return + 1; g_assert (c_count < sizeof (cookie)); //ensure we don't overflow the local @@ -201,31 +185,22 @@ mono_wasm_get_interp_to_native_trampoline (MonoMethodSignature *sig) cookie[0] = 'V'; // return value address goes in arg0 cookie[1] = ptrChar; - MH_LOG_INDENT(); - MH_LOG("Return value is byref: cookie[0][1] = %c, %c", cookie [0], cookie [1]); - MH_LOG_UNINDENT(); offset += 1; } if (sig->hasthis) { // thisptr goes in arg0/arg1 depending on return type cookie [offset] = ptrChar; - MH_LOG_INDENT(); - MH_LOG("Sig hasthis: value is byref: cookie[%d] = %c", offset, cookie [offset]); - MH_LOG_UNINDENT(); offset += 1; } for (int i = 0; i < sig->param_count; ++i) { cookie [offset + i] = type_to_c (sig->params [i], NULL); - MH_LOG("Parameter cookie[%d] = %c (from type: %s)\n", offset + i, cookie [offset + i], mono_type_get_name_full(sig->params[i], MONO_TYPE_NAME_FORMAT_FULL_NAME)); } - MH_LOG_UNINDENT(); logCookie(c_count, cookie); void *p = mono_wasm_interp_to_native_callback (cookie); if (!p) g_error ("CANNOT HANDLE INTERP ICALL SIG %s\n", cookie); - MH_LOG("Got interp to native trampoline %p for cookie %s", p, cookie); return p; } diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index 7760f60bc92c9a..61656eb6fa9f1e 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -91,15 +91,12 @@ is_scalar_vtype (MonoType *type) void stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean pinvoke) { - MH_LOG_INDENT(); intptr_t data_ptr = *(intptr_t *)data; - MH_LOG("Converting data to stackval for type %s: ,value as intptr_t is %p", mono_type_get_name (type), (void*)data_ptr); // memset(result, 0, sizeof(stackval)); log_mono_type(type); if (m_type_is_byref (type)) { result->data.p = *(gpointer*)data; - MH_LOG_UNINDENT(); return; } switch (type->type) { @@ -111,7 +108,6 @@ stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean case MONO_TYPE_U1: case MONO_TYPE_BOOLEAN: result->data.i = *(guint8*)data; - MH_LOG("Assigned U1 or BOOLEAN value assigned: %p", (void*)result->data.i); break; case MONO_TYPE_I2: result->data.i = *(gint16*)data; @@ -122,7 +118,6 @@ stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean break; case MONO_TYPE_I4: result->data.i = *(gint32*)data; - MH_LOG("Assigned I4 value assigned: (int) %d (ptr) %p", result->data.i, (void*)result->data.i); break; case MONO_TYPE_U: case MONO_TYPE_I: @@ -131,11 +126,9 @@ stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean case MONO_TYPE_PTR: case MONO_TYPE_FNPTR: result->data.p = *(gpointer*)data; - MH_LOG("Assigned pointer assigned: %p", result->data.p); break; case MONO_TYPE_U4: result->data.i = *(guint32*)data; - MH_LOG("Assigned U4 value assigned: (int) %d (ptr) %p", result->data.i, (void*)result->data.i); break; case MONO_TYPE_R4: /* memmove handles unaligned case */ @@ -153,7 +146,6 @@ stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean case MONO_TYPE_CLASS: case MONO_TYPE_OBJECT: case MONO_TYPE_ARRAY: - MH_LOG("Assigned pointer value: %p", result->data.p); result->data.p = *(gpointer*)data; break; case MONO_TYPE_VALUETYPE: @@ -188,47 +180,36 @@ stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean default: g_error ("got type 0x%02x", type->type); } - MH_LOG("Converted data to stackval. Type: %s, ptr value (result->data.p): %p", mono_type_get_name (type), (void*)result->data.p); - MH_LOG_UNINDENT(); } static char * log_sig(MonoMethodSignature* sig) { char buffer[256]; int offset = 0; if (!sig) { - MH_LOG("Signature is NULL"); return NULL; } - MH_LOG_INDENT(); for (int i = 0; i < sig->param_count; ++i) { MonoType* tp = sig->params[i]; - MH_LOG("Param %d: %s", (int)tp->type, mono_type_get_name (tp)); if(tp) offset += sprintf(buffer + offset, "%d", interp_type_as_ptr8(tp) ? 8 : interp_type_as_ptr4(tp) ? 4 : 0); else offset += sprintf(buffer + offset, "E"); } - MH_LOG_UNINDENT(); if (!sig->param_count) offset += sprintf(buffer + offset, "V"); offset += sprintf(buffer + offset, "_%s", sig->ret->type == MONO_TYPE_VOID ? "V" : (interp_type_as_ptr4(sig->ret) ? "4" : "8")); - MH_LOG("Signature: %s", buffer); return strdup(buffer); } static void log_op(MintICallSig op) { - MH_LOGV(MH_LVL_TRACE, "MintIcallSig logging not implemented\n"); } void do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval *sp, gpointer ptr, gboolean save_last_error) { - MH_LOG_INDENT(); - MH_LOG("Sig: %p op: %d ret_sp: %p sp: %p ptr: %p, save_last: %s", (void*)sig, op, (void*)ret_sp, (void*)sp, (void*)ptr, save_last_error ? "T" : "F"); if (save_last_error) mono_marshal_clear_last_error(); - MH_LOG("About to execute function, sig enum value is : %d", op); switch (op) { case MINT_ICALLSIG_V_V: { typedef void (*T)(void); @@ -353,12 +334,9 @@ do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval case MINT_ICALLSIG_88_8: { typedef I8(*T)(I8, I8); if (!ptr) - MH_LOGV(MH_LVL_INFO, "Function pointer is NULL!"); T func = (T)ptr; if (!func) - MH_LOGV(MH_LVL_INFO, "Cast function pointer is NULL!"); - MH_LOGV(MH_LVL_TRACE, "Callig MINT_ICALLSIG_88_8 with pointer %p", ptr); ret_sp->data.p = func(sp[0].data.p, sp[1].data.p); break; } @@ -2528,19 +2506,13 @@ do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval if (save_last_error) { - MH_LOG("Setting last error"); mono_marshal_set_last_error(); } /* convert the native representation to the stackval representation */ if (sig) { - MH_LOG("Setting stackval from data"); stackval_from_data(sig->ret, ret_sp, (char*)&ret_sp->data.p, sig->pinvoke && !sig->marshalling_disabled); - MH_LOG("Set stackval from data"); } else - MH_LOG("Not trying to set stackval from data - no sig"); - - MH_LOG("Returning from do_icall with ret_sp: %p", ret_sp->data.p); } diff --git a/src/mono/mono/mini/interp/interp-pinvoke.c b/src/mono/mono/mini/interp/interp-pinvoke.c index 7a8e8ff23b89b4..d262adf6841cf3 100644 --- a/src/mono/mono/mini/interp/interp-pinvoke.c +++ b/src/mono/mono/mini/interp/interp-pinvoke.c @@ -1117,7 +1117,6 @@ imethod_alloc0 (InterpMethod *imethod, guint size) void log_mono_type(MonoType* type) { if (!type) { - MH_LOG("MonoType: NULL"); return; } @@ -1151,8 +1150,6 @@ void log_mono_type(MonoType* type) { case MONO_TYPE_FNPTR: type_str = "FNPTR"; break; default: type_str = "UNKNOWN"; break; } - - MH_LOG("MonoType: %s", type_str); } void log_mono_type_enum(MonoTypeEnum type_enum) { @@ -1197,8 +1194,6 @@ void log_mono_type_enum(MonoTypeEnum type_enum) { case MONO_TYPE_ENUM: type_str = "MONO_TYPE_ENUM"; break; default: type_str = "UNKNOWN"; break; } - - MH_LOG("MonoTypeEnum: %s (0x%x)", type_str, (int)type_enum); } static void log_mint_type(int value) @@ -1220,7 +1215,6 @@ case MINT_TYPE_VOID: type_str = "MINT_TYPE_VOID"; break; default: type_str = "UNKNOWN"; } - MH_LOG("MintType: %s (%d)", type_str, value); } static guint32* initialize_arg_offsets (InterpMethod *imethod, MonoMethodSignature *csig) @@ -1236,27 +1230,20 @@ initialize_arg_offsets (InterpMethod *imethod, MonoMethodSignature *csig) int arg_count = sig->hasthis + sig->param_count; guint32 *arg_offsets = (guint32*)imethod_alloc0 (imethod, (arg_count + 1) * sizeof (int)); int index = 0, offset = 0; - MH_LOG_INDENT(); - MH_LOG("Getting arg offsets"); if (sig->hasthis) { arg_offsets [index++] = 0; offset = MINT_STACK_SLOT_SIZE; } - MH_LOG_INDENT(); for (int i = 0; i < sig->param_count; i++) { MonoType *type = sig->params [i]; int size, align; log_mono_type(type); log_mint_type(mono_mint_type (type)); - MH_LOG_INDENT(); size = mono_interp_type_size (type, mono_mint_type (type), &align); - MH_LOG("calculated size: %d - note includes alignment of %d", size, align); - MH_LOG_UNINDENT(); offset = ALIGN_TO (offset, align); arg_offsets [index++] = offset; offset += size; } - MH_LOG_UNINDENT(); // This index is not associated with an actual argument, we just store the offset // for convenience in order to easily determine the size of the param area used arg_offsets [index] = ALIGN_TO (offset, MINT_STACK_SLOT_SIZE); @@ -1264,7 +1251,6 @@ initialize_arg_offsets (InterpMethod *imethod, MonoMethodSignature *csig) mono_memory_write_barrier (); /* If this fails, the new one is leaked in the mem manager */ mono_atomic_cas_ptr ((gpointer*)&imethod->arg_offsets, arg_offsets, NULL); - MH_LOG_UNINDENT(); return imethod->arg_offsets; } @@ -1514,17 +1500,13 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui else margs->fargs = g_malloc0 (sizeof (double) * margs->flen); } - MH_LOG_INDENT(); - MH_LOG("setting args from signature: %s", mono_signature_full_name (sig)); for (int i = 0; i < sig->param_count; i++) { - MH_LOG_INDENT(); guint32 offset = get_arg_offset (frame->imethod, sig, i); stackval *sp_arg = STACK_ADD_BYTES (frame->stack, offset); switch (info->arg_types [i]) { case PINVOKE_ARG_INT: margs->iargs [int_i] = sp_arg->data.p; - MH_LOG("PINVOKE_ARG_INT"); #if DEBUG_INTERP g_print ("build_args_from_sig: margs->iargs [%d]: %p (frame @ %d)\n", int_i, margs->iargs [int_i], i); #endif @@ -1532,7 +1514,6 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui break; case PINVOKE_ARG_R4: * (float *) &(margs->fargs [int_f]) = sp_arg->data.f_r4; - MH_LOG("PINVOKE_ARG_R4"); #if DEBUG_INTERP g_print ("build_args_from_sig: margs->fargs [%d]: %p (%f) (frame @ %d)\n", int_f, margs->fargs [int_f], margs->fargs [int_f], i); #endif @@ -1540,7 +1521,6 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui break; case PINVOKE_ARG_R8: margs->fargs [int_f] = sp_arg->data.f; - MH_LOG("PINVOKE_ARG_R8"); #if DEBUG_INTERP g_print ("build_args_from_sig: margs->fargs [%d]: %p (%f) (frame @ %d)\n", int_f, margs->fargs [int_f], margs->fargs [int_f], i); #endif @@ -1548,14 +1528,12 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui break; case PINVOKE_ARG_VTYPE: margs->iargs [int_i] = sp_arg; - MH_LOG("PINVOKE_ARG_VTYPE"); #if DEBUG_INTERP g_print ("build_args_from_sig: margs->iargs [%d]: %p (vt) (frame @ %d)\n", int_i, margs->iargs [int_i], i); #endif int_i++; break; case PINVOKE_ARG_SCALAR_VTYPE: - MH_LOG("PINVOKE_ARG_SCALAR_VTYPE"); margs->iargs [int_i] = *(gpointer*)sp_arg; #if DEBUG_INTERP @@ -1564,7 +1542,6 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui int_i++; break; case PINVOKE_ARG_INT_PAIR: { - MH_LOG("PINVOKE_ARG_INT_PAIR"); margs->iargs [int_i] = (gpointer)(gssize)sp_arg->data.pair.lo; int_i++; margs->iargs [int_i] = (gpointer)(gssize)sp_arg->data.pair.hi; @@ -1578,15 +1555,9 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui g_assert_not_reached (); break; } - MH_LOG_UNINDENT(); } - MH_LOG_UNINDENT(); - - MH_LOG_INDENT(); - MH_LOG("setting ret_pinvoke_type: %s", mono_signature_full_name (sig)); switch (info->ret_pinvoke_type) { case PINVOKE_ARG_WASM_VALUETYPE_RESULT: - MH_LOG("PINVOKE_ARG_WASM_VALUETYPE_RESULT"); // We pass the return value address in arg0 so fill it in, we already // reserved space for it earlier. g_assert (frame->retval); @@ -1596,24 +1567,20 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui margs->is_float_ret = 0; break; case PINVOKE_ARG_INT: - MH_LOG("PINVOKE_ARG_INT"); margs->retval = (gpointer*)frame->retval; margs->is_float_ret = 0; break; case PINVOKE_ARG_R8: - MH_LOG("PINVOKE_ARG_R8"); margs->retval = (gpointer*)frame->retval; margs->is_float_ret = 1; break; case PINVOKE_ARG_NONE: - MH_LOG("PINVOKE_ARG_NONE"); margs->retval = NULL; break; default: g_assert_not_reached (); break; } - MH_LOG_UNINDENT(); } #endif @@ -2192,12 +2159,9 @@ interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject // method is transformed. context->stack_pointer = (guchar*)(sp + 4); g_assert (context->stack_pointer < context->stack_end); - MH_LOG_INDENT(); - MH_LOG("calling mono_interp_exec_method for %s : %s", method->name, mono_method_full_name (method, TRUE)); MONO_ENTER_GC_UNSAFE; mono_interp_exec_method (&frame, context, NULL); MONO_EXIT_GC_UNSAFE; - MH_LOG_UNINDENT(); context->stack_pointer = (guchar*)sp; if (context->has_resume_state) { @@ -2338,8 +2302,6 @@ do_icall_wrapper (InterpFrame *frame, MonoMethodSignature *sig, MintICallSig op, { MonoLMFExt ext; INTERP_PUSH_LMF_WITH_CTX (frame, ext, exit_icall); - MH_LOG_INDENT(); - MH_LOG("calling do_icall for %s : %s", frame->imethod->method->name, mono_method_full_name (frame->imethod->method, TRUE)); if (*gc_transitions) { MONO_ENTER_GC_SAFE; do_icall (sig, op, ret_sp, sp, ptr, save_last_error); @@ -2348,7 +2310,6 @@ do_icall_wrapper (InterpFrame *frame, MonoMethodSignature *sig, MintICallSig op, } else { do_icall (sig, op, ret_sp, sp, ptr, save_last_error); } - MH_LOG_UNINDENT(); interp_pop_lmf (&ext); goto exit_icall; // prevent unused label warning in some configurations @@ -4218,10 +4179,7 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause gpointer *cache = (gpointer*)&frame->imethod->data_items [ip [7]]; /* for calls, have ip pointing at the start of next instruction */ frame->state.ip = ip + 8; - MH_LOG_INDENT(); - MH_LOG ("Calling native method %s with signature %s\n", mono_method_full_name (imethod->method, TRUE), mono_signature_full_name (csignature)); ves_pinvoke_method (imethod, csignature, (MonoFuncV)code, context, frame, (stackval*)(locals + ip [1]), (stackval*)(locals + ip [3]), save_last_error, cache, &gc_transitions); - MH_LOG_UNINDENT(); EXCEPTION_CHECKPOINT; CHECK_RESUME_STATE (context); diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index 55c045520cf2f3..cd0c53f100aa69 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -1665,7 +1665,6 @@ ves_pinvoke_method ( gpointer args; MONO_REQ_GC_UNSAFE_MODE; - MH_LOG("invoking %s", mono_method_full_name(imethod->method, TRUE)); #ifdef HOST_WASM /* * Use a per-signature entry function. @@ -2139,7 +2138,6 @@ interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject // method is transformed. context->stack_pointer = (guchar*)(sp + 4); g_assert (context->stack_pointer < context->stack_end); - MH_LOG("calling mono_interp_exec_method for %s : %s", method->name, mono_method_full_name (method, TRUE)); MONO_ENTER_GC_UNSAFE; mono_interp_exec_method (&frame, context, NULL); MONO_EXIT_GC_UNSAFE; @@ -2283,28 +2281,7 @@ static MONO_NO_OPTIMIZATION MONO_NEVER_INLINE gpointer do_icall_wrapper (InterpFrame *frame, MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval *sp, gpointer ptr, gboolean save_last_error, gboolean *gc_transitions) { MonoLMFExt ext; - INTERP_PUSH_LMF_WITH_CTX (frame, ext, exit_icall); - if(frame->imethod && frame->imethod->method && frame->imethod->method->name) - { - MH_LOGV(MH_LVL_DEBUG, "calling do_icall for %s : %s", frame->imethod->method->name, mono_method_full_name (frame->imethod->method, TRUE)); - } - else - { - MH_LOGV(MH_LVL_DEBUG, "** Not getting method name because:"); - if (!frame->imethod) - { - MH_LOGV(MH_LVL_DEBUG, "** called do_icall_wrapper for null imethod"); - } - else if (!frame->imethod->method) - { - MH_LOGV(MH_LVL_DEBUG, "** called do_icall_wrapper for imethod %p with no method", frame->imethod); - } - else if (!frame->imethod->method->name) - { - MH_LOGV(MH_LVL_DEBUG, "** called do_icall_wrapper for imethod->method %p with no name", frame->imethod->method); - } - } - fflush(stdout); + INTERP_PUSH_LMF_WITH_CTX (frame, ext, exit_icall); if (*gc_transitions) { MONO_ENTER_GC_SAFE; do_icall (sig, op, ret_sp, sp, ptr, save_last_error); @@ -4191,7 +4168,6 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause frame->state.ip = ip + 8; if (imethod->method) - MH_LOG ("Calling native method %s with signature %s", mono_method_full_name (imethod->method, TRUE), mono_signature_full_name (csignature)); ves_pinvoke_method (imethod, csignature, (MonoFuncV)code, context, frame, (stackval*)(locals + ip [1]), (stackval*)(locals + ip [3]), save_last_error, cache, &gc_transitions); EXCEPTION_CHECKPOINT; CHECK_RESUME_STATE (context); @@ -7121,7 +7097,6 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; (*(gpointer*)(locals + (ip[1]))) = frame->imethod->data_items [ip [2]]; { intptr_t result = (*(guint64*)(locals + (ip[1]))); - MH_LOG("MINT_LDPTR: *(%p + %d) = frame->imethod->data_items [ip [%d]]: %p", locals, ip[1], ip[2], (void*)result); } ip += 3; MINT_IN_BREAK; @@ -7623,7 +7598,6 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; (*(guint64*)(locals + (ip[1]))) = (*(guint64*)(locals + (ip[2]))); { intptr_t result = (*(guint64*)(locals + (ip[1]))); - MH_LOGV(MH_LVL_CRIPPLE, "MINT_MOV_8: *(%p + %d) = *(%p + %d): %p", locals, ip[1], locals, ip[2], (void*)result); } ip += 3;; MINT_IN_BREAK; diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index f0c993f9f3fabc..2e43168230a072 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -2860,8 +2860,6 @@ static uint16_t encode_signature(const int* params, int param_count, int return_ sprintf(buff + param_count + offset, "_%d", return_type); else sprintf(buff + param_count + offset, "_V"); - - MH_LOGV(MH_LVL_VERBOSE, "Encoded signature %s as %d", buff, encoded); } #endif return encoded; @@ -2903,48 +2901,37 @@ gboolean interp_type_as_ptr_test (MonoType *tp) { if (MONO_TYPE_IS_POINTER (tp)) { - MH_LOGV(MH_LVL_TRACE, "MONO_TYPE_IS_POINTER evaluated true"); return TRUE; } if (MONO_TYPE_IS_REFERENCE (tp)) { - MH_LOGV(MH_LVL_TRACE, "MONO_TYPE_IS_REFERENCE evaluated true"); return TRUE; } if ((tp)->type == MONO_TYPE_I4) { - MH_LOGV(MH_LVL_TRACE, "tp->type == MONO_TYPE_I4 evaluated true"); return TRUE; } #if SIZEOF_VOID_P == 8 if ((tp)->type == MONO_TYPE_I8 || (tp)->type == MONO_TYPE_U8) { - MH_LOGV(MH_LVL_TRACE, "tp->type == MONO_TYPE_I8 or tp->type == MONO_TYPE_U8 evaluated true"); return TRUE; } #endif if ((tp)->type == MONO_TYPE_BOOLEAN) { - MH_LOGV(MH_LVL_TRACE, "tp->type == MONO_TYPE_BOOLEAN evaluated true"); return TRUE; } if ((tp)->type == MONO_TYPE_CHAR) { - MH_LOGV(MH_LVL_TRACE, "tp->type == MONO_TYPE_CHAR evaluated true"); return TRUE; } if ((tp)->type == MONO_TYPE_VALUETYPE && m_class_is_enumtype (m_type_data_get_klass_unchecked (tp))) { - MH_LOGV(MH_LVL_TRACE, "tp->type == MONO_TYPE_VALUETYPE and m_class_is_enumtype() evaluated true"); return TRUE; } if (is_scalar_vtype (tp)) { - MH_LOGV(MH_LVL_TRACE, "is_scalar_vtype(tp) evaluated true"); return TRUE; } else - MH_LOGV(MH_LVL_TRACE, "is_scalar_vtype(tp) evaluated false"); if (is_scalar_vtype_test (tp)) { - MH_LOGV(MH_LVL_TRACE, "is_scalar_vtype_test(tp) evaluated true"); return TRUE; } else - MH_LOGV(MH_LVL_TRACE, "is_scalar_vtype_test(tp) evaluated false"); return FALSE; } @@ -2956,17 +2943,13 @@ interp_get_icall_sig (MonoMethodSignature *sig) int params[MAX_SIG_PARAMS]; if (sig->param_count > MAX_SIG_PARAMS) { - MH_LOGV(MH_LVL_VERBOSE, "Parameter count (%d) too high for icall enum encoding (MAX_SIG_PARAMS is %d)", sig->param_count, MAX_SIG_PARAMS); return MINT_ICALLSIG_MAX; } - - MH_LOGV(MH_LVL_TRACE, "Getting icall sig for method with %d params", sig->param_count); for (int i = 0; i < sig->param_count && i < MAX_SIG_PARAMS; ++i) { MonoType *tp = sig->params[i]; params[i] = GET_PARAM_SIZE(tp); if (params[i] == 0) // this is ok but check logic against old method { - MH_LOGV(MH_LVL_TRACE, "Type %s encoded as %d. tp->type value is %d. Will check against old method", mono_type_get_name(tp), params[i], tp->type); gboolean isPtrOld = interp_type_as_ptr_test(tp); if (isPtrOld) { @@ -2977,16 +2960,13 @@ interp_get_icall_sig (MonoMethodSignature *sig) return MINT_ICALLSIG_MAX; // not a pointer type - double check } else - MH_LOGV(MH_LVL_TRACE, "Type %s encoded as %d. tp->type value is %d", mono_type_get_name(tp), params[i], tp->type); } // returnType of 0 == void int returnType = GET_PARAM_SIZE(sig->ret); if (returnType == 0 && sig->ret->type != MONO_TYPE_VOID) { - MH_LOGV(MH_LVL_TRACE, "will return MINT_ICALLSIG_MAX: return type %s was encoded as %d. p->type value is %d. rejecting because it's not a pointer type.", mono_type_get_name(sig->ret), returnType, sig->ret->type); return MINT_ICALLSIG_MAX; } - MH_LOGV(MH_LVL_TRACE, "return type %s encoded as %d. p->type value is %d", mono_type_get_name(sig->ret), returnType, sig->ret->type); op = encode_signature(params, sig->param_count, returnType); return op; } diff --git a/src/mono/mono/profiler/browser.c b/src/mono/mono/profiler/browser.c index ab37df50372b52..4a11fce17ccdf3 100644 --- a/src/mono/mono/profiler/browser.c +++ b/src/mono/mono/profiler/browser.c @@ -95,8 +95,6 @@ method_enter (MonoProfiler *prof, MonoMethod *method, MonoProfilerCallContext *c newframe->method = method; newframe->interp_frame = ctx ? ctx->interp_frame : NULL; } - MH_LOG_INDENT(); - MH_LOG("method_enter: %d %s\n", top_stack_frame_index, mono_method_get_full_name (method)); } static void @@ -133,9 +131,6 @@ method_leave (MonoProfiler *prof, MonoMethod *method, MonoProfilerCallContext *c bool is_over = top_stack_frame_index >= MAX_STACK_DEPTH; int top_index = is_over ? MAX_STACK_DEPTH - 1 : top_stack_frame_index; ProfilerStackFrame *top_frame = &profiler_stack_frames[top_index]; - - MH_LOG_UNINDENT(); - MH_LOG("method_leave: %d %s\n", top_stack_frame_index, mono_method_get_full_name (method)); if (!is_over) { g_assertf(top_frame->method == method, "method_exc_leave: %d method mismatch. Pointer comparison: %p : %p. \ntop_frame %s != leave %s. \n", top_stack_frame_index, top_frame->method, method, mono_method_get_full_name (top_frame->method), mono_method_get_full_name (method)); @@ -168,9 +163,6 @@ method_exc_leave (MonoProfiler *prof, MonoMethod *method, MonoObject *exc) bool is_over = top_stack_frame_index >= MAX_STACK_DEPTH; int top_index = is_over ? MAX_STACK_DEPTH - 1 : top_stack_frame_index; ProfilerStackFrame *top_frame = &profiler_stack_frames[top_index]; - - MH_LOG_UNINDENT(); - MH_LOG("method_exc_leave: %d %s\n", top_stack_frame_index, mono_method_get_full_name (method)); if (top_frame->should_record || should_record_frame (mono_wasm_profiler_now ())) { diff --git a/src/native/public/monoapi.cmake b/src/native/public/monoapi.cmake index 7b1fca85fddfda..65ecd1398ebff4 100644 --- a/src/native/public/monoapi.cmake +++ b/src/native/public/monoapi.cmake @@ -45,7 +45,6 @@ set(metadata_public_headers image.h loader.h metadata.h - mh_log.h mono-config.h mono-debug.h mono-gc.h From fc21032778289613db0d525f473c3b955497f2fe Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 7 Nov 2025 13:29:23 +0000 Subject: [PATCH 196/209] Tidying --- src/mono/browser/runtime/corebindings.c | 1 - src/mono/mono/eglib/gptrarray.c | 1 - src/mono/mono/metadata/icall-def.h | 3 - src/mono/mono/metadata/icall-table.c | 2 +- src/mono/mono/metadata/icall.c | 79 +------------------------ src/mono/mono/metadata/marshal.c | 8 +-- src/mono/mono/metadata/object.c | 8 --- src/mono/mono/mini/interp/interp.c | 3 +- 8 files changed, 8 insertions(+), 97 deletions(-) diff --git a/src/mono/browser/runtime/corebindings.c b/src/mono/browser/runtime/corebindings.c index 96d87e70ef58ea..9a88fd188154b9 100644 --- a/src/mono/browser/runtime/corebindings.c +++ b/src/mono/browser/runtime/corebindings.c @@ -15,7 +15,6 @@ #include #include #include -#include #include diff --git a/src/mono/mono/eglib/gptrarray.c b/src/mono/mono/eglib/gptrarray.c index bfde54c200c902..088b04a065e43d 100644 --- a/src/mono/mono/eglib/gptrarray.c +++ b/src/mono/mono/eglib/gptrarray.c @@ -115,7 +115,6 @@ void g_ptr_array_add(GPtrArray *array, gpointer data) { g_assert (array); - g_assert(sizeof(gpointer) == 8); g_ptr_array_grow((GPtrArrayPriv *)array, 1); array->pdata[array->len++] = data; } diff --git a/src/mono/mono/metadata/icall-def.h b/src/mono/mono/metadata/icall-def.h index 115eb8d969b545..00a88b2084d399 100644 --- a/src/mono/mono/metadata/icall-def.h +++ b/src/mono/mono/metadata/icall-def.h @@ -496,9 +496,6 @@ HANDLES(RT_1, "CreateInstanceInternal", ves_icall_System_RuntimeType_CreateInsta HANDLES(RT_28, "FunctionPointerReturnAndParameterTypes", ves_icall_RuntimeType_FunctionPointerReturnAndParameterTypes, GPtrArray_ptr, 1, (MonoQCallTypeHandle)) NOHANDLES(ICALL(RT_33, "GetCallingConventionFromFunctionPointerInternal", ves_icall_RuntimeType_GetCallingConventionFromFunctionPointerInternal)) HANDLES(RT_2, "GetConstructors_native", ves_icall_RuntimeType_GetConstructors_native, GPtrArray_ptr, 2, (MonoQCallTypeHandle, guint32)) -HANDLES(RT_34, "TestArray_native", ves_icall_RuntimeType_TestArray_Native, GPtrArray_ptr, 0, ()) -HANDLES(RT_35, "TestArrayRaw_native", ves_icall_RuntimeType_TestArray_Raw_Native, gpointer, 0, ()) - HANDLES(RT_30, "GetCorrespondingInflatedMethod", ves_icall_RuntimeType_GetCorrespondingInflatedMethod, MonoReflectionMethod, 2, (MonoQCallTypeHandle, MonoReflectionMethod)) HANDLES(RT_21, "GetDeclaringMethod", ves_icall_RuntimeType_GetDeclaringMethod, void, 2, (MonoQCallTypeHandle, MonoObjectHandleOnStack)) HANDLES(RT_22, "GetDeclaringType", ves_icall_RuntimeType_GetDeclaringType, void, 2, (MonoQCallTypeHandle, MonoObjectHandleOnStack)) diff --git a/src/mono/mono/metadata/icall-table.c b/src/mono/mono/metadata/icall-table.c index 33224aeb9c5b0f..b864900037d3cb 100644 --- a/src/mono/mono/metadata/icall-table.c +++ b/src/mono/mono/metadata/icall-table.c @@ -45,7 +45,7 @@ #define HANDLES_REUSE_WRAPPER HANDLES #define MONO_HANDLE_REGISTER_ICALL(...) /* nothing */ -#define TEST_ICALL_SYMBOL_MAP 1 +//#define TEST_ICALL_SYMBOL_MAP 1 // Generate Icall_ constants enum { diff --git a/src/mono/mono/metadata/icall.c b/src/mono/mono/metadata/icall.c index f634c067c42c59..36887ae9810ab2 100644 --- a/src/mono/mono/metadata/icall.c +++ b/src/mono/mono/metadata/icall.c @@ -4082,82 +4082,12 @@ ves_icall_RuntimeType_GetMethodsByName_native (MonoQCallTypeHandle type_handle, return mono_class_get_methods_by_name (klass, mname, bflags, mlisttype, FALSE, error); } -GPtrArray* -ves_icall_RuntimeType_TestArray_Native(MonoError *error) -{ - GPtrArray* res = g_ptr_array_new (); - gpointer val1 = (gpointer)0x111; - gpointer val2 = (gpointer)0x222; - gpointer val3 = (gpointer)0x333; - gpointer val4 = (gpointer)0x444; - - g_ptr_array_add (res, val1); - g_ptr_array_add (res, val2); - g_ptr_array_add (res, val3); - g_ptr_array_add (res, val4); - return res; -} - -gpointer -ves_icall_RuntimeType_TestArray_Raw_Native(MonoError *error) -{ - assert(sizeof(gpointer) == sizeof(gpointer_ptr)); - assert(sizeof(gpointer) == 8); - //bypass GPtrArray - int numElems = 4; - -#define MH_USE_GPTR_ARRAY 1 -#define MH_USER_INT64_ARRAY 0 - #if(0) - int64_t *rawArray = malloc(numElems * sizeof(int64_t)); - memset(rawArray, 0, numElems * sizeof(int64_t)); - GPtrArray* res = g_ptr_array_new (); - gpointer val1 = (gpointer)0x111; - gpointer val2 = (gpointer)0x222; - gpointer val3 = (gpointer)0x333; - gpointer val4 = (gpointer)0x444; - - g_ptr_array_add (res, val1); - g_ptr_array_add (res, val2); - g_ptr_array_add (res, val3); - g_ptr_array_add (res, val4); - return res->pdata; - #elif (MH_USER_INT64_ARRAY) - int64_t *rawArray = malloc(numElems * sizeof(int64_t)); - memset(rawArray, 0, numElems * sizeof(int64_t)); - int64_t val1 = (int64_t)0x111; - int64_t val2 = (int64_t)0x222; - int64_t val3 = (int64_t)0x333; - int64_t val4 = (int64_t)0x444; - rawArray[0] = val1; - rawArray[1] = val2; - rawArray[2] = val3; - rawArray[3] = val4; - #elif (MH_USE_GPTR_ARRAY) - gpointer *rawArray = malloc(numElems * sizeof(gpointer)); - memset(rawArray, 0, numElems * sizeof(gpointer)); - gpointer val1 = (gpointer)0x111; - gpointer val2 = (gpointer)0x222; - gpointer val3 = (gpointer)0x333; - gpointer val4 = (gpointer)0x444; - rawArray[0] = val1; - rawArray[1] = val2; - rawArray[2] = val3; - rawArray[3] = val4; - #endif - // 8 digits for 4 byte value - return (gpointer)rawArray; - - -} - GPtrArray* ves_icall_RuntimeType_GetConstructors_native (MonoQCallTypeHandle type_handle, guint32 bflags, MonoError *error) { MonoType *type = type_handle.type; if (m_type_is_byref (type)) { - GPtrArray* res = g_ptr_array_new (); - return res; + return g_ptr_array_new (); } MonoClass *startklass, *klass; @@ -5184,9 +5114,7 @@ ves_icall_System_Reflection_RuntimeMethodInfo_GetMethodFromHandleInternalType_na } else if (type) klass = mono_class_from_mono_type_internal (type); else - klass = method->klass; - mono_method_full_name (method, true), - mono_class_full_name (klass)); + klass = method->klass; return mono_method_get_object_handle (method, klass, error); } @@ -7067,9 +6995,8 @@ mono_lookup_internal_call_full_with_flags (MonoMethod *method, gboolean warn_on_ locked = FALSE; if (res) - { goto exit; - } + if (warn_on_missing) { g_warning ("cant resolve internal call to \"%s\" (tested without signature also)", mname); g_print ("\nYour mono runtime and class libraries are out of sync.\n"); diff --git a/src/mono/mono/metadata/marshal.c b/src/mono/mono/metadata/marshal.c index 3234f1c50e3fef..c6323aad8db5a7 100644 --- a/src/mono/mono/metadata/marshal.c +++ b/src/mono/mono/metadata/marshal.c @@ -4734,15 +4734,13 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method) cache = get_cache (&((MonoMethodInflated*)orig_method)->owner->wrapper_caches.synchronized_cache, mono_aligned_addr_hash, NULL); res = check_generic_wrapper_cache (cache, orig_method, orig_method, method); if (res) - { return res; - } + } else { cache = get_cache (&get_method_image (method)->wrapper_caches.synchronized_cache, mono_aligned_addr_hash, NULL); - if ((res = mono_marshal_find_in_cache (cache, method))) - { + if ((res = mono_marshal_find_in_cache (cache, method))) return res; - } + } sig = mono_metadata_signature_dup_full (get_method_image (method), mono_method_signature_internal (method)); diff --git a/src/mono/mono/metadata/object.c b/src/mono/mono/metadata/object.c index a517f2efe329ee..612ef517fcdc47 100644 --- a/src/mono/mono/metadata/object.c +++ b/src/mono/mono/metadata/object.c @@ -7204,7 +7204,6 @@ mono_ldstr_utf8 (MonoImage *image, guint32 idx, MonoError *error) char * mono_string_to_utf8 (MonoString *s) { - MH_LOGV(MH_LVL_VERBOSE, "Got here"); char *result; MONO_ENTER_GC_UNSAFE; ERROR_DECL (error); @@ -7224,7 +7223,6 @@ mono_string_to_utf8 (MonoString *s) char * mono_utf16_to_utf8len (const gunichar2 *s, gsize slength, gsize *utf8_length, MonoError *error) { - MH_LOGV(MH_LVL_VERBOSE, "Got here"); MONO_REQ_GC_UNSAFE_MODE; long written = 0; @@ -7239,7 +7237,6 @@ mono_utf16_to_utf8len (const gunichar2 *s, gsize slength, gsize *utf8_length, Mo if (!slength) return g_strdup (""); - MH_LOGV(MH_LVL_VERBOSE, "Got string pointer %p", s); as = g_utf16_to_utf8 (s, (glong)slength, NULL, &written, &gerror); *utf8_length = written; if (gerror) { @@ -7269,7 +7266,6 @@ mono_utf16_to_utf8len (const gunichar2 *s, gsize slength, gsize *utf8_length, Mo char * mono_utf16_to_utf8 (const gunichar2 *s, gsize slength, MonoError *error) { - MH_LOGV(MH_LVL_VERBOSE, "Got here"); gsize utf8_length = 0; return mono_utf16_to_utf8len (s, slength, &utf8_length, error); } @@ -7278,7 +7274,6 @@ char * mono_string_to_utf8_checked_internal (MonoString *s, MonoError *error) { MONO_REQ_GC_UNSAFE_MODE; - MH_LOGV(MH_LVL_VERBOSE, "Got here"); error_init (error); if (s == NULL) @@ -7286,7 +7281,6 @@ mono_string_to_utf8_checked_internal (MonoString *s, MonoError *error) if (!s->length) return g_strdup (""); - MH_LOGV(MH_LVL_VERBOSE, "Got string pointer %p, length %d", s, s->length); return mono_utf16_to_utf8 (mono_string_chars_internal (s), s->length, error); } @@ -7294,7 +7288,6 @@ char * mono_string_to_utf8len (MonoStringHandle s, gsize *utf8len, MonoError *error) { *utf8len = 0; - MH_LOGV(MH_LVL_VERBOSE, "Got string handle %p", MONO_HANDLE_RAW (s)); if (MONO_HANDLE_IS_NULL (s)) return NULL; @@ -7326,7 +7319,6 @@ mono_string_to_utf8_checked (MonoString *string_obj, MonoError *error) char * mono_string_handle_to_utf8 (MonoStringHandle s, MonoError *error) { - MH_LOGV(MH_LVL_VERBOSE, "Got string handle %p", MONO_HANDLE_RAW (s)); return mono_string_to_utf8_checked_internal (MONO_HANDLE_RAW (s), error); } diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index cd0c53f100aa69..1fa1f1a53a8e88 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -4166,8 +4166,7 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause gpointer *cache = (gpointer*)&frame->imethod->data_items [ip [7]]; /* for calls, have ip pointing at the start of next instruction */ frame->state.ip = ip + 8; - - if (imethod->method) + ves_pinvoke_method (imethod, csignature, (MonoFuncV)code, context, frame, (stackval*)(locals + ip [1]), (stackval*)(locals + ip [3]), save_last_error, cache, &gc_transitions); EXCEPTION_CHECKPOINT; CHECK_RESUME_STATE (context); From 394d84f353b0b95a377d92b92eb0c95ac7678972 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 7 Nov 2025 14:06:15 +0000 Subject: [PATCH 197/209] Test push --- src/mono/mono/metadata/object.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mono/mono/metadata/object.c b/src/mono/mono/metadata/object.c index 612ef517fcdc47..567c125445984e 100644 --- a/src/mono/mono/metadata/object.c +++ b/src/mono/mono/metadata/object.c @@ -57,6 +57,7 @@ #include "monitor.h" #include "icall-decl.h" #include "icall-signatures.h" +//test comment #if _MSC_VER #pragma warning(disable:4312) // FIXME pointer cast to different size #endif From 095adce438ab1663b0291eb92b30f19c1dfd3278 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 7 Nov 2025 14:07:46 +0000 Subject: [PATCH 198/209] revert test comment --- src/mono/mono/metadata/object.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mono/mono/metadata/object.c b/src/mono/mono/metadata/object.c index 567c125445984e..612ef517fcdc47 100644 --- a/src/mono/mono/metadata/object.c +++ b/src/mono/mono/metadata/object.c @@ -57,7 +57,6 @@ #include "monitor.h" #include "icall-decl.h" #include "icall-signatures.h" -//test comment #if _MSC_VER #pragma warning(disable:4312) // FIXME pointer cast to different size #endif From f984e51a2ada7f9abd399f0ed5c97f8d28256577 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 7 Nov 2025 14:25:35 +0000 Subject: [PATCH 199/209] Tidying --- src/mono/mono/mini/aot-runtime-wasm.c | 7 +- src/mono/mono/mini/interp/interp-pinvoke.c | 8842 -------------------- src/mono/mono/mini/interp/mintSigs.h | 2 +- src/mono/mono/utils/CMakeLists.txt | 7 +- 4 files changed, 4 insertions(+), 8854 deletions(-) delete mode 100644 src/mono/mono/mini/interp/interp-pinvoke.c diff --git a/src/mono/mono/mini/aot-runtime-wasm.c b/src/mono/mono/mini/aot-runtime-wasm.c index 60d1fe9cd2c553..04a4b2504f0306 100644 --- a/src/mono/mono/mini/aot-runtime-wasm.c +++ b/src/mono/mono/mini/aot-runtime-wasm.c @@ -165,9 +165,7 @@ compare_icall_tramp (const void *key, const void *elem) { return strcmp (key, *(void**)elem); } -static void -logCookie (int c_count, const char *cookie) { -} + gpointer mono_wasm_get_interp_to_native_trampoline (MonoMethodSignature *sig) { @@ -196,8 +194,7 @@ mono_wasm_get_interp_to_native_trampoline (MonoMethodSignature *sig) for (int i = 0; i < sig->param_count; ++i) { cookie [offset + i] = type_to_c (sig->params [i], NULL); } - logCookie(c_count, cookie); - + void *p = mono_wasm_interp_to_native_callback (cookie); if (!p) g_error ("CANNOT HANDLE INTERP ICALL SIG %s\n", cookie); diff --git a/src/mono/mono/mini/interp/interp-pinvoke.c b/src/mono/mono/mini/interp/interp-pinvoke.c deleted file mode 100644 index d262adf6841cf3..00000000000000 --- a/src/mono/mono/mini/interp/interp-pinvoke.c +++ /dev/null @@ -1,8842 +0,0 @@ -/** - * \file - * - * interp.c: Interpreter for CIL byte codes - * - * Authors: - * Paolo Molaro (lupus@ximian.com) - * Miguel de Icaza (miguel@ximian.com) - * Dietmar Maurer (dietmar@ximian.com) - * - * (C) 2001, 2002 Ximian, Inc. - */ -#ifndef __USE_ISOC99 -#define __USE_ISOC99 -#endif -#include "config.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_ALLOCA_H -# include -#else -# ifdef __CYGWIN__ -# define alloca __builtin_alloca -# endif -#endif - -/* trim excessive headers */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "interp.h" -#include "interp-internals.h" -#include "mintops.h" -#include "interp-intrins.h" -#include "interp-icalls.h" -#include "interp-pinvoke.h" -#include "tiering.h" - -#ifdef INTERP_ENABLE_SIMD -#include "interp-simd.h" -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#ifdef TARGET_ARM -#include -#endif -#include - -#include "interp-pgo.h" - -#ifdef HOST_BROWSER -#include "jiterpreter.h" -#include -#endif - - -/* Arguments that are passed when invoking only a finally/filter clause from the frame */ -struct FrameClauseArgs { - /* Where we start the frame execution from */ - const guint16 *start_with_ip; - /* - * End ip of the exit_clause. We need it so we know whether the resume - * state is for this frame (which is called from EH) or for the original - * frame further down the stack. - */ - const guint16 *end_at_ip; - /* Frame that is executing this clause */ - InterpFrame *exec_frame; - gboolean run_until_end; -}; - -static MONO_NEVER_INLINE void -mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClauseArgs *clause_args); - -/* - * This code synchronizes with interp_mark_stack () using compiler memory barriers. - */ - -static FrameDataFragment* -frame_data_frag_new (int size) -{ - FrameDataFragment *frag = (FrameDataFragment*)g_malloc (size); - - frag->pos = (guint8*)&frag->data; - frag->end = (guint8*)frag + size; - frag->next = NULL; - return frag; -} - -static void -frame_data_frag_free (FrameDataFragment *frag) -{ - while (frag) { - FrameDataFragment *next = frag->next; - g_free (frag); - frag = next; - } -} - -static void -frame_data_allocator_init (FrameDataAllocator *stack, int size) -{ - FrameDataFragment *frag; - - frag = frame_data_frag_new (size); - stack->first = stack->current = frag; - stack->infos_capacity = 4; - stack->infos = (FrameDataInfo*)g_malloc (stack->infos_capacity * sizeof (FrameDataInfo)); -} - -static void -frame_data_allocator_free (FrameDataAllocator *stack) -{ - /* Assert to catch leaks */ - g_assert_checked (stack->current == stack->first && stack->current->pos == (guint8*)&stack->current->data); - frame_data_frag_free (stack->first); -} - -static FrameDataFragment* -frame_data_allocator_add_frag (FrameDataAllocator *stack, int size) -{ - FrameDataFragment *new_frag; - - // FIXME: - guint frag_size = 4096; - if (size + sizeof (FrameDataFragment) > frag_size) - frag_size = size + sizeof (FrameDataFragment); - new_frag = frame_data_frag_new (frag_size); - mono_compiler_barrier (); - stack->current->next = new_frag; - stack->current = new_frag; - return new_frag; -} - -static gpointer -frame_data_allocator_alloc (FrameDataAllocator *stack, InterpFrame *frame, int size) -{ - FrameDataFragment *current = stack->current; - gpointer res; - - int infos_len = stack->infos_len; - - if (!infos_len || (infos_len > 0 && stack->infos [infos_len - 1].frame != frame)) { - /* First allocation by this frame. Save the markers for restore */ - if (infos_len == stack->infos_capacity) { - stack->infos_capacity = infos_len * 2; - stack->infos = (FrameDataInfo*)g_realloc (stack->infos, stack->infos_capacity * sizeof (FrameDataInfo)); - } - stack->infos [infos_len].frame = frame; - stack->infos [infos_len].frag = current; - stack->infos [infos_len].pos = current->pos; - stack->infos_len++; - } - - if (G_LIKELY (current->pos + size <= current->end)) { - res = current->pos; - current->pos += size; - } else { - if (current->next && current->next->pos + size <= current->next->end) { - current = stack->current = current->next; - current->pos = (guint8*)¤t->data; - } else { - FrameDataFragment *tmp = current->next; - /* avoid linking to be freed fragments, so the GC can't trip over it */ - current->next = NULL; - mono_compiler_barrier (); - frame_data_frag_free (tmp); - - current = frame_data_allocator_add_frag (stack, size); - } - g_assert (current->pos + size <= current->end); - res = (gpointer)current->pos; - current->pos += size; - } - mono_compiler_barrier (); - return res; -} - -static void -frame_data_allocator_pop (FrameDataAllocator *stack, InterpFrame *frame) -{ - int infos_len = stack->infos_len; - - if (infos_len > 0 && stack->infos [infos_len - 1].frame == frame) { - infos_len--; - stack->current = stack->infos [infos_len].frag; - stack->current->pos = stack->infos [infos_len].pos; - stack->infos_len = infos_len; - } -} - -/* - * reinit_frame: - * - * Reinitialize a frame. - */ -static void -reinit_frame (InterpFrame *frame, InterpFrame *parent, InterpMethod *imethod, gpointer retval, gpointer stack) -{ - frame->parent = parent; - frame->imethod = imethod; - frame->stack = (stackval*)stack; - frame->retval = (stackval*)retval; - frame->state.ip = NULL; -} - -#define STACK_ADD_ALIGNED_BYTES(sp,bytes) ((stackval*)((char*)(sp) + (bytes))) -#define STACK_ADD_BYTES(sp,bytes) ((stackval*)((char*)(sp) + ALIGN_TO(bytes, MINT_STACK_SLOT_SIZE))) -#define STACK_SUB_BYTES(sp,bytes) ((stackval*)((char*)(sp) - ALIGN_TO(bytes, MINT_STACK_SLOT_SIZE))) - - -/* If TRUE, interpreted code will be interrupted at function entry/backward branches */ -static gboolean ss_enabled; - -static gboolean interp_init_done = FALSE; - -#ifdef HOST_WASI -static gboolean debugger_enabled = FALSE; -#endif - -static MonoException* do_transform_method (InterpMethod *imethod, InterpFrame *method, ThreadContext *context); - -typedef void (*ICallMethod) (InterpFrame *frame); - -static MonoNativeTlsKey thread_context_id; - -#define DEBUG_INTERP 0 -#define COUNT_OPS 0 - -#if DEBUG_INTERP -int mono_interp_traceopt = 2; -/* If true, then we output the opcodes as we interpret them */ -static int global_tracing = 2; - -static int debug_indent_level = 0; - -static int break_on_method = 0; -static int nested_trace = 0; -static GList *db_methods = NULL; -static char* dump_args (InterpFrame *inv); - -static void -output_indent (void) -{ - int h; - - for (h = 0; h < debug_indent_level; h++) - g_print (" "); -} - -static void -db_match_method (gpointer data, gpointer user_data) -{ - MonoMethod *m = (MonoMethod*)user_data; - MonoMethodDesc *desc = (MonoMethodDesc*)data; - - if (mono_method_desc_full_match (desc, m)) - break_on_method = 1; -} - -static void -debug_enter (InterpFrame *frame, int *tracing) -{ - if (db_methods) { - g_list_foreach (db_methods, db_match_method, (gpointer)frame->imethod->method); - if (break_on_method) - *tracing = nested_trace ? (global_tracing = 2, 3) : 2; - break_on_method = 0; - } - if (*tracing) { - MonoMethod *method = frame->imethod->method; - char *mn, *args = dump_args (frame); - debug_indent_level++; - output_indent (); - mn = mono_method_full_name (method, FALSE); - g_print ("(%p) Entering %s (", mono_thread_internal_current (), mn); - g_free (mn); - g_print ("%s)\n", args); - g_free (args); - } -} - -#define DEBUG_LEAVE() \ - if (tracing) { \ - char *mn, *args; \ - args = dump_retval (frame); \ - output_indent (); \ - mn = mono_method_full_name (frame->imethod->method, FALSE); \ - g_print ("(%p) Leaving %s", mono_thread_internal_current (), mn); \ - g_free (mn); \ - g_print (" => %s\n", args); \ - g_free (args); \ - debug_indent_level--; \ - if (tracing == 3) global_tracing = 0; \ - } - -#else - - -#define DEBUG_LEAVE() - -#endif - -#if defined(__GNUC__) && !defined(TARGET_WASM) && !COUNT_OPS && !DEBUG_INTERP && !ENABLE_CHECKED_BUILD && !PROFILE_INTERP -#define USE_COMPUTED_GOTO 1 -#endif - -#if USE_COMPUTED_GOTO - -#define MINT_IN_DISPATCH(op) goto *in_labels [opcode = (MintOpcode)(op)] -#define MINT_IN_SWITCH(op) MINT_IN_DISPATCH (op); -#define MINT_IN_BREAK MINT_IN_DISPATCH (*ip) -#define MINT_IN_CASE(x) LAB_ ## x: - -#else - -#define MINT_IN_SWITCH(op) COUNT_OP(op); switch (opcode = (MintOpcode)(op)) -#define MINT_IN_CASE(x) case x: -#define MINT_IN_BREAK break - -#endif - -static void -clear_resume_state (ThreadContext *context) -{ - context->has_resume_state = 0; - context->handler_frame = NULL; - context->handler_ei = NULL; - g_assert (context->exc_gchandle); - mono_gchandle_free_internal (context->exc_gchandle); - context->exc_gchandle = 0; -} - -/* - * If this bit is set, it means the call has thrown the exception, and we - * reached this point because the EH code in mono_handle_exception () - * unwound all the JITted frames below us. mono_interp_set_resume_state () - * has set the fields in context to indicate where we have to resume execution. - */ -#define CHECK_RESUME_STATE(context) do { \ - if ((context)->has_resume_state) \ - goto resume; \ - } while (0) - -static void -set_context (ThreadContext *context) -{ - mono_native_tls_set_value (thread_context_id, context); - - if (!context) - return; - - MonoJitTlsData *jit_tls = mono_tls_get_jit_tls (); - g_assertf (jit_tls, "ThreadContext needs initialized JIT TLS"); - - /* jit_tls assumes ownership of 'context' */ - jit_tls->interp_context = context; -} - -static ThreadContext * -get_context (void) -{ - ThreadContext *context = (ThreadContext *) mono_native_tls_get_value (thread_context_id); - if (context == NULL) { - context = g_new0 (ThreadContext, 1); - context->stack_start = (guchar*)mono_valloc_aligned (INTERP_STACK_SIZE, MINT_STACK_ALIGNMENT, MONO_MMAP_READ | MONO_MMAP_WRITE, MONO_MEM_ACCOUNT_INTERP_STACK); - // A bit for every pointer sized slot in the stack. FIXME don't allocate whole bit array - if (mono_interp_opt & INTERP_OPT_PRECISE_GC) - context->no_ref_slots = (guchar*)mono_valloc (NULL, INTERP_STACK_SIZE / (8 * sizeof (gpointer)), MONO_MMAP_READ | MONO_MMAP_WRITE, MONO_MEM_ACCOUNT_INTERP_STACK); - context->stack_end = context->stack_start + INTERP_STACK_SIZE - INTERP_REDZONE_SIZE; - context->stack_real_end = context->stack_start + INTERP_STACK_SIZE; - /* We reserve a stack slot at the top of the interp stack to make temp objects visible to GC */ - context->stack_pointer = context->stack_start + MINT_STACK_ALIGNMENT; - - frame_data_allocator_init (&context->data_stack, 8192); - /* Make sure all data is initialized before publishing the context */ - mono_compiler_barrier (); - set_context (context); - } - return context; -} - -static void -interp_free_context (gpointer ctx) -{ - ThreadContext *context = (ThreadContext*)ctx; - - ThreadContext *current_context = (ThreadContext *) mono_native_tls_get_value (thread_context_id); - /* at thread exit, we can be called from the JIT TLS key destructor with current_context == NULL */ - if (current_context != NULL) { - /* check that the context we're freeing is the current one before overwriting TLS */ - g_assert (context == current_context); - set_context (NULL); - } - - mono_vfree (context->stack_start, INTERP_STACK_SIZE, MONO_MEM_ACCOUNT_INTERP_STACK); - /* Prevent interp_mark_stack from trying to scan the data_stack, before freeing it */ - context->stack_start = NULL; - mono_compiler_barrier (); - frame_data_allocator_free (&context->data_stack); - g_free (context); -} - -static gboolean -need_native_unwind (ThreadContext *context) -{ - return context->has_resume_state && !context->handler_frame; -} - -static InterpMethod* -lookup_imethod (MonoMethod *method) -{ - InterpMethod *imethod; - MonoJitMemoryManager *jit_mm = jit_mm_for_method (method); - - jit_mm_lock (jit_mm); - imethod = (InterpMethod*)mono_internal_hash_table_lookup (&jit_mm->interp_code_hash, method); - jit_mm_unlock (jit_mm); - - return imethod; -} - -#if defined (MONO_CROSS_COMPILE) || defined (HOST_WASM) -#define INTERP_PUSH_LMF_WITH_CTX_BODY(ext, exit_label) \ - (ext).kind = MONO_LMFEXT_INTERP_EXIT; - -#elif defined(MONO_ARCH_HAS_NO_PROPER_MONOCTX) -/* some platforms, e.g. appleTV, don't provide us a precise MonoContext - * (registers are not accurate), thus resuming to the label does not work. */ -#define INTERP_PUSH_LMF_WITH_CTX_BODY(ext, exit_label) \ - (ext).kind = MONO_LMFEXT_INTERP_EXIT; -#elif defined (_MSC_VER) -#define INTERP_PUSH_LMF_WITH_CTX_BODY(ext, exit_label) \ - (ext).kind = MONO_LMFEXT_INTERP_EXIT_WITH_CTX; \ - (ext).interp_exit_label_set = FALSE; \ - MONO_CONTEXT_GET_CURRENT ((ext).ctx); \ - if ((ext).interp_exit_label_set == FALSE) \ - mono_arch_do_ip_adjustment (&(ext).ctx); \ - if ((ext).interp_exit_label_set == TRUE) \ - goto exit_label; \ - (ext).interp_exit_label_set = TRUE; -#elif defined(MONO_ARCH_HAS_MONO_CONTEXT) -#define INTERP_PUSH_LMF_WITH_CTX_BODY(ext, exit_label) \ - (ext).kind = MONO_LMFEXT_INTERP_EXIT_WITH_CTX; \ - MONO_CONTEXT_GET_CURRENT ((ext).ctx); \ - MONO_CONTEXT_SET_IP (&(ext).ctx, (&&exit_label)); \ - mono_arch_do_ip_adjustment (&(ext).ctx); -#else -#define INTERP_PUSH_LMF_WITH_CTX_BODY(ext, exit_label) g_error ("requires working mono-context"); -#endif - -/* INTERP_PUSH_LMF_WITH_CTX: - * - * same as interp_push_lmf, but retrieving and attaching MonoContext to it. - * This is needed to resume into the interp when the exception is thrown from - * native code (see ./mono/tests/install_eh_callback.exe). - * - * This must be a macro in order to retrieve the right register values for - * MonoContext. - */ -#define INTERP_PUSH_LMF_WITH_CTX(frame, ext, exit_label) \ - memset (&(ext), 0, sizeof (MonoLMFExt)); \ - (ext).interp_exit_data = (frame); \ - INTERP_PUSH_LMF_WITH_CTX_BODY ((ext), exit_label); \ - mono_push_lmf (&(ext)); - -/* - * interp_push_lmf: - * - * Push an LMF frame on the LMF stack - * to mark the transition to native code. - * This is needed for the native code to - * be able to do stack walks. - */ -static void -interp_push_lmf (MonoLMFExt *ext, InterpFrame *frame) -{ - memset (ext, 0, sizeof (MonoLMFExt)); - ext->kind = MONO_LMFEXT_INTERP_EXIT; - ext->interp_exit_data = frame; - - mono_push_lmf (ext); -} - -static void -interp_pop_lmf (MonoLMFExt *ext) -{ - mono_pop_lmf (&ext->lmf); -} - -static InterpMethod* -get_virtual_method (InterpMethod *imethod, MonoVTable *vtable) -{ - MonoMethod *m = imethod->method; - - if ((m->flags & METHOD_ATTRIBUTE_FINAL) || !(m->flags & METHOD_ATTRIBUTE_VIRTUAL)) { - if (m->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED) - return mono_interp_get_imethod (mono_marshal_get_synchronized_wrapper (m)); - else - return imethod; - } - - mono_class_setup_vtable (vtable->klass); - - int slot = mono_method_get_vtable_slot (m); - if (mono_class_is_interface (m->klass)) { - g_assert (vtable->klass != m->klass); - /* TODO: interface offset lookup is slow, go through IMT instead */ - gboolean non_exact_match; - int ioffset = mono_class_interface_offset_with_variance (vtable->klass, m->klass, &non_exact_match); - g_assert (ioffset >= 0); - slot += ioffset; - } - - MonoMethod *virtual_method = m_class_get_vtable (vtable->klass) [slot]; - g_assert (virtual_method); - - if (m->is_inflated && mono_method_get_context (m)->method_inst) { - MonoGenericContext context = { NULL, NULL }; - - if (mono_class_is_ginst (virtual_method->klass)) - context.class_inst = mono_class_get_generic_class (virtual_method->klass)->context.class_inst; - else if (mono_class_is_gtd (virtual_method->klass)) - context.class_inst = mono_class_get_generic_container (virtual_method->klass)->context.class_inst; - context.method_inst = mono_method_get_context (m)->method_inst; - - ERROR_DECL (error); - virtual_method = mono_class_inflate_generic_method_checked (virtual_method, &context, error); - mono_error_cleanup (error); /* FIXME: don't swallow the error */ - } - - if (virtual_method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) { - virtual_method = mono_marshal_get_native_wrapper (virtual_method, FALSE, FALSE); - } - - if (virtual_method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED) { - virtual_method = mono_marshal_get_synchronized_wrapper (virtual_method); - } - - InterpMethod *virtual_imethod = mono_interp_get_imethod (virtual_method); - return virtual_imethod; -} - -typedef struct { - InterpMethod *imethod; - InterpMethod *target_imethod; -} InterpVTableEntry; - -/* memory manager lock must be held */ -static GSList* -append_imethod (MonoMemoryManager *memory_manager, GSList *list, InterpMethod *imethod, InterpMethod *target_imethod) -{ - GSList *ret; - InterpVTableEntry *entry; - - entry = (InterpVTableEntry*) mono_mem_manager_alloc0 (memory_manager, sizeof (InterpVTableEntry)); - entry->imethod = imethod; - entry->target_imethod = target_imethod; - ret = mono_mem_manager_alloc0 (memory_manager, sizeof (GSList)); - ret->data = entry; - ret = g_slist_concat (list, ret); - - mono_interp_register_imethod_patch_site ((gpointer*)&entry->imethod); - mono_interp_register_imethod_patch_site ((gpointer*)&entry->target_imethod); - - return ret; -} - -static InterpMethod* -get_target_imethod (GSList *list, InterpMethod *imethod) -{ - while (list != NULL) { - InterpVTableEntry *entry = (InterpVTableEntry*) list->data; - // We don't account for tiering here so this comparison is racy - // The side effect is that we might end up with duplicates of the same - // method in the vtable list, but this is extremely uncommon. - if (entry->imethod == imethod) - return entry->target_imethod; - list = list->next; - } - return NULL; -} - -static inline MonoVTableEEData* -get_vtable_ee_data (MonoVTable *vtable) -{ - MonoVTableEEData *ee_data = (MonoVTableEEData*)vtable->ee_data; - - if (G_UNLIKELY (!ee_data)) { - ee_data = m_class_alloc0 (vtable->klass, sizeof (MonoVTableEEData)); - mono_memory_barrier (); - vtable->ee_data = ee_data; - } - return ee_data; -} - -static gpointer* -get_method_table (MonoVTable *vtable, int offset) -{ - if (offset >= 0) - return get_vtable_ee_data (vtable)->interp_vtable; - else - return (gpointer*)vtable; -} - -static gpointer* -alloc_method_table (MonoVTable *vtable, int offset) -{ - gpointer *table; - - if (offset >= 0) { - table = (gpointer*)m_class_alloc0 (vtable->klass, m_class_get_vtable_size (vtable->klass) * sizeof (gpointer)); - get_vtable_ee_data (vtable)->interp_vtable = table; - } else { - table = (gpointer*)vtable; - } - - return table; -} - -static InterpMethod* // Inlining causes additional stack use in caller. -get_virtual_method_fast (InterpMethod *imethod, MonoVTable *vtable, int offset) -{ - gpointer *table; - MonoMemoryManager *memory_manager = NULL; - - table = get_method_table (vtable, offset); - - if (G_UNLIKELY (!table)) { - memory_manager = m_class_get_mem_manager (vtable->klass); - /* Lazily allocate method table */ - mono_mem_manager_lock (memory_manager); - table = get_method_table (vtable, offset); - if (!table) - table = alloc_method_table (vtable, offset); - mono_mem_manager_unlock (memory_manager); - } - - if (G_UNLIKELY (!table [offset])) { - InterpMethod *target_imethod = get_virtual_method (imethod, vtable); - if (!memory_manager) - memory_manager = m_class_get_mem_manager (vtable->klass); - /* Lazily initialize the method table slot */ - mono_mem_manager_lock (memory_manager); - if (!table [offset]) { - if (imethod->method->is_inflated || offset < 0) { - table [offset] = append_imethod (memory_manager, NULL, imethod, target_imethod); - } else { - table [offset] = (gpointer) ((gsize)target_imethod | 0x1); - mono_interp_register_imethod_patch_site (&table [offset]); - } - } - mono_mem_manager_unlock (memory_manager); - } - - if ((gsize)table [offset] & 0x1) { - /* Non generic virtual call. Only one method in slot */ - return (InterpMethod*) ((gsize)table [offset] & ~0x1); - } else { - /* Virtual generic or interface call. Multiple methods in slot */ - InterpMethod *target_imethod = get_target_imethod ((GSList*)table [offset], imethod); - - if (G_UNLIKELY (!target_imethod)) { - target_imethod = get_virtual_method (imethod, vtable); - if (!memory_manager) - memory_manager = m_class_get_mem_manager (vtable->klass); - mono_mem_manager_lock (memory_manager); - if (!get_target_imethod ((GSList*)table [offset], imethod)) - table [offset] = append_imethod (memory_manager, (GSList*)table [offset], imethod, target_imethod); - mono_mem_manager_unlock (memory_manager); - } - return target_imethod; - } -} - - - -static int -stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) -{ - if (m_type_is_byref (type)) { - gpointer *p = (gpointer*)data; - *p = val->data.p; - return MINT_STACK_SLOT_SIZE; - } - /* printf ("TODAT0 %p\n", data); */ - switch (type->type) { - case MONO_TYPE_BOOLEAN: - case MONO_TYPE_I1: - case MONO_TYPE_U1: { - guint8 *p = (guint8*)data; - *p = GINT32_TO_UINT8 (val->data.i); - return MINT_STACK_SLOT_SIZE; - } - case MONO_TYPE_I2: - case MONO_TYPE_U2: - case MONO_TYPE_CHAR: { - guint16 *p = (guint16*)data; - *p = GINT32_TO_UINT16 (val->data.i); - return MINT_STACK_SLOT_SIZE; - } - case MONO_TYPE_I: { - mono_i *p = (mono_i*)data; - /* In theory the value used by stloc should match the local var type - but in practice it sometimes doesn't (a int32 gets dup'd and stloc'd into - a native int - both by csc and mcs). Not sure what to do about sign extension - as it is outside the spec... doing the obvious */ - *p = (mono_i)val->data.p; - return MINT_STACK_SLOT_SIZE; - } - case MONO_TYPE_U: { - mono_u *p = (mono_u*)data; - /* see above. */ - *p = (mono_u)val->data.p; - return MINT_STACK_SLOT_SIZE; - } - case MONO_TYPE_I4: - case MONO_TYPE_U4: { - gint32 *p = (gint32*)data; - *p = val->data.i; - return MINT_STACK_SLOT_SIZE; - } - case MONO_TYPE_I8: - case MONO_TYPE_U8: { - memmove (data, &val->data.l, sizeof (gint64)); - return MINT_STACK_SLOT_SIZE; - } - case MONO_TYPE_R4: { - /* memmove handles unaligned case */ - memmove (data, &val->data.f_r4, sizeof (float)); - return MINT_STACK_SLOT_SIZE; - } - case MONO_TYPE_R8: { - memmove (data, &val->data.f, sizeof (double)); - return MINT_STACK_SLOT_SIZE; - } - case MONO_TYPE_STRING: - case MONO_TYPE_SZARRAY: - case MONO_TYPE_CLASS: - case MONO_TYPE_OBJECT: - case MONO_TYPE_ARRAY: { - gpointer *p = (gpointer *) data; - mono_gc_wbarrier_generic_store_internal (p, val->data.o); - return MINT_STACK_SLOT_SIZE; - } - case MONO_TYPE_PTR: - case MONO_TYPE_FNPTR: { - gpointer *p = (gpointer *) data; - *p = val->data.p; - return MINT_STACK_SLOT_SIZE; - } - case MONO_TYPE_VALUETYPE: - if (m_class_is_enumtype (m_type_data_get_klass_unchecked (type))) { - return stackval_to_data (mono_class_enum_basetype_internal (m_type_data_get_klass_unchecked (type)), val, data, pinvoke); - } else { - int size; - if (pinvoke) { - size = mono_class_native_size (m_type_data_get_klass_unchecked (type), NULL); - memcpy (data, val, size); - } else { - size = mono_class_value_size (m_type_data_get_klass_unchecked (type), NULL); - mono_value_copy_internal (data, val, m_type_data_get_klass_unchecked (type)); - } - return ALIGN_TO (size, MINT_STACK_SLOT_SIZE); - } - case MONO_TYPE_GENERICINST: { - MonoClass *container_class = m_type_data_get_generic_class_unchecked (type)->container_class; - - if (m_class_is_valuetype (container_class) && !m_class_is_enumtype (container_class)) { - MonoClass *klass = mono_class_from_mono_type_internal (type); - int size; - if (pinvoke) { - size = mono_class_native_size (klass, NULL); - memcpy (data, val, size); - } else { - size = mono_class_value_size (klass, NULL); - mono_value_copy_internal (data, val, klass); - } - return ALIGN_TO (size, MINT_STACK_SLOT_SIZE); - } - return stackval_to_data (m_class_get_byval_arg (m_type_data_get_generic_class_unchecked (type)->container_class), val, data, pinvoke); - } - default: - g_error ("got type %x", type->type); - } -} - -typedef struct { - MonoException *ex; - MonoContext *ctx; -} HandleExceptionCbData; - -static void -handle_exception_cb (gpointer arg) -{ - HandleExceptionCbData *cb_data = (HandleExceptionCbData*)arg; - - mono_handle_exception (cb_data->ctx, (MonoObject*)cb_data->ex); -} - -/* - * interp_throw: - * Throw an exception from the interpreter. - */ -static MONO_NEVER_INLINE void -interp_throw (ThreadContext *context, MonoException *ex, InterpFrame *frame, const guint16* ip, gboolean rethrow) -{ - ERROR_DECL (error); - MonoLMFExt ext; - - /* - * When explicitly throwing exception we pass the ip of the instruction that throws the exception. - * Offset the subtraction from interp_frame_get_ip, so we don't end up in prev instruction. - */ - frame->state.ip = ip + 1; - - // This LMF is pop'ed by the EH machinery before resuming - interp_push_lmf (&ext, frame); - - if (mono_object_isinst_checked ((MonoObject *) ex, mono_defaults.exception_class, error)) { - MonoException *mono_ex = ex; - if (!rethrow) { - mono_ex->stack_trace = NULL; - mono_ex->trace_ips = NULL; - } - } - mono_error_assert_ok (error); - - MonoContext ctx; - memset (&ctx, 0, sizeof (MonoContext)); - MONO_CONTEXT_SET_SP (&ctx, frame); - - /* - * Call the JIT EH code. The EH code will call back to us using: - * - mono_interp_set_resume_state ()/run_finally ()/run_filter (). - * Since ctx.ip is 0, this will start unwinding from the LMF frame - * pushed above, which points to our frames. - */ - - mono_handle_exception (&ctx, (MonoObject*)ex); - - if (MONO_CONTEXT_GET_IP (&ctx) != 0) { - /* We need to unwind into non-interpreter code */ - mono_restore_context (&ctx); - g_assert_not_reached (); - } - - g_assert (context->has_resume_state); -} - -static MONO_NEVER_INLINE MonoException * -interp_error_convert_to_exception (InterpFrame *frame, MonoError *error, const guint16 *ip) -{ - MonoLMFExt ext; - MonoException *ex; - - /* - * When calling runtime functions we pass the ip of the instruction triggering the runtime call. - * Offset the subtraction from interp_frame_get_ip, so we don't end up in prev instruction. - */ - frame->state.ip = ip + 1; - - interp_push_lmf (&ext, frame); - ex = mono_error_convert_to_exception (error); - interp_pop_lmf (&ext); - return ex; -} - -#define INTERP_BUILD_EXCEPTION_TYPE_FUNC_NAME(prefix_name, type_name) \ -prefix_name ## _ ## type_name - -#define INTERP_GET_EXCEPTION(exception_type) \ -static MONO_NEVER_INLINE MonoException * \ -INTERP_BUILD_EXCEPTION_TYPE_FUNC_NAME(interp_get_exception, exception_type) (InterpFrame *frame, const guint16 *ip)\ -{ \ - MonoLMFExt ext; \ - MonoException *ex; \ - frame->state.ip = ip + 1; \ - interp_push_lmf (&ext, frame); \ - ex = INTERP_BUILD_EXCEPTION_TYPE_FUNC_NAME(mono_get_exception,exception_type) (); \ - interp_pop_lmf (&ext); \ - return ex; \ -} - -#define INTERP_GET_EXCEPTION_CHAR_ARG(exception_type) \ -static MONO_NEVER_INLINE MonoException * \ -INTERP_BUILD_EXCEPTION_TYPE_FUNC_NAME(interp_get_exception, exception_type) (const char *arg, InterpFrame *frame, const guint16 *ip)\ -{ \ - MonoLMFExt ext; \ - MonoException *ex; \ - frame->state.ip = ip + 1; \ - interp_push_lmf (&ext, frame); \ - ex = INTERP_BUILD_EXCEPTION_TYPE_FUNC_NAME(mono_get_exception,exception_type) (arg); \ - interp_pop_lmf (&ext); \ - return ex; \ -} - -INTERP_GET_EXCEPTION(null_reference) -INTERP_GET_EXCEPTION(divide_by_zero) -INTERP_GET_EXCEPTION(overflow) -INTERP_GET_EXCEPTION(invalid_cast) -INTERP_GET_EXCEPTION(index_out_of_range) -INTERP_GET_EXCEPTION(array_type_mismatch) -INTERP_GET_EXCEPTION(arithmetic) -INTERP_GET_EXCEPTION_CHAR_ARG(argument_out_of_range) - -// Inlining throw logic into interp_exec_method makes it bigger and could push us up against -// internal limits in things like WASM compilers -static MONO_NEVER_INLINE void -interp_throw_ex_general ( - MonoException *__ex, ThreadContext *context, InterpFrame *frame, const guint16 *ex_ip, gboolean rethrow -) -{ - HANDLE_FUNCTION_ENTER (); - MonoExceptionHandle tmp_handle = MONO_HANDLE_NEW (MonoException, __ex); - interp_throw (context, MONO_HANDLE_RAW(tmp_handle), (frame), (ex_ip), (rethrow)); - HANDLE_FUNCTION_RETURN (); -} - -// We conservatively pin exception object here to avoid tweaking the -// numerous call sites of this macro, even though, in a few cases, -// this is not needed. -#define THROW_EX_GENERAL(exception,ex_ip, rethrow) \ - do { \ - interp_throw_ex_general (exception, context, frame, ex_ip, rethrow); \ - goto resume; \ - } while (0) - -#define THROW_EX(exception,ex_ip) THROW_EX_GENERAL ((exception), (ex_ip), FALSE) - -#define NULL_CHECK(o) do { \ - if (G_UNLIKELY (!(o))) \ - THROW_EX (interp_get_exception_null_reference (frame, ip), ip); \ - } while (0) - -#define EXCEPTION_CHECKPOINT \ - do { \ - if (mono_thread_interruption_request_flag && !mono_threads_is_critical_method (frame->imethod->method)) { \ - MonoException *exc = mono_thread_interruption_checkpoint (); \ - if (exc) \ - THROW_EX_GENERAL (exc, ip, TRUE); \ - } \ - } while (0) - -// Reduce duplicate code in mono_interp_exec_method -static MONO_NEVER_INLINE void -do_safepoint (InterpFrame *frame, ThreadContext *context, const guint16 *ip) -{ - MonoLMFExt ext; - - /* - * When calling runtime functions we pass the ip of the instruction triggering the runtime call. - * Offset the subtraction from interp_frame_get_ip, so we don't end up in prev instruction. - */ - frame->state.ip = ip + 1; - - interp_push_lmf (&ext, frame); - /* Poll safepoint */ - mono_threads_safepoint (); - interp_pop_lmf (&ext); -} - -#define SAFEPOINT \ - do { \ - if (G_UNLIKELY (mono_polling_required)) \ - do_safepoint (frame, context, ip); \ - } while (0) - -static MonoObject* -ves_array_create (MonoClass *klass, int param_count, stackval *values, MonoError *error) -{ - int rank = m_class_get_rank (klass); - uintptr_t *lengths = g_newa (uintptr_t, rank * 2); - intptr_t *lower_bounds = NULL; - - if (param_count > rank && m_class_get_byval_arg (klass)->type == MONO_TYPE_SZARRAY) { - // Special constructor for jagged arrays - for (int i = 0; i < param_count; ++i) - lengths [i] = values [i].data.i; - return (MonoObject*) mono_array_new_jagged_checked (klass, param_count, lengths, error); - } else if (2 * rank == param_count) { - for (int l = 0; l < 2; ++l) { - int src = l; - int dst = l * rank; - for (int r = 0; r < rank; ++r, src += 2, ++dst) { - lengths [dst] = values [src].data.i; - } - } - /* lower bounds are first. */ - lower_bounds = (intptr_t *) lengths; - lengths += rank; - } else { - /* Only lengths provided. */ - for (int i = 0; i < param_count; ++i) { - lengths [i] = values [i].data.i; - } - } - return (MonoObject*) mono_array_new_full_checked (klass, lengths, lower_bounds, error); -} - -static gint32 -ves_array_calculate_index (MonoArray *ao, stackval *sp, gboolean safe) -{ - MonoClass *ac = ((MonoObject *) ao)->vtable->klass; - - guint32 pos = 0; - if (ao->bounds) { - for (gint32 i = 0; i < m_class_get_rank (ac); i++) { - gint32 idx = sp [i].data.i; - gint32 lower = ao->bounds [i].lower_bound; - guint32 len = ao->bounds [i].length; - if (safe && (idx < lower || (guint32)(idx - lower) >= len)) - return -1; - pos = (pos * len) + (guint32)(idx - lower); - } - } else { - pos = sp [0].data.i; - if (safe && pos >= ao->max_length) - return -1; - } - return pos; -} - -static MonoException* -ves_array_element_address (InterpFrame *frame, MonoClass *required_type, MonoArray *ao, gpointer *ret, stackval *sp, gboolean needs_typecheck) -{ - MonoClass *ac = ((MonoObject *) ao)->vtable->klass; - - g_assert (m_class_get_rank (ac) >= 1); - - gint32 pos = ves_array_calculate_index (ao, sp, TRUE); - if (pos == -1) - return mono_get_exception_index_out_of_range (); - - if (needs_typecheck && !mono_class_is_assignable_from_internal (m_class_get_element_class (mono_object_class ((MonoObject *) ao)), required_type)) - return mono_get_exception_array_type_mismatch (); - gint32 esize = mono_array_element_size (ac); - *ret = mono_array_addr_with_size_fast (ao, esize, pos); - return NULL; -} - -/* Does not handle `this` argument */ -static guint32 -compute_arg_offset (MonoMethodSignature *sig, int index) -{ - if (index == 0) - return 0; - - guint32 offset = 0; - int size, align; - MonoType *type; - for (int i = 0; i < index; i++) { - type = sig->params [i]; - size = mono_interp_type_size (type, mono_mint_type (type), &align); - - offset = ALIGN_TO (offset, align); - offset += size; - } - type = sig->params [index]; - mono_interp_type_size (type, mono_mint_type (type), &align); - - offset = ALIGN_TO (offset, align); - return offset; -} - -static gpointer -imethod_alloc0 (InterpMethod *imethod, guint size) -{ - if (imethod->method->dynamic) - return mono_dyn_method_alloc0 (imethod->method, size); - else - return m_method_alloc0 (imethod->method, size); -} - -void log_mono_type(MonoType* type) { - if (!type) { - return; - } - - const char* type_str = NULL; - - switch (type->type) { - case MONO_TYPE_VOID: type_str = "VOID"; break; - case MONO_TYPE_BOOLEAN: type_str = "BOOLEAN"; break; - case MONO_TYPE_CHAR: type_str = "CHAR"; break; - case MONO_TYPE_I1: type_str = "I1"; break; - case MONO_TYPE_U1: type_str = "U1"; break; - case MONO_TYPE_I2: type_str = "I2"; break; - case MONO_TYPE_U2: type_str = "U2"; break; - case MONO_TYPE_I4: type_str = "I4"; break; - case MONO_TYPE_U4: type_str = "U4"; break; - case MONO_TYPE_I8: type_str = "I8"; break; - case MONO_TYPE_U8: type_str = "U8"; break; - case MONO_TYPE_R4: type_str = "R4"; break; - case MONO_TYPE_R8: type_str = "R8"; break; - case MONO_TYPE_STRING: type_str = "STRING"; break; - case MONO_TYPE_PTR: type_str = "PTR"; break; - case MONO_TYPE_BYREF: type_str = "BYREF"; break; - case MONO_TYPE_VALUETYPE: type_str = "VALUETYPE"; break; - case MONO_TYPE_CLASS: type_str = "CLASS"; break; - case MONO_TYPE_ARRAY: type_str = "ARRAY"; break; - case MONO_TYPE_SZARRAY: type_str = "SZARRAY"; break; - case MONO_TYPE_OBJECT: type_str = "OBJECT"; break; - case MONO_TYPE_VAR: type_str = "VAR"; break; - case MONO_TYPE_MVAR: type_str = "MVAR"; break; - case MONO_TYPE_GENERICINST: type_str = "GENERICINST"; break; - case MONO_TYPE_FNPTR: type_str = "FNPTR"; break; - default: type_str = "UNKNOWN"; break; - } -} - -void log_mono_type_enum(MonoTypeEnum type_enum) { - const char* type_str = NULL; - - switch (type_enum) { - case MONO_TYPE_END: type_str = "END"; break; - case MONO_TYPE_VOID: type_str = "VOID"; break; - case MONO_TYPE_BOOLEAN: type_str = "BOOLEAN"; break; - case MONO_TYPE_CHAR: type_str = "CHAR"; break; - case MONO_TYPE_I1: type_str = "I1"; break; - case MONO_TYPE_U1: type_str = "U1"; break; - case MONO_TYPE_I2: type_str = "I2"; break; - case MONO_TYPE_U2: type_str = "U2"; break; - case MONO_TYPE_I4: type_str = "I4"; break; - case MONO_TYPE_U4: type_str = "U4"; break; - case MONO_TYPE_I8: type_str = "I8"; break; - case MONO_TYPE_U8: type_str = "U8"; break; - case MONO_TYPE_R4: type_str = "R4"; break; - case MONO_TYPE_R8: type_str = "R8"; break; - case MONO_TYPE_STRING: type_str = "STRING"; break; - case MONO_TYPE_PTR: type_str = "PTR"; break; - case MONO_TYPE_BYREF: type_str = "BYREF"; break; - case MONO_TYPE_VALUETYPE: type_str = "VALUETYPE"; break; - case MONO_TYPE_CLASS: type_str = "CLASS"; break; - case MONO_TYPE_VAR: type_str = "VAR"; break; - case MONO_TYPE_ARRAY: type_str = "ARRAY"; break; - case MONO_TYPE_GENERICINST: type_str = "GENERICINST"; break; - case MONO_TYPE_TYPEDBYREF: type_str = "TYPEDBYREF"; break; - case MONO_TYPE_I: type_str = "I"; break; - case MONO_TYPE_U: type_str = "U"; break; - case MONO_TYPE_FNPTR: type_str = "FNPTR"; break; - case MONO_TYPE_OBJECT: type_str = "OBJECT"; break; - case MONO_TYPE_SZARRAY: type_str = "SZARRAY"; break; - case MONO_TYPE_MVAR: type_str = "MVAR"; break; - case MONO_TYPE_CMOD_REQD: type_str = "CMOD_REQD"; break; - case MONO_TYPE_CMOD_OPT: type_str = "CMOD_OPT"; break; - case MONO_TYPE_INTERNAL: type_str = "INTERNAL"; break; - case MONO_TYPE_MODIFIER: type_str = "MODIFIER"; break; - case MONO_TYPE_SENTINEL: type_str = "SENTINEL"; break; - case MONO_TYPE_PINNED: type_str = "PINNED"; break; - case MONO_TYPE_ENUM: type_str = "MONO_TYPE_ENUM"; break; - default: type_str = "UNKNOWN"; break; - } -} - -static void log_mint_type(int value) -{ - const char* type_str = NULL; - switch (value) - { -case MINT_TYPE_I1: type_str = "MINT_TYPE_I1";break; -case MINT_TYPE_U1: type_str = "MINT_TYPE_U1";break; -case MINT_TYPE_I2: type_str = "MINT_TYPE_I2";break; -case MINT_TYPE_U2: type_str = "MINT_TYPE_U2";break; -case MINT_TYPE_I4: type_str = "MINT_TYPE_I4";break; -case MINT_TYPE_I8: type_str = "MINT_TYPE_I8";break; -case MINT_TYPE_R4: type_str = "MINT_TYPE_R4";break; -case MINT_TYPE_R8: type_str = "MINT_TYPE_R8";break; -case MINT_TYPE_O : type_str = "MINT_TYPE_O";break; -case MINT_TYPE_VT: type_str = "MINT_TYPE_VT";break; -case MINT_TYPE_VOID: type_str = "MINT_TYPE_VOID"; break; - default: - type_str = "UNKNOWN"; - } -} -static guint32* -initialize_arg_offsets (InterpMethod *imethod, MonoMethodSignature *csig) -{ - if (imethod->arg_offsets) - return imethod->arg_offsets; - - // For pinvokes, csig represents the real signature with marshalled args. If an explicit - // marshalled signature was not provided, we use the managed signature of the method. - MonoMethodSignature *sig = csig; - if (!sig) - sig = mono_method_signature_internal (imethod->method); - int arg_count = sig->hasthis + sig->param_count; - guint32 *arg_offsets = (guint32*)imethod_alloc0 (imethod, (arg_count + 1) * sizeof (int)); - int index = 0, offset = 0; - if (sig->hasthis) { - arg_offsets [index++] = 0; - offset = MINT_STACK_SLOT_SIZE; - } - for (int i = 0; i < sig->param_count; i++) { - MonoType *type = sig->params [i]; - int size, align; - log_mono_type(type); - log_mint_type(mono_mint_type (type)); - size = mono_interp_type_size (type, mono_mint_type (type), &align); - offset = ALIGN_TO (offset, align); - arg_offsets [index++] = offset; - offset += size; - } - // This index is not associated with an actual argument, we just store the offset - // for convenience in order to easily determine the size of the param area used - arg_offsets [index] = ALIGN_TO (offset, MINT_STACK_SLOT_SIZE); - - mono_memory_write_barrier (); - /* If this fails, the new one is leaked in the mem manager */ - mono_atomic_cas_ptr ((gpointer*)&imethod->arg_offsets, arg_offsets, NULL); - return imethod->arg_offsets; -} - -static guint32 -get_arg_offset_fast (InterpMethod *imethod, MonoMethodSignature *sig, int index) -{ - guint32 *arg_offsets = imethod->arg_offsets; - if (arg_offsets) - return arg_offsets [index]; - - arg_offsets = initialize_arg_offsets (imethod, sig); - g_assert (arg_offsets); - return arg_offsets [index]; -} - -static guint32 -get_arg_offset (InterpMethod *imethod, MonoMethodSignature *sig, int index) -{ - if (imethod) { - return get_arg_offset_fast (imethod, sig, index); - } else { - g_assert (!sig->hasthis); - return compute_arg_offset (sig, index); - } -} - -#ifdef MONO_ARCH_HAVE_INTERP_ENTRY_TRAMPOLINE -static MonoFuncV mono_native_to_interp_trampoline = NULL; -#endif - -#ifndef MONO_ARCH_HAVE_INTERP_PINVOKE_TRAMP - -typedef enum { - PINVOKE_ARG_NONE = 0, - PINVOKE_ARG_INT = 1, - PINVOKE_ARG_INT_PAIR = 2, - PINVOKE_ARG_R8 = 3, - PINVOKE_ARG_R4 = 4, - PINVOKE_ARG_VTYPE = 5, - PINVOKE_ARG_SCALAR_VTYPE = 6, - // This isn't ifdefed so it's easier to write code that handles it without sprinkling - // 800 ifdefs in this file - PINVOKE_ARG_WASM_VALUETYPE_RESULT = 7, -} PInvokeArgType; - -typedef struct { - int ilen, flen; - MonoType *ret_mono_type; - PInvokeArgType ret_pinvoke_type; - PInvokeArgType *arg_types; -} BuildArgsFromSigInfo; - -static MonoType * -filter_type_for_args_from_sig (MonoType *type) { -#if defined(HOST_WASM) - MonoType *etype; - if (MONO_TYPE_ISSTRUCT (type) && mini_wasm_is_scalar_vtype (type, &etype)) - // FIXME: Does this need to be recursive? - return etype; -#endif - return type; -} - -static BuildArgsFromSigInfo * -get_build_args_from_sig_info (MonoMemoryManager *mem_manager, MonoMethodSignature *sig) -{ - BuildArgsFromSigInfo *info = mono_mem_manager_alloc0 (mem_manager, sizeof (BuildArgsFromSigInfo)); - int ilen = 0, flen = 0; - - info->arg_types = mono_mem_manager_alloc0 (mem_manager, sizeof (PInvokeArgType) * sig->param_count); - - g_assert (!sig->hasthis); - - for (int i = 0; i < sig->param_count; i++) { - MonoType *type = filter_type_for_args_from_sig (sig->params [i]); - guint32 ptype; - -retry: - ptype = m_type_is_byref (type) ? MONO_TYPE_PTR : type->type; - switch (ptype) { - case MONO_TYPE_BOOLEAN: - case MONO_TYPE_CHAR: - case MONO_TYPE_I1: - case MONO_TYPE_U1: - case MONO_TYPE_I2: - case MONO_TYPE_U2: - case MONO_TYPE_I4: - case MONO_TYPE_U4: - case MONO_TYPE_I: - case MONO_TYPE_U: - case MONO_TYPE_PTR: - case MONO_TYPE_FNPTR: - case MONO_TYPE_SZARRAY: - case MONO_TYPE_CLASS: - case MONO_TYPE_OBJECT: - case MONO_TYPE_STRING: -#if SIZEOF_VOID_P == 8 - case MONO_TYPE_I8: - case MONO_TYPE_U8: -#endif - info->arg_types [i] = PINVOKE_ARG_INT; - ilen++; - break; -#if SIZEOF_VOID_P == 4 - case MONO_TYPE_I8: - case MONO_TYPE_U8: - info->arg_types [i] = PINVOKE_ARG_INT_PAIR; - ilen += 2; - break; -#endif - case MONO_TYPE_R4: - info->arg_types [i] = PINVOKE_ARG_R4; - flen++; - break; - case MONO_TYPE_R8: - info->arg_types [i] = PINVOKE_ARG_R8; - flen++; - break; - case MONO_TYPE_VALUETYPE: - if (m_class_is_enumtype (m_type_data_get_klass_unchecked (type))) { - type = mono_class_enum_basetype_internal (m_type_data_get_klass_unchecked (type)); - goto retry; - } - info->arg_types [i] = PINVOKE_ARG_VTYPE; - -#ifdef HOST_WASM - { - MonoType *etype; - - /* Scalar vtypes are passed by value */ - // FIXME: r4/r8 - if (mini_wasm_is_scalar_vtype (sig->params [i], &etype) && etype->type != MONO_TYPE_R4 && etype->type != MONO_TYPE_R8) - info->arg_types [i] = PINVOKE_ARG_SCALAR_VTYPE; - } -#endif - ilen++; - break; - case MONO_TYPE_GENERICINST: { - // FIXME: Should mini_wasm_is_scalar_vtype stuff go in here? - MonoClass *container_class = m_type_data_get_generic_class_unchecked (type)->container_class; - type = m_class_get_byval_arg (container_class); - goto retry; - } - default: - g_error ("build_args_from_sig: not implemented yet (1): 0x%x\n", ptype); - } - } - - if (ilen > INTERP_ICALL_TRAMP_IARGS) - g_error ("build_args_from_sig: TODO, allocate gregs: %d\n", ilen); - - if (flen > INTERP_ICALL_TRAMP_FARGS) - g_error ("build_args_from_sig: TODO, allocate fregs: %d\n", flen); - - info->ilen = ilen; - info->flen = flen; - - info->ret_mono_type = filter_type_for_args_from_sig (sig->ret); - - switch (info->ret_mono_type->type) { - case MONO_TYPE_BOOLEAN: - case MONO_TYPE_CHAR: - case MONO_TYPE_I1: - case MONO_TYPE_U1: - case MONO_TYPE_I2: - case MONO_TYPE_U2: - case MONO_TYPE_I4: - case MONO_TYPE_U4: - case MONO_TYPE_I: - case MONO_TYPE_U: - case MONO_TYPE_PTR: - case MONO_TYPE_FNPTR: - case MONO_TYPE_SZARRAY: - case MONO_TYPE_CLASS: - case MONO_TYPE_OBJECT: - case MONO_TYPE_STRING: - info->ret_pinvoke_type = PINVOKE_ARG_INT; - break; -#if SIZEOF_VOID_P == 8 - case MONO_TYPE_I8: - case MONO_TYPE_U8: -#endif - info->ret_pinvoke_type = PINVOKE_ARG_INT; - break; -#if SIZEOF_VOID_P == 4 - case MONO_TYPE_I8: - case MONO_TYPE_U8: - info->ret_pinvoke_type = PINVOKE_ARG_INT; - break; -#endif - case MONO_TYPE_VALUETYPE: - case MONO_TYPE_GENERICINST: - info->ret_pinvoke_type = PINVOKE_ARG_INT; -#ifdef HOST_WASM - // This ISSTRUCT check is important, because the type could be an enum - if (MONO_TYPE_ISSTRUCT (info->ret_mono_type)) { - // The return type was already filtered previously, so if we get here - // we're returning a struct byref instead of as a scalar - info->ret_pinvoke_type = PINVOKE_ARG_WASM_VALUETYPE_RESULT; - info->ilen++; - } -#endif - break; - case MONO_TYPE_R4: - case MONO_TYPE_R8: - info->ret_pinvoke_type = PINVOKE_ARG_R8; - break; - case MONO_TYPE_VOID: - info->ret_pinvoke_type = PINVOKE_ARG_NONE; - break; - default: - g_error ("build_args_from_sig: ret type not implemented yet: 0x%x\n", info->ret_mono_type->type); - } - - return info; -} -#define DEBUG_MH 1 -static void -build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, BuildArgsFromSigInfo *info, InterpFrame *frame) -{ -#ifdef TARGET_WASM - margs->sig = sig; -#endif - - margs->ilen = info->ilen; - margs->flen = info->flen; - - size_t int_i = 0; - size_t int_f = 0; - - if (info->ret_pinvoke_type == PINVOKE_ARG_WASM_VALUETYPE_RESULT) { - // Allocate an empty arg0 for the address of the return value - // info->ilen was already increased earlier - int_i++; - } - - if (margs->ilen > 0) { - if (margs->ilen <= 8) - margs->iargs = margs->iargs_buf; - else - margs->iargs = g_malloc0 (sizeof (gpointer) * margs->ilen); - } - - if (margs->flen > 0) { - if (margs->flen <= 8) - margs->fargs = margs->fargs_buf; - else - margs->fargs = g_malloc0 (sizeof (double) * margs->flen); - } - for (int i = 0; i < sig->param_count; i++) { - guint32 offset = get_arg_offset (frame->imethod, sig, i); - stackval *sp_arg = STACK_ADD_BYTES (frame->stack, offset); - - switch (info->arg_types [i]) { - case PINVOKE_ARG_INT: - margs->iargs [int_i] = sp_arg->data.p; -#if DEBUG_INTERP - g_print ("build_args_from_sig: margs->iargs [%d]: %p (frame @ %d)\n", int_i, margs->iargs [int_i], i); -#endif - int_i++; - break; - case PINVOKE_ARG_R4: - * (float *) &(margs->fargs [int_f]) = sp_arg->data.f_r4; -#if DEBUG_INTERP - g_print ("build_args_from_sig: margs->fargs [%d]: %p (%f) (frame @ %d)\n", int_f, margs->fargs [int_f], margs->fargs [int_f], i); -#endif - int_f ++; - break; - case PINVOKE_ARG_R8: - margs->fargs [int_f] = sp_arg->data.f; -#if DEBUG_INTERP - g_print ("build_args_from_sig: margs->fargs [%d]: %p (%f) (frame @ %d)\n", int_f, margs->fargs [int_f], margs->fargs [int_f], i); -#endif - int_f ++; - break; - case PINVOKE_ARG_VTYPE: - margs->iargs [int_i] = sp_arg; -#if DEBUG_INTERP - g_print ("build_args_from_sig: margs->iargs [%d]: %p (vt) (frame @ %d)\n", int_i, margs->iargs [int_i], i); -#endif - int_i++; - break; - case PINVOKE_ARG_SCALAR_VTYPE: - margs->iargs [int_i] = *(gpointer*)sp_arg; - -#if DEBUG_INTERP - g_print ("build_args_from_sig: margs->iargs [%d]: %p (vt) (frame @ %d)\n", int_i, margs->iargs [int_i], i); -#endif - int_i++; - break; - case PINVOKE_ARG_INT_PAIR: { - margs->iargs [int_i] = (gpointer)(gssize)sp_arg->data.pair.lo; - int_i++; - margs->iargs [int_i] = (gpointer)(gssize)sp_arg->data.pair.hi; -#if DEBUG_INTERP - g_print ("build_args_from_sig: margs->iargs [%d/%d]: 0x%016" PRIx64 ", hi=0x%08x lo=0x%08x (frame @ %d)\n", int_i - 1, int_i, *((guint64 *) &margs->iargs [int_i - 1]), sp_arg->data.pair.hi, sp_arg->data.pair.lo, i); -#endif - int_i++; - break; - } - default: - g_assert_not_reached (); - break; - } - } - switch (info->ret_pinvoke_type) { - case PINVOKE_ARG_WASM_VALUETYPE_RESULT: - // We pass the return value address in arg0 so fill it in, we already - // reserved space for it earlier. - g_assert (frame->retval); - margs->iargs[0] = (gpointer*)frame->retval; - // The return type is void so retval should be NULL - margs->retval = NULL; - margs->is_float_ret = 0; - break; - case PINVOKE_ARG_INT: - margs->retval = (gpointer*)frame->retval; - margs->is_float_ret = 0; - break; - case PINVOKE_ARG_R8: - margs->retval = (gpointer*)frame->retval; - margs->is_float_ret = 1; - break; - case PINVOKE_ARG_NONE: - margs->retval = NULL; - break; - default: - g_assert_not_reached (); - break; - } -} -#endif - - - -static void -interp_frame_arg_to_data (MonoInterpFrameHandle frame, MonoMethodSignature *sig, int index, gpointer data) -{ - InterpFrame *iframe = (InterpFrame*)frame; - InterpMethod *imethod = iframe->imethod; - - // If index == -1, we finished executing an InterpFrame and the result is at retval. - if (index == -1) - stackval_to_data (sig->ret, iframe->retval, data, sig->pinvoke && !sig->marshalling_disabled); - else if (sig->hasthis && index == 0) - *(gpointer*)data = iframe->stack->data.p; - else - stackval_to_data (sig->params [index - sig->hasthis], STACK_ADD_BYTES (iframe->stack, get_arg_offset (imethod, sig, index)), data, sig->pinvoke && !sig->marshalling_disabled); -} - -static void -interp_data_to_frame_arg (MonoInterpFrameHandle frame, MonoMethodSignature *sig, int index, gconstpointer data) -{ - InterpFrame *iframe = (InterpFrame*)frame; - InterpMethod *imethod = iframe->imethod; - - // Get result from pinvoke call, put it directly on top of execution stack in the caller frame - if (index == -1) - stackval_from_data (sig->ret, iframe->retval, data, sig->pinvoke && !sig->marshalling_disabled); - else if (sig->hasthis && index == 0) - iframe->stack->data.p = *(gpointer*)data; - else - stackval_from_data (sig->params [index - sig->hasthis], STACK_ADD_BYTES (iframe->stack, get_arg_offset (imethod, sig, index)), data, sig->pinvoke && !sig->marshalling_disabled); -} - -static gpointer -interp_frame_arg_to_storage (MonoInterpFrameHandle frame, MonoMethodSignature *sig, int index) -{ - InterpFrame *iframe = (InterpFrame*)frame; - InterpMethod *imethod = iframe->imethod; - - if (index == -1) - return iframe->retval; - else - return STACK_ADD_BYTES (iframe->stack, get_arg_offset (imethod, sig, index)); -} - -static MonoPIFunc -get_interp_to_native_trampoline (void) -{ - static MonoPIFunc trampoline = NULL; - - if (!trampoline) { - if (mono_ee_features.use_aot_trampolines) { - trampoline = (MonoPIFunc) mono_aot_get_trampoline ("interp_to_native_trampoline"); - } else { - MonoTrampInfo *info; - trampoline = (MonoPIFunc) mono_arch_get_interp_to_native_trampoline (&info); - mono_tramp_info_register (info, NULL); - } - mono_memory_barrier (); - } - return trampoline; -} - -static void -interp_to_native_trampoline (gpointer addr, gpointer ccontext) -{ - get_interp_to_native_trampoline () (addr, ccontext); -} - -#ifdef HOST_WASM -typedef struct { - MonoPIFunc entry_func; - BuildArgsFromSigInfo *call_info; -} WasmPInvokeCacheData; -#endif - -/* MONO_NO_OPTIMIZATION is needed due to usage of INTERP_PUSH_LMF_WITH_CTX. */ -#ifdef _MSC_VER -#pragma optimize ("", off) -#endif -MONO_NO_OPTIMIZATION MONO_NEVER_INLINE gpointer -ves_pinvoke_method ( - InterpMethod *imethod, - MonoMethodSignature *sig, - MonoFuncV addr, - ThreadContext *context, - InterpFrame *parent_frame, - stackval *ret_sp, - stackval *sp, - gboolean save_last_error, - gpointer *cache, - gboolean *gc_transitions) -{ - InterpFrame frame = {0}; - frame.parent = parent_frame; - frame.imethod = imethod; - frame.stack = sp; - frame.retval = ret_sp; - - MonoLMFExt ext; - gpointer args; - - MONO_REQ_GC_UNSAFE_MODE; - -#ifdef HOST_WASM - /* - * Use a per-signature entry function. - * Cache it in imethod->data_items. - * This is GC safe. - */ - MonoPIFunc entry_func = NULL; - WasmPInvokeCacheData *cache_data = (WasmPInvokeCacheData*)*cache; - if (!cache_data) { - cache_data = g_new0 (WasmPInvokeCacheData, 1); - cache_data->entry_func = (MonoPIFunc)mono_wasm_get_interp_to_native_trampoline (sig); - cache_data->call_info = get_build_args_from_sig_info (get_default_mem_manager (), sig); - mono_memory_barrier (); - *cache = cache_data; - } - entry_func = cache_data->entry_func; -#else - static MonoPIFunc entry_func = NULL; - if (!entry_func) { - MONO_ENTER_GC_UNSAFE; -#ifdef MONO_ARCH_HAS_NO_PROPER_MONOCTX - ERROR_DECL (error); - entry_func = (MonoPIFunc) mono_jit_compile_method_jit_only (mini_get_interp_lmf_wrapper ("mono_interp_to_native_trampoline", (gpointer) mono_interp_to_native_trampoline), error); - mono_error_assert_ok (error); -#else - entry_func = get_interp_to_native_trampoline (); -#endif - mono_memory_barrier (); - MONO_EXIT_GC_UNSAFE; - } -#endif - - if (save_last_error) { - mono_marshal_clear_last_error (); - } - -#ifdef MONO_ARCH_HAVE_INTERP_PINVOKE_TRAMP - gpointer call_info = *cache; - - if (!call_info) { - call_info = mono_arch_get_interp_native_call_info (get_default_mem_manager (), sig); - mono_memory_barrier (); - *cache = call_info; - } - CallContext ccontext; - mono_arch_set_native_call_context_args (&ccontext, &frame, sig, call_info); - args = &ccontext; -#else - -#ifdef HOST_WASM - BuildArgsFromSigInfo *call_info = cache_data->call_info; -#else - BuildArgsFromSigInfo *call_info = NULL; - g_assert_not_reached (); -#endif - - InterpMethodArguments margs; - memset (&margs, 0, sizeof (InterpMethodArguments)); - build_args_from_sig (&margs, sig, call_info, &frame); - args = &margs; -#endif - - INTERP_PUSH_LMF_WITH_CTX (&frame, ext, exit_pinvoke); - - if (*gc_transitions) { - MONO_ENTER_GC_SAFE; - entry_func ((gpointer) addr, args); - MONO_EXIT_GC_SAFE; - *gc_transitions = FALSE; - } else { - entry_func ((gpointer) addr, args); - } - - if (save_last_error) - mono_marshal_set_last_error (); - interp_pop_lmf (&ext); - -#ifdef MONO_ARCH_HAVE_INTERP_PINVOKE_TRAMP -#ifdef MONO_ARCH_HAVE_SWIFTCALL - if (mono_method_signature_has_ext_callconv (sig, MONO_EXT_CALLCONV_SWIFTCALL)) { - int arg_index = -1; - gpointer data = mono_arch_get_swift_error (&ccontext, sig, &arg_index); - - // Perform an indirect store at arg_index stack location - if (arg_index >= 0) { - g_assert (data); - stackval *result = (stackval*) STACK_ADD_BYTES (frame.stack, get_arg_offset (frame.imethod, sig, arg_index)); - *(gpointer*)result->data.p = *(gpointer*)data; - } - } -#endif - if (!context->has_resume_state) { - mono_arch_get_native_call_context_ret (&ccontext, &frame, sig, call_info); - } - - g_free (ccontext.stack); -#else - // Only the vt address has been returned, we need to copy the entire content on interp stack - if (!context->has_resume_state && MONO_TYPE_ISSTRUCT (call_info->ret_mono_type)) { - if (call_info->ret_pinvoke_type != PINVOKE_ARG_WASM_VALUETYPE_RESULT) - stackval_from_data (call_info->ret_mono_type, frame.retval, (char*)frame.retval->data.p, sig->pinvoke && !sig->marshalling_disabled); - } - - if (margs.iargs != margs.iargs_buf) - g_free (margs.iargs); - if (margs.fargs != margs.fargs_buf) - g_free (margs.fargs); -#endif - goto exit_pinvoke; // prevent unused label warning in some configurations -exit_pinvoke: - return NULL; -} -#ifdef _MSC_VER -#pragma optimize ("", on) -#endif - -/* - * interp_init_delegate: - * - * Initialize del->interp_method. - */ -static void -interp_init_delegate (MonoDelegate *del, MonoDelegateTrampInfo **out_info, MonoError *error) -{ - MonoMethod *method; - - if (del->interp_method) { - /* Delegate created by a call to ves_icall_mono_delegate_ctor_interp () */ - del->method = ((InterpMethod *)del->interp_method)->method; - } else if (del->method_ptr && !del->method) { - /* Delegate created from methodInfo.MethodHandle.GetFunctionPointer() */ - del->interp_method = (InterpMethod *)del->method_ptr; - if (mono_llvm_only) - // FIXME: - g_assert_not_reached (); - } else if (del->method) { - /* Delegate created dynamically */ - del->interp_method = mono_interp_get_imethod (del->method); - } else { - /* Created from JITted code */ - g_assert_not_reached (); - } - - method = ((InterpMethod*)del->interp_method)->method; - if (del->target && - method && - method->flags & METHOD_ATTRIBUTE_VIRTUAL && - method->flags & METHOD_ATTRIBUTE_ABSTRACT && - mono_class_is_abstract (method->klass)) - del->interp_method = get_virtual_method ((InterpMethod*)del->interp_method, del->target->vtable); - - method = ((InterpMethod*)del->interp_method)->method; - if (method && m_class_get_parent (method->klass) == mono_defaults.multicastdelegate_class) { - const char *name = method->name; - if (*name == 'I' && (strcmp (name, "Invoke") == 0)) { - /* - * When invoking the delegate interp_method is executed directly. If it's an - * invoke make sure we replace it with the appropriate delegate invoke wrapper. - * - * FIXME We should do this later, when we also know the delegate on which the - * target method is called. - */ - del->interp_method = mono_interp_get_imethod (mono_marshal_get_delegate_invoke (method, NULL)); - } - } - - if (!((InterpMethod *) del->interp_method)->transformed && method_is_dynamic (method)) { - /* Return any errors from method compilation */ - mono_interp_transform_method ((InterpMethod *) del->interp_method, get_context (), error); - return_if_nok (error); - } - - /* - * Compute a MonoDelegateTrampInfo for this delegate if possible and pass it back to - * the caller. - * Keep a 1 element cache in imethod->del_info. This should be good enough since most methods - * are only associated with one delegate type. - */ - if (out_info) - *out_info = NULL; - if (mono_llvm_only) { - InterpMethod *imethod = del->interp_method; - method = imethod->method; - if (imethod->del_info && imethod->del_info->klass == del->object.vtable->klass) { - *out_info = imethod->del_info; - } else if (!imethod->del_info) { - imethod->del_info = mono_create_delegate_trampoline_info (del->object.vtable->klass, method, FALSE); - *out_info = imethod->del_info; - } - } -} - -/* Convert a function pointer for a managed method to an InterpMethod* */ -static InterpMethod* -ftnptr_to_imethod (gpointer addr, gboolean *need_unbox) -{ - InterpMethod *imethod; - - if (mono_llvm_only) { - /* Function pointers are represented by a MonoFtnDesc structure */ - MonoFtnDesc *ftndesc = (MonoFtnDesc*)addr; - g_assert (ftndesc); - g_assert (ftndesc->method); - - if (!ftndesc->interp_method) { - imethod = mono_interp_get_imethod (ftndesc->method); - mono_memory_barrier (); - // FIXME Handle unboxing here ? - ftndesc->interp_method = imethod; - } - *need_unbox = INTERP_IMETHOD_IS_TAGGED_UNBOX (ftndesc->interp_method); - imethod = INTERP_IMETHOD_UNTAG_UNBOX (ftndesc->interp_method); - } else { - /* Function pointers are represented by their InterpMethod */ - *need_unbox = INTERP_IMETHOD_IS_TAGGED_UNBOX (addr); - imethod = INTERP_IMETHOD_UNTAG_UNBOX (addr); - } - return imethod; -} - -static gpointer -imethod_to_ftnptr (InterpMethod *imethod, gboolean need_unbox) -{ - if (mono_llvm_only) { - ERROR_DECL (error); - /* Function pointers are represented by a MonoFtnDesc structure */ - MonoFtnDesc **ftndesc_p; - if (need_unbox) - ftndesc_p = &imethod->ftndesc_unbox; - else - ftndesc_p = &imethod->ftndesc; - if (!*ftndesc_p) { - MonoFtnDesc *ftndesc = mini_llvmonly_load_method_ftndesc (imethod->method, FALSE, need_unbox, error); - mono_error_assert_ok (error); - if (need_unbox) - ftndesc->interp_method = INTERP_IMETHOD_TAG_UNBOX (imethod); - else - ftndesc->interp_method = imethod; - mono_memory_barrier (); - *ftndesc_p = ftndesc; - } - return *ftndesc_p; - } else { - if (need_unbox) - return INTERP_IMETHOD_TAG_UNBOX (imethod); - else - return imethod; - } -} - -static void -interp_delegate_ctor (MonoObjectHandle this_obj, MonoObjectHandle target, gpointer addr, MonoError *error) -{ - gboolean need_unbox; - /* addr is the result of an LDFTN opcode */ - InterpMethod *imethod = ftnptr_to_imethod (addr, &need_unbox); - - if (!(imethod->method->flags & METHOD_ATTRIBUTE_STATIC)) { - MonoMethod *invoke = mono_get_delegate_invoke_internal (mono_handle_class (this_obj)); - /* virtual invoke delegates must not have null check */ - if (mono_method_signature_internal (imethod->method)->param_count == mono_method_signature_internal (invoke)->param_count - && MONO_HANDLE_IS_NULL (target)) { - mono_error_set_argument (error, "this", "Delegate to an instance method cannot have null 'this'"); - return; - } - } - - g_assert (imethod->method); - gpointer entry = mini_get_interp_callbacks ()->create_method_pointer (imethod->method, FALSE, error); - return_if_nok (error); - - MONO_HANDLE_SETVAL (MONO_HANDLE_CAST (MonoDelegate, this_obj), interp_method, gpointer, imethod); - - mono_delegate_ctor (this_obj, target, entry, imethod->method, error); -} - -#if DEBUG_INTERP -static void -dump_stackval (GString *str, stackval *s, MonoType *type) -{ - switch (type->type) { - case MONO_TYPE_I1: - case MONO_TYPE_U1: - case MONO_TYPE_I2: - case MONO_TYPE_U2: - case MONO_TYPE_I4: - case MONO_TYPE_U4: - case MONO_TYPE_CHAR: - case MONO_TYPE_BOOLEAN: - g_string_append_printf (str, "[%d] ", s->data.i); - break; - case MONO_TYPE_STRING: - case MONO_TYPE_SZARRAY: - case MONO_TYPE_CLASS: - case MONO_TYPE_OBJECT: - case MONO_TYPE_ARRAY: - case MONO_TYPE_PTR: - case MONO_TYPE_FNPTR: - case MONO_TYPE_I: - case MONO_TYPE_U: - g_string_append_printf (str, "[%p] ", s->data.p); - break; - case MONO_TYPE_VALUETYPE: - if (m_class_is_enumtype (m_type_data_get_klass_unchecked (type))) - g_string_append_printf (str, "[%d] ", s->data.i); - else - g_string_append_printf (str, "[vt:%p] ", s->data.p); - break; - case MONO_TYPE_R4: - g_string_append_printf (str, "[%g] ", s->data.f_r4); - break; - case MONO_TYPE_R8: - g_string_append_printf (str, "[%g] ", s->data.f); - break; - case MONO_TYPE_I8: - case MONO_TYPE_U8: - default: { - GString *res = g_string_new (""); - mono_type_get_desc (res, type, TRUE); - g_string_append_printf (str, "[{%s} %" PRId64 "/0x%0" PRIx64 "] ", res->str, (gint64)s->data.l, (guint64)s->data.l); - g_string_free (res, TRUE); - break; - } - } -} - -static char* -dump_retval (InterpFrame *inv) -{ - GString *str = g_string_new (""); - MonoType *ret = mono_method_signature_internal (inv->imethod->method)->ret; - - if (ret->type != MONO_TYPE_VOID) - dump_stackval (str, inv->stack, ret); - - return g_string_free (str, FALSE); -} - -static char* -dump_args (InterpFrame *inv) -{ - GString *str = g_string_new (""); - int i; - MonoMethodSignature *signature = mono_method_signature_internal (inv->imethod->method); - - if (signature->param_count == 0 && !signature->hasthis) - return g_string_free (str, FALSE); - - if (signature->hasthis) { - MonoMethod *method = inv->imethod->method; - dump_stackval (str, inv->stack, m_class_get_byval_arg (method->klass)); - } - - for (i = 0; i < signature->param_count; ++i) - dump_stackval (str, inv->stack + (!!signature->hasthis) + i, signature->params [i]); - - return g_string_free (str, FALSE); -} -#endif - -#define CHECK_ADD_OVERFLOW(a,b) \ - (gint32)(b) >= 0 ? (gint32)(G_MAXINT32) - (gint32)(b) < (gint32)(a) ? -1 : 0 \ - : (gint32)(G_MININT32) - (gint32)(b) > (gint32)(a) ? +1 : 0 - -#define CHECK_SUB_OVERFLOW(a,b) \ - (gint32)(b) < 0 ? (gint32)(G_MAXINT32) + (gint32)(b) < (gint32)(a) ? -1 : 0 \ - : (gint32)(G_MININT32) + (gint32)(b) > (gint32)(a) ? +1 : 0 - -#define CHECK_ADD_OVERFLOW_UN(a,b) \ - (guint32)(G_MAXUINT32) - (guint32)(b) < (guint32)(a) ? -1 : 0 - -#define CHECK_SUB_OVERFLOW_UN(a,b) \ - (guint32)(a) < (guint32)(b) ? -1 : 0 - -#define CHECK_ADD_OVERFLOW64(a,b) \ - (gint64)(b) >= 0 ? (gint64)(G_MAXINT64) - (gint64)(b) < (gint64)(a) ? -1 : 0 \ - : (gint64)(G_MININT64) - (gint64)(b) > (gint64)(a) ? +1 : 0 - -#define CHECK_SUB_OVERFLOW64(a,b) \ - (gint64)(b) < 0 ? (gint64)(G_MAXINT64) + (gint64)(b) < (gint64)(a) ? -1 : 0 \ - : (gint64)(G_MININT64) + (gint64)(b) > (gint64)(a) ? +1 : 0 - -#define CHECK_ADD_OVERFLOW64_UN(a,b) \ - (guint64)(G_MAXUINT64) - (guint64)(b) < (guint64)(a) ? -1 : 0 - -#define CHECK_SUB_OVERFLOW64_UN(a,b) \ - (guint64)(a) < (guint64)(b) ? -1 : 0 - -#if SIZEOF_VOID_P == 4 -#define CHECK_ADD_OVERFLOW_NAT(a,b) CHECK_ADD_OVERFLOW(a,b) -#define CHECK_ADD_OVERFLOW_NAT_UN(a,b) CHECK_ADD_OVERFLOW_UN(a,b) -#else -#define CHECK_ADD_OVERFLOW_NAT(a,b) CHECK_ADD_OVERFLOW64(a,b) -#define CHECK_ADD_OVERFLOW_NAT_UN(a,b) CHECK_ADD_OVERFLOW64_UN(a,b) -#endif - -/* Resolves to TRUE if the operands would overflow */ -#define CHECK_MUL_OVERFLOW(a,b) \ - ((gint32)(a) == 0) || ((gint32)(b) == 0) ? 0 : \ - (((gint32)(a) > 0) && ((gint32)(b) == -1)) ? FALSE : \ - (((gint32)(a) < 0) && ((gint32)(b) == -1)) ? (a == G_MININT32) : \ - (((gint32)(a) > 0) && ((gint32)(b) > 0)) ? (gint32)(a) > ((G_MAXINT32) / (gint32)(b)) : \ - (((gint32)(a) > 0) && ((gint32)(b) < 0)) ? (gint32)(a) > ((G_MININT32) / (gint32)(b)) : \ - (((gint32)(a) < 0) && ((gint32)(b) > 0)) ? (gint32)(a) < ((G_MININT32) / (gint32)(b)) : \ - (gint32)(a) < ((G_MAXINT32) / (gint32)(b)) - -#define CHECK_MUL_OVERFLOW_UN(a,b) \ - ((guint32)(a) == 0) || ((guint32)(b) == 0) ? 0 : \ - (guint32)(b) > ((G_MAXUINT32) / (guint32)(a)) - -#define CHECK_MUL_OVERFLOW64(a,b) \ - ((gint64)(a) == 0) || ((gint64)(b) == 0) ? 0 : \ - (((gint64)(a) > 0) && ((gint64)(b) == -1)) ? FALSE : \ - (((gint64)(a) < 0) && ((gint64)(b) == -1)) ? (a == G_MININT64) : \ - (((gint64)(a) > 0) && ((gint64)(b) > 0)) ? (gint64)(a) > ((G_MAXINT64) / (gint64)(b)) : \ - (((gint64)(a) > 0) && ((gint64)(b) < 0)) ? (gint64)(a) > ((G_MININT64) / (gint64)(b)) : \ - (((gint64)(a) < 0) && ((gint64)(b) > 0)) ? (gint64)(a) < ((G_MININT64) / (gint64)(b)) : \ - (gint64)(a) < ((G_MAXINT64) / (gint64)(b)) - -#define CHECK_MUL_OVERFLOW64_UN(a,b) \ - ((guint64)(a) == 0) || ((guint64)(b) == 0) ? 0 : \ - (guint64)(b) > ((G_MAXUINT64) / (guint64)(a)) - -#if SIZEOF_VOID_P == 4 -#define CHECK_MUL_OVERFLOW_NAT(a,b) CHECK_MUL_OVERFLOW(a,b) -#define CHECK_MUL_OVERFLOW_NAT_UN(a,b) CHECK_MUL_OVERFLOW_UN(a,b) -#else -#define CHECK_MUL_OVERFLOW_NAT(a,b) CHECK_MUL_OVERFLOW64(a,b) -#define CHECK_MUL_OVERFLOW_NAT_UN(a,b) CHECK_MUL_OVERFLOW64_UN(a,b) -#endif - -// Do not inline in case order of frame addresses matters. -static MONO_NEVER_INLINE MonoObject* -interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc, MonoError *error) -{ - ThreadContext *context = get_context (); - MonoMethodSignature *sig = mono_method_signature_internal (method); - stackval *sp = (stackval*)context->stack_pointer; - MonoMethod *target_method = method; - - error_init (error); - if (exc) - *exc = NULL; - - if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) - target_method = mono_marshal_get_native_wrapper (target_method, FALSE, FALSE); - MonoMethod *invoke_wrapper = mono_marshal_get_runtime_invoke_full (target_method, FALSE, TRUE); - - //* MonoObject *runtime_invoke (MonoObject *this_obj, void **params, MonoObject **exc, void* method) - - if (sig->hasthis) - sp [0].data.p = obj; - else - sp [0].data.p = NULL; - sp [1].data.p = params; - sp [2].data.p = exc; - sp [3].data.p = target_method; - - InterpMethod *imethod = mono_interp_get_imethod (invoke_wrapper); - - InterpFrame frame = {0}; - frame.imethod = imethod; - frame.stack = sp; - frame.retval = sp; - - // The method to execute might not be transformed yet, so we don't know how much stack - // it uses. We bump the stack_pointer here so any code triggered by method compilation - // will not attempt to use the space that we used to push the args for this method. - // The real top of stack for this method will be set in mono_interp_exec_method once the - // method is transformed. - context->stack_pointer = (guchar*)(sp + 4); - g_assert (context->stack_pointer < context->stack_end); - MONO_ENTER_GC_UNSAFE; - mono_interp_exec_method (&frame, context, NULL); - MONO_EXIT_GC_UNSAFE; - context->stack_pointer = (guchar*)sp; - - if (context->has_resume_state) { - /* - * This can happen on wasm where native frames cannot be skipped during EH. - * EH processing will continue when control returns to the interpreter. - */ - if (mono_aot_mode == MONO_AOT_MODE_LLVMONLY_INTERP) - mono_llvm_start_native_unwind (); - return NULL; - } - // The return value is at the bottom of the stack - return frame.stack->data.o; -} - -typedef struct { - InterpMethod *rmethod; - gpointer this_arg; - gpointer res; - gpointer args [16]; - gpointer *many_args; -} InterpEntryData; - -/* Main function for entering the interpreter from compiled code */ -// Do not inline in case order of frame addresses matters. -static MONO_NEVER_INLINE void -interp_entry (InterpEntryData *data) -{ - InterpMethod *rmethod; - ThreadContext *context; - stackval *sp; - int stack_index = 0; - MonoMethod *method; - MonoMethodSignature *sig; - MonoType *type; - gpointer orig_domain = NULL, attach_cookie; - int i; - - if ((gsize)data->rmethod & 1) { - /* Unbox */ - data->this_arg = mono_object_unbox_internal ((MonoObject*)data->this_arg); - data->rmethod = (InterpMethod*)(gpointer)((gsize)data->rmethod & ~1); - } - rmethod = data->rmethod; - - if (rmethod->needs_thread_attach) - orig_domain = mono_threads_attach_coop (mono_domain_get (), &attach_cookie); - - context = get_context (); - sp = (stackval*)context->stack_pointer; - - method = rmethod->method; - - if (rmethod->is_invoke) { - /* - * This happens when AOT code for the invoke wrapper is not found. - * Have to replace the method with the wrapper here, since the wrapper depends on the delegate. - */ - MonoDelegate *del = (MonoDelegate*)data->this_arg; - // FIXME: This is slow - method = mono_marshal_get_delegate_invoke (method, del); - data->rmethod = mono_interp_get_imethod (method); - } - - sig = mono_method_signature_internal (method); - - // FIXME: Optimize this - - if (sig->hasthis) { - sp->data.p = data->this_arg; - stack_index = 1; - } - - gpointer *params; - if (data->many_args) - params = data->many_args; - else - params = data->args; - for (i = 0; i < sig->param_count; ++i) { - int arg_offset = get_arg_offset_fast (rmethod, NULL, stack_index + i); - stackval *sval = STACK_ADD_ALIGNED_BYTES (sp, arg_offset); - - if (m_type_is_byref (sig->params [i])) - sval->data.p = params [i]; - else - stackval_from_data (sig->params [i], sval, params [i], FALSE); - } - - InterpFrame frame = {0}; - frame.imethod = data->rmethod; - frame.stack = sp; - frame.retval = sp; - - int params_size = get_arg_offset_fast (rmethod, NULL, stack_index + sig->param_count); - context->stack_pointer = (guchar*)ALIGN_TO ((guchar*)sp + params_size, MINT_STACK_ALIGNMENT); - g_assert (context->stack_pointer < context->stack_end); - - MONO_ENTER_GC_UNSAFE; - mono_interp_exec_method (&frame, context, NULL); - MONO_EXIT_GC_UNSAFE; - - context->stack_pointer = (guchar*)sp; - - if (rmethod->needs_thread_attach) - mono_threads_detach_coop (orig_domain, &attach_cookie); - - if (need_native_unwind (context)) { - mono_llvm_start_native_unwind (); - return; - } - - if (mono_llvm_only) { - if (context->has_resume_state) { - /* The exception will be handled in a frame above us */ - mono_llvm_start_native_unwind (); - // FIXME: Set dummy return value ? - return; - } - } else { - g_assert (!context->has_resume_state); - } - - // The return value is at the bottom of the stack, after the locals space - type = rmethod->rtype; - if (type->type != MONO_TYPE_VOID) - stackval_to_data (type, frame.stack, data->res, FALSE); -} - - -/* MONO_NO_OPTIMIZATION is needed due to usage of INTERP_PUSH_LMF_WITH_CTX. */ -#ifdef _MSC_VER -#pragma optimize ("", off) -#endif - -// Do not inline in case order of frame addresses matters, and maybe other reasons. -static MONO_NO_OPTIMIZATION MONO_NEVER_INLINE gpointer -do_icall_wrapper (InterpFrame *frame, MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval *sp, gpointer ptr, gboolean save_last_error, gboolean *gc_transitions) -{ - MonoLMFExt ext; - INTERP_PUSH_LMF_WITH_CTX (frame, ext, exit_icall); - if (*gc_transitions) { - MONO_ENTER_GC_SAFE; - do_icall (sig, op, ret_sp, sp, ptr, save_last_error); - MONO_EXIT_GC_SAFE; - *gc_transitions = FALSE; - } else { - do_icall (sig, op, ret_sp, sp, ptr, save_last_error); - } - interp_pop_lmf (&ext); - - goto exit_icall; // prevent unused label warning in some configurations - /* If an exception is thrown from native code, execution will continue here */ -exit_icall: - return NULL; -} -#ifdef _MSC_VER -#pragma optimize ("", on) -#endif - -typedef struct { - int pindex; - gpointer jit_wrapper; - gpointer *args; - gpointer extra_arg; - MonoFtnDesc ftndesc; -} JitCallCbData; - -/* Callback called by mono_llvm_catch_exception () */ -static void -jit_call_cb (gpointer arg) -{ - JitCallCbData *cb_data = (JitCallCbData*)arg; - gpointer jit_wrapper = cb_data->jit_wrapper; - int pindex = cb_data->pindex; - gpointer *args = cb_data->args; - gpointer ftndesc = cb_data->extra_arg; - - switch (pindex) { - case 0: { - typedef void (*T)(gpointer); - T func = (T)jit_wrapper; - - func (ftndesc); - break; - } - case 1: { - typedef void (*T)(gpointer, gpointer); - T func = (T)jit_wrapper; - - func (args [0], ftndesc); - break; - } - case 2: { - typedef void (*T)(gpointer, gpointer, gpointer); - T func = (T)jit_wrapper; - - func (args [0], args [1], ftndesc); - break; - } - case 3: { - typedef void (*T)(gpointer, gpointer, gpointer, gpointer); - T func = (T)jit_wrapper; - - func (args [0], args [1], args [2], ftndesc); - break; - } - case 4: { - typedef void (*T)(gpointer, gpointer, gpointer, gpointer, gpointer); - T func = (T)jit_wrapper; - - func (args [0], args [1], args [2], args [3], ftndesc); - break; - } - case 5: { - typedef void (*T)(gpointer, gpointer, gpointer, gpointer, gpointer, gpointer); - T func = (T)jit_wrapper; - - func (args [0], args [1], args [2], args [3], args [4], ftndesc); - break; - } - case 6: { - typedef void (*T)(gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer); - T func = (T)jit_wrapper; - - func (args [0], args [1], args [2], args [3], args [4], args [5], ftndesc); - break; - } - case 7: { - typedef void (*T)(gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer); - T func = (T)jit_wrapper; - - func (args [0], args [1], args [2], args [3], args [4], args [5], args [6], ftndesc); - break; - } - case 8: { - typedef void (*T)(gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer); - T func = (T)jit_wrapper; - - func (args [0], args [1], args [2], args [3], args [4], args [5], args [6], args [7], ftndesc); - break; - } - case 9: { - typedef void (*T)(gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer); - T func = (T)jit_wrapper; - - func (args [0], args [1], args [2], args [3], args [4], args [5], args [6], args [7], args [8], ftndesc); - break; - } - case 10: { - typedef void (*T)(gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer); - T func = (T)jit_wrapper; - - func (args [0], args [1], args [2], args [3], args [4], args [5], args [6], args [7], args [8], args [9], ftndesc); - break; - } - case 11: { - typedef void (*T)(gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer); - T func = (T)jit_wrapper; - - func (args [0], args [1], args [2], args [3], args [4], args [5], args [6], args [7], args [8], args [9], args [10], ftndesc); - break; - } - case 12: { - typedef void (*T)(gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer, gpointer); - T func = (T)jit_wrapper; - - func (args [0], args [1], args [2], args [3], args [4], args [5], args [6], args [7], args [8], args [9], args [10], args [11], ftndesc); - break; - } - default: - g_assert_not_reached (); - break; - } -} - -enum { - /* Pass stackval->data.p */ - JIT_ARG_BYVAL, - /* Pass &stackval->data.p */ - JIT_ARG_BYREF -}; - -enum { - JIT_RET_VOID, - JIT_RET_SCALAR, - JIT_RET_VTYPE -}; - -typedef struct _JitCallInfo JitCallInfo; -struct _JitCallInfo { - gpointer addr; - gpointer extra_arg; - gpointer wrapper; - MonoMethodSignature *sig; - guint8 *arginfo; - gint32 res_size; - int ret_mt; - gboolean no_wrapper; -#if HOST_BROWSER - int hit_count; - WasmJitCallThunk jiterp_thunk; -#endif -}; - -static MONO_NEVER_INLINE void -init_jit_call_info (InterpMethod *rmethod, MonoError *error) -{ - MonoMethodSignature *sig; - JitCallInfo *cinfo; - - //printf ("jit_call: %s\n", mono_method_full_name (rmethod->method, 1)); - - MonoMethod *method = rmethod->method; - - // FIXME: Memory management - cinfo = g_new0 (JitCallInfo, 1); - - sig = mono_method_signature_internal (method); - g_assert (sig); - - gpointer addr = mono_jit_compile_method_jit_only (method, error); - return_if_nok (error); - g_assert (addr); - - gboolean need_wrapper = TRUE; - if (mono_llvm_only) { - MonoAotMethodFlags flags = mono_aot_get_method_flags (addr); - - if (flags & MONO_AOT_METHOD_FLAG_GSHAREDVT_VARIABLE) { - /* - * The callee already has a gsharedvt signature, we can call it directly - * instead of through a gsharedvt out wrapper. - */ - need_wrapper = FALSE; - cinfo->no_wrapper = TRUE; - } - } - - gpointer jit_wrapper = NULL; - if (need_wrapper) { - MonoMethod *wrapper = mini_get_gsharedvt_out_sig_wrapper (sig); - jit_wrapper = mono_jit_compile_method_jit_only (wrapper, error); - mono_error_assert_ok (error); - } - - if (mono_llvm_only) { - gboolean caller_gsharedvt = !need_wrapper; - cinfo->addr = mini_llvmonly_add_method_wrappers (method, addr, caller_gsharedvt, FALSE, &cinfo->extra_arg); - } else { - cinfo->addr = addr; - } - - cinfo->sig = sig; - cinfo->wrapper = jit_wrapper; - - if (sig->ret->type != MONO_TYPE_VOID) { - int mt = mono_mint_type (sig->ret); - if (mt == MINT_TYPE_VT) { - MonoClass *klass = mono_class_from_mono_type_internal (sig->ret); - /* - * We cache this size here, instead of the instruction stream of the - * calling instruction, to save space for common callvirt instructions - * that could end up doing a jit call. - */ - gint32 size = mono_class_value_size (klass, NULL); - cinfo->res_size = ALIGN_TO (size, MINT_STACK_SLOT_SIZE); - } else { - cinfo->res_size = MINT_STACK_SLOT_SIZE; - } - cinfo->ret_mt = mt; - } else { - cinfo->ret_mt = -1; - } - - if (sig->param_count) { - cinfo->arginfo = g_new0 (guint8, sig->param_count); - - for (guint i = 0; i < rmethod->param_count; ++i) { - MonoType *t = rmethod->param_types [i]; - int mt = mono_mint_type (t); - if (m_type_is_byref (sig->params [i])) { - cinfo->arginfo [i] = JIT_ARG_BYVAL; - } else if (mt == MINT_TYPE_O) { - cinfo->arginfo [i] = JIT_ARG_BYREF; - } else { - /* stackval->data is an union */ - cinfo->arginfo [i] = JIT_ARG_BYREF; - } - } - } - - mono_memory_barrier (); - rmethod->jit_call_info = cinfo; -} - - -static MONO_NEVER_INLINE void -do_jit_call (ThreadContext *context, stackval *ret_sp, stackval *sp, InterpFrame *frame, InterpMethod *rmethod, MonoError *error) -{ - MonoLMFExt ext; - JitCallInfo *cinfo; - gboolean thrown = FALSE; - - //printf ("jit_call: %s\n", mono_method_full_name (rmethod->method, 1)); - - /* - * Call JITted code through a gsharedvt_out wrapper. These wrappers receive every argument - * by ref and return a return value using an explicit return value argument. - */ - if (G_UNLIKELY (!rmethod->jit_call_info)) { - init_jit_call_info (rmethod, error); - mono_error_assert_ok (error); - } - - cinfo = (JitCallInfo*)rmethod->jit_call_info; - -#if JITERPRETER_ENABLE_JIT_CALL_TRAMPOLINES - // The jiterpreter will compile a unique thunk for each do_jit_call call site if it is hot - // enough to justify it. At that point we can invoke the thunk to efficiently do most of - // the work that would normally be done by do_jit_call - if (mono_opt_jiterpreter_jit_call_enabled) { - // FIXME: Thread safety for the thunk pointer - WasmJitCallThunk thunk = cinfo->jiterp_thunk; - if (thunk) { - MonoFtnDesc ftndesc = {0}; - ftndesc.addr = cinfo->addr; - ftndesc.arg = cinfo->extra_arg; - interp_push_lmf (&ext, frame); - if ( - mono_opt_jiterpreter_wasm_eh_enabled || - (mono_aot_mode != MONO_AOT_MODE_LLVMONLY_INTERP) - ) { - // WASM EH is available or we are otherwise in a situation where we know - // that the jiterpreter thunk was compiled with exception handling built-in - // so we can just invoke it directly and errors will be handled - thunk (ret_sp, sp, &ftndesc, &thrown); - } else { - // Call a special JS function that will invoke the compiled jiterpreter thunk - // and trap errors for us to set the thrown flag - mono_interp_invoke_wasm_jit_call_trampoline ( - thunk, ret_sp, sp, &ftndesc, &thrown - ); - } - interp_pop_lmf (&ext); - - // We reuse do_jit_call's epilogue to do things like propagate thrown exceptions - // and sign-extend return values instead of inlining that logic into every thunk - // the dummy implementation sets a special value into thrown to indicate that - // we need to go through the slow path because this thread has no thunk yet - if (G_UNLIKELY (thrown == 999)) - thrown = 0; - else - goto epilogue; - } else { - int old_count = mono_jiterp_increment_counter (&cinfo->hit_count); - // If our hit count just reached the threshold, we request that a thunk be jitted - // for this specific call site. It will go into a queue and wait until there - // are enough jit calls waiting to be compiled into one WASM module - if (old_count == mono_opt_jiterpreter_jit_call_trampoline_hit_count) { - mono_interp_jit_wasm_jit_call_trampoline ( - rmethod->method, rmethod, cinfo, - initialize_arg_offsets(rmethod, mono_method_signature_internal (rmethod->method)), - mono_aot_mode == MONO_AOT_MODE_LLVMONLY_INTERP - ); - } else { - int excess = old_count - mono_opt_jiterpreter_jit_call_queue_flush_threshold; - // If our hit count just reached the flush threshold, that means that we - // previously requested compilation for this call site and it didn't - // happen yet. We will request a flush of the entire queue this one - // time which will probably result in it being compiled - if (excess == 0) - mono_interp_flush_jitcall_queue (); - } - } - } -#endif - - /* - * Convert the arguments on the interpreter stack to the format expected by the gsharedvt_out wrapper. - */ - gpointer args [32]; - int pindex = 0; - int stack_index = 0; - if (rmethod->hasthis) { - args [pindex ++] = sp [0].data.p; - stack_index ++; - } - /* return address */ - if (cinfo->ret_mt != -1) - args [pindex ++] = ret_sp; - for (guint i = 0; i < rmethod->param_count; ++i) { - stackval *sval = STACK_ADD_ALIGNED_BYTES (sp, get_arg_offset_fast (rmethod, NULL, stack_index + i)); - if (cinfo->arginfo [i] == JIT_ARG_BYVAL) - args [pindex ++] = sval->data.p; - else - /* data is an union, so can use 'p' for all types */ - args [pindex ++] = sval; - } - - JitCallCbData cb_data; - cb_data.pindex = pindex; - cb_data.args = args; - cb_data.ftndesc.interp_method = NULL; - cb_data.ftndesc.method = NULL; - if (cinfo->no_wrapper) { - cb_data.ftndesc.addr = NULL; - cb_data.ftndesc.arg = NULL; - cb_data.jit_wrapper = cinfo->addr; - cb_data.extra_arg = cinfo->extra_arg; - } else { - cb_data.ftndesc.addr = cinfo->addr; - cb_data.ftndesc.arg = cinfo->extra_arg; - cb_data.jit_wrapper = cinfo->wrapper; - cb_data.extra_arg = &cb_data.ftndesc; - } - - interp_push_lmf (&ext, frame); - - if (mono_aot_mode == MONO_AOT_MODE_LLVMONLY_INTERP) { - /* Catch the exception thrown by the native code using a try-catch */ - mono_llvm_catch_exception (jit_call_cb, &cb_data, &thrown); - } else { - jit_call_cb (&cb_data); - } - - interp_pop_lmf (&ext); - -#if JITERPRETER_ENABLE_JIT_CALL_TRAMPOLINES -epilogue: -#endif - if (thrown) { - if (context->has_resume_state) - /* - * This happens when interp_entry calls mono_llvm_reraise_exception (). - */ - return; - MonoJitTlsData *jit_tls = mono_get_jit_tls (); - if (jit_tls->resume_state.il_state) { - /* - * This c++ exception is going to be caught by an AOTed frame above us. - * We can't rethrow here, since that will skip the cleanup of the - * interpreter stack space etc. So instruct the interpreter to unwind. - */ - context->has_resume_state = TRUE; - context->handler_frame = NULL; - return; - } - MonoObject *obj = mini_llvmonly_load_exception (); - g_assert (obj); - mini_llvmonly_clear_exception (); - mono_error_set_exception_instance (error, (MonoException*)obj); - return; - } - if (cinfo->ret_mt != -1) { - // Sign/zero extend if necessary - switch (cinfo->ret_mt) { - case MINT_TYPE_I1: - ret_sp->data.i = *(gint8*)ret_sp; - break; - case MINT_TYPE_U1: - ret_sp->data.i = *(guint8*)ret_sp; - break; - case MINT_TYPE_I2: - ret_sp->data.i = *(gint16*)ret_sp; - break; - case MINT_TYPE_U2: - ret_sp->data.i = *(guint16*)ret_sp; - break; - case MINT_TYPE_I4: - case MINT_TYPE_I8: - case MINT_TYPE_R4: - case MINT_TYPE_R8: - case MINT_TYPE_VT: - case MINT_TYPE_O: - /* The result was written to ret_sp */ - break; - default: - g_assert_not_reached (); - } - } -} - -static MONO_NEVER_INLINE void -do_debugger_tramp (void (*tramp) (void), InterpFrame *frame) -{ - MonoLMFExt ext; - interp_push_lmf (&ext, frame); - tramp (); - interp_pop_lmf (&ext); -} - -static MONO_NEVER_INLINE MonoException* -do_transform_method (InterpMethod *imethod, InterpFrame *frame, ThreadContext *context) -{ - MonoLMFExt ext; - /* Don't push lmf if we have no interp data */ - gboolean push_lmf = frame->parent != NULL; - MonoException *ex = NULL; - ERROR_DECL (error); - - /* Use the parent frame as the current frame is not complete yet */ - if (push_lmf) - interp_push_lmf (&ext, frame->parent); - -#if DEBUG_INTERP - if (imethod->method) { - char* mn = mono_method_full_name (imethod->method, TRUE); - g_print ("(%p) Transforming %s\n", mono_thread_internal_current (), mn); - g_free (mn); - } -#endif - - mono_interp_transform_method (imethod, context, error); - if (!is_ok (error)) - ex = mono_error_convert_to_exception (error); - - if (push_lmf) - interp_pop_lmf (&ext); - - return ex; -} - -static void -init_arglist (InterpFrame *frame, MonoMethodSignature *sig, stackval *sp, char *arglist) -{ - *(gpointer*)arglist = sig; - arglist += sizeof (gpointer); - - for (int i = sig->sentinelpos; i < sig->param_count; i++) { - int align, arg_size, sv_size; - arg_size = mono_type_stack_size (sig->params [i], &align); - arglist = (char*)ALIGN_PTR_TO (arglist, align); - - sv_size = stackval_to_data (sig->params [i], sp, arglist, FALSE); - arglist += arg_size; - sp = STACK_ADD_BYTES (sp, sv_size); - } -} - -/* - * These functions are the entry points into the interpreter from compiled code. - * They are called by the interp_in wrappers. They have the following signature: - * void (, , , ..., , ) - * They pack up their arguments into an InterpEntryData structure and call interp_entry (). - * It would be possible for the wrappers to pack up the arguments etc, but that would make them bigger, and there are - * more wrappers then these functions. - * this/static * ret/void * 16 arguments -> 64 functions. - */ - -#if HOST_BROWSER -/* - * For the jiterpreter, we want to record a hit count for interp_entry wrappers that can - * be jitted, but not for ones that can't. As a result we need to put this in its own - * macro instead of in INTERP_ENTRY_BASE, so that the generic wrappers don't have to - * call it on every invocation. - * Once this gets called a few hundred times, the wrapper will be jitted so we'll stop - * paying the cost of the hit counter and the entry will become faster. - */ -#define INTERP_ENTRY_UPDATE_HIT_COUNT(_method) \ - if (mono_opt_jiterpreter_interp_entry_enabled) \ - mono_interp_record_interp_entry (_method) -#else -#define INTERP_ENTRY_UPDATE_HIT_COUNT(_method) -#endif - -#define INTERP_ENTRY_BASE(_method, _this_arg, _res) \ - InterpEntryData data; \ - (data).rmethod = (_method); \ - (data).res = (_res); \ - (data).this_arg = (_this_arg); \ - (data).many_args = NULL; - -#define INTERP_ENTRY_BASE_WITH_HIT_COUNT(_method, _this_arg, _res) \ - INTERP_ENTRY_BASE (_method, _this_arg, _res) \ - INTERP_ENTRY_UPDATE_HIT_COUNT (_method); - -#define INTERP_ENTRY0(_this_arg, _res, _method) { \ - INTERP_ENTRY_BASE_WITH_HIT_COUNT (_method, _this_arg, _res); \ - interp_entry (&data); \ - } -#define INTERP_ENTRY1(_this_arg, _res, _method) { \ - INTERP_ENTRY_BASE_WITH_HIT_COUNT (_method, _this_arg, _res); \ - (data).args [0] = arg1; \ - interp_entry (&data); \ - } -#define INTERP_ENTRY2(_this_arg, _res, _method) { \ - INTERP_ENTRY_BASE_WITH_HIT_COUNT (_method, _this_arg, _res); \ - (data).args [0] = arg1; \ - (data).args [1] = arg2; \ - interp_entry (&data); \ - } -#define INTERP_ENTRY3(_this_arg, _res, _method) { \ - INTERP_ENTRY_BASE_WITH_HIT_COUNT (_method, _this_arg, _res); \ - (data).args [0] = arg1; \ - (data).args [1] = arg2; \ - (data).args [2] = arg3; \ - interp_entry (&data); \ - } -#define INTERP_ENTRY4(_this_arg, _res, _method) { \ - INTERP_ENTRY_BASE_WITH_HIT_COUNT (_method, _this_arg, _res); \ - (data).args [0] = arg1; \ - (data).args [1] = arg2; \ - (data).args [2] = arg3; \ - (data).args [3] = arg4; \ - interp_entry (&data); \ - } -#define INTERP_ENTRY5(_this_arg, _res, _method) { \ - INTERP_ENTRY_BASE_WITH_HIT_COUNT (_method, _this_arg, _res); \ - (data).args [0] = arg1; \ - (data).args [1] = arg2; \ - (data).args [2] = arg3; \ - (data).args [3] = arg4; \ - (data).args [4] = arg5; \ - interp_entry (&data); \ - } -#define INTERP_ENTRY6(_this_arg, _res, _method) { \ - INTERP_ENTRY_BASE_WITH_HIT_COUNT (_method, _this_arg, _res); \ - (data).args [0] = arg1; \ - (data).args [1] = arg2; \ - (data).args [2] = arg3; \ - (data).args [3] = arg4; \ - (data).args [4] = arg5; \ - (data).args [5] = arg6; \ - interp_entry (&data); \ - } -#define INTERP_ENTRY7(_this_arg, _res, _method) { \ - INTERP_ENTRY_BASE_WITH_HIT_COUNT (_method, _this_arg, _res); \ - (data).args [0] = arg1; \ - (data).args [1] = arg2; \ - (data).args [2] = arg3; \ - (data).args [3] = arg4; \ - (data).args [4] = arg5; \ - (data).args [5] = arg6; \ - (data).args [6] = arg7; \ - interp_entry (&data); \ - } -#define INTERP_ENTRY8(_this_arg, _res, _method) { \ - INTERP_ENTRY_BASE_WITH_HIT_COUNT (_method, _this_arg, _res); \ - (data).args [0] = arg1; \ - (data).args [1] = arg2; \ - (data).args [2] = arg3; \ - (data).args [3] = arg4; \ - (data).args [4] = arg5; \ - (data).args [5] = arg6; \ - (data).args [6] = arg7; \ - (data).args [7] = arg8; \ - interp_entry (&data); \ - } - -#define ARGLIST0 InterpMethod *rmethod -#define ARGLIST1 gpointer arg1, InterpMethod *rmethod -#define ARGLIST2 gpointer arg1, gpointer arg2, InterpMethod *rmethod -#define ARGLIST3 gpointer arg1, gpointer arg2, gpointer arg3, InterpMethod *rmethod -#define ARGLIST4 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, InterpMethod *rmethod -#define ARGLIST5 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, InterpMethod *rmethod -#define ARGLIST6 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, gpointer arg6, InterpMethod *rmethod -#define ARGLIST7 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, gpointer arg6, gpointer arg7, InterpMethod *rmethod -#define ARGLIST8 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, gpointer arg6, gpointer arg7, gpointer arg8, InterpMethod *rmethod - -static void interp_entry_static_0 (ARGLIST0) INTERP_ENTRY0 (NULL, NULL, rmethod) -static void interp_entry_static_1 (ARGLIST1) INTERP_ENTRY1 (NULL, NULL, rmethod) -static void interp_entry_static_2 (ARGLIST2) INTERP_ENTRY2 (NULL, NULL, rmethod) -static void interp_entry_static_3 (ARGLIST3) INTERP_ENTRY3 (NULL, NULL, rmethod) -static void interp_entry_static_4 (ARGLIST4) INTERP_ENTRY4 (NULL, NULL, rmethod) -static void interp_entry_static_5 (ARGLIST5) INTERP_ENTRY5 (NULL, NULL, rmethod) -static void interp_entry_static_6 (ARGLIST6) INTERP_ENTRY6 (NULL, NULL, rmethod) -static void interp_entry_static_7 (ARGLIST7) INTERP_ENTRY7 (NULL, NULL, rmethod) -static void interp_entry_static_8 (ARGLIST8) INTERP_ENTRY8 (NULL, NULL, rmethod) -static void interp_entry_static_ret_0 (gpointer res, ARGLIST0) INTERP_ENTRY0 (NULL, res, rmethod) -static void interp_entry_static_ret_1 (gpointer res, ARGLIST1) INTERP_ENTRY1 (NULL, res, rmethod) -static void interp_entry_static_ret_2 (gpointer res, ARGLIST2) INTERP_ENTRY2 (NULL, res, rmethod) -static void interp_entry_static_ret_3 (gpointer res, ARGLIST3) INTERP_ENTRY3 (NULL, res, rmethod) -static void interp_entry_static_ret_4 (gpointer res, ARGLIST4) INTERP_ENTRY4 (NULL, res, rmethod) -static void interp_entry_static_ret_5 (gpointer res, ARGLIST5) INTERP_ENTRY5 (NULL, res, rmethod) -static void interp_entry_static_ret_6 (gpointer res, ARGLIST6) INTERP_ENTRY6 (NULL, res, rmethod) -static void interp_entry_static_ret_7 (gpointer res, ARGLIST7) INTERP_ENTRY7 (NULL, res, rmethod) -static void interp_entry_static_ret_8 (gpointer res, ARGLIST8) INTERP_ENTRY8 (NULL, res, rmethod) -static void interp_entry_instance_0 (gpointer this_arg, ARGLIST0) INTERP_ENTRY0 (this_arg, NULL, rmethod) -static void interp_entry_instance_1 (gpointer this_arg, ARGLIST1) INTERP_ENTRY1 (this_arg, NULL, rmethod) -static void interp_entry_instance_2 (gpointer this_arg, ARGLIST2) INTERP_ENTRY2 (this_arg, NULL, rmethod) -static void interp_entry_instance_3 (gpointer this_arg, ARGLIST3) INTERP_ENTRY3 (this_arg, NULL, rmethod) -static void interp_entry_instance_4 (gpointer this_arg, ARGLIST4) INTERP_ENTRY4 (this_arg, NULL, rmethod) -static void interp_entry_instance_5 (gpointer this_arg, ARGLIST5) INTERP_ENTRY5 (this_arg, NULL, rmethod) -static void interp_entry_instance_6 (gpointer this_arg, ARGLIST6) INTERP_ENTRY6 (this_arg, NULL, rmethod) -static void interp_entry_instance_7 (gpointer this_arg, ARGLIST7) INTERP_ENTRY7 (this_arg, NULL, rmethod) -static void interp_entry_instance_8 (gpointer this_arg, ARGLIST8) INTERP_ENTRY8 (this_arg, NULL, rmethod) -static void interp_entry_instance_ret_0 (gpointer this_arg, gpointer res, ARGLIST0) INTERP_ENTRY0 (this_arg, res, rmethod) -static void interp_entry_instance_ret_1 (gpointer this_arg, gpointer res, ARGLIST1) INTERP_ENTRY1 (this_arg, res, rmethod) -static void interp_entry_instance_ret_2 (gpointer this_arg, gpointer res, ARGLIST2) INTERP_ENTRY2 (this_arg, res, rmethod) -static void interp_entry_instance_ret_3 (gpointer this_arg, gpointer res, ARGLIST3) INTERP_ENTRY3 (this_arg, res, rmethod) -static void interp_entry_instance_ret_4 (gpointer this_arg, gpointer res, ARGLIST4) INTERP_ENTRY4 (this_arg, res, rmethod) -static void interp_entry_instance_ret_5 (gpointer this_arg, gpointer res, ARGLIST5) INTERP_ENTRY5 (this_arg, res, rmethod) -static void interp_entry_instance_ret_6 (gpointer this_arg, gpointer res, ARGLIST6) INTERP_ENTRY6 (this_arg, res, rmethod) -static void interp_entry_instance_ret_7 (gpointer this_arg, gpointer res, ARGLIST7) INTERP_ENTRY7 (this_arg, res, rmethod) -static void interp_entry_instance_ret_8 (gpointer this_arg, gpointer res, ARGLIST8) INTERP_ENTRY8 (this_arg, res, rmethod) - -#define INTERP_ENTRY_FUNCLIST(type) (gpointer)interp_entry_ ## type ## _0, (gpointer)interp_entry_ ## type ## _1, (gpointer)interp_entry_ ## type ## _2, (gpointer)interp_entry_ ## type ## _3, (gpointer)interp_entry_ ## type ## _4, (gpointer)interp_entry_ ## type ## _5, (gpointer)interp_entry_ ## type ## _6, (gpointer)interp_entry_ ## type ## _7, (gpointer)interp_entry_ ## type ## _8 - -static gpointer entry_funcs_static [MAX_INTERP_ENTRY_ARGS + 1] = { INTERP_ENTRY_FUNCLIST (static) }; -static gpointer entry_funcs_static_ret [MAX_INTERP_ENTRY_ARGS + 1] = { INTERP_ENTRY_FUNCLIST (static_ret) }; -static gpointer entry_funcs_instance [MAX_INTERP_ENTRY_ARGS + 1] = { INTERP_ENTRY_FUNCLIST (instance) }; -static gpointer entry_funcs_instance_ret [MAX_INTERP_ENTRY_ARGS + 1] = { INTERP_ENTRY_FUNCLIST (instance_ret) }; - -/* General version for methods with more than MAX_INTERP_ENTRY_ARGS arguments */ -static void -interp_entry_general (gpointer this_arg, gpointer res, gpointer *args, gpointer rmethod) -{ - INTERP_ENTRY_BASE ((InterpMethod*)rmethod, this_arg, res); - data.many_args = args; - interp_entry (&data); -} - -#ifdef MONO_ARCH_HAVE_INTERP_ENTRY_TRAMPOLINE - -// Do not inline in case order of frame addresses matters. -static MONO_NEVER_INLINE void -interp_entry_from_trampoline (gpointer ccontext_untyped, gpointer rmethod_untyped) -{ - ThreadContext *context; - stackval *sp; - MonoMethod *method; - MonoMethodSignature *sig; - CallContext *ccontext = (CallContext*) ccontext_untyped; - InterpMethod *rmethod = (InterpMethod*) rmethod_untyped; - gpointer orig_domain = NULL, attach_cookie; - int i; - - if (rmethod->needs_thread_attach) - orig_domain = mono_threads_attach_coop (mono_domain_get (), &attach_cookie); - - context = get_context (); - sp = (stackval*)context->stack_pointer; - - method = rmethod->method; - sig = mono_method_signature_internal (method); - if (method->string_ctor) { - MonoMethodSignature *newsig = (MonoMethodSignature*)g_alloca (MONO_SIZEOF_METHOD_SIGNATURE + ((sig->param_count + 2) * sizeof (MonoType*))); - memcpy (newsig, sig, mono_metadata_signature_size (sig)); - newsig->ret = m_class_get_byval_arg (mono_defaults.string_class); - sig = newsig; - } - - InterpFrame frame = {0}; - frame.imethod = rmethod; - frame.stack = sp; - frame.retval = sp; - - gpointer call_info = mono_arch_get_interp_native_call_info (NULL, sig); - - /* Copy the args saved in the trampoline to the frame stack */ - gpointer retp = mono_arch_get_native_call_context_args (ccontext, &frame, sig, call_info); - -#ifdef MONO_ARCH_HAVE_SWIFTCALL - int swift_error_arg_index = -1; - gpointer swift_error_data; - gpointer* swift_error_pointer; - if (mono_method_signature_has_ext_callconv (sig, MONO_EXT_CALLCONV_SWIFTCALL)) { - swift_error_data = mono_arch_get_swift_error (ccontext, sig, &swift_error_arg_index); - - int swift_error_offset = frame.imethod->swift_error_offset; - if (swift_error_offset >= 0) { - swift_error_pointer = (gpointer*)((guchar*)frame.stack + swift_error_offset); - *swift_error_pointer = *(gpointer*)swift_error_data; - } - } -#endif - - /* Allocate storage for value types */ - stackval *newsp = sp; - /* FIXME we should reuse computation on imethod for this */ - if (sig->hasthis) - newsp++; - for (i = 0; i < sig->param_count; i++) { - MonoType *type = sig->params [i]; - int size; - - if (type->type == MONO_TYPE_GENERICINST && !MONO_TYPE_IS_REFERENCE (type)) { - size = mono_class_value_size (mono_class_from_mono_type_internal (type), NULL); - } else if (type->type == MONO_TYPE_VALUETYPE) { - if (sig->pinvoke && !sig->marshalling_disabled) - size = mono_class_native_size (m_type_data_get_klass_unchecked (type), NULL); - else - size = mono_class_value_size (m_type_data_get_klass_unchecked (type), NULL); - } else { - size = MINT_STACK_SLOT_SIZE; - } -#ifdef MONO_ARCH_HAVE_SWIFTCALL - if (swift_error_arg_index >= 0 && swift_error_arg_index == i) - newsp->data.p = swift_error_pointer; -#endif - newsp = STACK_ADD_BYTES (newsp, size); - } - newsp = (stackval*)ALIGN_TO (newsp, MINT_STACK_ALIGNMENT); - context->stack_pointer = (guchar*)newsp; - g_assert (context->stack_pointer < context->stack_end); - - MONO_ENTER_GC_UNSAFE; - mono_interp_exec_method (&frame, context, NULL); - MONO_EXIT_GC_UNSAFE; - -#ifdef MONO_ARCH_HAVE_SWIFTCALL - if (swift_error_arg_index >= 0) - *(gpointer*)swift_error_data = *(gpointer*)swift_error_pointer; -#endif - - context->stack_pointer = (guchar*)sp; - g_assert (!context->has_resume_state); - - if (rmethod->needs_thread_attach) - mono_threads_detach_coop (orig_domain, &attach_cookie); - - if (need_native_unwind (context)) { - mono_llvm_start_native_unwind (); - return; - } - - /* Write back the return value */ - /* 'frame' is still valid */ - mono_arch_set_native_call_context_ret (ccontext, &frame, sig, call_info, retp); - - mono_arch_free_interp_native_call_info (call_info); -} - -#else - -static void -interp_entry_from_trampoline (gpointer ccontext_untyped, gpointer rmethod_untyped) -{ - g_assert_not_reached (); -} - -#endif /* MONO_ARCH_HAVE_INTERP_ENTRY_TRAMPOLINE */ - -static void -interp_entry_llvmonly (gpointer res, gpointer *args, gpointer imethod_untyped) -{ - InterpMethod *imethod = (InterpMethod*)imethod_untyped; - - if (imethod->hasthis) - interp_entry_general (*(gpointer*)(args [0]), res, args + 1, imethod); - else - interp_entry_general (NULL, res, args, imethod); -} - -static gpointer -interp_get_interp_method (MonoMethod *method) -{ - return mono_interp_get_imethod (method); -} - -static MonoJitInfo* -interp_compile_interp_method (MonoMethod *method, MonoError *error) -{ - InterpMethod *imethod = mono_interp_get_imethod (method); - - if (!imethod->transformed) { - mono_interp_transform_method (imethod, get_context (), error); - return_val_if_nok (error, NULL); - } - - return imethod->jinfo; -} - -#ifndef MONO_ARCH_HAVE_INTERP_NATIVE_TO_MANAGED -static void -interp_no_native_to_managed (void) -{ - g_error ("interpreter: native-to-managed transition not available on this platform"); -} -#endif - -static void -no_llvmonly_interp_method_pointer (void) -{ - g_assert_not_reached (); -} - -/* - * interp_create_method_pointer_llvmonly: - * - * Return an ftndesc for entering the interpreter and executing METHOD. - */ -static MonoFtnDesc* -interp_create_method_pointer_llvmonly (MonoMethod *method, gboolean unbox, MonoError *error) -{ - gpointer addr, entry_func = NULL, entry_wrapper; - MonoMethodSignature *sig; - MonoMethod *wrapper; - InterpMethod *imethod; - - imethod = mono_interp_get_imethod (method); - - if (unbox) { - if (imethod->llvmonly_unbox_entry) - return (MonoFtnDesc*)imethod->llvmonly_unbox_entry; - } else { - if (imethod->jit_entry) - return (MonoFtnDesc*)imethod->jit_entry; - } - - sig = mono_method_signature_internal (method); - - /* - * The entry functions need access to the method to call, so we have - * to use a ftndesc. The caller uses a normal signature, while the - * entry functions use a gsharedvt_in signature, so wrap the entry function in - * a gsharedvt_in_sig wrapper. - * We use a gsharedvt_in_sig wrapper instead of an interp_in wrapper, because they - * are mostly the same, and they are already generated. The exception is the - * wrappers for methods with more than 8 arguments, those are different. - */ - if (sig->param_count > MAX_INTERP_ENTRY_ARGS) - wrapper = mini_get_interp_in_wrapper (sig); - else - wrapper = mini_get_gsharedvt_in_sig_wrapper (sig); - - entry_wrapper = mono_jit_compile_method_jit_only (wrapper, error); - mono_error_assertf_ok (error, "couldn't compile wrapper \"%s\" for \"%s\"", - mono_method_get_name_full (wrapper, TRUE, TRUE, MONO_TYPE_NAME_FORMAT_IL), - mono_method_get_name_full (method, TRUE, TRUE, MONO_TYPE_NAME_FORMAT_IL)); - - if (sig->param_count > MAX_INTERP_ENTRY_ARGS) { - entry_func = (gpointer)interp_entry_general; - } else if (sig->hasthis) { - if (sig->ret->type == MONO_TYPE_VOID) - entry_func = entry_funcs_instance [sig->param_count]; - else - entry_func = entry_funcs_instance_ret [sig->param_count]; - } else { - if (sig->ret->type == MONO_TYPE_VOID) - entry_func = entry_funcs_static [sig->param_count]; - else - entry_func = entry_funcs_static_ret [sig->param_count]; - } - g_assert (entry_func); - -#if HOST_BROWSER - // FIXME: We don't support generating wasm trampolines for high arg counts yet - if ( - (sig->param_count <= MAX_INTERP_ENTRY_ARGS) && - mono_opt_jiterpreter_interp_entry_enabled - ) { - jiterp_preserve_module(); - - gpointer wasm_entry_func = mono_interp_jit_wasm_entry_trampoline ( - imethod, method, sig->param_count, (MonoType *)sig->params, - unbox, sig->hasthis, sig->ret->type != MONO_TYPE_VOID, - entry_func - ); - - // Compiling a trampoline can fail for various reasons, so in that case we will fall back to the pre-existing ones below - if (wasm_entry_func) - entry_func = wasm_entry_func; - } -#endif - - /* Encode unbox in the lower bit of imethod */ - gpointer entry_arg = imethod; - if (unbox) - entry_arg = (gpointer)(((gsize)entry_arg) | 1); - - MonoFtnDesc *entry_ftndesc = mini_llvmonly_create_ftndesc (method, entry_func, entry_arg); - - addr = mini_llvmonly_create_ftndesc (method, entry_wrapper, entry_ftndesc); - - mono_memory_barrier (); - if (unbox) - imethod->llvmonly_unbox_entry = addr; - else - imethod->jit_entry = addr; - - return (MonoFtnDesc*)addr; -} - -/* - * interp_create_method_pointer: - * - * Return a function pointer which can be used to call METHOD using the - * interpreter. Return NULL for methods which are not supported. - */ -static gpointer -interp_create_method_pointer (MonoMethod *method, gboolean compile, MonoError *error) -{ - gpointer addr, entry_func, entry_wrapper = NULL; - InterpMethod *imethod = mono_interp_get_imethod (method); - - if (imethod->jit_entry) - return imethod->jit_entry; - - if (compile && !imethod->transformed) { - /* Return any errors from method compilation */ - mono_interp_transform_method (imethod, get_context (), error); - return_val_if_nok (error, NULL); - } - - MonoMethodSignature *sig = mono_method_signature_internal (method); - if (method->string_ctor) { - MonoMethodSignature *newsig = (MonoMethodSignature*)g_alloca (MONO_SIZEOF_METHOD_SIGNATURE + ((sig->param_count + 2) * sizeof (MonoType*))); - memcpy (newsig, sig, mono_metadata_signature_size (sig)); - newsig->ret = m_class_get_byval_arg (mono_defaults.string_class); - sig = newsig; - } - - if (sig->param_count > MAX_INTERP_ENTRY_ARGS) { - entry_func = (gpointer)interp_entry_general; - } else if (sig->hasthis) { - if (sig->ret->type == MONO_TYPE_VOID) - entry_func = entry_funcs_instance [sig->param_count]; - else - entry_func = entry_funcs_instance_ret [sig->param_count]; - } else { - if (sig->ret->type == MONO_TYPE_VOID) - entry_func = entry_funcs_static [sig->param_count]; - else - entry_func = entry_funcs_static_ret [sig->param_count]; - } - -#ifndef MONO_ARCH_HAVE_INTERP_NATIVE_TO_MANAGED -#ifdef HOST_WASM - if (method->wrapper_type == MONO_WRAPPER_NATIVE_TO_MANAGED) { - WrapperInfo *info = mono_marshal_get_wrapper_info (method); - MonoMethod *orig_method = info->d.native_to_managed.method; - - /* - * These are called from native code. Ask the host app for a trampoline. - */ - MonoFtnDesc *ftndesc = g_new0 (MonoFtnDesc, 1); - ftndesc->addr = entry_func; - ftndesc->arg = imethod; - - addr = mono_wasm_get_native_to_interp_trampoline (orig_method, ftndesc); - if (addr) { - mono_memory_barrier (); - imethod->jit_entry = addr; - return addr; - } - - /* - * The runtime expects a function pointer unique to method and - * the native caller expects a function pointer with the - * right signature, so fail right away. - */ - char *s = mono_method_get_full_name (orig_method); - char *msg = g_strdup_printf ("No native to managed transition for method '%s', missing [UnmanagedCallersOnly] attribute.", s); - mono_error_set_platform_not_supported (error, msg); - g_free (s); - g_free (msg); - return NULL; - } -#endif - return (gpointer)interp_no_native_to_managed; -#endif - - if (mono_llvm_only) { - /* The caller should call interp_create_method_pointer_llvmonly */ - //g_assert_not_reached (); - return (gpointer)no_llvmonly_interp_method_pointer; - } - -#ifndef MONO_ARCH_HAVE_FTNPTR_ARG_TRAMPOLINE - /* - * Interp in wrappers get the argument in the rgctx register. If - * MONO_ARCH_HAVE_FTNPTR_ARG_TRAMPOLINE is defined it means that - * on that arch the rgctx register is not scratch, so we use a - * separate temp register. We should update the wrappers for this - * if we really care about those architectures (arm). - */ - - MonoMethod *wrapper = NULL; -#ifdef MONO_ARCH_HAVE_SWIFTCALL - /* Methods with Swift cconv should go to trampoline */ - if (!mono_method_signature_has_ext_callconv (sig, MONO_EXT_CALLCONV_SWIFTCALL)) -#endif - { - wrapper = mini_get_interp_in_wrapper (sig); - entry_wrapper = mono_jit_compile_method_jit_only (wrapper, error); - } -#endif - if (!entry_wrapper) { -#ifndef MONO_ARCH_HAVE_INTERP_ENTRY_TRAMPOLINE - g_assertion_message ("couldn't compile wrapper \"%s\" for \"%s\"", - mono_method_get_name_full (wrapper, TRUE, TRUE, MONO_TYPE_NAME_FORMAT_IL), - mono_method_get_name_full (method, TRUE, TRUE, MONO_TYPE_NAME_FORMAT_IL)); -#else - mono_interp_error_cleanup (error); - if (!mono_native_to_interp_trampoline) { - if (mono_aot_only) { - mono_native_to_interp_trampoline = (MonoFuncV)mono_aot_get_trampoline ("native_to_interp_trampoline"); - } else { - MonoTrampInfo *info; - mono_native_to_interp_trampoline = (MonoFuncV)mono_arch_get_native_to_interp_trampoline (&info); - mono_tramp_info_register (info, NULL); - } - } - entry_wrapper = (gpointer)mono_native_to_interp_trampoline; - /* We need the lmf wrapper only when being called from mixed mode */ - if (sig->pinvoke) - entry_func = (gpointer)interp_entry_from_trampoline; - else { - static gpointer cached_func = NULL; - if (!cached_func) { - cached_func = mono_jit_compile_method_jit_only (mini_get_interp_lmf_wrapper ("mono_interp_entry_from_trampoline", (gpointer) mono_interp_entry_from_trampoline), error); - mono_memory_barrier (); - } - entry_func = cached_func; - } -#endif - } - - g_assert (entry_func); - /* This is the argument passed to the interp_in wrapper by the static rgctx trampoline */ - MonoFtnDesc *ftndesc = g_new0 (MonoFtnDesc, 1); - ftndesc->addr = entry_func; - ftndesc->arg = imethod; - mono_error_assert_ok (error); - - /* - * The wrapper is called by compiled code, which doesn't pass the extra argument, so we pass it in the - * rgctx register using a trampoline. - */ - - addr = mono_create_ftnptr_arg_trampoline (ftndesc, entry_wrapper); - - mono_memory_barrier (); - imethod->jit_entry = addr; - - return addr; -} - -static void -interp_free_method (MonoMethod *method) -{ - MonoJitMemoryManager *jit_mm = jit_mm_for_method (method); - MonoDynamicMethod *dmethod = (MonoDynamicMethod*)method; - - jit_mm_lock (jit_mm); - -#if HOST_BROWSER - InterpMethod *imethod = (InterpMethod*)mono_internal_hash_table_lookup (&jit_mm->interp_code_hash, method); - mono_jiterp_free_method_data (method, imethod); -#endif - - mono_internal_hash_table_remove (&jit_mm->interp_code_hash, method); - jit_mm_unlock (jit_mm); - - if (dmethod->mp) { - mono_mempool_destroy (dmethod->mp); - dmethod->mp = NULL; - } -} - -#if COUNT_OPS -static long opcode_counts[MINT_LASTOP]; - -#define COUNT_OP(op) opcode_counts[op]++ -#else -#define COUNT_OP(op) -#endif - -#if DEBUG_INTERP -#define DUMP_INSTR() \ - if (tracing > 1) { \ - output_indent (); \ - char *mn = mono_method_full_name (frame->imethod->method, FALSE); \ - g_print ("(%p) %s -> IL_%04x: %-10s\n", mono_thread_internal_current (), mn, (gint32)(ip - frame->imethod->code), mono_interp_opname (*ip)); \ - g_free (mn); \ - } -#else -#define DUMP_INSTR() -#endif - -static MONO_NEVER_INLINE MonoException* -do_init_vtable (MonoVTable *vtable, MonoError *error, InterpFrame *frame, const guint16 *ip) -{ - MonoLMFExt ext; - MonoException *ex = NULL; - - /* - * When calling runtime functions we pass the ip of the instruction triggering the runtime call. - * Offset the subtraction from interp_frame_get_ip, so we don't end up in prev instruction. - */ - frame->state.ip = ip + 1; - - interp_push_lmf (&ext, frame); - mono_runtime_class_init_full (vtable, error); - if (!is_ok (error)) - ex = mono_error_convert_to_exception (error); - interp_pop_lmf (&ext); - return ex; -} - -#define INIT_VTABLE(vtable) do { \ - if (G_UNLIKELY (!(vtable)->initialized)) { \ - MonoException *__init_vtable_ex = do_init_vtable ((vtable), error, frame, ip); \ - if (G_UNLIKELY (__init_vtable_ex)) \ - THROW_EX (__init_vtable_ex, ip); \ - } \ - } while (0); - -static MonoObject* -mono_interp_new (MonoClass* klass) -{ - ERROR_DECL (error); - MonoObject* const object = mono_object_new_checked (klass, error); - mono_error_cleanup (error); // FIXME: do not swallow the error - return object; -} - -static gboolean -mono_interp_isinst (MonoObject* object, MonoClass* klass) -{ - ERROR_DECL (error); - gboolean isinst; - MonoClass *obj_class = mono_object_class (object); - mono_class_is_assignable_from_checked (klass, obj_class, &isinst, error); - mono_error_cleanup (error); // FIXME: do not swallow the error - return isinst; -} - -static MONO_NEVER_INLINE InterpMethod* -mono_interp_get_native_func_wrapper (InterpMethod* imethod, MonoMethodSignature* csignature, guchar* code) -{ - /* Pinvoke call is missing the wrapper. See mono_get_native_calli_wrapper */ - MonoMarshalSpec** mspecs = g_newa0 (MonoMarshalSpec*, csignature->param_count + 1); - - MonoMethodPInvoke iinfo; - memset (&iinfo, 0, sizeof (iinfo)); - - MonoMethod *method = imethod->method; - MonoImage *image = NULL; - if (imethod->method->dynamic) - image = ((MonoDynamicMethod*)method)->assembly->image; - else - image = m_class_get_image (method->klass); - MonoMethod* m = mono_marshal_get_native_func_wrapper (image, csignature, &iinfo, mspecs, code); - - for (int i = csignature->param_count; i >= 0; i--) - if (mspecs [i]) - mono_metadata_free_marshal_spec (mspecs [i]); - - InterpMethod *cmethod = mono_interp_get_imethod (m); - - return cmethod; -} - -// Do not inline in case order of frame addresses matters. -static MONO_NEVER_INLINE MonoException* -mono_interp_leave (InterpFrame* parent_frame) -{ - InterpFrame frame = {parent_frame}; - gboolean gc_transitions = FALSE; - stackval tmp_sp; - /* - * We need for mono_thread_get_undeniable_exception to be able to unwind - * to check the abort threshold. For this to work we use frame as a - * dummy frame that is stored in the lmf and serves as the transition frame - */ - - do_icall_wrapper (&frame, NULL, MINT_ICALLSIG_V_P, &tmp_sp, &tmp_sp, (gpointer)mono_thread_get_undeniable_exception, FALSE, &gc_transitions); - - return (MonoException*)tmp_sp.data.p; -} - -static gint32 -mono_interp_enum_hasflag (stackval *sp1, stackval *sp2, MonoClass* klass) -{ - guint64 a_val = 0, b_val = 0; - - stackval_to_data (m_class_get_byval_arg (klass), sp1, &a_val, FALSE); - stackval_to_data (m_class_get_byval_arg (klass), sp2, &b_val, FALSE); - return (a_val & b_val) == b_val; -} - -static void -interp_simd_create (gpointer dest, gpointer args, int el_size) -{ - const int num_elements = SIZEOF_V128 / el_size; - gint8 res_buffer [SIZEOF_V128]; - for (int i = 0; i < num_elements; i++) { - switch (el_size) { - case 1: res_buffer [i] = *(gint8*)args; break; - case 2: ((gint16*)res_buffer) [i] = *(gint16*)args; break; - case 4: ((gint32*)res_buffer) [i] = *(gint32*)args; break; - case 8: ((gint64*)res_buffer) [i] = *(gint64*)args; break; - default: - g_assert_not_reached (); - } - args = (gpointer) ((char*)args + MINT_STACK_SLOT_SIZE); - } - - memcpy (dest, res_buffer, SIZEOF_V128); -} - -// varargs in wasm consumes extra linear stack per call-site. -// These g_warning/g_error wrappers fix that. It is not the -// small wasm stack, but conserving it is still desirable. -static void -g_warning_d (const char *format, int d) -{ - g_warning (format, d); -} - -#if !USE_COMPUTED_GOTO -static void -interp_error_xsx (const char *format, int x1, const char *s, int x2) -{ - g_error (format, x1, s, x2); -} -#endif - -static MONO_ALWAYS_INLINE gboolean -method_entry (ThreadContext *context, InterpFrame *frame, -#if DEBUG_INTERP - int *out_tracing, -#endif - MonoException **out_ex) -{ - gboolean slow = FALSE; - -#if DEBUG_INTERP - debug_enter (frame, out_tracing); -#endif -#if PROFILE_INTERP - frame->imethod->calls++; -#endif - - *out_ex = NULL; - if (!G_UNLIKELY (frame->imethod->transformed)) { - slow = TRUE; - MonoException *ex = do_transform_method (frame->imethod, frame, context); - if (ex) { - *out_ex = ex; - /* - * Initialize the stack base pointer here, in the uncommon branch, so we don't - * need to check for it everytime when exitting a frame. - */ - frame->stack = (stackval*)context->stack_pointer; - return slow; - } - } else { - mono_memory_read_barrier (); - } - - return slow; -} - -/* Save the state of the interpreter main loop into FRAME */ -#define SAVE_INTERP_STATE(frame) do { \ - frame->state.ip = ip; \ - } while (0) - -/* Load and clear state from FRAME */ -#define LOAD_INTERP_STATE(frame) do { \ - ip = frame->state.ip; \ - locals = (unsigned char *)frame->stack; \ - frame->state.ip = NULL; \ - } while (0) - -/* Initialize interpreter state for executing FRAME */ -#define INIT_INTERP_STATE(frame, _clause_args) do { \ - ip = _clause_args ? ((FrameClauseArgs *)_clause_args)->start_with_ip : (frame)->imethod->code; \ - locals = (unsigned char *)(frame)->stack; \ - } while (0) - -#if PROFILE_INTERP -static long total_executed_opcodes; -#endif - -#define LOCAL_VAR(offset,type) (*(type*)(locals + (offset))) - -// The start of the stack has a reserved slot for a GC visible temp object pointer -#ifdef TARGET_WASM -#define SET_TEMP_POINTER(value) (*((volatile MonoObject * volatile *)context->stack_start) = value) -#else -#define SET_TEMP_POINTER(value) (*((MonoObject **)context->stack_start) = value) -#endif - -/* - * Custom C implementations of the min/max operations for float and double. - * We cannot directly use the C stdlib functions because their semantics do not match - * the C# methods in System.Math, but having interpreter opcodes for these operations - * improves performance for FP math a lot in some cases. - */ -static float -min_f (float lhs, float rhs) -{ - if (mono_isnan (lhs)) - return lhs; - else if (mono_isnan (rhs)) - return rhs; - else if (lhs == rhs) - return mono_signbit (lhs) ? lhs : rhs; - else - return fminf (lhs, rhs); -} - -static float -max_f (float lhs, float rhs) -{ - if (mono_isnan (lhs)) - return lhs; - else if (mono_isnan (rhs)) - return rhs; - else if (lhs == rhs) - return mono_signbit (rhs) ? lhs : rhs; - else - return fmaxf (lhs, rhs); -} - -static double -min_d (double lhs, double rhs) -{ - if (mono_isnan (lhs)) - return lhs; - else if (mono_isnan (rhs)) - return rhs; - else if (lhs == rhs) - return mono_signbit (lhs) ? lhs : rhs; - else - return fmin (lhs, rhs); -} - -static double -max_d (double lhs, double rhs) -{ - if (mono_isnan (lhs)) - return lhs; - else if (mono_isnan (rhs)) - return rhs; - else if (lhs == rhs) - return mono_signbit (rhs) ? lhs : rhs; - else - return fmax (lhs, rhs); -} - -// Equivalent of mono_get_addr_compiled_method -static gpointer -interp_ldvirtftn_delegate (gpointer arg, MonoDelegate *del) -{ - MonoMethod *virtual_method = del->method; - ERROR_DECL(error); - - MonoClass *klass = del->object.vtable->klass; - MonoMethod *invoke = mono_get_delegate_invoke_internal (klass); - MonoMethodSignature *invoke_sig = mono_method_signature_internal (invoke); - - MonoClass *arg_class = NULL; - if (m_type_is_byref (invoke_sig->params [0])) { - arg_class = mono_class_from_mono_type_internal (invoke_sig->params [0]); - } else { - MonoObject *object = (MonoObject*)arg; - arg_class = object->vtable->klass; - } - - MonoMethod *res = mono_class_get_virtual_method (arg_class, virtual_method, error); - mono_error_assert_ok (error); - - gboolean need_unbox = m_class_is_valuetype (res->klass) && !m_class_is_valuetype (virtual_method->klass); - - InterpMethod *imethod = mono_interp_get_imethod (res); - return imethod_to_ftnptr (imethod, need_unbox); -} - -static MONO_NEVER_INLINE void -mono_interp_trace_with_ctx (InterpFrame *frame, void (*trace_cb)(MonoMethod*,MonoJitInfo*,MonoProfilerCallContext*)) -{ - MonoProfilerCallContext prof_ctx; - MonoLMFExt ext; - memset (&prof_ctx, 0, sizeof (MonoProfilerCallContext)); - prof_ctx.interp_frame = frame; - prof_ctx.method = frame->imethod->method; - prof_ctx.return_value = frame->retval; - interp_push_lmf (&ext, frame); - trace_cb (frame->imethod->method, frame->imethod->jinfo, &prof_ctx); - interp_pop_lmf (&ext); -} - -static MONO_NEVER_INLINE void -mono_interp_profiler_raise_with_ctx (InterpFrame *frame, void (*prof_cb)(MonoMethod*,MonoProfilerCallContext*)) -{ - MonoProfilerCallContext prof_ctx; - MonoLMFExt ext; - memset (&prof_ctx, 0, sizeof (MonoProfilerCallContext)); - prof_ctx.interp_frame = frame; - prof_ctx.method = frame->imethod->method; - prof_ctx.return_value = frame->retval; - interp_push_lmf (&ext, frame); - prof_cb (frame->imethod->method, &prof_ctx); - interp_pop_lmf (&ext); -} - -static MONO_NEVER_INLINE void -mono_interp_profiler_raise (InterpFrame *frame, void (*prof_cb)(MonoMethod*,MonoProfilerCallContext*)) -{ - MonoLMFExt ext; - interp_push_lmf (&ext, frame); - prof_cb (frame->imethod->method, NULL); - interp_pop_lmf (&ext); -} - -static MONO_NEVER_INLINE void -mono_interp_profiler_raise_tail_call (InterpFrame *frame, MonoMethod *new_method) -{ - MonoLMFExt ext; - interp_push_lmf (&ext, frame); - mono_profiler_raise_method_tail_call (frame->imethod->method, new_method); - interp_pop_lmf (&ext); -} - -#define INTERP_PROFILER_RAISE(name_lower, name_upper) \ - if ((flag & TRACING_FLAG) || ((flag & PROFILING_FLAG) && MONO_PROFILER_ENABLED (method_ ## name_lower) && \ - (frame->imethod->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_ ## name_upper ## _CONTEXT ))) { \ - if (flag & TRACING_FLAG) \ - mono_interp_trace_with_ctx (frame, mono_trace_ ## name_lower ## _method); \ - if (flag & PROFILING_FLAG) \ - mono_interp_profiler_raise_with_ctx (frame, mono_profiler_raise_method_ ## name_lower); \ - } else if ((flag & PROFILING_FLAG) && MONO_PROFILER_ENABLED (method_ ## name_lower)) { \ - mono_interp_profiler_raise (frame, mono_profiler_raise_method_ ## name_lower); \ - } - - -/* - * If CLAUSE_ARGS is non-null, start executing from it. - * The ERROR argument is used to avoid declaring an error object for every interp frame, its not used - * to return error information. - * FRAME is only valid until the next call to alloc_frame (). - */ -static MONO_NEVER_INLINE void -mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClauseArgs *clause_args) -{ - InterpMethod *cmethod; - ERROR_DECL(error); - - /* Interpreter main loop state (InterpState) */ - const guint16 *ip = NULL; - unsigned char *locals = NULL; - int call_args_offset; - int return_offset; - gboolean gc_transitions = FALSE; - -#if DEBUG_INTERP - int tracing = global_tracing; -#endif -#if USE_COMPUTED_GOTO - static void * const in_labels[] = { -#define OPDEF(a,b,c,d,e,f) &&LAB_ ## a, -#define IROPDEF(a,b,c,d,e,f) -#include "mintops.def" - }; -#endif - - /* - * GC SAFETY: - * - * The interpreter executes in gc unsafe (non-preempt) mode. On wasm, we cannot rely on - * scanning the stack or any registers. In order to make the code GC safe, every objref - * handled by the code needs to be kept alive and pinned in any of the following ways: - * - the object needs to be stored on the interpreter stack. In order to make sure the - * object actually gets stored on the interp stack and the store is not optimized out, - * the store/variable should be volatile. - * - if the execution of an opcode requires an object not coming from interp stack to be - * kept alive, the tmp_handle below can be used. This handle will keep only one object - * pinned by the GC. Ideally, once this object is no longer needed, the handle should be - * cleared. If we will need to have more objects pinned simultaneously, additional handles - * can be reserved here. - */ - MonoException *method_entry_ex; - if (method_entry (context, frame, -#if DEBUG_INTERP - &tracing, -#endif - &method_entry_ex)) { - if (method_entry_ex) - THROW_EX (method_entry_ex, NULL); - EXCEPTION_CHECKPOINT; - CHECK_RESUME_STATE (context); - } - - if (!clause_args) { - context->stack_pointer = (guchar*)frame->stack + frame->imethod->alloca_size; - g_assert (context->stack_pointer < context->stack_end); - /* Make sure the stack pointer is bumped before we store any references on the stack */ - mono_compiler_barrier (); - } - - INIT_INTERP_STATE (frame, clause_args); - - if (clause_args && clause_args->run_until_end) - /* - * Called from run_with_il_state to run the method until the end. - * Clear this out so it doesn't confuse the rest of the code. - */ - clause_args = NULL; - -#ifdef ENABLE_EXPERIMENT_TIERED - mini_tiered_inc (frame->imethod->method, &frame->imethod->tiered_counter, 0); -#endif - //g_print ("(%p) Call %s\n", mono_thread_internal_current (), mono_method_get_full_name (frame->imethod->method)); - -#if defined(ENABLE_HYBRID_SUSPEND) || defined(ENABLE_COOP_SUSPEND) - mono_threads_safepoint (); -#endif -main_loop: - /* - * using while (ip < end) may result in a 15% performance drop, - * but it may be useful for debug - */ - while (1) { -#if PROFILE_INTERP - frame->imethod->opcounts++; - total_executed_opcodes++; -#endif - MintOpcode opcode; - DUMP_INSTR(); - MINT_IN_SWITCH (*ip) { - MINT_IN_CASE(MINT_INITLOCAL) - MINT_IN_CASE(MINT_INITLOCALS) - memset (locals + ip [1], 0, ip [2]); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_NIY) - g_printf ("MONO interpreter: NIY encountered in method %s\n", mono_method_full_name (frame->imethod->method, TRUE)); - g_assert_not_reached (); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BREAK) - ++ip; - SAVE_INTERP_STATE (frame); - do_debugger_tramp (mono_component_debugger ()->user_break, frame); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BREAKPOINT) - ++ip; - mono_break (); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_INIT_ARGLIST) { - const guint16 *call_ip = frame->parent->state.ip - 6; - g_assert_checked (*call_ip == MINT_CALL_VARARG); - int params_stack_size = call_ip [5]; - MonoMethodSignature *sig = (MonoMethodSignature*)frame->parent->imethod->data_items [call_ip [4]]; - - // we are being overly conservative with the size here, for simplicity - gpointer arglist = frame_data_allocator_alloc (&context->data_stack, frame, params_stack_size + MINT_STACK_SLOT_SIZE); - - init_arglist (frame, sig, STACK_ADD_BYTES (frame->stack, ip [2]), (char*)arglist); - - // save the arglist for future access with MINT_ARGLIST - LOCAL_VAR (ip [1], gpointer) = arglist; - - ip += 3; - MINT_IN_BREAK; - } - - MINT_IN_CASE(MINT_LDC_I4_0) - LOCAL_VAR (ip [1], gint32) = 0; - ip += 2; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDC_I4_1) - LOCAL_VAR (ip [1], gint32) = 1; - ip += 2; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDC_I4_S) - LOCAL_VAR (ip [1], gint32) = (short)ip [2]; - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDC_I4) - LOCAL_VAR (ip [1], gint32) = READ32 (ip + 2); - ip += 4; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDC_I8_0) - LOCAL_VAR (ip [1], gint64) = 0; - ip += 2; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDC_I8) - LOCAL_VAR (ip [1], gint64) = READ64 (ip + 2); - ip += 6; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDC_I8_S) - LOCAL_VAR (ip [1], gint64) = (short)ip [2]; - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDC_R4) { - LOCAL_VAR (ip [1], gint32) = READ32(ip + 2); /* not union usage */ - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_LDC_R8) - LOCAL_VAR (ip [1], gint64) = READ64 (ip + 2); /* note union usage */ - ip += 6; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_TAILCALL) - MINT_IN_CASE(MINT_TAILCALL_VIRT) - MINT_IN_CASE(MINT_JMP) { - gboolean is_tailcall = *ip != MINT_JMP; - InterpMethod *new_method; - - if (is_tailcall) { - guint16 params_offset = ip [1]; - guint16 params_size = ip [3]; - - new_method = (InterpMethod*)frame->imethod->data_items [ip [2]]; - - if (*ip == MINT_TAILCALL_VIRT) { - gint16 slot = (gint16)ip [4]; - MonoObject **this_arg_p = (MonoObject **)((guchar*)frame->stack + params_offset); - MonoObject *this_arg = *this_arg_p; - new_method = get_virtual_method_fast (new_method, this_arg->vtable, slot); - if (m_class_is_valuetype (this_arg->vtable->klass) && m_class_is_valuetype (new_method->method->klass)) { - /* unbox */ - gpointer unboxed = mono_object_unbox_internal (this_arg); - *this_arg_p = unboxed; - } - - InterpMethodCodeType code_type = new_method->code_type; - - g_assert (code_type == IMETHOD_CODE_UNKNOWN || - code_type == IMETHOD_CODE_INTERP || - code_type == IMETHOD_CODE_COMPILED); - - if (G_UNLIKELY (code_type == IMETHOD_CODE_UNKNOWN)) { - // FIXME push/pop LMF - MonoMethodSignature *sig = mono_method_signature_internal (new_method->method); - if (mono_interp_jit_call_supported (new_method->method, sig)) - code_type = IMETHOD_CODE_COMPILED; - else - code_type = IMETHOD_CODE_INTERP; - new_method->code_type = code_type; - } - - if (code_type == IMETHOD_CODE_COMPILED) { - error_init_reuse (error); - do_jit_call (context, frame->retval, (stackval*)((guchar*)frame->stack + params_offset), frame, new_method, error); - if (!is_ok (error)) { - MonoException *call_ex = interp_error_convert_to_exception (frame, error, ip); - THROW_EX (call_ex, ip); - } - - goto exit_frame; - } - } - - // Copy the params to their location at the start of the frame - memmove (frame->stack, (guchar*)frame->stack + params_offset, params_size); - } else { - new_method = (InterpMethod*)frame->imethod->data_items [ip [1]]; - } - - if (frame->imethod->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_TAIL_CALL) - if (MONO_PROFILER_ENABLED (method_tail_call)) - mono_interp_profiler_raise_tail_call (frame, new_method->method); - - if (!new_method->transformed) { - MonoException *transform_ex = do_transform_method (new_method, frame, context); - if (transform_ex) - THROW_EX (transform_ex, ip); - EXCEPTION_CHECKPOINT; - } - /* - * It's possible for the caller stack frame to be smaller - * than the callee stack frame (at the interp level) - */ - context->stack_pointer = (guchar*)frame->stack + new_method->alloca_size; - if (G_UNLIKELY (context->stack_pointer >= context->stack_end)) { - context->stack_end = context->stack_real_end; - THROW_EX (mono_domain_get ()->stack_overflow_ex, ip); - } - - frame->imethod = new_method; - ip = frame->imethod->code; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_MOV_STACK_UNOPT) { - int src_offset = ip [1]; - int dst_offset = src_offset + (gint16)ip [2]; - int size = ip [3]; - - memmove (locals + dst_offset, locals + src_offset, size); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CALL_DELEGATE) { - return_offset = ip [1]; - call_args_offset = ip [2]; - MonoDelegate *del = LOCAL_VAR (call_args_offset, MonoDelegate*); - gboolean is_multicast = del->method == NULL; - InterpMethod *del_imethod = (InterpMethod*)del->interp_invoke_impl; - - if (!del_imethod) { - // FIXME push/pop LMF - if (is_multicast) { - MonoMethod *invoke = mono_get_delegate_invoke_internal (del->object.vtable->klass); - del_imethod = mono_interp_get_imethod (mono_marshal_get_delegate_invoke (invoke, del)); - del->interp_invoke_impl = del_imethod; - } else if (!del->interp_method) { - // Not created from interpreted code - g_assert (del->method); - del_imethod = mono_interp_get_imethod (del->method); - if (del->target && m_method_is_virtual (del->method)) - del_imethod = get_virtual_method (del_imethod, del->target->vtable); - del->interp_method = del_imethod; - del->interp_invoke_impl = del_imethod; - } else { - del_imethod = (InterpMethod*)del->interp_method; - if (del_imethod->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) { - del_imethod = mono_interp_get_imethod (mono_marshal_get_native_wrapper (del_imethod->method, FALSE, FALSE)); - del->interp_invoke_impl = del_imethod; - } else if ((m_method_is_virtual (del_imethod->method) && !m_method_is_static (del_imethod->method)) && !del->target && !m_class_is_valuetype (del_imethod->method->klass)) { - // 'this' is passed dynamically, we need to recompute the target method - // with each call - MonoObject *obj = LOCAL_VAR (call_args_offset + MINT_STACK_SLOT_SIZE, MonoObject*); - del_imethod = get_virtual_method (del_imethod, obj->vtable); - if (m_class_is_valuetype (del_imethod->method->klass)) { - // We are calling into a value type method, `this` needs to be unboxed - LOCAL_VAR (call_args_offset + MINT_STACK_SLOT_SIZE, gpointer) = mono_object_unbox_internal (obj); - } - } else { - del->interp_invoke_impl = del_imethod; - } - } - } - if (del_imethod->optimized_imethod) { - del_imethod = del_imethod->optimized_imethod; - // don't patch for virtual calls - if (del->interp_invoke_impl) - del->interp_invoke_impl = del_imethod; - } - cmethod = del_imethod; - if (!is_multicast) { - int ref_slot_offset = frame->imethod->ref_slot_offset; - if (ref_slot_offset >= 0) - LOCAL_VAR (ref_slot_offset, gpointer) = del; - int param_count = ip [4]; - if (cmethod->param_count == param_count + 1) { - // Target method is static but the delegate has a target object. We handle - // this separately from the case below, because, for these calls, the instance - // is allowed to be null. - LOCAL_VAR (call_args_offset, MonoObject*) = del->target; - } else if (del->target) { - MonoObject *this_arg = del->target; - - // replace the MonoDelegate* on the stack with 'this' pointer - if (m_class_is_valuetype (cmethod->method->klass)) { - gpointer unboxed = mono_object_unbox_internal (this_arg); - LOCAL_VAR (call_args_offset, gpointer) = unboxed; - } else { - LOCAL_VAR (call_args_offset, MonoObject*) = this_arg; - } - } else { - // skip the delegate pointer for static calls - // FIXME we could avoid memmove - memmove (locals + call_args_offset, locals + call_args_offset + ip [5], ip [3]); - } - } - ip += 6; - - goto jit_call; - } - MINT_IN_CASE(MINT_CALLI) { - gboolean need_unbox; - - /* In mixed mode, stay in the interpreter for simplicity even if there is an AOT version of the callee */ - cmethod = ftnptr_to_imethod (LOCAL_VAR (ip [2], gpointer), &need_unbox); - - if (cmethod->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) { - // FIXME push/pop LMF - cmethod = mono_interp_get_imethod (mono_marshal_get_native_wrapper (cmethod->method, FALSE, FALSE)); - } - - return_offset = ip [1]; - call_args_offset = ip [3]; - - if (need_unbox) { - MonoObject *this_arg = LOCAL_VAR (call_args_offset, MonoObject*); - LOCAL_VAR (call_args_offset, gpointer) = mono_object_unbox_internal (this_arg); - } - ip += 4; - - goto jit_call; - } - MINT_IN_CASE(MINT_CALLI_NAT_FAST) { - MintICallSig icall_sig = (MintICallSig)ip [4]; - MonoMethodSignature *csignature = (MonoMethodSignature*)frame->imethod->data_items [ip [5]]; - gboolean save_last_error = ip [6]; - - stackval *ret = (stackval*)(locals + ip [1]); - gpointer target_ip = LOCAL_VAR (ip [2], gpointer); - stackval *args = (stackval*)(locals + ip [3]); - /* for calls, have ip pointing at the start of next instruction */ - frame->state.ip = ip + 7; - - do_icall_wrapper (frame, csignature, icall_sig, ret, args, target_ip, save_last_error, &gc_transitions); - EXCEPTION_CHECKPOINT; - CHECK_RESUME_STATE (context); - ip += 7; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CALLI_NAT_DYNAMIC) { - MonoMethodSignature* csignature = (MonoMethodSignature*)frame->imethod->data_items [ip [4]]; - - return_offset = ip [1]; - guchar* code = LOCAL_VAR (ip [2], guchar*); - call_args_offset = ip [3]; - - // FIXME push/pop LMF - cmethod = mono_interp_get_native_func_wrapper (frame->imethod, csignature, code); - - ip += 5; - goto jit_call; - } - MINT_IN_CASE(MINT_CALLI_NAT) { - MonoMethodSignature *csignature = (MonoMethodSignature*)frame->imethod->data_items [ip [4]]; - InterpMethod *imethod = (InterpMethod*)frame->imethod->data_items [ip [5]]; - - guchar *code = LOCAL_VAR (ip [2], guchar*); - - gboolean save_last_error = ip [6]; - gpointer *cache = (gpointer*)&frame->imethod->data_items [ip [7]]; - /* for calls, have ip pointing at the start of next instruction */ - frame->state.ip = ip + 8; - ves_pinvoke_method (imethod, csignature, (MonoFuncV)code, context, frame, (stackval*)(locals + ip [1]), (stackval*)(locals + ip [3]), save_last_error, cache, &gc_transitions); - EXCEPTION_CHECKPOINT; - CHECK_RESUME_STATE (context); - - ip += 8; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CALLVIRT_FAST) { - MonoObject *this_arg; - int slot; - - cmethod = (InterpMethod*)frame->imethod->data_items [ip [3]]; - return_offset = ip [1]; - call_args_offset = ip [2]; - - this_arg = LOCAL_VAR (call_args_offset, MonoObject*); - NULL_CHECK (this_arg); - - slot = (gint16)ip [4]; - ip += 5; - // FIXME push/pop LMF - cmethod = get_virtual_method_fast (cmethod, this_arg->vtable, slot); - if (m_class_is_valuetype (cmethod->method->klass)) { - /* unbox */ - gpointer unboxed = mono_object_unbox_internal (this_arg); - LOCAL_VAR (call_args_offset, gpointer) = unboxed; - } - -jit_call: - { - InterpMethodCodeType code_type = cmethod->code_type; - - g_assert (code_type == IMETHOD_CODE_UNKNOWN || - code_type == IMETHOD_CODE_INTERP || - code_type == IMETHOD_CODE_COMPILED); - - if (G_UNLIKELY (code_type == IMETHOD_CODE_UNKNOWN)) { - // FIXME push/pop LMF - MonoMethodSignature *sig = mono_method_signature_internal (cmethod->method); - if (mono_interp_jit_call_supported (cmethod->method, sig)) - code_type = IMETHOD_CODE_COMPILED; - else - code_type = IMETHOD_CODE_INTERP; - cmethod->code_type = code_type; - } - - if (code_type == IMETHOD_CODE_INTERP) { - - goto interp_call; - - } else if (code_type == IMETHOD_CODE_COMPILED) { - frame->state.ip = ip; - error_init_reuse (error); - do_jit_call (context, (stackval*)(locals + return_offset), (stackval*)(locals + call_args_offset), frame, cmethod, error); - if (!is_ok (error)) { - MonoException *call_ex = interp_error_convert_to_exception (frame, error, ip); - THROW_EX (call_ex, ip); - } - - CHECK_RESUME_STATE (context); - } - MINT_IN_BREAK; - } - } - MINT_IN_CASE(MINT_CALL_VARARG) { - // Same as MINT_CALL, except at ip [4] we have the index for the csignature, - // which is required by the called method to set up the arglist. - cmethod = (InterpMethod*)frame->imethod->data_items [ip [3]]; - return_offset = ip [1]; - call_args_offset = ip [2]; - ip += 6; - goto jit_call; - } - - MINT_IN_CASE(MINT_CALL) { - cmethod = (InterpMethod*)frame->imethod->data_items [ip [3]]; - return_offset = ip [1]; - call_args_offset = ip [2]; - -#ifdef ENABLE_EXPERIMENT_TIERED - ip += 5; -#else - ip += 4; -#endif - -interp_call: - /* - * Make a non-recursive call by loading the new interpreter state based on child frame, - * and going back to the main loop. - */ - SAVE_INTERP_STATE (frame); - - // Allocate child frame. - // FIXME: Add stack overflow checks - { - InterpFrame *child_frame = frame->next_free; - if (!child_frame) { - child_frame = g_newa0 (InterpFrame, 1); - // Not free currently, but will be when allocation attempted. - frame->next_free = child_frame; - } - reinit_frame (child_frame, frame, cmethod, locals + return_offset, locals + call_args_offset); - frame = child_frame; - } - g_assert_checked (((gsize)frame->stack % MINT_STACK_ALIGNMENT) == 0); - - MonoException *call_ex; - if (method_entry (context, frame, -#if DEBUG_INTERP - &tracing, -#endif - &call_ex)) { - if (call_ex) - THROW_EX (call_ex, NULL); - EXCEPTION_CHECKPOINT; - CHECK_RESUME_STATE (context); - } - - context->stack_pointer = (guchar*)frame->stack + cmethod->alloca_size; - - if (G_UNLIKELY (context->stack_pointer >= context->stack_end)) { - context->stack_end = context->stack_real_end; - THROW_EX (mono_domain_get ()->stack_overflow_ex, ip); - } - - /* Make sure the stack pointer is bumped before we store any references on the stack */ - mono_compiler_barrier (); - - INIT_INTERP_STATE (frame, NULL); - - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_JIT_CALL) { - InterpMethod *rmethod = (InterpMethod*)frame->imethod->data_items [ip [3]]; - error_init_reuse (error); - /* for calls, have ip pointing at the start of next instruction */ - frame->state.ip = ip + 4; - do_jit_call (context, (stackval*)(locals + ip [1]), (stackval*)(locals + ip [2]), frame, rmethod, error); - if (!is_ok (error)) { - MonoException *call_ex = interp_error_convert_to_exception (frame, error, ip); - THROW_EX (call_ex, ip); - } - - CHECK_RESUME_STATE (context); - ip += 4; - - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_JIT_CALL2) { -#ifdef ENABLE_EXPERIMENT_TIERED - InterpMethod *rmethod = (InterpMethod *) READ64 (ip + 2); - - error_init_reuse (error); - - frame->state.ip = ip + 6; - do_jit_call (context, (stackval*)(locals + ip [1]), frame, rmethod, error); - if (!is_ok (error)) { - MonoException *call_ex = interp_error_convert_to_exception (frame, error); - THROW_EX (call_ex, ip); - } - - CHECK_RESUME_STATE (context); - - ip += 6; -#else - g_error ("MINT_JIT_ICALL2 shouldn't be used"); -#endif - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_RET) - frame->retval [0] = LOCAL_VAR (ip [1], stackval); - goto exit_frame; - MINT_IN_CASE(MINT_RET_I1) - frame->retval [0].data.i = (gint8) LOCAL_VAR (ip [1], gint32); - goto exit_frame; - MINT_IN_CASE(MINT_RET_U1) - frame->retval [0].data.i = (guint8) LOCAL_VAR (ip [1], gint32); - goto exit_frame; - MINT_IN_CASE(MINT_RET_I2) - frame->retval [0].data.i = (gint16) LOCAL_VAR (ip [1], gint32); - goto exit_frame; - MINT_IN_CASE(MINT_RET_U2) - frame->retval [0].data.i = (guint16) LOCAL_VAR (ip [1], gint32); - goto exit_frame; - MINT_IN_CASE(MINT_RET_I4_IMM) - frame->retval [0].data.i = (gint16)ip [1]; - goto exit_frame; - MINT_IN_CASE(MINT_RET_I8_IMM) - frame->retval [0].data.l = (gint16)ip [1]; - goto exit_frame; - MINT_IN_CASE(MINT_RET_VOID) - goto exit_frame; - MINT_IN_CASE(MINT_RET_VT) { - memmove (frame->retval, locals + ip [1], ip [2]); - goto exit_frame; - } - MINT_IN_CASE(MINT_RET_LOCALLOC) - frame->retval [0] = LOCAL_VAR (ip [1], stackval); - frame_data_allocator_pop (&context->data_stack, frame); - goto exit_frame; - MINT_IN_CASE(MINT_RET_VOID_LOCALLOC) - frame_data_allocator_pop (&context->data_stack, frame); - goto exit_frame; - MINT_IN_CASE(MINT_RET_VT_LOCALLOC) { - memmove (frame->retval, locals + ip [1], ip [2]); - frame_data_allocator_pop (&context->data_stack, frame); - goto exit_frame; - } - -#ifdef ENABLE_EXPERIMENT_TIERED -#define BACK_BRANCH_PROFILE(offset) do { \ - if (offset < 0) \ - mini_tiered_inc (frame->imethod->method, &frame->imethod->tiered_counter, 0); \ - } while (0); -#else -#define BACK_BRANCH_PROFILE(offset) -#endif - - MINT_IN_CASE(MINT_BR_S) { - short br_offset = (short) *(ip + 1); - BACK_BRANCH_PROFILE (br_offset); - ip += br_offset; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BR) { - gint32 br_offset = (gint32) READ32(ip + 1); - BACK_BRANCH_PROFILE (br_offset); - ip += br_offset; - MINT_IN_BREAK; - } - -#define ZEROP_S(datatype, op) \ - if (LOCAL_VAR (ip [1], datatype) op 0) { \ - gint16 br_offset = (gint16) ip [2]; \ - BACK_BRANCH_PROFILE (br_offset); \ - ip += br_offset; \ - } else \ - ip += 3; - -#define ZEROP(datatype, op) \ - if (LOCAL_VAR (ip [1], datatype) op 0) { \ - gint32 br_offset = (gint32)READ32(ip + 2); \ - BACK_BRANCH_PROFILE (br_offset); \ - ip += br_offset; \ - } else \ - ip += 4; - - MINT_IN_CASE(MINT_BRFALSE_I4_S) - ZEROP_S(gint32, ==); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BRFALSE_I8_S) - ZEROP_S(gint64, ==); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BRFALSE_I4) - ZEROP(gint32, ==); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BRFALSE_I8) - ZEROP(gint64, ==); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BRTRUE_I4_S) - ZEROP_S(gint32, !=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BRTRUE_I8_S) - ZEROP_S(gint64, !=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BRTRUE_I4) - ZEROP(gint32, !=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BRTRUE_I8) - ZEROP(gint64, !=); - MINT_IN_BREAK; -#define CONDBR_S(cond) \ - if (cond) { \ - gint16 br_offset = (gint16) ip [3]; \ - BACK_BRANCH_PROFILE (br_offset); \ - ip += br_offset; \ - } else \ - ip += 4; -#define BRELOP_S(datatype, op) \ - CONDBR_S(LOCAL_VAR (ip [1], datatype) op LOCAL_VAR (ip [2], datatype)) - -#define CONDBR(cond) \ - if (cond) { \ - gint32 br_offset = (gint32) READ32 (ip + 3); \ - BACK_BRANCH_PROFILE (br_offset); \ - ip += br_offset; \ - } else \ - ip += 5; - -#define BRELOP(datatype, op) \ - CONDBR(LOCAL_VAR (ip [1], datatype) op LOCAL_VAR (ip [2], datatype)) - - MINT_IN_CASE(MINT_BEQ_I4_S) - BRELOP_S(gint32, ==) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BEQ_I8_S) - BRELOP_S(gint64, ==) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BEQ_R4_S) { - float f1 = LOCAL_VAR (ip [1], float); - float f2 = LOCAL_VAR (ip [2], float); - CONDBR_S(!isunordered (f1, f2) && f1 == f2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BEQ_R8_S) { - double d1 = LOCAL_VAR (ip [1], double); - double d2 = LOCAL_VAR (ip [2], double); - CONDBR_S(!mono_isunordered (d1, d2) && d1 == d2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BEQ_I4) - BRELOP(gint32, ==) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BEQ_I8) - BRELOP(gint64, ==) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BEQ_R4) { - float f1 = LOCAL_VAR (ip [1], float); - float f2 = LOCAL_VAR (ip [2], float); - CONDBR(!isunordered (f1, f2) && f1 == f2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BEQ_R8) { - double d1 = LOCAL_VAR (ip [1], double); - double d2 = LOCAL_VAR (ip [2], double); - CONDBR(!mono_isunordered (d1, d2) && d1 == d2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BGE_I4_S) - BRELOP_S(gint32, >=) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGE_I8_S) - BRELOP_S(gint64, >=) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGE_R4_S) { - float f1 = LOCAL_VAR (ip [1], float); - float f2 = LOCAL_VAR (ip [2], float); - CONDBR_S(!isunordered (f1, f2) && f1 >= f2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BGE_R8_S) { - double d1 = LOCAL_VAR (ip [1], double); - double d2 = LOCAL_VAR (ip [2], double); - CONDBR_S(!mono_isunordered (d1, d2) && d1 >= d2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BGE_I4) - BRELOP(gint32, >=) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGE_I8) - BRELOP(gint64, >=) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGE_R4) { - float f1 = LOCAL_VAR (ip [1], float); - float f2 = LOCAL_VAR (ip [2], float); - CONDBR(!isunordered (f1, f2) && f1 >= f2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BGE_R8) { - double d1 = LOCAL_VAR (ip [1], double); - double d2 = LOCAL_VAR (ip [2], double); - CONDBR(!mono_isunordered (d1, d2) && d1 >= d2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BGT_I4_S) - BRELOP_S(gint32, >) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGT_I8_S) - BRELOP_S(gint64, >) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGT_R4_S) { - float f1 = LOCAL_VAR (ip [1], float); - float f2 = LOCAL_VAR (ip [2], float); - CONDBR_S(!isunordered (f1, f2) && f1 > f2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BGT_R8_S) { - double d1 = LOCAL_VAR (ip [1], double); - double d2 = LOCAL_VAR (ip [2], double); - CONDBR_S(!mono_isunordered (d1, d2) && d1 > d2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BGT_I4) - BRELOP(gint32, >) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGT_I8) - BRELOP(gint64, >) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGT_R4) { - float f1 = LOCAL_VAR (ip [1], float); - float f2 = LOCAL_VAR (ip [2], float); - CONDBR(!isunordered (f1, f2) && f1 > f2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BGT_R8) { - double d1 = LOCAL_VAR (ip [1], double); - double d2 = LOCAL_VAR (ip [2], double); - CONDBR(!mono_isunordered (d1, d2) && d1 > d2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BLT_I4_S) - BRELOP_S(gint32, <) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLT_I8_S) - BRELOP_S(gint64, <) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLT_R4_S) { - float f1 = LOCAL_VAR (ip [1], float); - float f2 = LOCAL_VAR (ip [2], float); - CONDBR_S(!isunordered (f1, f2) && f1 < f2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BLT_R8_S) { - double d1 = LOCAL_VAR (ip [1], double); - double d2 = LOCAL_VAR (ip [2], double); - CONDBR_S(!mono_isunordered (d1, d2) && d1 < d2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BLT_I4) - BRELOP(gint32, <) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLT_I8) - BRELOP(gint64, <) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLT_R4) { - float f1 = LOCAL_VAR (ip [1], float); - float f2 = LOCAL_VAR (ip [2], float); - CONDBR(!isunordered (f1, f2) && f1 < f2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BLT_R8) { - double d1 = LOCAL_VAR (ip [1], double); - double d2 = LOCAL_VAR (ip [2], double); - CONDBR(!mono_isunordered (d1, d2) && d1 < d2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BLE_I4_S) - BRELOP_S(gint32, <=) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLE_I8_S) - BRELOP_S(gint64, <=) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLE_R4_S) { - float f1 = LOCAL_VAR (ip [1], float); - float f2 = LOCAL_VAR (ip [2], float); - CONDBR_S(!isunordered (f1, f2) && f1 <= f2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BLE_R8_S) { - double d1 = LOCAL_VAR (ip [1], double); - double d2 = LOCAL_VAR (ip [2], double); - CONDBR_S(!mono_isunordered (d1, d2) && d1 <= d2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BLE_I4) - BRELOP(gint32, <=) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLE_I8) - BRELOP(gint64, <=) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLE_R4) { - float f1 = LOCAL_VAR (ip [1], float); - float f2 = LOCAL_VAR (ip [2], float); - CONDBR(!isunordered (f1, f2) && f1 <= f2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BLE_R8) { - double d1 = LOCAL_VAR (ip [1], double); - double d2 = LOCAL_VAR (ip [2], double); - CONDBR(!mono_isunordered (d1, d2) && d1 <= d2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BNE_UN_I4_S) - BRELOP_S(gint32, !=) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BNE_UN_I8_S) - BRELOP_S(gint64, !=) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BNE_UN_R4_S) { - float f1 = LOCAL_VAR (ip [1], float); - float f2 = LOCAL_VAR (ip [2], float); - CONDBR_S(isunordered (f1, f2) || f1 != f2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BNE_UN_R8_S) { - double d1 = LOCAL_VAR (ip [1], double); - double d2 = LOCAL_VAR (ip [2], double); - CONDBR_S(mono_isunordered (d1, d2) || d1 != d2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BNE_UN_I4) - BRELOP(gint32, !=) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BNE_UN_I8) - BRELOP(gint64, !=) - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BNE_UN_R4) { - float f1 = LOCAL_VAR (ip [1], float); - float f2 = LOCAL_VAR (ip [2], float); - CONDBR(isunordered (f1, f2) || f1 != f2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BNE_UN_R8) { - double d1 = LOCAL_VAR (ip [1], double); - double d2 = LOCAL_VAR (ip [2], double); - CONDBR(mono_isunordered (d1, d2) || d1 != d2) - MINT_IN_BREAK; - } - -#define BRELOP_S_CAST(datatype, op) \ - if (LOCAL_VAR (ip [1], datatype) op LOCAL_VAR (ip [2], datatype)) { \ - gint16 br_offset = (gint16) ip [3]; \ - BACK_BRANCH_PROFILE (br_offset); \ - ip += br_offset; \ - } else \ - ip += 4; - -#define BRELOP_CAST(datatype, op) \ - if (LOCAL_VAR (ip [1], datatype) op LOCAL_VAR (ip [2], datatype)) { \ - gint32 br_offset = (gint32)READ32(ip + 3); \ - BACK_BRANCH_PROFILE (br_offset); \ - ip += br_offset; \ - } else \ - ip += 5; - - MINT_IN_CASE(MINT_BGE_UN_I4_S) - BRELOP_S_CAST(guint32, >=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGE_UN_I8_S) - BRELOP_S_CAST(guint64, >=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGE_UN_R4_S) { - float f1 = LOCAL_VAR (ip [1], float); - float f2 = LOCAL_VAR (ip [2], float); - CONDBR_S(isunordered (f1, f2) || f1 >= f2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BGE_UN_R8_S) { - double d1 = LOCAL_VAR (ip [1], double); - double d2 = LOCAL_VAR (ip [2], double); - CONDBR_S(mono_isunordered (d1, d2) || d1 >= d2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BGE_UN_I4) - BRELOP_CAST(guint32, >=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGE_UN_I8) - BRELOP_CAST(guint64, >=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGE_UN_R4) { - float f1 = LOCAL_VAR (ip [1], float); - float f2 = LOCAL_VAR (ip [2], float); - CONDBR(isunordered (f1, f2) || f1 >= f2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BGE_UN_R8) { - double d1 = LOCAL_VAR (ip [1], double); - double d2 = LOCAL_VAR (ip [2], double); - CONDBR(mono_isunordered (d1, d2) || d1 >= d2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BGT_UN_I4_S) - BRELOP_S_CAST(guint32, >); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGT_UN_I8_S) - BRELOP_S_CAST(guint64, >); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGT_UN_R4_S) { - float f1 = LOCAL_VAR (ip [1], float); - float f2 = LOCAL_VAR (ip [2], float); - CONDBR_S(isunordered (f1, f2) || f1 > f2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BGT_UN_R8_S) { - double d1 = LOCAL_VAR (ip [1], double); - double d2 = LOCAL_VAR (ip [2], double); - CONDBR_S(mono_isunordered (d1, d2) || d1 > d2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BGT_UN_I4) - BRELOP_CAST(guint32, >); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGT_UN_I8) - BRELOP_CAST(guint64, >); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGT_UN_R4) { - float f1 = LOCAL_VAR (ip [1], float); - float f2 = LOCAL_VAR (ip [2], float); - CONDBR(isunordered (f1, f2) || f1 > f2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BGT_UN_R8) { - double d1 = LOCAL_VAR (ip [1], double); - double d2 = LOCAL_VAR (ip [2], double); - CONDBR(mono_isunordered (d1, d2) || d1 > d2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BLE_UN_I4_S) - BRELOP_S_CAST(guint32, <=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLE_UN_I8_S) - BRELOP_S_CAST(guint64, <=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLE_UN_R4_S) { - float f1 = LOCAL_VAR (ip [1], float); - float f2 = LOCAL_VAR (ip [2], float); - CONDBR_S(isunordered (f1, f2) || f1 <= f2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BLE_UN_R8_S) { - double d1 = LOCAL_VAR (ip [1], double); - double d2 = LOCAL_VAR (ip [2], double); - CONDBR_S(mono_isunordered (d1, d2) || d1 <= d2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BLE_UN_I4) - BRELOP_CAST(guint32, <=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLE_UN_I8) - BRELOP_CAST(guint64, <=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLE_UN_R4) { - float f1 = LOCAL_VAR (ip [1], float); - float f2 = LOCAL_VAR (ip [2], float); - CONDBR(isunordered (f1, f2) || f1 <= f2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BLE_UN_R8) { - double d1 = LOCAL_VAR (ip [1], double); - double d2 = LOCAL_VAR (ip [2], double); - CONDBR(mono_isunordered (d1, d2) || d1 <= d2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BLT_UN_I4_S) - BRELOP_S_CAST(guint32, <); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLT_UN_I8_S) - BRELOP_S_CAST(guint64, <); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLT_UN_R4_S) { - float f1 = LOCAL_VAR (ip [1], float); - float f2 = LOCAL_VAR (ip [2], float); - CONDBR_S(isunordered (f1, f2) || f1 < f2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BLT_UN_R8_S) { - double d1 = LOCAL_VAR (ip [1], double); - double d2 = LOCAL_VAR (ip [2], double); - CONDBR_S(mono_isunordered (d1, d2) || d1 < d2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BLT_UN_I4) - BRELOP_CAST(guint32, <); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLT_UN_I8) - BRELOP_CAST(guint64, <); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLT_UN_R4) { - float f1 = LOCAL_VAR (ip [1], float); - float f2 = LOCAL_VAR (ip [2], float); - CONDBR(isunordered (f1, f2) || f1 < f2) - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BLT_UN_R8) { - double d1 = LOCAL_VAR (ip [1], double); - double d2 = LOCAL_VAR (ip [2], double); - CONDBR(mono_isunordered (d1, d2) || d1 < d2) - MINT_IN_BREAK; - } - -#define ZEROP_SP(datatype, op) \ - if (LOCAL_VAR (ip [1], datatype) op 0) { \ - gint16 br_offset = (gint16) ip [2]; \ - BACK_BRANCH_PROFILE (br_offset); \ - SAFEPOINT; \ - ip += br_offset; \ - } else \ - ip += 3; - -MINT_IN_CASE(MINT_BRFALSE_I4_SP) ZEROP_SP(gint32, ==); MINT_IN_BREAK; -MINT_IN_CASE(MINT_BRFALSE_I8_SP) ZEROP_SP(gint64, ==); MINT_IN_BREAK; -MINT_IN_CASE(MINT_BRTRUE_I4_SP) ZEROP_SP(gint32, !=); MINT_IN_BREAK; -MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; - -#define CONDBR_SP(cond) \ - if (cond) { \ - gint16 br_offset = (gint16) ip [3]; \ - BACK_BRANCH_PROFILE (br_offset); \ - SAFEPOINT; \ - ip += br_offset; \ - } else \ - ip += 4; -#define BRELOP_SP(datatype, op) \ - CONDBR_SP(LOCAL_VAR (ip [1], datatype) op LOCAL_VAR (ip [2], datatype)) - - MINT_IN_CASE(MINT_BEQ_I4_SP) BRELOP_SP(gint32, ==); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BEQ_I8_SP) BRELOP_SP(gint64, ==); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGE_I4_SP) BRELOP_SP(gint32, >=); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGE_I8_SP) BRELOP_SP(gint64, >=); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGT_I4_SP) BRELOP_SP(gint32, >); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGT_I8_SP) BRELOP_SP(gint64, >); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLT_I4_SP) BRELOP_SP(gint32, <); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLT_I8_SP) BRELOP_SP(gint64, <); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLE_I4_SP) BRELOP_SP(gint32, <=); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLE_I8_SP) BRELOP_SP(gint64, <=); MINT_IN_BREAK; - - MINT_IN_CASE(MINT_BNE_UN_I4_SP) BRELOP_SP(guint32, !=); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BNE_UN_I8_SP) BRELOP_SP(guint64, !=); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGE_UN_I4_SP) BRELOP_SP(guint32, >=); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGE_UN_I8_SP) BRELOP_SP(guint64, >=); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGT_UN_I4_SP) BRELOP_SP(guint32, >); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGT_UN_I8_SP) BRELOP_SP(guint64, >); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLE_UN_I4_SP) BRELOP_SP(guint32, <=); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLE_UN_I8_SP) BRELOP_SP(guint64, <=); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLT_UN_I4_SP) BRELOP_SP(guint32, <); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLT_UN_I8_SP) BRELOP_SP(guint64, <); MINT_IN_BREAK; - -#define BRELOP_IMM_SP(datatype, op) \ - CONDBR_SP(LOCAL_VAR (ip [1], datatype) op (datatype)(gint16)ip [2]) - - MINT_IN_CASE(MINT_BEQ_I4_IMM_SP) BRELOP_IMM_SP(gint32, ==); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BEQ_I8_IMM_SP) BRELOP_IMM_SP(gint64, ==); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGE_I4_IMM_SP) BRELOP_IMM_SP(gint32, >=); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGE_I8_IMM_SP) BRELOP_IMM_SP(gint64, >=); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGT_I4_IMM_SP) BRELOP_IMM_SP(gint32, >); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGT_I8_IMM_SP) BRELOP_IMM_SP(gint64, >); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLT_I4_IMM_SP) BRELOP_IMM_SP(gint32, <); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLT_I8_IMM_SP) BRELOP_IMM_SP(gint64, <); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLE_I4_IMM_SP) BRELOP_IMM_SP(gint32, <=); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLE_I8_IMM_SP) BRELOP_IMM_SP(gint64, <=); MINT_IN_BREAK; - - MINT_IN_CASE(MINT_BNE_UN_I4_IMM_SP) BRELOP_IMM_SP(guint32, !=); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BNE_UN_I8_IMM_SP) BRELOP_IMM_SP(guint64, !=); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGE_UN_I4_IMM_SP) BRELOP_IMM_SP(guint32, >=); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGE_UN_I8_IMM_SP) BRELOP_IMM_SP(guint64, >=); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGT_UN_I4_IMM_SP) BRELOP_IMM_SP(guint32, >); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BGT_UN_I8_IMM_SP) BRELOP_IMM_SP(guint64, >); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLE_UN_I4_IMM_SP) BRELOP_IMM_SP(guint32, <=); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLE_UN_I8_IMM_SP) BRELOP_IMM_SP(guint64, <=); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLT_UN_I4_IMM_SP) BRELOP_IMM_SP(guint32, <); MINT_IN_BREAK; - MINT_IN_CASE(MINT_BLT_UN_I8_IMM_SP) BRELOP_IMM_SP(guint64, <); MINT_IN_BREAK; - - MINT_IN_CASE(MINT_SWITCH) { - guint32 val = LOCAL_VAR (ip [1], guint32); - guint32 n = READ32 (ip + 2); - ip += 4; - if (val < n) { - ip += 2 * val; - int offset = READ32 (ip); - ip += offset; - } else { - ip += 2 * n; - } - MINT_IN_BREAK; - } -#define LDIND(datatype,casttype,unaligned) do { \ - MONO_DISABLE_WARNING(4127) \ - gpointer ptr = LOCAL_VAR (ip [2], gpointer); \ - NULL_CHECK (ptr); \ - if (unaligned && ((gsize)ptr % SIZEOF_VOID_P)) \ - memcpy (locals + ip [1], ptr, sizeof (datatype)); \ - else \ - LOCAL_VAR (ip [1], datatype) = *(casttype*)ptr; \ - ip += 3; \ - MONO_RESTORE_WARNING \ -} while (0) - MINT_IN_CASE(MINT_LDIND_I1) - LDIND(int, gint8, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_U1) - LDIND(int, guint8, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_I2) - LDIND(int, gint16, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_U2) - LDIND(int, guint16, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_I4) { - LDIND(int, gint32, FALSE); - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_LDIND_I8) -#ifdef NO_UNALIGNED_ACCESS - LDIND(gint64, gint64, TRUE); -#else - LDIND(gint64, gint64, FALSE); -#endif - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_R4) - LDIND(float, gfloat, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_R8) -#ifdef NO_UNALIGNED_ACCESS - LDIND(double, gdouble, TRUE); -#else - LDIND(double, gdouble, FALSE); -#endif - MINT_IN_BREAK; - -#define LDIND_OFFSET(datatype,casttype,unaligned) do { \ - MONO_DISABLE_WARNING(4127) \ - gpointer ptr = LOCAL_VAR (ip [2], gpointer); \ - NULL_CHECK (ptr); \ - ptr = (char*)ptr + LOCAL_VAR (ip [3], mono_i); \ - if (unaligned && ((gsize)ptr % SIZEOF_VOID_P)) \ - memcpy (locals + ip [1], ptr, sizeof (datatype)); \ - else \ - LOCAL_VAR (ip [1], datatype) = *(casttype*)ptr; \ - ip += 4; \ - MONO_RESTORE_WARNING \ -} while (0) - MINT_IN_CASE(MINT_LDIND_OFFSET_I1) - LDIND_OFFSET(int, gint8, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_OFFSET_U1) - LDIND_OFFSET(int, guint8, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_OFFSET_I2) - LDIND_OFFSET(int, gint16, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_OFFSET_U2) - LDIND_OFFSET(int, guint16, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_OFFSET_I4) - LDIND_OFFSET(int, gint32, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_OFFSET_I8) -#ifdef NO_UNALIGNED_ACCESS - LDIND_OFFSET(gint64, gint64, TRUE); -#else - LDIND_OFFSET(gint64, gint64, FALSE); -#endif - MINT_IN_BREAK; - -#define LDIND_OFFSET_ADD_MUL(datatype,casttype,unaligned) do { \ - MONO_DISABLE_WARNING(4127) \ - gpointer ptr = LOCAL_VAR (ip [2], gpointer); \ - NULL_CHECK (ptr); \ - ptr = (char*)ptr + (LOCAL_VAR (ip [3], mono_i) + (gint16)ip [4]) * (gint16)ip [5]; \ - if (unaligned && ((gsize)ptr % SIZEOF_VOID_P)) \ - memcpy (locals + ip [1], ptr, sizeof (datatype)); \ - else \ - LOCAL_VAR (ip [1], datatype) = *(casttype*)ptr; \ - ip += 6; \ - MONO_RESTORE_WARNING \ -} while (0) - MINT_IN_CASE(MINT_LDIND_OFFSET_ADD_MUL_IMM_I1) - LDIND_OFFSET_ADD_MUL(gint32, gint8, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_OFFSET_ADD_MUL_IMM_U1) - LDIND_OFFSET_ADD_MUL(gint32, guint8, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_OFFSET_ADD_MUL_IMM_I2) - LDIND_OFFSET_ADD_MUL(gint32, gint16, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_OFFSET_ADD_MUL_IMM_U2) - LDIND_OFFSET_ADD_MUL(gint32, guint16, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_OFFSET_ADD_MUL_IMM_I4) - LDIND_OFFSET_ADD_MUL(gint32, gint32, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_OFFSET_ADD_MUL_IMM_I8) -#ifdef NO_UNALIGNED_ACCESS - LDIND_OFFSET_ADD_MUL(gint64, gint64, TRUE); -#else - LDIND_OFFSET_ADD_MUL(gint64, gint64, FALSE); -#endif - MINT_IN_BREAK; - -#define LDIND_OFFSET_IMM(datatype,casttype,unaligned) do { \ - MONO_DISABLE_WARNING(4127) \ - gpointer ptr = LOCAL_VAR (ip [2], gpointer); \ - NULL_CHECK (ptr); \ - ptr = (char*)ptr + (gint16)ip [3]; \ - if (unaligned && ((gsize)ptr % SIZEOF_VOID_P)) \ - memcpy (locals + ip [1], ptr, sizeof (datatype)); \ - else \ - LOCAL_VAR (ip [1], datatype) = *(casttype*)ptr; \ - ip += 4; \ - MONO_RESTORE_WARNING \ -} while (0) - MINT_IN_CASE(MINT_LDIND_OFFSET_IMM_I1) - LDIND_OFFSET_IMM(int, gint8, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_OFFSET_IMM_U1) - LDIND_OFFSET_IMM(int, guint8, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_OFFSET_IMM_I2) - LDIND_OFFSET_IMM(int, gint16, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_OFFSET_IMM_U2) - LDIND_OFFSET_IMM(int, guint16, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_OFFSET_IMM_I4) - LDIND_OFFSET_IMM(int, gint32, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDIND_OFFSET_IMM_I8) -#ifdef NO_UNALIGNED_ACCESS - LDIND_OFFSET_IMM(gint64, gint64, TRUE); -#else - LDIND_OFFSET_IMM(gint64, gint64, FALSE); -#endif - MINT_IN_BREAK; - MINT_IN_CASE(MINT_STIND_REF) { - gpointer ptr = LOCAL_VAR (ip [1], gpointer); - NULL_CHECK (ptr); - mono_gc_wbarrier_generic_store_internal (ptr, LOCAL_VAR (ip [2], MonoObject*)); - ip += 3; - MINT_IN_BREAK; - } -#define STIND(datatype,unaligned) do { \ - MONO_DISABLE_WARNING(4127) \ - gpointer ptr = LOCAL_VAR (ip [1], gpointer); \ - NULL_CHECK (ptr); \ - if (unaligned && ((gsize)ptr % SIZEOF_VOID_P)) \ - memcpy (ptr, locals + ip [2], sizeof (datatype)); \ - else \ - *(datatype*)ptr = LOCAL_VAR (ip [2], datatype); \ - ip += 3; \ - MONO_RESTORE_WARNING \ -} while (0) - MINT_IN_CASE(MINT_STIND_I1) - STIND(gint8, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_STIND_I2) - STIND(gint16, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_STIND_I4) - STIND(gint32, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_STIND_I8) -#ifdef NO_UNALIGNED_ACCESS - STIND(gint64, TRUE); -#else - STIND(gint64, FALSE); -#endif - MINT_IN_BREAK; - MINT_IN_CASE(MINT_STIND_R4) - STIND(float, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_STIND_R8) -#ifdef NO_UNALIGNED_ACCESS - STIND(double, TRUE); -#else - STIND(double, FALSE); -#endif - MINT_IN_BREAK; - -#define STIND_OFFSET(datatype,unaligned) do { \ - MONO_DISABLE_WARNING(4127) \ - gpointer ptr = LOCAL_VAR (ip [1], gpointer); \ - NULL_CHECK (ptr); \ - ptr = (char*)ptr + LOCAL_VAR (ip [2], mono_i); \ - if (unaligned && ((gsize)ptr % SIZEOF_VOID_P)) \ - memcpy (ptr, locals + ip [3], sizeof (datatype)); \ - else \ - *(datatype*)ptr = LOCAL_VAR (ip [3], datatype); \ - ip += 4; \ - MONO_RESTORE_WARNING \ -} while (0) - MINT_IN_CASE(MINT_STIND_OFFSET_I1) - STIND_OFFSET(gint8, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_STIND_OFFSET_I2) - STIND_OFFSET(gint16, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_STIND_OFFSET_I4) - STIND_OFFSET(gint32, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_STIND_OFFSET_I8) -#ifdef NO_UNALIGNED_ACCESS - STIND_OFFSET(gint64, TRUE); -#else - STIND_OFFSET(gint64, FALSE); -#endif - MINT_IN_BREAK; - -#define STIND_OFFSET_IMM(datatype,unaligned) do { \ - MONO_DISABLE_WARNING(4127) \ - gpointer ptr = LOCAL_VAR (ip [1], gpointer); \ - NULL_CHECK (ptr); \ - ptr = (char*)ptr + (gint16)ip [3]; \ - if (unaligned && ((gsize)ptr % SIZEOF_VOID_P)) \ - memcpy (ptr, locals + ip [2], sizeof (datatype)); \ - else \ - *(datatype*)ptr = LOCAL_VAR (ip [2], datatype); \ - ip += 4; \ - MONO_RESTORE_WARNING \ -} while (0) - MINT_IN_CASE(MINT_STIND_OFFSET_IMM_I1) - STIND_OFFSET_IMM(gint8, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_STIND_OFFSET_IMM_I2) - STIND_OFFSET_IMM(gint16, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_STIND_OFFSET_IMM_I4) - STIND_OFFSET_IMM(gint32, FALSE); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_STIND_OFFSET_IMM_I8) -#ifdef NO_UNALIGNED_ACCESS - STIND_OFFSET_IMM(gint64, TRUE); -#else - STIND_OFFSET_IMM(gint64, FALSE); -#endif - MINT_IN_BREAK; -#define BINOP(datatype, op) \ - LOCAL_VAR (ip [1], datatype) = LOCAL_VAR (ip [2], datatype) op LOCAL_VAR (ip [3], datatype); \ - ip += 4; - MINT_IN_CASE(MINT_ADD_I4) - BINOP(gint32, +); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_ADD_I8) - BINOP(gint64, +); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_ADD_R4) - BINOP(float, +); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_ADD_R8) - BINOP(double, +); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_ADD1_I4) - LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) + 1; - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_ADD_I4_IMM) - LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) + (gint16)ip [3]; - ip += 4; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_ADD_I4_IMM2) - LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) + (gint32)READ32 (ip + 3); - ip += 5; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_ADD1_I8) - LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) + 1; - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_ADD_I8_IMM) - LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) + (gint16)ip [3]; - ip += 4; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_ADD_I8_IMM2) - LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) + (gint32)READ32 (ip + 3); - ip += 5; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SUB_I4) - BINOP(gint32, -); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SUB_I8) - BINOP(gint64, -); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SUB_R4) - BINOP(float, -); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SUB_R8) - BINOP(double, -); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SUB1_I4) - LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) - 1; - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SUB1_I8) - LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) - 1; - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_MUL_I4) - BINOP(gint32, *); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_MUL_I8) - BINOP(gint64, *); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_MUL_I4_IMM) - LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) * (gint16)ip [3]; - ip += 4; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_MUL_I4_IMM2) - LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) * (gint32)READ32 (ip + 3); - ip += 5; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_MUL_I8_IMM) - LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) * (gint16)ip [3]; - ip += 4; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_MUL_I8_IMM2) - LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) * (gint32)READ32 (ip + 3); - ip += 5; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_ADD_MUL_I4_IMM) - LOCAL_VAR (ip [1], gint32) = (LOCAL_VAR (ip [2], gint32) + (gint16)ip [3]) * (gint16)ip [4]; - ip += 5; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_ADD_MUL_I8_IMM) - LOCAL_VAR (ip [1], gint64) = (LOCAL_VAR (ip [2], gint64) + (gint16)ip [3]) * (gint16)ip [4]; - ip += 5; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_MUL_R4) - BINOP(float, *); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_MUL_R8) - BINOP(double, *); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_DIV_I4) { - gint32 i1 = LOCAL_VAR (ip [2], gint32); - gint32 i2 = LOCAL_VAR (ip [3], gint32); - if (i2 == 0) - THROW_EX (interp_get_exception_divide_by_zero (frame, ip), ip); - if (i2 == (-1) && i1 == G_MININT32) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = i1 / i2; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_DIV_I8) { - gint64 l1 = LOCAL_VAR (ip [2], gint64); - gint64 l2 = LOCAL_VAR (ip [3], gint64); - if (l2 == 0) - THROW_EX (interp_get_exception_divide_by_zero (frame, ip), ip); - if (l2 == (-1) && l1 == G_MININT64) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint64) = l1 / l2; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_DIV_R4) - BINOP(float, /); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_DIV_R8) - BINOP(double, /); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_DIV_UN_I4) { - guint32 i2 = LOCAL_VAR (ip [3], guint32); - if (i2 == 0) - THROW_EX (interp_get_exception_divide_by_zero (frame, ip), ip); - LOCAL_VAR (ip [1], guint32) = LOCAL_VAR (ip [2], guint32) / i2; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_DIV_UN_I8) { - guint64 l2 = LOCAL_VAR (ip [3], guint64); - if (l2 == 0) - THROW_EX (interp_get_exception_divide_by_zero (frame, ip), ip); - LOCAL_VAR (ip [1], guint64) = LOCAL_VAR (ip [2], guint64) / l2; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_REM_I4) { - gint32 i1 = LOCAL_VAR (ip [2], gint32); - gint32 i2 = LOCAL_VAR (ip [3], gint32); - if (i2 == 0) - THROW_EX (interp_get_exception_divide_by_zero (frame, ip), ip); - if (i2 == (-1) && i1 == G_MININT32) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = i1 % i2; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_REM_I8) { - gint64 l1 = LOCAL_VAR (ip [2], gint64); - gint64 l2 = LOCAL_VAR (ip [3], gint64); - if (l2 == 0) - THROW_EX (interp_get_exception_divide_by_zero (frame, ip), ip); - if (l2 == (-1) && l1 == G_MININT64) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint64) = l1 % l2; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_REM_R4) - LOCAL_VAR (ip [1], float) = fmodf (LOCAL_VAR (ip [2], float), LOCAL_VAR (ip [3], float)); - ip += 4; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_REM_R8) - LOCAL_VAR (ip [1], double) = fmod (LOCAL_VAR (ip [2], double), LOCAL_VAR (ip [3], double)); - ip += 4; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_REM_UN_I4) { - guint32 i2 = LOCAL_VAR (ip [3], guint32); - if (i2 == 0) - THROW_EX (interp_get_exception_divide_by_zero (frame, ip), ip); - LOCAL_VAR (ip [1], guint32) = LOCAL_VAR (ip [2], guint32) % i2; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_REM_UN_I8) { - guint64 l2 = LOCAL_VAR (ip [3], guint64); - if (l2 == 0) - THROW_EX (interp_get_exception_divide_by_zero (frame, ip), ip); - LOCAL_VAR (ip [1], guint64) = LOCAL_VAR (ip [2], guint64) % l2; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_AND_I4) - BINOP(gint32, &); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_AND_I4_IMM) - LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) & (gint16)ip [3]; - ip += 4; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_AND_I4_IMM2) - LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) & READ32 (ip + 3); - ip += 5; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_AND_I8) - BINOP(gint64, &); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_OR_I4) - BINOP(gint32, |); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_OR_I4_IMM) - LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) | (gint16)ip [3]; - ip += 4; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_OR_I4_IMM2) - LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) | READ32 (ip + 3); - ip += 5; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_OR_I8) - BINOP(gint64, |); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_XOR_I4) - BINOP(gint32, ^); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_XOR_I8) - BINOP(gint64, ^); - MINT_IN_BREAK; - -#define SHIFTOP(datatype, op) \ - LOCAL_VAR (ip [1], datatype) = LOCAL_VAR (ip [2], datatype) op LOCAL_VAR (ip [3], gint32); \ - ip += 4; - - MINT_IN_CASE(MINT_SHL_I4) - SHIFTOP(gint32, <<); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SHL_I8) - SHIFTOP(gint64, <<); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SHR_I4) - SHIFTOP(gint32, >>); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SHR_I8) - SHIFTOP(gint64, >>); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SHR_UN_I4) - SHIFTOP(guint32, >>); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SHR_UN_I8) - SHIFTOP(guint64, >>); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SHL_I4_IMM) - LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) << ip [3]; - ip += 4; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SHL_I8_IMM) - LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) << ip [3]; - ip += 4; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SHR_I4_IMM) - LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) >> ip [3]; - ip += 4; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SHR_I8_IMM) - LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) >> ip [3]; - ip += 4; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SHR_UN_I4_IMM) - LOCAL_VAR (ip [1], guint32) = LOCAL_VAR (ip [2], guint32) >> ip [3]; - ip += 4; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SHR_UN_I8_IMM) - LOCAL_VAR (ip [1], guint64) = LOCAL_VAR (ip [2], guint64) >> ip [3]; - ip += 4; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SHL_AND_I4) - LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) << (LOCAL_VAR (ip [3], gint32) & 31); - ip += 4; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SHL_AND_I8) - LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) << (LOCAL_VAR (ip [3], gint64) & 63); - ip += 4; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_NEG_I4) - LOCAL_VAR (ip [1], gint32) = - LOCAL_VAR (ip [2], gint32); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_NEG_I8) - LOCAL_VAR (ip [1], gint64) = - LOCAL_VAR (ip [2], gint64); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_NEG_R4) - LOCAL_VAR (ip [1], float) = - LOCAL_VAR (ip [2], float); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_NEG_R8) - LOCAL_VAR (ip [1], double) = - LOCAL_VAR (ip [2], double); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_NOT_I4) - LOCAL_VAR (ip [1], gint32) = ~ LOCAL_VAR (ip [2], gint32); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_NOT_I8) - LOCAL_VAR (ip [1], gint64) = ~ LOCAL_VAR (ip [2], gint64); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_I1_I4) - // FIXME read casted var directly and remove redundant conv opcodes - LOCAL_VAR (ip [1], gint32) = (gint8)LOCAL_VAR (ip [2], gint32); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_I1_I8) - LOCAL_VAR (ip [1], gint32) = (gint8)LOCAL_VAR (ip [2], gint64); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_I1_R4) - LOCAL_VAR (ip [1], gint32) = (gint8) (gint32) LOCAL_VAR (ip [2], float); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_I1_R8) - /* without gint32 cast, C compiler is allowed to use undefined - * behaviour if data.f is bigger than >255. See conv.fpint section - * in C standard: - * > The conversion truncates; that is, the fractional part - * > is discarded. The behavior is undefined if the truncated - * > value cannot be represented in the destination type. - * */ - LOCAL_VAR (ip [1], gint32) = (gint8) (gint32) LOCAL_VAR (ip [2], double); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_U1_I4) - LOCAL_VAR (ip [1], gint32) = (guint8) LOCAL_VAR (ip [2], gint32); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_U1_I8) - LOCAL_VAR (ip [1], gint32) = (guint8) LOCAL_VAR (ip [2], gint64); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_U1_R4) - LOCAL_VAR (ip [1], gint32) = (guint8) (guint32) LOCAL_VAR (ip [2], float); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_U1_R8) - LOCAL_VAR (ip [1], gint32) = (guint8) (guint32) LOCAL_VAR (ip [2], double); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_I2_I4) - LOCAL_VAR (ip [1], gint32) = (gint16) LOCAL_VAR (ip [2], gint32); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_I2_I8) - LOCAL_VAR (ip [1], gint32) = (gint16) LOCAL_VAR (ip [2], gint64); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_I2_R4) - LOCAL_VAR (ip [1], gint32) = (gint16) (gint32) LOCAL_VAR (ip [2], float); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_I2_R8) - LOCAL_VAR (ip [1], gint32) = (gint16) (gint32) LOCAL_VAR (ip [2], double); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_U2_I4) - LOCAL_VAR (ip [1], gint32) = (guint16) LOCAL_VAR (ip [2], gint32); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_U2_I8) - LOCAL_VAR (ip [1], gint32) = (guint16) LOCAL_VAR (ip [2], gint64); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_U2_R4) - LOCAL_VAR (ip [1], gint32) = (guint16) (guint32) LOCAL_VAR (ip [2], float); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_U2_R8) - LOCAL_VAR (ip [1], gint32) = (guint16) (guint32) LOCAL_VAR (ip [2], double); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_I4_R4) - LOCAL_VAR (ip [1], gint32) = (gint32) LOCAL_VAR (ip [2], float); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_I4_R8) - LOCAL_VAR (ip [1], gint32) = (gint32) LOCAL_VAR (ip [2], double); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_U4_R4) -#ifdef MONO_ARCH_EMULATE_FCONV_TO_U4 - LOCAL_VAR (ip [1], gint32) = mono_rconv_u4 (LOCAL_VAR (ip [2], float)); -#else - LOCAL_VAR (ip [1], gint32) = (guint32) LOCAL_VAR (ip [2], float); -#endif - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_U4_R8) -#ifdef MONO_ARCH_EMULATE_FCONV_TO_U4 - LOCAL_VAR (ip [1], gint32) = mono_fconv_u4 (LOCAL_VAR (ip [2], double)); -#else - LOCAL_VAR (ip [1], gint32) = (guint32) LOCAL_VAR (ip [2], double); -#endif - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_I8_I4) - LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint32); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_I8_U4) - LOCAL_VAR (ip [1], gint64) = (guint32) LOCAL_VAR (ip [2], gint32); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_I8_R4) - LOCAL_VAR (ip [1], gint64) = (gint64) LOCAL_VAR (ip [2], float); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_I8_R8) - LOCAL_VAR (ip [1], gint64) = (gint64) LOCAL_VAR (ip [2], double); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_R4_I4) - LOCAL_VAR (ip [1], float) = (float) LOCAL_VAR (ip [2], gint32); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_R4_I8) - LOCAL_VAR (ip [1], float) = (float) LOCAL_VAR (ip [2], gint64); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_R4_R8) - LOCAL_VAR (ip [1], float) = (float) LOCAL_VAR (ip [2], double); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_R8_I4) - LOCAL_VAR (ip [1], double) = (double) LOCAL_VAR (ip [2], gint32); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_R8_I8) - LOCAL_VAR (ip [1], double) = (double) LOCAL_VAR (ip [2], gint64); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_R8_R4) - LOCAL_VAR (ip [1], double) = (double) LOCAL_VAR (ip [2], float); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_U8_R4) -#ifdef MONO_ARCH_EMULATE_FCONV_TO_U8 - LOCAL_VAR (ip [1], gint64) = mono_rconv_u8 (LOCAL_VAR (ip [2], float)); -#else - LOCAL_VAR (ip [1], gint64) = (guint64) LOCAL_VAR (ip [2], float); -#endif - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_U8_R8) -#ifdef MONO_ARCH_EMULATE_FCONV_TO_U8 - LOCAL_VAR (ip [1], gint64) = mono_fconv_u8 (LOCAL_VAR (ip [2], double)); -#else - LOCAL_VAR (ip [1], gint64) = (guint64) LOCAL_VAR (ip [2], double); -#endif - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CPOBJ) { - MonoClass* const c = (MonoClass*)frame->imethod->data_items[ip [3]]; - g_assert (m_class_is_valuetype (c)); - /* if this assertion fails, we need to add a write barrier */ - g_assert (!MONO_TYPE_IS_REFERENCE (m_class_get_byval_arg (c))); - stackval_from_data (m_class_get_byval_arg (c), (stackval*)LOCAL_VAR (ip [1], gpointer), LOCAL_VAR (ip [2], gpointer), FALSE); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CPOBJ_VT) { - MonoClass* const c = (MonoClass*)frame->imethod->data_items[ip [3]]; - mono_value_copy_internal (LOCAL_VAR (ip [1], gpointer), LOCAL_VAR (ip [2], gpointer), c); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CPOBJ_VT_NOREF) { - gpointer src_addr = LOCAL_VAR (ip [2], gpointer); - NULL_CHECK (src_addr); - memcpy (LOCAL_VAR (ip [1], gpointer), src_addr, ip [3]); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_LDOBJ_VT) { - guint16 size = ip [3]; - gpointer srcAddr = LOCAL_VAR (ip [2], gpointer); - NULL_CHECK (srcAddr); - memcpy (locals + ip [1], srcAddr, size); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_LDSTR) - LOCAL_VAR (ip [1], gpointer) = frame->imethod->data_items [ip [2]]; - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDSTR_DYNAMIC) { - MonoString *s = NULL; - guint32 strtoken = (guint32)(gsize)frame->imethod->data_items [ip [2]]; - - MonoMethod *method = frame->imethod->method; - g_assert (method->wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD); - s = (MonoString*)mono_method_get_wrapper_data (method, strtoken); - LOCAL_VAR (ip [1], gpointer) = s; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_LDSTR_CSTR) { - MonoString *s = NULL; - const char* cstr = (const char*)frame->imethod->data_items [ip [2]]; - - // FIXME push/pop LMF - s = mono_string_new_wrapper_internal (cstr); - LOCAL_VAR (ip [1], gpointer) = s; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_NEWOBJ_ARRAY) { - MonoClass *newobj_class; - guint32 token = ip [3]; - guint16 param_count = ip [4]; - - newobj_class = (MonoClass*) frame->imethod->data_items [token]; - - // FIXME push/pop LMF - LOCAL_VAR (ip [1], MonoObject*) = ves_array_create (newobj_class, param_count, (stackval*)(locals + ip [2]), error); - if (!is_ok (error)) - THROW_EX (interp_error_convert_to_exception (frame, error, ip), ip); - ip += 5; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_NEWOBJ_STRING) { - cmethod = (InterpMethod*)frame->imethod->data_items [ip [3]]; - return_offset = ip [1]; - call_args_offset = ip [2]; - - // `this` is implicit null. The created string will be returned - // by the call, even though the call has void return (?!). - LOCAL_VAR (call_args_offset, gpointer) = NULL; - ip += 4; - goto jit_call; - } - MINT_IN_CASE(MINT_NEWOBJ_STRING_UNOPT) { - // Same as MINT_NEWOBJ_STRING but copy params into right place on stack - cmethod = (InterpMethod*)frame->imethod->data_items [ip [2]]; - return_offset = ip [1]; - call_args_offset = ip [1]; - int aligned_call_args_offset = ALIGN_TO (call_args_offset, MINT_STACK_ALIGNMENT); - - int param_size = ip [3]; - if (param_size) - memmove (locals + aligned_call_args_offset + MINT_STACK_SLOT_SIZE, locals + call_args_offset, param_size); - call_args_offset = aligned_call_args_offset; - LOCAL_VAR (call_args_offset, gpointer) = NULL; - ip += 4; - goto jit_call; - } - MINT_IN_CASE(MINT_NEWOBJ) { - MonoVTable *vtable = (MonoVTable*) frame->imethod->data_items [ip [4]]; - INIT_VTABLE (vtable); - guint16 imethod_index = ip [3]; - return_offset = ip [1]; - call_args_offset = ip [2]; - - // FIXME push/pop LMF - MonoObject *o = mono_gc_alloc_obj (vtable, m_class_get_instance_size (vtable->klass)); - if (G_UNLIKELY (!o)) { - mono_error_set_out_of_memory (error, "Could not allocate %i bytes", m_class_get_instance_size (vtable->klass)); - THROW_EX (interp_error_convert_to_exception (frame, error, ip), ip); - } - - // This is return value - LOCAL_VAR (return_offset, MonoObject*) = o; - // Set `this` arg for ctor call - LOCAL_VAR (call_args_offset, MonoObject*) = o; - ip += 5; - - cmethod = (InterpMethod*)frame->imethod->data_items [imethod_index]; - - goto jit_call; - } - MINT_IN_CASE(MINT_NEWOBJ_INLINED) { - MonoVTable *vtable = (MonoVTable*) frame->imethod->data_items [ip [2]]; - INIT_VTABLE (vtable); - - // FIXME push/pop LMF - MonoObject *o = mono_gc_alloc_obj (vtable, m_class_get_instance_size (vtable->klass)); - if (G_UNLIKELY (!o)) { - mono_error_set_out_of_memory (error, "Could not allocate %i bytes", m_class_get_instance_size (vtable->klass)); - THROW_EX (interp_error_convert_to_exception (frame, error, ip), ip); - } - - // This is return value - LOCAL_VAR (ip [1], MonoObject*) = o; - ip += 3; - MINT_IN_BREAK; - } - - MINT_IN_CASE(MINT_NEWOBJ_VT) { - guint16 imethod_index = ip [3]; - guint16 ret_size = ip [4]; - return_offset = ip [1]; - call_args_offset = ip [2]; - gpointer this_vt = locals + return_offset; - - // clear the valuetype - memset (this_vt, 0, ret_size); - // pass the address of the valuetype - LOCAL_VAR (call_args_offset, gpointer) = this_vt; - ip += 5; - - cmethod = (InterpMethod*)frame->imethod->data_items [imethod_index]; - goto jit_call; - } - MINT_IN_CASE(MINT_NEWOBJ_SLOW) { - guint32 const token = ip [3]; - return_offset = ip [1]; - call_args_offset = ip [2]; - - cmethod = (InterpMethod*)frame->imethod->data_items [token]; - - MonoClass * const newobj_class = cmethod->method->klass; - - /* - * First arg is the object. - * a constructor returns void, but we need to return the object we created - */ - - g_assert (!m_class_is_valuetype (newobj_class)); - - // FIXME push/pop LMF - MonoVTable *vtable = mono_class_vtable_checked (newobj_class, error); - if (!is_ok (error) || !mono_runtime_class_init_full (vtable, error)) { - MonoException *exc = interp_error_convert_to_exception (frame, error, ip); - g_assert (exc); - THROW_EX (exc, ip); - } - error_init_reuse (error); - MonoObject* o = mono_object_new_checked (newobj_class, error); - LOCAL_VAR (return_offset, MonoObject*) = o; // return value - LOCAL_VAR (call_args_offset, MonoObject*) = o; // first parameter - - mono_interp_error_cleanup (error); // FIXME: do not swallow the error - EXCEPTION_CHECKPOINT; - ip += 4; - goto jit_call; - } - - MINT_IN_CASE(MINT_ROL_I4_IMM) { - guint32 val = LOCAL_VAR (ip [2], guint32); - int amount = ip [3]; - LOCAL_VAR (ip [1], guint32) = (val << amount) | (val >> (32 - amount)); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_ROL_I8_IMM) { - guint64 val = LOCAL_VAR (ip [2], guint64); - int amount = ip [3]; - LOCAL_VAR (ip [1], guint64) = (val << amount) | (val >> (64 - amount)); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_ROR_I4_IMM) { - guint32 val = LOCAL_VAR (ip [2], guint32); - int amount = ip [3]; - LOCAL_VAR (ip [1], guint32) = (val >> amount) | (val << (32 - amount)); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_ROR_I8_IMM) { - guint64 val = LOCAL_VAR (ip [2], guint64); - int amount = ip [3]; - LOCAL_VAR (ip [1], guint64) = (val >> amount) | (val << (64 - amount)); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CLZ_I4) LOCAL_VAR (ip [1], gint32) = interp_intrins_clz_i4 (LOCAL_VAR (ip [2], guint32)); ip += 3; MINT_IN_BREAK; - MINT_IN_CASE(MINT_CLZ_I8) LOCAL_VAR (ip [1], gint64) = interp_intrins_clz_i8 (LOCAL_VAR (ip [2], guint64)); ip += 3; MINT_IN_BREAK; - MINT_IN_CASE(MINT_CTZ_I4) LOCAL_VAR (ip [1], gint32) = interp_intrins_ctz_i4 (LOCAL_VAR (ip [2], guint32)); ip += 3; MINT_IN_BREAK; - MINT_IN_CASE(MINT_CTZ_I8) LOCAL_VAR (ip [1], gint64) = interp_intrins_ctz_i8 (LOCAL_VAR (ip [2], guint64)); ip += 3; MINT_IN_BREAK; - MINT_IN_CASE(MINT_POPCNT_I4) LOCAL_VAR (ip [1], gint32) = interp_intrins_popcount_i4 (LOCAL_VAR (ip [2], guint32)); ip += 3; MINT_IN_BREAK; - MINT_IN_CASE(MINT_POPCNT_I8) LOCAL_VAR (ip [1], gint64) = interp_intrins_popcount_i8 (LOCAL_VAR (ip [2], guint64)); ip += 3; MINT_IN_BREAK; - MINT_IN_CASE(MINT_LOG2_I4) LOCAL_VAR (ip [1], gint32) = 31 ^ interp_intrins_clz_i4 (LOCAL_VAR (ip [2], guint32) | 1); ip += 3; MINT_IN_BREAK; - MINT_IN_CASE(MINT_LOG2_I8) LOCAL_VAR (ip [1], gint32) = 63 ^ interp_intrins_clz_i8 (LOCAL_VAR (ip [2], guint64) | 1); ip += 3; MINT_IN_BREAK; - -#ifdef INTERP_ENABLE_SIMD - MINT_IN_CASE(MINT_SIMD_V128_LDC) { - memcpy (locals + ip [1], ip + 2, SIZEOF_V128); - ip += 10; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_SIMD_V128_I1_CREATE) { - interp_simd_create (locals + ip [1], locals + ip [2], 1); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_SIMD_V128_I2_CREATE) { - interp_simd_create (locals + ip [1], locals + ip [2], 2); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_SIMD_V128_I4_CREATE) { - interp_simd_create (locals + ip [1], locals + ip [2], 4); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_SIMD_V128_I8_CREATE) { - interp_simd_create (locals + ip [1], locals + ip [2], 8); - ip += 3; - MINT_IN_BREAK; - } - - MINT_IN_CASE(MINT_SIMD_INTRINS_P_P) - interp_simd_p_p_table [ip [3]] (locals + ip [1], locals + ip [2]); - ip += 4; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SIMD_INTRINS_P_PP) - interp_simd_p_pp_table [ip [4]] (locals + ip [1], locals + ip [2], locals + ip [3]); - ip += 5; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SIMD_INTRINS_P_PPP) - interp_simd_p_ppp_table [ip [5]] (locals + ip [1], locals + ip [2], locals + ip [3], locals + ip [4]); - ip += 6; - MINT_IN_BREAK; -#else - MINT_IN_CASE(MINT_SIMD_V128_LDC) - MINT_IN_CASE(MINT_SIMD_V128_I1_CREATE) - MINT_IN_CASE(MINT_SIMD_V128_I2_CREATE) - MINT_IN_CASE(MINT_SIMD_V128_I4_CREATE) - MINT_IN_CASE(MINT_SIMD_V128_I8_CREATE) - MINT_IN_CASE(MINT_SIMD_INTRINS_P_P) - MINT_IN_CASE(MINT_SIMD_INTRINS_P_PP) - MINT_IN_CASE(MINT_SIMD_INTRINS_P_PPP) - g_assert_not_reached (); - MINT_IN_BREAK; -#endif - - MINT_IN_CASE(MINT_INTRINS_SPAN_CTOR) { - gpointer ptr = LOCAL_VAR (ip [2], gpointer); - int len = LOCAL_VAR (ip [3], gint32); - if (len < 0) - THROW_EX (interp_get_exception_argument_out_of_range ("length", frame, ip), ip); - gpointer span = locals + ip [1]; - *(gpointer*)span = ptr; - *(gint32*)((gpointer*)span + 1) = len; - ip += 4;; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_INTRINS_CLEAR_WITH_REFERENCES) { - gpointer p = LOCAL_VAR (ip [1], gpointer); - size_t size = LOCAL_VAR (ip [2], mono_u) * sizeof (gpointer); - mono_gc_bzero_aligned (p, size); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_INTRINS_MARVIN_BLOCK) { - guint32 *pp0 = (guint32*)(locals + ip [1]); - guint32 *pp1 = (guint32*)(locals + ip [2]); - guint32 *dest0 = (guint32*)(locals + ip [3]); - guint32 *dest1 = (guint32*)(locals + ip [4]); - - interp_intrins_marvin_block (pp0, pp1, dest0, dest1); - ip += 5; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_INTRINS_ASCII_CHARS_TO_UPPERCASE) { - LOCAL_VAR (ip [1], gint32) = interp_intrins_ascii_chars_to_uppercase (LOCAL_VAR (ip [2], guint32)); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_INTRINS_MEMORYMARSHAL_GETARRAYDATAREF) { - MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); - NULL_CHECK (o); - LOCAL_VAR (ip [1], gpointer) = (guint8*)o + MONO_STRUCT_OFFSET (MonoArray, vector); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_INTRINS_ORDINAL_IGNORE_CASE_ASCII) { - LOCAL_VAR (ip [1], gint32) = interp_intrins_ordinal_ignore_case_ascii (LOCAL_VAR (ip [2], guint32), LOCAL_VAR (ip [3], guint32)); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_INTRINS_64ORDINAL_IGNORE_CASE_ASCII) { - LOCAL_VAR (ip [1], gint32) = interp_intrins_64ordinal_ignore_case_ascii (LOCAL_VAR (ip [2], guint64), LOCAL_VAR (ip [3], guint64)); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_INTRINS_WIDEN_ASCII_TO_UTF16) { - LOCAL_VAR (ip [1], mono_u) = interp_intrins_widen_ascii_to_utf16 (LOCAL_VAR (ip [2], guint8*), LOCAL_VAR (ip [3], mono_unichar2*), LOCAL_VAR (ip [4], mono_u)); - ip += 5; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_INTRINS_RUNTIMEHELPERS_OBJECT_HAS_COMPONENT_SIZE) { - MonoObject *obj = LOCAL_VAR (ip [2], MonoObject*); - LOCAL_VAR (ip [1], gint32) = (obj->vtable->flags & MONO_VT_FLAG_ARRAY_OR_STRING) != 0; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CASTCLASS_INTERFACE) - MINT_IN_CASE(MINT_ISINST_INTERFACE) { - MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); - if (o) { - MonoClass *c = (MonoClass*)frame->imethod->data_items [ip [3]]; - gboolean isinst; - if (MONO_VTABLE_IMPLEMENTS_INTERFACE (o->vtable, m_class_get_interface_id (c))) { - isinst = TRUE; - } else if (m_class_is_array_special_interface (c)) { - /* slow path */ - // FIXME push/pop LMF - isinst = mono_interp_isinst (o, c); // FIXME: do not swallow the error - } else { - isinst = FALSE; - } - - if (!isinst) { - gboolean const isinst_instr = *ip == MINT_ISINST_INTERFACE; - if (isinst_instr) - LOCAL_VAR (ip [1], MonoObject*) = NULL; - else - THROW_EX (interp_get_exception_invalid_cast (frame, ip), ip); - } else { - LOCAL_VAR (ip [1], MonoObject*) = o; - } - } else { - LOCAL_VAR (ip [1], MonoObject*) = NULL; - } - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CASTCLASS_COMMON) - MINT_IN_CASE(MINT_ISINST_COMMON) { - MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); - if (o) { - MonoClass *c = (MonoClass*)frame->imethod->data_items [ip [3]]; - gboolean isinst = mono_class_has_parent_fast (o->vtable->klass, c); - - if (!isinst) { - gboolean const isinst_instr = *ip == MINT_ISINST_COMMON; - if (isinst_instr) - LOCAL_VAR (ip [1], MonoObject*) = NULL; - else - THROW_EX (interp_get_exception_invalid_cast (frame, ip), ip); - } else { - LOCAL_VAR (ip [1], MonoObject*) = o; - } - } else { - LOCAL_VAR (ip [1], MonoObject*) = NULL; - } - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CASTCLASS) - MINT_IN_CASE(MINT_ISINST) { - MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); - if (o) { - MonoClass* const c = (MonoClass*)frame->imethod->data_items [ip [3]]; - // FIXME push/pop LMF - if (!mono_interp_isinst (o, c)) { // FIXME: do not swallow the error - gboolean const isinst_instr = *ip == MINT_ISINST; - if (isinst_instr) - LOCAL_VAR (ip [1], MonoObject*) = NULL; - else - THROW_EX (interp_get_exception_invalid_cast (frame, ip), ip); - } else { - LOCAL_VAR (ip [1], MonoObject*) = o; - } - } else { - LOCAL_VAR (ip [1], MonoObject*) = NULL; - } - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_R_UN_I4) - LOCAL_VAR (ip [1], double) = (double)LOCAL_VAR (ip [2], guint32); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CONV_R_UN_I8) - LOCAL_VAR (ip [1], double) = (double)LOCAL_VAR (ip [2], guint64); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_UNBOX) { - MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); - NULL_CHECK (o); - MonoClass *c = (MonoClass*)frame->imethod->data_items [ip [3]]; - - if (!(m_class_get_rank (o->vtable->klass) == 0 && m_class_get_element_class (o->vtable->klass) == m_class_get_element_class (c))) - THROW_EX (interp_get_exception_invalid_cast (frame, ip), ip); - - LOCAL_VAR (ip [1], gpointer) = mono_object_unbox_internal (o); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_THROW) { - MonoException *local_ex = LOCAL_VAR (ip [1], MonoException*); - if (!local_ex) - local_ex = interp_get_exception_null_reference (frame, ip); - - THROW_EX (local_ex, ip); - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_SAFEPOINT) - SAFEPOINT; - ++ip; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLDA_UNSAFE) { - LOCAL_VAR (ip [1], gpointer) = (char*)LOCAL_VAR (ip [2], gpointer) + ip [3]; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_LDFLDA) { - MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); - NULL_CHECK (o); - LOCAL_VAR (ip [1], gpointer) = (char *)o + ip [3]; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CKNULL) { - MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); - NULL_CHECK (o); - LOCAL_VAR (ip [1], MonoObject*) = o; - ip += 3; - MINT_IN_BREAK; - } - -#define LDFLD_UNALIGNED(datatype, fieldtype, unaligned) do { \ - MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); \ - NULL_CHECK (o); \ - if (unaligned) \ - memcpy (locals + ip [1], (char *)o + ip [3], sizeof (fieldtype)); \ - else \ - LOCAL_VAR (ip [1], datatype) = * (fieldtype *)((char *)o + ip [3]) ; \ - ip += 4; \ -} while (0) - -#define LDFLD(datamem, fieldtype) LDFLD_UNALIGNED(datamem, fieldtype, FALSE) - - MINT_IN_CASE(MINT_LDFLD_I1) LDFLD(gint32, gint8); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_U1) LDFLD(gint32, guint8); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_I2) LDFLD(gint32, gint16); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_U2) LDFLD(gint32, guint16); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_I4) LDFLD(gint32, gint32); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_I8) LDFLD(gint64, gint64); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_R4) LDFLD(float, float); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_R8) LDFLD(double, double); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_O) LDFLD(gpointer, gpointer); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_I8_UNALIGNED) LDFLD_UNALIGNED(gint64, gint64, TRUE); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDFLD_R8_UNALIGNED) LDFLD_UNALIGNED(double, double, TRUE); MINT_IN_BREAK; - - MINT_IN_CASE(MINT_LDFLD_VT) { - MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); - NULL_CHECK (o); - memcpy (locals + ip [1], (char *)o + ip [3], ip [4]); - ip += 5; - MINT_IN_BREAK; - } - -#define STFLD_UNALIGNED(datatype, fieldtype, unaligned) do { \ - MonoObject *o = LOCAL_VAR (ip [1], MonoObject*); \ - NULL_CHECK (o); \ - if (unaligned) \ - memcpy ((char *)o + ip [3], locals + ip [2], sizeof (fieldtype)); \ - else \ - * (fieldtype *)((char *)o + ip [3]) = (fieldtype)(LOCAL_VAR (ip [2], datatype)); \ - ip += 4; \ -} while (0) - -#define STFLD(datamem, fieldtype) STFLD_UNALIGNED(datamem, fieldtype, FALSE) - - MINT_IN_CASE(MINT_STFLD_I1) STFLD(gint32, gint8); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STFLD_U1) STFLD(gint32, guint8); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STFLD_I2) STFLD(gint32, gint16); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STFLD_U2) STFLD(gint32, guint16); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STFLD_I4) STFLD(gint32, gint32); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STFLD_I8) STFLD(gint64, gint64); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STFLD_R4) STFLD(float, float); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STFLD_R8) STFLD(double, double); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STFLD_O) { - MonoObject *o = LOCAL_VAR (ip [1], MonoObject*); - NULL_CHECK (o); - mono_gc_wbarrier_set_field_internal (o, (char*)o + ip [3], LOCAL_VAR (ip [2], MonoObject*)); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_STFLD_I8_UNALIGNED) STFLD_UNALIGNED(gint64, gint64, TRUE); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STFLD_R8_UNALIGNED) STFLD_UNALIGNED(double, double, TRUE); MINT_IN_BREAK; - - MINT_IN_CASE(MINT_STFLD_VT_NOREF) { - MonoObject *o = LOCAL_VAR (ip [1], MonoObject*); - NULL_CHECK (o); - memcpy ((char*)o + ip [3], locals + ip [2], ip [4]); - ip += 5; - MINT_IN_BREAK; - } - - MINT_IN_CASE(MINT_STFLD_VT) { - MonoClass *klass = (MonoClass*)frame->imethod->data_items [ip [4]]; - MonoObject *o = LOCAL_VAR (ip [1], MonoObject*); - NULL_CHECK (o); - mono_value_copy_internal ((char*)o + ip [3], locals + ip [2], klass); - ip += 5; - MINT_IN_BREAK; - } - - MINT_IN_CASE(MINT_LDSFLDA) { - MonoVTable *vtable = (MonoVTable*) frame->imethod->data_items [ip [2]]; - INIT_VTABLE (vtable); - LOCAL_VAR (ip [1], gpointer) = frame->imethod->data_items [ip [3]]; - ip += 4; - MINT_IN_BREAK; - } - - MINT_IN_CASE(MINT_LDTSFLDA) { - MonoInternalThread *thread = mono_thread_internal_current (); - guint32 offset = READ32 (ip + 2); - LOCAL_VAR (ip [1], gpointer) = ((char*)thread->static_data [offset & 0x3f]) + (offset >> 6); - ip += 4; - MINT_IN_BREAK; - } - -/* We init class here to preserve cctor order */ -#define LDSFLD(datatype, fieldtype) { \ - MonoVTable *vtable = (MonoVTable*) frame->imethod->data_items [ip [2]]; \ - INIT_VTABLE (vtable); \ - LOCAL_VAR (ip [1], datatype) = * (fieldtype *)(frame->imethod->data_items [ip [3]]) ; \ - ip += 4; \ - } - - MINT_IN_CASE(MINT_LDSFLD_I1) LDSFLD(gint32, gint8); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDSFLD_U1) LDSFLD(gint32, guint8); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDSFLD_I2) LDSFLD(gint32, gint16); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDSFLD_U2) LDSFLD(gint32, guint16); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDSFLD_I4) LDSFLD(gint32, gint32); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDSFLD_I8) LDSFLD(gint64, gint64); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDSFLD_R4) LDSFLD(float, float); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDSFLD_R8) LDSFLD(double, double); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDSFLD_O) LDSFLD(gpointer, gpointer); MINT_IN_BREAK; - - MINT_IN_CASE(MINT_LDSFLD_VT) { - MonoVTable *vtable = (MonoVTable*) frame->imethod->data_items [ip [2]]; - INIT_VTABLE (vtable); - - gpointer addr = frame->imethod->data_items [ip [3]]; - guint16 size = ip [4]; - - memcpy (locals + ip [1], addr, size); - ip += 5; - MINT_IN_BREAK; - } - - MINT_IN_CASE(MINT_LDSFLD_W) { - MonoVTable *vtable = (MonoVTable*) frame->imethod->data_items [READ32 (ip + 2)]; - INIT_VTABLE (vtable); - gpointer addr = frame->imethod->data_items [READ32 (ip + 4)]; - MonoClass *klass = frame->imethod->data_items [READ32 (ip + 6)]; - stackval_from_data (m_class_get_byval_arg (klass), (stackval*)(locals + ip [1]), addr, FALSE); - ip += 8; - MINT_IN_BREAK; - } - -#define STSFLD(datatype, fieldtype) { \ - MonoVTable *vtable = (MonoVTable*) frame->imethod->data_items [ip [2]]; \ - INIT_VTABLE (vtable); \ - * (fieldtype *)(frame->imethod->data_items [ip [3]]) = (fieldtype)(LOCAL_VAR (ip [1], datatype)); \ - ip += 4; \ - } - - MINT_IN_CASE(MINT_STSFLD_I1) STSFLD(gint32, gint8); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STSFLD_U1) STSFLD(gint32, guint8); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STSFLD_I2) STSFLD(gint32, gint16); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STSFLD_U2) STSFLD(gint32, guint16); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STSFLD_I4) STSFLD(gint32, gint32); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STSFLD_I8) STSFLD(gint64, gint64); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STSFLD_R4) STSFLD(float, float); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STSFLD_R8) STSFLD(double, double); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STSFLD_O) STSFLD(gpointer, gpointer); MINT_IN_BREAK; - - MINT_IN_CASE(MINT_STSFLD_VT) { - MonoVTable *vtable = (MonoVTable*) frame->imethod->data_items [ip [2]]; - INIT_VTABLE (vtable); - gpointer addr = frame->imethod->data_items [ip [3]]; - memcpy (addr, locals + ip [1], ip [4]); - ip += 5; - MINT_IN_BREAK; - } - - MINT_IN_CASE(MINT_STSFLD_W) { - MonoVTable *vtable = (MonoVTable*) frame->imethod->data_items [READ32 (ip + 2)]; - INIT_VTABLE (vtable); - gpointer addr = frame->imethod->data_items [READ32 (ip + 4)]; - MonoClass *klass = frame->imethod->data_items [READ32 (ip + 6)]; - stackval_to_data (m_class_get_byval_arg (klass), (stackval*)(locals + ip [1]), addr, FALSE); - ip += 8; - MINT_IN_BREAK; - } - - MINT_IN_CASE(MINT_STOBJ_VT) { - MonoClass *c = (MonoClass*)frame->imethod->data_items [ip [3]]; - mono_value_copy_internal (LOCAL_VAR (ip [1], gpointer), locals + ip [2], c); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_STOBJ_VT_NOREF) { - memcpy (LOCAL_VAR (ip [1], gpointer), locals + ip [2], ip [3]); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_U8_I4) { - gint32 val = LOCAL_VAR (ip [2], gint32); - if (val < 0) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], guint64) = val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_U8_I8) { - gint64 val = LOCAL_VAR (ip [2], gint64); - if (val < 0) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], guint64) = val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_I8_U8) { - guint64 val = LOCAL_VAR (ip [2], guint64); - if (val > G_MAXINT64) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint64) = val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_U8_R4) { - float val = LOCAL_VAR (ip [2], float); - if (!mono_try_trunc_u64 (val, (guint64*)(locals + ip [1]))) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_U8_R8) { - double val = LOCAL_VAR (ip [2], double); - if (!mono_try_trunc_u64 (val, (guint64*)(locals + ip [1]))) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_I8_R4) { - float val = LOCAL_VAR (ip [2], float); - if (!mono_try_trunc_i64 (val, (gint64*)(locals + ip [1]))) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_I8_R8) { - double val = LOCAL_VAR (ip [2], double); - if (!mono_try_trunc_i64 (val, (gint64*)(locals + ip [1]))) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BOX) { - MonoVTable *vtable = (MonoVTable*)frame->imethod->data_items [ip [3]]; - - // FIXME push/pop LMF - MonoObject *o = mono_gc_alloc_obj (vtable, m_class_get_instance_size (vtable->klass)); - SET_TEMP_POINTER(o); - stackval_to_data (m_class_get_byval_arg (vtable->klass), (stackval*)(locals + ip [2]), mono_object_get_data (o), FALSE); - LOCAL_VAR (ip [1], MonoObject*) = o; - SET_TEMP_POINTER(NULL); - - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BOX_VT) { - MonoVTable *vtable = (MonoVTable*)frame->imethod->data_items [ip [3]]; - MonoClass *c = vtable->klass; - - if (G_UNLIKELY (m_class_is_byreflike (c))) { - char *str = g_strdup_printf ("Cannot box IsByRefLike type '%s.%s'", m_class_get_name_space (c), m_class_get_name (c)); - MonoException *ex = mono_exception_from_name_msg (mono_defaults.corlib, "System", "InvalidProgramException", str); - g_free (str); - THROW_EX (ex, ip); - } - - // FIXME push/pop LMF - MonoObject *o = mono_gc_alloc_obj (vtable, m_class_get_instance_size (c)); - SET_TEMP_POINTER(o); - mono_value_copy_internal (mono_object_get_data (o), locals + ip [2], c); - LOCAL_VAR (ip [1], MonoObject*) = o; - SET_TEMP_POINTER(NULL); - - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BOX_PTR) { - MonoVTable *vtable = (MonoVTable*)frame->imethod->data_items [ip [3]]; - MonoClass *c = vtable->klass; - - // FIXME push/pop LMF - MonoObject *o = mono_gc_alloc_obj (vtable, m_class_get_instance_size (c)); - SET_TEMP_POINTER(o); - mono_value_copy_internal (mono_object_get_data (o), LOCAL_VAR (ip [2], gpointer), c); - LOCAL_VAR (ip [1], MonoObject*) = o; - SET_TEMP_POINTER(NULL); - - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_BOX_NULLABLE_PTR) { - MonoClass *c = (MonoClass*)frame->imethod->data_items [ip [3]]; - - // FIXME push/pop LMF - LOCAL_VAR (ip [1], MonoObject*) = mono_nullable_box (LOCAL_VAR (ip [2], gpointer), c, error); - mono_interp_error_cleanup (error); /* FIXME: don't swallow the error */ - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_NEWARR) { - // FIXME push/pop LMF - MonoVTable *vtable = (MonoVTable*)frame->imethod->data_items [ip [3]]; - LOCAL_VAR (ip [1], MonoObject*) = (MonoObject*) mono_array_new_specific_checked (vtable, LOCAL_VAR (ip [2], gint32), error); - if (!is_ok (error)) { - THROW_EX (interp_error_convert_to_exception (frame, error, ip), ip); - } - ip += 4; - /*if (profiling_classes) { - guint count = GPOINTER_TO_UINT (g_hash_table_lookup (profiling_classes, o->vtable->klass)); - count++; - g_hash_table_insert (profiling_classes, o->vtable->klass, GUINT_TO_POINTER (count)); - }*/ - - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_NEWSTR) { - LOCAL_VAR (ip [1], MonoString*) = mono_string_new_size_checked (LOCAL_VAR (ip [2], gint32), error); - if (!is_ok (error)) { - THROW_EX (interp_error_convert_to_exception (frame, error, ip), ip); - } - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_LDLEN) { - MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); - NULL_CHECK (o); - LOCAL_VAR (ip [1], mono_u) = mono_array_length_internal ((MonoArray *)o); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_GETCHR) { - MonoString *s = LOCAL_VAR (ip [2], MonoString*); - NULL_CHECK (s); - int i32 = LOCAL_VAR (ip [3], int); - if (i32 < 0 || i32 >= mono_string_length_internal (s)) - THROW_EX (interp_get_exception_index_out_of_range (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = mono_string_chars_internal (s)[i32]; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_GETITEM_SPAN) { - MonoSpanOfVoid *span = LOCAL_VAR (ip [2], MonoSpanOfVoid*); - int index = LOCAL_VAR (ip [3], int); - NULL_CHECK (span); - - gint32 length = span->_length; - if (index < 0 || index >= length) - THROW_EX (interp_get_exception_index_out_of_range (frame, ip), ip); - - gsize element_size = (gsize)(gint16)ip [4]; - LOCAL_VAR (ip [1], gpointer) = (guint8*)span->_reference + index * element_size; - - ip += 5; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_GETITEM_LOCALSPAN) { - // Same as getitem span but we know the offset of the span structure on the stack - MonoSpanOfVoid *span = (MonoSpanOfVoid*)(locals + ip [2]); - int index = LOCAL_VAR (ip [3], int); - - gint32 length = span->_length; - if (index < 0 || index >= length) - THROW_EX (interp_get_exception_index_out_of_range (frame, ip), ip); - - gsize element_size = (gsize)(gint16)ip [4]; - LOCAL_VAR (ip [1], gpointer) = (guint8*)span->_reference + index * element_size; - - ip += 5; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_STRLEN) { - MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); - NULL_CHECK (o); - LOCAL_VAR (ip [1], gint32) = mono_string_length_internal ((MonoString*) o); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_ARRAY_RANK) { - MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); - NULL_CHECK (o); - LOCAL_VAR (ip [1], gint32) = m_class_get_rank (mono_object_class (o)); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_ARRAY_ELEMENT_SIZE) { - // FIXME push/pop LMF - MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); - NULL_CHECK (o); - LOCAL_VAR (ip [1], gint32) = mono_array_element_size (mono_object_class (o)); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_LDELEMA1) { - /* No bounds, one direction */ - MonoArray *ao = LOCAL_VAR (ip [2], MonoArray*); - NULL_CHECK (ao); - guint32 index = LOCAL_VAR (ip [3], guint32); - if (index >= ao->max_length) - THROW_EX (interp_get_exception_index_out_of_range (frame, ip), ip); - guint16 size = ip [4]; - LOCAL_VAR (ip [1], gpointer) = mono_array_addr_with_size_fast (ao, size, index); - ip += 5; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_LDELEMA) { - guint16 rank = ip [3]; - guint16 esize = ip [4]; - stackval *sp = (stackval*)(locals + ip [2]); - - MonoArray *ao = (MonoArray*) sp [0].data.o; - NULL_CHECK (ao); - - g_assert (ao->bounds); - guint32 pos = 0; - for (int i = 0; i < rank; i++) { - gint32 idx = sp [i + 1].data.i; - gint32 lower = ao->bounds [i].lower_bound; - guint32 len = ao->bounds [i].length; - if (idx < lower || (guint32)(idx - lower) >= len) - THROW_EX (interp_get_exception_index_out_of_range (frame, ip), ip); - pos = (pos * len) + (guint32)(idx - lower); - } - - LOCAL_VAR (ip [1], gpointer) = mono_array_addr_with_size_fast (ao, esize, pos); - ip += 5; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_LDELEMA_TC) { - // FIXME push/pop LMF - stackval *sp = (stackval*)(locals + ip [2]); - - MonoObject *o = (MonoObject*) sp [0].data.o; - NULL_CHECK (o); - - MonoClass *klass = (MonoClass*)frame->imethod->data_items [ip [3]]; - MonoException *address_ex = ves_array_element_address (frame, klass, (MonoArray *) o, (gpointer*)(locals + ip [1]), sp + 1, TRUE); - if (address_ex) - THROW_EX (address_ex, ip); - ip += 4; - MINT_IN_BREAK; - } - -#define LDELEM(datatype,elemtype) do { \ - MonoArray *o = LOCAL_VAR (ip [2], MonoArray*); \ - NULL_CHECK (o); \ - guint32 aindex = LOCAL_VAR (ip [3], guint32); \ - if (aindex >= mono_array_length_internal (o)) \ - THROW_EX (interp_get_exception_index_out_of_range (frame, ip), ip); \ - LOCAL_VAR (ip [1], datatype) = mono_array_get_fast (o, elemtype, aindex); \ - ip += 4; \ -} while (0) - MINT_IN_CASE(MINT_LDELEM_I1) LDELEM(gint32, gint8); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDELEM_U1) LDELEM(gint32, guint8); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDELEM_I2) LDELEM(gint32, gint16); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDELEM_U2) LDELEM(gint32, guint16); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDELEM_I4) LDELEM(gint32, gint32); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDELEM_U4) LDELEM(gint32, guint32); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDELEM_I8) LDELEM(gint64, guint64); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDELEM_R4) LDELEM(float, float); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDELEM_R8) LDELEM(double, double); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDELEM_REF) LDELEM(gpointer, gpointer); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDELEM_VT) { - MonoArray *o = LOCAL_VAR (ip [2], MonoArray*); - NULL_CHECK (o); - mono_u aindex = LOCAL_VAR (ip [3], gint32); - if (aindex >= mono_array_length_internal (o)) - THROW_EX (interp_get_exception_index_out_of_range (frame, ip), ip); - - guint16 size = ip [4]; - char *src_addr = mono_array_addr_with_size_fast ((MonoArray *) o, size, aindex); - memcpy (locals + ip [1], src_addr, size); - - ip += 5; - MINT_IN_BREAK; - } -#define STELEM_PROLOG(o, aindex) do { \ - o = LOCAL_VAR (ip [1], MonoArray*); \ - NULL_CHECK (o); \ - aindex = LOCAL_VAR (ip [2], gint32); \ - if (aindex >= mono_array_length_internal (o)) \ - THROW_EX (interp_get_exception_index_out_of_range (frame, ip), ip); \ -} while (0) - -#define STELEM(datatype, elemtype) do { \ - MonoArray *o; \ - guint32 aindex; \ - STELEM_PROLOG(o, aindex); \ - mono_array_set_fast (o, elemtype, aindex, LOCAL_VAR (ip [3], datatype)); \ - ip += 4; \ -} while (0) - MINT_IN_CASE(MINT_STELEM_I1) STELEM(gint32, gint8); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STELEM_U1) STELEM(gint32, guint8); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STELEM_I2) STELEM(gint32, gint16); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STELEM_U2) STELEM(gint32, guint16); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STELEM_I4) STELEM(gint32, gint32); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STELEM_I8) STELEM(gint64, gint64); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STELEM_R4) STELEM(float, float); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STELEM_R8) STELEM(double, double); MINT_IN_BREAK; - MINT_IN_CASE(MINT_STELEM_REF_UNCHECKED) { - MonoArray *o; - guint32 aindex; - STELEM_PROLOG(o, aindex); - mono_array_setref_fast ((MonoArray *) o, aindex, LOCAL_VAR (ip [3], MonoObject*)); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_STELEM_REF) { - MonoArray *o; - guint32 aindex; - STELEM_PROLOG(o, aindex); - MonoObject *ref = LOCAL_VAR (ip [3], MonoObject*); - - if (ref) { - // FIXME push/pop LMF - gboolean isinst = mono_interp_isinst (ref, m_class_get_element_class (mono_object_class (o))); - if (!isinst) - THROW_EX (interp_get_exception_array_type_mismatch (frame, ip), ip); - } - mono_array_setref_fast ((MonoArray *) o, aindex, ref); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_STELEM_VT) { - MonoArray *o = LOCAL_VAR (ip [1], MonoArray*); - NULL_CHECK (o); - guint32 aindex = LOCAL_VAR (ip [2], guint32); - if (aindex >= mono_array_length_internal (o)) - THROW_EX (interp_get_exception_index_out_of_range (frame, ip), ip); - - guint16 size = ip [5]; - char *dst_addr = mono_array_addr_with_size_fast ((MonoArray *) o, size, aindex); - MonoClass *klass_vt = (MonoClass*)frame->imethod->data_items [ip [4]]; - mono_value_copy_internal (dst_addr, locals + ip [3], klass_vt); - ip += 6; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_STELEM_VT_NOREF) { - MonoArray *o = LOCAL_VAR (ip [1], MonoArray*); - NULL_CHECK (o); - guint32 aindex = LOCAL_VAR (ip [2], guint32); - if (aindex >= mono_array_length_internal (o)) - THROW_EX (interp_get_exception_index_out_of_range (frame, ip), ip); - - guint16 size = ip [5]; - char *dst_addr = mono_array_addr_with_size_fast ((MonoArray *) o, size, aindex); - memcpy (dst_addr, locals + ip [3], size); - ip += 6; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_I4_U4) { - gint32 val = LOCAL_VAR (ip [2], gint32); - if (val < 0) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_I4_I8) { - gint64 val = LOCAL_VAR (ip [2], gint64); - if (val < G_MININT32 || val > G_MAXINT32) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = (gint32) val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_I4_U8) { - guint64 val = LOCAL_VAR (ip [2], guint64); - if (val > G_MAXINT32) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = (gint32) val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_I4_R4) { - float val = LOCAL_VAR (ip [2], float); - double val_r8 = (double)val; - if (val_r8 > ((double)G_MININT32 - 1) && val_r8 < ((double)G_MAXINT32 + 1)) - LOCAL_VAR (ip [1], gint32) = (gint32) val; - else - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_I4_R8) { - double val = LOCAL_VAR (ip [2], double); - if (val > ((double)G_MININT32 - 1) && val < ((double)G_MAXINT32 + 1)) - LOCAL_VAR (ip [1], gint32) = (gint32) val; - else - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_U4_I4) { - gint32 val = LOCAL_VAR (ip [2], gint32); - if (val < 0) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_U4_I8) { - gint64 val = LOCAL_VAR (ip [2], gint64); - if (val < 0 || val > G_MAXUINT32) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = (guint32) val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_U4_R4) { - float val = LOCAL_VAR (ip [2], float); - double val_r8 = val; - if (val_r8 > -1.0 && val_r8 < ((double)G_MAXUINT32 + 1)) - LOCAL_VAR (ip [1], gint32) = (guint32)val; - else - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_U4_R8) { - double val = LOCAL_VAR (ip [2], double); - if (val > -1.0 && val < ((double)G_MAXUINT32 + 1)) - LOCAL_VAR (ip [1], gint32) = (guint32)val; - else - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_I2_I4) { - gint32 val = LOCAL_VAR (ip [2], gint32); - if (val < G_MININT16 || val > G_MAXINT16) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = (gint16)val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_I2_U4) { - gint32 val = LOCAL_VAR (ip [2], gint32); - if (val < 0 || val > G_MAXINT16) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = (gint16)val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_I2_I8) { - gint64 val = LOCAL_VAR (ip [2], gint64); - if (val < G_MININT16 || val > G_MAXINT16) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = (gint16) val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_I2_U8) { - gint64 val = LOCAL_VAR (ip [2], gint64); - if (val < 0 || val > G_MAXINT16) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = (gint16) val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_I2_R4) { - float val = LOCAL_VAR (ip [2], float); - if (val > (G_MININT16 - 1) && val < (G_MAXINT16 + 1)) - LOCAL_VAR (ip [1], gint32) = (gint16) val; - else - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_I2_R8) { - double val = LOCAL_VAR (ip [2], double); - if (val > (G_MININT16 - 1) && val < (G_MAXINT16 + 1)) - LOCAL_VAR (ip [1], gint32) = (gint16) val; - else - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_U2_I4) { - gint32 val = LOCAL_VAR (ip [2], gint32); - if (val < 0 || val > G_MAXUINT16) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_U2_I8) { - gint64 val = LOCAL_VAR (ip [2], gint64); - if (val < 0 || val > G_MAXUINT16) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = (guint16) val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_U2_R4) { - float val = LOCAL_VAR (ip [2], float); - if (val > -1.0f && val < (G_MAXUINT16 + 1)) - LOCAL_VAR (ip [1], gint32) = (guint16) val; - else - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_U2_R8) { - double val = LOCAL_VAR (ip [2], double); - if (val > -1.0 && val < (G_MAXUINT16 + 1)) - LOCAL_VAR (ip [1], gint32) = (guint16) val; - else - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_I1_I4) { - gint32 val = LOCAL_VAR (ip [2], gint32); - if (val < G_MININT8 || val > G_MAXINT8) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_I1_U4) { - gint32 val = LOCAL_VAR (ip [2], gint32); - if (val < 0 || val > G_MAXINT8) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_I1_I8) { - gint64 val = LOCAL_VAR (ip [2], gint64); - if (val < G_MININT8 || val > G_MAXINT8) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = (gint8) val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_I1_U8) { - gint64 val = LOCAL_VAR (ip [2], gint64); - if (val < 0 || val > G_MAXINT8) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = (gint8) val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_I1_R4) { - float val = LOCAL_VAR (ip [2], float); - if (val > (G_MININT8 - 1) && val < (G_MAXINT8 + 1)) - LOCAL_VAR (ip [1], gint32) = (gint8) val; - else - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_I1_R8) { - double val = LOCAL_VAR (ip [2], double); - if (val > (G_MININT8 - 1) && val < (G_MAXINT8 + 1)) - LOCAL_VAR (ip [1], gint32) = (gint8) val; - else - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_U1_I4) { - gint32 val = LOCAL_VAR (ip [2], gint32); - if (val < 0 || val > G_MAXUINT8) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_U1_I8) { - gint64 val = LOCAL_VAR (ip [2], gint64); - if (val < 0 || val > G_MAXUINT8) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = (guint8) val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_U1_R4) { - float val = LOCAL_VAR (ip [2], float); - if (val > -1.0f && val < (G_MAXUINT8 + 1)) - LOCAL_VAR (ip [1], gint32) = (guint8)val; - else - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CONV_OVF_U1_R8) { - double val = LOCAL_VAR (ip [2], double); - if (val > -1.0 && val < (G_MAXUINT8 + 1)) - LOCAL_VAR (ip [1], gint32) = (guint8)val; - else - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CKFINITE_R4) { - float val = LOCAL_VAR (ip [2], float); - if (!mono_isfinite (val)) - THROW_EX (interp_get_exception_arithmetic (frame, ip), ip); - LOCAL_VAR (ip [1], float) = val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CKFINITE_R8) { - double val = LOCAL_VAR (ip [2], double); - if (!mono_isfinite (val)) - THROW_EX (interp_get_exception_arithmetic (frame, ip), ip); - LOCAL_VAR (ip [1], double) = val; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_MKREFANY) { - MonoClass *c = (MonoClass*)frame->imethod->data_items [ip [3]]; - - gpointer addr = LOCAL_VAR (ip [2], gpointer); - /* Write the typedref value */ - MonoTypedRef *tref = (MonoTypedRef*)(locals + ip [1]); - tref->klass = c; - tref->type = m_class_get_byval_arg (c); - tref->value = addr; - - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_REFANYTYPE) { - MonoTypedRef *tref = (MonoTypedRef*)(locals + ip [2]); - - LOCAL_VAR (ip [1], gpointer) = tref->type; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_REFANYVAL) { - MonoTypedRef *tref = (MonoTypedRef*)(locals + ip [2]); - - MonoClass *c = (MonoClass*)frame->imethod->data_items [ip [3]]; - if (c != tref->klass) - THROW_EX (interp_get_exception_invalid_cast (frame, ip), ip); - - LOCAL_VAR (ip [1], gpointer) = tref->value; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_ADD_OVF_I4) { - gint32 i1 = LOCAL_VAR (ip [2], gint32); - gint32 i2 = LOCAL_VAR (ip [3], gint32); - if (CHECK_ADD_OVERFLOW (i1, i2)) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = i1 + i2; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_ADD_OVF_I8) { - gint64 l1 = LOCAL_VAR (ip [2], gint64); - gint64 l2 = LOCAL_VAR (ip [3], gint64); - if (CHECK_ADD_OVERFLOW64 (l1, l2)) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint64) = l1 + l2; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_ADD_OVF_UN_I4) { - guint32 i1 = LOCAL_VAR (ip [2], guint32); - guint32 i2 = LOCAL_VAR (ip [3], guint32); - if (CHECK_ADD_OVERFLOW_UN (i1, i2)) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], guint32) = i1 + i2; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_ADD_OVF_UN_I8) { - guint64 l1 = LOCAL_VAR (ip [2], guint64); - guint64 l2 = LOCAL_VAR (ip [3], guint64); - if (CHECK_ADD_OVERFLOW64_UN (l1, l2)) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], guint64) = l1 + l2; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_MUL_OVF_I4) { - gint32 i1 = LOCAL_VAR (ip [2], gint32); - gint32 i2 = LOCAL_VAR (ip [3], gint32); - if (CHECK_MUL_OVERFLOW (i1, i2)) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = i1 * i2; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_MUL_OVF_I8) { - gint64 l1 = LOCAL_VAR (ip [2], gint64); - gint64 l2 = LOCAL_VAR (ip [3], gint64); - if (CHECK_MUL_OVERFLOW64 (l1, l2)) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint64) = l1 * l2; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_MUL_OVF_UN_I4) { - guint32 i1 = LOCAL_VAR (ip [2], guint32); - guint32 i2 = LOCAL_VAR (ip [3], guint32); - if (CHECK_MUL_OVERFLOW_UN (i1, i2)) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], guint32) = i1 * i2; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_MUL_OVF_UN_I8) { - guint64 l1 = LOCAL_VAR (ip [2], guint64); - guint64 l2 = LOCAL_VAR (ip [3], guint64); - if (CHECK_MUL_OVERFLOW64_UN (l1, l2)) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], guint64) = l1 * l2; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_SUB_OVF_I4) { - gint32 i1 = LOCAL_VAR (ip [2], gint32); - gint32 i2 = LOCAL_VAR (ip [3], gint32); - if (CHECK_SUB_OVERFLOW (i1, i2)) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint32) = i1 - i2; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_SUB_OVF_I8) { - gint64 l1 = LOCAL_VAR (ip [2], gint64); - gint64 l2 = LOCAL_VAR (ip [3], gint64); - if (CHECK_SUB_OVERFLOW64 (l1, l2)) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint64) = l1 - l2; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_SUB_OVF_UN_I4) { - guint32 i1 = LOCAL_VAR (ip [2], guint32); - guint32 i2 = LOCAL_VAR (ip [3], guint32); - if (CHECK_SUB_OVERFLOW_UN (i1, i2)) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], guint32) = i1 - i2; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_SUB_OVF_UN_I8) { - guint64 l1 = LOCAL_VAR (ip [2], guint64); - guint64 l2 = LOCAL_VAR (ip [3], guint64); - if (CHECK_SUB_OVERFLOW64_UN (l1, l2)) - THROW_EX (interp_get_exception_overflow (frame, ip), ip); - LOCAL_VAR (ip [1], gint64) = l1 - l2; - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_ENDFINALLY) { - guint16 clause_index = *(ip + 1); - - guint16 *ret_ip = *(guint16**)(locals + frame->imethod->clause_data_offsets [clause_index]); - if (!ret_ip) { - // this clause was called from EH, return to eh - g_assert (clause_args && clause_args->exec_frame == frame); - goto exit_clause; - } - ip = ret_ip; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_CALL_HANDLER) - MINT_IN_CASE(MINT_CALL_HANDLER_S) { - gboolean short_offset = *ip == MINT_CALL_HANDLER_S; - const guint16 *ret_ip = short_offset ? (ip + 3) : (ip + 4); - guint16 clause_index = *(ret_ip - 1); - - *(const guint16**)(locals + frame->imethod->clause_data_offsets [clause_index]) = ret_ip; - - // jump to clause - ip += short_offset ? (gint16)*(ip + 1) : (gint32)READ32 (ip + 1); - MINT_IN_BREAK; - } - - MINT_IN_CASE(MINT_LEAVE_CHECK) - MINT_IN_CASE(MINT_LEAVE_S_CHECK) { - int leave_opcode = *ip; - - if (frame->imethod->method->wrapper_type != MONO_WRAPPER_RUNTIME_INVOKE) { - MonoException *abort_exc = mono_interp_leave (frame); - if (abort_exc) - THROW_EX (abort_exc, ip); - } - - gboolean const short_offset = leave_opcode == MINT_LEAVE_S_CHECK; - ip += short_offset ? (gint16)*(ip + 1) : (gint32)READ32 (ip + 1); - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_ICALL) { - stackval *ret = (stackval*)(locals + ip [1]); - stackval *args = (stackval*)(locals + ip [2]); - MintICallSig icall_sig = (MintICallSig)ip [3]; - gpointer target_ip = frame->imethod->data_items [ip [4]]; - - frame->state.ip = ip + 5; - do_icall_wrapper (frame, NULL, icall_sig, ret, args, target_ip, FALSE, &gc_transitions); - EXCEPTION_CHECKPOINT; - CHECK_RESUME_STATE (context); - ip += 5; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_LDPTR) - LOCAL_VAR (ip [1], gpointer) = frame->imethod->data_items [ip [2]]; - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_MONO_NEWOBJ) - // FIXME push/pop LMF - LOCAL_VAR (ip [1], MonoObject*) = mono_interp_new ((MonoClass*)frame->imethod->data_items [ip [2]]); // FIXME: do not swallow the error - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_MONO_RETOBJ) - // FIXME push/pop LMF - stackval_from_data (mono_method_signature_internal (frame->imethod->method)->ret, frame->stack, LOCAL_VAR (ip [1], gpointer), - mono_method_signature_internal (frame->imethod->method)->pinvoke && !mono_method_signature_internal (frame->imethod->method)->marshalling_disabled); - frame_data_allocator_pop (&context->data_stack, frame); - goto exit_frame; - MINT_IN_CASE(MINT_MONO_MEMORY_BARRIER) { - ++ip; - mono_memory_barrier (); - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_MONO_EXCHANGE_U1) { - guint8 *dest = LOCAL_VAR (ip [2], guint8*); - guint8 exch = LOCAL_VAR (ip[3], guint8); - NULL_CHECK(dest); - LOCAL_VAR(ip[1], guint32) = (guint32)mono_atomic_xchg_u8(dest, exch); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_MONO_EXCHANGE_I1) { - gint8 *dest = LOCAL_VAR (ip [2], gint8*); - gint8 exch = LOCAL_VAR (ip[3], gint8); - NULL_CHECK(dest); - LOCAL_VAR(ip[1], gint32) = (gint32)(gint8)mono_atomic_xchg_u8((guint8*)dest, exch); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_MONO_EXCHANGE_U2) { - guint16 *dest = LOCAL_VAR (ip [2], guint16*); - guint16 exch = LOCAL_VAR (ip[3], guint16); - NULL_CHECK(dest); - LOCAL_VAR(ip[1], guint32) = (guint32)mono_atomic_xchg_u16(dest, exch); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_MONO_EXCHANGE_I2) { - gint16 *dest = LOCAL_VAR (ip [2], gint16*); - gint16 exch = LOCAL_VAR (ip[3], gint16); - NULL_CHECK(dest); - LOCAL_VAR(ip[1], gint32) = (gint32)(gint16)mono_atomic_xchg_u16((guint16*)dest, exch); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_MONO_EXCHANGE_I4) { - gint32 *dest = LOCAL_VAR (ip [2], gint32*); - gint32 exch = LOCAL_VAR (ip[3], gint32); - NULL_CHECK(dest); - LOCAL_VAR(ip[1], gint32) = mono_atomic_xchg_i32(dest, exch); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_MONO_EXCHANGE_I8) { - gboolean flag = FALSE; - gint64 *dest = LOCAL_VAR (ip [2], gint64*); - gint64 exch = LOCAL_VAR (ip [3], gint64); - NULL_CHECK(dest); -#if SIZEOF_VOID_P == 4 - if (G_UNLIKELY (((size_t)dest) & 0x7)) { - gint64 result; - mono_interlocked_lock (); - result = *dest; - *dest = exch; - mono_interlocked_unlock (); - LOCAL_VAR (ip [1], gint64) = result; - flag = TRUE; - } -#endif - if (!flag) - LOCAL_VAR (ip [1], gint64) = mono_atomic_xchg_i64 (dest, exch); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_MONO_CMPXCHG_U1) { - guint8 *dest = LOCAL_VAR(ip[2], guint8*); - guint8 value = LOCAL_VAR(ip[3], guint8); - guint8 comparand = LOCAL_VAR(ip[4], guint8); - NULL_CHECK(dest); - - LOCAL_VAR(ip[1], guint32) = (guint32)mono_atomic_cas_u8(dest, value, comparand); - ip += 5; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_MONO_CMPXCHG_I1) { - gint8 *dest = LOCAL_VAR(ip[2], gint8*); - gint8 value = LOCAL_VAR(ip[3], gint8); - gint8 comparand = LOCAL_VAR(ip[4], gint8); - NULL_CHECK(dest); - - LOCAL_VAR(ip[1], gint32) = (gint32)(gint8)mono_atomic_cas_u8((guint8*)dest, value, comparand); - ip += 5; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_MONO_CMPXCHG_U2) { - guint16 *dest = LOCAL_VAR(ip[2], guint16*); - guint16 value = LOCAL_VAR(ip[3], guint16); - guint16 comparand = LOCAL_VAR(ip[4], guint16); - NULL_CHECK(dest); - - LOCAL_VAR(ip[1], guint32) = (guint32)mono_atomic_cas_u16(dest, value, comparand); - ip += 5; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_MONO_CMPXCHG_I2) { - gint16 *dest = LOCAL_VAR(ip[2], gint16*); - gint16 value = LOCAL_VAR(ip[3], gint16); - gint16 comparand = LOCAL_VAR(ip[4], gint16); - NULL_CHECK(dest); - - LOCAL_VAR(ip[1], gint32) = (gint32)(gint16)mono_atomic_cas_u16((guint16*)dest, value, comparand); - ip += 5; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_MONO_CMPXCHG_I4) { - gint32 *dest = LOCAL_VAR(ip[2], gint32*); - gint32 value = LOCAL_VAR(ip[3], gint32); - gint32 comparand = LOCAL_VAR(ip[4], gint32); - NULL_CHECK(dest); - - LOCAL_VAR(ip[1], gint32) = mono_atomic_cas_i32(dest, value, comparand); - ip += 5; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_MONO_CMPXCHG_I8) { - gboolean flag = FALSE; - gint64 *dest = LOCAL_VAR(ip[2], gint64*); - gint64 value = LOCAL_VAR(ip[3], gint64); - gint64 comparand = LOCAL_VAR(ip[4], gint64); - NULL_CHECK(dest); - -#if SIZEOF_VOID_P == 4 - if (G_UNLIKELY ((size_t)dest & 0x7)) { - gint64 old; - mono_interlocked_lock (); - old = *dest; - if (old == comparand) - *dest = value; - mono_interlocked_unlock (); - LOCAL_VAR(ip[1], gint64) = old; - flag = TRUE; - } -#endif - - if (!flag) - LOCAL_VAR(ip[1], gint64) = mono_atomic_cas_i64(dest, value, comparand); - ip += 5; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_MONO_LDDOMAIN) - LOCAL_VAR (ip [1], gpointer) = mono_domain_get (); - ip += 2; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_MONO_ENABLE_GCTRANS) - gc_transitions = TRUE; - ip++; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SDB_INTR_LOC) - if (G_UNLIKELY (ss_enabled)) { - typedef void (*T) (void); - static T ss_tramp; - - if (!ss_tramp) { - // FIXME push/pop LMF - void *tramp = mini_get_single_step_trampoline (); - mono_memory_barrier (); - ss_tramp = (T)tramp; - } - - /* - * Make this point to the MINT_SDB_SEQ_POINT instruction which follows this since - * the address of that instruction is stored as the seq point address. Add also - * 1 to offset subtraction from interp_frame_get_ip. - */ - frame->state.ip = ip + 2; - - /* - * Use the same trampoline as the JIT. This ensures that - * the debugger has the context for the last interpreter - * native frame. - */ - do_debugger_tramp (ss_tramp, frame); - - CHECK_RESUME_STATE (context); - } - ++ip; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SDB_SEQ_POINT) - /* Just a placeholder for a breakpoint */ -#if HOST_WASI - if (debugger_enabled) - mono_component_debugger()->receive_and_process_command_from_debugger_agent (); -#endif - ++ip; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SDB_BREAKPOINT) { - typedef void (*T) (void); - static T bp_tramp; - if (!bp_tramp) { - // FIXME push/pop LMF - void *tramp = mini_get_breakpoint_trampoline (); - mono_memory_barrier (); - bp_tramp = (T)tramp; - } - - /* Add 1 to offset subtraction from interp_frame_get_ip */ - frame->state.ip = ip + 1; - - /* Use the same trampoline as the JIT */ - do_debugger_tramp (bp_tramp, frame); - - CHECK_RESUME_STATE (context); - - ++ip; - MINT_IN_BREAK; - } - -#define RELOP(datatype, op) \ - LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], datatype) op LOCAL_VAR (ip [3], datatype); \ - ip += 4; - -#define RELOP_FP(datatype, op, noorder) do { \ - datatype a1 = LOCAL_VAR (ip [2], datatype); \ - datatype a2 = LOCAL_VAR (ip [3], datatype); \ - if (mono_isunordered (a1, a2)) \ - LOCAL_VAR (ip [1], gint32) = noorder; \ - else \ - LOCAL_VAR (ip [1], gint32) = a1 op a2; \ - ip += 4; \ -} while (0) - - MINT_IN_CASE(MINT_CEQ_I4) - RELOP(gint32, ==); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CEQ0_I4) - LOCAL_VAR (ip [1], gint32) = (LOCAL_VAR (ip [2], gint32) == 0); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CEQ_I8) - RELOP(gint64, ==); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CEQ_R4) - RELOP_FP(float, ==, 0); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CEQ_R8) - RELOP_FP(double, ==, 0); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CNE_I4) - RELOP(gint32, !=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CNE_I8) - RELOP(gint64, !=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CNE_R4) - RELOP_FP(float, !=, 1); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CNE_R8) - RELOP_FP(double, !=, 1); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CGT_I4) - RELOP(gint32, >); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CGT_I8) - RELOP(gint64, >); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CGT_R4) - RELOP_FP(float, >, 0); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CGT_R8) - RELOP_FP(double, >, 0); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CGE_I4) - RELOP(gint32, >=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CGE_I8) - RELOP(gint64, >=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CGE_R4) - RELOP_FP(float, >=, 0); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CGE_R8) - RELOP_FP(double, >=, 0); - MINT_IN_BREAK; - -#define RELOP_CAST(datatype, op) \ - LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], datatype) op LOCAL_VAR (ip [3], datatype); \ - ip += 4; - - MINT_IN_CASE(MINT_CGE_UN_I4) - RELOP_CAST(guint32, >=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CGE_UN_I8) - RELOP_CAST(guint64, >=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CGT_UN_I4) - RELOP_CAST(guint32, >); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CGT_UN_I8) - RELOP_CAST(guint64, >); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CGT_UN_R4) - RELOP_FP(float, >, 1); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CGT_UN_R8) - RELOP_FP(double, >, 1); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CLT_I4) - RELOP(gint32, <); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CLT_I8) - RELOP(gint64, <); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CLT_R4) - RELOP_FP(float, <, 0); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CLT_R8) - RELOP_FP(double, <, 0); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CLT_UN_I4) - RELOP_CAST(guint32, <); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CLT_UN_I8) - RELOP_CAST(guint64, <); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CLT_UN_R4) - RELOP_FP(float, <, 1); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CLT_UN_R8) - RELOP_FP(double, <, 1); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CLE_I4) - RELOP(gint32, <=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CLE_I8) - RELOP(gint64, <=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CLE_UN_I4) - RELOP_CAST(guint32, <=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CLE_UN_I8) - RELOP_CAST(guint64, <=); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CLE_R4) - RELOP_FP(float, <=, 0); - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CLE_R8) - RELOP_FP(double, <=, 0); - MINT_IN_BREAK; - -#undef RELOP -#undef RELOP_FP -#undef RELOP_CAST - - MINT_IN_CASE(MINT_LDFTN_ADDR) { - LOCAL_VAR (ip [1], gpointer) = frame->imethod->data_items [ip [2]]; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_LDFTN) { - InterpMethod *m = (InterpMethod*)frame->imethod->data_items [ip [2]]; - - // FIXME push/pop LMF - LOCAL_VAR (ip [1], gpointer) = imethod_to_ftnptr (m, FALSE); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_LDVIRTFTN) { - InterpMethod *virtual_method = (InterpMethod*)frame->imethod->data_items [ip [3]]; - MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); - NULL_CHECK (o); - - // FIXME push/pop LMF - InterpMethod *res_method = get_virtual_method (virtual_method, o->vtable); - gboolean need_unbox = m_class_is_valuetype (res_method->method->klass) && !m_class_is_valuetype (virtual_method->method->klass); - LOCAL_VAR (ip [1], gpointer) = imethod_to_ftnptr (res_method, need_unbox); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_LDFTN_DYNAMIC) { - error_init_reuse (error); - - MonoMethod *local_cmethod = LOCAL_VAR (ip [2], MonoMethod*); - - if (local_cmethod->is_generic || mono_class_is_gtd (local_cmethod->klass)) { - MonoException *ex = mono_exception_from_name_msg (mono_defaults.corlib, "System", "InvalidOperationException", ""); - THROW_EX (ex, ip); - } - - // FIXME push/pop LMF - if (G_UNLIKELY (mono_method_has_unmanaged_callers_only_attribute (local_cmethod))) { - local_cmethod = mono_marshal_get_managed_wrapper (local_cmethod, NULL, (MonoGCHandle)0, error); - mono_error_assert_ok (error); - gpointer addr = mini_get_interp_callbacks ()->create_method_pointer (local_cmethod, TRUE, error); - LOCAL_VAR (ip [1], gpointer) = addr; - } else { - InterpMethod *m = mono_interp_get_imethod (local_cmethod); - LOCAL_VAR (ip [1], gpointer) = imethod_to_ftnptr (m, FALSE); - } - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_PROF_ENTER) { - guint16 flag = ip [1]; - ip += 2; - INTERP_PROFILER_RAISE(enter, ENTER); - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_PROF_SAMPLEPOINT) { - guint16 flag = ip [1]; - ip += 2; - INTERP_PROFILER_RAISE(samplepoint, SAMPLEPOINT); - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_PROF_EXIT) - MINT_IN_CASE(MINT_PROF_EXIT_VOID) { - gboolean is_void = ip [0] == MINT_PROF_EXIT_VOID; - guint16 flag = is_void ? ip [1] : ip [2]; - // Set retval - if (!is_void) { - int i32 = READ32 (ip + 3); - if (i32) - memmove (frame->retval, locals + ip [1], i32); - else - frame->retval [0] = LOCAL_VAR (ip [1], stackval); - } - INTERP_PROFILER_RAISE(leave, LEAVE); - frame_data_allocator_pop (&context->data_stack, frame); - goto exit_frame; - } - MINT_IN_CASE(MINT_PROF_COVERAGE_STORE) { - ++ip; - guint32 *p = (guint32*)GINT_TO_POINTER (READ64 (ip)); - *p = 1; - ip += 4; - MINT_IN_BREAK; - } - - MINT_IN_CASE(MINT_TIER_ENTER_METHOD) { - frame->imethod->entry_count++; - if (frame->imethod->entry_count > INTERP_TIER_ENTRY_LIMIT && !clause_args) - ip = mono_interp_tier_up_frame_enter (frame, context); - else - ip++; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_TIER_PATCHPOINT) { - frame->imethod->entry_count++; - if (frame->imethod->entry_count > INTERP_TIER_ENTRY_LIMIT && !clause_args) - ip = mono_interp_tier_up_frame_patchpoint (frame, context, ip [1]); - else - ip += 2; - MINT_IN_BREAK; - } - - MINT_IN_CASE(MINT_LDLOCA_S) - LOCAL_VAR (ip [1], gpointer) = locals + ip [2]; - // ip[3] reserved for size data for jiterpreter - ip += 4; - MINT_IN_BREAK; - -#define MOV(argtype1,argtype2) \ - LOCAL_VAR (ip [1], argtype1) = LOCAL_VAR (ip [2], argtype2); \ - ip += 3; - // When loading from a local, we might need to sign / zero extend to 4 bytes - // which is our minimum "register" size in interp. They are only needed when - // the address of the local is taken and we should try to optimize them out - // because the local can't be propagated. - MINT_IN_CASE(MINT_MOV_I4_I1) MOV(gint32, gint8); MINT_IN_BREAK; - MINT_IN_CASE(MINT_MOV_I4_U1) MOV(gint32, guint8); MINT_IN_BREAK; - MINT_IN_CASE(MINT_MOV_I4_I2) MOV(gint32, gint16); MINT_IN_BREAK; - MINT_IN_CASE(MINT_MOV_I4_U2) MOV(gint32, guint16); MINT_IN_BREAK; - // These moves are used to store into the field of a local valuetype - // No sign extension is needed, we just move bytes from the execution - // stack, no additional conversion is needed. - MINT_IN_CASE(MINT_MOV_1) MOV(gint8, gint8); MINT_IN_BREAK; - MINT_IN_CASE(MINT_MOV_2) MOV(gint16, gint16); MINT_IN_BREAK; - // Normal moves between locals - MINT_IN_CASE(MINT_MOV_4) MOV(guint32, guint32); MINT_IN_BREAK; - MINT_IN_CASE(MINT_MOV_8) MOV(guint64, guint64); MINT_IN_BREAK; - - MINT_IN_CASE(MINT_MOV_VT) { - guint16 size = ip [3]; - memmove (locals + ip [1], locals + ip [2], size); - ip += 4; - MINT_IN_BREAK; - } - - MINT_IN_CASE(MINT_MOV_8_2) - LOCAL_VAR (ip [1], guint64) = LOCAL_VAR (ip [2], guint64); - LOCAL_VAR (ip [3], guint64) = LOCAL_VAR (ip [4], guint64); - ip += 5; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_MOV_8_3) - LOCAL_VAR (ip [1], guint64) = LOCAL_VAR (ip [2], guint64); - LOCAL_VAR (ip [3], guint64) = LOCAL_VAR (ip [4], guint64); - LOCAL_VAR (ip [5], guint64) = LOCAL_VAR (ip [6], guint64); - ip += 7; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_MOV_8_4) - LOCAL_VAR (ip [1], guint64) = LOCAL_VAR (ip [2], guint64); - LOCAL_VAR (ip [3], guint64) = LOCAL_VAR (ip [4], guint64); - LOCAL_VAR (ip [5], guint64) = LOCAL_VAR (ip [6], guint64); - LOCAL_VAR (ip [7], guint64) = LOCAL_VAR (ip [8], guint64); - ip += 9; - MINT_IN_BREAK; - - MINT_IN_CASE(MINT_LOCALLOC) { - int len = LOCAL_VAR (ip [2], gint32); - gpointer mem; - if (len > 0) { - // We align len to 8 so we can safely load all primitive types on all platforms - mem = frame_data_allocator_alloc (&context->data_stack, frame, ALIGN_TO (len, sizeof (gint64))); - - if (frame->imethod->init_locals) - memset (mem, 0, len); - } else { - mem = NULL; - } - LOCAL_VAR (ip [1], gpointer) = mem; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_ENDFILTER) - /* top of stack is result of filter */ - frame->retval->data.i = LOCAL_VAR (ip [1], gint32); - goto exit_clause; - MINT_IN_CASE(MINT_ZEROBLK) - memset (LOCAL_VAR (ip [1], gpointer), 0, LOCAL_VAR (ip [2], gsize)); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_ZEROBLK_IMM) - memset (LOCAL_VAR (ip [1], gpointer), 0, ip [2]); - ip += 3; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_CPBLK) { - gpointer dest = LOCAL_VAR (ip [1], gpointer); - gpointer src = LOCAL_VAR (ip [2], gpointer); - guint32 size = LOCAL_VAR (ip [3], guint32); - if (size && (!dest || !src)) - THROW_EX (interp_get_exception_null_reference(frame, ip), ip); - else - memcpy (dest, src, size); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_INITBLK) { - gpointer dest = LOCAL_VAR (ip [1], gpointer); - guint32 size = LOCAL_VAR (ip [3], guint32); - if (size) - NULL_CHECK (dest); - memset (dest, LOCAL_VAR (ip [2], gint32), size); - ip += 4; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_RETHROW) { - int exvar_offset = ip [1]; - THROW_EX_GENERAL (*(MonoException**)(frame_locals (frame) + exvar_offset), ip, TRUE); - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_MONO_RETHROW) { - /* - * need to clarify what this should actually do: - * - * Takes an exception from the stack and rethrows it. - * This is useful for wrappers that don't want to have to - * use CEE_THROW and lose the exception stacktrace. - */ - - MonoException *exc = LOCAL_VAR (ip [1], MonoException*); - if (!exc) - exc = interp_get_exception_null_reference (frame, ip); - - THROW_EX_GENERAL (exc, ip, TRUE); - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_LD_DELEGATE_METHOD_PTR) { - // FIXME push/pop LMF - MonoDelegate *del = LOCAL_VAR (ip [2], MonoDelegate*); - if (!del->interp_method) { - /* Not created from interpreted code */ - g_assert (del->method); - del->interp_method = mono_interp_get_imethod (del->method); - } else if (((InterpMethod*)del->interp_method)->optimized_imethod) { - del->interp_method = ((InterpMethod*)del->interp_method)->optimized_imethod; - } - g_assert (del->interp_method); - LOCAL_VAR (ip [1], gpointer) = imethod_to_ftnptr (del->interp_method, FALSE); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_LDVIRTFTN_DELEGATE) { - gpointer arg = LOCAL_VAR (ip [2], gpointer); - MonoDelegate *del = LOCAL_VAR (ip [3], MonoDelegate*); - NULL_CHECK (arg); - - LOCAL_VAR (ip [1], gpointer) = interp_ldvirtftn_delegate (arg, del); - ip += 4; - MINT_IN_BREAK; - } - -#define MATH_UNOP(mathfunc) \ - LOCAL_VAR (ip [1], double) = mathfunc (LOCAL_VAR (ip [2], double)); \ - ip += 3; - -#define MATH_BINOP(mathfunc) \ - LOCAL_VAR (ip [1], double) = mathfunc (LOCAL_VAR (ip [2], double), LOCAL_VAR (ip [3], double)); \ - ip += 4; - - MINT_IN_CASE(MINT_ASIN) MATH_UNOP(asin); MINT_IN_BREAK; - MINT_IN_CASE(MINT_ASINH) MATH_UNOP(asinh); MINT_IN_BREAK; - MINT_IN_CASE(MINT_ACOS) MATH_UNOP(acos); MINT_IN_BREAK; - MINT_IN_CASE(MINT_ACOSH) MATH_UNOP(acosh); MINT_IN_BREAK; - MINT_IN_CASE(MINT_ATAN) MATH_UNOP(atan); MINT_IN_BREAK; - MINT_IN_CASE(MINT_ATANH) MATH_UNOP(atanh); MINT_IN_BREAK; - MINT_IN_CASE(MINT_CEILING) MATH_UNOP(ceil); MINT_IN_BREAK; - MINT_IN_CASE(MINT_COS) MATH_UNOP(cos); MINT_IN_BREAK; - MINT_IN_CASE(MINT_CBRT) MATH_UNOP(cbrt); MINT_IN_BREAK; - MINT_IN_CASE(MINT_COSH) MATH_UNOP(cosh); MINT_IN_BREAK; - MINT_IN_CASE(MINT_EXP) MATH_UNOP(exp); MINT_IN_BREAK; - MINT_IN_CASE(MINT_FLOOR) MATH_UNOP(floor); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LOG) MATH_UNOP(log); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LOG2) MATH_UNOP(log2); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LOG10) MATH_UNOP(log10); MINT_IN_BREAK; - MINT_IN_CASE(MINT_SIN) MATH_UNOP(sin); MINT_IN_BREAK; - MINT_IN_CASE(MINT_SQRT) MATH_UNOP(sqrt); MINT_IN_BREAK; - MINT_IN_CASE(MINT_SINH) MATH_UNOP(sinh); MINT_IN_BREAK; - MINT_IN_CASE(MINT_TAN) MATH_UNOP(tan); MINT_IN_BREAK; - MINT_IN_CASE(MINT_TANH) MATH_UNOP(tanh); MINT_IN_BREAK; - MINT_IN_CASE(MINT_ABS) MATH_UNOP(fabs); MINT_IN_BREAK; - - MINT_IN_CASE(MINT_ATAN2) MATH_BINOP(atan2); MINT_IN_BREAK; - MINT_IN_CASE(MINT_POW) MATH_BINOP(pow); MINT_IN_BREAK; - MINT_IN_CASE(MINT_MIN) MATH_BINOP(min_d); MINT_IN_BREAK; - MINT_IN_CASE(MINT_MAX) MATH_BINOP(max_d); MINT_IN_BREAK; - MINT_IN_CASE(MINT_FMA) - LOCAL_VAR (ip [1], double) = fma (LOCAL_VAR (ip [2], double), LOCAL_VAR (ip [3], double), LOCAL_VAR (ip [4], double)); - ip += 5; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SCALEB) - LOCAL_VAR (ip [1], double) = scalbn (LOCAL_VAR (ip [2], double), LOCAL_VAR (ip [3], gint32)); - ip += 4; - MINT_IN_BREAK; - -#define MATH_UNOPF(mathfunc) \ - LOCAL_VAR (ip [1], float) = mathfunc (LOCAL_VAR (ip [2], float)); \ - ip += 3; - -#define MATH_BINOPF(mathfunc) \ - LOCAL_VAR (ip [1], float) = mathfunc (LOCAL_VAR (ip [2], float), LOCAL_VAR (ip [3], float)); \ - ip += 4; - MINT_IN_CASE(MINT_ASINF) MATH_UNOPF(asinf); MINT_IN_BREAK; - MINT_IN_CASE(MINT_ASINHF) MATH_UNOPF(asinhf); MINT_IN_BREAK; - MINT_IN_CASE(MINT_ACOSF) MATH_UNOPF(acosf); MINT_IN_BREAK; - MINT_IN_CASE(MINT_ACOSHF) MATH_UNOPF(acoshf); MINT_IN_BREAK; - MINT_IN_CASE(MINT_ATANF) MATH_UNOPF(atanf); MINT_IN_BREAK; - MINT_IN_CASE(MINT_ATANHF) MATH_UNOPF(atanhf); MINT_IN_BREAK; - MINT_IN_CASE(MINT_CEILINGF) MATH_UNOPF(ceilf); MINT_IN_BREAK; - MINT_IN_CASE(MINT_COSF) MATH_UNOPF(cosf); MINT_IN_BREAK; - MINT_IN_CASE(MINT_CBRTF) MATH_UNOPF(cbrtf); MINT_IN_BREAK; - MINT_IN_CASE(MINT_COSHF) MATH_UNOPF(coshf); MINT_IN_BREAK; - MINT_IN_CASE(MINT_EXPF) MATH_UNOPF(expf); MINT_IN_BREAK; - MINT_IN_CASE(MINT_FLOORF) MATH_UNOPF(floorf); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LOGF) MATH_UNOPF(logf); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LOG2F) MATH_UNOPF(log2f); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LOG10F) MATH_UNOPF(log10f); MINT_IN_BREAK; - MINT_IN_CASE(MINT_SINF) MATH_UNOPF(sinf); MINT_IN_BREAK; - MINT_IN_CASE(MINT_SQRTF) MATH_UNOPF(sqrtf); MINT_IN_BREAK; - MINT_IN_CASE(MINT_SINHF) MATH_UNOPF(sinhf); MINT_IN_BREAK; - MINT_IN_CASE(MINT_TANF) MATH_UNOPF(tanf); MINT_IN_BREAK; - MINT_IN_CASE(MINT_TANHF) MATH_UNOPF(tanhf); MINT_IN_BREAK; - MINT_IN_CASE(MINT_ABSF) MATH_UNOPF(fabsf); MINT_IN_BREAK; - - MINT_IN_CASE(MINT_ATAN2F) MATH_BINOPF(atan2f); MINT_IN_BREAK; - MINT_IN_CASE(MINT_POWF) MATH_BINOPF(powf); MINT_IN_BREAK; - MINT_IN_CASE(MINT_MINF) MATH_BINOPF(min_f); MINT_IN_BREAK; - MINT_IN_CASE(MINT_MAXF) MATH_BINOPF(max_f); MINT_IN_BREAK; - MINT_IN_CASE(MINT_FMAF) - LOCAL_VAR (ip [1], float) = fmaf (LOCAL_VAR (ip [2], float), LOCAL_VAR (ip [3], float), LOCAL_VAR (ip [4], float)); - ip += 5; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_SCALEBF) - LOCAL_VAR (ip [1], float) = scalbnf (LOCAL_VAR (ip [2], float), LOCAL_VAR (ip [3], gint32)); - ip += 4; - MINT_IN_BREAK; - - MINT_IN_CASE(MINT_INTRINS_ENUM_HASFLAG) { - MonoClass *klass = (MonoClass*)frame->imethod->data_items [ip [4]]; - LOCAL_VAR (ip [1], gint32) = mono_interp_enum_hasflag ((stackval*)(locals + ip [2]), (stackval*)(locals + ip [3]), klass); - ip += 5; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_INTRINS_GET_HASHCODE) { - LOCAL_VAR (ip [1], gint32) = mono_object_hash_internal (LOCAL_VAR (ip [2], MonoObject*)); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_INTRINS_TRY_GET_HASHCODE) { - LOCAL_VAR (ip [1], gint32) = mono_object_try_get_hash_internal (LOCAL_VAR (ip [2], MonoObject*)); - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_INTRINS_GET_TYPE) { - MonoObject *o = LOCAL_VAR (ip [2], MonoObject*); - NULL_CHECK (o); - LOCAL_VAR (ip [1], MonoObject*) = (MonoObject*) o->vtable->type; - ip += 3; - MINT_IN_BREAK; - } - MINT_IN_CASE(MINT_METADATA_UPDATE_LDFLDA) { - MonoObject *inst = LOCAL_VAR (ip [2], MonoObject*); - MonoType *field_type = frame->imethod->data_items [ip [3]]; - uint32_t fielddef_token = GPOINTER_TO_UINT32 (frame->imethod->data_items [ip [4]]); - // FIXME: can we emit a call directly instead of a runtime-invoke? - gpointer field_addr = mono_metadata_update_added_field_ldflda (inst, field_type, fielddef_token, error); - /* FIXME: think about pinning the FieldStore and adding a second opcode to - * unpin it */ - LOCAL_VAR (ip [1], gpointer) = field_addr; - mono_interp_error_cleanup (error); - ip += 5; - MINT_IN_BREAK; - } - -#ifdef HOST_BROWSER - MINT_IN_CASE(MINT_TIER_NOP_JITERPRETER) { - ip += JITERPRETER_OPCODE_SIZE; - MINT_IN_BREAK; - } - - MINT_IN_CASE(MINT_TIER_PREPARE_JITERPRETER) { - if (mono_opt_jiterpreter_traces_enabled) { - /* - * prepare_jiterpreter will update the trace's hit count and potentially either JIT it or - * disable this entry point based on whether it fails to JIT. the hit counting is necessary - * because a given method may contain many jiterpreter entry points, but some of them will - * not be actually hit often enough to justify the cost of jitting them. (for example, a - * trace that only runs inside an unlikely branch for throwing exceptions.) - * thanks to the heuristic that runs during transform.c's codegen, most (95%+) of these - * entry points will JIT successfully, which will keep the number of NOT_JITTED nops low. - * note: threading doesn't work yet, we will need to broadcast jitted traces to all of our - * JS workers in order to register them at the appropriate slots in the function pointer - * table. when growing the function pointer table we will also need to synchronize that. - */ - JiterpreterThunk prepare_result = mono_interp_tier_prepare_jiterpreter_fast (frame, ip); - ptrdiff_t offset; - switch ((guint32)(void*)prepare_result) { - case JITERPRETER_TRAINING: - // jiterpreter still updating hit count before deciding to generate a trace, - // so skip this opcode. - ip += JITERPRETER_OPCODE_SIZE; - break; - case JITERPRETER_NOT_JITTED: - // Patch opcode to disable it because this trace failed to JIT. - if (!mono_opt_jiterpreter_estimate_heat) { - if (!mono_jiterp_patch_opcode ((volatile JiterpreterOpcode *)ip, MINT_TIER_PREPARE_JITERPRETER, MINT_TIER_NOP_JITERPRETER)) - g_printf ("Failed to patch opcode at %x into a nop\n", (unsigned int)ip); - } - ip += JITERPRETER_OPCODE_SIZE; - break; - default: - /* - * trace generated. patch opcode to disable it, then write the function - * pointer, then patch opcode again to turn this trace on. - * we do this to ensure that other threads won't see an ENTER_JITERPRETER - * opcode that has no function pointer stored inside of it. - * (note that right now threading doesn't work, but it's worth being correct - * here so that implementing thread support will be easier later.) - */ - if (!mono_jiterp_patch_opcode ((volatile JiterpreterOpcode *)ip, MINT_TIER_PREPARE_JITERPRETER, MINT_TIER_MONITOR_JITERPRETER)) - g_printf ("Failed to patch opcode at %x into a monitor point\n", (unsigned int)ip); - // now execute the trace - // this isn't important for performance, but it makes it easier to use the - // jiterpreter early in automated tests where code only runs once - offset = prepare_result (frame, locals, NULL, ip); - ip = (guint16*) (((guint8*)ip) + offset); - break; - } - } else { - ip += JITERPRETER_OPCODE_SIZE; - } - - MINT_IN_BREAK; - } - - MINT_IN_CASE(MINT_TIER_MONITOR_JITERPRETER) { - // The trace is in monitoring mode, where we track how far it actually goes - // each time it is executed for a while. After N more hits, we either - // turn it into an ENTER or a NOP depending on how well it is working - ptrdiff_t offset = mono_jiterp_monitor_trace (ip, frame, locals); - ip = (guint16*) (((guint8*)ip) + offset); - MINT_IN_BREAK; - } - - MINT_IN_CASE(MINT_TIER_ENTER_JITERPRETER) { - // The fn ptr is encoded in a guint16 relative to the index of the first trace fn ptr, so compute the actual ptr - JiterpreterThunk thunk = (JiterpreterThunk)(void *)(((JiterpreterOpcode *)ip)->relative_fn_ptr + mono_jiterp_first_trace_fn_ptr); - ptrdiff_t offset = thunk (frame, locals, NULL, ip); - ip = (guint16*) (((guint8*)ip) + offset); - MINT_IN_BREAK; - } -#endif - -#if !USE_COMPUTED_GOTO - default: - interp_error_xsx ("Unimplemented opcode: %04x %s at 0x%x\n", *ip, mono_interp_opname (*ip), GPTRDIFF_TO_INT (ip - frame->imethod->code)); -#endif // USE_COMPUTED_GOTO - } - } - - g_assert_not_reached (); - -resume: - g_assert (context->has_resume_state); - g_assert (frame->imethod); - - if (frame == context->handler_frame) { - /* - * When running finally blocks, we can have the same frame twice on the stack. If we have - * clause_args information, we need to check whether resuming should happen inside this - * finally block, or in some other part of the method, in which case we need to exit. - */ - if (clause_args && frame == clause_args->exec_frame && context->handler_ip >= clause_args->end_at_ip) { - goto exit_clause; - } else { - /* Set the current execution state to the resume state in context */ - ip = context->handler_ip; - /* spec says stack should be empty at endfinally so it should be at the start too */ - locals = (guchar*)frame->stack; - g_assert (context->exc_gchandle); - - clear_resume_state (context); - // goto main_loop instead of MINT_IN_DISPATCH helps the compiler and therefore conserves stack. - // This is a slow/rare path and conserving stack is preferred over its performance otherwise. - goto main_loop; - } - } else if (clause_args && frame == clause_args->exec_frame) { - /* - * This frame doesn't handle the resume state and it is the first frame invoked from EH. - * We can't just return to parent. We must first exit the EH mechanism and start resuming - * again from the original frame. - */ - goto exit_clause; - } - // Because we are resuming in another frame, bypassing a normal ret opcode, - // we need to make sure to reset the localloc stack - frame_data_allocator_pop (&context->data_stack, frame); - // fall through -exit_frame: - g_assert_checked (frame->imethod); - - if (frame->parent && frame->parent->state.ip) { - /* Return to the main loop after a non-recursive interpreter call */ - //printf ("R: %s -> %s %p\n", mono_method_get_full_name (frame->imethod->method), mono_method_get_full_name (frame->parent->imethod->method), frame->parent->state.ip); - g_assert_checked (frame->stack); - frame = frame->parent; - /* - * FIXME We should be able to avoid dereferencing imethod here, if we will have - * a param_area and all calls would inherit the same sp, or if we are full coop. - */ - context->stack_pointer = (guchar*)frame->stack + frame->imethod->alloca_size; - LOAD_INTERP_STATE (frame); - - CHECK_RESUME_STATE (context); - - goto main_loop; - } -exit_clause: - if (!clause_args) - context->stack_pointer = (guchar*)frame->stack; - - DEBUG_LEAVE (); -} - -#undef SET_TEMP_POINTER - -static void -interp_parse_options (const char *options) -{ - char **args, **ptr; - - if (!options) - return; - - args = g_strsplit (options, ",", -1); - for (ptr = args; ptr && *ptr; ptr ++) { - char *arg = *ptr; - - if (strncmp (arg, "jit=", 4) == 0) { - mono_interp_jit_classes = g_slist_prepend (mono_interp_jit_classes, arg + 4); - } else if (strncmp (arg, "interp-only=", strlen ("interp-only=")) == 0) { - mono_interp_only_classes = g_slist_prepend (mono_interp_only_classes, arg + strlen ("interp-only=")); - } else { - gboolean invert; - int opt = 0; - - if (*arg == '-') { - arg++; - invert = TRUE; - } else { - invert = FALSE; - } - - if (strncmp (arg, "inline", 6) == 0) - opt = INTERP_OPT_INLINE; - else if (strncmp (arg, "cprop", 5) == 0) - opt = INTERP_OPT_CPROP; - else if (strncmp (arg, "super", 5) == 0) - opt = INTERP_OPT_SUPER_INSTRUCTIONS; - else if (strncmp (arg, "bblocks", 7) == 0) - opt = INTERP_OPT_BBLOCKS; - else if (strncmp (arg, "tiering", 7) == 0) - opt = INTERP_OPT_TIERING; - else if (strncmp (arg, "simd", 4) == 0) - opt = INTERP_OPT_SIMD; -#if HOST_BROWSER - else if (strncmp (arg, "jiterp", 6) == 0) - opt = INTERP_OPT_JITERPRETER; -#endif - else if (strncmp (arg, "ssa", 3) == 0) - opt = INTERP_OPT_SSA; - else if (strncmp (arg, "precise", 7) == 0) - opt = INTERP_OPT_PRECISE_GC; - else if (strncmp (arg, "all", 3) == 0) - opt = ~INTERP_OPT_NONE; - - if (opt) { - if (invert) - mono_interp_opt &= ~opt; - else - mono_interp_opt |= opt; - } - } - } - g_strfreev (args); -} - -/* - * interp_set_resume_state: - * - * Set the state the interpreter will continue to execute from after execution returns to the interpreter. - * If INTERP_FRAME is NULL, that means the exception is caught in an AOTed frame and the interpreter needs to - * unwind back to AOT code. - */ -static void -interp_set_resume_state (MonoJitTlsData *jit_tls, MonoObject *ex, MonoJitExceptionInfo *ei, MonoInterpFrameHandle interp_frame, gpointer handler_ip) -{ - ThreadContext *context; - - g_assert (jit_tls); - context = (ThreadContext*)jit_tls->interp_context; - g_assert (context); - - context->has_resume_state = TRUE; - context->handler_frame = (InterpFrame*)interp_frame; - context->handler_ei = ei; - if (context->exc_gchandle) - mono_gchandle_free_internal (context->exc_gchandle); - context->exc_gchandle = mono_gchandle_new_internal ((MonoObject*)ex, FALSE); - /* Ditto */ - if (context->handler_frame) { - if (ei) - *(MonoObject**)(frame_locals (context->handler_frame) + ei->exvar_offset) = ex; - } - context->handler_ip = (const guint16*)handler_ip; -} - -static void -interp_get_resume_state (const MonoJitTlsData *jit_tls, gboolean *has_resume_state, MonoInterpFrameHandle *interp_frame, gpointer *handler_ip) -{ - g_assert (jit_tls); - ThreadContext *context = (ThreadContext*)jit_tls->interp_context; - - *has_resume_state = context ? context->has_resume_state : FALSE; - if (!*has_resume_state) - return; - - *interp_frame = context->handler_frame; - *handler_ip = (gpointer)context->handler_ip; -} - -/* - * interp_run_finally: - * - * Run the finally clause identified by CLAUSE_INDEX in the interpreter frame given by - * frame->interp_frame. - * Return TRUE if the finally clause threw an exception. - */ -static gboolean -interp_run_finally (StackFrameInfo *frame, int clause_index) -{ - InterpFrame *iframe = (InterpFrame*)frame->interp_frame; - MonoJitExceptionInfo *ei = &iframe->imethod->jinfo->clauses [clause_index]; - ThreadContext *context = get_context (); - FrameClauseArgs clause_args; - const guint16 *state_ip; - - memset (&clause_args, 0, sizeof (FrameClauseArgs)); - clause_args.start_with_ip = (const guint16*)ei->handler_start; - clause_args.end_at_ip = (const guint16*)ei->data.handler_end; - clause_args.exec_frame = iframe; - - state_ip = iframe->state.ip; - iframe->state.ip = NULL; - - InterpFrame* const next_free = iframe->next_free; - iframe->next_free = NULL; - - // this informs MINT_ENDFINALLY to return to EH - *(guint16**)(frame_locals (iframe) + iframe->imethod->clause_data_offsets [clause_index]) = NULL; - - mono_interp_exec_method (iframe, context, &clause_args); - - iframe->next_free = next_free; - iframe->state.ip = state_ip; - - if (need_native_unwind (context)) { - mono_llvm_start_native_unwind (); - return TRUE; - } - - if (context->has_resume_state) { - return TRUE; - } else { - return FALSE; - } -} - -/* - * interp_run_filter: - * - * Run the filter clause identified by CLAUSE_INDEX in the interpreter frame given by - * frame->interp_frame. - */ -// Do not inline in case order of frame addresses matters. -static MONO_NEVER_INLINE gboolean -interp_run_filter (StackFrameInfo *frame, MonoException *ex, int clause_index, gpointer handler_ip, gpointer handler_ip_end) -{ - InterpFrame *iframe = (InterpFrame*)frame->interp_frame; - ThreadContext *context = get_context (); - stackval retval; - FrameClauseArgs clause_args; - - /* - * Have to run the clause in a new frame which is a copy of IFRAME, since - * during debugging, there are two copies of the frame on the stack. - */ - InterpFrame child_frame = {0}; - child_frame.parent = iframe; - child_frame.imethod = iframe->imethod; - child_frame.stack = (stackval*)context->stack_pointer; - child_frame.retval = &retval; - - /* Copy the stack frame of the original method */ - memcpy (child_frame.stack, iframe->stack, iframe->imethod->locals_size); - // Write the exception object in its reserved stack slot - *((MonoException**)((char*)child_frame.stack + iframe->imethod->clause_data_offsets [clause_index])) = ex; - context->stack_pointer += iframe->imethod->alloca_size; - g_assert (context->stack_pointer < context->stack_end); - - memset (&clause_args, 0, sizeof (FrameClauseArgs)); - clause_args.start_with_ip = (const guint16*)handler_ip; - clause_args.end_at_ip = (const guint16*)handler_ip_end; - clause_args.exec_frame = &child_frame; - - mono_interp_exec_method (&child_frame, context, &clause_args); - - /* Copy back the updated frame */ - memcpy (iframe->stack, child_frame.stack, iframe->imethod->locals_size); - - context->stack_pointer = (guchar*)child_frame.stack; - - if (need_native_unwind (context)) { - mono_llvm_start_native_unwind (); - return TRUE; - } - - /* ENDFILTER stores the result into child_frame->retval */ - return retval.data.i ? TRUE : FALSE; -} - -/* Returns TRUE if there is a pending exception */ -static gboolean -interp_run_clause_with_il_state (gpointer il_state_ptr, int clause_index, MonoObject *ex, gboolean *filtered) -{ - MonoMethodILState *il_state = (MonoMethodILState*)il_state_ptr; - MonoMethodSignature *sig; - ThreadContext *context = get_context (); - stackval *sp; - InterpMethod *imethod; - FrameClauseArgs clause_args; - ERROR_DECL (error); - - sig = mono_method_signature_internal (il_state->method); - g_assert (sig); - - imethod = mono_interp_get_imethod (il_state->method); - if (!imethod->transformed) { - // In case method is in process of being tiered up, make sure it is compiled - mono_interp_transform_method (imethod, context, error); - mono_error_assert_ok (error); - } - - sp = (stackval*)context->stack_pointer; - - gpointer ret_addr = NULL; - - int findex = 0; - if (sig->ret->type != MONO_TYPE_VOID) { - ret_addr = il_state->data [findex]; - findex ++; - } - int first_param_index = 0; - if (sig->hasthis) { - if (il_state->data [findex]) - sp->data.p = *(gpointer*)il_state->data [findex]; - first_param_index = 1; - findex ++; - } - - for (int i = 0; i < sig->param_count; ++i) { - if (il_state->data [findex]) { - int arg_offset = get_arg_offset_fast (imethod, NULL, first_param_index + i); - stackval *sval = STACK_ADD_ALIGNED_BYTES (sp, arg_offset); - - stackval_from_data (sig->params [i], sval, il_state->data [findex], FALSE); - } - findex ++; - } - - /* Allocate frame */ - InterpFrame frame = {0}; - frame.imethod = imethod; - frame.stack = sp; - frame.retval = sp; - - int params_size = get_arg_offset_fast (imethod, NULL, first_param_index + sig->param_count); - context->stack_pointer = (guchar*)ALIGN_TO ((guchar*)sp + params_size, MINT_STACK_ALIGNMENT); - context->stack_pointer += imethod->alloca_size; - g_assert (context->stack_pointer < context->stack_end); - - MonoMethodHeader *header = mono_method_get_header_internal (il_state->method, error); - mono_error_assert_ok (error); - - /* Init locals */ - if (header->num_locals) - memset (frame_locals (&frame) + imethod->local_offsets [0], 0, imethod->locals_size); - /* Copy locals from il_state */ - int locals_start = findex; - for (int i = 0; i < header->num_locals; ++i) { - if (il_state->data [locals_start + i]) - stackval_from_data (header->locals [i], (stackval*)(frame_locals (&frame) + imethod->local_offsets [i]), il_state->data [locals_start + i], FALSE); - } - - memset (&clause_args, 0, sizeof (FrameClauseArgs)); - MonoJitExceptionInfo *ei = &imethod->jinfo->clauses [clause_index]; - MonoExceptionEnum clause_type = ei->flags; - // For filter clauses, if filtered is set, then we run the filter, otherwise we run the catch handler - if (clause_type == MONO_EXCEPTION_CLAUSE_FILTER && !filtered) - clause_type = MONO_EXCEPTION_CLAUSE_NONE; - - if (clause_type == MONO_EXCEPTION_CLAUSE_FILTER) - clause_args.start_with_ip = (const guint16*)ei->data.filter; - else - clause_args.start_with_ip = (const guint16*)ei->handler_start; - if (clause_type == MONO_EXCEPTION_CLAUSE_NONE || clause_type == MONO_EXCEPTION_CLAUSE_FILTER) { - /* Run until the end */ - clause_args.end_at_ip = NULL; - clause_args.run_until_end = TRUE; - } else { - clause_args.end_at_ip = (const guint16*)ei->data.handler_end; - } - clause_args.exec_frame = &frame; - - if (clause_type == MONO_EXCEPTION_CLAUSE_NONE || clause_type == MONO_EXCEPTION_CLAUSE_FILTER) - *(MonoObject**)(frame_locals (&frame) + imethod->jinfo->clauses [clause_index].exvar_offset) = ex; - else - // this informs MINT_ENDFINALLY to return to EH - *(guint16**)(frame_locals (&frame) + imethod->clause_data_offsets [clause_index]) = NULL; - - /* Set in mono_handle_exception () */ - context->has_resume_state = FALSE; - - mono_interp_exec_method (&frame, context, &clause_args); - - /* Write back args */ - findex = 0; - if (sig->ret->type != MONO_TYPE_VOID) - findex ++; - if (sig->hasthis) { - // FIXME: This - findex ++; - } - for (int i = 0; i < sig->param_count; ++i) { - if (il_state->data [findex]) { - int arg_offset = get_arg_offset_fast (imethod, NULL, first_param_index + i); - stackval *sval = STACK_ADD_ALIGNED_BYTES (sp, arg_offset); - - stackval_to_data (sig->params [i], sval, il_state->data [findex], FALSE); - } - findex ++; - } - /* Write back locals */ - for (int i = 0; i < header->num_locals; ++i) { - if (il_state->data [locals_start + i]) - stackval_to_data (header->locals [i], (stackval*)(frame_locals (&frame) + imethod->local_offsets [i]), il_state->data [locals_start + i], FALSE); - } - mono_metadata_free_mh (header); - - if (clause_type == MONO_EXCEPTION_CLAUSE_NONE && ret_addr) { - stackval_to_data (sig->ret, frame.retval, ret_addr, FALSE); - } else if (clause_type == MONO_EXCEPTION_CLAUSE_FILTER) { - g_assert (filtered); - *filtered = frame.retval->data.i; - } - - memset (sp, 0, (guint8*)context->stack_pointer - (guint8*)sp); - context->stack_pointer = (guchar*)sp; - - if (need_native_unwind (context)) { - mono_llvm_start_native_unwind (); - return FALSE; - } - - return context->has_resume_state; -} - -typedef struct { - InterpFrame *current; -} StackIter; - -static gpointer -interp_frame_get_ip (MonoInterpFrameHandle frame) -{ - InterpFrame *iframe = (InterpFrame*)frame; - - g_assert (iframe->imethod); - /* - * For calls, state.ip points to the instruction following the call, so we need to subtract - * in order to get inside the call instruction range. Other instructions that set the IP for - * the rest of the runtime to see, like throws and sdb breakpoints, will need to account for - * this subtraction that we are doing here. - */ - return (gpointer)(iframe->state.ip - 1); -} - -/* - * interp_frame_iter_init: - * - * Initialize an iterator for iterating through interpreted frames. - */ -static void -interp_frame_iter_init (MonoInterpStackIter *iter, gpointer interp_exit_data) -{ - StackIter *stack_iter = (StackIter*)iter; - - stack_iter->current = (InterpFrame*)interp_exit_data; -} - -/* - * interp_frame_iter_next: - * - * Fill out FRAME with date for the next interpreter frame. - */ -static gboolean -interp_frame_iter_next (MonoInterpStackIter *iter, StackFrameInfo *frame) -{ - StackIter *stack_iter = (StackIter*)iter; - InterpFrame *iframe = stack_iter->current; - - memset (frame, 0, sizeof (StackFrameInfo)); - /* pinvoke frames doesn't have imethod set */ - while (iframe && !(iframe->imethod && iframe->imethod->code && iframe->imethod->jinfo)) - iframe = iframe->parent; - if (!iframe) - return FALSE; - - MonoMethod *method = iframe->imethod->method; - frame->interp_frame = iframe; - frame->method = method; - frame->actual_method = method; - if (method && ((method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) || (method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME)))) { - frame->native_offset = -1; - frame->type = FRAME_TYPE_MANAGED_TO_NATIVE; - } else { - frame->type = FRAME_TYPE_INTERP; - /* This is the offset in the interpreter IR. */ - frame->native_offset = GPTRDIFF_TO_INT ((guint8*)interp_frame_get_ip (iframe) - (guint8*)iframe->imethod->code); - if (method && (!method->wrapper_type || method->wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD)) - frame->managed = TRUE; - } - frame->ji = iframe->imethod->jinfo; - frame->frame_addr = iframe; - - stack_iter->current = iframe->parent; - - return TRUE; -} - -static MonoJitInfo* -interp_find_jit_info (MonoMethod *method) -{ - InterpMethod* imethod; - - imethod = lookup_imethod (method); - if (imethod) - return imethod->jinfo; - else - return NULL; -} - -static void -interp_set_breakpoint (MonoJitInfo *jinfo, gpointer ip) -{ - guint16 *code = (guint16*)ip; - g_assert (*code == MINT_SDB_SEQ_POINT); - *code = MINT_SDB_BREAKPOINT; -} - -static void -interp_clear_breakpoint (MonoJitInfo *jinfo, gpointer ip) -{ - guint16 *code = (guint16*)ip; - g_assert (*code == MINT_SDB_BREAKPOINT); - *code = MINT_SDB_SEQ_POINT; -} - -static MonoJitInfo* -interp_frame_get_jit_info (MonoInterpFrameHandle frame) -{ - InterpFrame *iframe = (InterpFrame*)frame; - - g_assert (iframe->imethod); - return iframe->imethod->jinfo; -} - -static gpointer -interp_frame_get_arg (MonoInterpFrameHandle frame, int pos) -{ - InterpFrame *iframe = (InterpFrame*)frame; - - g_assert (iframe->imethod); - - return (char*)iframe->stack + get_arg_offset_fast (iframe->imethod, NULL, pos + iframe->imethod->hasthis); -} - -static gpointer -interp_frame_get_local (MonoInterpFrameHandle frame, int pos) -{ - InterpFrame *iframe = (InterpFrame*)frame; - - g_assert (iframe->imethod); - - return frame_locals (iframe) + iframe->imethod->local_offsets [pos]; -} - -static gpointer -interp_frame_get_this (MonoInterpFrameHandle frame) -{ - InterpFrame *iframe = (InterpFrame*)frame; - - g_assert (iframe->imethod); - g_assert (iframe->imethod->hasthis); - return iframe->stack; -} - -static MonoInterpFrameHandle -interp_frame_get_parent (MonoInterpFrameHandle frame) -{ - InterpFrame *iframe = (InterpFrame*)frame; - - return iframe->parent; -} - -static void -interp_start_single_stepping (void) -{ - ss_enabled = TRUE; -} - -static void -interp_stop_single_stepping (void) -{ - ss_enabled = FALSE; -} - - -static void -interp_mark_frame_no_ref_slots (ThreadContext *context, InterpFrame *frame, gpointer *top_limit) -{ - InterpMethod *imethod = frame->imethod; - gpointer *frame_stack = (gpointer*)frame->stack; - gpointer *frame_stack_end = (gpointer*)((guchar*)frame->stack + imethod->alloca_size); - // The way interpreter implements calls is by moving arguments to the param area, at the - // top of the stack and then proceed with the call. Up to the moment of the call these slots - // are owned by the calling frame. Once we do the call, the stack pointer of the called - // frame will point inside the param area of the calling frame. - // - // We mark no ref slots from top to bottom and we use the top limit to ignore slots - // that were already handled in the called frame. - if (top_limit && top_limit < frame_stack_end) - frame_stack_end = top_limit; - - for (gpointer *current = frame_stack; current < frame_stack_end; current++) { - gsize slot_index = current - frame_stack; - if (!mono_bitset_test_fast (imethod->ref_slots, slot_index)) { - gsize global_slot_index = current - (gpointer*)context->stack_start; - gsize table_index = global_slot_index / 8; - int bit_index = global_slot_index % 8; - context->no_ref_slots [table_index] |= 1 << bit_index; - } - } -} - -static void -interp_mark_no_ref_slots (ThreadContext *context, MonoLMF* lmf) -{ - memset (context->no_ref_slots, 0, (context->stack_pointer - context->stack_start) / (8 * sizeof (gpointer)) + 1); - while (lmf) { - if ((gsize)lmf->previous_lmf & 2) { - MonoLMFExt *lmf_ext = (MonoLMFExt*) lmf; - if (lmf_ext->kind == MONO_LMFEXT_INTERP_EXIT || lmf_ext->kind == MONO_LMFEXT_INTERP_EXIT_WITH_CTX) { - InterpFrame *frame = (InterpFrame*)lmf_ext->interp_exit_data; - gpointer *top_limit = NULL; - while (frame) { - if (frame->imethod) { - interp_mark_frame_no_ref_slots (context, frame, top_limit); - top_limit = (gpointer*)frame->stack; - } - frame = frame->parent; - } - } - } - lmf = (MonoLMF*)((gsize)lmf->previous_lmf & ~3); - } -} - -/* - * interp_mark_stack: - * - * Mark the interpreter stack frames for a thread. - * - */ -static void -interp_mark_stack (gpointer thread_data, GcScanFunc func, gpointer gc_data, gboolean precise) -{ - MonoThreadInfo *info = (MonoThreadInfo*)thread_data; - - if (!mono_use_interpreter) - return; - if (precise) - return; - - /* - * We explicitly mark the frames instead of registering the stack fragments as GC roots, so - * we have to process less data and avoid false pinning from data which is above 'pos'. - * - * The stack frame handling code uses compiler write barriers only, but the calling code - * in sgen-mono.c already did a mono_memory_barrier_process_wide () so we can - * process these data structures normally. - */ - MonoJitTlsData *jit_tls = (MonoJitTlsData *)info->tls [TLS_KEY_JIT_TLS]; - if (!jit_tls) - return; - - ThreadContext *context = (ThreadContext*)jit_tls->interp_context; - if (!context || !context->stack_start) - return; - - if (mono_interp_opt & INTERP_OPT_PRECISE_GC) { - MonoLMF **lmf_addr = (MonoLMF**)info->tls [TLS_KEY_LMF_ADDR]; - if (lmf_addr) - interp_mark_no_ref_slots (context, *lmf_addr); - } - - int slot_index = 0; - for (gpointer *p = (gpointer*)context->stack_start; p < (gpointer*)context->stack_pointer; p++) { - if (context->no_ref_slots && (context->no_ref_slots [slot_index / 8] & (1 << (slot_index % 8)))) - ;// This slot is marked as no ref, we don't scan it - else - func (p, gc_data); - slot_index++; - } - - FrameDataFragment *frag; - for (frag = context->data_stack.first; frag; frag = frag->next) { - // FIXME: Scan the whole area with 1 call - for (gpointer *p = (gpointer*)&frag->data; p < (gpointer*)frag->pos; ++p) - func (p, gc_data); - if (frag == context->data_stack.current) - break; - } -} - -#if COUNT_OPS - -static int -opcode_count_comparer (const void * pa, const void * pb) -{ - long counta = opcode_counts [*(int*)pa]; - long countb = opcode_counts [*(int*)pb]; - - if (counta < countb) - return 1; - else if (counta > countb) - return -1; - else - return 0; -} - -static void -interp_print_op_count (void) -{ - int ordered_ops [MINT_LASTOP]; - int i; - long total_ops = 0; - - for (i = 0; i < MINT_LASTOP; i++) { - ordered_ops [i] = i; - total_ops += opcode_counts [i]; - } - qsort (ordered_ops, MINT_LASTOP, sizeof (int), opcode_count_comparer); - - g_print ("total ops %ld\n", total_ops); - for (i = 0; i < MINT_LASTOP; i++) { - long count = opcode_counts [ordered_ops [i]]; - g_print ("%s : %ld (%.2lf%%)\n", mono_interp_opname (ordered_ops [i]), count, (double)count / total_ops * 100); - } -} -#endif - -#if PROFILE_INTERP - -static InterpMethod **imethods; -static int num_methods; -const int opcount_threshold = 100000; - -static void -interp_add_imethod (gpointer method, gpointer user_data) -{ - InterpMethod *imethod = (InterpMethod*) method; - if (imethod->opcounts > opcount_threshold) - imethods [num_methods++] = imethod; -} - -static int -imethod_opcount_comparer (gconstpointer m1, gconstpointer m2) -{ - long diff = (*(InterpMethod**)m2)->opcounts - (*(InterpMethod**)m1)->opcounts; - if (diff > 0) - return 1; - else if (diff < 0) - return -1; - else - return 0; -} - -static void -interp_print_method_counts (void) -{ - MonoJitMemoryManager *jit_mm = get_default_jit_mm (); - - jit_mm_lock (jit_mm); - imethods = (InterpMethod**) malloc (jit_mm->interp_code_hash.num_entries * sizeof (InterpMethod*)); - mono_internal_hash_table_apply (&jit_mm->interp_code_hash, interp_add_imethod, NULL); - jit_mm_unlock (jit_mm); - - qsort (imethods, num_methods, sizeof (InterpMethod*), imethod_opcount_comparer); - - printf ("Total executed opcodes %ld\n", total_executed_opcodes); - long cumulative_executed_opcodes = 0; - for (int i = 0; i < num_methods; i++) { - cumulative_executed_opcodes += imethods [i]->opcounts; - printf ("%d%% Opcounts %ld, calls %ld, Method %s, imethod ptr %p\n", (int)(cumulative_executed_opcodes * 100 / total_executed_opcodes), imethods [i]->opcounts, imethods [i]->calls, mono_method_full_name (imethods [i]->method, TRUE), imethods [i]); - } -} -#endif - -static void -interp_set_optimizations (guint32 opts) -{ - mono_interp_opt = opts; -} - -static void -invalidate_transform (gpointer imethod_, gpointer user_data) -{ - InterpMethod *imethod = (InterpMethod *) imethod_; - imethod->transformed = FALSE; -} - -static void -copy_imethod_for_frame (InterpFrame *frame) -{ - InterpMethod *copy = (InterpMethod *) m_method_alloc0 (frame->imethod->method, sizeof (InterpMethod)); - memcpy (copy, frame->imethod, sizeof (InterpMethod)); - copy->next_jit_code_hash = NULL; /* we don't want that in our copy */ - frame->imethod = copy; - /* Note: The copy will be around until the method is unloaded. Ideally we - * would reclaim its memory when the corresponding InterpFrame is popped. - */ -} - -static void -metadata_update_backup_frames (MonoThreadInfo *info, InterpFrame *frame) -{ - while (frame) { - mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_METADATA_UPDATE, "threadinfo=%p, copy imethod for method=%s", info, mono_method_full_name (frame->imethod->method, 1)); - copy_imethod_for_frame (frame); - frame = frame->parent; - } -} - -static void -metadata_update_prepare_to_invalidate (void) -{ - /* (1) make a copy of imethod for every interpframe that is on the stack, - * so we do not invalidate currently running methods */ - - FOREACH_THREAD_EXCLUDE (info, MONO_THREAD_INFO_FLAGS_NO_GC) { - if (!info || !info->jit_data) - continue; - - MonoLMF *lmf = info->jit_data->lmf; - while (lmf) { - if (((gsize) lmf->previous_lmf) & 2) { - MonoLMFExt *ext = (MonoLMFExt *) lmf; - if (ext->kind == MONO_LMFEXT_INTERP_EXIT || ext->kind == MONO_LMFEXT_INTERP_EXIT_WITH_CTX) { - InterpFrame *frame = ext->interp_exit_data; - metadata_update_backup_frames (info, frame); - } - } - lmf = (MonoLMF *)(((gsize) lmf->previous_lmf) & ~3); - } - } FOREACH_THREAD_END - - /* (2) invalidate all the registered imethods */ -} - -static void -interp_invalidate_transformed (void) -{ - gboolean need_stw_restart = FALSE; - if (mono_metadata_has_updates ()) { - mono_stop_world (MONO_THREAD_INFO_FLAGS_NO_GC); - metadata_update_prepare_to_invalidate (); - need_stw_restart = TRUE; - } - - GPtrArray *alcs = mono_alc_get_all (); - - if (alcs) { - MonoAssemblyLoadContext* alc; - for (guint i = 0; i < alcs->len; ++i) { - alc = (MonoAssemblyLoadContext*)g_ptr_array_index (alcs, i); - MonoJitMemoryManager *jit_mm = (MonoJitMemoryManager*)(alc->memory_manager->runtime_info); - - jit_mm_lock (jit_mm); - mono_internal_hash_table_apply (&jit_mm->interp_code_hash, invalidate_transform, NULL); - jit_mm_unlock (jit_mm); - } - - g_ptr_array_free (alcs, TRUE); - } - - if (need_stw_restart) - mono_restart_world (MONO_THREAD_INFO_FLAGS_NO_GC); -} - - -typedef struct { - MonoJitInfo **jit_info_array; - gint size; - gint next; -} InterpCopyJitInfoFuncUserData; - -static void -interp_copy_jit_info_func (gpointer imethod, gpointer user_data) -{ - InterpCopyJitInfoFuncUserData *data = (InterpCopyJitInfoFuncUserData*)user_data; - if (data->next < data->size) - data->jit_info_array [data->next++] = ((InterpMethod *)imethod)->jinfo; -} - -static void -interp_jit_info_foreach (InterpJitInfoFunc func, gpointer user_data) -{ - GPtrArray *alcs = mono_alc_get_all (); - - if (alcs) { - MonoAssemblyLoadContext* alc; - for (guint i = 0; i < alcs->len; ++i) { - alc = (MonoAssemblyLoadContext*)g_ptr_array_index (alcs, i); - MonoJitMemoryManager *jit_mm = (MonoJitMemoryManager*)(alc->memory_manager->runtime_info); - InterpCopyJitInfoFuncUserData copy_jit_info_data; - // Can't keep memory manager lock while iterating and calling callback since it might take other locks - // causing poential deadlock situations. Instead, create copy of interpreter imethod jinfo pointers into - // plain array and use pointers from array when when running callbacks. - copy_jit_info_data.size = mono_atomic_load_i32 (&(jit_mm->interp_code_hash.num_entries)); - copy_jit_info_data.next = 0; - copy_jit_info_data.jit_info_array = (MonoJitInfo**) g_new (MonoJitInfo*, copy_jit_info_data.size); - if (copy_jit_info_data.jit_info_array) { - jit_mm_lock (jit_mm); - mono_internal_hash_table_apply (&jit_mm->interp_code_hash, interp_copy_jit_info_func, ©_jit_info_data); - jit_mm_unlock (jit_mm); - } - - if (copy_jit_info_data.jit_info_array) { - for (int j = 0; j < copy_jit_info_data.next; ++j) - func (copy_jit_info_data.jit_info_array [j], user_data); - g_free (copy_jit_info_data.jit_info_array); - } - } - - g_ptr_array_free (alcs, TRUE); - } -} - -static gboolean -interp_sufficient_stack (gsize size) -{ - ThreadContext *context = get_context (); - - return (context->stack_pointer + size) < (context->stack_start + INTERP_STACK_SIZE); -} - -static void -interp_cleanup (void) -{ -#if COUNT_OPS - interp_print_op_count (); -#endif -#if PROFILE_INTERP - interp_print_method_counts (); -#endif -} - -#undef MONO_EE_CALLBACK -#define MONO_EE_CALLBACK(ret, name, sig) interp_ ## name, - -static const MonoEECallbacks mono_interp_callbacks = { - MONO_EE_CALLBACKS -}; - diff --git a/src/mono/mono/mini/interp/mintSigs.h b/src/mono/mono/mini/interp/mintSigs.h index 40ff88b155201c..f0c6e0f4d698b6 100644 --- a/src/mono/mono/mini/interp/mintSigs.h +++ b/src/mono/mono/mini/interp/mintSigs.h @@ -5,7 +5,7 @@ typedef enum { SIG_PARAM_8B = 8, SIG_PARAM_INVALID = 666 } param_type_e; -// this enum must fit in a unit16_t +// this enum must fit in a uint16_t typedef enum { MINT_ICALLSIG_MAX = 55555, // just a recognisable large number MINT_ICALLSIG_V_V = 0, diff --git a/src/mono/mono/utils/CMakeLists.txt b/src/mono/mono/utils/CMakeLists.txt index b01078d4c33a30..dd6992b3dcefe7 100644 --- a/src/mono/mono/utils/CMakeLists.txt +++ b/src/mono/mono/utils/CMakeLists.txt @@ -37,8 +37,7 @@ else() endif() if(HOST_WASM AND USES_MEM64) - set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -DMEMORY64 --target=wasm64") - message(STATUS "MRH_LOGGING_UTILS: Set CMAKE_ASM_FLAGS to: '${CMAKE_ASM_FLAGS}'") + set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -DMEMORY64 --target=wasm64") endif() set(utils_common_sources @@ -193,9 +192,6 @@ else() #message(FATAL_ERROR "") endif() -message(STATUS "MRH_LOGGING_UTILS: TARGET_WASM is: '${TARGET_WASM}'") -message(STATUS "MRH_LOGGING_UTILS: MONO_CROSS_COMPILE is: '${MONO_CROSS_COMPILE}'") - if(MONO_CROSS_COMPILE) set(utils_arch_sources "${utils_arch_sources};mono-hwcap-cross.c") elseif(TARGET_AMD64 OR TARGET_X86) @@ -210,7 +206,6 @@ elseif(TARGET_S390X) set(utils_arch_sources "${utils_arch_sources};mono-hwcap-s390x.c") elseif(TARGET_WASM) set(utils_arch_sources "${utils_arch_sources};mono-hwcap-wasm.c;mono-mmap-wasm.c") -message(STATUS "MRH_LOGGING_UTILS: added mono-mmap-wasm.c, utils_arch_sources is '${utils_arch_sources}''") elseif(TARGET_WASI) set(utils_arch_sources "${utils_arch_sources};mono-hwcap-wasm.c") elseif(TARGET_POWERPC OR TARGET_POWERPC64) From bd6e6989ca0b9d142d6248700d9d25b8da093391 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 7 Nov 2025 14:35:26 +0000 Subject: [PATCH 200/209] Tidying --- src/mono/mono/mini/CMakeLists.txt | 5 +- src/mono/mono/mini/interp/interp.c | 75 ++++++------------- src/mono/mono/mini/interp/transform.c | 25 ++----- .../sample/wasm/browser-test-debug/main.js | 4 +- 4 files changed, 33 insertions(+), 76 deletions(-) diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index d632fc10f40936..a25b685ee4d8c2 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -257,9 +257,6 @@ set(jiterp_sources set(jiterp_stub_sources interp/jiterpreter_stubs.c) -message("MRH_LOGGING_MINI: DISABLE_INTERPRETER '${DISABLE_INTERPRETER}'") -message("MRH_LOGGING_MINI: DISABLE_JITERPRETER '${DISABLE_JITERPRETER}'") - if(NOT DISABLE_INTERPRETER) if(HOST_WASM) set(mini_interp_sources ${interp_sources}) @@ -273,7 +270,7 @@ endif() if(NOT DISABLE_JITERPRETER) list(APPEND mini_interp_sources ${jiterp_sources}) else() - message("MRH_LOGGING: adding jiterp stub sources '${jiterp_stub_sources}'") + message("Adding jiterp stub sources '${jiterp_stub_sources}'") list(APPEND mini_interp_sources ${jiterp_stub_sources}) endif() diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index 1fa1f1a53a8e88..0d10d4ffcc6153 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -244,8 +244,7 @@ reinit_frame (InterpFrame *frame, InterpFrame *parent, InterpMethod *imethod, gp frame->imethod = imethod; frame->stack = (stackval*)stack; frame->retval = (stackval*)retval; - frame->state.ip = NULL; - //MH_LOG("Reinitializing frame %p with imethod %s (%p), retval %p, stack %p", frame, mono_method_get_name_full(imethod->method, TRUE, TRUE, MONO_TYPE_NAME_FORMAT_IL), imethod, retval, stack); + frame->state.ip = NULL; } #define STACK_ADD_ALIGNED_BYTES(sp,bytes) ((stackval*)((char*)(sp) + (bytes))) @@ -365,8 +364,7 @@ int mono_interp_traceopt = 0; #else #define MINT_IN_SWITCH(op) COUNT_OP(op); switch (opcode = (MintOpcode)(op)) -//#define MINT_IN_CASE(x) case x: -#define MINT_IN_CASE(x) case x: if (mh_log_get_verbosity() >= MH_LVL_CRIPPLE) { printf("MH_LOG_MINT: %s\n", #x); fflush(stdout); } +#define MINT_IN_CASE(x) case x: #define MINT_IN_BREAK break #endif @@ -795,8 +793,7 @@ get_virtual_method_fast (InterpMethod *imethod, MonoVTable *vtable, int offset) static int stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) -{ - //MH_LOG("Converting stackval to data for type %s: ", mono_type_get_name (type)); +{ log_mono_type (type); if (m_type_is_byref (type)) { @@ -1478,8 +1475,7 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui else margs->fargs = g_malloc0 (sizeof (double) * margs->flen); } - for (int i = 0; i < sig->param_count; i++) { - //MH_LOG_INDENT(); + for (int i = 0; i < sig->param_count; i++) { guint32 offset = get_arg_offset (frame->imethod, sig, i); stackval *sp_arg = STACK_ADD_BYTES (frame->stack, offset); @@ -1560,8 +1556,7 @@ build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, Bui default: g_assert_not_reached (); break; - } - //MH_LOG_UNINDENT(); + } } #endif @@ -2140,8 +2135,7 @@ interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject g_assert (context->stack_pointer < context->stack_end); MONO_ENTER_GC_UNSAFE; mono_interp_exec_method (&frame, context, NULL); - MONO_EXIT_GC_UNSAFE; - //MH_LOG_UNINDENT(); + MONO_EXIT_GC_UNSAFE; context->stack_pointer = (guchar*)sp; if (context->has_resume_state) { @@ -3505,12 +3499,8 @@ mono_interp_leave (InterpFrame* parent_frame) * We need for mono_thread_get_undeniable_exception to be able to unwind * to check the abort threshold. For this to work we use frame as a * dummy frame that is stored in the lmf and serves as the transition frame - */ - //MH_LOG_INDENT(); - //MH_LOG("Calling do_icall_wrapper for mono_thread_get_undeniable_exception\n"); - do_icall_wrapper (&frame, NULL, SIZEOF_VOID_P == 4 ? MINT_ICALLSIG_V_4 : MINT_ICALLSIG_V_8, &tmp_sp, &tmp_sp, (gpointer)mono_thread_get_undeniable_exception, FALSE, &gc_transitions); - //MH_LOG("..Finished calling do_icall_wrapper for mono_thread_get_undeniable_exception\n"); - //MH_LOG_UNINDENT(); + */ + do_icall_wrapper (&frame, NULL, SIZEOF_VOID_P == 4 ? MINT_ICALLSIG_V_4 : MINT_ICALLSIG_V_8, &tmp_sp, &tmp_sp, (gpointer)mono_thread_get_undeniable_exception, FALSE, &gc_transitions); return (MonoException*)tmp_sp.data.p; } @@ -4166,7 +4156,8 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause gpointer *cache = (gpointer*)&frame->imethod->data_items [ip [7]]; /* for calls, have ip pointing at the start of next instruction */ frame->state.ip = ip + 8; - + + if (imethod->method) ves_pinvoke_method (imethod, csignature, (MonoFuncV)code, context, frame, (stackval*)(locals + ip [1]), (stackval*)(locals + ip [3]), save_last_error, cache, &gc_transitions); EXCEPTION_CHECKPOINT; CHECK_RESUME_STATE (context); @@ -4246,8 +4237,7 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause cmethod = (InterpMethod*)frame->imethod->data_items [ip [3]]; return_offset = ip [1]; call_args_offset = ip [2]; - //MH_LOG("MINT_CALL for %s. return offset %d, call_args_offset %d", mono_method_get_name_full(frame->imethod->method, TRUE, TRUE, MONO_TYPE_NAME_FORMAT_IL), return_offset, call_args_offset); -#ifdef ENABLE_EXPERIMENT_TIERED + #ifdef ENABLE_EXPERIMENT_TIERED ip += 5; #else ip += 4; @@ -4339,38 +4329,29 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause } MINT_IN_CASE(MINT_RET) frame->retval [0] = LOCAL_VAR (ip [1], stackval); - //MH_LOG("returning pointer %p or long %lld", frame->retval [0].data.p, frame->retval [0].data.l); goto exit_frame; MINT_IN_CASE(MINT_RET_I1) frame->retval [0].data.i = (gint8) LOCAL_VAR (ip [1], gint32); - //MH_LOG("MINT_RET_I1 %d", frame->retval [0].data.i); goto exit_frame; MINT_IN_CASE(MINT_RET_U1) frame->retval [0].data.i = (guint8) LOCAL_VAR (ip [1], gint32); - //MH_LOG("MINT_RET_U1 %d", frame->retval [0].data.i); goto exit_frame; MINT_IN_CASE(MINT_RET_I2) frame->retval [0].data.i = (gint16) LOCAL_VAR (ip [1], gint32); - //MH_LOG("MINT_RET_I2 %d", frame->retval [0].data.i); goto exit_frame; MINT_IN_CASE(MINT_RET_U2) - frame->retval [0].data.i = (guint16) LOCAL_VAR (ip [1], gint32); - //MH_LOG("MINT_RET_U2 %d", frame->retval [0].data.i); + frame->retval [0].data.i = (guint16) LOCAL_VAR (ip [1], gint32); goto exit_frame; MINT_IN_CASE(MINT_RET_I4_IMM) - frame->retval [0].data.i = (gint16)ip [1]; - //MH_LOG("MINT_RET_I4_IMM"); + frame->retval [0].data.i = (gint16)ip [1]; goto exit_frame; MINT_IN_CASE(MINT_RET_I8_IMM) - frame->retval [0].data.l = (gint16)ip [1]; - //MH_LOG("MINT_RET_I8_IMM casting to gint16 ip[1] = %lld", frame->retval [0].data.l); + frame->retval [0].data.l = (gint16)ip [1]; goto exit_frame; - MINT_IN_CASE(MINT_RET_VOID) - //MH_LOG("void returning"); + MINT_IN_CASE(MINT_RET_VOID) goto exit_frame; MINT_IN_CASE(MINT_RET_VT) { - memmove (frame->retval, locals + ip [1], ip [2]); - //MH_LOG("returning vt, moved %d bytes from offset to give %p", ip[2], ip[1]); + memmove (frame->retval, locals + ip [1], ip [2]); goto exit_frame; } MINT_IN_CASE(MINT_RET_LOCALLOC) @@ -4961,11 +4942,9 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; MINT_IN_BREAK; } MINT_IN_CASE(MINT_LDIND_I8) -#ifdef NO_UNALIGNED_ACCESS - //MH_LOG("doing unaligned access for MINT_LDIND_I8\n"); +#ifdef NO_UNALIGNED_ACCESS LDIND(gint64, gint64, TRUE); -#else - //MH_LOG("doing aligned access for MINT_LDIND_I8\n"); +#else LDIND(gint64, gint64, FALSE); #endif MINT_IN_BREAK; @@ -7577,8 +7556,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; // No sign extension is needed, we just move bytes from the execution // stack, no additional conversion is needed. MINT_IN_CASE(MINT_MOV_1) - (*(gint8*)(locals + (ip[1]))) = (*(gint8*)(locals + (ip[2]))); - //MH_LOG("MINT_MOV_1: %d <- %d: %p\n", ip[1], ip[2], (void*)(*(gint8*)(locals + (ip[1])))); + (*(gint8*)(locals + (ip[1]))) = (*(gint8*)(locals + (ip[2]))); ip += 3; MINT_IN_BREAK; MINT_IN_CASE(MINT_MOV_2) MOV(gint16, gint16); MINT_IN_BREAK; @@ -7586,8 +7564,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; MINT_IN_CASE(MINT_MOV_4) // TODO: this is hardcoded for x64 //assert(((uintptr_t)locals % 8) == 0 && "locals is not 8-byte aligned"); - (*(guint32*)(locals + (ip[1]))) = (*(guint32*)(locals + (ip[2]))); - //MH_LOG("MINT_MOV_4: %d <- %d: %p\n", ip[1], ip[2], (void*)(*(guint32*)(locals + (ip[1])))); + (*(guint32*)(locals + (ip[1]))) = (*(guint32*)(locals + (ip[2]))); ip += 3;; MINT_IN_BREAK; MINT_IN_CASE(MINT_MOV_8) @@ -7913,8 +7890,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; MINT_IN_BREAK; } - MINT_IN_CASE(MINT_TIER_ENTER_JITERPRETER) { - //MH_LOG("*** Jiterpreter thunk warning location: %p\n", ip); + MINT_IN_CASE(MINT_TIER_ENTER_JITERPRETER) { // The fn ptr is encoded in a guint16 relative to the index of the first trace fn ptr, so compute the actual ptr JiterpreterThunk thunk = (JiterpreterThunk)(void *)(((JiterpreterOpcode *)ip)->relative_fn_ptr + mono_jiterp_first_trace_fn_ptr); ptrdiff_t offset = thunk (frame, locals, NULL, ip); @@ -7980,8 +7956,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; * FIXME We should be able to avoid dereferencing imethod here, if we will have * a param_area and all calls would inherit the same sp, or if we are full coop. */ - context->stack_pointer = (guchar*)frame->stack + frame->imethod->alloca_size; - //MH_LOG("exiting frame %p for %s", frame, mono_method_get_name_full(frame->imethod->method, FALSE, TRUE, MONO_TYPE_NAME_FORMAT_IL)); + context->stack_pointer = (guchar*)frame->stack + frame->imethod->alloca_size; LOAD_INTERP_STATE (frame); CHECK_RESUME_STATE (context); @@ -9139,13 +9114,11 @@ mono_jiterp_get_simd_opcode (int arity, int index) EMSCRIPTEN_KEEPALIVE intptr_t mono_jiterp_get_opcode_info (int opcode, int type) -{ - //MH_LOG("Test jiterp opcode %d type %d\n", opcode, type); +{ g_assert ((opcode >= 0) && (opcode <= MINT_LASTOP)); switch (type) { case JITERP_OPINFO_TYPE_NAME: - // We know this conversion is safe because wasm pointers are 32 bits - // not in wasm64 they aren't + // We know this conversion is safe because wasm pointers are 32 bits...not in wasm64 return (intptr_t)(mono_interp_opname (opcode)); case JITERP_OPINFO_TYPE_LENGTH: return mono_interp_oplen [opcode]; diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index 2e43168230a072..bd8832503352ec 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -40,7 +40,6 @@ #if HOST_BROWSER #include "jiterpreter.h" #endif -#include "mono/metadata/mh_log.h" MonoInterpStats mono_interp_stats; @@ -119,8 +118,7 @@ interp_add_ins_explicit (TransformData *td, int opcode, int len) td->cbb->first_ins = new_inst; td->cbb->last_ins = new_inst; // We should delete this, but is currently used widely to set the args of an instruction - td->last_ins = new_inst; - //MH_LOG("adding instruction %s at offset %d", mono_interp_opname (opcode), td->current_il_offset); + td->last_ins = new_inst; return new_inst; } @@ -445,8 +443,7 @@ interp_create_var_explicit (TransformData *td, MonoType *type, int size) local->bb_index = -1; local->ext_index = -1; - td->vars_size++; - //MH_LOG("Creating var of type %s at index %d, size %d", mono_type_full_name (type), td->vars_size - 1, size); + td->vars_size++; return td->vars_size - 1; } @@ -1799,8 +1796,7 @@ interp_emit_ldelema (TransformData *td, MonoClass *array_class, MonoClass *check { MonoClass *element_class = m_class_get_element_class (array_class); int rank = m_class_get_rank (array_class); - int size = mono_class_array_element_size (element_class); - //MH_LOG("Emiting LDELEMA for %s, size %d\n", m_class_get_name (array_class), size); + int size = mono_class_array_element_size (element_class); gboolean bounded = m_class_get_byval_arg (array_class) ? m_class_get_byval_arg (array_class)->type == MONO_TYPE_ARRAY : FALSE; td->sp -= rank + 1; @@ -3135,8 +3131,7 @@ interp_inline_method (TransformData *td, MonoMethod *target_method, MonoMethodHe td->aggressive_inlining = TRUE; } if (td->verbose_level) - g_print ("Inline start method %s.%s\n", m_class_get_name (target_method->klass), target_method->name); - //MH_LOG("Inline start method %s.%s", m_class_get_name (target_method->klass), target_method->name); + g_print ("Inline start method %s.%s\n", m_class_get_name (target_method->klass), target_method->name); td->inline_depth++; ret = generate_code (td, target_method, header, generic_context, error); td->inline_depth--; @@ -5321,9 +5316,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, original_bb = bb = mono_basic_block_split (method, error, header); goto_if_nok (error, exit); g_assert (bb); - - //MH_LOG("Generating code for method %s", mono_method_full_name (method, TRUE)); - + td->il_code = header->code; td->in_start = td->ip = header->code; end = td->ip + header->code_size; @@ -5459,10 +5452,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, arg_locals = (guint32*) g_malloc ((!!signature->hasthis + signature->param_count) * sizeof (guint32)); /* Allocate locals to store inlined method args from stack */ for (int i = signature->param_count - 1; i >= 0; i--) { - MonoType *type = get_type_from_stack (td->sp [-1].type, td->sp [-1].klass); - - //MH_LOG("Creating local for inlined arg %d: %s", i, mono_type_full_name (type)); - + MonoType *type = get_type_from_stack (td->sp [-1].type, td->sp [-1].klass); local = interp_create_var (td, type); arg_locals [i + !!signature->hasthis] = local; store_local (td, local); @@ -9981,8 +9971,7 @@ mono_interp_transform_method (InterpMethod *imethod, ThreadContext *context, Mon if (mono_class_is_open_constructed_type (m_class_get_byval_arg (method->klass))) { mono_error_set_invalid_operation (error, "%s", "Could not execute the method because the containing type is not fully instantiated."); return; - } - //MH_LOG("transforming method %s", method->name); + } // g_printerr ("TRANSFORM(0x%016lx): begin %s::%s\n", mono_thread_current (), method->klass->name, method->name); method_class_vt = mono_class_vtable_checked (imethod->method->klass, error); return_if_nok (error); diff --git a/src/mono/sample/wasm/browser-test-debug/main.js b/src/mono/sample/wasm/browser-test-debug/main.js index 666bfc49248bdb..d334400c1df291 100644 --- a/src/mono/sample/wasm/browser-test-debug/main.js +++ b/src/mono/sample/wasm/browser-test-debug/main.js @@ -53,9 +53,7 @@ try { // config is loaded and could be tweaked before the rest of the runtime startup sequence config.environmentVariables["MONO_LOG_LEVEL"] = "debug"; config.environmentVariables["MONO_LOG_MASK"] = "gc"; - config.environmentVariables["MONO_GC_DEBUG"] = "8:gc_log.txt,print-gchandles,clear-nursery-at-gc"; - // 1 or lower = None, 2 = info, 3 = debug, 4 = verbose, 5 = trace - config.environmentVariables["MH_LOG_VERBOSITY"] = "5"; + config.environmentVariables["MONO_GC_DEBUG"] = "8:gc_log.txt,print-gchandles,clear-nursery-at-gc"; }, preInit: () => { console.log('user code Module.preInit'); }, preRun: () => { console.log('user code Module.preRun'); }, From 543ea8e26ca2987150bbc68d9fa4d5cfb20f3af1 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 7 Nov 2025 14:49:17 +0000 Subject: [PATCH 201/209] Tidying Undo macro expansion in interp --- src/mono/mono/mini/interp/interp-icalls.c | 10 ++--- src/mono/mono/mini/interp/interp.c | 45 ++++------------------- 2 files changed, 11 insertions(+), 44 deletions(-) diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index 61656eb6fa9f1e..8279c684e900af 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -93,8 +93,7 @@ stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean { intptr_t data_ptr = *(intptr_t *)data; -// memset(result, 0, sizeof(stackval)); - log_mono_type(type); +// memset(result, 0, sizeof(stackval)); if (m_type_is_byref (type)) { result->data.p = *(gpointer*)data; return; @@ -201,9 +200,7 @@ static char * log_sig(MonoMethodSignature* sig) offset += sprintf(buffer + offset, "_%s", sig->ret->type == MONO_TYPE_VOID ? "V" : (interp_type_as_ptr4(sig->ret) ? "4" : "8")); return strdup(buffer); } -static void log_op(MintICallSig op) -{ -} + void do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval *sp, gpointer ptr, gboolean save_last_error) { @@ -2512,7 +2509,6 @@ do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval if (sig) { stackval_from_data(sig->ret, ret_sp, (char*)&ret_sp->data.p, sig->pinvoke && !sig->marshalling_disabled); - } - else + } } diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index 0d10d4ffcc6153..1847453c2816cc 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -793,9 +793,7 @@ get_virtual_method_fast (InterpMethod *imethod, MonoVTable *vtable, int offset) static int stackval_to_data (MonoType *type, stackval *val, void *data, gboolean pinvoke) -{ - log_mono_type (type); - +{ if (m_type_is_byref (type)) { gpointer *p = (gpointer*)data; *p = val->data.p; @@ -1211,9 +1209,7 @@ initialize_arg_offsets (InterpMethod *imethod, MonoMethodSignature *csig) } for (int i = 0; i < sig->param_count; i++) { MonoType *type = sig->params [i]; - int size, align; - log_mono_type(type); - log_mint_type(mono_mint_type (type)); + int size, align; size = mono_interp_type_size (type, mono_mint_type (type), &align); offset = ALIGN_TO (offset, align); arg_offsets [index++] = offset; @@ -1442,7 +1438,6 @@ get_build_args_from_sig_info (MonoMemoryManager *mem_manager, MonoMethodSignatur return info; } -#define DEBUG_MH 1 static void build_args_from_sig (InterpMethodArguments *margs, MonoMethodSignature *sig, BuildArgsFromSigInfo *info, InterpFrame *frame) { @@ -2772,9 +2767,7 @@ init_arglist (InterpFrame *frame, MonoMethodSignature *sig, stackval *sp, char * for (int i = sig->sentinelpos; i < sig->param_count; i++) { int align, arg_size, sv_size; - arg_size = mono_type_stack_size (sig->params [i], &align); - log_mono_type(sig->params [i]); - + arg_size = mono_type_stack_size (sig->params [i], &align); arglist = (char*)ALIGN_PTR_TO (arglist, align); sv_size = stackval_to_data (sig->params [i], sp, arglist, FALSE); arglist += arg_size; @@ -4156,8 +4149,7 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause gpointer *cache = (gpointer*)&frame->imethod->data_items [ip [7]]; /* for calls, have ip pointing at the start of next instruction */ frame->state.ip = ip + 8; - - if (imethod->method) + ves_pinvoke_method (imethod, csignature, (MonoFuncV)code, context, frame, (stackval*)(locals + ip [1]), (stackval*)(locals + ip [3]), save_last_error, cache, &gc_transitions); EXCEPTION_CHECKPOINT; CHECK_RESUME_STATE (context); @@ -7072,10 +7064,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; MINT_IN_BREAK; } MINT_IN_CASE(MINT_LDPTR) - (*(gpointer*)(locals + (ip[1]))) = frame->imethod->data_items [ip [2]]; - { - intptr_t result = (*(guint64*)(locals + (ip[1]))); - } + LOCAL_VAR (ip [1], gpointer) = frame->imethod->data_items [ip [2]]; ip += 3; MINT_IN_BREAK; MINT_IN_CASE(MINT_MONO_NEWOBJ) @@ -7555,29 +7544,11 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; // These moves are used to store into the field of a local valuetype // No sign extension is needed, we just move bytes from the execution // stack, no additional conversion is needed. - MINT_IN_CASE(MINT_MOV_1) - (*(gint8*)(locals + (ip[1]))) = (*(gint8*)(locals + (ip[2]))); - ip += 3; - MINT_IN_BREAK; + MINT_IN_CASE(MINT_MOV_1) MOV(gint8, gint8); MINT_IN_BREAK; MINT_IN_CASE(MINT_MOV_2) MOV(gint16, gint16); MINT_IN_BREAK; // Normal moves between locals - MINT_IN_CASE(MINT_MOV_4) - // TODO: this is hardcoded for x64 - //assert(((uintptr_t)locals % 8) == 0 && "locals is not 8-byte aligned"); - (*(guint32*)(locals + (ip[1]))) = (*(guint32*)(locals + (ip[2]))); - ip += 3;; - MINT_IN_BREAK; - MINT_IN_CASE(MINT_MOV_8) - // TODO: this is hardcoded for x64 - assert(((uintptr_t)locals % 8) == 0 && "locals is not 8-byte aligned"); - - (*(guint64*)(locals + (ip[1]))) = (*(guint64*)(locals + (ip[2]))); - { - intptr_t result = (*(guint64*)(locals + (ip[1]))); - } - ip += 3;; - MINT_IN_BREAK; - + MINT_IN_CASE(MINT_MOV_4) MOV(guint32, guint32); MINT_IN_BREAK; + MINT_IN_CASE(MINT_MOV_8) MOV(guint64, guint64); MINT_IN_BREAK; MINT_IN_CASE(MINT_MOV_VT) { guint16 size = ip [3]; memmove (locals + ip [1], locals + ip [2], size); From db18614654fd36e5803bcd2c9b2e9077917d9d91 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 7 Nov 2025 16:03:11 +0000 Subject: [PATCH 202/209] Tidying --- src/mono/mono/mini/interp/transform.c | 8 +- src/mono/mono/profiler/browser.c | 7 +- .../sample/wasm/browser-advanced/Program.cs | 76 +- .../sample/wasm/browser-advanced/fibonacci.c | 25 - src/mono/sample/wasm/browser-advanced/main.js | 23 +- .../sample/wasm/browser-test-debug/Assert.cs | 209 --- .../wasm/browser-test-debug/GCHandleTests.cs | 414 ----- .../browser-test-debug/ILLink.Descriptors.xml | 8 - .../JavaScriptTestHelper.cs | 1384 ----------------- .../JavaScriptTestHelper.mjs | 493 ------ .../sample/wasm/browser-test-debug/Program.cs | 558 ------- .../wasm/browser-test-debug/StringTests.cs | 11 - .../wasm/browser-test-debug/TryWrite.cs | 730 --------- .../Wasm.Test.Debug.Sample.csproj | 63 - .../advanced-sample.lib.module.js | 10 - .../wasm/browser-test-debug/fibonacci.c | 62 - .../sample/wasm/browser-test-debug/index.html | 25 - .../sample/wasm/browser-test-debug/main.js | 115 -- .../wasm/browser-test-debug/wasmString.c | 8 - .../wasm/browser-test-debug/wasmString.h | 15 - 20 files changed, 10 insertions(+), 4234 deletions(-) delete mode 100644 src/mono/sample/wasm/browser-test-debug/Assert.cs delete mode 100644 src/mono/sample/wasm/browser-test-debug/GCHandleTests.cs delete mode 100644 src/mono/sample/wasm/browser-test-debug/ILLink.Descriptors.xml delete mode 100644 src/mono/sample/wasm/browser-test-debug/JavaScriptTestHelper.cs delete mode 100644 src/mono/sample/wasm/browser-test-debug/JavaScriptTestHelper.mjs delete mode 100644 src/mono/sample/wasm/browser-test-debug/Program.cs delete mode 100644 src/mono/sample/wasm/browser-test-debug/StringTests.cs delete mode 100644 src/mono/sample/wasm/browser-test-debug/TryWrite.cs delete mode 100644 src/mono/sample/wasm/browser-test-debug/Wasm.Test.Debug.Sample.csproj delete mode 100644 src/mono/sample/wasm/browser-test-debug/advanced-sample.lib.module.js delete mode 100644 src/mono/sample/wasm/browser-test-debug/fibonacci.c delete mode 100644 src/mono/sample/wasm/browser-test-debug/index.html delete mode 100644 src/mono/sample/wasm/browser-test-debug/main.js delete mode 100644 src/mono/sample/wasm/browser-test-debug/wasmString.c delete mode 100644 src/mono/sample/wasm/browser-test-debug/wasmString.h diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index bd8832503352ec..256b1928f9d552 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -2823,7 +2823,7 @@ is_scalar_vtype_test(MonoType *type) } #define INTERP_TYPE_AS_PTR(tp) interp_type_as_ptr (tp) -#define DEBUG_ENCODE_SIGNATURE 1 +#define DEBUG_ENCODE_SIGNATURE 0 #define ENCODE_4BYTE 0b01 #define ENCODE_8BYTE 0b10 @@ -2954,10 +2954,8 @@ interp_get_icall_sig (MonoMethodSignature *sig) } else return MINT_ICALLSIG_MAX; // not a pointer type - double check - } - else - } - // returnType of 0 == void + } + } int returnType = GET_PARAM_SIZE(sig->ret); if (returnType == 0 && sig->ret->type != MONO_TYPE_VOID) { diff --git a/src/mono/mono/profiler/browser.c b/src/mono/mono/profiler/browser.c index 4a11fce17ccdf3..fb4954d1a644c8 100644 --- a/src/mono/mono/profiler/browser.c +++ b/src/mono/mono/profiler/browser.c @@ -182,12 +182,7 @@ method_exc_leave (MonoProfiler *prof, MonoMethod *method, MonoObject *exc) if (!is_over) { top_index = is_over ? MAX_STACK_DEPTH - 1 : top_stack_frame_index; top_frame = &profiler_stack_frames[top_index]; - //g_assertf(top_frame->method == method, "method_exc_leave: %d method mismatch top_frame %s != leave %s\n", top_stack_frame_index, mono_method_get_full_name (top_frame->method), mono_method_get_full_name (method)); - if (top_frame->method != method) { - if (strcmp(mono_method_get_full_name(top_frame->method), mono_method_get_full_name(method)) != 0) { - g_warning("method_exc_leave: %d method mismatch top_frame %s != leave %s\n", top_stack_frame_index, mono_method_get_full_name(top_frame->method), mono_method_get_full_name(method)); - } - } + g_assertf(top_frame->method == method, "method_exc_leave: %d method mismatch top_frame %s != leave %s\n", top_stack_frame_index, mono_method_get_full_name (top_frame->method), mono_method_get_full_name (method)); } } diff --git a/src/mono/sample/wasm/browser-advanced/Program.cs b/src/mono/sample/wasm/browser-advanced/Program.cs index d6b6c65f380502..89db89d3857de1 100644 --- a/src/mono/sample/wasm/browser-advanced/Program.cs +++ b/src/mono/sample/wasm/browser-advanced/Program.cs @@ -43,10 +43,7 @@ public static async Task Main(string[] args) [LibraryImport("fibonacci")] public static partial int Fibonacci(int n); - - [LibraryImport("testGLStartup")] - public static partial void testGLStartup(); - + [JSImport("Sample.Test.add", "main.js")] internal static partial int Add(int a, int b); @@ -59,76 +56,10 @@ internal static async Task PrintMeaning(Task meaningPromise) { Console.WriteLine("Meaning of life is " + await meaningPromise); } - - [JSExport] - internal static async Task PrintMeaningDEBUG(int value) - { - Console.WriteLine("Meaning of life is " + value); - } - [JSExport] - internal static int SimpleTestFunctionInt() - { - return 666; - } - - [JSExport] - internal static int SimpleTestFunctionIntSize() - { - return sizeof(int); - } - - [JSExport] - internal static string SimpleTestFunctionString() - { - return "Your lucky number today is:"; - } - - [JSExport] - internal static void SimpleTestFunctionPrintEmptyString() - { - // write an empty string to the console - Console.WriteLine(""); - } - [JSExport] - internal static bool SimpleTestConsole() - { - // see if we can access anything from the console - System.IO.TextWriter output = Console.Out; - return output != null; - } - [JSExport] - internal static void SimpleTestArray() - { - - //var arrayPtr = System.MHTestClass.RunTestArray(); - //var arrayPtr = System.MHTestClass.RunTestArrayRaw(); - //var h = new Mono.SafeGPtrArrayHandle(arrayPtr); - - var a = 1;// h[0]; - var b = 2;// h[1]; - var c = 3;// h[2]; - - //return a + b + c; - //using (var h = new Mono.SafeGPtrArrayHandle(TestArray_native()); - } - [JSExport] - internal static void SimpleTestFunctionPrintString() - { - // write an empty string to the console - Console.WriteLine("MH DOING A TEST"); - } - [JSExport] - internal static void TestGL() - { - testGLStartup(); - } [JSExport] internal static int TestMeaning() - { - testGLStartup(); - int testSize = 123; - Console.WriteLine("Size of an int is " + sizeof(int) + " bytes, and test size is " + testSize + " bytes."); + { // call to C code via [DllImport] var half = Fibonacci(8); @@ -138,8 +69,7 @@ internal static int TestMeaning() [JSExport] internal static void SillyLoop() - { - Console.WriteLine("Entering SillyLoop()"); + { // this silly method will generate few sample points for the profiler for (int i = 1; i <= 60; i ++) { diff --git a/src/mono/sample/wasm/browser-advanced/fibonacci.c b/src/mono/sample/wasm/browser-advanced/fibonacci.c index ff269d393dcb6f..7f4383b77fd18e 100644 --- a/src/mono/sample/wasm/browser-advanced/fibonacci.c +++ b/src/mono/sample/wasm/browser-advanced/fibonacci.c @@ -1,5 +1,3 @@ -#include -#include int Fibonacci(int n) { int fnow = 0, fnext = 1, tempf; while(--n>0){ @@ -9,27 +7,4 @@ int Fibonacci(int n) { } return fnext; } -void testGLStartup() -{ - EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = 0; - EmscriptenWebGLContextAttributes attrs; - attrs.depth = 1; - attrs.stencil = 1; - attrs.antialias = 1; - attrs.premultipliedAlpha = 1; - attrs.preserveDrawingBuffer = 0; - attrs.powerPreference = EM_WEBGL_POWER_PREFERENCE_DEFAULT; //EM_WEBGL_POWER_PREFERENCE_HIGH_PERFORMANCE - attrs.failIfMajorPerformanceCaveat = 0; - attrs.majorVersion = 2; - attrs.minorVersion = 0; - attrs.enableExtensionsByDefault = 1; - attrs.explicitSwapControl = 0; - attrs.renderViaOffscreenBackBuffer = 0; - attrs.proxyContextToMainThread = EMSCRIPTEN_WEBGL_CONTEXT_PROXY_DISALLOW; - emscripten_console_log("Creating webGL context"); - const char* canvasIdStr ="MYCANVASID"; - printf("Canvas id: %s\n", canvasIdStr); fflush(stdout); - context = emscripten_webgl_create_context(canvasIdStr, &attrs); - printf("**OPENGL CONTEXT TEST Context: %d\n", context);fflush(stdout); -} diff --git a/src/mono/sample/wasm/browser-advanced/main.js b/src/mono/sample/wasm/browser-advanced/main.js index 94fdc87c28650d..d40b70a9b3f62a 100644 --- a/src/mono/sample/wasm/browser-advanced/main.js +++ b/src/mono/sample/wasm/browser-advanced/main.js @@ -6,11 +6,7 @@ import { dotnet, exit } from './dotnet.js' function add(a, b) { return a + b; } -function setLogLevel(logLevel) { - const runtimeApi = globalThis.getDotnetRuntime(0); - runtimeApi.INTERNAL.MH_SetLogVerbosity(logLevel); -} function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } @@ -97,15 +93,7 @@ try { const config = getConfig(); const exports = await getAssemblyExports(config.mainAssemblyName); - console.clear(); - //console.debug("Accessing console:"); - const result = exports.Sample.Test.SimpleTestConsole(); - console.debug(`result: ${result}`); - setLogLevel(3); - console.clear(); - //exports.Sample.Test.DoTestMethod(); - exports.Sample.Test.TestGL(); - + const meaning = exports.Sample.Test.TestMeaning(); if (typeof Module.GL !== "object") { exit(-10, "Can't find GL"); @@ -117,14 +105,9 @@ try { if (!exports.Sample.Test.IsPrime(meaning)) { document.getElementById("out").innerHTML = `${meaning} as computed on dotnet ver ${runtimeBuildInfo.productVersion}`; } - //exports.Sample.Test.SimpleTestFunctionPrintString(); - const deepMeaning = new Promise(resolve => setTimeout(() => resolve(meaning), 100)); - //const deepMeaning = new Promise(resolve => { - // resolve(meaning); - //}); - exports.Sample.Test.PrintMeaning(deepMeaning); - //exports.Sample.Test.PrintMeaningDEBUG(meaning); + const deepMeaning = new Promise(resolve => setTimeout(() => resolve(meaning), 100)); + exports.Sample.Test.PrintMeaning(deepMeaning); exports.Sample.Test.SillyLoop(); let exit_code = await runMain(config.mainAssemblyName, []); diff --git a/src/mono/sample/wasm/browser-test-debug/Assert.cs b/src/mono/sample/wasm/browser-test-debug/Assert.cs deleted file mode 100644 index 05ef9a79257364..00000000000000 --- a/src/mono/sample/wasm/browser-test-debug/Assert.cs +++ /dev/null @@ -1,209 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Sample -{ - public static class Assert - { - private static string FormatIfArray(object? obj) - { - if (obj is Array arr) - { - var items = new System.Text.StringBuilder(); - items.Append('['); - for (int i = 0; i < arr.Length; i++) - { - if (i > 0) items.Append(", "); - var value = arr.GetValue(i); - // Recursively format nested arrays - items.Append(FormatIfArray(value)); - } - items.Append(']'); - return items.ToString(); - } - // For collections (e.g., List) - if (obj is System.Collections.IEnumerable enumerable && !(obj is string)) - { - var items = new System.Text.StringBuilder(); - items.Append('['); - bool first = true; - foreach (var value in enumerable) - { - if (!first) items.Append(", "); - items.Append(FormatIfArray(value)); - first = false; - } - items.Append(']'); - return items.ToString(); - } - return obj?.ToString() ?? "null"; - } - - public static TException Throws(Action action) where TException : Exception - { - try - { - action(); - } - catch (Exception ex) - { - if (ex is TException expected) - return expected; - throw new Exception($"AssertHelper.Throws failed. Expected exception of type {typeof(TException)}, but got {ex.GetType()}.\nMessage: {ex.Message}", ex); - } - throw new Exception($"AssertHelper.Throws failed. No exception was thrown. Expected exception of type {typeof(TException)}."); - } - public static TException Throws(string? paramName, Action action) where TException : ArgumentException - { - try - { - action(); - } - catch (Exception ex) - { - if (ex is TException expected) - { - if (paramName != null && !string.Equals(expected.ParamName, paramName, StringComparison.Ordinal)) - { - throw new Exception( - $"Assert.Throws failed. Expected ParamName: '{paramName}', but got: '{expected.ParamName}'.\nMessage: {ex.Message}", ex); - } - return expected; - } - throw new Exception( - $"Assert.Throws failed. Expected exception of type {typeof(TException)}, but got {ex.GetType()}.\nMessage: {ex.Message}", ex); - } - throw new Exception( - $"Assert.Throws failed. No exception was thrown. Expected exception of type {typeof(TException)}."); - } - public static void Contains(T expected, IEnumerable collection) - { - if (collection == null) - throw new Exception("AssertHelper.Contains failed. Collection is null."); - foreach (var item in collection) - { - if (object.Equals(item, expected)) - return; - } - throw new Exception($"AssertHelper.Contains failed. Expected item: {FormatIfArray(expected)} was not found in collection: {FormatIfArray(collection)}."); - } - public static void Contains(string expectedSubstring, string? actualString, StringComparison comparisonType) - { - if (actualString == null) - throw new Exception("AssertHelper.Contains failed. Actual string is null."); - if (!actualString.Contains(expectedSubstring, comparisonType)) - throw new Exception($"AssertHelper.Contains failed. Expected substring: \"{expectedSubstring}\" was not found in string: \"{actualString}\" (comparison: {comparisonType})."); - } - public static void Contains(string expectedSubstring, string? actualString) - { - if (actualString == null) - throw new Exception("AssertHelper.Contains failed. Actual string is null."); - if (!actualString.Contains(expectedSubstring, StringComparison.Ordinal)) - throw new Exception($"AssertHelper.Contains failed. Expected substring: \"{expectedSubstring}\" was not found in string: \"{actualString}\"."); - } - - public static void DoesNotContain(T expected, IEnumerable collection) - { - if (collection == null) - throw new Exception("AssertHelper.DoesNotContain failed. Collection is null."); - foreach (var item in collection) - { - if (object.Equals(item, expected)) - throw new Exception($"AssertHelper.DoesNotContain failed. Item: {FormatIfArray(expected)} was found in collection: {FormatIfArray(collection)}."); - } - } - - public static void DoesNotContain(string expectedSubstring, string? actualString) - { - if (actualString == null) - return; - if (actualString.Contains(expectedSubstring, StringComparison.Ordinal)) - throw new Exception($"AssertHelper.DoesNotContain failed. Substring: \"{expectedSubstring}\" was found in string: \"{actualString}\"."); - } - public static void NotEqual(T expected, T actual) - { - if (object.Equals(expected, actual)) - { - string expectedStr = FormatIfArray(expected); - string actualStr = FormatIfArray(actual); - throw new Exception($"AssertHelper.NotEqual failed. Expected: {expectedStr}. Actual: {actualStr}."); - } - } - public static void Equal(T expected, T actual) - { - // Handle nulls - if (ReferenceEquals(expected, actual)) - return; - if (expected is null || actual is null) - throw new Exception($"AssertHelper.Equal failed. Expected: {FormatIfArray(expected)}, Actual: {FormatIfArray(actual)}."); - - // Recursively compare arrays - if (expected is Array expectedArray && actual is Array actualArray) - { - if (expectedArray.Length != actualArray.Length) - throw new Exception($"AssertHelper.Equal failed. Array lengths differ. Expected: {FormatIfArray(expectedArray)}, Actual: {FormatIfArray(actualArray)}."); - - for (int i = 0; i < expectedArray.Length; i++) - { - var e = expectedArray.GetValue(i); - var a = actualArray.GetValue(i); - try - { - // Recursively call Equal for nested arrays/objects - Equal(e, a); - } - catch (Exception ex) - { - throw new Exception($"AssertHelper.Equal failed at index {i}. Expected: {FormatIfArray(expectedArray)}, Actual: {FormatIfArray(actualArray)}. Inner: {ex.Message}"); - } - } - return; - } - - // Fallback to default equality - if (!object.Equals(expected, actual)) - { - throw new Exception($"AssertHelper.Equal failed. Expected: {FormatIfArray(expected)}, Actual: {FormatIfArray(actual)}."); - } - } - public static void Same(object? expected, object? actual) - { - if (!ReferenceEquals(expected, actual)) - { - string expectedStr = FormatIfArray(expected); - string actualStr = FormatIfArray(actual); - throw new Exception( - $"AssertHelper.Same failed. Expected and actual are not the same reference.\nExpected: {expectedStr}\nActual: {actualStr}" - ); - } - } - public static void True(bool condition) - { - if (!condition) - throw new Exception("AssertHelper.True failed. Condition was false."); - } - public static void True(bool condition, string message) - { - if (!condition) - throw new Exception($"AssertHelper.True failed. Condition was false. {message}"); - } - public static void False(bool condition) - { - if (condition) - throw new Exception("AssertHelper.False failed. Condition was true."); - } - public static void StartsWith(string expectedStart, string? actual) - { - if (actual == null) - throw new Exception($"AssertHelper.StartsWith failed. Actual string was null. Expected start: \"{expectedStart}\"."); - - if (!actual.StartsWith(expectedStart, StringComparison.Ordinal)) - throw new Exception($"AssertHelper.StartsWith failed. Expected string starting with: \"{expectedStart}\". Actual: \"{actual}\"."); - } - public static void Null(object? expected) - { - if (expected != null) - throw new Exception($"AssertHelper.Null failed. Expected null, but got: {FormatIfArray(expected)}."); - } - } -} diff --git a/src/mono/sample/wasm/browser-test-debug/GCHandleTests.cs b/src/mono/sample/wasm/browser-test-debug/GCHandleTests.cs deleted file mode 100644 index 32e74b429c10d4..00000000000000 --- a/src/mono/sample/wasm/browser-test-debug/GCHandleTests.cs +++ /dev/null @@ -1,414 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Collections.Generic; -using System.Runtime.InteropServices; -using Sample; - -namespace System.Runtime.InteropServices.Tests -{ - static public class GCHandleTests - { - - static public void Ctor_Default() - { - //var handle = new GCHandle(); - - var handle = new System.Runtime.InteropServices.GCHandle(); - var t = handle.Target; - System.Console.WriteLine(handle.GetType().FullName); - //Assert.Throws(() => handle.Target); - Assert.False(handle.IsAllocated); - - Assert.Equal(IntPtr.Zero, GCHandle.ToIntPtr(handle)); - Assert.Equal(IntPtr.Zero, (IntPtr)handle); - } - - - //static public void Ctor_Default_Generic() - //{ - // var handle = new GCHandle(); - // Assert.Throws(() => handle.Target); - // Assert.False(handle.IsAllocated); - - // Assert.Equal(IntPtr.Zero, GCHandle.ToIntPtr(handle)); - //} - - - //static public void Ctor_Default_Weak() - //{ - // var handle = new WeakGCHandle(); - // Assert.Throws(() => handle.TryGetTarget(out _)); - // Assert.False(handle.IsAllocated); - - // Assert.Equal(IntPtr.Zero, WeakGCHandle.ToIntPtr(handle)); - //} - - - //static public void Ctor_Default_Pinned() - //{ - // var handle = new PinnedGCHandle(); - // Assert.Throws(() => handle.Target); - // Assert.False(handle.IsAllocated); - - // Assert.Equal(IntPtr.Zero, PinnedGCHandle.ToIntPtr(handle)); - //} - - //static public IEnumerable Alloc_TestData() - //{ - // yield return new object[] { null }; - // yield return new object[] { "String" }; - // yield return new object[] { 123 }; - // yield return new object[] { new int[1] }; - // yield return new object[] { new NonBlittable[1] }; - // yield return new object[] { new object[1] }; - // yield return new object[] { new NonBlittable() }; - //} - - ////[Theory] - ////[MemberData(nameof(Alloc_TestData))] - //static public void Alloc_Value_ReturnsExpected(object value) - //{ - // GCHandle handle = GCHandle.Alloc(value); - // ValidateGCHandle(handle, GCHandleType.Normal, value); - //} - - - //static public void Alloc_Value_ReturnsExpected_Genenic() - //{ - // RunTest(null); - // RunTest("String"); - // RunTest(new int[1]); - // RunTest(new object[1]); - // RunTest(new NonBlittable[1]); - // RunTest(new Blittable()); - // RunTest(new NonBlittable()); - // RunTest(new UnmanagedNonBlittable()); - // RunTest(new ClassWithReferences()); - // RunTest(new ClassWithoutReferences()); - - // void RunTest(T value) where T : class - // { - // ValidateGCHandle(new GCHandle(value), value); - // ValidateWeakGCHandle(new WeakGCHandle(value), value); - // ValidateWeakGCHandle(new WeakGCHandle(value, trackResurrection: true), value); - // ValidatePinnedGCHandle(new PinnedGCHandle(value), value); - // } - //} - - //static public IEnumerable Alloc_Type_TestData() - //{ - // foreach (object[] data in Alloc_TestData()) - // { - // yield return new object[] { data[0], GCHandleType.Normal }; - // yield return new object[] { data[0], GCHandleType.Weak }; - // yield return new object[] { data[0], GCHandleType.WeakTrackResurrection }; - // } - - // yield return new object[] { null, GCHandleType.Pinned }; - // yield return new object[] { "", GCHandleType.Pinned }; - // yield return new object[] { 1, GCHandleType.Pinned }; - // yield return new object[] { new object(), GCHandleType.Pinned }; - // yield return new object[] { new Blittable(), GCHandleType.Pinned }; - // yield return new object[] { new Blittable(), GCHandleType.Pinned }; - // yield return new object[] { new Blittable[0], GCHandleType.Pinned }; - // yield return new object[] { new UnmanagedNonBlittable(), GCHandleType.Pinned }; - // yield return new object[] { new UnmanagedNonBlittable[0], GCHandleType.Pinned }; - // yield return new object[] { new ClassWithoutReferences(), GCHandleType.Pinned }; - //} - - ////[Theory] - ////[MemberData(nameof(Alloc_Type_TestData))] - //static public void Alloc_Type_ReturnsExpected(object value, GCHandleType type) - //{ - // GCHandle handle = GCHandle.Alloc(value, type); - // ValidateGCHandle(handle, type, value); - //} - - //static public IEnumerable InvalidPinnedObject_TestData() - //{ - // yield return new object[] { new NonBlittable() }; - // yield return new object[] { new ClassWithReferences() }; - // yield return new object[] { new object[0] }; - // yield return new object[] { new NonBlittable[0] }; - // yield return new object[] { new ClassWithoutReferences[0] }; - //} - - ////[Theory] - ////[MemberData(nameof(InvalidPinnedObject_TestData))] - //static public void Alloc_InvalidPinnedObject_ThrowsArgumentException(object value) - //{ - // Assert.Throws(() => GCHandle.Alloc(value, GCHandleType.Pinned)); - //} - - ////[Theory] - ////[InlineData(GCHandleType.Weak - 1)] - ////[InlineData(GCHandleType.Pinned + 1)] - //static public void Alloc_InvalidGCHandleType_ThrowsArgumentOutOfRangeException(GCHandleType type) - //{ - // AssertExtensions.Throws("type", () => GCHandle.Alloc(new object(), type)); - //} - - - //static public void FromIntPtr_Zero_ThrowsInvalidOperationException() - //{ - // Assert.Throws(() => GCHandle.FromIntPtr(IntPtr.Zero)); - //} - - - //static public void FromIntPtr_Generic_Zero_NoCheck() - //{ - // var handle = GCHandle.FromIntPtr(IntPtr.Zero); - // Assert.False(handle.IsAllocated); - // var weakHandle = WeakGCHandle.FromIntPtr(IntPtr.Zero); - // Assert.False(weakHandle.IsAllocated); - // var pinnedHandle = PinnedGCHandle.FromIntPtr(IntPtr.Zero); - // Assert.False(pinnedHandle.IsAllocated); - //} - - - //static public unsafe void AddrOfPinnedObject_NotInitialized_ThrowsException() - //{ - // var handle = new GCHandle(); - // Assert.Throws(() => handle.AddrOfPinnedObject()); - // var handleOfObject = new PinnedGCHandle(); - // Assert.Throws(() => handleOfObject.GetAddressOfObjectData()); - // var handleOfString = new PinnedGCHandle(); - // Assert.Throws(() => handleOfString.GetAddressOfStringData()); - // var handleOfArray = new PinnedGCHandle(); - // Assert.Throws(() => handleOfArray.GetAddressOfArrayData()); - //} - - - //static public unsafe void AddrOfPinnedObject_ReturnsStringData() - //{ - // string str = "String"; - // fixed (char* ptr = str) - // { - // var handle = GCHandle.Alloc(str, GCHandleType.Pinned); - // try - // { - // Assert.Equal((IntPtr)ptr, handle.AddrOfPinnedObject()); - // using var handleOfString = new PinnedGCHandle(str); - // Assert.NotEqual((IntPtr)ptr, (IntPtr)handleOfString.GetAddressOfObjectData()); - // Assert.Equal((IntPtr)ptr, (IntPtr)handleOfString.GetAddressOfStringData()); - // } - // finally - // { - // handle.Free(); - // } - // } - //} - - - //static public unsafe void AddrOfPinnedObject_ReturnsArrayData() - //{ - // int[] array = new int[1]; - // fixed (int* ptr = array) - // { - // var handle = GCHandle.Alloc(array, GCHandleType.Pinned); - // try - // { - // Assert.Equal((IntPtr)ptr, handle.AddrOfPinnedObject()); - // using var handleOfArray = new PinnedGCHandle(array); - // Assert.NotEqual((IntPtr)ptr, (IntPtr)handleOfArray.GetAddressOfObjectData()); - // Assert.Equal((IntPtr)ptr, (IntPtr)handleOfArray.GetAddressOfArrayData()); - // } - // finally - // { - // handle.Free(); - // } - // } - //} - - - //static public void AddrOfPinnedObject_NotPinned_ThrowsInvalidOperationException() - //{ - // GCHandle handle = GCHandle.Alloc(new object()); - // try - // { - // Assert.Throws(() => handle.AddrOfPinnedObject()); - // } - // finally - // { - // handle.Free(); - // } - //} - - - //static public void Free_NotInitialized_ThrowsInvalidOperationException() - //{ - // var handle = new GCHandle(); - // Assert.Throws(() => handle.Free()); - //} - - - //static public void Dispose_NotInitialized_NoThrow() - //{ - // var handleOfObject = new GCHandle(); - // handleOfObject.Dispose(); - // var weakHandle = new WeakGCHandle(); - // weakHandle.Dispose(); - // var pinnedHandle = new PinnedGCHandle(); - // pinnedHandle.Dispose(); - //} - - //static public IEnumerable Equals_TestData() - //{ - // GCHandle handle = GCHandle.Alloc(new object()); - // yield return new object[] { handle, handle, true }; - // yield return new object[] { GCHandle.Alloc(new object()), GCHandle.Alloc(new object()), false }; - - // yield return new object[] { GCHandle.Alloc(new object()), new object(), false }; - // yield return new object[] { GCHandle.Alloc(new object()), null, false }; - //} - - ////[Theory] - ////[MemberData(nameof(Equals_TestData))] - //static public void Equals_Object_ReturnsExpected(GCHandle handle, object other, bool expected) - //{ - // try - // { - // Assert.Equal(expected, handle.Equals(other)); - // if (other is GCHandle otherHandle) - // { - // Assert.Equal(expected, handle.Equals(otherHandle)); - // Assert.Equal(expected, handle == otherHandle); - // Assert.Equal(!expected, handle != otherHandle); - // } - // } - // finally - // { - // handle.Free(); - // if (other is GCHandle otherHandle && !expected) - // { - // otherHandle.Free(); - // } - // } - //} - - //private static void ValidateGCHandle(GCHandle handle, GCHandleType type, object target) - //{ - // try - // { - // Assert.Equal(target, handle.Target); - // Assert.True(handle.IsAllocated); - - // Assert.NotEqual(IntPtr.Zero, GCHandle.ToIntPtr(handle)); - // Assert.Equal(GCHandle.ToIntPtr(handle), (IntPtr)handle); - // Assert.Equal(((IntPtr)handle).GetHashCode(), handle.GetHashCode()); - - // if (type == GCHandleType.Pinned) - // { - // if (target == null) - // { - // Assert.Equal(IntPtr.Zero, handle.AddrOfPinnedObject()); - // } - // else - // { - // Assert.NotEqual(IntPtr.Zero, handle.AddrOfPinnedObject()); - // } - // } - - // } - // finally - // { - // handle.Free(); - // Assert.False(handle.IsAllocated); - // } - //} - - //private static void ValidateGCHandle(GCHandle handle, T target) - // where T : class - //{ - // try - // { - // Assert.Equal(target, handle.Target); - // Assert.True(handle.IsAllocated); - - // Assert.NotEqual(IntPtr.Zero, GCHandle.ToIntPtr(handle)); - // } - // finally - // { - // handle.Dispose(); - // Assert.False(handle.IsAllocated); - // } - //} - - //private static void ValidateWeakGCHandle(WeakGCHandle handle, T target) where T : class - //{ - // try - // { - // if (target != null) - // { - // Assert.True(handle.TryGetTarget(out T outTarget)); - // Assert.Equal(target, outTarget); - // } - // else - // { - // Assert.False(handle.TryGetTarget(out T outTarget)); - // Assert.Null(outTarget); - // } - // Assert.True(handle.IsAllocated); - - // Assert.NotEqual(IntPtr.Zero, WeakGCHandle.ToIntPtr(handle)); - // } - // finally - // { - // handle.Dispose(); - // Assert.False(handle.IsAllocated); - // } - //} - - //private static unsafe void ValidatePinnedGCHandle(PinnedGCHandle handle, T target) where T : class - //{ - // try - // { - // Assert.Equal(target, handle.Target); - // Assert.True(handle.IsAllocated); - - // Assert.NotEqual(IntPtr.Zero, PinnedGCHandle.ToIntPtr(handle)); - - // if (target == null) - // { - // Assert.Equal(IntPtr.Zero, (IntPtr)handle.GetAddressOfObjectData()); - // } - // else - // { - // Assert.NotEqual(IntPtr.Zero, (IntPtr)handle.GetAddressOfObjectData()); - // } - // } - // finally - // { - // handle.Dispose(); - // Assert.False(handle.IsAllocated); - // } - //} - - //public struct Blittable - //{ - // static public int _field; - //} - - //public class ClassWithoutReferences - //{ - // static public int _field; - //} - - //public struct UnmanagedNonBlittable - //{ - // static public char _field1; - // static public bool _field2; - //} - - //public struct NonBlittable - //{ - // static public string _field; - //} - - //public class ClassWithReferences - //{ - // static public string _field; - //} - } -} diff --git a/src/mono/sample/wasm/browser-test-debug/ILLink.Descriptors.xml b/src/mono/sample/wasm/browser-test-debug/ILLink.Descriptors.xml deleted file mode 100644 index 665eae765f7332..00000000000000 --- a/src/mono/sample/wasm/browser-test-debug/ILLink.Descriptors.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/mono/sample/wasm/browser-test-debug/JavaScriptTestHelper.cs b/src/mono/sample/wasm/browser-test-debug/JavaScriptTestHelper.cs deleted file mode 100644 index 60dcf849114c69..00000000000000 --- a/src/mono/sample/wasm/browser-test-debug/JavaScriptTestHelper.cs +++ /dev/null @@ -1,1384 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Collections.Generic; -using System.IO; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices.Marshalling; -using System.Threading.Tasks; -using System.Xml.Serialization; - -//[assembly: DisableRuntimeMarshalling] - -namespace System.Runtime.InteropServices.JavaScript.Tests -{ - public partial class JavaScriptTestHelper - { - [JSImport("globalThis.console.log")] - [return: JSMarshalAs] - public static partial void Log([JSMarshalAs] string message); - - [JSImport("globalThis.window.location.toString")] - public static partial string NativeFunctionToString(); - - [JSImport("globalThis.data.echoMemberMethod")] - public static partial string MemberEcho(string message); - - [JSImport("globalThis.rebound.echoMemberMethod")] - public static partial string ReboundMemberEcho(string message); - - [JSExport] - [return: JSMarshalAs] // this means that the message will arrive out of order, especially across threads. - public static void ConsoleWriteLine([JSMarshalAs] string message) - { - Console.WriteLine(message); - } - - [JSImport("delay", "JavaScriptTestHelper")] - public static partial Task Delay(int ms); - - [JSImport("reject", "JavaScriptTestHelper")] - public static partial Task Reject([JSMarshalAs] object what); - - [JSImport("intentionallyMissingImport", "JavaScriptTestHelper")] - public static partial void IntentionallyMissingImport(); - - [JSImport("intentionallyMissingImportAsync", "JavaScriptTestHelper")] - public static partial Task IntentionallyMissingImportAsync(); - - [JSImport("catch1toString", "JavaScriptTestHelper")] - public static partial string catch1toString(string message, string functionName); - - [JSImport("catch1stack", "JavaScriptTestHelper")] - public static partial string catch1stack(string message, string functionName); - - [JSExport] - public static void ThrowFromJSExport(string message) - { - throw new ArgumentException(message); - } - - [JSExport] - [return: JSMarshalAs] - public static DateTime Now() - { - return DateTime.Now; - } - - // the methods in the region have signature for which we have optimized path in the call marshaler - // it's the combination of number of arguments and void vs result - // see mono_wasm_bind_js_function and mono_wasm_bind_cs_function - #region Optimized - - public static int optimizedReached = 0; - [JSExport] - public static void Optimized0V() - { - optimizedReached++; - } - [JSImport("invoke0V", "JavaScriptTestHelper")] - public static partial void invoke0V(); - - [JSExport] - public static void Optimized1V(int a1) - { - optimizedReached += a1; - } - [JSImport("invoke1V", "JavaScriptTestHelper")] - public static partial void invoke1V(int a1); - - [JSExport] - [return: JSMarshalAs] // this means that the message will arrive out of order, especially across threads. - public static void Optimized1O(int a1) - { - optimizedReached += a1; - } - [JSImport("invoke1O", "JavaScriptTestHelper")] - public static partial void invoke1O(int a1); - - [JSExport] - public static int Optimized1R(int a1) - { - optimizedReached += a1; - return a1 + 1; - } - [JSImport("invoke1R", "JavaScriptTestHelper")] - public static partial int invoke1R(int a1); - - [JSExport] - public static int Optimized2R(int a1, int a2) - { - optimizedReached += a1 + a2; - return a1 + a2 + 1; - } - [JSImport("invoke2R", "JavaScriptTestHelper")] - public static partial int invoke2R(int a1, int a2); - - #endregion - - [JSImport("create_function", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - public static partial Func createMath([JSMarshalAs] string a, [JSMarshalAs] string b, [JSMarshalAs] string code); - - [JSImport("getType1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial string getType1(); - - [JSImport("getClass1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial string getClass1(); - - [JSImport("throw0fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial void throw0(); - - [JSImport("returnError", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial object returnError(); - - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial Task echo1_Task([JSMarshalAs>] Task arg1); - - [JSImport("createException", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial Exception createException([JSMarshalAs] string name); - - [JSImport("createData", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial JSObject createData([JSMarshalAs] string name); - - #region relaxed - [JSImport("dummy", "JavaScriptTestHelper")] - internal static partial void Relaxed(string a1, Exception ex, - bool ab, double a6, byte a2, char a3, short a4, float a5, IntPtr a7, - bool? nab, double? na6, byte? na2, char? na3, short? na4, float? na5, IntPtr? na7, - Task ta1, Task tex, - Task tab, Task ta6, Task ta2, Task ta3, Task ta4, Task ta5, Task ta7, - string[] aa1, byte[] aab, double[] aad, int[] aai - ); - - [JSImport("dummy", "JavaScriptTestHelper")] - internal static partial double RelaxedDouble(); - - [JSImport("dummy", "JavaScriptTestHelper")] - internal static partial string RelaxedString(); - - [JSImport("dummy", "JavaScriptTestHelper")] - internal static partial string[] RelaxedStringArray(); - - [JSImport("dummy", "JavaScriptTestHelper")] - internal static partial Exception RelaxedException(); - - [JSImport("dummy", "JavaScriptTestHelper")] - internal static partial bool RelaxedBool(); - - [JSImport("dummy", "JavaScriptTestHelper")] - internal static partial double? RelaxedNullableDouble(); - - [JSImport("dummy", "JavaScriptTestHelper")] - internal static partial bool? RelaxedNullableBool(); - - [JSImport("dummy", "JavaScriptTestHelper")] - internal static partial Task RelaxedTask(); - - [JSImport("dummy", "JavaScriptTestHelper")] - internal static partial Task RelaxedTaskDouble(); - - [JSImport("dummy", "JavaScriptTestHelper")] - internal static partial Task RelaxedTaskString(); - - [JSImport("dummy", "JavaScriptTestHelper")] - internal static partial Task RelaxedTaskException(); - - [JSImport("dummy", "JavaScriptTestHelper")] - internal static partial Task RelaxedTaskBool(); - - - #endregion - - #region Arrays - - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial byte[]? echo1_ByteArray([JSMarshalAs>] byte[]? value); - - [JSImport("storeAt", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial byte? store_ByteArray([JSMarshalAs>] byte[]? value, [JSMarshalAs] int index); - - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial int[]? echo1_Int32Array([JSMarshalAs>] int[]? value); - - [JSImport("storeAt", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial int? store_Int32Array([JSMarshalAs>] int[]? value, [JSMarshalAs] int index); - - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial double[]? echo1_DoubleArray([JSMarshalAs>] double[]? value); - - [JSImport("storeAt", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial double? store_DoubleArray([JSMarshalAs>] double[]? value, [JSMarshalAs] int index); - - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial string[]? echo1_StringArray([JSMarshalAs>] string[]? value); - - [JSImport("storeAt", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial string? store_StringArray([JSMarshalAs>] string[]? value, [JSMarshalAs] int index); - - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial object[]? echo1_ObjectArray([JSMarshalAs>] object[]? value); - - [JSImport("storeAt", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial object? store_ObjectArray([JSMarshalAs>] object[]? value, [JSMarshalAs] int index); - - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial JSObject[]? echo1_JSObjectArray([JSMarshalAs>] JSObject[]? value); - - [JSImport("storeAt", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial JSObject? store_JSObjectArray([JSMarshalAs>] JSObject[]? value, [JSMarshalAs] int index); - - #endregion - - #region Views - - [JSImport("echo1view", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial Span echo1_SpanOfByte([JSMarshalAs] Span value, [JSMarshalAs] bool edit); - - [JSImport("echo1view", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial Span echo1_SpanOfInt32([JSMarshalAs] Span value, [JSMarshalAs] bool edit); - - [JSImport("echo1view", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial Span echo1_SpanOfDouble([JSMarshalAs] Span value, [JSMarshalAs] bool edit); - - [JSImport("echo1view", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial ArraySegment echo1_ArraySegmentOfByte([JSMarshalAs] ArraySegment value, [JSMarshalAs] bool edit); - - [JSImport("echo1view", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial ArraySegment echo1_ArraySegmentOfInt32([JSMarshalAs] ArraySegment value, [JSMarshalAs] bool edit); - - [JSImport("echo1view", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial ArraySegment echo1_ArraySegmentOfDouble([JSMarshalAs] ArraySegment value, [JSMarshalAs] bool edit); - - #endregion - - #region Int32 - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial int echo1_Int32([JSMarshalAs] int value); - [JSImport("store1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial void store1_Int32([JSMarshalAs] int value); - - [JSImport("store1", "JavaScriptTestHelper")] - [return: JSMarshalAs] // this means that the message will arrive out of order, especially across threads. - internal static partial void store1DiscardNoWait_Int32([JSMarshalAs] int value); - - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial int retrieve1_Int32(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_Int32([JSMarshalAs] int value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial int throw1_Int32([JSMarshalAs] int value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial int invoke1_Int32([JSMarshalAs] int value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public static int EchoInt32([JSMarshalAs] int arg1) - { - return arg1; - } - #endregion Int32 - - #region String - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial string echo1_String([JSMarshalAs] string value); - [JSImport("store1", "JavaScriptTestHelper")] - internal static partial void store1_String([JSMarshalAs] string value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial string retrieve1_String(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_String([JSMarshalAs] string value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial string throw1_String([JSMarshalAs] string value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial string invoke1_String([JSMarshalAs] string value, [JSMarshalAs] string name); - [JSImport("invoke2", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial string invoke2_String([JSMarshalAs] string value, [JSMarshalAs] string name); - [JSImport("invokeStructClassRecords", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial string[] invokeStructClassRecords([JSMarshalAs] string value); - [JSExport] - [return: JSMarshalAs] - public static string EchoString([JSMarshalAs] string arg1) - { - return arg1; - } - - [JSImport("echopromise", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial Task echopromise_String([JSMarshalAs] string value); - #endregion String - - #region Object - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial object echo1_Object([JSMarshalAs] object value); - [JSImport("store1", "JavaScriptTestHelper")] - internal static partial void store1_Object([JSMarshalAs] object value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial object retrieve1_Object(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_Object([JSMarshalAs] object value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial object throw1_Object([JSMarshalAs] object value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial object invoke1_Object([JSMarshalAs] object value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public static object EchoObject([JSMarshalAs] object arg1) - { - return arg1; - } - - [JSImport("echopromise", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial Task echopromise_Object([JSMarshalAs] object value); - #endregion Object - - #region Exception - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial Exception echo1_Exception([JSMarshalAs] Exception value); - [JSImport("store1", "JavaScriptTestHelper")] - internal static partial void store1_Exception([JSMarshalAs] Exception value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial Exception retrieve1_Exception(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_Exception([JSMarshalAs] Exception value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial Exception throw1_Exception([JSMarshalAs] Exception value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial Exception invoke1_Exception([JSMarshalAs] Exception value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public static Exception EchoException([JSMarshalAs] Exception arg1) - { - return arg1; - } - [JSImport("echopromise", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial Task echopromise_Exception([JSMarshalAs] Exception value); - #endregion Exception - - #region Task - [JSImport("awaitvoid", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial Task awaitvoid([JSMarshalAs>] Task arg1); - [JSImport("sleep", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial Task sleep([JSMarshalAs] int ms); - [JSImport("forever", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial Task forever(); - [JSImport("sleep", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial Task sleep_Int([JSMarshalAs] int ms); - - [JSImport("sleep", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial Task? sleepMaybe_Int([JSMarshalAs] int ms); - - [JSImport("await2", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial Task await2([JSMarshalAs>] Task arg1); - - [JSImport("thenvoid", "JavaScriptTestHelper")] - internal static partial void thenvoid([JSMarshalAs>] Task arg1); - - [JSImport("await1", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial Task await1([JSMarshalAs>] Task arg1); - [JSImport("await1", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial Task await1_TaskOfException([JSMarshalAs>] Task arg1); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial Task invoke1_TaskOfObject([JSMarshalAs>] Task value, [JSMarshalAs] string name); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial Task invoke1_TaskOfInt([JSMarshalAs>] Task value, [JSMarshalAs] string name); - - [JSImport("returnResolvedPromise", "JavaScriptTestHelper")] - internal static partial Task ReturnResolvedPromise(); - - [JSImport("invokeReturnCompletedTask", "JavaScriptTestHelper")] - internal static partial Task InvokeReturnCompletedTask(); - - [JSExport] - internal static Task ReturnCompletedTask() - { - return Task.CompletedTask; - } - - [JSExport] - [return: JSMarshalAs>] - public static async Task AwaitTaskOfObject([JSMarshalAs>] Task arg1) - { - var res = await arg1; - return res; - } - - #endregion - - #region Action + Func - - [JSImport("back3", "JavaScriptTestHelper")] - internal static partial void back3_Action([JSMarshalAs] Action action); - - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial Action echo1_ActionAction([JSMarshalAs] Action action); - - [JSImport("echo1large", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial Action echo1large_ActionAction([JSMarshalAs] Action action); - - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial Action echo1_ActionIntActionInt([JSMarshalAs>] Action action); - - [JSImport("backback", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial Func backback_FuncIntFuncInt([JSMarshalAs>] Func fun, [JSMarshalAs] int a); - - [JSImport("backback", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial Func backback_FuncIntIntFuncIntInt([JSMarshalAs>] Func fun, [JSMarshalAs] int a, [JSMarshalAs] int b); - - [JSImport("backbackAsync", "JavaScriptTestHelper")] - internal static partial Task backback_FuncIntIntFuncIntIntAsync([JSMarshalAs>] Func fun, [JSMarshalAs] int a, [JSMarshalAs] int b); - - [JSImport("back3", "JavaScriptTestHelper")] - internal static partial void back3_ActionInt([JSMarshalAs>] Action? action, [JSMarshalAs] int a); - - [JSImport("back3", "JavaScriptTestHelper")] - internal static partial void back3_ActionIntInt([JSMarshalAs>] Action? action, [JSMarshalAs] int a, [JSMarshalAs] int b); - - [JSImport("back3", "JavaScriptTestHelper")] - internal static partial void back3_ActionLongLong([JSMarshalAs>] Action? action, [JSMarshalAs] long a, [JSMarshalAs] long b); - - [JSImport("back3", "JavaScriptTestHelper")] - internal static partial void back3_ActionIntLong([JSMarshalAs>] Action? action, [JSMarshalAs] int a, [JSMarshalAs] long b); - - [JSImport("back3", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial int back3_FunctionIntInt([JSMarshalAs>] Func? fun, [JSMarshalAs] int a); - - [JSImport("back4", "JavaScriptTestHelper")] - internal static partial void back4_ActionIntLongDouble([JSMarshalAs>] Action? action, [JSMarshalAs] int a, [JSMarshalAs] long b, [JSMarshalAs] double c); - - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial Func invoke1_FuncOfIntInt([JSMarshalAs>] Func value, [JSMarshalAs] string name); - - [JSExport] - [return: JSMarshalAs>] - public static Func BackFuncOfIntInt([JSMarshalAs>] Func arg1) - { - return (int a) => - { - return arg1(a); - }; - } - - #endregion - - #region Boolean - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool echo1_Boolean([JSMarshalAs] bool value); - [JSImport("store1", "JavaScriptTestHelper")] - internal static partial void store1_Boolean([JSMarshalAs] bool value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool retrieve1_Boolean(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_Boolean([JSMarshalAs] bool value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool throw1_Boolean([JSMarshalAs] bool value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool invoke1_Boolean([JSMarshalAs] bool value, [JSMarshalAs] string name); - - [JSImport("invoke1Async", "JavaScriptTestHelper")] - internal static partial Task invoke1_BooleanAsync(bool value, string name); - - [JSExport] - [return: JSMarshalAs] - public static bool EchoBoolean([JSMarshalAs] bool arg1) - { - return arg1; - } - #endregion Boolean - - #region Char - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial char echo1_Char([JSMarshalAs] char value); - [JSImport("store1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial void store1_Char([JSMarshalAs] char value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial char retrieve1_Char(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_Char([JSMarshalAs] char value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial char throw1_Char([JSMarshalAs] char value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial char invoke1_Char([JSMarshalAs] char value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public static char EchoChar([JSMarshalAs] char arg1) - { - return arg1; - } - #endregion Byte - - #region Byte - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial byte echo1_Byte([JSMarshalAs] byte value); - [JSImport("store1", "JavaScriptTestHelper")] - internal static partial void store1_Byte([JSMarshalAs] byte value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial byte retrieve1_Byte(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_Byte([JSMarshalAs] byte value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial byte throw1_Byte([JSMarshalAs] byte value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial byte invoke1_Byte([JSMarshalAs] byte value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public static byte EchoByte([JSMarshalAs] byte arg1) - { - return arg1; - } - #endregion Byte - - #region Int16 - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial short echo1_Int16([JSMarshalAs] short value); - [JSImport("store1", "JavaScriptTestHelper")] - internal static partial void store1_Int16([JSMarshalAs] short value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial short retrieve1_Int16(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_Int16([JSMarshalAs] short value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial short throw1_Int16([JSMarshalAs] short value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial short invoke1_Int16([JSMarshalAs] short value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public static short EchoInt16([JSMarshalAs] short arg1) - { - return arg1; - } - #endregion Int16 - - #region Int52 - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial long echo1_Int52([JSMarshalAs] long value); - [JSImport("store1", "JavaScriptTestHelper")] - internal static partial void store1_Int52([JSMarshalAs] long value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial long retrieve1_Int52(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_Int52([JSMarshalAs] long value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial long throw1_Int52([JSMarshalAs] long value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial long invoke1_Int52([JSMarshalAs] long value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public static long EchoInt52([JSMarshalAs] long arg1) - { - return arg1; - } - #endregion Int52 - - #region BigInt64 - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial long echo1_BigInt64([JSMarshalAs] long value); - [JSImport("store1", "JavaScriptTestHelper")] - internal static partial void store1_BigInt64([JSMarshalAs] long value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial long retrieve1_BigInt64(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_BigInt64([JSMarshalAs] long value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial long throw1_BigInt64([JSMarshalAs] long value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial long invoke1_BigInt64([JSMarshalAs] long value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public static long EchoBigInt64([JSMarshalAs] long arg1) - { - return arg1; - } - #endregion BigInt64 - - #region Double - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial double echo1_Double([JSMarshalAs] double value); - [JSImport("store1", "JavaScriptTestHelper")] - internal static partial void store1_Double([JSMarshalAs] double value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial double retrieve1_Double(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_Double([JSMarshalAs] double value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial double throw1_Double([JSMarshalAs] double value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial double invoke1_Double([JSMarshalAs] double value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public static double EchoDouble([JSMarshalAs] double arg1) - { - return arg1; - } - #endregion Double - - #region Single - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial float echo1_Single([JSMarshalAs] float value); - [JSImport("store1", "JavaScriptTestHelper")] - internal static partial void store1_Single([JSMarshalAs] float value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial float retrieve1_Single(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_Single([JSMarshalAs] float value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial float throw1_Single([JSMarshalAs] float value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial float invoke1_Single([JSMarshalAs] float value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public static float EchoSingle([JSMarshalAs] float arg1) - { - return arg1; - } - #endregion Single - - #region IntPtr - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial IntPtr echo1_IntPtr([JSMarshalAs] IntPtr value); - [JSImport("store1", "JavaScriptTestHelper")] - internal static partial void store1_IntPtr([JSMarshalAs] IntPtr value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial IntPtr retrieve1_IntPtr(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_IntPtr([JSMarshalAs] IntPtr value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial IntPtr throw1_IntPtr([JSMarshalAs] IntPtr value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial IntPtr invoke1_IntPtr([JSMarshalAs] IntPtr value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public static IntPtr EchoIntPtr([JSMarshalAs] IntPtr arg1) - { - return arg1; - } - #endregion IntPtr - - #region VoidPtr - - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal unsafe static partial void* echo1_VoidPtr([JSMarshalAs] void* value); - [JSImport("store1", "JavaScriptTestHelper")] - internal unsafe static partial void store1_VoidPtr([JSMarshalAs] void* value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal unsafe static partial void* retrieve1_VoidPtr(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal unsafe static partial bool identity1_VoidPtr([JSMarshalAs] void* value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal unsafe static partial void* throw1_VoidPtr([JSMarshalAs] void* value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal unsafe static partial void* invoke1_VoidPtr([JSMarshalAs] void* value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public unsafe static void* EchoVoidPtr([JSMarshalAs] void* arg1) - { - return arg1; - } - #endregion VoidPtr - - #region DateTime - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial DateTime echo1_DateTime([JSMarshalAs] DateTime value); - [JSImport("store1", "JavaScriptTestHelper")] - internal static partial void store1_DateTime([JSMarshalAs] DateTime value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial DateTime retrieve1_DateTime(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_DateTime([JSMarshalAs] DateTime value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial DateTime throw1_DateTime([JSMarshalAs] DateTime value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial DateTime invoke1_DateTime([JSMarshalAs] DateTime value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public static DateTime EchoDateTime([JSMarshalAs] DateTime arg1) - { - return arg1; - } - #endregion DateTime - - #region DateTimeOffset - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial DateTimeOffset echo1_DateTimeOffset([JSMarshalAs] DateTimeOffset value); - [JSImport("store1", "JavaScriptTestHelper")] - internal static partial void store1_DateTimeOffset([JSMarshalAs] DateTimeOffset value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial DateTimeOffset retrieve1_DateTimeOffset(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_DateTimeOffset([JSMarshalAs] DateTimeOffset value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial DateTimeOffset throw1_DateTimeOffset([JSMarshalAs] DateTimeOffset value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial DateTimeOffset invoke1_DateTimeOffset([JSMarshalAs] DateTimeOffset value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public static DateTimeOffset EchoDateTimeOffset([JSMarshalAs] DateTimeOffset arg1) - { - return arg1; - } - #endregion DateTimeOffset - - #region NullableBoolean - - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool? echo1_NullableBoolean([JSMarshalAs] bool? value); - [JSImport("store1", "JavaScriptTestHelper")] - internal static partial void store1_NullableBoolean([JSMarshalAs] bool? value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool? retrieve1_NullableBoolean(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_NullableBoolean([JSMarshalAs] bool? value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool? throw1_NullableBoolean([JSMarshalAs] bool? value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool? invoke1_NullableBoolean([JSMarshalAs] bool? value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public static bool? EchoNullableBoolean([JSMarshalAs] bool? arg1) - { - return arg1; - } - #endregion NullableBoolean - - #region NullableInt32 - - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial int? echo1_NullableInt32([JSMarshalAs] int? value); - [JSImport("store1", "JavaScriptTestHelper")] - internal static partial void store1_NullableInt32([JSMarshalAs] int? value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial int? retrieve1_NullableInt32(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_NullableInt32([JSMarshalAs] int? value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial int? throw1_NullableInt32([JSMarshalAs] int? value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial int? invoke1_NullableInt32([JSMarshalAs] int? value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public static int? EchoNullableInt32([JSMarshalAs] int? arg1) - { - return arg1; - } - #endregion NullableInt32 - - #region NullableBigInt64 - - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial long? echo1_NullableBigInt64([JSMarshalAs] long? value); - [JSImport("store1", "JavaScriptTestHelper")] - internal static partial void store1_NullableBigInt64([JSMarshalAs] long? value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial long? retrieve1_NullableBigInt64(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_NullableBigInt64([JSMarshalAs] long? value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial long? throw1_NullableBigInt64([JSMarshalAs] long? value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial long? invoke1_NullableBigInt64([JSMarshalAs] long? value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public static long? EchoNullableBigInt64([JSMarshalAs] long? arg1) - { - return arg1; - } - #endregion NullableBigInt64 - - #region NullableIntPtr - - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial IntPtr? echo1_NullableIntPtr([JSMarshalAs] IntPtr? value); - [JSImport("store1", "JavaScriptTestHelper")] - internal static partial void store1_NullableIntPtr([JSMarshalAs] IntPtr? value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial IntPtr? retrieve1_NullableIntPtr(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_NullableIntPtr([JSMarshalAs] IntPtr? value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial IntPtr? throw1_NullableIntPtr([JSMarshalAs] IntPtr? value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial IntPtr? invoke1_NullableIntPtr([JSMarshalAs] IntPtr? value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public static IntPtr? EchoNullableIntPtr([JSMarshalAs] IntPtr? arg1) - { - return arg1; - } - #endregion NullableIntPtr - - #region NullableDouble - - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial double? echo1_NullableDouble([JSMarshalAs] double? value); - [JSImport("store1", "JavaScriptTestHelper")] - internal static partial void store1_NullableDouble([JSMarshalAs] double? value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial double? retrieve1_NullableDouble(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_NullableDouble([JSMarshalAs] double? value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial double? throw1_NullableDouble([JSMarshalAs] double? value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial double? invoke1_NullableDouble([JSMarshalAs] double? value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public static double? EchoNullableDouble([JSMarshalAs] double? arg1) - { - return arg1; - } - #endregion NullableDouble - - #region NullableDateTime - - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial DateTime? echo1_NullableDateTime([JSMarshalAs] DateTime? value); - [JSImport("store1", "JavaScriptTestHelper")] - internal static partial void store1_NullableDateTime([JSMarshalAs] DateTime? value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial DateTime? retrieve1_NullableDateTime(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_NullableDateTime([JSMarshalAs] DateTime? value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial DateTime? throw1_NullableDateTime([JSMarshalAs] DateTime? value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial DateTime? invoke1_NullableDateTime([JSMarshalAs] DateTime? value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public static DateTime? EchoNullableDateTime([JSMarshalAs] DateTime? arg1) - { - return arg1; - } - #endregion NullableDateTime - - #region JSObject - [JSImport("echo1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial JSObject echo1_JSObject([JSMarshalAs] JSObject value); - [JSImport("store1", "JavaScriptTestHelper")] - internal static partial void store1_JSObject([JSMarshalAs] JSObject value); - [JSImport("retrieve1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial JSObject retrieve1_JSObject(); - [JSImport("identity1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial bool identity1_JSObject([JSMarshalAs] JSObject value); - [JSImport("throw1fn", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial JSObject throw1_JSObject([JSMarshalAs] JSObject value); - [JSImport("invoke1", "JavaScriptTestHelper")] - [return: JSMarshalAs] - internal static partial JSObject invoke1_JSObject([JSMarshalAs] JSObject value, [JSMarshalAs] string name); - [JSExport] - [return: JSMarshalAs] - public static JSObject EchoIJSObject([JSMarshalAs] JSObject arg1) - { - return arg1; - } - - [JSImport("beforeYield", "JavaScriptTestHelper")] - public static partial void BeforeYield(); - - [JSImport("isSetTimeoutHit", "JavaScriptTestHelper")] - public static partial bool IsSetTimeoutHit(); - - [JSImport("isPromiseThenHit", "JavaScriptTestHelper")] - public static partial bool IsPromiseThenHit(); - - [JSImport("callJavaScriptLibrary", "JavaScriptTestHelper")] - public static partial Task callJavaScriptLibrary(int a, int b); - - [JSImport("echopromise", "JavaScriptTestHelper")] - [return: JSMarshalAs>] - internal static partial Task echopromise_JSObject([JSMarshalAs] JSObject value); - #endregion JSObject - - [JSImport("setup", "JavaScriptTestHelper")] - internal static partial Task Setup(); - - [JSImport("INTERNAL.forceDisposeProxies")] - internal static partial void ForceDisposeProxies(bool disposeMethods, bool verbose); - - static JSObject _module; - public static async Task InitializeAsync() - { - if (_module == null) - { - _module = await JSHost.ImportAsync("JavaScriptTestHelper", "../JavaScriptTestHelper.mjs"); ; - await Setup(); - } - -#if FEATURE_WASM_MANAGED_THREADS - // are we in the UI thread ? - if (Environment.CurrentManagedThreadId == 1) -#endif - { - // this gives browser chance to serve UI thread event loop before every test - await Task.Yield(); - } - } - - public static Task DisposeAsync() - { - _module?.Dispose(); - _module = null; - return Task.CompletedTask; - } - } -} - -namespace JavaScriptTestHelperNamespace -{ - public partial class JavaScriptTestHelper - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) - { - return message + "11"; - } - - private partial class NestedClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "12"; - - private partial class DoubleNestedClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "13"; - } - } - - public partial record class NestedRecordClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "14"; - - public partial record class DoubleNestedRecordClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "15"; - } - } - - public partial struct NestedStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "16"; - - public partial struct DoubleNestedStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "17"; - } - } - - public partial record struct NestedRecordStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "18"; - - public partial record struct DoubleNestedRecordStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "19"; - } - } - } - - public partial class JavaScriptTestHelperStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "21"; - - public partial class NestedClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "22"; - } - - public partial record class NestedRecordClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "23"; - } - - public partial struct NestedStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) - { - return message + "24"; - } - } - - public partial record struct NestedRecordStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "25"; - } - } - - public partial record class JavaScriptTestHelperRecordClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "31"; - - public partial class NestedClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "32"; - } - - public partial record class NestedRecordClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "33"; - } - - public partial struct NestedStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "34"; - } - - public partial record struct NestedRecordStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "35"; - } - } - - public partial record struct JavaScriptTestHelperRecordStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "41"; - - public partial class NestedClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "42"; - } - - public partial record class NestedRecordClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "43"; - } - - public partial struct NestedStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "44"; - } - - public partial record struct NestedRecordStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) - { - return message + "45"; - } - } - } -} - -public partial class JavaScriptTestHelperNoNamespace -{ - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "51"; - - public partial class NestedClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "52"; - - public partial class DoubleNestedClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "53"; - } - } - - public partial record class NestedRecordClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "54"; - - public partial record class DoubleNestedRecordClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "55"; - } - } - - public partial struct NestedStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "56"; - - public partial struct DoubleNestedStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "57"; - } - } - - public partial record struct NestedRecordStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "58"; - - public partial record struct DoubleNestedRecordStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "59"; - } - } -} - -public partial class JavaScriptTestHelperStructNoNamespace -{ - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "61"; - - public partial class NestedClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "62"; - } - - public partial record class NestedRecordClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "63"; - } - - public partial struct NestedStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "64"; - } - - public partial record struct NestedRecordStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "65"; - } -} - -public partial record class JavaScriptTestHelperRecordClassNoNamespace -{ - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "71"; - - public partial class NestedClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "72"; - } - - public partial record class NestedRecordClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "73"; - } - - public partial struct NestedStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "74"; - } - - public partial record struct NestedRecordStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "75"; - } -} - -public partial record struct JavaScriptTestHelperRecordStructNoNamespace -{ - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "81"; - - public partial class NestedClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "82"; - } - - public partial record class NestedRecordClass - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "83"; - } - - public partial struct NestedStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "84"; - } - - public partial record struct NestedRecordStruct - { - [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "85"; - } -} diff --git a/src/mono/sample/wasm/browser-test-debug/JavaScriptTestHelper.mjs b/src/mono/sample/wasm/browser-test-debug/JavaScriptTestHelper.mjs deleted file mode 100644 index 1b5b03829bcf93..00000000000000 --- a/src/mono/sample/wasm/browser-test-debug/JavaScriptTestHelper.mjs +++ /dev/null @@ -1,493 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -class JSData { - constructor(name) { - this.name = name; - } - echoMemberMethod(arg1) { - return arg1 + "-w-i-t-h-" + this.name; - } - toString() { - return `JSData("${this.name}")`; - } -} - -class JSTestError extends Error { - constructor(message) { - super(message) - } -} - -export function createData(name) { - //console.log(`createData(name:"${name ? name : ''}")`) - return new JSData(name); -} - -export function createException(name) { - //console.log(`createException(name:"${name ? name : ''}")`) - return new JSTestError(name); -} - -export function echo1(arg1) { - if (globalThis.gc) { - // console.log('globalThis.gc'); - globalThis.gc(); - } - - //console.log(`echo1(arg1:${arg1 !== null ? JSON.stringify(arg1): ''})`) - return arg1; -} - -export function echo1view(arg1, edit) { - if (globalThis.gc) { - // console.log('globalThis.gc'); - globalThis.gc(); - } - - // console.log(`echo1view(arg1:${arg1 !== null ? arg1 : ''})`) - // console.log(`echo1view(arg1:${arg1 !== null ? typeof arg1 : ''})`) - const cpy = arg1.slice(); - if (edit) { - cpy[1] = cpy[0] - arg1.set(cpy); - } - return arg1; -} - -export function echo1array(arg1, edit) { - if (globalThis.gc) { - // console.log('globalThis.gc'); - globalThis.gc(); - } - - // console.log(`echo1view(arg1:${arg1 !== null ? arg1 : ''})`) - // console.log(`echo1view(arg1:${arg1 !== null ? typeof arg1 : ''})`) - if (edit) { - arg1[1] = arg1[0] - } - return arg1; -} - -export function echo1large(arg1) { - try { - arg1._large = new Uint8Array(10000000); - } - catch (ex) { - console.log("echo1large " + ex) - } - if (globalThis.gc) { - // console.log('globalThis.gc'); - globalThis.gc(); - } - - //console.log(`echo1large(arg1:${arg1 !== null ? typeof arg1: ''})`) - return () => { - console.log("don't call me"); - }; -} - -export function store1(arg1) { - //console.log(`store1(arg1:${arg1 !== null ? arg1 : ''})`) - globalThis.javaScriptTestHelper.store1val = arg1; -} - -export function storeAt(arg1, arg2) { - //console.log(`storeAt(arg1:${arg1 !== null ? arg1 : ''})`) - //console.log(`storeAt(arg2:${arg2 !== null ? arg2 : ''})`) - globalThis.javaScriptTestHelper.store1val = arg1[arg2]; - return arg1[arg2]; -} - -export function retrieve1() { - const val = globalThis.javaScriptTestHelper.store1val; - //console.log(`retrieve1(arg1:${val !== null ? val : ''})`) - return val; -} - -export function throw0fn() { - //console.log(`throw0()`) - throw new Error('throw-0-msg'); -} - -export function returnError() { - return new Error('this-is-error'); -} - -export function catch1toString(message, functionName) { - const JavaScriptTestHelper = dllExports.System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper; - const fn = JavaScriptTestHelper[functionName]; - try { - fn(message); - return "bad"; - } catch (err) { - return err.toString(); - } -} - -export function catch1stack(message, functionName) { - const JavaScriptTestHelper = dllExports.System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper; - const fn = JavaScriptTestHelper[functionName]; - try { - fn(message); - return "bad"; - } catch (err) { - return err.stack; - } -} - -export function throw1fn(arg1) { - //console.log(`throw1(arg1:${arg1 !== null ? arg1 : ''})`) - throw new Error('throw1-msg ' + arg1); -} - -export function throwretrieve1() { - const val = globalThis.javaScriptTestHelper.store1val; - //console.log(`retrieve1(arg1:${val !== null ? val : ''})`) - throw new Error('throwretrieve1 ' + val); -} - -export function identity1(arg1) { - const val = globalThis.javaScriptTestHelper.store1val; - //console.log(`compare1(arg1:${arg1 !== null ? arg1 : ''}) with ${val !== null ? val : ''}`) - if (val instanceof Date) { - return arg1.valueOf() == val.valueOf(); - } - if (Number.isNaN(val)) { - return Number.isNaN(arg1); - } - return arg1 === val; -} - -export function getType1() { - const val = globalThis.javaScriptTestHelper.store1val; - const vtype = typeof (val); - // console.log(`getType1(arg1:${vtype !== null ? vtype : ''})`) - return vtype; -} - -export function getClass1() { - const val = globalThis.javaScriptTestHelper.store1val; - const cname = val.constructor.name; - // console.log(`getClass1(arg1:${cname !== null ? cname : ''})`) - return cname; -} -let dllExports; - -export function invoke0V() { - const JavaScriptTestHelper = dllExports.System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper; - const fn = JavaScriptTestHelper['Optimized0V']; - fn(); -} - -export function invoke1V(arg1) { - const JavaScriptTestHelper = dllExports.System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper; - const fn = JavaScriptTestHelper['Optimized1V']; - fn(arg1); -} - -export function invoke1O(arg1) { - const JavaScriptTestHelper = dllExports.System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper; - const fn = JavaScriptTestHelper['Optimized1O']; - fn(arg1); -} - -export function invoke1R(arg1) { - const JavaScriptTestHelper = dllExports.System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper; - const fn = JavaScriptTestHelper['Optimized1R']; - return fn(arg1); -} - -export function invoke2R(arg1, arg2) { - const JavaScriptTestHelper = dllExports.System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper; - const fn = JavaScriptTestHelper['Optimized2R']; - return fn(arg1, arg2); -} - -export function invoke1(arg1, name) { - if (globalThis.gc) { - // console.log('globalThis.gc'); - globalThis.gc(); - } - // console.log(`invoke1: ${name}(arg1:${arg1 !== null ? typeof arg1 : ''})`) - const JavaScriptTestHelper = dllExports.System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper; - const fn = JavaScriptTestHelper[name]; - - // console.log("invoke1:" + typeof fn); - // console.log("invoke1:" + fn.toString()); - const res = fn(arg1); - // console.log(`invoke1: res ${res !== null ? typeof res : ''}`) - return res; -} - -export async function invoke1Async(arg1, name) { - if (globalThis.gc) { - // console.log('globalThis.gc'); - globalThis.gc(); - } - // console.log(`invoke1: ${name}(arg1:${arg1 !== null ? typeof arg1 : ''})`) - const JavaScriptTestHelper = dllExports.System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper; - const fn = JavaScriptTestHelper[name]; - - await delay(10); - - // console.log("invoke1:" + typeof fn); - // console.log("invoke1:" + fn.toString()); - const res = fn(arg1); - // console.log(`invoke1: res ${res !== null ? typeof res : ''}`) - return res; -} - -export function invoke2(arg1, name) { - const fn = dllExports.JavaScriptTestHelperNoNamespace[name]; - //console.log("invoke1:" + fn.toString()); - const res = fn(arg1); - // console.log(`invoke1: res ${res !== null ? typeof res : ''}`) - return res; -} - -export function returnResolvedPromise() { - return Promise.resolve(); -} - -export async function invokeReturnCompletedTask() { - await dllExports.System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper.ReturnCompletedTask(); - return "resolved"; -} - -export function invokeStructClassRecords(arg1) { - return [ - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelper.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelper.NestedClass.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelper.NestedClass.DoubleNestedClass.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelper.NestedRecordClass.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelper.NestedRecordClass.DoubleNestedRecordClass.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelper.NestedStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelper.NestedStruct.DoubleNestedStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelper.NestedRecordStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelper.NestedRecordStruct.DoubleNestedRecordStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperStruct.NestedClass.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperStruct.NestedRecordClass.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperStruct.NestedStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperStruct.NestedRecordStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperRecordClass.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperRecordClass.NestedClass.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperRecordClass.NestedRecordClass.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperRecordClass.NestedStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperRecordClass.NestedRecordStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperRecordStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperRecordStruct.NestedClass.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperRecordStruct.NestedRecordClass.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperRecordStruct.NestedStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperNamespace.JavaScriptTestHelperRecordStruct.NestedRecordStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperNoNamespace.EchoString(arg1), - dllExports.JavaScriptTestHelperNoNamespace.NestedClass.EchoString(arg1), - dllExports.JavaScriptTestHelperNoNamespace.NestedClass.DoubleNestedClass.EchoString(arg1), - dllExports.JavaScriptTestHelperNoNamespace.NestedRecordClass.EchoString(arg1), - dllExports.JavaScriptTestHelperNoNamespace.NestedRecordClass.DoubleNestedRecordClass.EchoString(arg1), - dllExports.JavaScriptTestHelperNoNamespace.NestedStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperNoNamespace.NestedStruct.DoubleNestedStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperNoNamespace.NestedRecordStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperNoNamespace.NestedRecordStruct.DoubleNestedRecordStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperStructNoNamespace.EchoString(arg1), - dllExports.JavaScriptTestHelperStructNoNamespace.NestedClass.EchoString(arg1), - dllExports.JavaScriptTestHelperStructNoNamespace.NestedRecordClass.EchoString(arg1), - dllExports.JavaScriptTestHelperStructNoNamespace.NestedStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperStructNoNamespace.NestedRecordStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperRecordClassNoNamespace.EchoString(arg1), - dllExports.JavaScriptTestHelperRecordClassNoNamespace.NestedClass.EchoString(arg1), - dllExports.JavaScriptTestHelperRecordClassNoNamespace.NestedRecordClass.EchoString(arg1), - dllExports.JavaScriptTestHelperRecordClassNoNamespace.NestedStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperRecordClassNoNamespace.NestedRecordStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperRecordStructNoNamespace.EchoString(arg1), - dllExports.JavaScriptTestHelperRecordStructNoNamespace.NestedClass.EchoString(arg1), - dllExports.JavaScriptTestHelperRecordStructNoNamespace.NestedRecordClass.EchoString(arg1), - dllExports.JavaScriptTestHelperRecordStructNoNamespace.NestedStruct.EchoString(arg1), - dllExports.JavaScriptTestHelperRecordStructNoNamespace.NestedRecordStruct.EchoString(arg1), - ]; -} - -export function echopromise(arg1) { - if (globalThis.gc) { - //console.log('globalThis.gc'); - globalThis.gc(); - } - return new Promise(resolve => setTimeout(() => resolve(arg1), 0)); -} - -export async function awaitvoid(arg1) { - // console.log("awaitvoid:" + typeof arg1); - await arg1; - // console.log("awaitvoid done"); -} - -export function thenvoid(arg1) { - //console.log("thenvoid:" + typeof arg1); - arg1.then(() => { - // console.log("thenvoid then done"); - }); - //console.log("thenvoid done"); -} - -export async function await1(arg1) { - try { - // console.log("await1:" + typeof arg1); - const value = await arg1; - // console.log("await1 value:" + value); - return value; - } catch (ex) { - // console.log("await1 ex:" + ex); - throw ex; - } -} - -export async function await2(arg1) { - //console.log("await2-1:" + typeof arg1); - await arg1; - //console.log("await2-2:" + typeof arg1); -} - -export async function sleep(ms) { - if (globalThis.gc) { - // console.log('globalThis.gc'); - globalThis.gc(); - } - // console.log("sleep:" + ms); - await new Promise(resolve => setTimeout(resolve, ms)); - // console.log("sleep2:" + ms); - return ms; -} - -export async function forever() { - if (globalThis.gc) { - // console.log('globalThis.gc'); - globalThis.gc(); - } - // console.log("forever:" + ms); - await new Promise(() => { }); -} - -export function back3(arg1, arg2, arg3) { - if (globalThis.gc) { - // console.log('globalThis.gc'); - globalThis.gc(); - } - try { - if (!(arg1 instanceof Function)) throw new Error('expecting Function!') - //console.log(`back3(arg1:${arg1 !== null ? typeof (arg1) : ''})`) - //console.log(`back3(arg2:${arg2 !== null ? arg2 : ''})`) - //console.log(`back3(arg3:${arg3 !== null ? arg3 : ''})`) - - // call it twice, to make sure it's persistent - arg1(arg2, arg3); - //console.log(`back3(arg2:${arg2 !== null ? arg2 : ''})`) - //console.log(`back3(arg3:${arg3 !== null ? arg3 : ''})`) - - return arg1(arg2, arg3); - } - catch (ex) { - // console.log(`back1 - catch`) - throw ex; - } -} - -export function back4(arg1, arg2, arg3, arg4) { - if (globalThis.gc) { - // console.log('globalThis.gc'); - globalThis.gc(); - } - try { - if (!(arg1 instanceof Function)) throw new Error('expecting Function!') - - return arg1(arg2, arg3, arg4); - } - catch (ex) { - throw ex; - } -} - -export function backback(arg1, arg2, arg3) { - if (globalThis.gc) { - // console.log('globalThis.gc'); - globalThis.gc(); - } - // console.log('backback A') - return (brg1, brg2) => { - // console.log('backback B') - try { - var res = arg1(brg1 + arg2, brg2 + arg3); - // console.log('backback C') - return res - } - catch (e) { - // console.log('backback E ' + e) - throw e; - } - } -} - -export async function backbackAsync(arg1, arg2, arg3) { - if (globalThis.gc) { - // console.log('globalThis.gc'); - globalThis.gc(); - } - await delay(10); - return arg1(arg2, arg3); -} - -export async function callJavaScriptLibrary(a, b) { - const exports = await App.runtime.getAssemblyExports("JavaScriptLibrary.dll"); - return exports.JavaScriptLibrary.JavaScriptInterop.ExportedMethod(a, b); -} - -export const instance = {} - -globalThis.javaScriptTestHelper = instance; -globalThis.data = new JSData("i-n-s-t-a-n-c-e"); -globalThis.rebound = { - // our JSImport will try to bind it to `globalThis.rebound` - // but it would stay bound to globalThis.data - // because once the function is bound, it would stay bound to the first object and can't be re-bound subsequently - // this line is actually the first binding, not the fact it's part of the class JSData - echoMemberMethod: globalThis.data.echoMemberMethod.bind(globalThis.data) -} - -export async function setup() { - dllExports = await App.runtime.getAssemblyExports("Wasm.Test.Debug.Sample.dll"); -} - -// console.log('JavaScriptTestHelper:' Object.keys(globalThis.JavaScriptTestHelper)); - -export function delay(ms) { - return new Promise(resolve => globalThis.setTimeout(resolve, ms)); -} - -export function reject(what) { - return new Promise((_, reject) => globalThis.setTimeout(() => reject(what), 0)); -} - -let setTimeoutHit = false; -let promiseThenHit = false; -export function beforeYield() { - setTimeoutHit = false; - promiseThenHit = false; - setTimeout(() => { - setTimeoutHit = true; - }, 0); - let res; - new Promise((resolve) => { - res = resolve; - }).then(() => { - promiseThenHit = true; - }); - res(); -} - -export function isSetTimeoutHit() { - return setTimeoutHit; -} - -export function isPromiseThenHit() { - return promiseThenHit; -} diff --git a/src/mono/sample/wasm/browser-test-debug/Program.cs b/src/mono/sample/wasm/browser-test-debug/Program.cs deleted file mode 100644 index cdbd42f21e0f90..00000000000000 --- a/src/mono/sample/wasm/browser-test-debug/Program.cs +++ /dev/null @@ -1,558 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Runtime.InteropServices.JavaScript; -using System.Runtime.InteropServices.JavaScript.Tests; -using System.Threading.Tasks; -using System.Security; -using System.Runtime.InteropServices; -using System.Runtime.InteropServices.Tests; -using System.Globalization; -using System.SpanTests; -using System.Runtime.ExceptionServices; - -namespace Sample -{ - [StructLayout(LayoutKind.Sequential)] - public class NonExistField - { - - } - public class SubBuffer : SafeBuffer - { - public SubBuffer(bool ownsHandle) : base(ownsHandle) { } - - protected override bool ReleaseHandle() - { - throw new NotImplementedException(); - } - } - public partial class Test - { - private char[] _largeBuffer = new char[4096]; - - public static async Task Main(string[] args) - { - var rand = new Random(); - Console.WriteLine("Today's lucky number is " + rand.Next(100) + " and " + Guid.NewGuid()); - - return 0; - } - private static void ABCDEFGHIJKLMNOPQRSTUVWXYZ(Exception e) - { - Assert.Same(e, ExceptionDispatchInfo.SetCurrentStackTrace(e)); - } - - [LibraryImport("fibonacci")] - public static partial int Fibonacci(int n); - - [LibraryImport("fibonacci")] - [return: MarshalAs(UnmanagedType.I1)] - public static unsafe partial bool TestBoolReturn(int input, int* outValue); - - [LibraryImport("fibonacci")] - public static partial void testGLStartup(); - - public static async Task JsExportTaskOfInt(int value) - { - TaskCompletionSource tcs = new TaskCompletionSource(); - - var res = JavaScriptTestHelper.invoke1_TaskOfInt(tcs.Task, nameof(JavaScriptTestHelper.AwaitTaskOfObject)); - tcs.SetResult(value); - await Task.Yield(); - var rr = await res; - await Task.Yield(); - - Assert.Equal(value, rr); - //GC.Collect(); - } - - public static unsafe void JsExportVoidPtr(IntPtr xvalue) - { - void* value = (void*)xvalue; - void* res = JavaScriptTestHelper.invoke1_VoidPtr(value, nameof(JavaScriptTestHelper.EchoVoidPtr)); - Assert.True(value == res); - } - - public static unsafe void JsImportIntArray(int[]? expected) - { - var actual = JavaScriptTestHelper.echo1_Int32Array(expected); - Assert.Equal(expected, actual); - if (expected != null) for (int i = 0; i < expected.Length; i++) - { - var actualI = JavaScriptTestHelper.store_Int32Array(expected, i); - Assert.Equal(expected[i], actualI); - } - } - - public static unsafe void JsImportArraySegmentOfInt32() - { - var expectedBytes = new int[] { 88, 0, 1, -2, 42, int.MaxValue, int.MinValue }; - ArraySegment expected = new ArraySegment(expectedBytes, 1, 6); - ArraySegment actual = JavaScriptTestHelper.echo1_ArraySegmentOfInt32(expected, false); - Assert.Equal(expected.Count, actual.Count); - Assert.NotEqual(expected[0], expected[1]); - Assert.Equal(expected.Array, actual.Array); - actual = JavaScriptTestHelper.echo1_ArraySegmentOfInt32(expected, true); - Assert.Equal(expected[0], expected[1]); - Assert.Equal(actual[0], actual[1]); - } - - public static unsafe void JsImportArraySegmentOfDouble() - { - var expectedBytes = new double[] { 88.88, 0, 1, -1, double.Pi, 42, double.MaxValue, double.MinValue, double.NaN, double.PositiveInfinity, double.NegativeInfinity }; - ArraySegment expected = new ArraySegment(expectedBytes, 1, 10); - ArraySegment actual = JavaScriptTestHelper.echo1_ArraySegmentOfDouble(expected, false); - Assert.Equal(expected.Count, actual.Count); - Assert.NotEqual(expected[0], expected[1]); - Assert.Equal(expected.Array, actual.Array); - actual = JavaScriptTestHelper.echo1_ArraySegmentOfDouble(expected, true); - Assert.Equal(expected[0], expected[1]); - Assert.Equal(actual[0], actual[1]); - } - - public static unsafe void JsImportSpanOfDouble() - { - var expectedBytes = stackalloc double[] { 0, 1, -1, double.Pi, 42, double.MaxValue, double.MinValue, double.NaN, double.PositiveInfinity, double.NegativeInfinity }; - Span expected = new Span(expectedBytes, 10); - Assert.True(Unsafe.AsPointer(ref expected.GetPinnableReference()) == expectedBytes); - Span actual = JavaScriptTestHelper.echo1_SpanOfDouble(expected, false); - Assert.Equal(expected.Length, actual.Length); - Assert.NotEqual(expected[0], expected[1]); - Assert.Equal(expected.GetPinnableReference(), actual.GetPinnableReference()); - Assert.True(actual.SequenceCompareTo(expected) == 0); - Assert.Equal(expected.ToArray(), actual.ToArray()); - actual = JavaScriptTestHelper.echo1_SpanOfDouble(expected, true); - Assert.Equal(expected[0], expected[1]); - Assert.Equal(actual[0], actual[1]); - } - public static unsafe void JsImportObjectArray(object[]? expected) - { - if (expected?.Length == 1 && expected[0] is string s && s == "JSData") - { - expected = new object[] { new object[] { JavaScriptTestHelper.createData("test"), JavaScriptTestHelper.createException("test") } }; - } - var actual = JavaScriptTestHelper.echo1_ObjectArray(expected); - Console.WriteLine($"Checking two arrays for equality: expected={0}, actual={1}", - expected == null ? "null" : string.Join(", ", expected), - actual == null ? "null" : string.Join(", ", actual)); - - Assert.Equal(expected, actual); - - Console.WriteLine("Checking element-wise equality of arrays."); - if (expected != null) for (int i = 0; i < expected.Length; i++) - { - var actualI = JavaScriptTestHelper.store_ObjectArray(expected, i); - Assert.Equal(expected[i], actualI); - } - } - - public static unsafe void JsImportVoidPtr(IntPtr xvalue) - { - void* value = (void*)xvalue; - - JavaScriptTestHelper.store1_VoidPtr(value); - void* res = JavaScriptTestHelper.retrieve1_VoidPtr(); - Assert.True(value == res); - res = JavaScriptTestHelper.echo1_VoidPtr(value); - Assert.True(value == res); - - var actualJsType = JavaScriptTestHelper.getType1(); - string expectedType = IntPtr.Size == 4 ? "number" : "bigint"; - Assert.Equal(expectedType, actualJsType); - } - - public static async Task JsImportTaskTypes() - { - for (int i = 0; i < 100; i++) - { - object a = new object(); - Exception e = new Exception(); - JSObject j = JSHost.GlobalThis; - Assert.Equal("test", await JavaScriptTestHelper.echopromise_String("test")); - Assert.Same(a, await JavaScriptTestHelper.echopromise_Object(a)); - Assert.Same(e, await JavaScriptTestHelper.echopromise_Exception(e)); - Assert.Same(j, await JavaScriptTestHelper.echopromise_JSObject(j)); - GC.Collect(); - await Task.Delay(10); - } - } - public static void JsImportInstanceMember() - { - var actual = JavaScriptTestHelper.MemberEcho("t-e-s-t"); - Assert.StartsWith("t-e-s-t-w-i-t-h-i-n-s-t-a-n-c-e", actual); - } - - public static void JsImportNullableIntPtr(IntPtr? value) - { - string expectedType = IntPtr.Size == 4 ? "number" : "bigint"; - JsImportTest(value, - JavaScriptTestHelper.store1_NullableIntPtr, - JavaScriptTestHelper.retrieve1_NullableIntPtr, - JavaScriptTestHelper.echo1_NullableIntPtr, - JavaScriptTestHelper.throw1_NullableIntPtr, - JavaScriptTestHelper.identity1_NullableIntPtr, - expectedType); - } - - private static void JsImportTest(T value - , Action store1 - , Func retrieve1 - , Func echo1 - , Func throw1 - , Func identity1 - , string jsType, string? jsClass = null) - { - if (value == null) - { - jsClass = null; - jsType = "object"; - } - - // invoke - store1(value); - var res = retrieve1(); - Assert.Equal(value, res); - res = echo1(value); - Assert.Equal(value, res); - var equals = identity1(value); - Assert.True(equals, "value not equals"); - - var actualJsType = JavaScriptTestHelper.getType1(); - Assert.Equal(jsType, actualJsType); - - if (jsClass != null) - { - var actualJsClass = JavaScriptTestHelper.getClass1(); - Assert.Equal(jsClass, actualJsClass); - } - var exThrow0 = Assert.Throws(() => JavaScriptTestHelper.throw0()); - Assert.Contains("throw-0-msg", exThrow0.Message); - Assert.DoesNotContain(" at ", exThrow0.Message); -#if !FEATURE_WASM_MANAGED_THREADS - Assert.Contains("throw0fn", exThrow0.StackTrace); -#else - Assert.Contains("omitted JavaScript stack trace", exThrow0.StackTrace); -#endif - - var exThrow1 = Assert.Throws(() => throw1(value)); - Assert.Contains("throw1-msg", exThrow1.Message); - Assert.DoesNotContain(" at ", exThrow1.Message); -#if !FEATURE_WASM_MANAGED_THREADS - Assert.Contains("throw1fn", exThrow1.StackTrace); -#else - Assert.Contains("omitted JavaScript stack trace", exThrow0.StackTrace); -#endif - - // anything is a system.object, sometimes it would be JSObject wrapper - if (typeof(T).IsPrimitive) - { - if (typeof(T) != typeof(long)) - { - - object resBoxed = JavaScriptTestHelper.echo1_Object(value); - // js Number always boxes as double - if (typeof(T) == typeof(IntPtr)) - { - //TODO Assert.Equal((IntPtr)(object)value, (IntPtr)(int)(double)resBoxed); - } - else if (typeof(T) == typeof(bool)) - { - Assert.Equal((bool)(object)value, (bool)resBoxed); - } - else if (typeof(T) == typeof(char)) - { - Assert.Equal((char)(object)value, (char)(double)resBoxed); - } - else - { - Assert.Equal(Convert.ToDouble(value), resBoxed); - } - } - - //TODO var task = JavaScriptTestHelper.await1(Task.FromResult((object)value)); - } - else if (typeof(T) == typeof(DateTime)) - { - var resBoxed = JavaScriptTestHelper.echo1_Object(value); - Assert.Equal(value, resBoxed); - } - else if (typeof(T) == typeof(DateTimeOffset)) - { - var resBoxed = JavaScriptTestHelper.echo1_Object(value); - Assert.Equal(((DateTimeOffset)(object)value).UtcDateTime, resBoxed); - } - else if (Nullable.GetUnderlyingType(typeof(T)) != null) - { - var vt = Nullable.GetUnderlyingType(typeof(T)); - if (vt != typeof(long)) - { - var resBoxed = JavaScriptTestHelper.echo1_Object(value); - if (resBoxed != null) - { - if (vt == typeof(bool)) - { - Assert.Equal(((bool?)(object)value).Value, (bool)resBoxed); - } - else if (vt == typeof(char)) - { - Assert.Equal(((char?)(object)value).Value, (char)resBoxed); - } - else if (vt == typeof(DateTime)) - { - Assert.Equal(((DateTime?)(object)value).Value, resBoxed); - } - else if (vt == typeof(DateTimeOffset)) - { - Assert.Equal(((DateTimeOffset?)(object)value).Value.UtcDateTime, resBoxed); - } - else if (vt == typeof(IntPtr)) - { - // TODO Assert.Equal((double)((IntPtr?)(object)value).Value, resBoxed); - } - else - { - Assert.Equal(Convert.ToDouble(value), resBoxed); - } - } - else - { - Assert.Equal(value, default(T)); - } - } - } - else - { - var resObj = JavaScriptTestHelper.retrieve1_Object(); - if (resObj == null || resObj.GetType() != typeof(JSObject)) - { - Assert.Equal(value, resObj); - } - } - - if (typeof(Exception).IsAssignableFrom(typeof(T))) - { - // all exceptions are Exception - var resEx = JavaScriptTestHelper.retrieve1_Exception(); - Assert.Equal((Exception)(object)value, resEx); - } - } - - public static unsafe void BadCast() - { - JSException ex; - JSHost.DotnetInstance.SetProperty("testBool", true); - //ex = Assert.Throws(() => JSHost.DotnetInstance.GetPropertyAsInt32("testBool")); - //Assert.Contains("Value is not an integer", ex.Message); - //ex = Assert.Throws(() => JSHost.DotnetInstance.GetPropertyAsDouble("testBool")); - //Assert.Contains("Value is not a Number", ex.Message); - //ex = Assert.Throws(() => JSHost.DotnetInstance.GetPropertyAsString("testBool")); - //Assert.Contains("Value is not a String", ex.Message); - //ex = Assert.Throws(() => JSHost.DotnetInstance.GetPropertyAsJSObject("testBool")); - //Assert.Contains("JSObject proxy of boolean is not supported", ex.Message); - ex = Assert.Throws(() => JSHost.DotnetInstance.GetPropertyAsByteArray("testBool")); - Assert.Contains("Value is not an Array or Uint8Array", ex.Message); - //JSHost.DotnetInstance.SetProperty("testInt", 42); - //ex = Assert.Throws(() => JSHost.DotnetInstance.GetPropertyAsBoolean("testInt")); - //Assert.Contains("Value is not a Boolean", ex.Message); - } - - - private static bool IsNullOrWin32Atom(IntPtr ptr) - { - const long HIWORDMASK = unchecked((long)0xffffffffffff0000L); - - long lPtr = (long)ptr; - Console.WriteLine($"IsNullOrWin32Atom: {lPtr} ({ptr})"); - return 0 == (lPtr & HIWORDMASK); - } - public static void TestPtrIsAtom(IntPtr ptr) - { - Assert.True(IsNullOrWin32Atom(ptr), $"Expected {ptr} to be <64k but it is not."); - } - - public static unsafe string? MyPtrToStringUTF8(IntPtr ptr) - { - Console.WriteLine($"MyPtrToStringUTF8: {ptr}"); - if (IsNullOrWin32Atom(ptr)) - { - Console.WriteLine($"MyPtrToStringUTF8: returning NULL"); - return null; - } - - return "Junk"; - } - - public static void PtrToStringUTF8_Win32AtomPointer_ReturnsNull() - { - // Windows Marshal has specific checks that does not do - // anything if the ptr is less than 64K. - IntPtr testVal = 1; - string res = Marshal.PtrToStringUTF8(testVal); - //string res = MyPtrToStringUTF8(testVal); - Console.WriteLine($"Marshal.PtrToStringUTF8({testVal}) = {res}"); - Assert.Null(Marshal.PtrToStringUTF8((IntPtr)1)); - } - public static void PtrToStringUTF8_ZeroPointer_ReturnsNull() - { - Assert.Null(Marshal.PtrToStringUTF8(IntPtr.Zero)); - } - - public static void ZeroFreeGlobalAllocAnsi_Zero_Nop() - { - Marshal.ZeroFreeGlobalAllocAnsi(IntPtr.Zero); - } - - private static SecureString ToSecureString(string data) - { - var str = new SecureString(); - foreach (char c in data) - { - str.AppendChar(c); - } - str.MakeReadOnly(); - return str; - } - - public static void ZeroFreeGlobalAllocAnsi_ValidPointer_Success() - { - using (SecureString secureString = ToSecureString("hello")) - { - IntPtr ptr = Marshal.SecureStringToGlobalAllocAnsi(secureString); - Marshal.ZeroFreeGlobalAllocAnsi(ptr); - } - } - [JSExport] - public static async Task TestMath() - { - // can we call ModF from here? looks like it's an internal call. - double test = Math.Truncate(6.666); - Console.WriteLine($"Math.Truncate(6.666) = {test}"); - } - // should be encoded as 4_V, not V_V - public static uint TestUint_4_V() - { - uint retval = 666; - return retval; - } - [JSExport] - public static async Task TestUint() - { - uint id = TestUint_4_V(); - Console.WriteLine($"TestUint got value {id}"); - } - [JSExport] - public static async Task TestBuffer(string str) - { - //OffsetOf_NoSuchFieldName_ThrowsArgumentException - var buffer = new SubBuffer(true); - //buffer.Initialize(ulong.MaxValue); - Assert.Throws("numBytes", () => buffer.Initialize(ulong.MaxValue)); - } - [JSExport] - public static async Task OffsetOf_NoSuchFieldName_ThrowsArgumentException() - { - Assert.Throws(() => Marshal.OffsetOf(typeof(NonExistField), "NonExistField")); - Assert.Throws(() => Marshal.OffsetOf("NonExistField")); - } - [JSExport] - public static async Task SetCurrentStackTrace_IncludedInExceptionStackTrace() - { - Exception e; - - e = new Exception(); - ABCDEFGHIJKLMNOPQRSTUVWXYZ(e); - Assert.Contains(nameof(ABCDEFGHIJKLMNOPQRSTUVWXYZ), e.StackTrace, StringComparison.Ordinal); - - e = new Exception(); - ABCDEFGHIJKLMNOPQRSTUVWXYZ(e); - try { throw e; } catch { } - Assert.Contains(nameof(ABCDEFGHIJKLMNOPQRSTUVWXYZ), e.StackTrace, StringComparison.Ordinal); - } - - [JSExport] - internal static unsafe void TestBool() - { - Console.WriteLine("Calling testbool"); - int retVal = 0; - bool value = TestBoolReturn(1, &retVal); - Console.WriteLine($"TestBoolReturn(1) returned {value} with out param {retVal}"); - } - [JSExport] - internal static void TestGL() - { - Console.WriteLine("Calling testGLStartup"); - var val = Fibonacci(8); - Console.WriteLine($"Fibonacci(8)={val}"); - testGLStartup(); - } - - [JSExport] - public static async Task DoTestMethod() - { - //await JavaScriptTestHelper.InitializeAsync(); - //const bool doCollect = true; - - var val = Fibonacci(8); - Console.WriteLine($"Fibonacci(8)={val}"); - //testGLStartup(); - string myTestString = "Hello from .NET"; - unsafe - { - fixed (char* p = myTestString) - { - Console.WriteLine($"Address of x: 0x{(ulong)p:X}"); - StringTests.PrintMyStringFromCSharp(myTestString); - } - } - - //if (doCollect) GC.Collect(); - - //ZeroFreeGlobalAllocAnsi_Zero_Nop(); - //if (doCollect) GC.Collect(); - //ZeroFreeGlobalAllocAnsi_ValidPointer_Success(); - //if (doCollect) GC.Collect(); - - //System.SpanTests.TryWriteTests.AppendFormatted_ReferenceTypes_ICustomFormatter(); - //if (doCollect) GC.Collect(); - //System.SpanTests.TryWriteTests.AppendFormatted_ValueTypes_CreateProviderFlowed(); - //if (doCollect) GC.Collect(); - - - //GCHandleTests.Ctor_Default(); - //if (doCollect) GC.Collect(); - - - //int[] testData = new int[] { 1, 2, 3, int.MaxValue, int.MinValue }; - //object[] objectTestData = { new object[] { string.Intern("hello"), string.Empty } }; - - //JsImportNullableIntPtr((IntPtr)42); - //GeneralInterop.MH_SetLogVerbosity(1); // export isn't picked up! - //PtrToStringUTF8_ZeroPointer_ReturnsNull(); - //IsNullOrWin32Atom((IntPtr)1); - //PtrToStringUTF8_Win32AtomPointer_ReturnsNull(); - //GetFunctionPointerForDelegate_MarshalledDelegateGeneric_ReturnsExpected(); - //BadCast(); - //JsImportInstanceMember(); - //JsImportInstanceMember(); - //await JsImportTaskTypes(); - //JsImportVoidPtr((IntPtr)42); - - //JsImportObjectArray(objectTestData); - //JsImportArraySegmentOfInt32(); - //JsImportArraySegmentOfDouble(); - //JsImportSpanOfDouble(); - //JsImportIntArray(testData); - //JsExportVoidPtr(-9223372036854775808); //IntPtr.MinValue - //JsExportVoidPtr(IntPtr.MinValue); - //await JsExportTaskOfInt(-2147483648); - //await JsExportTaskOfInt(8); - //await JsExportTaskOfInt(0); - } - } -} diff --git a/src/mono/sample/wasm/browser-test-debug/StringTests.cs b/src/mono/sample/wasm/browser-test-debug/StringTests.cs deleted file mode 100644 index 421578dd40b959..00000000000000 --- a/src/mono/sample/wasm/browser-test-debug/StringTests.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Sample -{ - public class StringTests - { - [DllImport("wasmString", EntryPoint = "printString")] - [DefaultDllImportSearchPaths(DllImportSearchPath.AssemblyDirectory)] - public static extern void PrintMyStringFromCSharp([MarshalAs(UnmanagedType.LPStr)] string _filePath); - } -} diff --git a/src/mono/sample/wasm/browser-test-debug/TryWrite.cs b/src/mono/sample/wasm/browser-test-debug/TryWrite.cs deleted file mode 100644 index b0ebef1ed3a0e8..00000000000000 --- a/src/mono/sample/wasm/browser-test-debug/TryWrite.cs +++ /dev/null @@ -1,730 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Diagnostics; -using System.Globalization; -//using System.Tests; -using System.Text; -using Sample; -//using Xunit; - -// TODO: Once compiler support is available, augment tests to exercise interpolated strings. - -namespace System.SpanTests -{ - static public class TryWriteTests - { - public static char[] _largeBuffer = new char[4096]; - - //[Theory] - //[InlineData(0, 0)] - //[InlineData(1, 1)] - //[InlineData(42, 84)] - //[InlineData(-1, 0)] - //[InlineData(-1, -1)] - //[InlineData(-16, 1)] - static public void LengthAndHoleArguments_Valid(int literalLength, int formattedCount) - { - bool shouldAppend; - - new MemoryExtensions.TryWriteInterpolatedStringHandler(literalLength, formattedCount, new char[Math.Max(0, literalLength)], out shouldAppend); - Assert.True(shouldAppend); - - new MemoryExtensions.TryWriteInterpolatedStringHandler(literalLength, formattedCount, new char[1 + Math.Max(0, literalLength)], out shouldAppend); - Assert.True(shouldAppend); - - if (literalLength > 0) - { - new MemoryExtensions.TryWriteInterpolatedStringHandler(literalLength, formattedCount, new char[literalLength - 1], out shouldAppend); - Assert.False(shouldAppend); - } - - foreach (IFormatProvider provider in new IFormatProvider[] { null, new ConcatFormatter(), CultureInfo.InvariantCulture, CultureInfo.CurrentCulture, new CultureInfo("en-US"), new CultureInfo("fr-FR") }) - { - new MemoryExtensions.TryWriteInterpolatedStringHandler(literalLength, formattedCount, new char[Math.Max(0, literalLength)], out shouldAppend); - Assert.True(shouldAppend); - - new MemoryExtensions.TryWriteInterpolatedStringHandler(literalLength, formattedCount, new char[1 + Math.Max(0, literalLength)], out shouldAppend); - Assert.True(shouldAppend); - - if (literalLength > 0) - { - new MemoryExtensions.TryWriteInterpolatedStringHandler(literalLength, formattedCount, new char[literalLength - 1], out shouldAppend); - Assert.False(shouldAppend); - } - } - } - - - static public void AppendLiteral() - { - var expected = new StringBuilder(); - MemoryExtensions.TryWriteInterpolatedStringHandler actual = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, _largeBuffer, out _); - - foreach (string s in new[] { "", "a", "bc", "def", "this is a long string", "!" }) - { - expected.Append(s); - actual.AppendLiteral(s); - } - - Assert.True(MemoryExtensions.TryWrite(_largeBuffer, ref actual, out int charsWritten)); - Assert.Equal(expected.ToString(), _largeBuffer.AsSpan(0, charsWritten).ToString()); - } - - - static public void AppendFormatted_ReadOnlySpanChar() - { - var expected = new StringBuilder(); - MemoryExtensions.TryWriteInterpolatedStringHandler actual = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, _largeBuffer, out _); - - foreach (string s in new[] { "", "a", "bc", "def", "this is a longer string", "!" }) - { - // span - expected.Append(s); - actual.AppendFormatted((ReadOnlySpan)s); - - // span, format - expected.AppendFormat("{0:X2}", s); - actual.AppendFormatted((ReadOnlySpan)s, format: "X2"); - - foreach (int alignment in new[] { 0, 3, -3 }) - { - // span, alignment - expected.AppendFormat("{0," + alignment.ToString(CultureInfo.InvariantCulture) + "}", s); - actual.AppendFormatted((ReadOnlySpan)s, alignment); - - // span, alignment, format - expected.AppendFormat("{0," + alignment.ToString(CultureInfo.InvariantCulture) + ":X2}", s); - actual.AppendFormatted((ReadOnlySpan)s, alignment, "X2"); - } - } - - Assert.True(MemoryExtensions.TryWrite(_largeBuffer, ref actual, out int charsWritten)); - Assert.Equal(expected.ToString(), _largeBuffer.AsSpan(0, charsWritten).ToString()); - } - - - static public void AppendFormatted_String() - { - var expected = new StringBuilder(); - MemoryExtensions.TryWriteInterpolatedStringHandler actual = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, _largeBuffer, out _); - - foreach (string s in new[] { null, "", "a", "bc", "def", "this is a longer string", "!" }) - { - // string - expected.AppendFormat("{0}", s); - actual.AppendFormatted(s); - - // string, format - expected.AppendFormat("{0:X2}", s); - actual.AppendFormatted(s, "X2"); - - foreach (int alignment in new[] { 0, 3, -3 }) - { - // string, alignment - expected.AppendFormat("{0," + alignment.ToString(CultureInfo.InvariantCulture) + "}", s); - actual.AppendFormatted(s, alignment); - - // string, alignment, format - expected.AppendFormat("{0," + alignment.ToString(CultureInfo.InvariantCulture) + ":X2}", s); - actual.AppendFormatted(s, alignment, "X2"); - } - } - - Assert.True(MemoryExtensions.TryWrite(_largeBuffer, ref actual, out int charsWritten)); - Assert.Equal(expected.ToString(), _largeBuffer.AsSpan(0, charsWritten).ToString()); - } - - - static public void AppendFormatted_String_ICustomFormatter() - { - var provider = new ConcatFormatter(); - - var expected = new StringBuilder(); - MemoryExtensions.TryWriteInterpolatedStringHandler actual = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, _largeBuffer, provider, out _); - - foreach (string s in new[] { null, "", "a" }) - { - // string - expected.AppendFormat(provider, "{0}", s); - actual.AppendFormatted(s); - - // string, format - expected.AppendFormat(provider, "{0:X2}", s); - actual.AppendFormatted(s, "X2"); - - // string, alignment - expected.AppendFormat(provider, "{0,3}", s); - actual.AppendFormatted(s, 3); - - // string, alignment, format - expected.AppendFormat(provider, "{0,-3:X2}", s); - actual.AppendFormatted(s, -3, "X2"); - } - - Assert.True(MemoryExtensions.TryWrite(_largeBuffer, ref actual, out int charsWritten)); - Assert.Equal(expected.ToString(), _largeBuffer.AsSpan(0, charsWritten).ToString()); - } - - - static public void AppendFormatted_ReferenceTypes() - { - var expected = new StringBuilder(); - MemoryExtensions.TryWriteInterpolatedStringHandler actual = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, _largeBuffer, out _); - - foreach (string rawInput in new[] { null, "", "a", "bc", "def", "this is a longer string", "!" }) - { - foreach (object o in new object[] - { - rawInput, // raw string directly; ToString will return itself - new StringWrapper(rawInput), // wrapper object that returns string from ToString - new FormattableStringWrapper(rawInput), // IFormattable wrapper around string - new SpanFormattableStringWrapper(rawInput) // ISpanFormattable wrapper around string - }) - { - // object - expected.AppendFormat("{0}", o); - actual.AppendFormatted(o); - if (o is IHasToStringState tss1) - { - Assert.True(string.IsNullOrEmpty(tss1.ToStringState.LastFormat)); - AssertModeMatchesType(tss1); - } - - // object, format - expected.AppendFormat("{0:X2}", o); - actual.AppendFormatted(o, "X2"); - if (o is IHasToStringState tss2) - { - Assert.Equal("X2", tss2.ToStringState.LastFormat); - AssertModeMatchesType(tss2); - } - - foreach (int alignment in new[] { 0, 3, -3 }) - { - // object, alignment - expected.AppendFormat("{0," + alignment.ToString(CultureInfo.InvariantCulture) + "}", o); - actual.AppendFormatted(o, alignment); - if (o is IHasToStringState tss3) - { - Assert.True(string.IsNullOrEmpty(tss3.ToStringState.LastFormat)); - AssertModeMatchesType(tss3); - } - - // object, alignment, format - expected.AppendFormat("{0," + alignment.ToString(CultureInfo.InvariantCulture) + ":X2}", o); - actual.AppendFormatted(o, alignment, "X2"); - if (o is IHasToStringState tss4) - { - Assert.Equal("X2", tss4.ToStringState.LastFormat); - AssertModeMatchesType(tss4); - } - } - } - } - - Assert.True(MemoryExtensions.TryWrite(_largeBuffer, ref actual, out int charsWritten)); - Assert.Equal(expected.ToString(), _largeBuffer.AsSpan(0, charsWritten).ToString()); - } - - - static public void AppendFormatted_ReferenceTypes_CreateProviderFlowed() - { - Console.WriteLine("Starting test AppendFormatted_ReferenceTypes_CreateProviderFlowed"); - var provider = new CultureInfo("en-US"); - MemoryExtensions.TryWriteInterpolatedStringHandler handler = new MemoryExtensions.TryWriteInterpolatedStringHandler(1, 2, _largeBuffer, provider, out _); - - foreach (IHasToStringState tss in new IHasToStringState[] { new FormattableStringWrapper("hello"), new SpanFormattableStringWrapper("hello") }) - { - handler.AppendFormatted(tss); - Assert.Same(provider, tss.ToStringState.LastProvider); - - handler.AppendFormatted(tss, 1); - Assert.Same(provider, tss.ToStringState.LastProvider); - - handler.AppendFormatted(tss, "X2"); - Assert.Same(provider, tss.ToStringState.LastProvider); - - handler.AppendFormatted(tss, 1, "X2"); - Assert.Same(provider, tss.ToStringState.LastProvider); - } - } - - - static public void AppendFormatted_ReferenceTypes_ICustomFormatter() - { - var provider = new ConcatFormatter(); - - var expected = new StringBuilder(); - MemoryExtensions.TryWriteInterpolatedStringHandler actual = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, _largeBuffer, provider, out _); - - foreach (string s in new[] { null, "", "a" }) - { - foreach (IHasToStringState tss in new IHasToStringState[] { new FormattableStringWrapper(s), new SpanFormattableStringWrapper(s) }) - { - void AssertTss(IHasToStringState tss, string format) - { - Assert.Equal(format, tss.ToStringState.LastFormat); - Assert.Same(provider, tss.ToStringState.LastProvider); - Assert.Equal(ToStringMode.ICustomFormatterFormat, tss.ToStringState.ToStringMode); - } - - // object - expected.AppendFormat(provider, "{0}", tss); - actual.AppendFormatted(tss); - AssertTss(tss, null); - - // object, format - expected.AppendFormat(provider, "{0:X2}", tss); - actual.AppendFormatted(tss, "X2"); - AssertTss(tss, "X2"); - - // object, alignment - expected.AppendFormat(provider, "{0,3}", tss); - actual.AppendFormatted(tss, 3); - AssertTss(tss, null); - - // object, alignment, format - expected.AppendFormat(provider, "{0,-3:X2}", tss); - actual.AppendFormatted(tss, -3, "X2"); - AssertTss(tss, "X2"); - } - } - - Assert.True(MemoryExtensions.TryWrite(_largeBuffer, ref actual, out int charsWritten)); - Assert.Equal(expected.ToString(), _largeBuffer.AsSpan(0, charsWritten).ToString()); - } - - - static public void AppendFormatted_ValueTypes() - { - void Test(T t) - { - var expected = new StringBuilder(); - MemoryExtensions.TryWriteInterpolatedStringHandler actual = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, _largeBuffer, out _); - - // struct - expected.AppendFormat("{0}", t); - actual.AppendFormatted(t); - Assert.True(string.IsNullOrEmpty(((IHasToStringState)t).ToStringState.LastFormat)); - AssertModeMatchesType(((IHasToStringState)t)); - - // struct, format - expected.AppendFormat("{0:X2}", t); - actual.AppendFormatted(t, "X2"); - Assert.Equal("X2", ((IHasToStringState)t).ToStringState.LastFormat); - AssertModeMatchesType(((IHasToStringState)t)); - - foreach (int alignment in new[] { 0, 3, -3 }) - { - // struct, alignment - expected.AppendFormat("{0," + alignment.ToString(CultureInfo.InvariantCulture) + "}", t); - actual.AppendFormatted(t, alignment); - Assert.True(string.IsNullOrEmpty(((IHasToStringState)t).ToStringState.LastFormat)); - AssertModeMatchesType(((IHasToStringState)t)); - - // struct, alignment, format - expected.AppendFormat("{0," + alignment.ToString(CultureInfo.InvariantCulture) + ":X2}", t); - actual.AppendFormatted(t, alignment, "X2"); - Assert.Equal("X2", ((IHasToStringState)t).ToStringState.LastFormat); - AssertModeMatchesType(((IHasToStringState)t)); - } - - Assert.True(MemoryExtensions.TryWrite(_largeBuffer, ref actual, out int charsWritten)); - Assert.Equal(expected.ToString(), _largeBuffer.AsSpan(0, charsWritten).ToString()); - } - - Test(new FormattableInt32Wrapper(42)); - Test(new SpanFormattableInt32Wrapper(84)); - Test((FormattableInt32Wrapper?)new FormattableInt32Wrapper(42)); - Test((SpanFormattableInt32Wrapper?)new SpanFormattableInt32Wrapper(84)); - } - - - static public void AppendFormatted_ValueTypes_CreateProviderFlowed() - { - void Test(T t) - { - var provider = new CultureInfo("en-US"); //CultureInfo.InvariantCulture; - MemoryExtensions.TryWriteInterpolatedStringHandler handler = new MemoryExtensions.TryWriteInterpolatedStringHandler(1, 2, _largeBuffer, provider, out _); - - handler.AppendFormatted(t); - Assert.Same(provider, ((IHasToStringState)t).ToStringState.LastProvider); - - handler.AppendFormatted(t, 1); - Assert.Same(provider, ((IHasToStringState)t).ToStringState.LastProvider); - - handler.AppendFormatted(t, "X2"); - Assert.Same(provider, ((IHasToStringState)t).ToStringState.LastProvider); - - handler.AppendFormatted(t, 1, "X2"); - Assert.Same(provider, ((IHasToStringState)t).ToStringState.LastProvider); - } - - Test(new FormattableInt32Wrapper(42)); - Test(new SpanFormattableInt32Wrapper(84)); - Test((FormattableInt32Wrapper?)new FormattableInt32Wrapper(42)); - Test((SpanFormattableInt32Wrapper?)new SpanFormattableInt32Wrapper(84)); - } - - - static public void AppendFormatted_ValueTypes_ICustomFormatter() - { - var provider = new ConcatFormatter(); - - void Test(T t) - { - void AssertTss(T tss, string format) - { - Assert.Equal(format, ((IHasToStringState)tss).ToStringState.LastFormat); - Assert.Same(provider, ((IHasToStringState)tss).ToStringState.LastProvider); - Assert.Equal(ToStringMode.ICustomFormatterFormat, ((IHasToStringState)tss).ToStringState.ToStringMode); - } - - var expected = new StringBuilder(); - MemoryExtensions.TryWriteInterpolatedStringHandler actual = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, _largeBuffer, provider, out _); - - // struct - expected.AppendFormat(provider, "{0}", t); - actual.AppendFormatted(t); - AssertTss(t, null); - - // struct, format - expected.AppendFormat(provider, "{0:X2}", t); - actual.AppendFormatted(t, "X2"); - AssertTss(t, "X2"); - - // struct, alignment - expected.AppendFormat(provider, "{0,3}", t); - actual.AppendFormatted(t, 3); - AssertTss(t, null); - - // struct, alignment, format - expected.AppendFormat(provider, "{0,-3:X2}", t); - actual.AppendFormatted(t, -3, "X2"); - AssertTss(t, "X2"); - - Assert.True(MemoryExtensions.TryWrite(_largeBuffer, ref actual, out int charsWritten)); - Assert.Equal(expected.ToString(), _largeBuffer.AsSpan(0, charsWritten).ToString()); - } - - Test(new FormattableInt32Wrapper(42)); - Test(new SpanFormattableInt32Wrapper(84)); - Test((FormattableInt32Wrapper?)new FormattableInt32Wrapper(42)); - Test((SpanFormattableInt32Wrapper?)new SpanFormattableInt32Wrapper(84)); - } - - - static public void AppendFormatted_EmptyBuffer_ZeroLengthWritesSuccessful() - { - var buffer = new char[100]; - - MemoryExtensions.TryWriteInterpolatedStringHandler b = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, buffer.AsSpan(0, 0), out bool shouldAppend); - Assert.True(shouldAppend); - - Assert.True(b.AppendLiteral("")); - Assert.True(b.AppendFormatted((object)"", alignment: 0, format: "X2")); - Assert.True(b.AppendFormatted(null)); - Assert.True(b.AppendFormatted("")); - Assert.True(b.AppendFormatted("", alignment: 0, format: "X2")); - Assert.True(b.AppendFormatted("")); - Assert.True(b.AppendFormatted("", alignment: 0)); - Assert.True(b.AppendFormatted("", format: "X2")); - Assert.True(b.AppendFormatted("", alignment: 0, format: "X2")); - Assert.True(b.AppendFormatted("".AsSpan())); - Assert.True(b.AppendFormatted("".AsSpan(), alignment: 0, format: "X2")); - - Assert.True(MemoryExtensions.TryWrite(buffer.AsSpan(0, 0), ref b, out int charsWritten)); - Assert.Equal(0, charsWritten); - } - - //[Theory] - //[InlineData(0)] - //[InlineData(100)] - static public void AppendFormatted_BufferTooSmall(int bufferLength) - { - var buffer = new char[bufferLength]; - - for (int i = 0; i <= 29; i++) - { - MemoryExtensions.TryWriteInterpolatedStringHandler b = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, buffer, out bool shouldAppend); - Assert.True(shouldAppend); - - Assert.True(b.AppendLiteral(new string('s', bufferLength))); - - bool result = i switch - { - 0 => b.AppendLiteral(" "), - 1 => b.AppendFormatted((object)" ", alignment: 0, format: "X2"), - 2 => b.AppendFormatted(" "), - 3 => b.AppendFormatted(" ", alignment: 0, format: "X2"), - 4 => b.AppendFormatted(" "), - 5 => b.AppendFormatted(" ", alignment: 0), - 6 => b.AppendFormatted(" ", format: "X2"), - 7 => b.AppendFormatted(" ", alignment: 0, format: "X2"), - 8 => b.AppendFormatted(" ".AsSpan()), - 9 => b.AppendFormatted(" ".AsSpan(), alignment: 0, format: "X2"), - 10 => b.AppendFormatted(new FormattableStringWrapper(" ")), - 11 => b.AppendFormatted(new FormattableStringWrapper(" "), alignment: 0), - 12 => b.AppendFormatted(new FormattableStringWrapper(" "), format: "X2"), - 13 => b.AppendFormatted(new FormattableStringWrapper(" "), alignment: 0, format: "X2"), - 14 => b.AppendFormatted(new SpanFormattableStringWrapper(" ")), - 15 => b.AppendFormatted(new SpanFormattableStringWrapper(" "), alignment: 0), - 16 => b.AppendFormatted(new SpanFormattableStringWrapper(" "), format: "X2"), - 17 => b.AppendFormatted(new SpanFormattableStringWrapper(" "), alignment: 0, format: "X2"), - 18 => b.AppendFormatted(new FormattableInt32Wrapper(1)), - 19 => b.AppendFormatted(new FormattableInt32Wrapper(1), alignment: 0), - 20 => b.AppendFormatted(new FormattableInt32Wrapper(1), format: "X2"), - 21 => b.AppendFormatted(new FormattableInt32Wrapper(1), alignment: 0, format: "X2"), - 22 => b.AppendFormatted(new SpanFormattableInt32Wrapper(1)), - 23 => b.AppendFormatted(new SpanFormattableInt32Wrapper(1), alignment: 0), - 24 => b.AppendFormatted(new SpanFormattableInt32Wrapper(1), format: "X2"), - 25 => b.AppendFormatted(new SpanFormattableInt32Wrapper(1), alignment: 0, format: "X2"), - 26 => b.AppendFormatted("", alignment: 1), - 27 => b.AppendFormatted("", alignment: -1), - 28 => b.AppendFormatted(" ", alignment: 1, format: "X2"), - 29 => b.AppendFormatted(" ", alignment: -1, format: "X2"), - _ => throw new Exception(), - }; - Assert.False(result); - - Assert.False(MemoryExtensions.TryWrite(buffer.AsSpan(0, 0), ref b, out int charsWritten)); - Assert.Equal(0, charsWritten); - } - } - - static public void AppendFormatted_BufferTooSmall_CustomFormatter() - { - var buffer = new char[100]; - var provider = new ConstFormatter(" "); - - { - MemoryExtensions.TryWriteInterpolatedStringHandler b = new MemoryExtensions.TryWriteInterpolatedStringHandler(0, 0, buffer.AsSpan(0, 0), provider, out bool shouldAppend); - Assert.True(shouldAppend); - - // don't use custom formatter - Assert.True(b.AppendLiteral("")); - Assert.True(b.AppendFormatted("".AsSpan())); - Assert.True(b.AppendFormatted("".AsSpan(), alignment: 0, format: "X2")); - - // do use custom formatter - Assert.False(b.AppendFormatted((object)"", alignment: 0, format: "X2")); - Assert.False(b.AppendFormatted(null)); - Assert.False(b.AppendFormatted("")); - Assert.False(b.AppendFormatted("", alignment: 0, format: "X2")); - Assert.False(b.AppendFormatted("")); - Assert.False(b.AppendFormatted("", alignment: 0)); - Assert.False(b.AppendFormatted("", format: "X2")); - Assert.False(b.AppendFormatted("", alignment: 0, format: "X2")); - - Assert.False(MemoryExtensions.TryWrite(buffer.AsSpan(0, 0), ref b, out int charsWritten)); - Assert.Equal(0, charsWritten); - } - } - - private static void AssertModeMatchesType(T tss) where T : IHasToStringState - { - ToStringMode expected = - tss is ISpanFormattable ? ToStringMode.ISpanFormattableTryFormat : - tss is IFormattable ? ToStringMode.IFormattableToString : - ToStringMode.ObjectToString; - Assert.Equal(expected, tss.ToStringState.ToStringMode); - } - - private sealed class SpanFormattableStringWrapper : IFormattable, ISpanFormattable, IHasToStringState - { - private readonly string _value; - public ToStringState ToStringState { get; } = new ToStringState(); - - public SpanFormattableStringWrapper(string value) => _value = value; - - public bool TryFormat(Span destination, out int charsWritten, ReadOnlySpan format, IFormatProvider provider) - { - ToStringState.LastFormat = format.ToString(); - ToStringState.LastProvider = provider; - ToStringState.ToStringMode = ToStringMode.ISpanFormattableTryFormat; - - if (_value is null) - { - charsWritten = 0; - return true; - } - - if (_value.Length > destination.Length) - { - charsWritten = 0; - return false; - } - - charsWritten = _value.Length; - _value.AsSpan().CopyTo(destination); - return true; - } - - public string ToString(string format, IFormatProvider formatProvider) - { - ToStringState.LastFormat = format; - ToStringState.LastProvider = formatProvider; - ToStringState.ToStringMode = ToStringMode.IFormattableToString; - return _value; - } - - public override string ToString() - { - ToStringState.LastFormat = null; - ToStringState.LastProvider = null; - ToStringState.ToStringMode = ToStringMode.ObjectToString; - return _value; - } - } - - private struct SpanFormattableInt32Wrapper : IFormattable, ISpanFormattable, IHasToStringState - { - private readonly int _value; - public ToStringState ToStringState { get; } - - public SpanFormattableInt32Wrapper(int value) - { - ToStringState = new ToStringState(); - _value = value; - } - - public bool TryFormat(Span destination, out int charsWritten, ReadOnlySpan format, IFormatProvider provider) - { - ToStringState.LastFormat = format.ToString(); - ToStringState.LastProvider = provider; - ToStringState.ToStringMode = ToStringMode.ISpanFormattableTryFormat; - - return _value.TryFormat(destination, out charsWritten, format, provider); - } - - public string ToString(string format, IFormatProvider formatProvider) - { - ToStringState.LastFormat = format; - ToStringState.LastProvider = formatProvider; - ToStringState.ToStringMode = ToStringMode.IFormattableToString; - return _value.ToString(format, formatProvider); - } - - public override string ToString() - { - ToStringState.LastFormat = null; - ToStringState.LastProvider = null; - ToStringState.ToStringMode = ToStringMode.ObjectToString; - return _value.ToString(); - } - } - - private sealed class FormattableStringWrapper : IFormattable, IHasToStringState - { - private readonly string _value; - public ToStringState ToStringState { get; } = new ToStringState(); - - public FormattableStringWrapper(string s) => _value = s; - - public string ToString(string format, IFormatProvider formatProvider) - { - ToStringState.LastFormat = format; - ToStringState.LastProvider = formatProvider; - ToStringState.ToStringMode = ToStringMode.IFormattableToString; - return _value; - } - - public override string ToString() - { - ToStringState.LastFormat = null; - ToStringState.LastProvider = null; - ToStringState.ToStringMode = ToStringMode.ObjectToString; - return _value; - } - } - - private struct FormattableInt32Wrapper : IFormattable, IHasToStringState - { - private readonly int _value; - public ToStringState ToStringState { get; } - - public FormattableInt32Wrapper(int i) - { - ToStringState = new ToStringState(); - _value = i; - } - - public string ToString(string format, IFormatProvider formatProvider) - { - ToStringState.LastFormat = format; - ToStringState.LastProvider = formatProvider; - ToStringState.ToStringMode = ToStringMode.IFormattableToString; - return _value.ToString(format, formatProvider); - } - - public override string ToString() - { - ToStringState.LastFormat = null; - ToStringState.LastProvider = null; - ToStringState.ToStringMode = ToStringMode.ObjectToString; - return _value.ToString(); - } - } - - private sealed class ToStringState - { - public string LastFormat { get; set; } - public IFormatProvider LastProvider { get; set; } - public ToStringMode ToStringMode { get; set; } - } - - private interface IHasToStringState - { - ToStringState ToStringState { get; } - } - - private enum ToStringMode - { - ObjectToString, - IFormattableToString, - ISpanFormattableTryFormat, - ICustomFormatterFormat, - } - - private sealed class StringWrapper - { - private readonly string _value; - - public StringWrapper(string s) => _value = s; - - public override string ToString() => _value; - } - - private sealed class ConcatFormatter : IFormatProvider, ICustomFormatter - { - public object GetFormat(Type formatType) => formatType == typeof(ICustomFormatter) ? this : null; - - public string Format(string format, object arg, IFormatProvider formatProvider) - { - string s = format + " " + arg + formatProvider; - - if (arg is IHasToStringState tss) - { - // Set after using arg.ToString() in concat above - tss.ToStringState.LastFormat = format; - tss.ToStringState.LastProvider = formatProvider; - tss.ToStringState.ToStringMode = ToStringMode.ICustomFormatterFormat; - } - - return s; - } - } - - private sealed class ConstFormatter : IFormatProvider, ICustomFormatter - { - private readonly string _value; - - public ConstFormatter(string value) => _value = value; - - public object GetFormat(Type formatType) => formatType == typeof(ICustomFormatter) ? this : null; - - public string Format(string format, object arg, IFormatProvider formatProvider) => _value; - } - } -} diff --git a/src/mono/sample/wasm/browser-test-debug/Wasm.Test.Debug.Sample.csproj b/src/mono/sample/wasm/browser-test-debug/Wasm.Test.Debug.Sample.csproj deleted file mode 100644 index 46fb11d91e55ad..00000000000000 --- a/src/mono/sample/wasm/browser-test-debug/Wasm.Test.Debug.Sample.csproj +++ /dev/null @@ -1,63 +0,0 @@ - - - - false - false - true - true - false - true - true - web,worker - - $(EmccFlags) -gsource-map -sMAX_WEBGL_VERSION=2 - - - -s LEGACY_GL_EMULATION=1 -lGL -lSDL -lidbfs.js - - <_ServeHeaders>$(_ServeHeaders) -h "Content-Security-Policy: default-src 'self' 'wasm-unsafe-eval'" -h "Timing-Allow-Origin: *" -h "Cross-Origin-Opener-Policy: same-origin" -h "Cross-Origin-Embedder-Policy: require-corp" - - - - - - ./ - - - - true - false - net10.0 - browser-wasm - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mono/sample/wasm/browser-test-debug/advanced-sample.lib.module.js b/src/mono/sample/wasm/browser-test-debug/advanced-sample.lib.module.js deleted file mode 100644 index be57002195d2f4..00000000000000 --- a/src/mono/sample/wasm/browser-test-debug/advanced-sample.lib.module.js +++ /dev/null @@ -1,10 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -export function onRuntimeConfigLoaded(config) { - console.log("advanced-sample onRuntimeConfigLoaded") -} - -export async function onRuntimeReady({ getAssemblyExports, getConfig }) { - console.log("advanced-sample onRuntimeReady") -} \ No newline at end of file diff --git a/src/mono/sample/wasm/browser-test-debug/fibonacci.c b/src/mono/sample/wasm/browser-test-debug/fibonacci.c deleted file mode 100644 index 70b0f47d3b27b7..00000000000000 --- a/src/mono/sample/wasm/browser-test-debug/fibonacci.c +++ /dev/null @@ -1,62 +0,0 @@ -#include -#include - -int Fibonacci(int n) { - int fnow = 0, fnext = 1, tempf; - printf("In Fibonacci.c\n"); fflush(stdout); - EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = 0; - EmscriptenWebGLContextAttributes attrs; - attrs.depth = 1; - attrs.stencil = 1; - attrs.antialias = 1; - attrs.premultipliedAlpha = 1; - attrs.preserveDrawingBuffer = 0; - attrs.powerPreference = EM_WEBGL_POWER_PREFERENCE_DEFAULT; //EM_WEBGL_POWER_PREFERENCE_HIGH_PERFORMANCE - attrs.failIfMajorPerformanceCaveat = 0; - attrs.majorVersion = 2; - attrs.minorVersion = 0; - attrs.enableExtensionsByDefault = 1; - attrs.explicitSwapControl = 0; - attrs.renderViaOffscreenBackBuffer = 0; - attrs.proxyContextToMainThread = EMSCRIPTEN_WEBGL_CONTEXT_PROXY_DISALLOW; - printf("Have attrs.majorVersion %d\n", attrs.majorVersion); fflush(stdout); - context = emscripten_webgl_create_context("#MyCanvasId", &attrs); - printf("Got context: %d\n", (int)context);fflush(stdout); - while(--n>0){ - tempf = fnow + fnext; - fnow = fnext; - fnext = tempf; - } - return fnext; -} - -bool TestBoolReturn(int input, int* outValue) -{ - *outValue = input * 2; - return true; -} - -void testGLStartup() -{ - EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = 0; - EmscriptenWebGLContextAttributes attrs; - attrs.depth = 1; - attrs.stencil = 1; - attrs.antialias = 1; - attrs.premultipliedAlpha = 1; - attrs.preserveDrawingBuffer = 0; - attrs.powerPreference = EM_WEBGL_POWER_PREFERENCE_DEFAULT; //EM_WEBGL_POWER_PREFERENCE_HIGH_PERFORMANCE - attrs.failIfMajorPerformanceCaveat = 0; - attrs.majorVersion = 2; - attrs.minorVersion = 0; - attrs.enableExtensionsByDefault = 1; - attrs.explicitSwapControl = 0; - attrs.renderViaOffscreenBackBuffer = 0; - attrs.proxyContextToMainThread = EMSCRIPTEN_WEBGL_CONTEXT_PROXY_DISALLOW; - - emscripten_console_log("Creating webGL context"); - const char* canvasIdStr = "myCanvasId"; - printf("Canvas id: %s\n", canvasIdStr); fflush(stdout); - context = emscripten_webgl_create_context(canvasIdStr, &attrs); - printf("**OPENGL CONTEXT TEST Context: %d\n", context);fflush(stdout); -} diff --git a/src/mono/sample/wasm/browser-test-debug/index.html b/src/mono/sample/wasm/browser-test-debug/index.html deleted file mode 100644 index 1a060b6c815639..00000000000000 --- a/src/mono/sample/wasm/browser-test-debug/index.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - Wasm Browser Test Debug Sample - - - - - - - - - - - - - - Test has: - - - - diff --git a/src/mono/sample/wasm/browser-test-debug/main.js b/src/mono/sample/wasm/browser-test-debug/main.js deleted file mode 100644 index d334400c1df291..00000000000000 --- a/src/mono/sample/wasm/browser-test-debug/main.js +++ /dev/null @@ -1,115 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -import { dotnet, exit } from './dotnet.js' - -let testAbort = true; -let testError = true; -let Module; - -function setLogLevel(logLevel) { - - const runtimeApi = globalThis.getDotnetRuntime(0); - runtimeApi.INTERNAL.MH_SetLogVerbosity(logLevel); -} -function printGcLog(Module) { - try { - // List all files in the root directory - const files = Module.FS.readdir("/"); - // Find files matching gc_log.txt or gc_log.txt. - const gcLogPattern = /^gc_log\.txt(\.\d+)?$/; - const gcLogFile = files.find(f => gcLogPattern.test(f)); - if (gcLogFile) { - const contents = Module.FS.readFile(gcLogFile, { encoding: "utf8" }); - console.log(`=== ${gcLogFile} ===\n${contents}`); - } else { - console.log("gc_log.txt (with or without suffix) not found in Emscripten FS."); - } - } catch (e) { - console.error("Error reading gc_log.txt:", e); - } -} - -try { - dotnet - .withElementOnExit() - // 'withModuleConfig' is internal lower level API - // here we show how emscripten could be further configured - // It is preferred to use specific 'with***' methods instead in all other cases. - .withConfig({ - startupMemoryCache: true, - maxParallelDownloads: 1, - resources: { - modulesAfterConfigLoaded: { - "advanced-sample.lib.module.js": "" - } - } - }) - .withModuleConfig({ - configSrc: "./dotnet.boot.js", - onConfigLoaded: (config) => { - // This is called during emscripten `dotnet.wasm` instantiation, after we fetched config. - console.log('user code Module.onConfigLoaded'); - // config is loaded and could be tweaked before the rest of the runtime startup sequence - config.environmentVariables["MONO_LOG_LEVEL"] = "debug"; - config.environmentVariables["MONO_LOG_MASK"] = "gc"; - config.environmentVariables["MONO_GC_DEBUG"] = "8:gc_log.txt,print-gchandles,clear-nursery-at-gc"; - }, - preInit: () => { console.log('user code Module.preInit'); }, - preRun: () => { console.log('user code Module.preRun'); }, - onRuntimeInitialized: () => { - console.log('user code Module.onRuntimeInitialized'); - // here we could use API passed into this callback - // Module.FS.chdir("/"); - }, - onDotnetReady: () => { - // This is called after all assets are loaded. - console.log('user code Module.onDotnetReady'); - }, - postRun: () => { console.log('user code Module.postRun'); }, - out: (text) => { console.log("ADVANCED:" + text) }, - }) - .withResourceLoader((type, name, defaultUri, integrity, behavior) => { - // loadBootResource could return string with unqualified name of resource. It assumes that we resolve it with document.baseURI - return name; - }); - - await dotnet.download(); - - const { runtimeBuildInfo, setModuleImports, getAssemblyExports, runMain, getConfig, Module: localModule } = await dotnet.create(); - Module = localModule; - - globalThis.App = { - runtime: { - getAssemblyExports, - } - }; - - const config = getConfig(); - const exports = await getAssemblyExports(config.mainAssemblyName); - - document.getElementById("out").innerHTML = `NOT PASSED`; - console.clear(); - setLogLevel(5); - //await exports.Sample.Test.SetCurrentStackTrace_IncludedInExceptionStackTrace(); - await exports.Sample.Test.TestBool(); - //await exports.Sample.Test.DoTestMethod(); - //await exports.Sample.Test.TestGL(); - //await exports.Sample.Test.OffsetOf_NoSuchFieldName_ThrowsArgumentException(); - - //await exports.Sample.Test.TestBuffer(); - //await exports.Sample.Test.TestUint(); - //await exports.Sample.Test.TestMath(); - - setLogLevel(0); - document.getElementById("out").innerHTML = `PASSED`; - - - console.log('user code Module.onRuntimeInitialized'); - //printGcLog(Module); - exit(exit_code); -} -catch (err) { - //printGcLog(Module); - exit(2, err); -} diff --git a/src/mono/sample/wasm/browser-test-debug/wasmString.c b/src/mono/sample/wasm/browser-test-debug/wasmString.c deleted file mode 100644 index 54859de22afd8e..00000000000000 --- a/src/mono/sample/wasm/browser-test-debug/wasmString.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "wasmString.h" -#include - -void printString(char* someString) -{ - printf("C file got string: 0x%p: %s\n", someString, someString); - fflush(stdout); -} diff --git a/src/mono/sample/wasm/browser-test-debug/wasmString.h b/src/mono/sample/wasm/browser-test-debug/wasmString.h deleted file mode 100644 index bc791b4bc5bbc4..00000000000000 --- a/src/mono/sample/wasm/browser-test-debug/wasmString.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#ifdef STRING_DLL -# define API __declspec(dllexport) -#else -# define API -#endif - -#ifdef __cplusplus -extern "C" { -#endif - API void printString(char* someString); -#ifdef __cplusplus -} -#endif From 05836e7a6a35fbbba58f9446d6b62c28f8ba2423 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Fri, 7 Nov 2025 16:26:28 +0000 Subject: [PATCH 203/209] More tidying --- src/mono/sample/wasm/simple-server/Program.cs | 3 +-- src/native/external/brotli/CMakeLists.txt | 4 ++-- src/native/external/zlib-ng.cmake | 16 ++-------------- src/native/external/zlib-ng/CMakeLists.txt | 14 +------------- src/native/libs/CMakeLists.txt | 3 +-- .../System.Globalization.Native/CMakeLists.txt | 6 ++---- .../System.IO.Compression.Native/CMakeLists.txt | 3 +-- src/native/libs/System.Native/CMakeLists.txt | 3 +-- src/native/libs/build-native.cmd | 1 - src/native/libs/build-native.proj | 12 ++---------- 10 files changed, 13 insertions(+), 52 deletions(-) diff --git a/src/mono/sample/wasm/simple-server/Program.cs b/src/mono/sample/wasm/simple-server/Program.cs index 5a5cf48876923f..f39392a85a4763 100644 --- a/src/mono/sample/wasm/simple-server/Program.cs +++ b/src/mono/sample/wasm/simple-server/Program.cs @@ -94,8 +94,7 @@ public static int Main(string[] args) private bool StartServer() { - //var port = 8000 + Random.Shared.Next(1000); - var port = 8002; + var port = 8000 + Random.Shared.Next(1000); var listener = new HttpListener(); var url = $"http://localhost:{port}/"; listener.Prefixes.Add(url); diff --git a/src/native/external/brotli/CMakeLists.txt b/src/native/external/brotli/CMakeLists.txt index 43cc7b5c1e1b97..a053b224dd484f 100644 --- a/src/native/external/brotli/CMakeLists.txt +++ b/src/native/external/brotli/CMakeLists.txt @@ -33,10 +33,10 @@ else() endif() if (BROTLI_EMSCRIPTEN AND "${CMAKE_C_FLAGS}" MATCHES "MEMORY64") - message("MRH_LOGGING BROTLI: Building native BROTLI with MEMORY64") + message("BROTLI: Building native BROTLI with MEMORY64") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --target=wasm64") else() - message("MRH_LOGGING: BROTLI unable to set wasm64") + message("BROTLI: unable to set wasm64") endif() diff --git a/src/native/external/zlib-ng.cmake b/src/native/external/zlib-ng.cmake index e76590a0c41b7a..c818c939829ef7 100644 --- a/src/native/external/zlib-ng.cmake +++ b/src/native/external/zlib-ng.cmake @@ -2,15 +2,6 @@ include(FetchContent) -function(DUMP_CMAKE_VARIABLES) - message("MRH_LOGGING: DUMP_CMAKE_VARIABLES ZLIB-NG.CMAKE:") - get_cmake_property(_variableNames VARIABLES) - list (SORT _variableNames) - foreach (_variableName ${_variableNames}) - message(STATUS "${_variableName}=${${_variableName}}") - endforeach() -endfunction() - FetchContent_Declare( fetchzlibng SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/zlib-ng") @@ -39,13 +30,10 @@ if (CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) add_linker_flag(-pthread) endif() - if (CMAKE_USE_MEMORY64 OR USES_MEM64) - message(STATUS "MRH_LOGGING: setting MEMORY64 in zlib-ng.make") + if (CMAKE_USE_MEMORY64 OR USES_MEM64) add_definitions(-DMEMORY64) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMEMORY64") - add_compile_options(-DMEMORY64=1) - else() - DUMP_CMAKE_VARIABLES() + add_compile_options(-DMEMORY64=1) endif() endif() diff --git a/src/native/external/zlib-ng/CMakeLists.txt b/src/native/external/zlib-ng/CMakeLists.txt index 0366b0d8b8596f..aa37a86e359265 100644 --- a/src/native/external/zlib-ng/CMakeLists.txt +++ b/src/native/external/zlib-ng/CMakeLists.txt @@ -1185,20 +1185,8 @@ foreach(ZLIB_INSTALL_LIBRARY ${ZLIB_INSTALL_LIBRARIES}) "$") endforeach() -function(dump_cmake_variables) - get_cmake_property(_variableNames VARIABLES) - list (SORT _variableNames) - foreach (_variableName ${_variableNames}) - message(STATUS "${_variableName}=${${_variableName}}") - endforeach() -endfunction() - -if (EMSCRIPTEN AND "${CMAKE_C_FLAGS}" MATCHES "MEMORY64") - message("MRH_LOGGING: Building native ZLIB-NG with MEMORY64") +if (EMSCRIPTEN AND "${CMAKE_C_FLAGS}" MATCHES "MEMORY64") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --target=wasm64 -Wno-error") -else() - message("MRH_LOGGING: ZLIB-NG unable to set wasm64") - dump_cmake_variables() endif() if(WIN32) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index ad275a854d83cf..cd9add9b308eb2 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -122,8 +122,7 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) if (MONO_WASM_MT) add_definitions(-DMONO_WASM_MT) endif() - if (MEMORY64) - message(STATUS "MRH_LOGGING: setting MEMORY64 in CMakeLists.txt") + if (MEMORY64) add_definitions(-DMEMORY64) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMEMORY64") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --target=wasm64") diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 293ddb87a5e8ff..9aa54d327c767b 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -97,10 +97,8 @@ if (CMAKE_USE_PTHREADS) add_linker_flag(-pthread) endif() -if (CMAKE_USE_MEMORY64) - message("MRH_LOGGING: Building native libs with MEMORY64 enabled") - add_compile_options(--target=wasm64) - #set(NATIVEGLOBALIZATION_SOURCES ${NATIVEGLOBALIZATION_SOURCES} pal_icushim_stubs.c) +if (CMAKE_USE_MEMORY64) + add_compile_options(--target=wasm64) endif() #TODO: this should be conditional on invariant globalization set(NATIVEGLOBALIZATION_SOURCES ${NATIVEGLOBALIZATION_SOURCES} pal_icushim_stubs.c) diff --git a/src/native/libs/System.IO.Compression.Native/CMakeLists.txt b/src/native/libs/System.IO.Compression.Native/CMakeLists.txt index 84803de75bcfb1..29975adee79256 100644 --- a/src/native/libs/System.IO.Compression.Native/CMakeLists.txt +++ b/src/native/libs/System.IO.Compression.Native/CMakeLists.txt @@ -43,8 +43,7 @@ if (NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_WASI) ) endif () -if (CLR_CMAKE_TARGET_BROWSER AND CMAKE_USE_MEMORY64) - message("MRH_LOGGING: Building native compression libs with MEMORY64 enabled and Browser targeted") +if (CLR_CMAKE_TARGET_BROWSER AND CMAKE_USE_MEMORY64) add_compile_options(--target=wasm64) endif() diff --git a/src/native/libs/System.Native/CMakeLists.txt b/src/native/libs/System.Native/CMakeLists.txt index 68015f0ca66620..d4cfc71781449d 100644 --- a/src/native/libs/System.Native/CMakeLists.txt +++ b/src/native/libs/System.Native/CMakeLists.txt @@ -136,8 +136,7 @@ foreach(source_file ${NATIVE_SOURCES}) set_source_files_properties(${source_file} PROPERTIES LANGUAGE C) endforeach() -if (CMAKE_USE_MEMORY64) - message("MRH_LOGGING: Building native libs with MEMORY64 enabled") +if (CMAKE_USE_MEMORY64) add_compile_options(--target=wasm64) endif() diff --git a/src/native/libs/build-native.cmd b/src/native/libs/build-native.cmd index 37a413cfcac015..20cc7fd90420d4 100644 --- a/src/native/libs/build-native.cmd +++ b/src/native/libs/build-native.cmd @@ -83,7 +83,6 @@ set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_USE_PTHREADS=%__usePThreads if %__useMemory64% == 1 ( set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_USE_MEMORY64=1" - echo "MRH_LOGGING_CMD: set -DCMAKE_USE_MEMORY64, params now: !__ExtraCmakeParams!"" ) :: set __ExtraCmakeParams=%__ExtraCmakeParams% "-Wno-experimental" diff --git a/src/native/libs/build-native.proj b/src/native/libs/build-native.proj index b3ead3bbcd3d24..201daa6c5b12c4 100644 --- a/src/native/libs/build-native.proj +++ b/src/native/libs/build-native.proj @@ -17,9 +17,7 @@ <_UsePThreads Condition="'$(WasmEnableThreads)' == 'true'"> usepthreads <_IcuDir Condition="'$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)' != ''">$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)/runtimes/$(TargetOS)-$(TargetArchitecture)$(_RuntimeVariant)/native - <_IcuDirArg Condition="'$(_IcuDir)' != ''"> icudir "$(_IcuDir)" - - + <_IcuDirArg Condition="'$(_IcuDir)' != ''"> icudir "$(_IcuDir)" <_IcuDir Condition="'$(WasmEnableThreads)' == 'true'">"" <_BuildNativeArgs>$(_BuildNativeArgs)$(_IcuDirArg)$(_UsePThreads) @@ -104,13 +102,7 @@ <_MonoWasmMTCMakeArgs Condition="'$(CMakeArgs)' != ''"> $(_MonoWasmMTCMakeArgs) <_BuildNativeArgs Condition="'$(CMakeArgs)' != '' or '$(_MonoWasmMTCMakeArgs)' != ''">$(_BuildNativeArgs) -cmakeargs "$(CMakeArgs)$(_MonoWasmMTCMakeArgs)" - - - - - - - + From 3b98f8d5f7e65dd0fe05170792c04b2618651752 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 10 Nov 2025 11:16:24 +0000 Subject: [PATCH 204/209] Tidying --- src/mono/mono/mini/interp/interp-icalls.c | 7 +------ src/mono/sample/wasm/Directory.Build.targets | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/mono/mono/mini/interp/interp-icalls.c b/src/mono/mono/mini/interp/interp-icalls.c index 8279c684e900af..6f3115fef8255c 100644 --- a/src/mono/mono/mini/interp/interp-icalls.c +++ b/src/mono/mono/mini/interp/interp-icalls.c @@ -90,9 +90,7 @@ is_scalar_vtype (MonoType *type) } void stackval_from_data (MonoType *type, stackval *result, const void *data, gboolean pinvoke) -{ - intptr_t data_ptr = *(intptr_t *)data; - +{ // memset(result, 0, sizeof(stackval)); if (m_type_is_byref (type)) { result->data.p = *(gpointer*)data; @@ -330,10 +328,7 @@ do_icall (MonoMethodSignature *sig, MintICallSig op, stackval *ret_sp, stackval } case MINT_ICALLSIG_88_8: { typedef I8(*T)(I8, I8); - if (!ptr) - T func = (T)ptr; - if (!func) ret_sp->data.p = func(sp[0].data.p, sp[1].data.p); break; } diff --git a/src/mono/sample/wasm/Directory.Build.targets b/src/mono/sample/wasm/Directory.Build.targets index ab8a87e043d73d..548a6ce828c8d0 100644 --- a/src/mono/sample/wasm/Directory.Build.targets +++ b/src/mono/sample/wasm/Directory.Build.targets @@ -86,7 +86,7 @@ - + From cfc521c5c82ffb2a693eac183a65606aef91251d Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 10 Nov 2025 13:20:43 +0000 Subject: [PATCH 205/209] Fix BigInt issues raised by http tests --- src/mono/browser/runtime/web-socket.ts | 44 +++++++++++++++----------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/src/mono/browser/runtime/web-socket.ts b/src/mono/browser/runtime/web-socket.ts index b328943ceaa6de..245beb54a3e8c8 100644 --- a/src/mono/browser/runtime/web-socket.ts +++ b/src/mono/browser/runtime/web-socket.ts @@ -13,6 +13,7 @@ import { mono_log_warn } from "./logging"; import { viewOrCopy, utf8ToStringRelaxed, stringToUTF8 } from "./strings"; import { wrap_as_cancelable } from "./cancelable-promise"; import { assert_js_interop } from "./invoke-js"; +import { normalizePointer } from "./marshal"; const wasm_ws_pending_send_buffer = Symbol.for("wasm ws_pending_send_buffer"); const wasm_ws_pending_send_buffer_offset = Symbol.for("wasm ws_pending_send_buffer_offset"); @@ -31,7 +32,6 @@ const wasm_ws_receive_status_ptr = Symbol.for("wasm ws_receive_status_ptr"); const ws_send_buffer_blocking_threshold = 65536; const emptyBuffer = new Uint8Array(); - function verifyEnvironment () { if (ENVIRONMENT_IS_SHELL) { throw new Error("WebSockets are not supported in shell JS engine."); @@ -118,9 +118,10 @@ export function ws_wasm_create (uri: string, sub_protocols: string[] | null, rec // send close to any pending receivers, to wake them const receive_promise_queue = ws[wasm_ws_pending_receive_promise_queue]; receive_promise_queue.drain((receive_promise_control) => { - setI32(receive_status_ptr, 0); // count - setI32(receive_status_ptr + 4, 2); // type:close - setI32(receive_status_ptr + 8, 1);// end_of_message: true + const normalized_response_ptr = normalizePointer(receive_status_ptr); + setI32(normalized_response_ptr, 0); // count + setI32(normalized_response_ptr + 4, 2); // type:close + setI32(normalized_response_ptr + 8, 1);// end_of_message: true receive_promise_control.resolve(); }); } catch (error: any) { @@ -168,7 +169,7 @@ export function ws_wasm_open (ws: WebSocketExtension): Promise | null { +export function ws_wasm_send (ws: WebSocketExtension, buffer_ptr: VoidPtr | bigint, buffer_length: number, message_type: number, end_of_message: boolean): Promise | null { mono_assert(!!ws, "ERR17: expected ws instance"); if (ws[wasm_ws_pending_error]) { @@ -183,7 +184,7 @@ export function ws_wasm_send (ws: WebSocketExtension, buffer_ptr: VoidPtr, buffe return resolvedPromise(); } - const buffer_view = new Uint8Array(localHeapViewU8().buffer, buffer_ptr, buffer_length); + const buffer_view = new Uint8Array(localHeapViewU8().buffer, normalizePointer(buffer_ptr), buffer_length); const whole_buffer = web_socket_send_buffering(ws, buffer_view, message_type, end_of_message); if (!end_of_message || !whole_buffer) { @@ -193,8 +194,9 @@ export function ws_wasm_send (ws: WebSocketExtension, buffer_ptr: VoidPtr, buffe return web_socket_send_and_wait(ws, whole_buffer); } -export function ws_wasm_receive (ws: WebSocketExtension, buffer_ptr: VoidPtr, buffer_length: number): Promise | null { +export function ws_wasm_receive (ws: WebSocketExtension, buffer_ptr: VoidPtr | bigint, buffer_length: number): Promise | null { mono_assert(!!ws, "ERR18: expected ws instance"); + const normalized_buffer_ptr = normalizePointer(buffer_ptr); if (ws[wasm_ws_pending_error]) { return rejectedPromise(ws[wasm_ws_pending_error]); @@ -203,9 +205,10 @@ export function ws_wasm_receive (ws: WebSocketExtension, buffer_ptr: VoidPtr, bu // we can't quickly return if wasm_ws_close_received==true, because there could be pending messages if (ws[wasm_ws_is_aborted]) { const receive_status_ptr = ws[wasm_ws_receive_status_ptr]; - setI32(receive_status_ptr, 0); // count - setI32(receive_status_ptr + 4, 2); // type:close - setI32(receive_status_ptr + 8, 1);// end_of_message: true + const normalized_response_ptr = normalizePointer(receive_status_ptr); + setI32(normalized_response_ptr, 0); // count + setI32(normalized_response_ptr + 4, 2); // type:close + setI32(normalized_response_ptr + 8, 1);// end_of_message: true return resolvedPromise(); } @@ -215,22 +218,23 @@ export function ws_wasm_receive (ws: WebSocketExtension, buffer_ptr: VoidPtr, bu if (receive_event_queue.getLength()) { mono_assert(receive_promise_queue.getLength() == 0, "ERR20: Invalid WS state"); - web_socket_receive_buffering(ws, receive_event_queue, buffer_ptr, buffer_length); + web_socket_receive_buffering(ws, receive_event_queue, normalized_buffer_ptr, buffer_length); return resolvedPromise(); } if (ws[wasm_ws_close_received]) { const receive_status_ptr = ws[wasm_ws_receive_status_ptr]; - setI32(receive_status_ptr, 0); // count - setI32(receive_status_ptr + 4, 2); // type:close - setI32(receive_status_ptr + 8, 1);// end_of_message: true + const normalized_response_ptr = normalizePointer(receive_status_ptr); + setI32(normalized_response_ptr, 0); // count + setI32(normalized_response_ptr + 4, 2); // type:close + setI32(normalized_response_ptr + 8, 1);// end_of_message: true return resolvedPromise(); } const { promise, promise_control } = createPromiseController(); const receive_promise_control = promise_control as ReceivePromiseControl; - receive_promise_control.buffer_ptr = buffer_ptr; + receive_promise_control.buffer_ptr = normalized_buffer_ptr; receive_promise_control.buffer_length = buffer_length; receive_promise_queue.enqueue(receive_promise_control); @@ -400,7 +404,8 @@ function web_socket_receive_buffering (ws: WebSocketExtension, event_queue: Queu const count = Math.min(buffer_length, event.data.length - event.offset); if (count > 0) { const sourceView = event.data.subarray(event.offset, event.offset + count); - const bufferView = new Uint8Array(localHeapViewU8().buffer, buffer_ptr, buffer_length); + const normalized_ptr = normalizePointer(buffer_ptr); + const bufferView = new Uint8Array(localHeapViewU8().buffer, normalized_ptr, buffer_length); bufferView.set(sourceView, 0); event.offset += count; } @@ -409,9 +414,10 @@ function web_socket_receive_buffering (ws: WebSocketExtension, event_queue: Queu event_queue.dequeue(); } const response_ptr = ws[wasm_ws_receive_status_ptr]; - setI32(response_ptr, count); - setI32(response_ptr + 4, event.type); - setI32(response_ptr + 8, end_of_message); + const normalized_response_ptr = normalizePointer(response_ptr); + setI32(normalized_response_ptr, count); + setI32(normalized_response_ptr + 4, event.type); + setI32(normalized_response_ptr + 8, end_of_message); } function web_socket_send_buffering (ws: WebSocketExtension, buffer_view: Uint8Array, message_type: number, end_of_message: boolean): Uint8Array | string | null { From d62e0ae46b451c2044348e7992e85f580905d629 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 10 Nov 2025 14:10:03 +0000 Subject: [PATCH 206/209] Update init-vs-env for 2026 --- eng/native/init-vs-env.cmd | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eng/native/init-vs-env.cmd b/eng/native/init-vs-env.cmd index 0d28cac9893be3..a6789ffa136313 100644 --- a/eng/native/init-vs-env.cmd +++ b/eng/native/init-vs-env.cmd @@ -58,6 +58,11 @@ if "%VisualStudioVersion%"=="17.0" ( set __PlatformToolset=v143 goto :SetVCEnvironment ) +if "%VisualStudioVersion%"=="18.0" ( + set __VSVersion=vs2026 + set __PlatformToolset=v143 + goto :SetVCEnvironment +) :VSMissing echo %__MsgPrefix%Error: Visual Studio 2022 with C++ tools required. ^ From 4f0fcd356cea90e06329ee3acf65b1529ff0d729 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 10 Nov 2025 15:16:10 +0000 Subject: [PATCH 207/209] Tidying --- .../src/System/Globalization/Ordinal.Utf8.cs | 2 -- .../src/System/Threading/Lock.NonNativeAot.cs | 9 +-------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/Ordinal.Utf8.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/Ordinal.Utf8.cs index b1bbac2e80fb6f..1d715f72ace4c5 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/Ordinal.Utf8.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/Ordinal.Utf8.cs @@ -210,8 +210,6 @@ internal static bool EqualsIgnoreCaseUtf8_Scalar(ref byte charA, int lengthA, re byteOffset += 8; length -= 8; } -#else - #error TARGET_64BIT is not defined #endif uint valueAu32 = 0; diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.NonNativeAot.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.NonNativeAot.cs index a7d659ab704e45..22764ce90642c3 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.NonNativeAot.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.NonNativeAot.cs @@ -47,14 +47,7 @@ internal partial struct ThreadId public bool IsInitialized => _id != 0; public static ThreadId Current_NoInitialize => new ThreadId(t_threadId); - - public static uint GetCurrentOSThreadIdForTest() - { - var threadId = new ThreadId(0); - threadId.InitializeForCurrentThread(); - return threadId.Id; - } - + public void InitializeForCurrentThread() { Debug.Assert(!IsInitialized); From 16f89a6ee27bce55138d106c7ee3907990a3138b Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 10 Nov 2025 15:18:12 +0000 Subject: [PATCH 208/209] Restoring struct location in file --- .../src/Mono/RuntimeStructs.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/mono/System.Private.CoreLib/src/Mono/RuntimeStructs.cs b/src/mono/System.Private.CoreLib/src/Mono/RuntimeStructs.cs index 6aeb66e2c0499e..ee13318dfb21bf 100644 --- a/src/mono/System.Private.CoreLib/src/Mono/RuntimeStructs.cs +++ b/src/mono/System.Private.CoreLib/src/Mono/RuntimeStructs.cs @@ -21,15 +21,7 @@ namespace Mono // Managed representations of mono runtime types // internal static class RuntimeStructs - { - // glib.h GPtrArray - [StructLayout(LayoutKind.Sequential, Pack = 8)] - internal unsafe struct GPtrArray - { - internal IntPtr* data; - internal int len; - internal int padding; - } + { // class-internals.h MonoRemoteClass [StructLayout(LayoutKind.Sequential)] internal unsafe struct RemoteClass @@ -56,6 +48,15 @@ internal unsafe struct GenericParamInfo internal uint token; internal MonoClass** constraints; /* NULL terminated */ } + + // glib.h GPtrArray + [StructLayout(LayoutKind.Sequential, Pack = 8)] + internal unsafe struct GPtrArray + { + internal IntPtr* data; + internal int len; + internal int padding; + } } //Maps to metadata-internals.h:: MonoAssemblyName From d6620757d976b5a0e93a582145039baf0eedde99 Mon Sep 17 00:00:00 2001 From: Mike Hudson Date: Mon, 10 Nov 2025 15:34:05 +0000 Subject: [PATCH 209/209] Remove logging --- src/mono/browser/runtime/strings.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/mono/browser/runtime/strings.ts b/src/mono/browser/runtime/strings.ts index e3430c2f7c307e..859d139adae3eb 100644 --- a/src/mono/browser/runtime/strings.ts +++ b/src/mono/browser/runtime/strings.ts @@ -10,7 +10,6 @@ import cwraps from "./cwraps"; import { isSharedArrayBuffer, localHeapViewU8, getU32_local, setU16_local, localHeapViewU32, getU16_local, localHeapViewU16, _zero_region, malloc, free } from "./memory"; import { NativePointer, CharPtr, VoidPtr } from "./types/emscripten"; import { safeBigIntToNumber } from "./invoke-js"; -import { mono_log_debug } from "./logging"; export const interned_js_string_table = new Map(); export const mono_wasm_empty_string = ""; @@ -62,11 +61,9 @@ export function stringToUTF8Ptr (str: string): CharPtr { export function utf8ToStringRelaxed (buffer: Uint8Array): string { if (_text_decoder_utf8_relaxed === undefined) { const retval = Module.UTF8ArrayToString(buffer, 0, buffer.byteLength); - mono_log_debug("utf8ToStringRelaxed: UTF8ArrayToString got " + retval); return retval; } const retval = _text_decoder_utf8_relaxed.decode(buffer); - mono_log_debug("utf8ToStringRelaxed: _text_decoder_utf8_relaxed.decode got " + retval); return retval; } @@ -92,19 +89,13 @@ export function utf8BufferToString (heapOrArray: Uint8Array, idx: number, maxByt let endPtr = idx; while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr; if (endPtr - idx <= 16) { - const retval = Module.UTF8ArrayToString(heapOrArray, idx, maxBytesToRead); - mono_log_debug("utf8BufferToString: Module.UTF8ArrayToStrin got " + retval); - return retval; + return Module.UTF8ArrayToString(heapOrArray, idx, maxBytesToRead); } if (_text_decoder_utf8_validating === undefined) { - const retval = Module.UTF8ArrayToString(heapOrArray, idx, maxBytesToRead); - mono_log_debug("utf8BufferToString: Module.UTF8ArrayToString got " + retval); - return retval; + return Module.UTF8ArrayToString(heapOrArray, idx, maxBytesToRead); } const view = viewOrCopy(heapOrArray, idx as any, endPtr as any); - const retval = _text_decoder_utf8_validating.decode(view); - mono_log_debug("utf8BufferToString: _text_decoder_utf8_validating.decode got " + retval); - return retval; + return _text_decoder_utf8_validating.decode(view); } export function utf16ToString (startPtr: number, endPtr: number): string {