- 14 7月, 2017 2 次提交
- 11 7月, 2017 1 次提交
-
-
由 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.
-
- 24 5月, 2017 1 次提交
-
-
由 vsadov 提交于
-
- 11 4月, 2017 1 次提交
-
-
由 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
-
- 05 4月, 2017 1 次提交
-
-
由 vsadov 提交于
-
- 04 4月, 2017 1 次提交
-
-
由 vsadov 提交于
The code was ignoring "readonly" part for local functions, Fixes:#18357
-
- 27 3月, 2017 1 次提交
-
-
由 vsadov 提交于
-
- 24 3月, 2017 1 次提交
-
-
由 vsadov 提交于
-
- 23 3月, 2017 3 次提交
-
-
由 vsadov 提交于
-
由 vsadov 提交于
-
由 Omar Tawfik 提交于
* Modify Symbol Display for readonly references from "ref readonly" to "in" * Address PR comments * Test Fixes after merge
-
- 21 3月, 2017 1 次提交
-
-
由 vsadov 提交于
-
- 17 3月, 2017 2 次提交
- 14 3月, 2017 1 次提交
-
-
由 Omar Tawfik 提交于
-
- 03 3月, 2017 1 次提交
-
-
由 vsadov 提交于
-
- 01 3月, 2017 1 次提交
-
-
由 vsadov 提交于
-
- 25 2月, 2017 1 次提交
-
-
由 vsadov 提交于
NOTE: binding of `ref readonly` parameters is NYI
-
- 24 2月, 2017 1 次提交
-
-
由 Omar Tawfik 提交于
-
- 23 2月, 2017 1 次提交
-
-
由 Omar Tawfik 提交于
-
- 18 2月, 2017 1 次提交
-
-
由 vsadov 提交于
Correclty handle local functions.
-
- 16 2月, 2017 1 次提交
-
-
由 vsadov 提交于
* Syntax model and Parsing * Support for 7.1 language version - just enough to unblock testing.
-