Permalink
Browse files

Gyro changes to implement generics

  • Loading branch information...
mattwarren committed Feb 13, 2018
1 parent 464bf98 commit 2714ccac6f18f0f6ff885567b90484013b31e007
Showing with 30,611 additions and 12,034 deletions.
  1. +7 −1 bcl/resources.txt
  2. +6 −0 bcl/sources
  3. +25 −2 bcl/system/diagnostics/stacktrace.cs
  4. +23 −3 bcl/system/environment.cs
  5. +11 −1 bcl/system/reflection/emit/opcodes.cs
  6. +24 −2 bcl/system/reflection/emit/signaturehelper.cs
  7. +20 −0 bcl/system/reflection/methodinfo.cs
  8. +26 −0 bcl/system/reflection/runtimemethodinfo.cs
  9. +42 −0 bcl/system/reflection/typarinfo.cs
  10. +5 −3 bcl/system/runtime/remoting/message.cs
  11. +20 −0 bcl/system/runtimetype.cs
  12. +23 −0 bcl/system/type.cs
  13. +13 −1 csharp/csharp/inc/enum.h
  14. +26 −0 csharp/csharp/inc/errors.h
  15. +28 −0 csharp/csharp/inc/msgsids.h
  16. +7 −0 csharp/csharp/inc/nodekind.h
  17. +48 −9 csharp/csharp/inc/nodes.h
  18. +8 −0 csharp/csharp/inc/predefname.h
  19. +7 −1 csharp/csharp/inc/tokens.h
  20. +974 −337 csharp/csharp/sccomp/clsdrec.cpp
  21. +46 −24 csharp/csharp/sccomp/clsdrec.h
  22. +13 −0 csharp/csharp/sccomp/compiler.cpp
  23. +46 −20 csharp/csharp/sccomp/dumpnode.h
  24. +343 −123 csharp/csharp/sccomp/emitter.cpp
  25. +14 −1 csharp/csharp/sccomp/emitter.h
  26. +39 −4 csharp/csharp/sccomp/error.cpp
  27. +67 −8 csharp/csharp/sccomp/exprlist.h
  28. +914 −309 csharp/csharp/sccomp/fncbind.cpp
  29. +70 −27 csharp/csharp/sccomp/fncbind.h
  30. +15 −7 csharp/csharp/sccomp/fncpbind.cpp
  31. +144 −47 csharp/csharp/sccomp/ilgen.cpp
  32. +7 −2 csharp/csharp/sccomp/ilgen.h
  33. +379 −85 csharp/csharp/sccomp/import.cpp
  34. +35 −13 csharp/csharp/sccomp/import.h
  35. +60 −42 csharp/csharp/sccomp/metaattr.cpp
  36. +7 −2 csharp/csharp/sccomp/metaattr.h
  37. +24 −0 csharp/csharp/sccomp/msgs.rc
  38. +707 −392 csharp/csharp/sccomp/parser.cpp
  39. +43 −4 csharp/csharp/sccomp/parser.h
  40. +22 −0 csharp/csharp/sccomp/srcmod.cpp
  41. +7 −2 csharp/csharp/sccomp/stdafx.h
  42. +194 −34 csharp/csharp/sccomp/symbol.h
  43. +11 −0 csharp/csharp/sccomp/symkinds.h
  44. +737 −42 csharp/csharp/sccomp/symmgr.cpp
  45. +37 −8 csharp/csharp/sccomp/symmgr.h
  46. +9 −0 csharp/csharp/sccomp/tests.cpp
  47. +11 −0 csharp/csharp/sccomp/timerids.h
  48. +21 −6 csharp/csharp/shared/node.cpp
  49. +25 −1 debug/di/common.cpp
  50. +331 −396 debug/di/divalue.cpp
  51. +1,745 −274 debug/di/module.cpp
  52. +70 −11 debug/di/process.cpp
  53. +667 −521 debug/di/rsthread.cpp
  54. +46 −18 debug/ee/controller.cpp
  55. +29 −18 debug/ee/controller.h
  56. +1,419 −691 debug/ee/debugger.cpp
  57. +1,434 −1,320 debug/ee/debugger.h
  58. +26 −17 debug/ee/thread.cpp
  59. +8 −0 debug/inc/common.h
  60. +500 −148 debug/inc/cordb.h
  61. +232 −52 debug/inc/dbgipcevents.h
  62. +14 −1 debug/inc/dbgipceventtypes.h
  63. +11 −0 debug/shell/commands.cpp
  64. +457 −155 debug/shell/dshell.cpp
  65. +33 −8 debug/shell/dshell.h
  66. +197 −3 debug/shell/source.cpp
  67. +8 −0 dlls/mscorrc/mscorrc.rc
  68. +589 −202 fjit/fjit.cpp
  69. +37 −1 fjit/fjit.h
  70. +24 −1 fjit/fjitcompiler.cpp
  71. +15 −0 fjit/fjitcore.h
  72. +154 −16 fjit/fjitdef.h
  73. +8 −2 fusion/binder/naming.cpp
  74. +6 −1 fusion/binder/policy.cpp
  75. +23 −0 fusion/download/cfgdl.cpp
  76. +6 −1 fusion/utils/dbglog.cpp
  77. +74 −75 ilasm/asmman.cpp
  78. +29 −6 ilasm/asmman.hpp
  79. +12 −3 ilasm/asmparse.h
  80. +307 −142 ilasm/asmparse.y
  81. +346 −332 ilasm/assem.cpp
  82. +339 −447 ilasm/assembler.cpp
  83. +315 −142 ilasm/assembler.h
  84. +17 −36 ilasm/class.hpp
  85. +63 −53 ilasm/main.cpp
  86. +5 −0 ilasm/makefile.inc
  87. +8 −12 ilasm/method.cpp
  88. +52 −30 ilasm/method.hpp
  89. +2,553 −2,180 ilasm/parseasm.cpp
  90. +59 −0 ilasm/typar.hpp
  91. +295 −144 ilasm/writer.cpp
  92. +84 −16 ildasm/dasm.cpp
  93. +6 −0 ildasm/dasm.rc
  94. +287 −0 ildasm/dasm_pr.cpp
  95. +60 −13 ildasm/dis.cpp
  96. +9 −2 ildasm/dis.h
  97. +84 −13 ildasm/formattype.cpp
  98. +7 −1 ildasm/resource.h
  99. +40 −17 ildasm/windasm.cpp
  100. +39 −0 inc/cor.h
  101. +156 −1 inc/cordebug.idl
  102. +9 −1 inc/corerror.h
  103. +20 −3 inc/corhdr.h
  104. +183 −17 inc/corinfo.h
  105. +12 −5 inc/cortypeinfo.h
  106. +13 −19 inc/il_kywd.h
  107. +11 −0 inc/metadata.h
  108. +5 −0 inc/metadatatracker.h
  109. +50 −0 inc/metamodelpub.h
  110. +8 −3 inc/opcode.def
  111. +84 −2 md/compiler/emit.cpp
  112. +11 −0 md/compiler/filtermanager.cpp
  113. +123 −0 md/compiler/import.cpp
  114. +82 −0 md/compiler/importhelper.cpp
  115. +112 −1 md/compiler/mdvalidator.cpp
  116. +162 −9 md/compiler/regmeta.cpp
  117. +50 −0 md/compiler/regmeta.h
  118. +50 −0 md/enc/mdinternalrw.cpp
  119. +19 −1 md/enc/metamodelrw.cpp
  120. +29 −0 md/inc/assemblymdinternaldisp.h
  121. +11 −0 md/inc/mdinternalrw.h
  122. +31 −0 md/inc/metamodel.h
  123. +19 −0 md/inc/metamodelrw.h
  124. +39 −0 md/runtime/mdinternaldisp.cpp
  125. +55 −0 md/runtime/mdinternalro.cpp
  126. +14 −0 md/runtime/mdinternalro.h
  127. +11 −1 md/runtime/metamodel.cpp
  128. +23 −0 md/runtime/metamodelcolumndefs.h
  129. +86 −13 tools/metainfo/mdinfo.cpp
  130. +6 −1 tools/metainfo/mdinfo.h
  131. +14 −1 utilcode/ilformatter.cpp
  132. +61 −13 utilcode/prettyprintsig.cpp
  133. +45 −0 utilcode/util.cpp
  134. +5 −0 vm/appdomain.cpp
  135. +76 −58 vm/array.cpp
  136. +10 −6 vm/assembly.cpp
  137. +10 −3 vm/assembly.hpp
  138. +24 −106 vm/assemblynative.cpp
  139. +11 −0 vm/assemblynative.hpp
  140. +43 −9 vm/binder.cpp
  141. +6 −0 vm/binder.h
  142. +6 −1 vm/ceeload.cpp
  143. +21 −9 vm/ceemain.cpp
  144. +1,412 −331 vm/class.cpp
  145. +457 −86 vm/class.h
  146. +351 −76 vm/clsload.cpp
  147. +162 −41 vm/clsload.hpp
  148. +31 −9 vm/codeman.cpp
  149. +11 −4 vm/codeman.h
  150. +6 −1 vm/comarrayinfo.cpp
  151. +9 −6 vm/comcallwrapper.cpp
  152. +306 −530 vm/comclass.cpp
  153. +48 −9 vm/comclass.h
  154. +258 −18 vm/comdelegate.cpp
  155. +16 −0 vm/comdelegate.h
  156. +322 −178 vm/commember.cpp
  157. +21 −4 vm/commember.h
  158. +21 −16 vm/commodule.cpp
  159. +5 −0 vm/comndirect.cpp
  160. +12 −8 vm/comobject.cpp
  161. +194 −122 vm/comreflectioncommon.cpp
  162. +27 −22 vm/comreflectioncommon.h
  163. +13 −3 vm/comsystem.cpp
  164. +6 −0 vm/comsystem.h
  165. +8 −1 vm/comvarargs.cpp
  166. +6 −1 vm/comvariant.cpp
  167. +7 −5 vm/contexts.cpp
  168. +10 −7 vm/customattribute.cpp
  169. +8 −3 vm/custommarshalerinfo.cpp
  170. +10 −3 vm/debugdebugger.cpp
  171. +6 −0 vm/debugdebugger.h
  172. +32 −4 vm/ecall.cpp
  173. +15 −1 vm/eeconfig.cpp
  174. +19 −0 vm/eeconfig.h
  175. +22 −13 vm/eedbginterface.h
  176. +68 −107 vm/eedbginterfaceimpl.h
  177. +14 −7 vm/ejitmgr.cpp
  178. +8 −2 vm/ejitmgr.h
  179. +35 −0 vm/encee.cpp
  180. +14 −10 vm/excep.cpp
  181. +13 −5 vm/excep.h
  182. +13 −7 vm/expandsig.cpp
  183. +8 −3 vm/expandsig.h
  184. +32 −18 vm/field.cpp
  185. +26 −8 vm/field.h
  186. +7 −2 vm/fjit_eetwain.cpp
  187. +31 −15 vm/frames.cpp
  188. +8 −3 vm/frames.h
  189. +5 −0 vm/gcscan.cpp
  190. +339 −0 vm/generics.cpp
  191. +26 −0 vm/generics.h
  192. +693 −0 vm/genmeth.cpp
  193. +6 −0 vm/i386/cgencpu.h
  194. +48 −0 vm/i386/cgenx86.cpp
  195. +26 −12 vm/i386/excepx86.cpp
  196. +6 −1 vm/interopconverter.cpp
  197. +15 −0 vm/interoputil.cpp
  198. +68 −40 vm/invokeutil.cpp
  199. +18 −7 vm/invokeutil.h
  200. +1,251 −224 vm/jitinterface.cpp
  201. +55 −10 vm/jitinterface.h
  202. +379 −0 vm/jitinterfacegen.cpp
  203. +53 −102 vm/message.cpp
  204. +9 −10 vm/message.h
  205. +133 −18 vm/method.cpp
  206. +415 −27 vm/method.hpp
  207. +6 −1 vm/ndirect.cpp
  208. +25 −9 vm/nexport.cpp
  209. +11 −0 vm/nexport.h
  210. +19 −3 vm/object.cpp
  211. +7 −1 vm/object.h
  212. +55 −8 vm/prestub.cpp
  213. +26 −7 vm/proftoeeinterfaceimpl.cpp
  214. +8 −3 vm/reflectutil.cpp
  215. +6 −1 vm/reflectutil.h
  216. +58 −26 vm/reflectwrap.cpp
  217. +72 −55 vm/reflectwrap.h
  218. +80 −74 vm/remoting.cpp
  219. +17 −14 vm/remoting.h
  220. +7 −2 vm/security.cpp
  221. +6 −1 vm/security.h
  222. +176 −54 vm/sigformat.cpp
  223. +13 −2 vm/sigformat.h
  224. +598 −149 vm/siginfo.cpp
  225. +148 −58 vm/siginfo.hpp
  226. +9 −0 vm/sources.inc
  227. +21 −16 vm/stackbuildersink.cpp
  228. +7 −2 vm/stackwalk.cpp
  229. +11 −10 vm/threads.cpp
  230. +158 −11 vm/typehandle.h
  231. +54 −5 vm/typehash.cpp
  232. +28 −6 vm/typehash.h
  233. +559 −0 vm/typeparse.cpp
  234. +99 −0 vm/typeparse.h
  235. +209 −0 vm/typestring.cpp
  236. +51 −0 vm/typestring.h
  237. +6 −1 vm/validator.cpp
  238. +7 −2 vm/verifier.cpp
  239. +8 −3 vm/veritem.hpp
  240. +8 −3 vm/vertable.h
