Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
190f7030
F
fsharp
项目概览
dotNET Platform
/
fsharp
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
190f7030
编写于
1月 19, 2016
作者:
D
Don Syme
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Integrate FCS API: Changes to src\absil
上级
9635bd0d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
11 deletion
+22
-11
src/absil/il.fs
src/absil/il.fs
+10
-7
src/absil/il.fsi
src/absil/il.fsi
+1
-0
src/absil/illib.fs
src/absil/illib.fs
+8
-2
src/absil/ilreflect.fs
src/absil/ilreflect.fs
+3
-2
未找到文件。
src/absil/il.fs
浏览文件 @
190f7030
...
...
@@ -13,8 +13,9 @@ open Microsoft.FSharp.Compiler.AbstractIL
open
Microsoft
.
FSharp
.
Compiler
.
AbstractIL
.
Internal
open
Microsoft
.
FSharp
.
Compiler
.
AbstractIL
.
Internal
.
Library
open
Microsoft
.
FSharp
.
Compiler
.
AbstractIL
.
Diagnostics
open
System
.
Collections
.
Generic
open
System
.
Collections
open
System
.
Collections
.
Generic
open
System
.
Collections
.
Concurrent
let
logging
=
false
...
...
@@ -75,10 +76,10 @@ let rec splitNamespaceAux (nm:string) =
/// Global State. All namespace splits ever seen
// ++GLOBAL MUTABLE STATE
let
memoizeNamespaceTable
=
new
Dictionary
<
string
,
string
list
>(
10
)
let
memoizeNamespaceTable
=
new
ConcurrentDictionary
<
string
,
string
list
>(
)
// ++GLOBAL MUTABLE STATE
let
memoizeNamespaceRightTable
=
new
Dictionary
<
string
,
string
option
*
string
>(
100
)
let
memoizeNamespaceRightTable
=
new
ConcurrentDictionary
<
string
,
string
option
*
string
>(
)
let
splitNamespace
nm
=
...
...
@@ -92,7 +93,7 @@ let splitNamespaceMemoized nm = splitNamespace nm
// ++GLOBAL MUTABLE STATE
let
memoizeNamespaceArrayTable
=
Dictionary
<
string
,
string
[]
>(
10
)
Concurrent
.
ConcurrentDictionary
<
string
,
string
[]
>(
)
let
splitNamespaceToArray
nm
=
let
mutable
res
=
Unchecked
.
defaultof
<_>
...
...
@@ -5082,7 +5083,7 @@ let compareILVersions (a1,a2,a3,a4) ((b1,b2,b3,b4) : ILVersionInfo) =
0
let
resolveILMethodRef
td
(
mref
:
ILMethodRef
)
=
let
resolveILMethodRef
WithRescope
r
td
(
mref
:
ILMethodRef
)
=
let
args
=
mref
.
ArgTypes
let
nargs
=
args
.
Length
let
nm
=
mref
.
Name
...
...
@@ -5092,15 +5093,17 @@ let resolveILMethodRef td (mref:ILMethodRef) =
possibles
|>
List
.
filter
(
fun
md
->
mref
.
CallingConv
=
md
.
CallingConv
&&
// REVIEW: this uses equality on ILType. For CMOD_OPTIONAL this is not going to be correct
(
md
.
Parameters
,
mref
.
ArgTypes
)
||>
ILList
.
lengthsEqAndForall2
(
fun
p1
p2
->
p1
.
Type
=
p2
)
&&
(
md
.
Parameters
,
mref
.
ArgTypes
)
||>
ILList
.
lengthsEqAndForall2
(
fun
p1
p2
->
r
p1
.
Type
=
p2
)
&&
// REVIEW: this uses equality on ILType. For CMOD_OPTIONAL this is not going to be correct
md
.
Return
.
Type
=
mref
.
ReturnType
)
with
r
md
.
Return
.
Type
=
mref
.
ReturnType
)
with
|
[]
->
failwith
(
"no method named "
+
nm
+
" with appropriate argument types found in type "
+
td
.
Name
);
|
[
mdef
]
->
mdef
|
_
->
failwith
(
"multiple methods named "
+
nm
+
" appear with identical argument types in type "
+
td
.
Name
)
let
resolveILMethodRef
td
mref
=
resolveILMethodRefWithRescope
id
td
mref
let
mkRefToILModule
m
=
ILModuleRef
.
Create
(
m
.
Name
,
true
,
None
)
...
...
src/absil/il.fsi
浏览文件 @
190f7030
...
...
@@ -1622,6 +1622,7 @@ type ILModuleDef =
/// or event. This is useful especially if your code is not using the Ilbind
/// API to bind references.
val
resolveILMethodRef
:
ILTypeDef
->
ILMethodRef
->
ILMethodDef
val
resolveILMethodRefWithRescope
:
(
ILType
->
ILType
)
->
ILTypeDef
->
ILMethodRef
->
ILMethodDef
// ------------------------------------------------------------------
// Type Names
...
...
src/absil/illib.fs
浏览文件 @
190f7030
...
...
@@ -151,6 +151,11 @@ module Option =
|
None
->
dflt
|
Some
x
->
x
let
orElse
dflt
opt
=
match
opt
with
|
None
->
dflt
()
|
res
->
res
// REVIEW: systematically eliminate foldMap/mapFold duplication
let
foldMap
f
z
l
=
match
l
with
...
...
@@ -961,6 +966,7 @@ module Shim =
abstract
AssemblyLoadFrom
:
fileName
:
string
->
System
.
Reflection
.
Assembly
abstract
AssemblyLoad
:
assemblyName
:
System
.
Reflection
.
AssemblyName
->
System
.
Reflection
.
Assembly
type
DefaultFileSystem
()
=
interface
IFileSystem
with
member
__.
AssemblyLoadFrom
(
fileName
:
string
)
=
...
...
@@ -1001,7 +1007,7 @@ module Shim =
member
__.
FileDelete
(
fileName
:
string
)
=
System
.
IO
.
File
.
Delete
fileName
type
System
.
Text
.
Encoding
with
static
member
GetEncodingShim
(
n
:
int
)
=
System
.
Text
.
Encoding
.
GetEncoding
(
n
)
static
member
GetEncodingShim
(
n
:
int
)
=
System
.
Text
.
Encoding
.
GetEncoding
(
n
)
let
mutable
FileSystem
=
DefaultFileSystem
()
:>
IFileSystem
src/absil/ilreflect.fs
浏览文件 @
190f7030
...
...
@@ -1950,13 +1950,14 @@ let buildModuleFragment cenv emEnv (asmB : AssemblyBuilder) (modB : ModuleBuilde
// test hook
//----------------------------------------------------------------------------
let
mkDynamicAssemblyAndModule
(
assemblyName
,
optimize
,
debugInfo
)
=
let
mkDynamicAssemblyAndModule
(
assemblyName
,
optimize
,
debugInfo
,
collectible
)
=
let
filename
=
assemblyName
^
".dll"
let
currentDom
=
System
.
AppDomain
.
CurrentDomain
let
asmDir
=
"."
let
asmName
=
new
AssemblyName
()
asmName
.
Name
<-
assemblyName
;
let
asmB
=
currentDom
.
DefineDynamicAssemblyAndLog
(
asmName
,
AssemblyBuilderAccess
.
RunAndSave
,
asmDir
)
let
asmAccess
=
if
collectible
then
AssemblyBuilderAccess
.
RunAndCollect
else
AssemblyBuilderAccess
.
RunAndSave
let
asmB
=
currentDom
.
DefineDynamicAssemblyAndLog
(
asmName
,
asmAccess
,
asmDir
)
if
not
optimize
then
let
daType
=
typeof
<
System
.
Diagnostics
.
DebuggableAttribute
>;
let
daCtor
=
daType
.
GetConstructor
[|
typeof
<
System
.
Diagnostics
.
DebuggableAttribute
.
DebuggingModes
>
|]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录