1. 14 7月, 2017 2 次提交
  2. 11 7月, 2017 1 次提交
    • V
      Retaining temporary IL slots allocated for passing rvalues as lvalues for the... · 03d0ec83
      vsadov 提交于
      Retaining temporary IL slots allocated for passing rvalues as lvalues for the duration of the whole encompassing expression.
      
      Passing rvalues to "in" parameters require allocation of temporary IL slots.
      
      ```C#
      var result M1(42).ToString();
      
       // where  M is declared as
      ref readonly int M1(in int x) {...}
      
      // needs to be emitted as:
      int temp = 42;
      var result M1(ref temp) .ToString();   // passed by reference
      ```
      
      This pattern bring an issue of the lifetime of such temporaries. Note that `M1` can return its argument back by reference, so the variable must exist as long as the return variable exists. - longer then the call to M1 itself.
      
      The situation where we would have to pass an rvalue by reference via a copy was possible before, but it was very rare, so the solution was to just "leak" the temp. I.E - do not release such temps back to the temp pool. This is not a good solution when the situation becomes more common.
      
      In this change we introduce a mechanism that collects temps of this kind and keeps them as for the duration of the most encompassing expression.
      We will use the same mechanism for the preexisting cases as well.
      
      Why "encompassing expression" is a sufficient extent for the temps. Consider the following concerns -
      
      1) It is not possible to store a result of a `ref readonly` call, so the temp does not need to be retained at block level. - we do not allow `ref readonly` locals in source.
      2) Internally compiler can create long-lived `ref readonly` temps for the purpose of returning from exception regions. This is not causing a concern since rvalues are not returnable and can never be stored insuch refs.
      3) We sometimes call struct methods on a temp, there is no concern with the life time of such temps since struct `this` it cannot be ref-returned.
      4) Sometimes short-term ref temps become mapped to long-term temps as a result of async spilling. We do not need to handle that specially here since those already have appropriate life times when extracted into  block variables in lowering.
      03d0ec83
  3. 24 5月, 2017 1 次提交
  4. 11 4月, 2017 1 次提交
    • O
      Writing ReadOnlyAttribute if it exists as well-known type (#18358) · 03f58fd2
      Omar Tawfik 提交于
      * Writing attribute to metadata
      
      * Reading attribute in PE symbols
      
      * Added more tests for lambdas, delegates, and other types
      
      * Use ReadOnlyAttribute instead
      
      * Fix build break
      
      * Fix Failed Tests
      
      * Enable back disabled tests
      
      * Fix more tests
      
      * Ban usage of ReadOnlyAttribute in source
      
      * Rename System.Runtime.InteropServices.ReadOnlyAttribute to System.Runtime.CompilerServices.ReadOnlyAttribute
      
      * Clean up
      
      * Address CR comments
      
      * More PR feedback
      03f58fd2
  5. 05 4月, 2017 1 次提交
  6. 04 4月, 2017 1 次提交
  7. 27 3月, 2017 1 次提交
  8. 24 3月, 2017 1 次提交
  9. 23 3月, 2017 3 次提交
  10. 21 3月, 2017 1 次提交
  11. 17 3月, 2017 2 次提交
  12. 14 3月, 2017 1 次提交
  13. 03 3月, 2017 1 次提交
  14. 01 3月, 2017 1 次提交
  15. 25 2月, 2017 1 次提交
  16. 24 2月, 2017 1 次提交
  17. 23 2月, 2017 1 次提交
  18. 18 2月, 2017 1 次提交
  19. 16 2月, 2017 1 次提交