Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
2eb7dc7c
F
fsharp
项目概览
dotNET Platform
/
fsharp
10 个月 前同步成功
通知
0
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
fsharp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
2eb7dc7c
编写于
5月 08, 2022
作者:
I
Igor Bagdamyan
提交者:
GitHub
5月 08, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Changed node { return x } to node.Return x for better stacks/perf. (#13112)
上级
91fb7796
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
11 deletion
+10
-11
src/fsharp/BuildGraph.fs
src/fsharp/BuildGraph.fs
+2
-2
src/fsharp/service/IncrementalBuild.fs
src/fsharp/service/IncrementalBuild.fs
+6
-6
src/fsharp/service/service.fs
src/fsharp/service/service.fs
+2
-3
未找到文件。
src/fsharp/BuildGraph.fs
浏览文件 @
2eb7dc7c
...
...
@@ -237,7 +237,7 @@ type GraphNode<'T> (retryCompute: bool, computation: NodeCode<'T>) =
// This computation can only be canceled if the requestCount reaches zero.
let
!
result
=
computation
|>
Async
.
AwaitNodeCode
cachedResult
<-
Task
.
FromResult
(
result
)
cachedResultNode
<-
node
{
return
result
}
cachedResultNode
<-
node
.
Return
result
computation
<-
Unchecked
.
defaultof
<_>
if
not
callerCancellationToken
.
IsCancellationRequested
then
replyChannel
.
Reply
(
Ok
result
)
...
...
@@ -326,7 +326,7 @@ type GraphNode<'T> (retryCompute: bool, computation: NodeCode<'T>) =
},
(
fun
res
->
cachedResult
<-
Task
.
FromResult
(
res
)
cachedResultNode
<-
node
{
return
res
}
cachedResultNode
<-
node
.
Return
res
computation
<-
Unchecked
.
defaultof
<_>
tcs
.
SetResult
(
res
)
),
...
...
src/fsharp/service/IncrementalBuild.fs
浏览文件 @
2eb7dc7c
...
...
@@ -252,7 +252,7 @@ type TcInfoNode =
static
member
FromState
(
state
:
TcInfoState
)
=
let
tcInfo
=
state
.
TcInfo
let
tcInfoExtras
=
state
.
TcInfoExtras
TcInfoNode
(
GraphNode
(
node
{
return
tcInfo
}),
GraphNode
(
node
{
return
tcInfo
,
defaultArg
tcInfoExtras
emptyTcInfoExtras
}
))
TcInfoNode
(
GraphNode
(
node
.
Return
tcInfo
),
GraphNode
(
node
.
Return
(
tcInfo
,
defaultArg
tcInfoExtras
emptyTcInfoExtras
)
))
/// Bound model of an underlying syntax and typed tree.
[<
Sealed
>]
...
...
@@ -448,8 +448,8 @@ type BoundModel private (tcConfig: TcConfig,
member
private
this
.
TypeCheck
(
partialCheck
:
bool
)
:
NodeCode
<
TcInfoState
>
=
match
partialCheck
,
tcInfoStateOpt
with
|
true
,
Some
(
PartialState
_
as
state
)
|
true
,
Some
(
FullState
_
as
state
)
->
node
{
return
state
}
|
false
,
Some
(
FullState
_
as
state
)
->
node
{
return
state
}
|
true
,
Some
(
FullState
_
as
state
)
->
node
.
Return
state
|
false
,
Some
(
FullState
_
as
state
)
->
node
.
Return
state
|
_
->
node
{
...
...
@@ -1055,7 +1055,7 @@ module IncrementalBuilderStateHelpers =
|
ValueSome
(
boundModel
)
when
initialState
.
enablePartialTypeChecking
&&
boundModel
.
BackingSignature
.
IsSome
->
let
newBoundModel
=
boundModel
.
ClearTcInfoExtras
()
{
state
with
boundModels
=
state
.
boundModels
.
RemoveAt
(
slot
).
Insert
(
slot
,
GraphNode
(
node
{
return
newBoundModel
}
))
boundModels
=
state
.
boundModels
.
RemoveAt
(
slot
).
Insert
(
slot
,
GraphNode
(
node
.
Return
newBoundModel
))
stampedFileNames
=
state
.
stampedFileNames
.
SetItem
(
slot
,
StampFileNameTask
cache
fileInfo
)
}
|
_
->
...
...
@@ -1130,7 +1130,7 @@ type IncrementalBuilderState with
let
referencedAssemblies
=
initialState
.
referencedAssemblies
let
cache
=
TimeStampCache
(
defaultTimeStamp
)
let
initialBoundModel
=
GraphNode
(
node
{
return
initialBoundModel
}
)
let
initialBoundModel
=
GraphNode
(
node
.
Return
initialBoundModel
)
let
boundModels
=
BlockBuilder
.
create
fileNames
.
Length
for
slot
=
0
to
fileNames
.
Length
-
1
do
...
...
@@ -1648,4 +1648,4 @@ type IncrementalBuilder(initialState: IncrementalBuilderInitialState, state: Inc
|>
Array
.
map
(
fun
(
d
,
severity
)
->
FSharpDiagnostic
.
CreateFromException
(
d
,
severity
,
range
.
Zero
,
suggestNamesForErrors
))
return
builderOpt
,
diagnostics
}
}
\ No newline at end of file
src/fsharp/service/service.fs
浏览文件 @
2eb7dc7c
...
...
@@ -390,7 +390,7 @@ type BackgroundCompiler(
let
createBuilderNode
(
options
,
userOpName
,
ct
:
CancellationToken
)
=
lock
gate
(
fun
()
->
if
ct
.
IsCancellationRequested
then
GraphNode
(
node
{
return
None
,
[||]
}
)
GraphNode
(
node
.
Return
(
None
,
[||])
)
else
let
getBuilderNode
=
GraphNode
(
CreateOneIncrementalBuilder
(
options
,
userOpName
))
...
...
@@ -1412,5 +1412,4 @@ type CompilerEnvironment() =
/// Whether or not this file should be a single-file project
static
member
MustBeSingleFileProject
file
=
let
ext
=
Path
.
GetExtension
file
singleFileProjectExtensions
|>
List
.
exists
(
fun
e
->
0
=
String
.
Compare
(
e
,
ext
,
StringComparison
.
OrdinalIgnoreCase
))
singleFileProjectExtensions
|>
List
.
exists
(
fun
e
->
0
=
String
.
Compare
(
e
,
ext
,
StringComparison
.
OrdinalIgnoreCase
))
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录