1. 19 2月, 2018 3 次提交
  2. 17 2月, 2018 1 次提交
    • J
      Rename to CompileStandardAndVerify · 75463028
      Jared Parsons 提交于
      This unifies our API naming convention. When standard is in the name
      then we are using the netstandard2.0 API set and when it is not then it
      is the simple desktop mscorlib46.
      
      Both variants are necessary for CompileAndVerify style functions because
      many of our tests that use it can only run on desktop or simply need to
      have some of the netstandard2.0 API set missing.
      75463028
  3. 05 1月, 2018 1 次提交
  4. 30 6月, 2017 1 次提交
    • V
      In some cases `fixed` statement used a peculiar codegen strategy. · f692ac46
      vsadov 提交于
      Instead of mapping the pointer to a pointer temp, it was mapped to the managed pinned reference (which does not even have the same type).
      At all the places where the pointer was used, the actual reference was converted to the pointer, repeatedly.
      
      I.E.
      
      ```C#
      fixed(int * p = &v)
      {
          Use(p);
          Use(p);
          Use(p);
      }
      ```
      was emitted as
      
      ```C#
      try
      {
           pinned ref int refTemp = ref v;
      
          Use((int*)refTemp);      // unsafely cast pinned ref
          Use((int*)refTemp);      // unsafely cast pinned ref
          Use((int*)refTemp);      // unsafely cast pinned ref
      }
      finally
      {
            // zero-out refTemp
      }
      ```
      instead of logical pattern matching the semantics:
      ```C#
      try
      {
           pinned ref int refTemp = ref v;
           int * p = (int*)refTemp;  // unsafely cast pinned ref
      
          Use(p);
          Use(p);
          Use(p);
      }
      finally
      {
            // zero-out refTemp
      }
      ```
      
      The reason for the strange emit was never truly understood. In fact, in other cases, like fixed string, the more obvious variant was used.
      One theory was that this codegen was just because of the lack of internal expressiveness in the old compiler around byref locals and we simply carried it forward.
      The inconsistency required special casing of such `fixed` statements  in binding, lowering, codegen and in the semantical model, which must expose the "logical" shape of the statement.
      
      Another guess was that this kind of emit was better for JIT.
      That turned out to be not true. To the contrary - while a pointer temp would be very optimizable, repeated accesses to the pinned ref actually results in noticeable overhead in the JITted code, forcing users to use workarounds like:
      
      ```C#
      fixed(int * p = &v)
      {
          // PERF: accessing p has additional expenses, so store it in another temp;
          int * cheapP = p;
          Use(cheapP);
          Use(cheapP);
          Use(cheapP);
      }
      ```
      
      Users should not need to do the above. Compiler should do that in the first place.
      
      Fixes: #18615
      f692ac46
  5. 08 4月, 2017 1 次提交
  6. 17 3月, 2017 1 次提交
  7. 26 1月, 2016 1 次提交
  8. 02 7月, 2015 1 次提交
    • J
      CodeFormatter Run · 95a76fb1
      Jared Parsons 提交于
      Fell out of our normal cadence for this during the push for RTM. Now that we
      had a bit more breathing room getting us back on track here.
      95a76fb1
  9. 10 6月, 2015 1 次提交
  10. 06 6月, 2015 1 次提交
  11. 01 2月, 2015 1 次提交
    • B
      Complete the style update to the rest of Open\src directory · 995eb372
      beep boop 提交于
           Background:
      
           As discussed in the dev team all hands all code under the GitHub dotnet foundation is using a single process for contribution, API review, infrastructure and coding style. The idea is to present a unified view to our customer and give them a single story for contributing to any project under the dotnet foundation.
      
           https://github.com/dotnet/corefx/wiki/Contributing#c-coding-style
      
           The coding style transition is automated using a Roslyn based rewrite tool:
      
           https://github.com/dotnet/codeformatter
      
           This will be applied in stages across our developer tree. Right now the focus is on the Open directory as this is what is being presented on github. Code owners will be contacted before the transition happens.
      
           Note: this is a soft style requirement. There are no build errors that come from this change.
       (changeset 1408227)
      995eb372
  12. 15 1月, 2015 1 次提交
  13. 14 1月, 2015 1 次提交
  14. 02 10月, 2014 1 次提交
    • T
      This shelveset implements following changes to metadata reference compiler API... · 4fc808ea
      TomasMatousek 提交于
      This shelveset implements following changes to metadata reference compiler API in order to remove duplication in the public surface and prevent users from unexpected metadata lifetime issues:
      
           1) MetadataImageReference and MetadataFileReference overlap
           Currently MetadataImageReference can be constructed from a Stream. MetadataImageReference supports metadata prefetch (reading the blob into memory and close the underlying stream) as well deferred reading (no content is read until the reference is consumed during compilation). MetadataFileReference only supports deferred reading.
      
           Lifetime of MetadataFileReference is non-deterministic, the underlying file is locked until no references exist and we GC the metadata.  On the other hand, it is possible to construct MetadataImageReference in such a way that allows controlling the underlying resources deterministically.
      
           Remove MetadataFileReference, use MetadataImageReference instead.
      
           2) Lifetime management
           AssemblyMetadata and ModuleMetadata objects hold on resources and implement IDisposable. When using MetadataFileReference constructors and some MetadataImageReference constructors to create references the underlying metadata objects are created implicitly and the user doesn’t have a way to explicitly dispose them.
      
           Make MetadataImageReference constructors internal and instead add factory method GetReference on AssemblyMetadata/ModuleMetadata. The usage pattern is:
      
           using (var metadata = AssemblyMetadata.CreateFromXxx(…))
           {
               var compilation = CSharpCompilation.Create(syntaxTrees, new[] { metadata.GetReference() });
               …
           }
      
           In addition the shelveset makes MetadataImageReference internal and adds the following convenience APIs, that are not the most efficient but are very convenient, easy to discover and safe to use for customers that don’t wanna explicitly manage the lifetime of metadata objects. (changeset 1345987)
      4fc808ea
  15. 15 8月, 2014 1 次提交
    • T
      Reduce the variety of optimization related compilation option values used in... · f58f5ab8
      TomasMatousek 提交于
      Reduce the variety of optimization related compilation option values used in tests to: Release, DebuggableRelease and Debug.
      
      By default tests should use Release, which enables all optimizations.
      PDB tests should mostly use Debug.
      We should have targeted tests for DebuggableRelease, for optimizations that are selectively disabled to improve debuggability of release builds.
      
         (changeset 1312277)
      f58f5ab8
  16. 15 4月, 2014 1 次提交
  17. 19 3月, 2014 1 次提交