1. 17 11月, 2021 5 次提交
    • P
      [wasm] renames and cleanup before modularization (#61596) · da0e0f73
      Pavel Savara 提交于
      - no imports from outer scope
      - move dotnet to -extern-pre-js
      - re-enable JS minification with ES2018
      - rename main javaScript files to main.js and test-main.js
      - sample and test script cleanup
      - rename set_exit_code method
      - rewrite test start as async method
      - improve script loading via script element on page in test
      - use BINDING.bind_static_method instead of INTERNAL where possible
      - better .d.ts exports
      - formatted html files
      - renamed modules.ts to imports.ts which makes more sense
      - improved error propagation
      - renamed __initializeImportsAndExports
      - delayed exit and stdout flush
      da0e0f73
    • A
      Update WASM README.md (#61681) · 0749730d
      Aaron Robinson 提交于
      * Update WASM README.md
      0749730d
    • T
      [wasm][debugger] View multidimensional array when debugging (#60983) · 293e5ed2
      Thays Grazia 提交于
      * It's working when debug from chrome but not when debug from VS, because it uses callFunctionOn
      
      * Remove unrelated change.
      
      * Working also on VS.
      
      * Working also on VS.
      
      * Addressing @lewing and @radical comments
      
      * Change ArrayDimensions to be a record and not a class as suggested by @radical.
      
      * Addressing @radical comments.
      293e5ed2
    • T
      [wasm][debugger] Improvement of memory consumption while Evaluating Expressions (#61470) · 7b74a7e7
      Thays Grazia 提交于
      * Fix memory consumption.
      
      * Fix debugger-tests
      
      * Fix compilation.
      
      * Addressing @lewing PR.
      
      * Address @lewing comment
      
      * Addressing @radical comment.
      
      * Addressing comments.
      
      * Addressing @radical comments.
      
      * missing return.
      
      * Addressing @radical comments
      
      * Adding test case
      Co-authored-by: NLarry Ewing <lewing@microsoft.com>
      
      * Fixing tests.
      
      * Adding another test case. Thanks @lewing.
      
      * Reuse the script.
      Co-authored-by: NLarry Ewing <lewing@microsoft.com>
      7b74a7e7
    • L
      [wasm] Rework fetch (#61639) · 2b1f420c
      Larry Ewing 提交于
      * Unify some code and load mono-config.json using our _fetch_asset
      2b1f420c
  2. 16 11月, 2021 1 次提交
  3. 14 11月, 2021 3 次提交
  4. 13 11月, 2021 2 次提交
  5. 12 11月, 2021 1 次提交
    • R
      [wasm] Add AppStart task to the bench Sample (#61481) · 35704e44
      Radek Doulik 提交于
      Measure browser app start times, 2 measurements implemented.
      
      First to measure till the JS window.pageshow event, second to measure
      time when we reach managed C# code.
      
      Example ouput:
      
          | measurement | time |
          |-:|-:|
          |                    AppStart, Page show |   108.1400ms |
          |                AppStart, Reach managed |   240.2174ms |
      35704e44
  6. 11 11月, 2021 6 次提交
  7. 10 11月, 2021 1 次提交
    • K
      Change WASM direct heap access to use helper functions (#61355) · 3dce93ba
      Katelyn Gadd 提交于
      Direct heap writes via Module.HEAPxx[y] = func(...) are incorrect because the left-hand side (according to spec) is evaluated before the right, so if evaluating func(...) causes the heap to grow, the assignment target becomes a detached buffer and the write goes nowhere, breaking your application. This PR introduces a new set of helper functions for memory reads and writes.
      3dce93ba
  8. 09 11月, 2021 1 次提交
  9. 08 11月, 2021 2 次提交
    • R
      [wasm] Add console version of browser-bench sample (#60733) · a8ac67ae
      Radek Doulik 提交于
      * [wasm] Add console version of browser-bench sample
      
      Example run:
      
          > v8 --expose_wasm runtime.js --  --run  Wasm.Console.Bench.Sample.dll -t Json:non,Exceptions:Inline
          console.info: Arguments: --run,Wasm.Console.Bench.Sample.dll,-t,Json:non,Exceptions:Inline
          console.debug: MONO_WASM: Initializing mono runtime
          console.debug: MONO_WASM: ICU data archive(s) loaded, disabling invariant mode
          console.debug: mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28
          console.info: Initializing.....
          Benchmark started
          Json, non-ASCII text serialize count: 23, per call: 7.565217391304348ms, total: 0.174s
          ...
          Exceptions, TryCatchFilterInline count: 1766666, per call: 4.301888415806949E-05ms, total: 0.076s
          
          Summary
          Json, non-ASCII text serialize: 7.478260869565218ms
          Json, non-ASCII text deserialize: 10.789473684210526ms
          Exceptions, TryCatchFilterInline: 4.301888415806949E-05ms
          
          .md
          | measurement | time |
          |-:|-:|
          |         Json, non-ASCII text serialize |     7.4783ms |
          |       Json, non-ASCII text deserialize |    10.7895ms |
          |       Exceptions, TryCatchFilterInline |     0.0430us |
      
      * Don't generate v8 script for browser project
      
      * Fix option set
      
      * Changes for linux/mac
      
      * Add link to bench sample README
      
      * Pass ARGS to the console version
      
      Add info about filtering and options to the README
      
      * Show how the table will looks like
      
      * Do not sign the assembly
      
      To avoid
      
          CSC : error CS8002: Referenced assembly 'Mono.Options, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null' does not have a strong name.
      
      * Add examples how to run it on windows
      
      * Fix interpolated string
      
      * Improve formatting
      
      * Remove unwanted space
      a8ac67ae
    • V
      [mono][interp] Implement tailcalls (#59799) · 70dd2db7
      Vlad Brezae 提交于
      * [interp] Fix opcode dump
      
      * [interp] Implement tailcalls
      
      Before this commit we supported tailcalls only for calls to the same method. Tailcalls are implemented by copying the call arguments to the start of the stack space, followed by replacing of the current executing method.
      
      * Re-enable test
      70dd2db7
  10. 05 11月, 2021 2 次提交
  11. 04 11月, 2021 1 次提交
  12. 03 11月, 2021 7 次提交
    • I
      [wasm][debugger]Add hidden attribute support (#61143) · 39f34708
      Ilona Tomkowicz 提交于
      * Draft of hidden attribute decorator use.
      
      * Removed checking custom attributes in the runtime each time the breakpoint is set and moved it to the constructor which is more efficient.
      
      * Added test for DebuggerHidden decorator.
      
      * By adding a line: using System.Diagnostics; IntAdd method moved down one line what resulted in CreateGoodBreakpoint tests failures. All row numbers in these tests had to be incremented.
      
      * Reverted edition of tests not connected with HiddenAttribute.
      
      * Added visible method to the HiddenAttribute test.
      
      * Applying thaystg review suggestion.
      39f34708
    • R
      Allow nfloat to be in the ObjCRuntime namespace, and make it work for... · 1486f667
      Rolf Bjarne Kvinge 提交于
      Allow nfloat to be in the ObjCRuntime namespace, and make it work for Xamarin.MacCatalyst.dll as well. (#60854)
      
      Ref: https://github.com/xamarin/xamarin-macios/pull/13092
      Ref: https://github.com/mono/mono/pull/21261
      1486f667
    • A
      Skip sys/sysctl.h on linux in mono (#61110) · 6aaee162
      Adeel Mujahid 提交于
      Fixes three warnings:
      ```sh
        [ 56%] Building C object mono/mini/CMakeFiles/monosgen-objects.dir/__/utils/mono-mmap.c.o
        In file included from /runtime/src/mono/mono/utils/mono-mmap.c:23:
        /usr/include/x86_64-linux-gnu/sys/sysctl.h:21:2: warning: #warning "The <sys/sysctl.h> header is deprecated and will be removed." [-Wcpp]
           21 | #warning "The <sys/sysctl.h> header is deprecated and will be removed."
              |  ^~~~~~~
      # snip
        [ 59%] Building C object mono/mini/CMakeFiles/monosgen-objects.dir/__/utils/mono-time.c.o
        In file included from /runtime/src/mono/mono/utils/mono-proclib.c:42:
        /usr/include/x86_64-linux-gnu/sys/sysctl.h:21:2: warning: #warning "The <sys/sysctl.h> header is deprecated and will be removed." [-Wcpp]
           21 | #warning "The <sys/sysctl.h> header is deprecated and will be removed."
              |  ^~~~~~~
        [ 59%] Building C object mono/mini/CMakeFiles/monosgen-objects.dir/__/utils/mono-uri.c.o
        [ 59%] Building C object mono/mini/CMakeFiles/monosgen-objects.dir/__/utils/mono-poll.c.o
        In file included from /runtime/src/mono/mono/utils/mono-time.c:107:
        /usr/include/x86_64-linux-gnu/sys/sysctl.h:21:2: warning: #warning "The <sys/sysctl.h> header is deprecated and will be removed." [-Wcpp]
           21 | #warning "The <sys/sysctl.h> header is deprecated and will be removed."
              |  ^~~~~~~
      ```
      
      With this PR: 0 warnings - http://sprunge.us/96kyq9
      
      Like in src/libraries/Native, skip linux from sys/sysctl.h check. For other systems, `check_include_files` (instead of `check_include_file` (singular)) when a header depends on another one.
       
      Also, simplified few conditions: "is linux" check supersedes "is android".
      6aaee162
    • P
      [wasm] simplify startup configuration (#61072) · 39503818
      Pavel Savara 提交于
      * added configSrc - path to MonoConfig json file
      * added Module.onConfigLoaded callback
      * added Module.onDotNetReady replacing MonoConfig.loaded_cb
      * removed loaded_cb, assembly_list, runtime_assets, runtime_asset_sources from MonoConfig
      * simplified all sample and test projects
      * renamed no_global_exports to disableDotNet6Compatibility
      * implement default Module.preInit and Module.onRuntimeInitialized which could be overriden by user code (like Blazor)
      
      * re-enable the interp lane
      39503818
    • J
      24e7a4a1
    • B
      Fix: Incorrect order of checks for TypeBuilder `GetConstructor` and `GetField` method (#53645) · f981785e
      Bartosz Klonowski 提交于
      * Reorder checks for TypeBuilder.GetConstructor()
      
      * Reorder checks for TypeBuilder.GetField()
      
      * Adjust unit test to reordered TypeBuilder checks
      
      * Use 'not' keyword for pattern matching
      
      * Apply the same Type checks for Mono
      
      GetConstructor and GetField had the same incorrect checks order
      comparing to GetMethod as in the CoreCLR.
      To keep the consistent solution, Mono has also been adjusted.
      
      * Check whether a declaring type isn't type's generic definition
      
      * Make generic type if contains generic parameters
      
      * Suppres UnrecognizedReflectionPattern for GetField and GetConstructor
      
      * Move GetMethodType validation method at original order
      
      * Test GetConstructor against throwing an exception
      
      * Fix: copy-paste error  'type' -> 'constructor'
      
      * Align Mono and CoreCLR with nameof for GetConstructor
      
      * Use type for argument exception and test against type parameter
      
      * Get tests passing on both coreclr and mono.
      
      Ensure checks are consistent across GetConstructor, GetField, and GetMethod for both coreclr and mono.
      
      * Fix mono exception messages to use SR resources.
      Co-authored-by: NEric Erhardt <eric.erhardt@microsoft.com>
      f981785e
    • A
      [wasm] Re-enable source generator tests failing due to OOM (#60701) · 5a078b51
      Ankit Jain 提交于
      This adds support for setting per-project optimization flags, and sets them for these projects so they don't OOM.
      
      Microsoft.Extensions.Logging.Generators.Roslyn3.11.Tests
      Microsoft.Extensions.Logging.Generators.Roslyn4.0.Tests
      System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests
      System.Text.Json.SourceGeneration.Roslyn4.0.Unit.Tests
      System.Text.RegularExpressions.Generators.Tests
      Some individual ones are disabled due to
      #58226, and #60899 .
      
      Additionally, if a AOT build fails, then on linux it dumps the last few lines from dmesg, to help identify it was an oom-kill.
      
      Fixes #51961 .
      Co-authored-by: NLarry Ewing <lewing@microsoft.com>
      5a078b51
  13. 02 11月, 2021 3 次提交
  14. 01 11月, 2021 2 次提交
    • I
      Fix for #60340 (#60863) · 1711db7d
      Ilona Tomkowicz 提交于
      * Fix for #60340
      
      * Fixes element access for a constant index.
      
      * Undo changes made based on https://github.com/dotnet/runtime/pull/60873, that were not intended to be commited.
      
      * Removed whitespaces.
      
      * Fixed element access by local variables, added tests for element access by object member variables.
      
      * Element access by indexing with simple object members is fixed.
      
      * Nested element access is fixed, e.g. a[a[a[0]]].
      
      * Added tests for nested element access. Reverted an unintentional change in EvaluateSimpleMethodCallsCheckChangedValue test.
      
      * Change test name to enable running test batch on calling ".EvaluateExpressionsWithElementAccess" prefix.
      
      * Fix ElementAccessByMemberVariables that was failing after previous changes.
      
      * Removed unused namespace import. Regexes are not needed in the new approach.
      
      * Added implementatio of evaluation for multidimentional indexing.
      1711db7d
    • T
      [wasm][debugger] Fix debugging blazor app after ts changes. (#60873) · a5eaceeb
      Thays Grazia 提交于
      * remove runtimeHelpers.loaded_files and repace it with MONO.loaded_files
      * disable too aggressive Terser minification
      * keep some function names un-mangled for stack walk in debugger implementation
      Co-authored-by: NThays <thaystg@gmail.com>
      Co-authored-by: Npavelsavara <pavel.savara@gmail.com>
      a5eaceeb
  15. 30 10月, 2021 1 次提交
  16. 29 10月, 2021 2 次提交
    • P
      [wasm] preparation for module encapsulation (#60928) · 76e68dbe
      Pavel Savara 提交于
      - simplified fetch and script loading logic/polyfil
      - clarified runtime-test.js based on Daniel's draft.
      - extracted mono_wasm_invoke_js and mono_wasm_compile_function out of C macro into proper .ts function
      - wrapped access to API via globalThis with warning on first use
      - added cwraps.mono_wasm_add_assembly and cwraps.mono_wasm_load_runtime which Blazor uses
      - fixed closures for generated functions, so that they don't use global Module reference
      - mono_wasm_invoke_js now uses new Function instead of eval()
      - removed deprecated Blazor functions
      - fixed lint issues
      Co-authored-by: NDaniel Genkin <genkind@gmail.com>
      76e68dbe
    • L
      [mono][workload] Work around a msbuild bug in MatchOnMetadata (#60989) · d7c96e86
      Larry Ewing 提交于
      * Work around a msbuild bug in MatchOnMetadata
      
      * Reenable workload build tests and bump to a 7.0.100 sdk version
      d7c96e86