Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
7fd5341e
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7fd5341e
编写于
4月 20, 2017
作者:
V
Vladimir Sadov
提交者:
GitHub
4月 20, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #18721 from VSadov/asyncTweak
Removed some unnecessary codegen from async state machine.
上级
82255e9a
eb90fff4
变更
13
展开全部
隐藏空白更改
内联
并排
Showing
13 changed file
with
1935 addition
and
2084 deletion
+1935
-2084
src/Compilers/CSharp/Portable/Lowering/AsyncRewriter/AsyncMethodToStateMachineRewriter.cs
...wering/AsyncRewriter/AsyncMethodToStateMachineRewriter.cs
+9
-24
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncEHTests.cs
...Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncEHTests.cs
+494
-520
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncLocalsTests.cs
...ilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncLocalsTests.cs
+390
-404
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncSpillTests.cs
...pilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncSpillTests.cs
+52
-56
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncTests.cs
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncTests.cs
+186
-207
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenDynamicTests.cs
...Compilers/CSharp/Test/Emit/CodeGen/CodeGenDynamicTests.cs
+170
-176
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTupleTest.cs
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTupleTest.cs
+115
-125
src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/EditAndContinueStateMachineTests.cs
.../Emit/EditAndContinue/EditAndContinueStateMachineTests.cs
+216
-234
src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/LocalSlotMappingTests.cs
...p/Test/Emit/Emit/EditAndContinue/LocalSlotMappingTests.cs
+23
-25
src/Compilers/CSharp/Test/Emit/PDB/PDBAsyncTests.cs
src/Compilers/CSharp/Test/Emit/PDB/PDBAsyncTests.cs
+234
-260
src/Compilers/CSharp/Test/Semantic/Semantics/BindingAwaitTests.cs
...ilers/CSharp/Test/Semantic/Semantics/BindingAwaitTests.cs
+5
-5
src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/DynamicTests.cs
...nEvaluator/CSharp/Test/ExpressionCompiler/DynamicTests.cs
+21
-23
src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/LocalsTests.cs
...onEvaluator/CSharp/Test/ExpressionCompiler/LocalsTests.cs
+20
-25
未找到文件。
src/Compilers/CSharp/Portable/Lowering/AsyncRewriter/AsyncMethodToStateMachineRewriter.cs
浏览文件 @
7fd5341e
...
...
@@ -298,30 +298,15 @@ private BoundBlock VisitAwaitExpression(BoundAwaitExpression node, BoundExpressi
WellKnownMemberNames
.
GetResult
,
resultsDiscarded
:
resultPlace
==
null
);
var
nullAwaiter
=
F
.
AssignmentExpression
(
F
.
Local
(
awaiterTemp
),
F
.
NullOrDefault
(
awaiterTemp
.
Type
));
if
(
resultPlace
!=
null
&&
type
.
SpecialType
!=
SpecialType
.
System_Void
)
{
// $resultTemp = $awaiterTemp.GetResult();
// $awaiterTemp = null;
// $resultTemp
LocalSymbol
resultTemp
=
F
.
SynthesizedLocal
(
type
);
return
F
.
Block
(
ImmutableArray
.
Create
(
awaiterTemp
,
resultTemp
),
awaitIfIncomplete
,
F
.
Assignment
(
F
.
Local
(
resultTemp
),
getResultCall
),
F
.
ExpressionStatement
(
nullAwaiter
),
F
.
Assignment
(
resultPlace
,
F
.
Local
(
resultTemp
)));
}
else
{
// $awaiterTemp.GetResult();
// $awaiterTemp = null;
return
F
.
Block
(
ImmutableArray
.
Create
(
awaiterTemp
),
awaitIfIncomplete
,
F
.
ExpressionStatement
(
getResultCall
),
F
.
ExpressionStatement
(
nullAwaiter
));
}
// [$resultPlace = ] $awaiterTemp.GetResult();
BoundStatement
getResultStatement
=
resultPlace
!=
null
&&
type
.
SpecialType
!=
SpecialType
.
System_Void
?
F
.
Assignment
(
resultPlace
,
getResultCall
):
F
.
ExpressionStatement
(
getResultCall
);
return
F
.
Block
(
ImmutableArray
.
Create
(
awaiterTemp
),
awaitIfIncomplete
,
getResultStatement
);
}
private
BoundExpression
MakeCallMaybeDynamic
(
...
...
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncEHTests.cs
浏览文件 @
7fd5341e
此差异已折叠。
点击以展开。
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncLocalsTests.cs
浏览文件 @
7fd5341e
此差异已折叠。
点击以展开。
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncSpillTests.cs
浏览文件 @
7fd5341e
...
...
@@ -599,7 +599,7 @@ public static async Task<int> F(int[] array)
v
.
VerifyIL
(
"Test.<F>d__2.System.Runtime.CompilerServices.IAsyncStateMachine.MoveNext"
,
@"
{
// Code size
300 (0x12c
)
// Code size
290 (0x122
)
.maxstack 5
.locals init (int V_0,
int V_1,
...
...
@@ -671,7 +671,7 @@ .maxstack 5
IL_007f: ldloca.s V_5
IL_0081: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<int>.AwaitUnsafeOnCompleted<System.Runtime.CompilerServices.TaskAwaiter<int>, Test.<F>d__2>(ref System.Runtime.CompilerServices.TaskAwaiter<int>, ref Test.<F>d__2)""
IL_0086: nop
IL_0087: leave IL_012
b
IL_0087: leave IL_012
1
>IL_008c: ldarg.0
IL_008d: ldfld ""System.Runtime.CompilerServices.TaskAwaiter<int> Test.<F>d__2.<>u__1""
IL_0092: stloc.s V_4
...
...
@@ -683,64 +683,60 @@ .maxstack 5
IL_00a2: dup
IL_00a3: stloc.0
IL_00a4: stfld ""int Test.<F>d__2.<>1__state""
IL_00a9: ldloca.s V_4
IL_00ab: call ""int System.Runtime.CompilerServices.TaskAwaiter<int>.GetResult()""
IL_00b0: stloc.3
IL_00b1: ldloca.s V_4
IL_00b3: initobj ""System.Runtime.CompilerServices.TaskAwaiter<int>""
IL_00b9: ldarg.0
IL_00ba: ldloc.3
IL_00bb: stfld ""int Test.<F>d__2.<>s__3""
IL_00c0: ldarg.0
IL_00c1: ldarg.0
IL_00c2: ldfld ""int[] Test.<F>d__2.<>s__5""
IL_00c7: ldc.i4.3
IL_00c8: ldarg.0
IL_00c9: ldfld ""int Test.<F>d__2.<>s__2""
IL_00ce: ldarg.0
IL_00cf: ldfld ""int Test.<F>d__2.<>s__3""
IL_00d4: add
IL_00d5: dup
IL_00d6: stloc.3
IL_00d7: stelem.i4
IL_00d8: ldloc.3
IL_00d9: stfld ""int Test.<F>d__2.<>s__4""
IL_00de: ldarg.0
IL_00df: ldfld ""int Test.<F>d__2.<>s__1""
IL_00e4: ldarg.0
IL_00e5: ldfld ""int Test.<F>d__2.<>s__4""
IL_00ea: ldc.i4.4
IL_00eb: call ""int Test.H(int, int, int)""
IL_00f0: pop
IL_00f1: ldarg.0
IL_00f2: ldnull
IL_00f3: stfld ""int[] Test.<F>d__2.<>s__5""
-IL_00f8: ldc.i4.1
IL_00f9: stloc.1
IL_00fa: leave.s IL_0116
IL_00a9: ldarg.0
IL_00aa: ldloca.s V_4
IL_00ac: call ""int System.Runtime.CompilerServices.TaskAwaiter<int>.GetResult()""
IL_00b1: stfld ""int Test.<F>d__2.<>s__3""
IL_00b6: ldarg.0
IL_00b7: ldarg.0
IL_00b8: ldfld ""int[] Test.<F>d__2.<>s__5""
IL_00bd: ldc.i4.3
IL_00be: ldarg.0
IL_00bf: ldfld ""int Test.<F>d__2.<>s__2""
IL_00c4: ldarg.0
IL_00c5: ldfld ""int Test.<F>d__2.<>s__3""
IL_00ca: add
IL_00cb: dup
IL_00cc: stloc.3
IL_00cd: stelem.i4
IL_00ce: ldloc.3
IL_00cf: stfld ""int Test.<F>d__2.<>s__4""
IL_00d4: ldarg.0
IL_00d5: ldfld ""int Test.<F>d__2.<>s__1""
IL_00da: ldarg.0
IL_00db: ldfld ""int Test.<F>d__2.<>s__4""
IL_00e0: ldc.i4.4
IL_00e1: call ""int Test.H(int, int, int)""
IL_00e6: pop
IL_00e7: ldarg.0
IL_00e8: ldnull
IL_00e9: stfld ""int[] Test.<F>d__2.<>s__5""
-IL_00ee: ldc.i4.1
IL_00ef: stloc.1
IL_00f0: leave.s IL_010c
}
catch System.Exception
{
~IL_00f
c
: stloc.s V_6
IL_00f
e
: ldarg.0
IL_00f
f
: ldc.i4.s -2
IL_0
101
: stfld ""int Test.<F>d__2.<>1__state""
IL_0
106
: ldarg.0
IL_0
107
: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<int> Test.<F>d__2.<>t__builder""
IL_010
c
: ldloc.s V_6
IL_010
e
: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<int>.SetException(System.Exception)""
IL_01
13
: nop
IL_01
14: leave.s IL_012b
~IL_00f
2
: stloc.s V_6
IL_00f
4
: ldarg.0
IL_00f
5
: ldc.i4.s -2
IL_0
0f7
: stfld ""int Test.<F>d__2.<>1__state""
IL_0
0fc
: ldarg.0
IL_0
0fd
: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<int> Test.<F>d__2.<>t__builder""
IL_010
2
: ldloc.s V_6
IL_010
4
: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<int>.SetException(System.Exception)""
IL_01
09
: nop
IL_01
0a: leave.s IL_0121
}
-IL_01
16
: ldarg.0
IL_01
17
: ldc.i4.s -2
IL_01
19
: stfld ""int Test.<F>d__2.<>1__state""
~IL_011
e
: ldarg.0
IL_011
f
: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<int> Test.<F>d__2.<>t__builder""
IL_01
24
: ldloc.1
IL_01
25
: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<int>.SetResult(int)""
IL_012
a
: nop
IL_012
b
: ret
-IL_01
0c
: ldarg.0
IL_01
0d
: ldc.i4.s -2
IL_01
0f
: stfld ""int Test.<F>d__2.<>1__state""
~IL_011
4
: ldarg.0
IL_011
5
: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<int> Test.<F>d__2.<>t__builder""
IL_01
1a
: ldloc.1
IL_01
1b
: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<int>.SetResult(int)""
IL_012
0
: nop
IL_012
1
: ret
}"
,
sequencePoints
:
"Test+<F>d__2.MoveNext"
);
}
...
...
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncTests.cs
浏览文件 @
7fd5341e
此差异已折叠。
点击以展开。
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenDynamicTests.cs
浏览文件 @
7fd5341e
此差异已折叠。
点击以展开。
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTupleTest.cs
浏览文件 @
7fd5341e
...
...
@@ -2090,7 +2090,7 @@ public static async Task<T> Test<T>(T a)
verifier.VerifyDiagnostics();
verifier.VerifyIL("C.<Test>d__1<T>.System.Runtime.CompilerServices.IAsyncStateMachine.MoveNext()", @"
{
// Code size 1
91 (0xbf
)
// Code size 1
83 (0xb7
)
.maxstack 3
.locals init (int V_0,
T V_1,
...
...
@@ -2132,7 +2132,7 @@ .maxstack 3
IL_004e: ldloca.s V_2
IL_0050: ldarg.0
IL_0051: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T>.AwaitUnsafeOnCompleted<System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter, C.<Test>d__1<T>>(ref System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter, ref C.<Test>d__1<T>)""
IL_0056: leave.s IL_00b
e
IL_0056: leave.s IL_00b
6
IL_0058: ldarg.0
IL_0059: ldfld ""System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter C.<Test>d__1<T>.<>u__1""
IL_005e: stloc.2
...
...
@@ -2146,34 +2146,32 @@ .maxstack 3
IL_006f: stfld ""int C.<Test>d__1<T>.<>1__state""
IL_0074: ldloca.s V_2
IL_0076: call ""void System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter.GetResult()""
IL_007b: ldloca.s V_2
IL_007d: initobj ""System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter""
IL_0083: ldarg.0
IL_0084: ldflda ""(T f1, T f2) C.<Test>d__1<T>.<x>5__1""
IL_0089: ldfld ""T System.ValueTuple<T, T>.Item1""
IL_008e: stloc.1
IL_008f: leave.s IL_00aa
IL_007b: ldarg.0
IL_007c: ldflda ""(T f1, T f2) C.<Test>d__1<T>.<x>5__1""
IL_0081: ldfld ""T System.ValueTuple<T, T>.Item1""
IL_0086: stloc.1
IL_0087: leave.s IL_00a2
}
catch System.Exception
{
IL_0091: stloc.s V_4
IL_0089: stloc.s V_4
IL_008b: ldarg.0
IL_008c: ldc.i4.s -2
IL_008e: stfld ""int C.<Test>d__1<T>.<>1__state""
IL_0093: ldarg.0
IL_0094: ldc.i4.s -2
IL_0096: stfld ""int C.<Test>d__1<T>.<>1__state""
IL_009b: ldarg.0
IL_009c: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T> C.<Test>d__1<T>.<>t__builder""
IL_00a1: ldloc.s V_4
IL_00a3: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T>.SetException(System.Exception)""
IL_00a8: leave.s IL_00be
IL_0094: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T> C.<Test>d__1<T>.<>t__builder""
IL_0099: ldloc.s V_4
IL_009b: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T>.SetException(System.Exception)""
IL_00a0: leave.s IL_00b6
}
IL_00a2: ldarg.0
IL_00a3: ldc.i4.s -2
IL_00a5: stfld ""int C.<Test>d__1<T>.<>1__state""
IL_00aa: ldarg.0
IL_00ab: ldc.i4.s -2
IL_00ad: stfld ""int C.<Test>d__1<T>.<>1__state""
IL_00b2: ldarg.0
IL_00b3: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T> C.<Test>d__1<T>.<>t__builder""
IL_00b8: ldloc.1
IL_00b9: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T>.SetResult(T)""
IL_00be: ret
IL_00ab: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T> C.<Test>d__1<T>.<>t__builder""
IL_00b0: ldloc.1
IL_00b1: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T>.SetResult(T)""
IL_00b6: ret
}
");
}
...
...
@@ -2206,7 +2204,7 @@ public static async Task<string> Test<T>(T a)
verifier.VerifyDiagnostics();
verifier.VerifyIL("C.<Test>d__1<T>.System.Runtime.CompilerServices.IAsyncStateMachine.MoveNext()", @"
{
// Code size 1
97 (0xc5
)
// Code size 1
89 (0xbd
)
.maxstack 3
.locals init (int V_0,
string V_1,
...
...
@@ -2248,7 +2246,7 @@ .maxstack 3
IL_004e: ldloca.s V_2
IL_0050: ldarg.0
IL_0051: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<string>.AwaitUnsafeOnCompleted<System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter, C.<Test>d__1<T>>(ref System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter, ref C.<Test>d__1<T>)""
IL_0056: leave.s IL_00
c4
IL_0056: leave.s IL_00
bc
IL_0058: ldarg.0
IL_0059: ldfld ""System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter C.<Test>d__1<T>.<>u__1""
IL_005e: stloc.2
...
...
@@ -2262,35 +2260,33 @@ .maxstack 3
IL_006f: stfld ""int C.<Test>d__1<T>.<>1__state""
IL_0074: ldloca.s V_2
IL_0076: call ""void System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter.GetResult()""
IL_007b: ldloca.s V_2
IL_007d: initobj ""System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter""
IL_0083: ldarg.0
IL_0084: ldflda ""(T f1, T f2) C.<Test>d__1<T>.<x>5__1""
IL_0089: constrained. ""System.ValueTuple<T, T>""
IL_008f: callvirt ""string object.ToString()""
IL_0094: stloc.1
IL_0095: leave.s IL_00b0
IL_007b: ldarg.0
IL_007c: ldflda ""(T f1, T f2) C.<Test>d__1<T>.<x>5__1""
IL_0081: constrained. ""System.ValueTuple<T, T>""
IL_0087: callvirt ""string object.ToString()""
IL_008c: stloc.1
IL_008d: leave.s IL_00a8
}
catch System.Exception
{
IL_0097: stloc.s V_4
IL_008f: stloc.s V_4
IL_0091: ldarg.0
IL_0092: ldc.i4.s -2
IL_0094: stfld ""int C.<Test>d__1<T>.<>1__state""
IL_0099: ldarg.0
IL_009a: ldc.i4.s -2
IL_009c: stfld ""int C.<Test>d__1<T>.<>1__state""
IL_00a1: ldarg.0
IL_00a2: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<string> C.<Test>d__1<T>.<>t__builder""
IL_00a7: ldloc.s V_4
IL_00a9: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<string>.SetException(System.Exception)""
IL_00ae: leave.s IL_00c4
IL_009a: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<string> C.<Test>d__1<T>.<>t__builder""
IL_009f: ldloc.s V_4
IL_00a1: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<string>.SetException(System.Exception)""
IL_00a6: leave.s IL_00bc
}
IL_00a8: ldarg.0
IL_00a9: ldc.i4.s -2
IL_00ab: stfld ""int C.<Test>d__1<T>.<>1__state""
IL_00b0: ldarg.0
IL_00b1: ldc.i4.s -2
IL_00b3: stfld ""int C.<Test>d__1<T>.<>1__state""
IL_00b8: ldarg.0
IL_00b9: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<string> C.<Test>d__1<T>.<>t__builder""
IL_00be: ldloc.1
IL_00bf: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<string>.SetResult(string)""
IL_00c4: ret
IL_00b1: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<string> C.<Test>d__1<T>.<>t__builder""
IL_00b6: ldloc.1
IL_00b7: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<string>.SetResult(string)""
IL_00bc: ret
}
");
}
...
...
@@ -2349,7 +2345,7 @@ public U Test<U>(U val)
verifier.VerifyDiagnostics();
verifier.VerifyIL("C.<Test>d__1<T>.System.Runtime.CompilerServices.IAsyncStateMachine.MoveNext()", @"
{
// Code size 1
97 (0xc5
)
// Code size 1
89 (0xbd
)
.maxstack 3
.locals init (int V_0,
T V_1,
...
...
@@ -2391,7 +2387,7 @@ .maxstack 3
IL_004e: ldloca.s V_2
IL_0050: ldarg.0
IL_0051: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T>.AwaitUnsafeOnCompleted<System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter, C.<Test>d__1<T>>(ref System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter, ref C.<Test>d__1<T>)""
IL_0056: leave.s IL_00
c4
IL_0056: leave.s IL_00
bc
IL_0058: ldarg.0
IL_0059: ldfld ""System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter C.<Test>d__1<T>.<>u__1""
IL_005e: stloc.2
...
...
@@ -2405,36 +2401,34 @@ .maxstack 3
IL_006f: stfld ""int C.<Test>d__1<T>.<>1__state""
IL_0074: ldloca.s V_2
IL_0076: call ""void System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter.GetResult()""
IL_007b: ldloca.s V_2
IL_007d: initobj ""System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter""
IL_0083: ldarg.0
IL_0084: ldflda ""(T f1, T f2) C.<Test>d__1<T>.<x>5__1""
IL_0089: ldarg.0
IL_008a: ldfld ""T C.<Test>d__1<T>.a""
IL_008f: call ""T System.ValueTuple<T, T>.Test<T>(T)""
IL_0094: stloc.1
IL_0095: leave.s IL_00b0
IL_007b: ldarg.0
IL_007c: ldflda ""(T f1, T f2) C.<Test>d__1<T>.<x>5__1""
IL_0081: ldarg.0
IL_0082: ldfld ""T C.<Test>d__1<T>.a""
IL_0087: call ""T System.ValueTuple<T, T>.Test<T>(T)""
IL_008c: stloc.1
IL_008d: leave.s IL_00a8
}
catch System.Exception
{
IL_0097: stloc.s V_4
IL_008f: stloc.s V_4
IL_0091: ldarg.0
IL_0092: ldc.i4.s -2
IL_0094: stfld ""int C.<Test>d__1<T>.<>1__state""
IL_0099: ldarg.0
IL_009a: ldc.i4.s -2
IL_009c: stfld ""int C.<Test>d__1<T>.<>1__state""
IL_00a1: ldarg.0
IL_00a2: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T> C.<Test>d__1<T>.<>t__builder""
IL_00a7: ldloc.s V_4
IL_00a9: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T>.SetException(System.Exception)""
IL_00ae: leave.s IL_00c4
IL_009a: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T> C.<Test>d__1<T>.<>t__builder""
IL_009f: ldloc.s V_4
IL_00a1: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T>.SetException(System.Exception)""
IL_00a6: leave.s IL_00bc
}
IL_00a8: ldarg.0
IL_00a9: ldc.i4.s -2
IL_00ab: stfld ""int C.<Test>d__1<T>.<>1__state""
IL_00b0: ldarg.0
IL_00b1: ldc.i4.s -2
IL_00b3: stfld ""int C.<Test>d__1<T>.<>1__state""
IL_00b8: ldarg.0
IL_00b9: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T> C.<Test>d__1<T>.<>t__builder""
IL_00be: ldloc.1
IL_00bf: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T>.SetResult(T)""
IL_00c4: ret
IL_00b1: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T> C.<Test>d__1<T>.<>t__builder""
IL_00b6: ldloc.1
IL_00b7: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T>.SetResult(T)""
IL_00bc: ret
}
");
}
...
...
@@ -2493,7 +2487,7 @@ public U Test<U>(U val)
verifier.VerifyDiagnostics();
verifier.VerifyIL("C.<Test>d__1<T>.System.Runtime.CompilerServices.IAsyncStateMachine.MoveNext()", @"
{
// Code size 1
87 (0xbb
)
// Code size 1
79 (0xb3
)
.maxstack 3
.locals init (int V_0,
T V_1,
...
...
@@ -2533,7 +2527,7 @@ .maxstack 3
IL_0044: ldloca.s V_2
IL_0046: ldarg.0
IL_0047: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T>.AwaitUnsafeOnCompleted<System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter, C.<Test>d__1<T>>(ref System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter, ref C.<Test>d__1<T>)""
IL_004c: leave.s IL_00b
a
IL_004c: leave.s IL_00b
2
IL_004e: ldarg.0
IL_004f: ldfld ""System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter C.<Test>d__1<T>.<>u__1""
IL_0054: stloc.2
...
...
@@ -2547,36 +2541,34 @@ .maxstack 3
IL_0065: stfld ""int C.<Test>d__1<T>.<>1__state""
IL_006a: ldloca.s V_2
IL_006c: call ""void System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter.GetResult()""
IL_0071: ldloca.s V_2
IL_0073: initobj ""System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter""
IL_0079: ldarg.0
IL_007a: ldflda ""(int f1, int f2) C.<Test>d__1<T>.<x>5__1""
IL_007f: ldarg.0
IL_0080: ldfld ""T C.<Test>d__1<T>.a""
IL_0085: call ""T System.ValueTuple<int, int>.Test<T>(T)""
IL_008a: stloc.1
IL_008b: leave.s IL_00a6
IL_0071: ldarg.0
IL_0072: ldflda ""(int f1, int f2) C.<Test>d__1<T>.<x>5__1""
IL_0077: ldarg.0
IL_0078: ldfld ""T C.<Test>d__1<T>.a""
IL_007d: call ""T System.ValueTuple<int, int>.Test<T>(T)""
IL_0082: stloc.1
IL_0083: leave.s IL_009e
}
catch System.Exception
{
IL_008d: stloc.s V_4
IL_0085: stloc.s V_4
IL_0087: ldarg.0
IL_0088: ldc.i4.s -2
IL_008a: stfld ""int C.<Test>d__1<T>.<>1__state""
IL_008f: ldarg.0
IL_0090: ldc.i4.s -2
IL_0092: stfld ""int C.<Test>d__1<T>.<>1__state""
IL_0097: ldarg.0
IL_0098: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T> C.<Test>d__1<T>.<>t__builder""
IL_009d: ldloc.s V_4
IL_009f: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T>.SetException(System.Exception)""
IL_00a4: leave.s IL_00ba
IL_0090: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T> C.<Test>d__1<T>.<>t__builder""
IL_0095: ldloc.s V_4
IL_0097: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T>.SetException(System.Exception)""
IL_009c: leave.s IL_00b2
}
IL_009e: ldarg.0
IL_009f: ldc.i4.s -2
IL_00a1: stfld ""int C.<Test>d__1<T>.<>1__state""
IL_00a6: ldarg.0
IL_00a7: ldc.i4.s -2
IL_00a9: stfld ""int C.<Test>d__1<T>.<>1__state""
IL_00ae: ldarg.0
IL_00af: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T> C.<Test>d__1<T>.<>t__builder""
IL_00b4: ldloc.1
IL_00b5: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T>.SetResult(T)""
IL_00ba: ret
IL_00a7: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T> C.<Test>d__1<T>.<>t__builder""
IL_00ac: ldloc.1
IL_00ad: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<T>.SetResult(T)""
IL_00b2: ret
}
");
}
...
...
@@ -19264,7 +19256,7 @@ static async Task<long> Test()
// NOTE: !!! There should be an IL local for " (byte x, int y) v2 " , it should not be captured
verifier.VerifyIL("C.<Test>d__1.System.Runtime.CompilerServices.IAsyncStateMachine.MoveNext()", @"
{
// Code size
201 (0xc9
)
// Code size
193 (0xc1
)
.maxstack 3
.locals init (int V_0,
long V_1,
...
...
@@ -19311,7 +19303,7 @@ .maxstack 3
IL_0058: ldloca.s V_3
IL_005a: ldarg.0
IL_005b: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<long>.AwaitUnsafeOnCompleted<System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter, C.<Test>d__1>(ref System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter, ref C.<Test>d__1)""
IL_0060: leave.s IL_00c
8
IL_0060: leave.s IL_00c
0
IL_0062: ldarg.0
IL_0063: ldfld ""System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter C.<Test>d__1.<>u__1""
IL_0068: stloc.3
...
...
@@ -19325,34 +19317,32 @@ .maxstack 3
IL_0079: stfld ""int C.<Test>d__1.<>1__state""
IL_007e: ldloca.s V_3
IL_0080: call ""void System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter.GetResult()""
IL_0085: ldloca.s V_3
IL_0087: initobj ""System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter""
IL_008d: ldarg.0
IL_008e: ldflda ""(long a, int b) C.<Test>d__1.<v1>5__1""
IL_0093: ldfld ""long System.ValueTuple<long, int>.Item1""
IL_0098: stloc.1
IL_0099: leave.s IL_00b4
IL_0085: ldarg.0
IL_0086: ldflda ""(long a, int b) C.<Test>d__1.<v1>5__1""
IL_008b: ldfld ""long System.ValueTuple<long, int>.Item1""
IL_0090: stloc.1
IL_0091: leave.s IL_00ac
}
catch System.Exception
{
IL_009b: stloc.s V_5
IL_0093: stloc.s V_5
IL_0095: ldarg.0
IL_0096: ldc.i4.s -2
IL_0098: stfld ""int C.<Test>d__1.<>1__state""
IL_009d: ldarg.0
IL_009e: ldc.i4.s -2
IL_00a0: stfld ""int C.<Test>d__1.<>1__state""
IL_00a5: ldarg.0
IL_00a6: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<long> C.<Test>d__1.<>t__builder""
IL_00ab: ldloc.s V_5
IL_00ad: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<long>.SetException(System.Exception)""
IL_00b2: leave.s IL_00c8
IL_009e: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<long> C.<Test>d__1.<>t__builder""
IL_00a3: ldloc.s V_5
IL_00a5: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<long>.SetException(System.Exception)""
IL_00aa: leave.s IL_00c0
}
IL_00ac: ldarg.0
IL_00ad: ldc.i4.s -2
IL_00af: stfld ""int C.<Test>d__1.<>1__state""
IL_00b4: ldarg.0
IL_00b5: ldc.i4.s -2
IL_00b7: stfld ""int C.<Test>d__1.<>1__state""
IL_00bc: ldarg.0
IL_00bd: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<long> C.<Test>d__1.<>t__builder""
IL_00c2: ldloc.1
IL_00c3: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<long>.SetResult(long)""
IL_00c8: ret
IL_00b5: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<long> C.<Test>d__1.<>t__builder""
IL_00ba: ldloc.1
IL_00bb: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<long>.SetResult(long)""
IL_00c0: ret
}
");
}
...
...
src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/EditAndContinueStateMachineTests.cs
浏览文件 @
7fd5341e
此差异已折叠。
点击以展开。
src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/LocalSlotMappingTests.cs
浏览文件 @
7fd5341e
...
...
@@ -2969,7 +2969,7 @@ public async Task<int> F()
v0
.
VerifyIL
(
"C.<F>d__0.System.Runtime.CompilerServices.IAsyncStateMachine.MoveNext"
,
@"
{
// Code size 2
54 (0xfe
)
// Code size 2
46 (0xf6
)
.maxstack 3
.locals init (int V_0,
int V_1,
...
...
@@ -3047,7 +3047,7 @@ .maxstack 3
IL_0094: ldloca.s V_3
IL_0096: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<int>.AwaitUnsafeOnCompleted<System.Runtime.CompilerServices.TaskAwaiter<int>, C.<F>d__0>(ref System.Runtime.CompilerServices.TaskAwaiter<int>, ref C.<F>d__0)""
IL_009b: nop
IL_009c: leave.s IL_00f
d
IL_009c: leave.s IL_00f
5
>IL_009e: ldarg.0
IL_009f: ldfld ""System.Runtime.CompilerServices.TaskAwaiter<int> C.<F>d__0.<>u__1""
IL_00a4: stloc.2
...
...
@@ -3062,34 +3062,32 @@ .maxstack 3
IL_00ba: ldloca.s V_2
IL_00bc: call ""int System.Runtime.CompilerServices.TaskAwaiter<int>.GetResult()""
IL_00c1: pop
IL_00c2: ldloca.s V_2
IL_00c4: initobj ""System.Runtime.CompilerServices.TaskAwaiter<int>""
-IL_00ca: ldc.i4.1
IL_00cb: stloc.1
IL_00cc: leave.s IL_00e8
-IL_00c2: ldc.i4.1
IL_00c3: stloc.1
IL_00c4: leave.s IL_00e0
}
catch System.Exception
{
~IL_00ce: stloc.s V_4
~IL_00c6: stloc.s V_4
IL_00c8: ldarg.0
IL_00c9: ldc.i4.s -2
IL_00cb: stfld ""int C.<F>d__0.<>1__state""
IL_00d0: ldarg.0
IL_00d1: ldc.i4.s -2
IL_00d3: stfld ""int C.<F>d__0.<>1__state""
IL_00d8: ldarg.0
IL_00d9: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<int> C.<F>d__0.<>t__builder""
IL_00de: ldloc.s V_4
IL_00e0: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<int>.SetException(System.Exception)""
IL_00e5: nop
IL_00e6: leave.s IL_00fd
IL_00d1: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<int> C.<F>d__0.<>t__builder""
IL_00d6: ldloc.s V_4
IL_00d8: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<int>.SetException(System.Exception)""
IL_00dd: nop
IL_00de: leave.s IL_00f5
}
-IL_00e
8
: ldarg.0
IL_00e
9
: ldc.i4.s -2
IL_00e
b
: stfld ""int C.<F>d__0.<>1__state""
~IL_00
f0
: ldarg.0
IL_00
f1
: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<int> C.<F>d__0.<>t__builder""
IL_00
f6
: ldloc.1
IL_00
f7
: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<int>.SetResult(int)""
IL_00f
c
: nop
IL_00f
d
: ret
-IL_00e
0
: ldarg.0
IL_00e
1
: ldc.i4.s -2
IL_00e
3
: stfld ""int C.<F>d__0.<>1__state""
~IL_00
e8
: ldarg.0
IL_00
e9
: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<int> C.<F>d__0.<>t__builder""
IL_00
ee
: ldloc.1
IL_00
ef
: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<int>.SetResult(int)""
IL_00f
4
: nop
IL_00f
5
: ret
}
"
,
sequencePoints
:
"C+<F>d__0.MoveNext"
);
...
...
src/Compilers/CSharp/Test/Emit/PDB/PDBAsyncTests.cs
浏览文件 @
7fd5341e
此差异已折叠。
点击以展开。
src/Compilers/CSharp/Test/Semantic/Semantics/BindingAwaitTests.cs
浏览文件 @
7fd5341e
...
...
@@ -1894,11 +1894,11 @@ class C
var
calls
=
actualIL
.
Split
(
new
[]
{
'\n'
,
'\r'
},
System
.
StringSplitOptions
.
RemoveEmptyEntries
).
Where
(
s
=>
s
.
Contains
(
"OnCompleted"
)).
ToArray
();
Assert
.
Equal
(
calls
.
Length
,
6
);
Assert
.
Equal
(
" IL_0056: call \"void System.Runtime.CompilerServices.AsyncVoidMethodBuilder.AwaitOnCompleted<T1, C.<F>d__0<T1, T2, T3, T4, T5, T6>>(ref T1, ref C.<F>d__0<T1, T2, T3, T4, T5, T6>)\""
,
calls
[
0
]);
Assert
.
Equal
(
" IL_00
c1
: call \"void System.Runtime.CompilerServices.AsyncVoidMethodBuilder.AwaitUnsafeOnCompleted<T2, C.<F>d__0<T1, T2, T3, T4, T5, T6>>(ref T2, ref C.<F>d__0<T1, T2, T3, T4, T5, T6>)\""
,
calls
[
1
]);
Assert
.
Equal
(
" IL_01
2
c: call \"void System.Runtime.CompilerServices.AsyncVoidMethodBuilder.AwaitUnsafeOnCompleted<T3, C.<F>d__0<T1, T2, T3, T4, T5, T6>>(ref T3, ref C.<F>d__0<T1, T2, T3, T4, T5, T6>)\""
,
calls
[
2
]);
Assert
.
Equal
(
" IL_01
9a
: call \"void System.Runtime.CompilerServices.AsyncVoidMethodBuilder.AwaitOnCompleted<T4, C.<F>d__0<T1, T2, T3, T4, T5, T6>>(ref T4, ref C.<F>d__0<T1, T2, T3, T4, T5, T6>)\""
,
calls
[
3
]);
Assert
.
Equal
(
" IL_0
20
a: call \"void System.Runtime.CompilerServices.AsyncVoidMethodBuilder.AwaitUnsafeOnCompleted<T5, C.<F>d__0<T1, T2, T3, T4, T5, T6>>(ref T5, ref C.<F>d__0<T1, T2, T3, T4, T5, T6>)\""
,
calls
[
4
]);
Assert
.
Equal
(
" IL_02
7a
: call \"void System.Runtime.CompilerServices.AsyncVoidMethodBuilder.AwaitUnsafeOnCompleted<T6, C.<F>d__0<T1, T2, T3, T4, T5, T6>>(ref T6, ref C.<F>d__0<T1, T2, T3, T4, T5, T6>)\""
,
calls
[
5
]);
Assert
.
Equal
(
" IL_00
b9
: call \"void System.Runtime.CompilerServices.AsyncVoidMethodBuilder.AwaitUnsafeOnCompleted<T2, C.<F>d__0<T1, T2, T3, T4, T5, T6>>(ref T2, ref C.<F>d__0<T1, T2, T3, T4, T5, T6>)\""
,
calls
[
1
]);
Assert
.
Equal
(
" IL_01
1
c: call \"void System.Runtime.CompilerServices.AsyncVoidMethodBuilder.AwaitUnsafeOnCompleted<T3, C.<F>d__0<T1, T2, T3, T4, T5, T6>>(ref T3, ref C.<F>d__0<T1, T2, T3, T4, T5, T6>)\""
,
calls
[
2
]);
Assert
.
Equal
(
" IL_01
82
: call \"void System.Runtime.CompilerServices.AsyncVoidMethodBuilder.AwaitOnCompleted<T4, C.<F>d__0<T1, T2, T3, T4, T5, T6>>(ref T4, ref C.<F>d__0<T1, T2, T3, T4, T5, T6>)\""
,
calls
[
3
]);
Assert
.
Equal
(
" IL_0
1e
a: call \"void System.Runtime.CompilerServices.AsyncVoidMethodBuilder.AwaitUnsafeOnCompleted<T5, C.<F>d__0<T1, T2, T3, T4, T5, T6>>(ref T5, ref C.<F>d__0<T1, T2, T3, T4, T5, T6>)\""
,
calls
[
4
]);
Assert
.
Equal
(
" IL_02
52
: call \"void System.Runtime.CompilerServices.AsyncVoidMethodBuilder.AwaitUnsafeOnCompleted<T6, C.<F>d__0<T1, T2, T3, T4, T5, T6>>(ref T6, ref C.<F>d__0<T1, T2, T3, T4, T5, T6>)\""
,
calls
[
5
]);
}
[
Fact
]
...
...
src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/DynamicTests.cs
浏览文件 @
7fd5341e
...
...
@@ -1050,7 +1050,7 @@ static void G(Func<Task<object>> f)
var
methodData
=
testData
.
GetMethodData
(
"<>x.<>c__DisplayClass0_0.<<<>m0>b__0>d.System.Runtime.CompilerServices.IAsyncStateMachine.MoveNext()"
);
methodData
.
VerifyIL
(
@"
{
// Code size 54
4 (0x220
)
// Code size 54
2 (0x21e
)
.maxstack 10
.locals init (int V_0,
<>x.<>c__DisplayClass0_0 V_1,
...
...
@@ -1183,7 +1183,7 @@ .maxstack 10
IL_017d: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<object>.AwaitUnsafeOnCompleted<System.Runtime.CompilerServices.ICriticalNotifyCompletion, <>x.<>c__DisplayClass0_0.<<<>m0>b__0>d>(ref System.Runtime.CompilerServices.ICriticalNotifyCompletion, ref <>x.<>c__DisplayClass0_0.<<<>m0>b__0>d)""
IL_0182: ldnull
IL_0183: stloc.s V_4
IL_0185: leave IL_021
f
IL_0185: leave IL_021
d
IL_018a: ldarg.0
IL_018b: ldfld ""object <>x.<>c__DisplayClass0_0.<<<>m0>b__0>d.<>u__1""
IL_0190: stloc.3
...
...
@@ -1218,31 +1218,29 @@ .maxstack 10
IL_01e2: ldsfld ""System.Runtime.CompilerServices.CallSite<System.Func<System.Runtime.CompilerServices.CallSite, dynamic, dynamic>> <>x.<>c__DisplayClass0_0.<<<>m0>b__0>d.<>o.<>p__3""
IL_01e7: ldloc.3
IL_01e8: callvirt ""dynamic System.Func<System.Runtime.CompilerServices.CallSite, dynamic, dynamic>.Invoke(System.Runtime.CompilerServices.CallSite, dynamic)""
IL_01ed: ldnull
IL_01ee: stloc.3
IL_01ef: stloc.2
IL_01f0: leave.s IL_020b
IL_01ed: stloc.2
IL_01ee: leave.s IL_0209
}
catch System.Exception
{
IL_01f
2
: stloc.s V_6
IL_01f
4
: ldarg.0
IL_01f
5
: ldc.i4.s -2
IL_01f
7
: stfld ""int <>x.<>c__DisplayClass0_0.<<<>m0>b__0>d.<>1__state""
IL_01f
c
: ldarg.0
IL_01f
d
: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<object> <>x.<>c__DisplayClass0_0.<<<>m0>b__0>d.<>t__builder""
IL_020
2
: ldloc.s V_6
IL_020
4
: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<object>.SetException(System.Exception)""
IL_020
9: leave.s IL_021f
IL_01f
0
: stloc.s V_6
IL_01f
2
: ldarg.0
IL_01f
3
: ldc.i4.s -2
IL_01f
5
: stfld ""int <>x.<>c__DisplayClass0_0.<<<>m0>b__0>d.<>1__state""
IL_01f
a
: ldarg.0
IL_01f
b
: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<object> <>x.<>c__DisplayClass0_0.<<<>m0>b__0>d.<>t__builder""
IL_020
0
: ldloc.s V_6
IL_020
2
: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<object>.SetException(System.Exception)""
IL_020
7: leave.s IL_021d
}
IL_020
b
: ldarg.0
IL_020
c
: ldc.i4.s -2
IL_020
e
: stfld ""int <>x.<>c__DisplayClass0_0.<<<>m0>b__0>d.<>1__state""
IL_021
3
: ldarg.0
IL_021
4
: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<object> <>x.<>c__DisplayClass0_0.<<<>m0>b__0>d.<>t__builder""
IL_021
9
: ldloc.2
IL_021
a
: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<object>.SetResult(object)""
IL_021
f
: ret
IL_020
9
: ldarg.0
IL_020
a
: ldc.i4.s -2
IL_020
c
: stfld ""int <>x.<>c__DisplayClass0_0.<<<>m0>b__0>d.<>1__state""
IL_021
1
: ldarg.0
IL_021
2
: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder<object> <>x.<>c__DisplayClass0_0.<<<>m0>b__0>d.<>t__builder""
IL_021
7
: ldloc.2
IL_021
8
: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<object>.SetResult(object)""
IL_021
d
: ret
}
"
);
});
...
...
src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/LocalsTests.cs
浏览文件 @
7fd5341e
...
...
@@ -2090,10 +2090,9 @@ static async Task M(object x)
.maxstack 1
.locals init (int V_0,
System.Runtime.CompilerServices.TaskAwaiter<object> V_1,
object V_2,
C.<M>d__1 V_3,
System.Runtime.CompilerServices.TaskAwaiter<object> V_4,
System.Exception V_5)
C.<M>d__1 V_2,
System.Runtime.CompilerServices.TaskAwaiter<object> V_3,
System.Exception V_4)
IL_0000: ldarg.0
IL_0001: ldfld ""object C.<M>d__1.x""
IL_0006: ret
...
...
@@ -2104,10 +2103,9 @@ .maxstack 1
.maxstack 1
.locals init (int V_0,
System.Runtime.CompilerServices.TaskAwaiter<object> V_1,
object V_2,
C.<M>d__1 V_3,
System.Runtime.CompilerServices.TaskAwaiter<object> V_4,
System.Exception V_5)
C.<M>d__1 V_2,
System.Runtime.CompilerServices.TaskAwaiter<object> V_3,
System.Exception V_4)
IL_0000: ldarg.0
IL_0001: ldfld ""object C.<M>d__1.<y>5__1""
IL_0006: ret
...
...
@@ -2162,12 +2160,11 @@ static async Task M(object x)
.maxstack 1
.locals init (int V_0,
System.Runtime.CompilerServices.TaskAwaiter<object> V_1,
object
V_2,
C.<M>d__1
V_3,
C.<M>d__1
V_2,
System.Runtime.CompilerServices.TaskAwaiter<object>
V_3,
System.Runtime.CompilerServices.TaskAwaiter<object> V_4,
System.Runtime.CompilerServices.TaskAwaiter<object> V_5,
System.Runtime.CompilerServices.TaskAwaiter<object> V_6,
System.Exception V_7)
System.Exception V_6)
IL_0000: ldarg.0
IL_0001: ldfld ""object C.<M>d__1.x""
IL_0006: ret
...
...
@@ -2178,12 +2175,11 @@ .maxstack 1
.maxstack 1
.locals init (int V_0,
System.Runtime.CompilerServices.TaskAwaiter<object> V_1,
object
V_2,
C.<M>d__1
V_3,
C.<M>d__1
V_2,
System.Runtime.CompilerServices.TaskAwaiter<object>
V_3,
System.Runtime.CompilerServices.TaskAwaiter<object> V_4,
System.Runtime.CompilerServices.TaskAwaiter<object> V_5,
System.Runtime.CompilerServices.TaskAwaiter<object> V_6,
System.Exception V_7)
System.Exception V_6)
IL_0000: ldarg.0
IL_0001: ldfld ""int C.<M>d__1.<y>5__1""
IL_0006: ret
...
...
@@ -2203,28 +2199,27 @@ .maxstack 1
.maxstack 1
.locals init (int V_0,
System.Runtime.CompilerServices.TaskAwaiter<object> V_1,
object
V_2,
C.<M>d__1
V_3,
C.<M>d__1
V_2,
System.Runtime.CompilerServices.TaskAwaiter<object>
V_3,
System.Runtime.CompilerServices.TaskAwaiter<object> V_4,
System.Runtime.CompilerServices.TaskAwaiter<object> V_5,
System.Runtime.CompilerServices.TaskAwaiter<object> V_6,
System.Exception V_7)
System.Exception V_6)
IL_0000: ldarg.0
IL_0001: ldfld ""object C.<M>d__1.x""
IL_0006: ret
}"
);
}
"
);
VerifyLocal
(
testData
,
"<>x"
,
locals
[
1
],
"<>m1"
,
"y"
,
expectedILOpt
:
@"{
// Code size 7 (0x7)
.maxstack 1
.locals init (int V_0,
System.Runtime.CompilerServices.TaskAwaiter<object> V_1,
object
V_2,
C.<M>d__1
V_3,
C.<M>d__1
V_2,
System.Runtime.CompilerServices.TaskAwaiter<object>
V_3,
System.Runtime.CompilerServices.TaskAwaiter<object> V_4,
System.Runtime.CompilerServices.TaskAwaiter<object> V_5,
System.Runtime.CompilerServices.TaskAwaiter<object> V_6,
System.Exception V_7)
System.Exception V_6)
IL_0000: ldarg.0
IL_0001: ldfld ""long C.<M>d__1.<y>5__3""
IL_0006: ret
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录