View
@@ -8,6 +8,11 @@
; By using this software in any fashion, you are agreeing to be bound by the
; terms of this license.
;
; This file contains modifications of the base SSCLI software to support generic
; type definitions and generic methods, THese modifications are for research
; purposes. They do not commit Microsoft to the future support of these or
; any similar changes to the SSCLI or the .NET product. -- 31st October, 2002.
;
; You must not remove this notice, or any other, from this software.
;
;
@@ -437,7 +442,8 @@ Argument_DuplicateModuleName = Duplicate dynamic module name within an assembly.
Argument_DuplicateTypeName = Duplicate type name within an assembly.
Argument_InvalidAssemblyName = Assembly names may not begin with whitespace, or contain the characters '/' or '\\'.
Argument_InvalidArrayName = The given array name was invalid.
Argument_DuplicatedFileName = Duplicated file names.
Argument_InvalidGenericInstantiation = The given generic instantiation was invalid.
Argument_DuplicatedFileName = Duplicate file names.
Argument_GlobalFunctionHasToBeStatic = Global members must be static.
Argument_BadPInvokeOnInterface = PInvoke methods cannot exist on interfaces.
Argument_BadPInvokeMethod = PInvoke methods must be static and native and cannot be abstract.
View
@@ -8,6 +8,11 @@
# By using this software in any fashion, you are agreeing to be bound by the
# terms of this license.
#
# This file contains modifications of the base SSCLI software to support generic
# type definitions and generic methods, THese modifications are for research
# purposes. They do not commit Microsoft to the future support of these or
# any similar changes to the SSCLI or the .NET product. -- 31st October, 2002.
#
# You must not remove this notice, or any other, from this software.
#
#
@@ -512,6 +517,7 @@ REFLECTION_SOURCES = \
system\reflection\targetexception.cs \
system\reflection\targetinvocationexception.cs \
system\reflection\targetparametercountexception.cs \
system\reflection\typarinfo.cs \
system\reflection\typeattributes.cs \
system\reflection\typedelegator.cs \
system\reflection\typefilter.cs \
@@ -8,6 +8,11 @@
// By using this software in any fashion, you are agreeing to be bound by the
// terms of this license.
//
// This file contains modifications of the base SSCLI software to support generic
// type definitions and generic methods, THese modifications are for research
// purposes. They do not commit Microsoft to the future support of these or
// any similar changes to the SSCLI or the .NET product. -- 31st October, 2002.
//
// You must not remove this notice, or any other, from this software.
//
//
@@ -370,10 +375,28 @@ public override String ToString()
sb.Append (t.Name);
sb.Append (".");
sb.Append (frames [iIndex].GetMethod().Name);
sb.Append (mb.Name);
if (mb is MethodInfo && ((MethodInfo)mb).HasGenericArguments)
{
Type[] typars = ((MethodInfo)mb).GetGenericArguments();
sb.Append ("[");
int k=0;
bool fFirstTyParam = true;
while (k < typars.Length)
{
if (fFirstTyParam == false)
sb.Append (",");
else
fFirstTyParam = false;
sb.Append (typars[k].Name);
k++;
}
sb.Append ("]");
}
sb.Append ("(");
ParameterInfo[] pi = frames [iIndex].GetMethod().GetParameters();
ParameterInfo[] pi = mb.GetParameters();
int j=0;
bool fFirstParam = true;
View
@@ -8,6 +8,11 @@
// By using this software in any fashion, you are agreeing to be bound by the
// terms of this license.
//
// This file contains modifications of the base SSCLI software to support generic
// type definitions and generic methods, THese modifications are for research
// purposes. They do not commit Microsoft to the future support of these or
// any similar changes to the SSCLI or the .NET product. -- 31st October, 2002.
//
// You must not remove this notice, or any other, from this software.
//
//
@@ -356,7 +361,6 @@ internal static String GetStackTrace(Exception e)
st = new StackTrace(e,true);
String newLine = Environment.NewLine;
StringBuilder sb = new StringBuilder(255);
for (int i = 0; i < st.FrameCount; i++)
{
StackFrame sf = st.GetFrame(i);
@@ -379,8 +383,24 @@ internal static String GetStackTrace(Exception e)
sb.Append(".");
}
sb.Append(method.Name);
if (method is MethodInfo && ((MethodInfo)method).HasGenericArguments)
{
Type[] typars = ((MethodInfo)method).GetGenericArguments();
sb.Append ("[");
int k=0;
bool fFirstTyParam = true;
while (k < typars.Length)
{
if (fFirstTyParam == false)
sb.Append (",");
else
fFirstTyParam = false;
sb.Append (typars[k].Name);
k++;
}
sb.Append ("]");
}
sb.Append("(");
ParameterInfo[] arrParams = method.GetParameters();
for (int j = 0; j < arrParams.Length; j++)
@@ -389,6 +409,7 @@ internal static String GetStackTrace(Exception e)
if (arrParams[j].ParameterType != null)
typeName = arrParams[j].ParameterType.Name;
sb.Append((j != 0 ? ", " : "") + typeName + " " + arrParams[j].Name);
}
@@ -403,7 +424,6 @@ internal static String GetStackTrace(Exception e)
if (fileName != null)
sb.Append(" in " + fileName + ":line " + sf.GetFileLineNumber());
}
if (i != st.FrameCount - 1)
sb.Append(newLine);
}
@@ -8,6 +8,11 @@
// By using this software in any fashion, you are agreeing to be bound by the
// terms of this license.
//
// This file contains modifications of the base SSCLI software to support generic
// type definitions and generic methods, THese modifications are for research
// purposes. They do not commit Microsoft to the future support of these or
// any similar changes to the SSCLI or the .NET product. -- 31st October, 2002.
//
// You must not remove this notice, or any other, from this software.
//
//
@@ -513,7 +518,12 @@ public class OpCodes {
/// <include file='doc\OpCodes.uex' path='docs/doc[@for="OpCodes.Stelem_Ref"]/*' />
public static readonly OpCode Stelem_Ref = new OpCode("stelem.ref", StackBehaviour.Popref_popi_popref, StackBehaviour.Push0, OperandType.InlineNone, OpCodeType.Objmodel, 1, (byte)0xff, (byte)0xa2, FlowControl.Next, false, -3);
/// <include file='doc\OpCodes.uex' path='docs/doc[@for="OpCodes.Conv_Ovf_I1"]/*' />
public static readonly OpCode Ldelem_Any = new OpCode("ldelem.any", StackBehaviour.Popref_popi, StackBehaviour.Push1, OperandType.InlineType, OpCodeType.Objmodel, 1, (byte)0xff, (byte)0xa3, FlowControl.Next, false, -1);
public static readonly OpCode Stelem_Any = new OpCode("stelem.any", StackBehaviour.Popref_popi_popref, StackBehaviour.Push0, OperandType.InlineType, OpCodeType.Objmodel, 1, (byte)0xff, (byte)0xa4, FlowControl.Next, false, 0);
public static readonly OpCode Unbox_Any = new OpCode("unbox.any", StackBehaviour.Popref, StackBehaviour.Push1, OperandType.InlineType, OpCodeType.Objmodel, 1, (byte)0xff, (byte)0xa5, FlowControl.Next, false, 0);
public static readonly OpCode Conv_Ovf_I1 = new OpCode("conv.ovf.i1", StackBehaviour.Pop1, StackBehaviour.Pushi, OperandType.InlineNone, OpCodeType.Primitive, 1, (byte)0xff, (byte)0xb3, FlowControl.Next, false, 0);
/// <include file='doc\OpCodes.uex' path='docs/doc[@for="OpCodes.Conv_Ovf_U1"]/*' />
@@ -8,6 +8,11 @@
// By using this software in any fashion, you are agreeing to be bound by the
// terms of this license.
//
// This file contains modifications of the base SSCLI software to support generic
// type definitions and generic methods, THese modifications are for research
// purposes. They do not commit Microsoft to the future support of these or
// any similar changes to the SSCLI or the .NET product. -- 31st October, 2002.
//
// You must not remove this notice, or any other, from this software.
//
//
@@ -47,8 +52,10 @@ public sealed class SignatureHelper {
internal const byte ELEMENT_TYPE_VALUETYPE = 0x11; // VALUETYPE <class Token>
internal const byte ELEMENT_TYPE_CLASS = 0x12; // CLASS <class Token>
internal const byte ELEMENT_TYPE_VAR = 0x13; // VAR <U1>
internal const byte ELEMENT_TYPE_ARRAY = 0x14; // MDARRAY <type> <rank> <bcount> <bound1> ... <lbcount> <lb1> ...
internal const byte ELEMENT_TYPE_WITH = 0x15; // WITH <type> <ntypars> <type1> ... <typen>
internal const byte ELEMENT_TYPE_TYPEDBYREF = 0x16; // This is a simple type.
@@ -57,11 +64,12 @@ public sealed class SignatureHelper {
internal const byte ELEMENT_TYPE_FNPTR = 0x1B; // FNPTR <complete sig for the function including calling convention>
internal const byte ELEMENT_TYPE_OBJECT = 0x1C; // Shortcut for System.Object
internal const byte ELEMENT_TYPE_SZARRAY = 0x1D; // SZARRAY <type> : Shortcut for single dimension zero lower bound array
internal const byte ELEMENT_TYPE_MVAR = 0x1E; // MVAR <U1>
internal const byte ELEMENT_TYPE_CMOD_REQD = 0x1F; // required C modifier : E_T_CMOD_REQD <mdTypeRef/mdTypeDef>
internal const byte ELEMENT_TYPE_CMOD_OPT = 0x20; // optional C modifier : E_T_CMOD_OPT <mdTypeRef/mdTypeDef>
internal const byte ELEMENT_TYPE_MAX = 0x22; // first invalid element type
internal const byte ELEMENT_TYPE_MAX = 0x23; // first invalid element type
internal const byte ELEMENT_TYPE_SENTINEL = 0x41; // SENTINEL for vararg
@@ -76,10 +84,12 @@ public sealed class SignatureHelper {
internal const int IMAGE_CEE_CS_CALLCONV_LOCAL_SIG = 0x7;
internal const int IMAGE_CEE_CS_CALLCONV_PROPERTY = 0x8;
internal const int IMAGE_CEE_CS_CALLCONV_UNMGD = 0x9;
internal const int IMAGE_CEE_CS_CALLCONV_MAX = 0x10; // first invalid calling convention
internal const int IMAGE_CEE_CS_CALLCONV_INSTANTIATION = 0x0a;
internal const int IMAGE_CEE_CS_CALLCONV_MAX = 0x0b; // first invalid calling convention
// The high bits of the calling convention convey additional info
internal const int IMAGE_CEE_CS_CALLCONV_MASK = 0x0f; // Calling convention is bottom 4 bits
internal const int IMAGE_CEE_CS_CALLCONV_GENERIC = 0x10; // Generic method sig with explicit number of type parameters
internal const int IMAGE_CEE_CS_CALLCONV_HASTHIS = 0x20; // Top bit indicates a 'this' parameter
internal const int IMAGE_CEE_CS_CALLCONV_RETPARAM = 0x40; // The first param in the sig is really the return value
@@ -390,6 +400,18 @@ private void AddOneArgTypeHelper(Type clsArgument)
return;
}
if (clsArgument.HasGenericArguments)
{
AddElementType(ELEMENT_TYPE_WITH);
AddOneArgTypeHelper(clsArgument.GetGenericTypeDefinition());
Type[] args = clsArgument.GetGenericArguments();
AddData(args.Length);
foreach (Type t in args) {
AddOneArgTypeHelper(t);
}
return;
}
RuntimeType rType = clsArgument as RuntimeType;
int type = rType != null ? GetCorElementTypeFromClass(rType) : ELEMENT_TYPE_MAX;
if (IsSimpleType(type))
@@ -8,6 +8,11 @@
// By using this software in any fashion, you are agreeing to be bound by the
// terms of this license.
//
// This file contains modifications of the base SSCLI software to support generic
// type definitions and generic methods, THese modifications are for research
// purposes. They do not commit Microsoft to the future support of these or
// any similar changes to the SSCLI or the .NET product. -- 31st October, 2002.
//
// You must not remove this notice, or any other, from this software.
//
//
@@ -53,6 +58,21 @@ abstract public class MethodInfo : MethodBase
get;
}
public bool HasGenericParameters {
get { return HasGenericParametersImpl(); }
}
public bool HasGenericArguments {
get { return HasGenericArgumentsImpl(); }
}
public virtual Type[] GetGenericArguments() { throw new NotSupportedException(Environment.GetResourceString("NotSupported_SubclassOverride")); }
public virtual MethodInfo GetGenericMethodDefinition() { throw new NotSupportedException(Environment.GetResourceString("NotSupported_SubclassOverride")); }
protected virtual bool HasGenericArgumentsImpl() { return false; }
protected virtual bool HasGenericParametersImpl() { return false; }
public virtual MethodInfo BindGenericParameters(Type[] typeArgs) { throw new NotSupportedException(Environment.GetResourceString("NotSupported_SubclassOverride")); }
// This method will return an object that represents the
// custom attributes for the return type.
/// <include file='doc\MethodInfo.uex' path='docs/doc[@for="MethodInfo.ReturnTypeCustomAttributes"]/*' />
@@ -8,6 +8,11 @@
// By using this software in any fashion, you are agreeing to be bound by the
// terms of this license.
//
// This file contains modifications of the base SSCLI software to support generic
// type definitions and generic methods, THese modifications are for research
// purposes. They do not commit Microsoft to the future support of these or
// any similar changes to the SSCLI or the .NET product. -- 31st October, 2002.
//
// You must not remove this notice, or any other, from this software.
//
//
@@ -130,6 +135,27 @@ internal Object InternalInvoke(Object obj,BindingFlags invokeAttr,Binder binder,
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern Type InternalGetReturnType();
/**
* Is this method an instantiated generic method?
*/
[MethodImplAttribute(MethodImplOptions.InternalCall)]
protected extern override bool HasGenericArgumentsImpl();
/**
* Is this method an uninstantiated generic method?
*/
[MethodImplAttribute(MethodImplOptions.InternalCall)]
protected extern override bool HasGenericParametersImpl();
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern public override MethodInfo BindGenericParameters(Type[] typeArgs);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern public override Type[] GetGenericArguments();
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern public override MethodInfo GetGenericMethodDefinition();
// This method will return an object that represents the
// custom attributes for the return type.
public override ICustomAttributeProvider ReturnTypeCustomAttributes {
@@ -0,0 +1,42 @@
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 1999-2000 Microsoft Corporation. All Rights Reserved.
// Microsoft Confidential.
////////////////////////////////////////////////////////////////////////////////
//
// TyParInfo is an class that represents a formal type parameter to a class or method.
//
// Author: akenn
// Date: Jun 01
//
namespace System.Reflection {
using System;
using System.Reflection.Cache;
using System.Runtime.CompilerServices;
public class TyParInfo
{
protected String NameImpl; // The name of the parameter
protected Type[] BoundsImpl; // Type bounds on the parameter
static private Type TyParInfoType = typeof(System.Reflection.TyParInfo);
// Prevent users from creating empty parameters.
protected TyParInfo() {}
// This constructor is called by the runtime and also by users (for Reflection Emit)
public TyParInfo(String name, Type[] bounds)
{
NameImpl = name;
BoundsImpl = bounds;
}
public String Name {
get {return NameImpl;}
}
public Type[] Bounds {
get {return BoundsImpl;}
}
}
}
@@ -8,6 +8,11 @@
// By using this software in any fashion, you are agreeing to be bound by the
// terms of this license.
//
// This file contains modifications of the base SSCLI software to support generic
// type definitions and generic methods, THese modifications are for research
// purposes. They do not commit Microsoft to the future support of these or
// any similar changes to the SSCLI or the .NET product. -- 31st October, 2002.
//
// You must not remove this notice, or any other, from this software.
//
//
@@ -784,9 +789,6 @@ internal static Object SoapCoerceArg(Object value, Type pt, Hashtable keyToNames
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern void PropagateOutParameters(Object[] OutArgs, Object retVal);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern String InternalGetMethodName(MethodBase mb, ref String TypeNAssemblyName);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern bool Dispatch(Object target, bool fExecuteInContext);
Oops, something went wrong.

0 comments on commit 2714cca

Please sign in to comment.