Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
0c824b98
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,发现更多精彩内容 >>
提交
0c824b98
编写于
8月 10, 2016
作者:
T
Tomáš Matoušek
提交者:
GitHub
8月 10, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update SRM reference to 1.4.1-beta-24410-02 (#13071)
上级
e4adebbe
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
54 addition
and
47 deletion
+54
-47
build/Targets/Dependencies.props
build/Targets/Dependencies.props
+1
-1
src/Compilers/Core/Portable/PEWriter/MetadataWriter.cs
src/Compilers/Core/Portable/PEWriter/MetadataWriter.cs
+45
-37
src/Compilers/Core/Portable/PEWriter/PeWriter.cs
src/Compilers/Core/Portable/PEWriter/PeWriter.cs
+1
-2
src/Compilers/Core/Portable/project.json
src/Compilers/Core/Portable/project.json
+2
-2
src/Dependencies/Metadata/project.json
src/Dependencies/Metadata/project.json
+1
-1
src/Test/PdbUtilities/project.json
src/Test/PdbUtilities/project.json
+1
-1
src/Tools/ProcessWatchdog/project.json
src/Tools/ProcessWatchdog/project.json
+1
-1
src/Tools/SignRoslyn/project.json
src/Tools/SignRoslyn/project.json
+1
-1
src/Tools/Source/RunTests/project.json
src/Tools/Source/RunTests/project.json
+1
-1
未找到文件。
build/Targets/Dependencies.props
浏览文件 @
0c824b98
...
...
@@ -34,7 +34,7 @@
<SystemNetSocketsVersion>
4.1.0
</SystemNetSocketsVersion>
<SystemReflectionVersion>
4.1.0
</SystemReflectionVersion>
<SystemReflectionExtensionsVersion>
4.0.1
</SystemReflectionExtensionsVersion>
<SystemReflectionMetadataVersion>
1.4.1-beta-24
322-03
</SystemReflectionMetadataVersion>
<SystemReflectionMetadataVersion>
1.4.1-beta-24
410-02
</SystemReflectionMetadataVersion>
<SystemReflectionPrimitivesVersion>
4.0.1
</SystemReflectionPrimitivesVersion>
<SystemReflectionTypeExtensionsVersion>
4.1.0
</SystemReflectionTypeExtensionsVersion>
<SystemResourcesResourceManagerVersion>
4.0.1
</SystemResourcesResourceManagerVersion>
...
...
src/Compilers/Core/Portable/PEWriter/MetadataWriter.cs
浏览文件 @
0c824b98
...
...
@@ -1739,7 +1739,11 @@ public void WriteMetadataAndIL(PdbWriter pdbWriterOpt, Stream metadataStream, St
Debug
.
Assert
(
mvidFixup
.
IsDefault
);
Debug
.
Assert
(
mvidStringFixup
.
IsDefault
);
var
rootBuilder
=
new
MetadataRootBuilder
(
metadata
,
module
.
Properties
.
TargetRuntimeVersion
);
// TODO (https://github.com/dotnet/roslyn/issues/3905):
// InterfaceImpl table emitted by Roslyn is not compliant with ECMA spec.
// Once fixed enable validation in DEBUG builds.
var
rootBuilder
=
new
MetadataRootBuilder
(
metadata
,
module
.
Properties
.
TargetRuntimeVersion
,
suppressValidation
:
true
);
rootBuilder
.
Serialize
(
metadataBuilder
,
methodBodyStreamRva
:
0
,
mappedFieldDataStreamRva
:
0
);
metadataSizes
=
rootBuilder
.
Sizes
;
...
...
@@ -1789,7 +1793,10 @@ public void WriteMetadataAndIL(PdbWriter pdbWriterOpt, Stream metadataStream, St
public
MetadataRootBuilder
GetRootBuilder
()
{
return
new
MetadataRootBuilder
(
metadata
,
module
.
Properties
.
TargetRuntimeVersion
);
// TODO (https://github.com/dotnet/roslyn/issues/3905):
// InterfaceImpl table emitted by Roslyn is not compliant with ECMA spec.
// Once fixed enable validation in DEBUG builds.
return
new
MetadataRootBuilder
(
metadata
,
module
.
Properties
.
TargetRuntimeVersion
,
suppressValidation
:
true
);
}
public
PortablePdbBuilder
GetPortablePdbBuilder
(
MetadataSizes
typeSystemMetadataSizes
,
MethodDefinitionHandle
debugEntryPoint
,
Func
<
IEnumerable
<
Blob
>,
BlobContentId
>
deterministicIdProviderOpt
)
...
...
@@ -2612,8 +2619,10 @@ private void PopulateModuleTableRow(out Blob mvidFixup)
else
{
// The guid will be filled in later:
mvidHandle
=
metadata
.
ReserveGuid
(
out
mvidFixup
);
new
BlobWriter
(
mvidFixup
).
WriteBytes
(
0
,
mvidFixup
.
Length
);
var
reservedGuid
=
metadata
.
ReserveGuid
();
mvidFixup
=
reservedGuid
.
Content
;
mvidHandle
=
reservedGuid
.
Handle
;
reservedGuid
.
CreateWriter
().
WriteBytes
(
0
,
mvidFixup
.
Length
);
}
metadata
.
AddModule
(
...
...
@@ -2787,7 +2796,7 @@ private int[] SerializeMethodBodies(BlobBuilder ilBuilder, PdbWriter pdbWriterOp
var
lastLocalVariableHandle
=
default
(
LocalVariableHandle
);
var
lastLocalConstantHandle
=
default
(
LocalConstantHandle
);
var
encoder
=
new
MethodBod
ies
Encoder
(
ilBuilder
);
var
encoder
=
new
MethodBod
yStream
Encoder
(
ilBuilder
);
var
mvidStringHandle
=
default
(
UserStringHandle
);
mvidStringFixup
=
default
(
Blob
);
...
...
@@ -2843,7 +2852,7 @@ private int[] SerializeMethodBodies(BlobBuilder ilBuilder, PdbWriter pdbWriterOp
return
bodyOffsets
;
}
private
int
SerializeMethodBody
(
MethodBod
ies
Encoder
encoder
,
IMethodBody
methodBody
,
StandaloneSignatureHandle
localSignatureHandleOpt
,
ref
UserStringHandle
mvidStringHandle
,
ref
Blob
mvidStringFixup
)
private
int
SerializeMethodBody
(
MethodBod
yStream
Encoder
encoder
,
IMethodBody
methodBody
,
StandaloneSignatureHandle
localSignatureHandleOpt
,
ref
UserStringHandle
mvidStringHandle
,
ref
Blob
mvidStringFixup
)
{
int
ilLength
=
methodBody
.
IL
.
Length
;
var
exceptionRegions
=
methodBody
.
ExceptionRegions
;
...
...
@@ -2852,35 +2861,34 @@ private int SerializeMethodBody(MethodBodiesEncoder encoder, IMethodBody methodB
// Check if an identical method body has already been serialized.
// If so, use the RVA of the already serialized one.
// Note that we don't need to rewrite the fake tokens in the body before looking it up.
int
bodyOffset
;
// Don't do small body method caching during deterministic builds until this issue is fixed
// https://github.com/dotnet/roslyn/issues/7595
int
bodyOffset
;
if
(!
_deterministic
&&
isSmallBody
&&
_smallMethodBodies
.
TryGetValue
(
methodBody
.
IL
,
out
bodyOffset
))
{
return
bodyOffset
;
}
MethodBodyAttributes
attributes
=
(
methodBody
.
LocalsAreZeroed
?
MethodBodyAttributes
.
InitLocals
:
0
)
|
(
MayUseSmallExceptionHeaders
(
exceptionRegions
)
?
0
:
MethodBodyAttributes
.
LargeExceptionRegions
);
var
bodyEncoder
=
encoder
.
AddMethodBody
(
methodBody
.
MaxStack
,
exceptionRegions
.
Length
,
localSignatureHandleOpt
,
attributes
);
Blob
ilBlob
;
var
ehEncoder
=
bodyEncoder
.
WriteInstructions
(
methodBody
.
IL
,
out
bodyOffset
,
out
ilBlob
);
var
encodedBody
=
encoder
.
AddMethodBody
(
codeSize
:
methodBody
.
IL
.
Length
,
maxStack
:
methodBody
.
MaxStack
,
exceptionRegionCount
:
exceptionRegions
.
Length
,
hasSmallExceptionRegions
:
MayUseSmallExceptionHeaders
(
exceptionRegions
),
localVariablesSignature
:
localSignatureHandleOpt
,
attributes
:
(
methodBody
.
LocalsAreZeroed
?
MethodBodyAttributes
.
InitLocals
:
0
));
// Don't do small body method caching during deterministic builds until this issue is fixed
// https://github.com/dotnet/roslyn/issues/7595
if
(
isSmallBody
&&
!
_deterministic
)
{
_smallMethodBodies
.
Add
(
methodBody
.
IL
,
body
Offset
);
_smallMethodBodies
.
Add
(
methodBody
.
IL
,
encodedBody
.
Offset
);
}
SubstituteFakeTokens
(
ilBlob
,
methodBody
.
IL
,
ref
mvidStringHandle
,
ref
mvidStringFixup
);
SerializeMethodBodyExceptionHandlerTable
(
e
hEncoder
,
exceptionRegions
);
WriteInstructions
(
encodedBody
.
Instructions
,
methodBody
.
IL
,
ref
mvidStringHandle
,
ref
mvidStringFixup
);
SerializeMethodBodyExceptionHandlerTable
(
e
ncodedBody
.
ExceptionRegions
,
exceptionRegions
);
return
body
Offset
;
return
encodedBody
.
Offset
;
}
/// <summary>
...
...
@@ -3033,13 +3041,13 @@ private UserStringHandle GetOrAddUserString(string str)
return
default
(
UserStringHandle
);
}
private
UserStringHandle
ReserveUserString
(
int
length
,
out
Blob
fixup
)
private
ReservedBlob
<
UserStringHandle
>
ReserveUserString
(
int
length
)
{
if
(!
_userStringTokenOverflow
)
{
try
{
return
metadata
.
ReserveUserString
(
length
,
out
fixup
);
return
metadata
.
ReserveUserString
(
length
);
}
catch
(
ImageFormatLimitationException
)
{
...
...
@@ -3048,8 +3056,7 @@ private UserStringHandle ReserveUserString(int length, out Blob fixup)
}
}
fixup
=
default
(
Blob
);
return
default
(
UserStringHandle
);
return
default
(
ReservedBlob
<
UserStringHandle
>);
}
internal
const
uint
LiteralMethodDefinitionToken
=
0x80000000
;
...
...
@@ -3057,15 +3064,18 @@ private UserStringHandle ReserveUserString(int length, out Blob fixup)
internal
const
uint
SourceDocumentIndex
=
0x20000000
;
internal
const
uint
ModuleVersionIdStringToken
=
0x80000000
;
private
void
SubstituteFakeTokens
(
Blob
blob
,
ImmutableArray
<
byte
>
methodBody
IL
,
ref
UserStringHandle
mvidStringHandle
,
ref
Blob
mvidStringFixup
)
private
void
WriteInstructions
(
Blob
finalIL
,
ImmutableArray
<
byte
>
generated
IL
,
ref
UserStringHandle
mvidStringHandle
,
ref
Blob
mvidStringFixup
)
{
// write the raw body first and then patch tokens:
var
writer
=
new
BlobWriter
(
blob
);
var
writer
=
new
BlobWriter
(
finalIL
);
writer
.
WriteBytes
(
generatedIL
);
writer
.
Offset
=
0
;
int
offset
=
0
;
while
(
offset
<
methodBody
IL
.
Length
)
while
(
offset
<
generated
IL
.
Length
)
{
var
operandType
=
InstructionOperandTypes
.
ReadOperandType
(
methodBody
IL
,
ref
offset
);
var
operandType
=
InstructionOperandTypes
.
ReadOperandType
(
generated
IL
,
ref
offset
);
switch
(
operandType
)
{
case
OperandType
.
InlineField
:
...
...
@@ -3073,7 +3083,7 @@ private void SubstituteFakeTokens(Blob blob, ImmutableArray<byte> methodBodyIL,
case
OperandType
.
InlineTok
:
case
OperandType
.
InlineType
:
{
int
pseudoToken
=
ReadInt32
(
methodBody
IL
,
offset
);
int
pseudoToken
=
ReadInt32
(
generated
IL
,
offset
);
int
token
=
0
;
// If any bits in the high-order byte of the pseudotoken are nonzero, replace the opcode with Ldc_i4
// and either clear the high-order byte in the pseudotoken or ignore the pseudotoken.
...
...
@@ -3083,7 +3093,7 @@ private void SubstituteFakeTokens(Blob blob, ImmutableArray<byte> methodBodyIL,
int
tokenMask
=
pseudoToken
&
unchecked
((
int
)
0xff000000
);
if
(
tokenMask
!=
0
&&
(
uint
)
pseudoToken
!=
0xffffffff
)
{
Debug
.
Assert
(
ReadByte
(
methodBody
IL
,
offset
-
1
)
==
(
byte
)
ILOpCode
.
Ldtoken
);
Debug
.
Assert
(
ReadByte
(
generated
IL
,
offset
-
1
)
==
(
byte
)
ILOpCode
.
Ldtoken
);
writer
.
Offset
=
offset
-
1
;
writer
.
WriteByte
((
byte
)
ILOpCode
.
Ldc_i4
);
switch
((
uint
)
tokenMask
)
...
...
@@ -3112,7 +3122,7 @@ private void SubstituteFakeTokens(Blob blob, ImmutableArray<byte> methodBodyIL,
{
writer
.
Offset
=
offset
;
int
pseudoToken
=
ReadInt32
(
methodBody
IL
,
offset
);
int
pseudoToken
=
ReadInt32
(
generated
IL
,
offset
);
UserStringHandle
handle
;
if
((
uint
)
pseudoToken
==
ModuleVersionIdStringToken
)
...
...
@@ -3124,7 +3134,9 @@ private void SubstituteFakeTokens(Blob blob, ImmutableArray<byte> methodBodyIL,
{
const
int
guidStringLength
=
36
;
Debug
.
Assert
(
guidStringLength
==
default
(
Guid
).
ToString
().
Length
);
mvidStringHandle
=
ReserveUserString
(
guidStringLength
,
out
mvidStringFixup
);
var
reserved
=
ReserveUserString
(
guidStringLength
);
mvidStringHandle
=
reserved
.
Handle
;
mvidStringFixup
=
reserved
.
Content
;
}
handle
=
mvidStringHandle
;
...
...
@@ -3148,7 +3160,7 @@ private void SubstituteFakeTokens(Blob blob, ImmutableArray<byte> methodBodyIL,
break
;
case
OperandType
.
InlineSwitch
:
int
argCount
=
ReadInt32
(
methodBody
IL
,
offset
);
int
argCount
=
ReadInt32
(
generated
IL
,
offset
);
// skip switch arguments count and arguments
offset
+=
(
argCount
+
1
)
*
4
;
break
;
...
...
@@ -3179,13 +3191,11 @@ private void SubstituteFakeTokens(Blob blob, ImmutableArray<byte> methodBodyIL,
private
void
SerializeMethodBodyExceptionHandlerTable
(
ExceptionRegionEncoder
encoder
,
ImmutableArray
<
ExceptionHandlerRegion
>
regions
)
{
encoder
.
StartRegions
();
foreach
(
var
region
in
regions
)
{
var
exceptionType
=
region
.
ExceptionType
;
encoder
.
Add
Region
(
encoder
.
Add
(
region
.
HandlerKind
,
region
.
TryStartOffset
,
region
.
TryLength
,
...
...
@@ -3194,8 +3204,6 @@ private void SerializeMethodBodyExceptionHandlerTable(ExceptionRegionEncoder enc
(
exceptionType
!=
null
)
?
GetTypeHandle
(
exceptionType
)
:
default
(
EntityHandle
),
region
.
FilterDecisionStartOffset
);
}
encoder
.
EndRegions
();
}
private
static
bool
MayUseSmallExceptionHeaders
(
ImmutableArray
<
ExceptionHandlerRegion
>
exceptionRegions
)
...
...
src/Compilers/Core/Portable/PEWriter/PeWriter.cs
浏览文件 @
0c824b98
...
...
@@ -193,8 +193,7 @@ internal static class PeWriter
deterministicIdProvider
);
var
peBlob
=
new
BlobBuilder
();
BlobContentId
peContentId
;
peBuilder
.
Serialize
(
peBlob
,
out
peContentId
);
var
peContentId
=
peBuilder
.
Serialize
(
peBlob
);
PatchModuleVersionIds
(
mvidFixup
,
mvidStringFixup
,
peContentId
.
Guid
);
...
...
src/Compilers/Core/Portable/project.json
浏览文件 @
0c824b98
{
"supports"
:
{},
"dependencies"
:
{
"System.Collections.Immutable"
:
"1.2.0"
,
"System.Reflection.Metadata"
:
"1.4.1-beta-24322-03
"
"System.Collections.Immutable"
:
"1.2.0"
,
"System.Reflection.Metadata"
:
"1.4.1-beta-24410-02
"
},
"frameworks"
:
{
".NETPortable,Version=v4.5,Profile=Profile7"
:
{}
...
...
src/Dependencies/Metadata/project.json
浏览文件 @
0c824b98
{
"supports"
:
{},
"dependencies"
:
{
"System.Reflection.Metadata"
:
"1.4.1-beta-24
322-03
"
"System.Reflection.Metadata"
:
"1.4.1-beta-24
410-02
"
},
"frameworks"
:
{
".NETPortable,Version=v4.5,Profile=Profile7"
:
{}
...
...
src/Test/PdbUtilities/project.json
浏览文件 @
0c824b98
...
...
@@ -2,7 +2,7 @@
"supports"
:
{},
"dependencies"
:
{
"System.Collections.Immutable"
:
"1.2.0"
,
"System.Reflection.Metadata"
:
"1.4.1-beta-24
322-03
"
,
"System.Reflection.Metadata"
:
"1.4.1-beta-24
410-02
"
,
"Microsoft.DiaSymReader.Native"
:
"1.5.0-beta1"
,
"Microsoft.DiaSymReader"
:
"1.1.0-beta1-60625-03"
,
"Microsoft.DiaSymReader.PortablePdb"
:
"1.2.0-beta1-60723-01"
...
...
src/Tools/ProcessWatchdog/project.json
浏览文件 @
0c824b98
...
...
@@ -2,7 +2,7 @@
"dependencies"
:
{
"CommandLineParser"
:
"2.0.273-beta"
,
"System.Collections.Immutable"
:
"1.2.0"
,
"System.Reflection.Metadata"
:
"1.4.1-beta-24
322-03
"
,
"System.Reflection.Metadata"
:
"1.4.1-beta-24
410-02
"
,
},
"frameworks"
:
{
"net46"
:
{}
...
...
src/Tools/SignRoslyn/project.json
浏览文件 @
0c824b98
...
...
@@ -2,7 +2,7 @@
"supports"
:
{},
"dependencies"
:
{
"System.Collections.Immutable"
:
"1.2.0"
,
"System.Reflection.Metadata"
:
"1.4.1-beta-24
322-03
"
,
"System.Reflection.Metadata"
:
"1.4.1-beta-24
410-02
"
,
"Newtonsoft.Json"
:
"8.0.3"
},
"frameworks"
:
{
...
...
src/Tools/Source/RunTests/project.json
浏览文件 @
0c824b98
...
...
@@ -3,7 +3,7 @@
"Newtonsoft.Json"
:
"8.0.3"
,
"RestSharp"
:
"105.2.3"
,
"System.Collections.Immutable"
:
"1.2.0"
,
"System.Reflection.Metadata"
:
"1.4.1-beta-24
322-03
"
,
"System.Reflection.Metadata"
:
"1.4.1-beta-24
410-02
"
,
},
"frameworks"
:
{
"net46"
:
{}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录