Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
dd76c5b2
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,发现更多精彩内容 >>
提交
dd76c5b2
编写于
2月 13, 2015
作者:
C
Charles Stoner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update EE tests
上级
e72c8643
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
162 addition
and
222 deletion
+162
-222
src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/DeclarationTests.cs
...luator/CSharp/Test/ExpressionCompiler/DeclarationTests.cs
+31
-31
src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/ExpressionCompilerTestBase.cs
...arp/Test/ExpressionCompiler/ExpressionCompilerTestBase.cs
+1
-7
src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/PseudoVariableTests.cs
...tor/CSharp/Test/ExpressionCompiler/PseudoVariableTests.cs
+31
-51
src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/WinMdTests.cs
...ionEvaluator/CSharp/Test/ExpressionCompiler/WinMdTests.cs
+5
-5
src/ExpressionEvaluator/Core/Source/ExpressionCompiler/ExpressionCompilerConstants.cs
.../Source/ExpressionCompiler/ExpressionCompilerConstants.cs
+1
-1
src/ExpressionEvaluator/Core/Test/ExpressionCompiler/ExpressionCompilerTestHelpers.cs
.../Test/ExpressionCompiler/ExpressionCompilerTestHelpers.cs
+12
-4
src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/DeclarationTests.vb
...r/VisualBasic/Test/ExpressionCompiler/DeclarationTests.vb
+39
-47
src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/ExpressionCompilerTestBase.vb
...sic/Test/ExpressionCompiler/ExpressionCompilerTestBase.vb
+1
-7
src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/PseudoVariableTests.vb
...isualBasic/Test/ExpressionCompiler/PseudoVariableTests.vb
+38
-66
src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/WinMdTests.vb
...aluator/VisualBasic/Test/ExpressionCompiler/WinMdTests.vb
+3
-3
未找到文件。
src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/DeclarationTests.cs
浏览文件 @
dd76c5b2
...
...
@@ -122,7 +122,7 @@ static void M<T>(object x)
EnsureEnglishUICulture
.
PreferredOrNull
,
testData
);
Assert
.
Empty
(
missingAssemblyIdentities
);
Assert
.
Equal
(
testData
.
Methods
.
Count
,
3
);
Assert
.
Equal
(
testData
.
Methods
.
Count
,
1
);
testData
.
GetMethodData
(
"<>x.<>m0<T>"
).
VerifyIL
(
@"{
// Code size 78 (0x4e)
...
...
@@ -137,19 +137,19 @@ .maxstack 2
IL_0007: brtrue.s IL_004d
IL_0009: pop
IL_000a: ldstr ""T""
IL_000f: call ""object
<>x.<>
GetObjectByAlias(string)""
IL_000f: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(string)""
IL_0014: dup
IL_0015: brtrue.s IL_004d
IL_0017: pop
IL_0018: ldstr ""F""
IL_001d: call ""object
<>x.<>
GetObjectByAlias(string)""
IL_001d: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(string)""
IL_0022: unbox.any ""int""
IL_0027: box ""int""
IL_002c: dup
IL_002d: brtrue.s IL_004d
IL_002f: pop
IL_0030: ldstr ""D""
IL_0035: call ""object
<>x.<>
GetObjectByAlias(string)""
IL_0035: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(string)""
IL_003a: castclass ""C""
IL_003f: ldfld ""object C.F""
IL_0044: dup
...
...
@@ -198,7 +198,7 @@ static void M()
.maxstack 3
.locals init (char V_0)
IL_0000: ldstr ""c""
IL_0005: call "" Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.GetVariableAddress<char>(string)""
IL_0005: call ""
char
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.GetVariableAddress<char>(string)""
IL_000a: conv.u
IL_000b: ldc.i4.s 65
IL_000d: dup
...
...
@@ -340,11 +340,11 @@ .maxstack 2
IL_0000: ldtoken ""System.ValueType""
IL_0005: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)""
IL_000a: ldstr ""C""
IL_000f: call ""void
<>x.<>
CreateVariable(System.Type, string)""
IL_000f: call ""void
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, string)""
IL_0014: ldstr ""C""
IL_0019: call ""System.ValueType
<>x.<>
GetVariableAddress<System.ValueType>(string)""
IL_0019: call ""System.ValueType
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress<System.ValueType>(string)""
IL_001e: ldstr ""3""
IL_0023: call ""object
<>x.<>
GetObjectByAlias(string)""
IL_0023: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(string)""
IL_0028: unbox.any ""int""
IL_002d: box ""int""
IL_0032: stind.ref
...
...
@@ -393,9 +393,9 @@ .maxstack 2
IL_0000: ldtoken ""int""
IL_0005: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)""
IL_000a: ldstr ""x""
IL_000f: call ""void
<>x.<>
CreateVariable(System.Type, string)""
IL_000f: call ""void
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, string)""
IL_0014: ldstr ""x""
IL_0019: call ""int
<>x.<>
GetVariableAddress<int>(string)""
IL_0019: call ""int
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress<int>(string)""
IL_001e: ldc.i4.1
IL_001f: stind.i4
IL_0020: ret
...
...
@@ -587,9 +587,9 @@ .locals init (T V_0)
IL_0000: ldtoken ""T""
IL_0005: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)""
IL_000a: ldstr ""x""
IL_000f: call ""void
<>x.<>
CreateVariable(System.Type, string)""
IL_000f: call ""void
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, string)""
IL_0014: ldstr ""x""
IL_0019: call ""T
<>x.<>
GetVariableAddress<T>(string)""
IL_0019: call ""T
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress<T>(string)""
IL_001e: ldloca.s V_0
IL_0020: initobj ""T""
IL_0026: ldloc.0
...
...
@@ -597,11 +597,11 @@ .locals init (T V_0)
IL_002c: ldtoken ""T""
IL_0031: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)""
IL_0036: ldstr ""y""
IL_003b: call ""void
<>x.<>
CreateVariable(System.Type, string)""
IL_003b: call ""void
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, string)""
IL_0040: ldstr ""y""
IL_0045: call ""T
<>x.<>
GetVariableAddress<T>(string)""
IL_0045: call ""T
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress<T>(string)""
IL_004a: ldstr ""x""
IL_004f: call ""object
<>x.<>
GetObjectByAlias(string)""
IL_004f: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(string)""
IL_0054: unbox.any ""T""
IL_0059: stobj ""T""
IL_005e: ret
...
...
@@ -654,11 +654,11 @@ .maxstack 3
IL_0000: ldtoken ""object""
IL_0005: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)""
IL_000a: ldstr ""o""
IL_000f: call ""void
<>x.<>
CreateVariable(System.Type, string)""
IL_000f: call ""void
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, string)""
IL_0014: ldstr ""o""
IL_0019: call ""object
<>x.<>
GetVariableAddress<object>(string)""
IL_0019: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress<object>(string)""
IL_001e: ldstr ""o""
IL_0023: call ""object
<>x.<>
GetObjectByAlias(string)""
IL_0023: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(string)""
IL_0028: dup
IL_0029: brtrue.s IL_002d
IL_002b: pop
...
...
@@ -685,11 +685,11 @@ .maxstack 3
IL_0000: ldtoken ""string""
IL_0005: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)""
IL_000a: ldstr ""s""
IL_000f: call ""void
<>x.<>
CreateVariable(System.Type, string)""
IL_000f: call ""void
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, string)""
IL_0014: ldstr ""s""
IL_0019: call ""string
<>x.<>
GetVariableAddress<string>(string)""
IL_0019: call ""string
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress<string>(string)""
IL_001e: ldstr ""s""
IL_0023: call ""object
<>x.<>
GetObjectByAlias(string)""
IL_0023: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(string)""
IL_0028: castclass ""string""
IL_002d: ldc.i4.0
IL_002e: callvirt ""string string.Substring(int)""
...
...
@@ -923,15 +923,15 @@ .maxstack 2
IL_0000: ldtoken ""object""
IL_0005: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)""
IL_000a: ldstr ""class""
IL_000f: call ""void
<>x.<>
CreateVariable(System.Type, string)""
IL_000f: call ""void
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, string)""
IL_0014: ldtoken ""object""
IL_0019: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)""
IL_001e: ldstr ""this""
IL_0023: call ""void
<>x.<>
CreateVariable(System.Type, string)""
IL_0023: call ""void
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, string)""
IL_0028: ldstr ""this""
IL_002d: call ""object
<>x.<>
GetVariableAddress<object>(string)""
IL_002d: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress<object>(string)""
IL_0032: ldstr ""class""
IL_0037: call ""object
<>x.<>
GetObjectByAlias(string)""
IL_0037: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(string)""
IL_003c: stind.ref
IL_003d: ret
}"
);
...
...
@@ -979,9 +979,9 @@ .maxstack 2
IL_0000: ldtoken ""int""
IL_0005: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)""
IL_000a: ldstr ""x""
IL_000f: call ""void
<>x.<>
CreateVariable(System.Type, string)""
IL_000f: call ""void
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, string)""
IL_0014: ldstr ""x""
IL_0019: call ""int
<>x.<>
GetVariableAddress<int>(string)""
IL_0019: call ""int
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress<int>(string)""
IL_001e: ldc.i4.1
IL_001f: stind.i4
IL_0020: ret
...
...
@@ -1028,9 +1028,9 @@ .maxstack 2
IL_0000: ldtoken ""T""
IL_0005: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)""
IL_000a: ldstr ""y""
IL_000f: call ""void
<>x.<>
CreateVariable(System.Type, string)""
IL_000f: call ""void
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, string)""
IL_0014: ldstr ""y""
IL_0019: call ""T
<>x.<>
GetVariableAddress<T>(string)""
IL_0019: call ""T
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress<T>(string)""
IL_001e: ldarg.0
IL_001f: stobj ""T""
IL_0024: ret
...
...
@@ -1168,9 +1168,9 @@ .maxstack 3
IL_0000: ldtoken ""System.Action""
IL_0005: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)""
IL_000a: ldstr ""b""
IL_000f: call ""void
<>x.<>
CreateVariable(System.Type, string)""
IL_000f: call ""void
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, string)""
IL_0014: ldstr ""b""
IL_0019: call ""System.Action
<>x.<>
GetVariableAddress<System.Action>(string)""
IL_0019: call ""System.Action
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress<System.Action>(string)""
IL_001e: ldsfld ""System.Action <>x.<>c.<>9__0_0""
IL_0023: dup
IL_0024: brtrue.s IL_003d
...
...
src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/ExpressionCompilerTestBase.cs
浏览文件 @
dd76c5b2
...
...
@@ -43,15 +43,9 @@ public override void Dispose()
byte
[]
pdbBytes
;
ImmutableArray
<
MetadataReference
>
references
;
compilation
.
EmitAndGetReferences
(
out
exeBytes
,
out
pdbBytes
,
out
references
);
var
builder
=
ArrayBuilder
<
MetadataReference
>.
GetInstance
();
builder
.
AddRange
(
references
);
builder
.
Add
(
ExpressionCompilerTestHelpers
.
InstrinsicAssembly
);
references
=
builder
.
ToImmutableAndFree
();
return
CreateRuntimeInstance
(
ExpressionCompilerUtilities
.
GenerateUniqueName
(),
references
,
references
.
AddIntrinsicAssembly
()
,
exeBytes
,
includeSymbols
?
new
SymReader
(
pdbBytes
)
:
null
);
}
...
...
src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/PseudoVariableTests.cs
浏览文件 @
dd76c5b2
...
...
@@ -232,7 +232,7 @@ static void M()
// Code size 14 (0xe)
.maxstack 2
IL_0000: ldc.i4.0
IL_0001: call ""object
<>x.<>
GetReturnValue(int)""
IL_0001: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetReturnValue(int)""
IL_0006: unbox.any ""int""
IL_000b: ldc.i4.2
IL_000c: sub
...
...
@@ -295,7 +295,7 @@ static void M()
string
error
;
ImmutableArray
<
AssemblyIdentity
>
missingAssemblyIdentities
;
var
testData
=
new
CompilationTestData
();
var
result
=
context
.
CompileExpression
(
context
.
CompileExpression
(
InspectionContextFactory
.
Empty
.
Add
(
"23"
,
typeof
(
string
)).
Add
(
"4"
,
typeof
(
Type
)),
"(object)$23 ?? $4.BaseType"
,
DkmEvaluationFlags
.
TreatAsExpression
,
...
...
@@ -306,30 +306,22 @@ static void M()
EnsureEnglishUICulture
.
PreferredOrNull
,
testData
);
Assert
.
Empty
(
missingAssemblyIdentities
);
Assert
.
Equal
(
testData
.
Methods
.
Count
,
3
);
Assert
.
Equal
(
testData
.
Methods
.
Count
,
1
);
testData
.
GetMethodData
(
"<>x.<>m0"
).
VerifyIL
(
@"{
// Code size 40 (0x28)
.maxstack 2
IL_0000: ldstr ""23""
IL_0005: call ""object
<>x.<>
GetObjectByAlias(string)""
IL_0005: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(string)""
IL_000a: castclass ""string""
IL_000f: dup
IL_0010: brtrue.s IL_0027
IL_0012: pop
IL_0013: ldstr ""4""
IL_0018: call ""object
<>x.<>
GetObjectByAlias(string)""
IL_0018: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(string)""
IL_001d: castclass ""System.Type""
IL_0022: callvirt ""System.Type System.Type.BaseType.get""
IL_0027: ret
}"
);
var
assembly
=
ImmutableArray
.
CreateRange
(
result
.
Assembly
);
assembly
.
VerifyIL
(
"<>x.<>GetObjectByAlias"
,
@"{
// Code size 2 (0x2)
.maxstack 8
IL_0000: ldnull
IL_0001: throw
}"
);
}
...
...
@@ -376,7 +368,7 @@ static void M()
// Code size 23 (0x17)
.maxstack 2
IL_0000: ldstr ""s""
IL_0005: call ""object
<>x.<>
GetObjectByAlias(string)""
IL_0005: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(string)""
IL_000a: unbox.any ""C.S<int>""
IL_000f: ldfld ""int C.S<int>.F""
IL_0014: ldc.i4.1
...
...
@@ -424,10 +416,10 @@ static void M()
// Code size 44 (0x2c)
.maxstack 4
IL_0000: ldstr ""a""
IL_0005: call ""object
<>x.<>
GetObjectByAlias(string)""
IL_0005: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(string)""
IL_000a: castclass ""C[]""
IL_000f: ldstr ""b""
IL_0014: call ""object
<>x.<>
GetObjectByAlias(string)""
IL_0014: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(string)""
IL_0019: castclass ""int[,]""
IL_001e: ldc.i4.1
IL_001f: ldc.i4.0
...
...
@@ -517,17 +509,17 @@ static void M()
[
Fact
]
public
void
Variables
()
{
CheckVariable
(
"$exception"
,
valid
:
true
,
methodNames
:
new
[]
{
"<>x.$exception()"
}
);
CheckVariable
(
"$stowedexception"
,
valid
:
true
,
methodNames
:
new
[]
{
"<>x.$stowedexception()"
}
);
CheckVariable
(
"$exception"
,
valid
:
true
);
CheckVariable
(
"$stowedexception"
,
valid
:
true
);
CheckVariable
(
"$Exception"
,
valid
:
false
);
CheckVariable
(
"$STOWEDEXCEPTION"
,
valid
:
false
);
CheckVariable
(
"$ReturnValue"
,
valid
:
true
,
methodNames
:
new
[]
{
"<>x.<>GetReturnValue(int)"
}
);
CheckVariable
(
"$ReturnValue"
,
valid
:
true
);
CheckVariable
(
"$RETURNVALUE"
,
valid
:
false
);
CheckVariable
(
"$returnvalue"
,
valid
:
true
,
methodNames
:
new
[]
{
"<>x.<>GetReturnValue(int)"
}
);
// Lowercase $ReturnValue supported.
CheckVariable
(
"$ReturnValue0"
,
valid
:
true
,
methodNames
:
new
[]
{
"<>x.<>GetReturnValue(int)"
}
);
CheckVariable
(
"$returnvalue21"
,
valid
:
true
,
methodNames
:
new
[]
{
"<>x.<>GetReturnValue(int)"
}
);
CheckVariable
(
"$returnvalue"
,
valid
:
true
);
// Lowercase $ReturnValue supported.
CheckVariable
(
"$ReturnValue0"
,
valid
:
true
);
CheckVariable
(
"$returnvalue21"
,
valid
:
true
);
CheckVariable
(
"$ReturnValue3A"
,
valid
:
false
);
CheckVariable
(
"$33"
,
valid
:
true
,
methodNames
:
new
[]
{
"<>x.<>GetObjectByAlias(string)"
,
"<>x.<>GetVariableAddress<<>T>(string)"
}
);
CheckVariable
(
"$33"
,
valid
:
true
);
CheckVariable
(
"$03"
,
valid
:
false
);
CheckVariable
(
"$3A"
,
valid
:
false
);
CheckVariable
(
"$0"
,
valid
:
false
);
...
...
@@ -535,7 +527,7 @@ public void Variables()
CheckVariable
(
"$Unknown"
,
valid
:
false
);
}
private
void
CheckVariable
(
string
variableName
,
bool
valid
,
string
[]
methodNames
=
null
)
private
void
CheckVariable
(
string
variableName
,
bool
valid
)
{
var
source
=
@"class C
...
...
@@ -555,13 +547,7 @@ static void M()
error
:
out
error
);
if
(
valid
)
{
var
builder
=
ArrayBuilder
<
string
>.
GetInstance
();
builder
.
Add
(
"<>x.<>m0()"
);
if
(
methodNames
!=
null
)
{
builder
.
AddRange
(
methodNames
);
}
var
expectedNames
=
builder
.
ToImmutableAndFree
();
var
expectedNames
=
new
[]
{
"<>x.<>m0()"
};
var
actualNames
=
testData
.
Methods
.
Keys
;
AssertEx
.
SetEqual
(
expectedNames
,
actualNames
);
}
...
...
@@ -633,7 +619,7 @@ .maxstack 2
IL_0006: dup
IL_0007: brtrue.s IL_000f
IL_0009: pop
IL_000a: call ""System.Exception
<>x.$e
xception()""
IL_000a: call ""System.Exception
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.GetE
xception()""
IL_000f: ret
}"
);
}
...
...
@@ -667,12 +653,12 @@ static void M(System.Exception e)
@"{
// Code size 22 (0x16)
.maxstack 2
IL_0000: call ""System.Exception
<>x.$e
xception()""
IL_0000: call ""System.Exception
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.GetE
xception()""
IL_0005: callvirt ""System.Exception System.Exception.InnerException.get""
IL_000a: dup
IL_000b: brtrue.s IL_0013
IL_000d: pop
IL_000e: call ""System.Exception
<>x.$e
xception()""
IL_000e: call ""System.Exception
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.GetE
xception()""
IL_0013: starg.s V_0
IL_0015: ret
}"
);
...
...
@@ -857,7 +843,7 @@ .maxstack 3
.locals init (T V_0,
int V_1)
IL_0000: ldstr ""x""
IL_0005: call ""int
<>x.<>
GetVariableAddress<int>(string)""
IL_0005: call ""int
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress<int>(string)""
IL_000a: ldc.i4.1
IL_000b: dup
IL_000c: stloc.1
...
...
@@ -884,16 +870,9 @@ .maxstack 3
.maxstack 1
.locals init (T V_0)
IL_0000: ldstr ""x""
IL_0005: call ""int
<>x.<>
GetVariableAddress<int>(string)""
IL_0005: call ""int
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress<int>(string)""
IL_000a: call ""int C.F<int>(ref int)""
IL_000f: ret
}"
);
testData
.
GetMethodData
(
"<>x.<>GetVariableAddress<<>T>"
).
VerifyIL
(
@"{
// Code size 2 (0x2)
.maxstack 1
IL_0000: ldnull
IL_0001: throw
}"
);
}
...
...
@@ -940,7 +919,7 @@ static void M()
.maxstack 3
.locals init (object V_0)
IL_0000: ldstr ""s""
IL_0005: call ""S
<>x.<>
GetVariableAddress<S>(string)""
IL_0005: call ""S
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress<S>(string)""
IL_000a: ldc.i4.1
IL_000b: box ""int""
IL_0010: dup
...
...
@@ -994,7 +973,7 @@ static void M()
.maxstack 3
.locals init (int V_0)
IL_0000: ldstr ""s""
IL_0005: call ""S
<>x.<>
GetVariableAddress<S>(string)""
IL_0005: call ""S
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress<S>(string)""
IL_000a: ldflda ""int S.F""
IL_000f: dup
IL_0010: ldind.i4
...
...
@@ -1059,7 +1038,7 @@ static void M()
var
referenceA2
=
compilationA2
.
EmitToImageReference
();
var
runtime
=
CreateRuntimeInstance
(
assemblyNameB
,
ImmutableArray
.
Create
(
MscorlibRef
,
referenceA2
),
ImmutableArray
.
Create
(
MscorlibRef
,
referenceA2
)
.
AddIntrinsicAssembly
()
,
exeBytes
,
new
SymReader
(
pdbBytes
));
...
...
@@ -1087,18 +1066,18 @@ static void M()
// Code size 44 (0x2c)
.maxstack 2
.locals init (A<object> V_0) //o
IL_0000: call ""System.Exception
<>x.$e
xception()""
IL_0000: call ""System.Exception
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.GetE
xception()""
IL_0005: dup
IL_0006: brtrue.s IL_002b
IL_0008: pop
IL_0009: ldstr ""1""
IL_000e: call ""object
<>x.<>
GetObjectByAlias(string)""
IL_000e: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(string)""
IL_0013: castclass ""A<B<object>>""
IL_0018: dup
IL_0019: brtrue.s IL_002b
IL_001b: pop
IL_001c: ldstr ""2""
IL_0021: call ""object
<>x.<>
GetObjectByAlias(string)""
IL_0021: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(string)""
IL_0026: castclass ""B<A<object>[]>""
IL_002b: ret
}"
);
...
...
@@ -1163,6 +1142,7 @@ static void Main()
modulesBuilder
.
Add
(
MscorlibRef
.
ToModuleInstance
(
fullImage
:
null
,
symReader
:
null
));
modulesBuilder
.
Add
(
referenceA
.
ToModuleInstance
(
fullImage
:
exeA
,
symReader
:
new
SymReader
(
pdbA
)));
modulesBuilder
.
Add
(
referenceB
.
ToModuleInstance
(
fullImage
:
exeB
,
symReader
:
new
SymReader
(
pdbB
)));
modulesBuilder
.
Add
(
ExpressionCompilerTestHelpers
.
IntrinsicAssemblyReference
.
ToModuleInstance
(
fullImage
:
null
,
symReader
:
null
));
using
(
var
runtime
=
new
RuntimeInstance
(
modulesBuilder
.
ToImmutableAndFree
()))
{
...
...
@@ -1187,7 +1167,7 @@ static void Main()
// Code size 11 (0xb)
.maxstack 1
.locals init (object V_0) //o
IL_0000: call ""System.Exception
<>x<T>.$e
xception()""
IL_0000: call ""System.Exception
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.GetE
xception()""
IL_0005: castclass ""E""
IL_000a: ret
}"
);
...
...
@@ -1209,7 +1189,7 @@ .maxstack 1
.maxstack 1
.locals init (object V_0) //o
IL_0000: ldstr ""1""
IL_0005: call ""object
<>x<T>.<>
GetObjectByAlias(string)""
IL_0005: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(string)""
IL_000a: castclass ""A<B>""
IL_000f: stloc.0
IL_0010: ret
...
...
src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/WinMdTests.cs
浏览文件 @
dd76c5b2
...
...
@@ -282,7 +282,7 @@ static void M(Windows.Storage.StorageFolder f, Windows.Foundation.Collections.Pr
// Code size 55 (0x37)
.maxstack 2
IL_0000: ldstr ""s""
IL_0005: call ""object
<>x.<>
GetObjectByAlias(string)""
IL_0005: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(string)""
IL_000a: castclass ""Windows.Storage.StorageFolder""
IL_000f: callvirt ""Windows.Storage.FileAttributes Windows.Storage.StorageFolder.Attributes.get""
IL_0014: box ""Windows.Storage.FileAttributes""
...
...
@@ -290,7 +290,7 @@ .maxstack 2
IL_001a: brtrue.s IL_0036
IL_001c: pop
IL_001d: ldstr ""d""
IL_0022: call ""object
<>x.<>
GetObjectByAlias(string)""
IL_0022: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(string)""
IL_0027: unbox.any ""Windows.Foundation.DateTime""
IL_002c: ldfld ""long Windows.Foundation.DateTime.UniversalTime""
IL_0031: box ""long""
...
...
@@ -334,7 +334,7 @@ static void M(Windows.UI.Xaml.FrameworkElement f)
// Code size 55 (0x37)
.maxstack 2
IL_0000: ldstr ""s""
IL_0005: call ""object
<>x.<>
GetObjectByAlias(string)""
IL_0005: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(string)""
IL_000a: castclass ""Windows.Storage.StorageFolder""
IL_000f: callvirt ""Windows.Storage.FileAttributes Windows.Storage.StorageFolder.Attributes.get""
IL_0014: box ""Windows.Storage.FileAttributes""
...
...
@@ -342,7 +342,7 @@ .maxstack 2
IL_001a: brtrue.s IL_0036
IL_001c: pop
IL_001d: ldstr ""d""
IL_0022: call ""object
<>x.<>
GetObjectByAlias(string)""
IL_0022: call ""object
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(string)""
IL_0027: unbox.any ""Windows.Foundation.DateTime""
IL_002c: ldfld ""long Windows.Foundation.DateTime.UniversalTime""
IL_0031: box ""long""
...
...
@@ -366,7 +366,7 @@ .maxstack 2
compilation0
.
EmitAndGetReferences
(
out
exeBytes
,
out
pdbBytes
,
out
references
);
return
CreateRuntimeInstance
(
ExpressionCompilerUtilities
.
GenerateUniqueName
(),
runtimeReferences
,
runtimeReferences
.
AddIntrinsicAssembly
()
,
exeBytes
,
new
SymReader
(
pdbBytes
));
}
...
...
src/ExpressionEvaluator/Core/Source/ExpressionCompiler/ExpressionCompilerConstants.cs
浏览文件 @
dd76c5b2
...
...
@@ -12,7 +12,7 @@ internal static class ExpressionCompilerConstants
internal
const
string
GetObjectAtAddressMethodName
=
"GetObjectAtAddress"
;
internal
const
string
GetReturnValueMethodName
=
"GetReturnValue"
;
internal
const
string
CreateVariableMethodName
=
"CreateVariable"
;
internal
const
string
GetVariableValueMethodName
=
"Get
VariableValue
"
;
internal
const
string
GetVariableValueMethodName
=
"Get
ObjectByAlias
"
;
internal
const
string
GetVariableAddressMethodName
=
"GetVariableAddress"
;
}
}
src/ExpressionEvaluator/Core/Test/ExpressionCompiler/ExpressionCompilerTestHelpers.cs
浏览文件 @
dd76c5b2
...
...
@@ -335,9 +335,17 @@ internal static ISymUnmanagedReader ConstructSymReaderWithImports(byte[] exeByte
}
}
internal
static
readonly
MetadataReference
In
strinsicAssembly
=
GetIntrinsicAssembly
();
internal
static
readonly
MetadataReference
In
trinsicAssemblyReference
=
GetIntrinsicAssemblyReference
();
private
static
MetadataReference
GetIntrinsicAssembly
()
internal
static
ImmutableArray
<
MetadataReference
>
AddIntrinsicAssembly
(
this
ImmutableArray
<
MetadataReference
>
references
)
{
var
builder
=
ArrayBuilder
<
MetadataReference
>.
GetInstance
();
builder
.
AddRange
(
references
);
builder
.
Add
(
IntrinsicAssemblyReference
);
return
builder
.
ToImmutableAndFree
();
}
private
static
MetadataReference
GetIntrinsicAssemblyReference
()
{
var
source
=
@".assembly extern mscorlib { }
...
...
@@ -368,7 +376,7 @@ private static MetadataReference GetIntrinsicAssembly()
ldnull
throw
}
.method public static object Get
VariableValue
(string name)
.method public static object Get
ObjectByAlias
(string name)
{
ldnull
throw
...
...
@@ -379,7 +387,7 @@ private static MetadataReference GetIntrinsicAssembly()
throw
}
}"
;
return
CommonTestBase
.
CompileIL
(
source
,
appendDefaultHeader
:
true
);
return
CommonTestBase
.
CompileIL
(
source
);
}
/// <summary>
...
...
src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/DeclarationTests.vb
浏览文件 @
dd76c5b2
...
...
@@ -58,7 +58,7 @@ End Class"
IL_0014: ldstr
""
z
""
IL_0019: call
""
Function Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.GetVariableAddress(Of Object)(String) As Object
""
IL_001e: ldstr
""
3
""
IL_0023: call
""
Function Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.Get
VariableValue
(String) As Object
""
IL_0023: call
""
Function Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.Get
ObjectByAlias
(String) As Object
""
IL_0028: unbox.any
""
Integer
""
IL_002d: box
""
Integer
""
IL_0032: stind.ref
...
...
@@ -84,7 +84,7 @@ End Class"
Dim
errorMessage
As
String
=
Nothing
Dim
missingAssemblyIdentities
As
ImmutableArray
(
Of
AssemblyIdentity
)
=
Nothing
Dim
testData
=
New
CompilationTestData
()
Dim
result
=
context
.
CompileExpression
(
context
.
CompileExpression
(
InspectionContextFactory
.
Empty
.
Add
(
"x"
,
GetType
(
String
)).
Add
(
"y"
,
GetType
(
Integer
)).
Add
(
"T"
,
GetType
(
Object
)).
Add
(
"D"
,
"C"
).
Add
(
"F"
,
GetType
(
Integer
)),
"If(If(If(If(If(x, y), T), F), DirectCast(D, C).F), C.G)"
,
DkmEvaluationFlags
.
TreatAsExpression
,
...
...
@@ -95,7 +95,7 @@ End Class"
EnsureEnglishUICulture
.
PreferredOrNull
,
testData
)
Assert
.
Empty
(
missingAssemblyIdentities
)
Assert
.
Equal
(
testData
.
Methods
.
Count
,
4
)
Assert
.
Equal
(
testData
.
Methods
.
Count
,
2
)
testData
.
GetMethodData
(
"<>x.<>m0"
).
VerifyIL
(
"{
// Code size 78 (0x4e)
...
...
@@ -110,19 +110,19 @@ End Class"
IL_0007: brtrue.s IL_0014
IL_0009: pop
IL_000a: ldstr
""
T
""
IL_000f: call
""
Function
<>x.<>
GetObjectByAlias(String) As Object
""
IL_000f: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(String) As Object
""
IL_0014: dup
IL_0015: brtrue.s IL_002c
IL_0017: pop
IL_0018: ldstr
""
F
""
IL_001d: call
""
Function
<>x.<>
GetObjectByAlias(String) As Object
""
IL_001d: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(String) As Object
""
IL_0022: unbox.any
""
Integer
""
IL_0027: box
""
Integer
""
IL_002c: dup
IL_002d: brtrue.s IL_0044
IL_002f: pop
IL_0030: ldstr
""
D
""
IL_0035: call
""
Function
<>x.<>
GetObjectByAlias(String) As Object
""
IL_0035: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(String) As Object
""
IL_003a: castclass
""
C
""
IL_003f: ldfld
""
C.F As Object
""
IL_0044: dup
...
...
@@ -132,14 +132,6 @@ End Class"
IL_004d: ret
}
"
)
Dim
assembly
=
ImmutableArray
.
CreateRange
(
result
.
Assembly
)
assembly
.
VerifyIL
(
"<>x.<>GetObjectByAlias"
,
"{
// Code size 2 (0x2)
.maxstack 8
IL_0000: ldnull
IL_0001: throw
}"
)
End
Sub
<
Fact
>
...
...
@@ -206,11 +198,11 @@ End Module"
IL_0000: ldtoken
""
Object
""
IL_0005: call
""
Function System.Type.GetTypeFromHandle(System.RuntimeTypeHandle) As System.Type
""
IL_000a: ldstr
""
s
""
IL_000f: call
""
Sub
<>x.<>
CreateVariable(System.Type, String)
""
IL_000f: call
""
Sub
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, String)
""
IL_0014: ldstr
""
s
""
IL_0019: call
""
Function
<>x.<>
GetVariableAddress(Of Object)(String) As Object
""
IL_0019: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress(Of Object)(String) As Object
""
IL_001e: ldstr
""
s
""
IL_0023: call
""
Function
<>x.<>
GetObjectByAlias(String) As Object
""
IL_0023: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(String) As Object
""
IL_0028: call
""
Function Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Object) As String
""
IL_002d: call
""
Function M.F(String) As String
""
IL_0032: stind.ref
...
...
@@ -235,14 +227,14 @@ End Module"
IL_0000: ldtoken
""
Object
""
IL_0005: call
""
Function System.Type.GetTypeFromHandle(System.RuntimeTypeHandle) As System.Type
""
IL_000a: ldstr
""
t
""
IL_000f: call
""
Sub
<>x.<>
CreateVariable(System.Type, String)
""
IL_000f: call
""
Sub
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, String)
""
IL_0014: ldstr
""
t
""
IL_0019: call
""
Function
<>x.<>
GetObjectByAlias(String) As Object
""
IL_0019: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(String) As Object
""
IL_001e: dup
IL_001f: brtrue.s IL_002c
IL_0021: pop
IL_0022: ldstr
""
t
""
IL_0027: call
""
Function
<>x.<>
GetObjectByAlias(String) As Object
""
IL_0027: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(String) As Object
""
IL_002c: call
""
Function System.Runtime.CompilerServices.RuntimeHelpers.GetObjectValue(Object) As Object
""
IL_0031: call
""
Sub M.M(Object)
""
IL_0036: ret
...
...
@@ -286,9 +278,9 @@ End Module"
IL_0000: ldtoken
""
Object
""
IL_0005: call
""
Function System.Type.GetTypeFromHandle(System.RuntimeTypeHandle) As System.Type
""
IL_000a: ldstr
""
o
""
IL_000f: call
""
Sub
<>x.<>
CreateVariable(System.Type, String)
""
IL_000f: call
""
Sub
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, String)
""
IL_0014: ldstr
""
o
""
IL_0019: call
""
Function
<>x.<>
GetVariableAddress(Of Object)(String) As Object
""
IL_0019: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress(Of Object)(String) As Object
""
IL_001e: call
""
Function M.F(Of Object)(ByRef Object) As Object
""
IL_0023: pop
IL_0024: ret
...
...
@@ -331,7 +323,7 @@ End Class"
IL_0014: ldstr
""
Me
""
IL_0019: call
""
Function Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.GetVariableAddress(Of Object)(String) As Object
""
IL_001e: ldstr
""
Class
""
IL_0023: call
""
Function Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.Get
VariableValue
(String) As Object
""
IL_0023: call
""
Function Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.Get
ObjectByAlias
(String) As Object
""
IL_0028: call
""
Function System.Runtime.CompilerServices.RuntimeHelpers.GetObjectValue(Object) As Object
""
IL_002d: stind.ref
IL_002e: ret
...
...
@@ -370,9 +362,9 @@ End Class"
IL_0000: ldtoken
""
Object
""
IL_0005: call
""
Function System.Type.GetTypeFromHandle(System.RuntimeTypeHandle) As System.Type
""
IL_000a: ldstr
""
y
""
IL_000f: call
""
Sub
<>x.<>
CreateVariable(System.Type, String)
""
IL_000f: call
""
Sub
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, String)
""
IL_0014: ldstr
""
y
""
IL_0019: call
""
Function
<>x.<>
GetVariableAddress(Of Object)(String) As Object
""
IL_0019: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress(Of Object)(String) As Object
""
IL_001e: ldarg.0
IL_001f: box
""
T
""
IL_0024: stind.ref
...
...
@@ -416,9 +408,9 @@ End Module"
IL_0000: ldtoken
""
Object
""
IL_0005: call
""
Function System.Type.GetTypeFromHandle(System.RuntimeTypeHandle) As System.Type
""
IL_000a: ldstr
""
x
""
IL_000f: call
""
Sub
<>x.<>
CreateVariable(System.Type, String)
""
IL_000f: call
""
Sub
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, String)
""
IL_0014: ldstr
""
x
""
IL_0019: call
""
Function
<>x.<>
GetVariableAddress(Of Object)(String) As Object
""
IL_0019: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress(Of Object)(String) As Object
""
IL_001e: ldc.i4.3
IL_001f: box
""
Integer
""
IL_0024: stind.ref
...
...
@@ -445,9 +437,9 @@ End Module"
IL_0000: ldtoken
""
Integer
""
IL_0005: call
""
Function System.Type.GetTypeFromHandle(System.RuntimeTypeHandle) As System.Type
""
IL_000a: ldstr
""
x
""
IL_000f: call
""
Sub
<>x.<>
CreateVariable(System.Type, String)
""
IL_000f: call
""
Sub
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, String)
""
IL_0014: ldstr
""
x
""
IL_0019: call
""
Function
<>x.<>
GetVariableAddress(Of Integer)(String) As Integer
""
IL_0019: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress(Of Integer)(String) As Integer
""
IL_001e: ldc.i4.3
IL_001f: stind.i4
IL_0020: ret
...
...
@@ -473,9 +465,9 @@ End Module"
IL_0000: ldtoken
""
Long
""
IL_0005: call
""
Function System.Type.GetTypeFromHandle(System.RuntimeTypeHandle) As System.Type
""
IL_000a: ldstr
""
x
""
IL_000f: call
""
Sub
<>x.<>
CreateVariable(System.Type, String)
""
IL_000f: call
""
Sub
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, String)
""
IL_0014: ldstr
""
x
""
IL_0019: call
""
Function
<>x.<>
GetVariableAddress(Of Long)(String) As Long
""
IL_0019: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress(Of Long)(String) As Long
""
IL_001e: ldc.i4.3
IL_001f: conv.i8
IL_0020: stind.i8
...
...
@@ -502,9 +494,9 @@ End Module"
IL_0000: ldtoken
""
Single
""
IL_0005: call
""
Function System.Type.GetTypeFromHandle(System.RuntimeTypeHandle) As System.Type
""
IL_000a: ldstr
""
x
""
IL_000f: call
""
Sub
<>x.<>
CreateVariable(System.Type, String)
""
IL_000f: call
""
Sub
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, String)
""
IL_0014: ldstr
""
x
""
IL_0019: call
""
Function
<>x.<>
GetVariableAddress(Of Single)(String) As Single
""
IL_0019: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress(Of Single)(String) As Single
""
IL_001e: ldc.r4 3
IL_0023: stind.r4
IL_0024: ret
...
...
@@ -530,9 +522,9 @@ End Module"
IL_0000: ldtoken
""
Double
""
IL_0005: call
""
Function System.Type.GetTypeFromHandle(System.RuntimeTypeHandle) As System.Type
""
IL_000a: ldstr
""
x
""
IL_000f: call
""
Sub
<>x.<>
CreateVariable(System.Type, String)
""
IL_000f: call
""
Sub
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, String)
""
IL_0014: ldstr
""
x
""
IL_0019: call
""
Function
<>x.<>
GetVariableAddress(Of Double)(String) As Double
""
IL_0019: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress(Of Double)(String) As Double
""
IL_001e: ldc.r8 3
IL_0027: stind.r8
IL_0028: ret
...
...
@@ -558,9 +550,9 @@ End Module"
IL_0000: ldtoken
""
String
""
IL_0005: call
""
Function System.Type.GetTypeFromHandle(System.RuntimeTypeHandle) As System.Type
""
IL_000a: ldstr
""
x
""
IL_000f: call
""
Sub
<>x.<>
CreateVariable(System.Type, String)
""
IL_000f: call
""
Sub
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, String)
""
IL_0014: ldstr
""
x
""
IL_0019: call
""
Function
<>x.<>
GetVariableAddress(Of String)(String) As String
""
IL_0019: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress(Of String)(String) As String
""
IL_001e: ldc.i4.3
IL_001f: call
""
Function Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Integer) As String
""
IL_0024: stind.ref
...
...
@@ -587,9 +579,9 @@ End Module"
IL_0000: ldtoken
""
Decimal
""
IL_0005: call
""
Function System.Type.GetTypeFromHandle(System.RuntimeTypeHandle) As System.Type
""
IL_000a: ldstr
""
x
""
IL_000f: call
""
Sub
<>x.<>
CreateVariable(System.Type, String)
""
IL_000f: call
""
Sub
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, String)
""
IL_0014: ldstr
""
x
""
IL_0019: call
""
Function
<>x.<>
GetVariableAddress(Of Decimal)(String) As Decimal
""
IL_0019: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress(Of Decimal)(String) As Decimal
""
IL_001e: ldc.i4.3
IL_001f: conv.i8
IL_0020: newobj
""
Sub Decimal..ctor(Long)
""
...
...
@@ -706,9 +698,9 @@ End Module"
IL_0000: ldtoken
""
Object
""
IL_0005: call
""
Function System.Type.GetTypeFromHandle(System.RuntimeTypeHandle) As System.Type
""
IL_000a: ldstr
""
a
""
IL_000f: call
""
Sub
<>x.<>
CreateVariable(System.Type, String)
""
IL_000f: call
""
Sub
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, String)
""
IL_0014: ldstr
""
a
""
IL_0019: call
""
Function
<>x.<>
GetVariableAddress(Of Object)(String) As Object
""
IL_0019: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress(Of Object)(String) As Object
""
IL_001e: ldc.i4.4
IL_001f: newarr
""
Object
""
IL_0024: stind.ref
...
...
@@ -733,11 +725,11 @@ End Module"
IL_0000: ldtoken
""
Object
""
IL_0005: call
""
Function System.Type.GetTypeFromHandle(System.RuntimeTypeHandle) As System.Type
""
IL_000a: ldstr
""
a
""
IL_000f: call
""
Sub
<>x.<>
CreateVariable(System.Type, String)
""
IL_000f: call
""
Sub
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, String)
""
IL_0014: ldstr
""
a
""
IL_0019: call
""
Function
<>x.<>
GetVariableAddress(Of Object)(String) As Object
""
IL_0019: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress(Of Object)(String) As Object
""
IL_001e: ldstr
""
a
""
IL_0023: call
""
Function
<>x.<>
GetObjectByAlias(String) As Object
""
IL_0023: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(String) As Object
""
IL_0028: castclass
""
System.Array
""
IL_002d: ldc.i4.4
IL_002e: newarr
""
Object
""
...
...
@@ -780,11 +772,11 @@ End Module"
IL_0000: ldtoken
""
Object
""
IL_0005: call
""
Function System.Type.GetTypeFromHandle(System.RuntimeTypeHandle) As System.Type
""
IL_000a: ldstr
""
x
""
IL_000f: call
""
Sub
<>x.<>
CreateVariable(System.Type, String)
""
IL_000f: call
""
Sub
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, String)
""
IL_0014: ldstr
""
x
""
IL_0019: call
""
Function
<>x.<>
GetVariableAddress(Of Object)(String) As Object
""
IL_0019: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress(Of Object)(String) As Object
""
IL_001e: ldstr
""
x
""
IL_0023: call
""
Function
<>x.<>
GetObjectByAlias(String) As Object
""
IL_0023: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(String) As Object
""
IL_0028: ldc.i4.1
IL_0029: box
""
Integer
""
IL_002e: call
""
Function Microsoft.VisualBasic.CompilerServices.Operators.AddObject(Object, Object) As Object
""
...
...
src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/ExpressionCompilerTestBase.vb
浏览文件 @
dd76c5b2
...
...
@@ -40,15 +40,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests
Dim
pdbBytes
As
Byte
()
=
Nothing
Dim
references
As
ImmutableArray
(
Of
MetadataReference
)
=
Nothing
compilation
.
EmitAndGetReferences
(
exeBytes
,
pdbBytes
,
references
)
Dim
builder
=
ArrayBuilder
(
Of
MetadataReference
).
GetInstance
()
builder
.
AddRange
(
references
)
builder
.
Add
(
ExpressionCompilerTestHelpers
.
InstrinsicAssembly
)
references
=
builder
.
ToImmutableAndFree
()
Return
CreateRuntimeInstance
(
ExpressionCompilerUtilities
.
GenerateUniqueName
(),
references
,
references
.
AddIntrinsicAssembly
()
,
exeBytes
,
If
(
includeSymbols
,
New
SymReader
(
pdbBytes
),
Nothing
))
End
Function
...
...
src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/PseudoVariableTests.vb
浏览文件 @
dd76c5b2
...
...
@@ -171,7 +171,7 @@ End Class
// Code size 18 (0x12)
.maxstack 2
IL_0000: ldc.i4.0
IL_0001: call
""
Function
<>x.<>
GetReturnValue(Integer) As Object
""
IL_0001: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetReturnValue(Integer) As Object
""
IL_0006: ldc.i4.2
IL_0007: box
""
Integer
""
IL_000c: call
""
Function Microsoft.VisualBasic.CompilerServices.Operators.SubtractObject(Object, Object) As Object
""
...
...
@@ -202,13 +202,13 @@ End Class"
// Code size 40 (0x28)
.maxstack 2
IL_0000: ldstr
""
23
""
IL_0005: call
""
Function
<>x.<>
GetObjectByAlias(String) As Object
""
IL_0005: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(String) As Object
""
IL_000a: castclass
""
String
""
IL_000f: dup
IL_0010: brtrue.s IL_0027
IL_0012: pop
IL_0013: ldstr
""
4
""
IL_0018: call
""
Function
<>x.<>
GetObjectByAlias(String) As Object
""
IL_0018: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(String) As Object
""
IL_001d: castclass
""
System.Type
""
IL_0022: callvirt
""
Function System.Type.get_BaseType() As System.Type
""
IL_0027: ret
...
...
@@ -225,7 +225,7 @@ End Class"
Dim
errorMessage
As
String
=
Nothing
Dim
missingAssemblyIdentities
As
ImmutableArray
(
Of
AssemblyIdentity
)
=
Nothing
Dim
testData
=
New
CompilationTestData
()
Dim
result
=
context
.
CompileExpression
(
context
.
CompileExpression
(
InspectionContextFactory
.
Empty
.
Add
(
"$exception"
,
GetType
(
System
.
IO
.
IOException
)).
Add
(
"$stowedexception"
,
GetType
(
Exception
)),
"If($ExcEptIOn, $SToWeDeXCePTioN)"
,
DkmEvaluationFlags
.
TreatAsExpression
,
...
...
@@ -240,30 +240,14 @@ End Class"
"{
// Code size 20 (0x14)
.maxstack 2
IL_0000: call
""
Function
<>x.$e
xception() As System.Exception
""
IL_0000: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.GetE
xception() As System.Exception
""
IL_0005: castclass
""
System.IO.IOException
""
IL_000a: dup
IL_000b: brtrue.s IL_0013
IL_000d: pop
IL_000e: call
""
Function
<>x.$stowede
xception() As System.Exception
""
IL_000e: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.GetStowedE
xception() As System.Exception
""
IL_0013: ret
}"
)
Dim
assembly
=
ImmutableArray
.
CreateRange
(
result
.
Assembly
)
assembly
.
VerifyIL
(
"<>x.$exception"
,
"{
// Code size 2 (0x2)
.maxstack 8
IL_0000: ldnull
IL_0001: throw
}"
)
assembly
.
VerifyIL
(
"<>x.$stowedexception"
,
"{
// Code size 2 (0x2)
.maxstack 8
IL_0000: ldnull
IL_0001: throw
}"
)
End
Sub
<
WorkItem
(
1101017
)
>
...
...
@@ -300,7 +284,7 @@ End Class"
// Code size 23 (0x17)
.maxstack 2
IL_0000: ldstr
""
s
""
IL_0005: call
""
Function
<>x.<>
GetObjectByAlias(String) As Object
""
IL_0005: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(String) As Object
""
IL_000a: unbox.any
""
C.S(Of Integer)
""
IL_000f: ldfld
""
C.S(Of Integer).F As Integer
""
IL_0014: ldc.i4.1
...
...
@@ -340,10 +324,10 @@ End Class"
// Code size 44 (0x2c)
.maxstack 4
IL_0000: ldstr
""
a
""
IL_0005: call
""
Function
<>x.<>
GetObjectByAlias(String) As Object
""
IL_0005: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(String) As Object
""
IL_000a: castclass
""
C()
""
IL_000f: ldstr
""
b
""
IL_0014: call
""
Function
<>x.<>
GetObjectByAlias(String) As Object
""
IL_0014: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(String) As Object
""
IL_0019: castclass
""
Integer(,)
""
IL_001e: ldc.i4.1
IL_001f: ldc.i4.0
...
...
@@ -424,16 +408,16 @@ End Class"
<
Fact
>
Public
Sub
Variables
()
CheckVariable
(
"$exception"
,
valid
:
=
True
,
methodNames
:
=
{
"<>x.$exception()"
}
)
CheckVariable
(
"$eXCePTioN"
,
valid
:
=
True
,
methodNames
:
=
{
"<>x.$exception()"
}
)
CheckVariable
(
"$stowedexception"
,
valid
:
=
True
,
methodNames
:
=
{
"<>x.$stowedexception()"
}
)
CheckVariable
(
"$stOwEdExcEptIOn"
,
valid
:
=
True
,
methodNames
:
=
{
"<>x.$stowedexception()"
}
)
CheckVariable
(
"$ReturnValue"
,
valid
:
=
True
,
methodNames
:
=
{
"<>x.<>GetReturnValue(Integer)"
}
)
CheckVariable
(
"$rEtUrnvAlUe"
,
valid
:
=
True
,
methodNames
:
=
{
"<>x.<>GetReturnValue(Integer)"
}
)
CheckVariable
(
"$ReturnValue0"
,
valid
:
=
True
,
methodNames
:
=
{
"<>x.<>GetReturnValue(Integer)"
}
)
CheckVariable
(
"$ReturnValue21"
,
valid
:
=
True
,
methodNames
:
=
{
"<>x.<>GetReturnValue(Integer)"
}
)
CheckVariable
(
"$exception"
,
valid
:
=
True
)
CheckVariable
(
"$eXCePTioN"
,
valid
:
=
True
)
CheckVariable
(
"$stowedexception"
,
valid
:
=
True
)
CheckVariable
(
"$stOwEdExcEptIOn"
,
valid
:
=
True
)
CheckVariable
(
"$ReturnValue"
,
valid
:
=
True
)
CheckVariable
(
"$rEtUrnvAlUe"
,
valid
:
=
True
)
CheckVariable
(
"$ReturnValue0"
,
valid
:
=
True
)
CheckVariable
(
"$ReturnValue21"
,
valid
:
=
True
)
CheckVariable
(
"$ReturnValue3A"
,
valid
:
=
False
)
CheckVariable
(
"$33"
,
valid
:
=
True
,
methodNames
:
=
{
"<>x.<>GetObjectByAlias(String)"
,
"<>x.<>GetVariableAddress(Of <>T)(String)"
}
)
CheckVariable
(
"$33"
,
valid
:
=
True
)
CheckVariable
(
"$03"
,
valid
:
=
False
)
CheckVariable
(
"$3A"
,
valid
:
=
False
)
CheckVariable
(
"$0"
,
valid
:
=
False
)
...
...
@@ -441,7 +425,7 @@ End Class"
CheckVariable
(
"$Unknown"
,
valid
:
=
False
)
End
Sub
Private
Sub
CheckVariable
(
variableName
As
String
,
valid
As
Boolean
,
Optional
methodNames
As
String
()
=
Nothing
)
Private
Sub
CheckVariable
(
variableName
As
String
,
valid
As
Boolean
)
Dim
resultProperties
As
ResultProperties
=
Nothing
Dim
errorMessage
As
String
=
Nothing
Dim
missingAssemblyIdentities
As
ImmutableArray
(
Of
AssemblyIdentity
)
=
Nothing
...
...
@@ -454,13 +438,7 @@ End Class"
errorMessage
:
=
errorMessage
)
If
valid
Then
Dim
builder
=
ArrayBuilder
(
Of
String
).
GetInstance
()
builder
.
Add
(
"<>x.<>m0(C)"
)
If
methodNames
IsNot
Nothing
Then
builder
.
AddRange
(
methodNames
)
End
If
builder
.
Add
(
"<invalid-global-code>..ctor()"
)
' Unnecessary <invalid-global-code> (DevDiv #1010243)
Dim
expectedNames
=
builder
.
ToImmutableAndFree
()
Dim
expectedNames
=
{
"<>x.<>m0(C)"
,
"<invalid-global-code>..ctor()"
}
' Unnecessary <invalid-global-code> (DevDiv #1010243)
Dim
actualNames
=
testData
.
Methods
.
Keys
AssertEx
.
SetEqual
(
expectedNames
,
actualNames
)
Else
...
...
@@ -506,7 +484,7 @@ End Class
// Code size 19 (0x13)
.maxstack 3
IL_0000: ldc.i4.2
IL_0001: call
""
Function
<>x.<>
GetReturnValue(Integer) As Object
""
IL_0001: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetReturnValue(Integer) As Object
""
IL_0006: ldc.i4.0
IL_0007: newarr
""
Object
""
IL_000c: ldnull
...
...
@@ -546,7 +524,7 @@ End Class
IL_0006: dup
IL_0007: brtrue.s IL_000f
IL_0009: pop
IL_000a: call
""
Function
<>x.$e
xception() As System.Exception
""
IL_000a: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.GetE
xception() As System.Exception
""
IL_000f: ret
}"
)
End
Sub
...
...
@@ -571,12 +549,12 @@ End Class
{
// Code size 22 (0x16)
.maxstack 2
IL_0000: call
""
Function
<>x.$e
xception() As System.Exception
""
IL_0000: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.GetE
xception() As System.Exception
""
IL_0005: callvirt
""
Function System.Exception.get_InnerException() As System.Exception
""
IL_000a: dup
IL_000b: brtrue.s IL_0013
IL_000d: pop
IL_000e: call
""
Function
<>x.$e
xception() As System.Exception
""
IL_000e: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.GetE
xception() As System.Exception
""
IL_0013: starg.s V_0
IL_0015: ret
}
...
...
@@ -649,7 +627,7 @@ End Class
.maxstack 1
.locals init (T V_0, //F
System.Exception V_1)
IL_0000: call
""
Function
<>x.$e
xception() As System.Exception
""
IL_0000: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.GetE
xception() As System.Exception
""
IL_0005: stloc.1
IL_0006: ldloca.s V_1
IL_0008: call
""
Function C.F(Of System.Exception)(ByRef System.Exception) As System.Exception
""
...
...
@@ -732,7 +710,7 @@ End Class
.maxstack 2
.locals init (T V_0) //F
IL_0000: ldstr
""
x
""
IL_0005: call
""
Function
<>x.<>
GetVariableAddress(Of Integer)(String) As Integer
""
IL_0005: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress(Of Integer)(String) As Integer
""
IL_000a: ldc.i4.0
IL_000b: stind.i4
IL_000c: ret
...
...
@@ -756,7 +734,7 @@ End Class
.maxstack 1
.locals init (T V_0) //F
IL_0000: ldstr
""
x
""
IL_0005: call
""
Function
<>x.<>
GetVariableAddress(Of Integer)(String) As Integer
""
IL_0005: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress(Of Integer)(String) As Integer
""
IL_000a: call
""
Function C.F(Of Integer)(ByRef Integer) As Integer
""
IL_000f: ret
}"
)
...
...
@@ -783,9 +761,9 @@ End Class
IL_0000: ldtoken
""
Object
""
IL_0005: call
""
Function System.Type.GetTypeFromHandle(System.RuntimeTypeHandle) As System.Type
""
IL_000a: ldstr
""
x
""
IL_000f: call
""
Sub
<>x.<>
CreateVariable(System.Type, String)
""
IL_000f: call
""
Sub
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, String)
""
IL_0014: ldstr
""
x
""
IL_0019: call
""
Function
<>x.<>
GetVariableAddress(Of Object)(String) As Object
""
IL_0019: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress(Of Object)(String) As Object
""
IL_001e: ldnull
IL_001f: stind.ref
IL_0020: ret
...
...
@@ -811,19 +789,12 @@ End Class
IL_0000: ldtoken
""
Object
""
IL_0005: call
""
Function System.Type.GetTypeFromHandle(System.RuntimeTypeHandle) As System.Type
""
IL_000a: ldstr
""
x
""
IL_000f: call
""
Sub
<>x.<>
CreateVariable(System.Type, String)
""
IL_000f: call
""
Sub
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, String)
""
IL_0014: ldstr
""
x
""
IL_0019: call
""
Function
<>x.<>
GetVariableAddress(Of Object)(String) As Object
""
IL_0019: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress(Of Object)(String) As Object
""
IL_001e: call
""
Function C.F(Of Object)(ByRef Object) As Object
""
IL_0023: pop
IL_0024: ret
}"
)
testData
.
GetMethodData
(
"<>x.<>GetVariableAddress(Of <>T)"
).
VerifyIL
(
"{
// Code size 2 (0x2)
.maxstack 1
IL_0000: ldnull
IL_0001: throw
}"
)
End
Sub
...
...
@@ -873,7 +844,7 @@ End Class"
Dim
referenceA2
=
compilationA2
.
EmitToImageReference
()
Dim
runtime
=
CreateRuntimeInstance
(
assemblyNameB
,
ImmutableArray
.
Create
(
MscorlibRef
,
referenceA2
),
ImmutableArray
.
Create
(
MscorlibRef
,
referenceA2
)
.
AddIntrinsicAssembly
()
,
exeBytes
,
New
SymReader
(
pdbBytes
))
...
...
@@ -901,18 +872,18 @@ End Class"
// Code size 44 (0x2c)
.maxstack 2
.locals init (A(Of Object) V_0) //o
IL_0000: call
""
Function
<>x.$e
xception() As System.Exception
""
IL_0000: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.GetE
xception() As System.Exception
""
IL_0005: dup
IL_0006: brtrue.s IL_0018
IL_0008: pop
IL_0009: ldstr
""
1
""
IL_000e: call
""
Function
<>x.<>
GetObjectByAlias(String) As Object
""
IL_000e: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(String) As Object
""
IL_0013: castclass
""
A(Of B(Of Object))
""
IL_0018: dup
IL_0019: brtrue.s IL_002b
IL_001b: pop
IL_001c: ldstr
""
2
""
IL_0021: call
""
Function
<>x.<>
GetObjectByAlias(String) As Object
""
IL_0021: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(String) As Object
""
IL_0026: castclass
""
B(Of A(Of Object)())
""
IL_002b: ret
}"
)
...
...
@@ -969,6 +940,7 @@ End Class"
modulesBuilder
.
Add
(
MscorlibRef
.
ToModuleInstance
(
fullImage
:
=
Nothing
,
symReader
:
=
Nothing
))
modulesBuilder
.
Add
(
referenceA
.
ToModuleInstance
(
fullImage
:
=
exeA
,
symReader
:
=
New
SymReader
(
pdbA
)))
modulesBuilder
.
Add
(
referenceB
.
ToModuleInstance
(
fullImage
:
=
exeB
,
symReader
:
=
New
SymReader
(
pdbB
)))
modulesBuilder
.
Add
(
ExpressionCompilerTestHelpers
.
IntrinsicAssemblyReference
.
ToModuleInstance
(
fullImage
:
=
Nothing
,
symReader
:
=
Nothing
))
Using
runtime
=
New
RuntimeInstance
(
modulesBuilder
.
ToImmutableAndFree
())
Dim
context
=
CreateMethodContext
(
runtime
,
"A.M"
)
...
...
@@ -993,7 +965,7 @@ End Class"
.maxstack 1
.locals init (Object V_0, //o
System.Exception V_1)
IL_0000: call
""
Function
<>x(Of T).$e
xception() As System.Exception
""
IL_0000: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.GetE
xception() As System.Exception
""
IL_0005: castclass
""
E
""
IL_000a: ret
}"
)
...
...
@@ -1016,7 +988,7 @@ End Class"
.locals init (Object V_0, //o
System.Exception V_1)
IL_0000: ldstr
""
1
""
IL_0005: call
""
Function
<>x(Of T).<>
GetObjectByAlias(String) As Object
""
IL_0005: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(String) As Object
""
IL_000a: castclass
""
A(Of B)
""
IL_000f: stloc.0
IL_0010: ret
...
...
src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/WinMdTests.vb
浏览文件 @
dd76c5b2
...
...
@@ -217,7 +217,7 @@ End Class"
// Code size 55 (0x37)
.maxstack 2
IL_0000: ldstr
""
s
""
IL_0005: call
""
Function
<>x.<>
GetObjectByAlias(String) As Object
""
IL_0005: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(String) As Object
""
IL_000a: castclass
""
Windows.Storage.StorageFolder
""
IL_000f: callvirt
""
Function Windows.Storage.StorageFolder.get_Attributes() As Windows.Storage.FileAttributes
""
IL_0014: box
""
Windows.Storage.FileAttributes
""
...
...
@@ -225,7 +225,7 @@ End Class"
IL_001a: brtrue.s IL_0036
IL_001c: pop
IL_001d: ldstr
""
d
""
IL_0022: call
""
Function
<>x.<>
GetObjectByAlias(String) As Object
""
IL_0022: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(String) As Object
""
IL_0027: unbox.any
""
Windows.Foundation.DateTime
""
IL_002c: ldfld
""
Windows.Foundation.DateTime.UniversalTime As Long
""
IL_0031: box
""
Long
""
...
...
@@ -249,7 +249,7 @@ End Class"
comp
.
EmitAndGetReferences
(
exeBytes
,
pdbBytes
,
references
)
Return
CreateRuntimeInstance
(
ExpressionCompilerUtilities
.
GenerateUniqueName
(),
runtimeReferences
,
runtimeReferences
.
AddIntrinsicAssembly
()
,
exeBytes
,
New
SymReader
(
pdbBytes
))
End
Function
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录