Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
2c770dfa
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,发现更多精彩内容 >>
提交
2c770dfa
编写于
5月 14, 2015
作者:
T
Tomas Matousek
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove duplicate sequence point and unnecessary nops emitted to VB iterators
上级
829bc6b2
变更
8
展开全部
显示空白变更内容
内联
并排
Showing
8 changed file
with
2111 addition
and
1951 deletion
+2111
-1951
src/Compilers/CSharp/Test/Emit/PDB/PDBIteratorTests.cs
src/Compilers/CSharp/Test/Emit/PDB/PDBIteratorTests.cs
+48
-2
src/Compilers/VisualBasic/Portable/CodeGen/EmitStatement.vb
src/Compilers/VisualBasic/Portable/CodeGen/EmitStatement.vb
+12
-10
src/Compilers/VisualBasic/Portable/Lowering/IteratorRewriter/IteratorRewriter.IteratorMethodToClassRewriter.vb
...ewriter/IteratorRewriter.IteratorMethodToClassRewriter.vb
+0
-1
src/Compilers/VisualBasic/Test/Emit/CodeGen/CodeGenAsyncTests.vb
...pilers/VisualBasic/Test/Emit/CodeGen/CodeGenAsyncTests.vb
+276
-279
src/Compilers/VisualBasic/Test/Emit/Emit/EditAndContinue/EditAndContinueStateMachineTests.vb
.../Emit/EditAndContinue/EditAndContinueStateMachineTests.vb
+1218
-1256
src/Compilers/VisualBasic/Test/Emit/Emit/EditAndContinue/LocalSlotMappingTests.vb
...c/Test/Emit/Emit/EditAndContinue/LocalSlotMappingTests.vb
+209
-217
src/Compilers/VisualBasic/Test/Emit/PDB/PDBAsyncTests.vb
src/Compilers/VisualBasic/Test/Emit/PDB/PDBAsyncTests.vb
+247
-146
src/Compilers/VisualBasic/Test/Emit/PDB/PDBIteratorTests.vb
src/Compilers/VisualBasic/Test/Emit/PDB/PDBIteratorTests.vb
+101
-40
未找到文件。
src/Compilers/CSharp/Test/Emit/PDB/PDBIteratorTests.cs
浏览文件 @
2c770dfa
...
...
@@ -134,8 +134,54 @@ System.Collections.Generic.IEnumerable<int> Foo()
}
"
;
var
c
=
CreateCompilationWithMscorlibAndSystemCore
(
text
,
options
:
TestOptions
.
DebugDll
);
c
.
VerifyPdb
(
@"
var
v
=
CompileAndVerify
(
text
,
options
:
TestOptions
.
DebugDll
);
v
.
VerifyIL
(
"Program.<Foo>d__0.System.Collections.IEnumerator.MoveNext"
,
@"
{
// Code size 63 (0x3f)
.maxstack 2
.locals init (int V_0,
bool V_1)
~IL_0000: ldarg.0
IL_0001: ldfld ""int Program.<Foo>d__0.<>1__state""
IL_0006: stloc.0
IL_0007: ldloc.0
IL_0008: brfalse.s IL_0012
IL_000a: br.s IL_000c
IL_000c: ldloc.0
IL_000d: ldc.i4.1
IL_000e: beq.s IL_0014
IL_0010: br.s IL_0016
IL_0012: br.s IL_001a
IL_0014: br.s IL_0034
IL_0016: ldc.i4.0
IL_0017: stloc.1
IL_0018: ldloc.1
IL_0019: ret
IL_001a: ldarg.0
IL_001b: ldc.i4.m1
IL_001c: stfld ""int Program.<Foo>d__0.<>1__state""
-IL_0021: nop
-IL_0022: ldarg.0
IL_0023: ldc.i4.1
IL_0024: stfld ""int Program.<Foo>d__0.<>2__current""
IL_0029: ldarg.0
IL_002a: ldc.i4.1
IL_002b: stfld ""int Program.<Foo>d__0.<>1__state""
IL_0030: ldc.i4.1
IL_0031: stloc.1
IL_0032: br.s IL_0018
~IL_0034: ldarg.0
IL_0035: ldc.i4.m1
IL_0036: stfld ""int Program.<Foo>d__0.<>1__state""
-IL_003b: ldc.i4.0
IL_003c: stloc.1
IL_003d: br.s IL_0018
}
"
,
sequencePoints
:
"Program+<Foo>d__0.MoveNext"
);
v
.
VerifyPdb
(
@"
<symbols>
<methods>
<method containingType=""Program"" name=""Foo"">
...
...
src/Compilers/VisualBasic/Portable/CodeGen/EmitStatement.vb
浏览文件 @
2c770dfa
...
...
@@ -1162,13 +1162,14 @@ OtherExpressions:
cur
=
cur
+
1
' Emit case statement sequence point
If
_emitPdbSequencePoints
Then
Dim
caseStatement
=
caseBlock
.
CaseStatement
If
Not
caseStatement
.
WasCompilerGenerated
Then
Debug
.
Assert
(
caseStatement
.
Syntax
IsNot
Nothing
)
If
_emitPdbSequencePoints
Then
EmitSequencePoint
(
caseStatement
.
Syntax
)
End
If
End
If
If
_optimizations
=
OptimizationLevel
.
Debug
Then
' Emit nop for the case statement otherwise the above sequence point
...
...
@@ -1176,6 +1177,7 @@ OtherExpressions:
' This matches the native compiler codegen.
_builder
.
EmitOpCode
(
ILOpCode
.
Nop
)
End
If
End
If
' Emit case block body
EmitBlock
(
caseBlock
.
Body
)
...
...
src/Compilers/VisualBasic/Portable/Lowering/IteratorRewriter/IteratorRewriter.IteratorMethodToClassRewriter.vb
浏览文件 @
2c770dfa
...
...
@@ -75,7 +75,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
GenerateReturn
(
finished
:
=
True
),
F
.
Label
(
initialLabel
),
F
.
Assignment
(
F
.
Field
(
F
.
Me
,
Me
.
StateField
,
True
),
Me
.
F
.
AssignmentExpression
(
Me
.
F
.
Local
(
Me
.
CachedState
,
True
),
Me
.
F
.
Literal
(
StateMachineStates
.
NotStartedStateMachine
))),
F
.
SequencePoint
(
_originalMethodDeclaration
),
newBody
,
HandleReturn
()
))
...
...
src/Compilers/VisualBasic/Test/Emit/CodeGen/CodeGenAsyncTests.vb
浏览文件 @
2c770dfa
此差异已折叠。
点击以展开。
src/Compilers/VisualBasic/Test/Emit/Emit/EditAndContinue/EditAndContinueStateMachineTests.vb
浏览文件 @
2c770dfa
此差异已折叠。
点击以展开。
src/Compilers/VisualBasic/Test/Emit/Emit/EditAndContinue/LocalSlotMappingTests.vb
浏览文件 @
2c770dfa
此差异已折叠。
点击以展开。
src/Compilers/VisualBasic/Test/Emit/PDB/PDBAsyncTests.vb
浏览文件 @
2c770dfa
此差异已折叠。
点击以展开。
src/Compilers/VisualBasic/Test/Emit/PDB/PDBIteratorTests.vb
浏览文件 @
2c770dfa
...
...
@@ -7,6 +7,70 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests.PDB
Public
Class
PDBIteratorTests
Inherits
BasicTestBase
<
Fact
,
WorkItem
(
2736
,
"https://github.com/dotnet/roslyn/issues/2736"
)
>
Public
Sub
SimpleIterator
()
Dim
source
=
<
compilation
>
<
file
>
Imports
System.Collections.Generic
Class
C
Public
Iterator
Function
F
()
As
IEnumerable
(
Of
Integer
)
Yield
1
End
Function
End
Class
</
file
>
</
compilation
>
Dim
v
=
CompileAndVerify
(
source
,
options
:
=
TestOptions
.
DebugDll
)
v
.
VerifyIL
(
"C.VB$StateMachine_1_F.MoveNext"
,
"
{
// Code size 63 (0x3f)
.maxstack 3
.locals init (Boolean V_0,
Integer V_1)
~IL_0000: ldarg.0
IL_0001: ldfld
""
C.VB$StateMachine_1_F.$State As Integer
""
IL_0006: stloc.1
IL_0007: ldloc.1
IL_0008: brfalse.s IL_0012
IL_000a: br.s IL_000c
IL_000c: ldloc.1
IL_000d: ldc.i4.1
IL_000e: beq.s IL_0014
IL_0010: br.s IL_0016
IL_0012: br.s IL_0018
IL_0014: br.s IL_0034
IL_0016: ldc.i4.0
IL_0017: ret
IL_0018: ldarg.0
IL_0019: ldc.i4.m1
IL_001a: dup
IL_001b: stloc.1
IL_001c: stfld
""
C.VB$StateMachine_1_F.$State As Integer
""
-IL_0021: nop
-IL_0022: ldarg.0
IL_0023: ldc.i4.1
IL_0024: stfld
""
C.VB$StateMachine_1_F.$Current As Integer
""
IL_0029: ldarg.0
IL_002a: ldc.i4.1
IL_002b: dup
IL_002c: stloc.1
IL_002d: stfld
""
C.VB$StateMachine_1_F.$State As Integer
""
IL_0032: ldc.i4.1
IL_0033: ret
IL_0034: ldarg.0
IL_0035: ldc.i4.m1
IL_0036: dup
IL_0037: stloc.1
IL_0038: stfld
""
C.VB$StateMachine_1_F.$State As Integer
""
-IL_003d: ldc.i4.0
IL_003e: ret
}
"
,
sequencePoints
:
=
"C+VB$StateMachine_1_F.MoveNext"
)
End
Sub
<
Fact
,
WorkItem
(
651996
,
"DevDiv"
)
>
Public
Sub
IteratorLambdaWithForEach
()
Dim
source
=
...
...
@@ -49,13 +113,12 @@ End Module
</
customDebugInfo
>
<
sequencePoints
>
<
entry
offset
=
"0x0"
hidden
=
"true"
document
=
"0"
/>
<
entry
offset
=
"0x2f"
startLine
=
"7"
startColumn
=
"13"
endLine
=
"7"
endColumn
=
"33"
document
=
"0"
/>
<
entry
offset
=
"0x30"
startLine
=
"7"
startColumn
=
"13"
endLine
=
"7"
endColumn
=
"33"
document
=
"0"
/>
<
entry
offset
=
"0x31"
startLine
=
"8"
startColumn
=
"17"
endLine
=
"8"
endColumn
=
"24"
document
=
"0"
/>
<
entry
offset
=
"0x4c"
startLine
=
"9"
startColumn
=
"17"
endLine
=
"9"
endColumn
=
"24"
document
=
"0"
/>
<
entry
offset
=
"0x6c"
startLine
=
"10"
startColumn
=
"13"
endLine
=
"10"
endColumn
=
"25"
document
=
"0"
/>
<
entry
offset
=
"0x2c"
startLine
=
"7"
startColumn
=
"13"
endLine
=
"7"
endColumn
=
"33"
document
=
"0"
/>
<
entry
offset
=
"0x2d"
startLine
=
"8"
startColumn
=
"17"
endLine
=
"8"
endColumn
=
"24"
document
=
"0"
/>
<
entry
offset
=
"0x48"
startLine
=
"9"
startColumn
=
"17"
endLine
=
"9"
endColumn
=
"24"
document
=
"0"
/>
<
entry
offset
=
"0x68"
startLine
=
"10"
startColumn
=
"13"
endLine
=
"10"
endColumn
=
"25"
document
=
"0"
/>
</
sequencePoints
>
<
scope
startOffset
=
"0x0"
endOffset
=
"0x6
e
"
>
<
scope
startOffset
=
"0x0"
endOffset
=
"0x6
a
"
>
<
importsforward
declaringType
=
"Program"
methodName
=
"Main"
parameterNames
=
"args"
/>
</
scope
>
</
method
>
...
...
@@ -118,37 +181,36 @@ End Module
</
customDebugInfo
>
<
sequencePoints
>
<
entry
offset
=
"0x0"
hidden
=
"true"
document
=
"0"
/>
<
entry
offset
=
"0x46"
startLine
=
"12"
startColumn
=
"5"
endLine
=
"12"
endColumn
=
"55"
document
=
"0"
/>
<
entry
offset
=
"0x47"
startLine
=
"12"
startColumn
=
"5"
endLine
=
"12"
endColumn
=
"55"
document
=
"0"
/>
<
entry
offset
=
"0x48"
startLine
=
"13"
startColumn
=
"13"
endLine
=
"13"
endColumn
=
"19"
document
=
"0"
/>
<
entry
offset
=
"0x54"
startLine
=
"14"
startColumn
=
"9"
endLine
=
"14"
endColumn
=
"20"
document
=
"0"
/>
<
entry
offset
=
"0x5e"
startLine
=
"16"
startColumn
=
"9"
endLine
=
"16"
endColumn
=
"26"
document
=
"0"
/>
<
entry
offset
=
"0x71"
hidden
=
"true"
document
=
"0"
/>
<
entry
offset
=
"0x86"
startLine
=
"17"
startColumn
=
"13"
endLine
=
"17"
endColumn
=
"20"
document
=
"0"
/>
<
entry
offset
=
"0xa6"
startLine
=
"18"
startColumn
=
"13"
endLine
=
"18"
endColumn
=
"20"
document
=
"0"
/>
<
entry
offset
=
"0xc6"
startLine
=
"19"
startColumn
=
"9"
endLine
=
"19"
endColumn
=
"13"
document
=
"0"
/>
<
entry
offset
=
"0xc7"
hidden
=
"true"
document
=
"0"
/>
<
entry
offset
=
"0xd5"
hidden
=
"true"
document
=
"0"
/>
<
entry
offset
=
"0xe6"
hidden
=
"true"
document
=
"0"
/>
<
entry
offset
=
"0xe9"
startLine
=
"21"
startColumn
=
"9"
endLine
=
"21"
endColumn
=
"28"
document
=
"0"
/>
<
entry
offset
=
"0xfb"
hidden
=
"true"
document
=
"0"
/>
<
entry
offset
=
"0x114"
startLine
=
"22"
startColumn
=
"13"
endLine
=
"22"
endColumn
=
"44"
document
=
"0"
/>
<
entry
offset
=
"0x139"
startLine
=
"23"
startColumn
=
"13"
endLine
=
"23"
endColumn
=
"44"
document
=
"0"
/>
<
entry
offset
=
"0x15e"
startLine
=
"24"
startColumn
=
"9"
endLine
=
"24"
endColumn
=
"13"
document
=
"0"
/>
<
entry
offset
=
"0x15f"
hidden
=
"true"
document
=
"0"
/>
<
entry
offset
=
"0x16d"
hidden
=
"true"
document
=
"0"
/>
<
entry
offset
=
"0x181"
hidden
=
"true"
document
=
"0"
/>
<
entry
offset
=
"0x187"
startLine
=
"26"
startColumn
=
"5"
endLine
=
"26"
endColumn
=
"17"
document
=
"0"
/>
<
entry
offset
=
"0x41"
startLine
=
"12"
startColumn
=
"5"
endLine
=
"12"
endColumn
=
"55"
document
=
"0"
/>
<
entry
offset
=
"0x42"
startLine
=
"13"
startColumn
=
"13"
endLine
=
"13"
endColumn
=
"19"
document
=
"0"
/>
<
entry
offset
=
"0x4e"
startLine
=
"14"
startColumn
=
"9"
endLine
=
"14"
endColumn
=
"20"
document
=
"0"
/>
<
entry
offset
=
"0x58"
startLine
=
"16"
startColumn
=
"9"
endLine
=
"16"
endColumn
=
"26"
document
=
"0"
/>
<
entry
offset
=
"0x6b"
hidden
=
"true"
document
=
"0"
/>
<
entry
offset
=
"0x80"
startLine
=
"17"
startColumn
=
"13"
endLine
=
"17"
endColumn
=
"20"
document
=
"0"
/>
<
entry
offset
=
"0xa0"
startLine
=
"18"
startColumn
=
"13"
endLine
=
"18"
endColumn
=
"20"
document
=
"0"
/>
<
entry
offset
=
"0xc0"
startLine
=
"19"
startColumn
=
"9"
endLine
=
"19"
endColumn
=
"13"
document
=
"0"
/>
<
entry
offset
=
"0xc1"
hidden
=
"true"
document
=
"0"
/>
<
entry
offset
=
"0xcf"
hidden
=
"true"
document
=
"0"
/>
<
entry
offset
=
"0xe0"
hidden
=
"true"
document
=
"0"
/>
<
entry
offset
=
"0xe3"
startLine
=
"21"
startColumn
=
"9"
endLine
=
"21"
endColumn
=
"28"
document
=
"0"
/>
<
entry
offset
=
"0xf5"
hidden
=
"true"
document
=
"0"
/>
<
entry
offset
=
"0x10e"
startLine
=
"22"
startColumn
=
"13"
endLine
=
"22"
endColumn
=
"44"
document
=
"0"
/>
<
entry
offset
=
"0x133"
startLine
=
"23"
startColumn
=
"13"
endLine
=
"23"
endColumn
=
"44"
document
=
"0"
/>
<
entry
offset
=
"0x158"
startLine
=
"24"
startColumn
=
"9"
endLine
=
"24"
endColumn
=
"13"
document
=
"0"
/>
<
entry
offset
=
"0x159"
hidden
=
"true"
document
=
"0"
/>
<
entry
offset
=
"0x167"
hidden
=
"true"
document
=
"0"
/>
<
entry
offset
=
"0x17b"
hidden
=
"true"
document
=
"0"
/>
<
entry
offset
=
"0x181"
startLine
=
"26"
startColumn
=
"5"
endLine
=
"26"
endColumn
=
"17"
document
=
"0"
/>
</
sequencePoints
>
<
scope
startOffset
=
"0x0"
endOffset
=
"0x18
9
"
>
<
scope
startOffset
=
"0x0"
endOffset
=
"0x18
3
"
>
<
importsforward
declaringType
=
"Module1"
methodName
=
"Main"
/>
<
scope
startOffset
=
"0x4
7"
endOffset
=
"0x188
"
>
<
local
name
=
"$VB$ResumableLocal_arr$0"
il_index
=
"0"
il_start
=
"0x4
7"
il_end
=
"0x188
"
attributes
=
"0"
/>
<
scope
startOffset
=
"0x
73"
endOffset
=
"0xd4
"
>
<
local
name
=
"$VB$ResumableLocal_x$3"
il_index
=
"3"
il_start
=
"0x
73"
il_end
=
"0xd4
"
attributes
=
"0"
/>
<
scope
startOffset
=
"0x4
1"
endOffset
=
"0x182
"
>
<
local
name
=
"$VB$ResumableLocal_arr$0"
il_index
=
"0"
il_start
=
"0x4
1"
il_end
=
"0x182
"
attributes
=
"0"
/>
<
scope
startOffset
=
"0x
6d"
endOffset
=
"0xce
"
>
<
local
name
=
"$VB$ResumableLocal_x$3"
il_index
=
"3"
il_start
=
"0x
6d"
il_end
=
"0xce
"
attributes
=
"0"
/>
</
scope
>
<
scope
startOffset
=
"0xf
d"
endOffset
=
"0x16c
"
>
<
local
name
=
"$VB$ResumableLocal_x$6"
il_index
=
"6"
il_start
=
"0xf
d"
il_end
=
"0x16c
"
attributes
=
"0"
/>
<
scope
startOffset
=
"0xf
7"
endOffset
=
"0x166
"
>
<
local
name
=
"$VB$ResumableLocal_x$6"
il_index
=
"6"
il_start
=
"0xf
7"
il_end
=
"0x166
"
attributes
=
"0"
/>
</
scope
>
</
scope
>
</
scope
>
...
...
@@ -400,13 +462,12 @@ End Module
</
customDebugInfo
>
<
sequencePoints
>
<
entry
offset
=
"0x0"
hidden
=
"true"
document
=
"0"
/>
<
entry
offset
=
"0x2f"
startLine
=
"12"
startColumn
=
"5"
endLine
=
"13"
endColumn
=
"55"
document
=
"0"
/>
<
entry
offset
=
"0x30"
startLine
=
"13"
startColumn
=
"5"
endLine
=
"13"
endColumn
=
"55"
document
=
"0"
/>
<
entry
offset
=
"0x31"
startLine
=
"14"
startColumn
=
"9"
endLine
=
"14"
endColumn
=
"16"
document
=
"0"
/>
<
entry
offset
=
"0x4c"
startLine
=
"15"
startColumn
=
"9"
endLine
=
"15"
endColumn
=
"16"
document
=
"0"
/>
<
entry
offset
=
"0x67"
startLine
=
"16"
startColumn
=
"5"
endLine
=
"16"
endColumn
=
"17"
document
=
"0"
/>
<
entry
offset
=
"0x2c"
startLine
=
"13"
startColumn
=
"5"
endLine
=
"13"
endColumn
=
"55"
document
=
"0"
/>
<
entry
offset
=
"0x2d"
startLine
=
"14"
startColumn
=
"9"
endLine
=
"14"
endColumn
=
"16"
document
=
"0"
/>
<
entry
offset
=
"0x48"
startLine
=
"15"
startColumn
=
"9"
endLine
=
"15"
endColumn
=
"16"
document
=
"0"
/>
<
entry
offset
=
"0x63"
startLine
=
"16"
startColumn
=
"5"
endLine
=
"16"
endColumn
=
"17"
document
=
"0"
/>
</
sequencePoints
>
<
scope
startOffset
=
"0x0"
endOffset
=
"0x6
9
"
>
<
scope
startOffset
=
"0x0"
endOffset
=
"0x6
5
"
>
<
importsforward
declaringType
=
"Module1"
methodName
=
"Main"
/>
</
scope
>
</
method
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录