1. 02 3月, 2022 5 次提交
    • M
      Improve nullability for TypeConverter.CanConvertTo (#63874) · ac246b17
      Michael Ketting 提交于
      The nullability of parameter 'destinationType' in
      TypeConverter.CanConvertTo(...) was changed from
      not-nullable to nullable during the development of .NET 6.
      
      Since a destination type supported by this TypeConverter
      can never be null, a NotNullWhenAttribute is added to the
      'destinationType' parameter when the result value of
      TypeConverter.CanConvertTo(...) is 'true'.
      
      Fix #63186
      ac246b17
    • B
      Fix libraries GCStress pipeline (#65924) · 79026a54
      Bruce Forstall 提交于
      * Remove reference to deleted setup-stress-dependencies.cmd/sh
      
      Automatically download and copy coredistools.dll to the libraries testhost.
      
      * Remove reference to setup-stress-dependencies.cmd/sh scripts
      
      This is in the libraries gcstress pipeline.
      
      It is no longer necessary.
      
      * Set a huge timeout for GCStress
      79026a54
    • L
      Native aot trim annotations experiment (#65816) · dfe08b3b
      Lakshan Fernando 提交于
      * Add nativeaot trim annotations experiment
      
      * Fix mono libraries
      
      * Update src/libraries/System.Reflection.Emit.Lightweight/ref/System.Reflection.Emit.Lightweight.cs
      Co-authored-by: NEric Erhardt <eric.erhardt@microsoft.com>
      
      * FB on attribute message
      
      * FB
      
      * missed nativeaot message change
      Co-authored-by: NEric Erhardt <eric.erhardt@microsoft.com>
      dfe08b3b
    • A
      [wasm] Fix a race condition in adding payloads for helix (#65995) · 1665aca8
      Ankit Jain 提交于
      * [wasm] Fix a race condition in adding payloads for helix
      
      The issue shows up only in Wasm.Build.Tests for the
      `TestUsingWorkloads!=true` case, as `clang --version` failing with:
      
      ```
      /datadisks/disk1/work/A0100914/p/build/emsdk/upstream/bin/clang: error while loading shared libraries: libLLVM-13git.so: cannot open shared object file: No such file or directory (TaskId:231)
      ```
      
      For this non-workloads testing case, we copy `emscripten` from the
      system copy to the git checkout. And then use that directory for the
      payload.
      
      The build logs show that the missing file (`libLLVM-13git.so`) does get
      copied as part of copying `/usr/local/emscripten/emsdk` to
      `$(RepoRoot)/src/mono/wasm/emsdk`. But the file, and a few others seem
      to be missing in the final helix payload.
      
      We add `emsdk` to the payload for target path `build/emsdk`.
      
      But a recent change also added `node` for this case with a target path
      `build/emsdk/node`, with an overlapping path with `build/emsdk`. I
      believe this is causing an issue where these directories are being
      processed in parallel, and cause some files get missed.
      
      This commit:
      
      1. Add `node` only when needed (skip WBT for example);
      2. Use a non-overlapping path for `node`, `build/emsdk-node`.
      
      Fixes https://github.com/dotnet/runtime/issues/65956
      
      * Change `_HelixLocalNodePath` evaluation order
      Co-authored-by: NRadek Doulik <radekdoulik@gmail.com>
      1665aca8
    • P
      Optimize clear_brick_table. (#65837) · 02e46674
      Peter Sollich 提交于
      I observed that the inlined call to clear_brick_table in clear_region_info took more CPU samples than necessary - it's about 7x faster to call memset than it is to code a straighforward loop.
      02e46674
  2. 01 3月, 2022 13 次提交
    • A
      add missing GC.SuppressFinalize(this) to FileStream.DisposeAsync (#65899) · 3cbed4b7
      Adam Sitnik 提交于
      * add missing GC.SuppressFinalize(this) to FileStream.DisposeAsync
      
      * DerivedFileStreamStrategy.DisposeAsync does not need to call _fileStream.BaseDisposeAsync, as FileStream.DisposeAsync calls Dispose(false) now
      3cbed4b7
    • E
      Make ObjectConverter use ConverterStrategy.Object (#65748) · 097d9ea3
      Eirik Tsarpalis 提交于
      * Use ConvereterStrategy.Object in ObjectConverter
      
      * address feedback
      097d9ea3
    • S
      Fix name of regex unit tests project (#65990) · a9823592
      Stephen Toub 提交于
      a9823592
    • Z
      [mono][wasm] Allow AOTing methods with catch/filter clauses. (#64867) · 783e260c
      Zoltan Varga 提交于
      * [mono][wasm] Allow AOTing methods with catch clauses.
      
      This works as follows:
      * During EH, when a catch clause is found in an AOTed method, the
        EH state is saved into TLS and a c++ exception is thrown.
      * The C++ exception is caught by the AOTed method, and the landing
        pad code calls mono_llvm_resume_exception_il_state ().
      * That call will run the catch clause and the rest of the method
        code using the interpreter, storing the possible return value
        back into the AOTed method's stack frame.
      * After the call, the method skips the rest of its code, and
        returns immediately to its caller.
      
      * Fix console bench sample.
      
      * Fix landing pads.
      
      * Fix issues.
      
      * Add support for filter clauses.
      
      * Implement all wasm return conventions.
      
      * Fix arg/local write back.
      
      * Avoid throwing a c++ exception from do_jit_call () so the caller can clean up the interpreter stack.
      
      * Disable AOTing some more assemblies on CI.
      
      * Rename llvmonly EH functions to mini_llvmonly_ for clarity.
      
      * Improve unwinding through interpreter frames.
      
      Instead of throwing a c++ exception from mono_handle_exception ()
      when an exception is caught in AOTed code, set context->has_resume_state,
      so the intepreter will normally unwind until exiting interpreted code.
      Then throw the c++ exception after the call to interp_exec_method ()
      to unwind through the runtime code and the AOTed frames
      which can't handle the exception.
      783e260c
    • V
      null-check the redirect context before using. (#65910) · 51306451
      Vladimir Sadov 提交于
      * null-check the redirect context before using.
      
      * tweak the comment
      
      * do not allocate context if InitializeContext has unexpected results.
      51306451
    • J
      Add AssemblyName overload for ILVerify.IResolver.Resolve method (#65905) · b40b31a1
      Jan Kotas 提交于
      Fixes #65573
      b40b31a1
    • B
      Fix GC hole with multi-reg local var stores (#65916) · 8686d06e
      Bruce Forstall 提交于
      * Fix GC hole with multi-reg local var stores
      
      Change #64857 exposed an existing problem where when generating code
      for a multi-reg GT_STORE_LCL_VAR, if the first register slot was not
      enregistered, but the second or subsequent slots was, and those non-first
      slots contained GC pointers, we wouldn't properly add those GC pointers
      to the GC tracking sets. This led to cases where the register lifetimes
      would be killed in the GC info before the actual lifetime was complete.
      
      The primary fix is to make `gtHasReg()` handle the `IsMultiRegLclVar()`
      case. As a side-effect, this fixes some LSRA dumps that weren't displaying
      multiple registers properly.
      
      There are about 50 SPMI asm diffs on win-arm64 where register lifetimes
      get extended, fixing GC holes.
      
      I also made `GetMultiRegCount()` handle the `IsMultiRegLclVar()` case.
      
      I made a number of cleanup changes along the way:
      1. Fixed two cases of calling `gcInfo.gcMarkRegSetNpt` with regNumber, not regMaskTP
      2. Marked some functions `const`
      3. Improved some comments
      4. Changed "ith" to "i'th" in comments which still doesn't read great,
      but at least I'm not left trying to parse "ith" as an English word.
      5. Use `OperIsScalarLocal()` more broadly
      6. Renamed `gtDispRegCount` to `gtDispMultiRegCount` to make it clear
      it only applies to the multi-reg case.
      
      Fixes #65476.
      
      * Update src/coreclr/jit/gentree.cpp
      Co-authored-by: NKunal Pathak <Kunal.Pathak@microsoft.com>
      Co-authored-by: NKunal Pathak <Kunal.Pathak@microsoft.com>
      8686d06e
    • E
      Move diagnostics for invalid GeneratedDllImportAttribute usage to generator... · d9eafd0c
      Elinor Fung 提交于
      Move diagnostics for invalid GeneratedDllImportAttribute usage to generator instead of analyzer (#65915)
      
      d9eafd0c
    • S
      Add regex "unit tests" test project (#65944) · b4c746b7
      Stephen Toub 提交于
      * Add regex "unit tests" test project
      
      This follows the convention used by the networking tests, which typically have two distinct test projects per library: functional tests and unit tests.  The former are what we typically refer to as our tests for a library, whereas the latter build product source into the test project in order to directly validate internals (an alternative to this is to use InternalsVisibleTo, but that negatively impacts trimming and makes it more challenging to maintain a property boundary for the functional tests).  All the existing tests are moved unedited into the FunctionalTests, and a new UnitTests project is added with some initial tests for the RegexTreeAnalyzer code. The generator parser tests were also consolidated into the functional tests, as there's no longer a good reason for those few tests to be separate.
      
      I fixed a few bugs in RegexTreeAnalyzer as a result.  In particular, we were over-annotating things as potentially containing captures or backtracking because in the implementation we were using the lookup APIs meant to be used only once all analysis was complete.  This doesn't have a negative functional impact, but it does negatively impact perf of compiled / source generator, which then generate unnecessary code.  We were also incorrectly conflating atomicity conferred by a grandparent with atomicity conferred by a parent; we need MayBacktracks to reflect only the atomicity directly contributed by a node, not by its parent's influence, as we need the parent to be able to understand whether the child might backtrack.
      
      * Add some unit tests for RegexFindOptimizations
      
      * Address PR feedback
      b4c746b7
    • K
      Fix minor random bias · 3d6781bd
      Kevin Jones 提交于
      This corrects two uses of RandomNumberGenerator that resulted in slight
      bias in their results.
      3d6781bd
    • V
      Make Is*Project properties unambiguous and improve IsGeneratorProject detection (#65896) · a6f45395
      Viktor Hofer 提交于
      * Make Is*Project properties unambiguous
      
      Currently these properties exist which categorize projects:
      - IsReferenceAssembly: The project's parent directory is 'ref'
      - IsGeneratorProject: The project's parent directory is 'gen'
      - IsTestProject: The project is located somewhere under a '/tests/'
                       directory and the project name's suffix is either
                       '.Tests' or '.UnitTests'.
      - IsTrimmingTestProject: Same as IsTestProject but the project name's
                               suffix is '.TrimmingTests'.
      - IsTestSupportProject: The project is located somewhere under a
                              '/tests/' directory and the above IsTestProject
                              property is false.
      - UsingMicrosoftNoTargetsSdk: The project uses the NoTargets msbuild SDK
      - UsingMicrosoftTraversalSdk: The project uses the Traversal msbuild SDK
      - IsRuntimeAssembly: True when all above is false
      - IsSourceProject: True when the project's parent directory is 'src'
      
      The IsRuntimeAssembly and IsSourceProject properties meanings are
      ambiguous and the property names aren't consistent (IsReferenceAssembly
      vs IsGeneratorProject).
      
      I'm changing the above to the following:
      - **IsReferenceSourceProject: The project's parent directory is 'ref'
                              or the parent of the parent directory is 'ref'**
      - IsGeneratorProject: The project's parent directory is 'gen'
      - IsTestProject: The project is located somewhere under a '/tests/'
                       directory and the project name's suffix is either
                       '.Tests' or '.UnitTests'.
      - IsTrimmingTestProject: Same as IsTestProject but the project name's
                               suffix is '.TrimmingTests'.
      - IsTestSupportProject: The project is located somewhere under a
                              '/tests/' directory and the above IsTestProject
                              **and IsTrimmingTestProject** props are false.
      - UsingMicrosoftNoTargetsSdk: The project uses the NoTargets msbuild SDK
      - UsingMicrosoftTraversalSdk: The project uses the Traversal msbuild SDK
      - IsSourceProject: **True when all above is false.**
      
      * React to PR feedback
      a6f45395
    • S
    • V
      Update GenAPI usage and code clean-up (#65887) · 7667e411
      Viktor Hofer 提交于
      * Update GenAPI usage and code clean-up
      7667e411
  3. 28 2月, 2022 2 次提交
    • P
      [PERF][MAUI] Add Maui version info to stored data. Runtime Side (#65800) · c41f452c
      Parker Bibus 提交于
      * Setup pipeline for testing.
      
      * First test with the Maui Version.
      
      * Remove perf-job parameter version typo.
      
      * Try another way of doing the output variable.
      
      * Third times the charm?
      
      * Add a second test for two to be done in one run.
      
      * Fix variable problem with xplat-setup.yml
      
      * Third time was not the charm...
      
      * Try another setup.
      
      * Only include one of the tests as the perf setup is failing potentially due to this.
      
      * Try 2 variable attempts and write out potential get methods.
      
      * Remove failed thing and split them to all be seperate and always run.
      
      * Move variables into the second job stuff.
      
      * Won't run when specified under the job parameters.
      
      * Try hardcoded values to see if it is the output or input that seems to not be connected properly.
      
      * Try new variable format.
      
      * Missed bracket that wasn't found until after most of the way through.
      
      * Maui installs are failing, work around this for variable testing.
      
      * Need to keep mono build enabled.
      
      * Revert "Need to keep mono build enabled."
      
      This reverts commit ff32e46c080efb8a103907de6dd1a13cd0d1be04.
      
      * Revert "Maui installs are failing, work around this for variable testing."
      
      This reverts commit 6dbf6b0ee26d8047d14be86e12e56872c7dab7cc.
      
      * Temp fix for workload install.
      
      * Removed breaking variable test as the new format works along with changing to only having one variable for testing. This should allow us to have access to the maui version in the perf setup for testing.
      
      * Full run test. Still using perf repo fork.
      
      * Add comment explaining RetrievedMauiVersion.
      
      * Add maui version to the iOS runs.
      
      * Undo testing changes to prepare for merge once install is working again.
      c41f452c
    • J
      Update stale comments that reference GitHub issues (#65932) · a58437f7
      Jeff Handley 提交于
      * Update comment in BinaryFormatterWriter to indicate a NRT bug won't be fixed
      
      * Update comment to reflect known issue in .NET Framework
      
      * Update comment to indicate a known issue
      a58437f7
  4. 27 2月, 2022 2 次提交
    • S
      ZeroObj assertions (#65257) · 68fb7fc6
      SingleAccretion 提交于
      It is the case that the IR supports the "zero" node for structs
      in two positions: on the RHS of an assignment (InitBlk form) and
      under a return, in case the ABI return type is scalar.
      
      Meanwhile, assertion propagation "blindly" replaced structs with
      zeroes, and so workarounds had to be applied in order for the IR
      to remain valid, in the form of the NO_CSE flag, applied either
      explicitly (multi-reg returns) or implicitly (ADDR(LCL) created by
      "impNormSturctVal" for call args).
      
      This was:
      
      a) A CQ problem in cases where we forgot to clear the NO_CSE flag
         when the node's parent was updated, say after inlining.
      b) A burden for enabling struct LCL_VAR arguments, as one had to
         remembered to mark them NO_CSE in all situation.
      
      This change fixes the problem by deleting propagation of zeroes for
      local uses, instead propagating them as part of their parents (ASGs
      and RETURNs).
      
      This has the CQ benefits of not being affected by stale NO_CSEs and
      the drawback of not participating in the "chained" propagation, where
      we first copy-propagated something, and then zero-propagated into the
      new local as well. These cases seem rather rare, so I decided not to
      spend TP on fixing them by looking at the copy assertions in the new
      code.
      
      This change also deletes the zero propagation code for SIMDs. It was
      only useful in cases we had a promoted SIMD field that was zero-inited
      via an InitBlk on the parent struct. That promotion code was (and is)
      creating nodes that look like integral constants, except they are of
      TYP_SIMD. We should delete that form and use proper SIMD zero nodes
      instead, and design the propagation story for them separately.
      68fb7fc6
    • S
  5. 26 2月, 2022 16 次提交
    • J
      Adding Regex.IsMatch(Span) and RegexRunner.Scan() methods (#65473) · 26b91db7
      Jose Perez Rodriguez 提交于
      * Adding Regex.IsMatch(Span) and RegexRunner.Scan() methods
      
      * Addressing some PR Feedback
      
      * Fixing case where span-based APIs are called from a precompiled regex and adding a test for it.
      
      * Adding Tests for IsMatch span overload
      
      * Refactor Run<TState> and Run to share centralized logic
      
      * Emit IsBoundary and IsECMABoundary instead of exposing them.
      
      * Address Emitter changes feedback.
      
      * Addressing PR Feedback.
      
      * Addressing most of the PR comments
      
      * Fix issue where runtextbeg and length do not match the size of the input
      
      * Add Precompiled tests for all overloads of methods.
      
      * Fix precompiled test failing in non-Windows due to new lines.
      
      * Apply suggestions from code review
      Co-authored-by: NStephen Toub <stoub@microsoft.com>
      
      * Addressing more PR Feedback
      
      * Fix protected Scan method
      
      * Addressing feedback and adding more tests
      
      * Fix few failing tests in Mono runtime
      Co-authored-by: NStephen Toub <stoub@microsoft.com>
      26b91db7
    • A
      [mono] Delete unicode-data.h and related code, cleanup unused eglib functions (#65751) · c173105b
      Alexander Köplinger 提交于
      This allows us to remove a bunch of huge tables that weren't actually needed.
      Removes support for setting MONO_EXTERNAL_ENCODINGS env var which is discouraged.
      Also removes the code for .mdb debug symbol support which was already disabled everywhere.
      c173105b
    • A
      JIT: OSR jitstress fixes; enable struct promotion (#65903) · c8da2fd5
      Andy Ayers 提交于
      Fix OSR jitstress failures by disabling STRESS_LCL_FLD for two cases:
      * for Tier0 methods with patchpoints (because patchpoint info generation
      does not produce the right offsets when locals are padded)
      * for OSR locals in OSR methods (because they live on the Tier0 frame and
      so can't have their storage altered.
      
      Enable struct promotion for OSR locals. In most cases this ends up being
      dependent promotion. Enabling independent promotion will take more work.
      c8da2fd5
    • A
      `GetTypeFields` should return `ELEMENT_TYPE_BYREF`. (#65880) · a3f7d295
      Aaron Robinson 提交于
      * GetTypeField should return ELEMENT_TYPE_BYREF.
      
      * Remove setting of token2 in all cases. This value is not used in any
      scenario and therefore is more confusing than helpful. Add a comment about
      the expectations of the returned values.
      a3f7d295
    • M
    • P
      [PERF][MAUI] Update Startup scenarios (#65911) · 87e7f06e
      Parker Bibus 提交于
      * Setup pipeline and setup for testing.
      
      * Updated scenario names for new scenario name setup and added no animation tests.
      
      * Revert "Setup pipeline and setup for testing."
      87e7f06e
    • J
      95a68f22
    • S
      Overhaul SymbolicRegexMatcher to avoid DFA perf regressions from NFA changes · 83e5cbcf
      Stephen Toub 提交于
      This does a few things:
      - The previous changes for Antimirov changed the representation from being represented as a DfaMatchingState to instead being a list of states.  Unfortunately, this came at the expense of a significant increase in overhead for the DFA mode.  This commit melds the old and new design, by still using a CurrentState struct that can be either a DFA state or an NFA state, but with a simplified representation that lacks any processing.  The processing is left to two separate structs that implement static abstract interface methods, as was previously done, using that to provide streamlined, generic-specialized processing for the DFA path.
      - Overhauled how we switch from DFA mode to NFA mode.  Previously, the builder would store whether we were in NFA mode, and any matching after it had been switched over immediately started in NFA mode.  We now always start in DFA, and only switch over to NFA if we try to create a new state but doing so would exceed the graph size constraint.
      - Overhauled how we handle the outer/inner loop logic.  Previously we wanted to remain in a tight inner loop and so would use some "leeway" to allow us to go beyond the graph size constraint in order to avoid having to check too frequently whether we'd exceeded that size.  Now, the transition function itself returns whether we need to exit out to the outer loop in order to upgrade from DFA to NFA, and until/unless that happens, we can stay in the inner loop.
      - Avoids inlining huge amounts of NFA code that can result in worse DFA code
      - Renamed Brzozowski and Antimirov to DFA and NFA.
      - Added a lot of comments to SymbolicRegexMatcher
      - Fixes "watchdog" issue with captures
      - A few other renames / cleanups.
      83e5cbcf
    • M
      054dc88c
    • T
      add RID for Ubuntu 22.04 (#65483) · 221257a4
      Tomas Weinfurt 提交于
      221257a4
    • P
      [Perf][Maui] Set only android-arm64 to be built for Maui (#65747) · e27f594e
      Parker Bibus 提交于
      * Set android to only build one RID (android-arm64).
      
      * Update the mv file path for the android apk.
      
      * Add --self-contained to get rid of android build warning.
      
      * Add comment about dotnet restore being done before publish.
      e27f594e
    • P
      [PERF][MAUI]Maui Install Workaround Fix (#65904) · 828f6d70
      Parker Bibus 提交于
      * Test a potential fix for the maui install failures.
      
      * Only run the app build.
      
      * Reenable rest of the pipeline.
      828f6d70
    • J
      Remove usages of native bootstrapping (#65901) · 8727ac77
      Juan Hoyos 提交于
      * Remove usages of native bootstrapping
      * Make sure cmake is in the path for mono wasm builds
      Co-authored-by: NAdeel Mujahid <3840695+am11@users.noreply.github.com>
      8727ac77
    • S
      Centralize regex tree analysis for atomic/capture/backtracking detection (#65734) · 2ce0af0b
      Stephen Toub 提交于
      We currently either guess at some of this state based on the immediate surrounding nodes (e.g. whether the immediate child backtracks) or we do potentially-expensive walks each time we need to check (e.g. walking all ancestors until root to determine whether a given node is to be considered atomic).  This changes the code to do a pass over the graph to compute the relevant information, which can then be used by the code generators any time they need to access that information.  This provides the code with faster and more accurate answers.
      2ce0af0b
    • T
      Reduce TypeGeneratorTests log spew to 1% of its previous size (#65871) · 0c33372d
      Tomáš Rylek 提交于
      As JanV noticed during an independent investigation,
      TypeGeneratorTests historically used to produce an enormous amount
      of stdout spew due to individually reporting the details of all
      passing test cases; for the entire set of 1501 tests the total
      size of the spew was about 150 MB. In combination with the change
      to capture stdout spew in the xml test reports this effectively
      canceled out all previous wins achieved via test merging - in fact,
      the tests became twice as slow compared to before the merging.
      
      This modification only reports mismatches i.e. failures where we
      don't receive the expected answer in one of the test cases. This
      reduces the total spew from 150 MB to just over a megabyte and
      restores the perf improvement achieved via test merging.
      
      Thanks
      
      Tomas
      0c33372d
    • T
      Mark architecture-specific tests with ConditionalFact attributes (#65862) · 572405ac
      Tomáš Rylek 提交于
      This change adds initial provisions for platform detection similar
      to library logic to CoreCLRTestLibrary and marks a few
      architecture-conditional tests with ConditionalFact attributes.
      
      While I must admit I'm not happy about the IL representation of
      the ConditionalFact attributes, it's technically using the same
      representation as the library tests do and it only affects a handful
      of tests. During consolidation of the remaining tests we'll
      continue working on an easier solution even though it may require
      diverging further away from Xunit.
      
      I'm not yet removing the CLRTestTargetUnsupported clauses from
      the corresponding project files, that can only be done after
      switching these tests over to use the merged wrappers (my next
      change) as the legacy XUnit wrapper generator (in particular the
      test execution script generator) relies on those properties.
      
      Thanks
      
      Tomas
      572405ac
  6. 25 2月, 2022 2 次提交
    • E
      95f7f7a0
    • I
      [wasm][debugger] Run debugger test in codespace (#64746) · ef785f5d
      Ilona Tomkowicz 提交于
      * Tmp change for debugging.
      
      * Added chromium, needed for running debugger tests.
      
      * Corrected line breaking, removed suso.
      
      * Removed update duplicate.
      
      * Prevent regex on null.
      
      * Set special env variable only for containers.
      
      * Locally docker build crashes without it.
      
      * Applied @eerhardt suggestion.
      
      * Moved env assignment to a place that is executed by onCreateCommand.sh
      
      * Revert accidential new line removal.
      
      * Upgrade is unnecessary, works without it.
      
      * Moved all logic to C# code.
      
      * Remove duplicated line.
      
      * Applied @thays's and @lewing's comments.
      
      * Enabling @radical approach for chromium installation.
      Co-authored-by: NAnkit Jain <radical@gmail.com>
      ef785f5d