Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/corlib/System.Reflection.Emit')
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs2
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/ConstructorBuilder.cs8
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/ConstructorOnTypeBuilderInst.cs9
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs5
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/DynamicMethod.cs14
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs6
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs8
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/MethodOnTypeBuilderInst.cs9
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/MonoArrayMethod.cs12
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/PropertyOnTypeBuilderInst.cs3
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs2
11 files changed, 54 insertions, 24 deletions
diff --git a/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs
index c0586b55402..e53cdbb097e 100644
--- a/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs
@@ -859,7 +859,7 @@ namespace System.Reflection.Emit
*/
if ((entry_point != null) && entry_point.DeclaringType.Module != mainModule) {
Type[] paramTypes;
- if (entry_point.GetParameters ().Length == 1)
+ if (entry_point.GetParametersCount () == 1)
paramTypes = new Type [] { typeof (string) };
else
paramTypes = Type.EmptyTypes;
diff --git a/mcs/class/corlib/System.Reflection.Emit/ConstructorBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/ConstructorBuilder.cs
index 2391dc8be2c..b0e6747bedf 100644
--- a/mcs/class/corlib/System.Reflection.Emit/ConstructorBuilder.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/ConstructorBuilder.cs
@@ -120,10 +120,10 @@ namespace System.Reflection.Emit {
return GetParametersInternal ();
}
- internal ParameterInfo [] GetParametersInternal ()
+ internal override ParameterInfo [] GetParametersInternal ()
{
if (parameters == null)
- return new ParameterInfo [0];
+ return EmptyArray<ParameterInfo>.Value;
ParameterInfo [] retval = new ParameterInfo [parameters.Length];
for (int i = 0; i < parameters.Length; i++)
@@ -133,7 +133,7 @@ namespace System.Reflection.Emit {
return retval;
}
- internal override int GetParameterCount ()
+ internal override int GetParametersCount ()
{
if (parameters == null)
return 0;
@@ -232,7 +232,7 @@ namespace System.Reflection.Emit {
public ParameterBuilder DefineParameter (int iSequence, ParameterAttributes attributes, string strParamName)
{
- if (iSequence < 1 || iSequence > GetParameterCount ())
+ if (iSequence < 1 || iSequence > GetParametersCount ())
throw new ArgumentOutOfRangeException ("iSequence");
if (type.is_created)
throw not_after_created ();
diff --git a/mcs/class/corlib/System.Reflection.Emit/ConstructorOnTypeBuilderInst.cs b/mcs/class/corlib/System.Reflection.Emit/ConstructorOnTypeBuilderInst.cs
index ea3cee589d0..1f7b30dbce5 100644
--- a/mcs/class/corlib/System.Reflection.Emit/ConstructorOnTypeBuilderInst.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/ConstructorOnTypeBuilderInst.cs
@@ -104,6 +104,11 @@ namespace System.Reflection.Emit
if (!instantiation.IsCreated)
throw new NotSupportedException ();
+ return GetParametersInternal ();
+ }
+
+ internal override ParameterInfo[] GetParametersInternal ()
+ {
ParameterInfo [] res;
if (cb is ConstructorBuilder) {
ConstructorBuilder cbuilder = (ConstructorBuilder)cb;
@@ -129,9 +134,9 @@ namespace System.Reflection.Emit
}
}
- internal override int GetParameterCount ()
+ internal override int GetParametersCount ()
{
- return cb.GetParameterCount ();
+ return cb.GetParametersCount ();
}
public override Object Invoke (Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
diff --git a/mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs
index 862420a6cc0..647736bf203 100644
--- a/mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs
@@ -148,7 +148,7 @@ namespace System.Reflection.Emit {
throw new ArgumentNullException ("namedFields");
if (fieldValues == null)
throw new ArgumentNullException ("fieldValues");
- if (con.GetParameterCount () != constructorArgs.Length)
+ if (con.GetParametersCount () != constructorArgs.Length)
throw new ArgumentException ("Parameter count does not match " +
"passed in argument value count.");
if (namedProperties.Length != propertyValues.Length)
@@ -532,7 +532,8 @@ namespace System.Reflection.Emit {
ConstructorBuilder cb = ctor as ConstructorBuilder;
if (cb != null)
return cb.GetParametersInternal ();
- return ctor.GetParameters ();
+
+ return ctor.GetParametersInternal ();
}
}
}
diff --git a/mcs/class/corlib/System.Reflection.Emit/DynamicMethod.cs b/mcs/class/corlib/System.Reflection.Emit/DynamicMethod.cs
index 931573d5449..0e87b8a340f 100644
--- a/mcs/class/corlib/System.Reflection.Emit/DynamicMethod.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/DynamicMethod.cs
@@ -245,9 +245,15 @@ namespace System.Reflection.Emit {
return MethodImplAttributes.IL | MethodImplAttributes.Managed;
}
- public override ParameterInfo[] GetParameters () {
+ public override ParameterInfo[] GetParameters ()
+ {
+ return GetParametersInternal ();
+ }
+
+ internal override ParameterInfo[] GetParametersInternal ()
+ {
if (parameters == null)
- return new ParameterInfo [0];
+ return EmptyArray<ParameterInfo>.Value;
ParameterInfo[] retval = new ParameterInfo [parameters.Length];
for (int i = 0; i < parameters.Length; i++) {
@@ -256,7 +262,7 @@ namespace System.Reflection.Emit {
return retval;
}
- internal override int GetParameterCount ()
+ internal override int GetParametersCount ()
{
return parameters == null ? 0 : parameters.Length;
}
@@ -297,7 +303,7 @@ namespace System.Reflection.Emit {
public override string ToString () {
string parms = String.Empty;
- ParameterInfo[] p = GetParameters ();
+ ParameterInfo[] p = GetParametersInternal ();
for (int i = 0; i < p.Length; ++i) {
if (i > 0)
parms = parms + ", ";
diff --git a/mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs b/mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs
index 2172b1e63f1..1c9c3f4c3d1 100644
--- a/mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs
@@ -525,7 +525,7 @@ namespace System.Reflection.Emit {
emit_int (token);
if (opcode.StackBehaviourPop == StackBehaviour.Varpop)
- cur_stack -= con.GetParameterCount ();
+ cur_stack -= con.GetParametersCount ();
}
public virtual void Emit (OpCode opcode, double arg)
@@ -744,7 +744,7 @@ namespace System.Reflection.Emit {
cur_stack ++;
if (opcode.StackBehaviourPop == StackBehaviour.Varpop)
- cur_stack -= meth.GetParameterCount ();
+ cur_stack -= meth.GetParametersCount ();
}
private void Emit (OpCode opcode, MethodInfo method, int token)
@@ -762,7 +762,7 @@ namespace System.Reflection.Emit {
cur_stack ++;
if (opcode.StackBehaviourPop == StackBehaviour.Varpop)
- cur_stack -= method.GetParameterCount ();
+ cur_stack -= method.GetParametersCount ();
}
[CLSCompliant(false)]
diff --git a/mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs
index 1beb945a8d2..f898bce399e 100644
--- a/mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs
@@ -219,6 +219,12 @@ namespace System.Reflection.Emit
{
if (!type.is_created)
throw NotSupported ();
+
+ return GetParametersInternal ();
+ }
+
+ internal override ParameterInfo[] GetParametersInternal ()
+ {
if (parameters == null)
return null;
@@ -229,7 +235,7 @@ namespace System.Reflection.Emit
return retval;
}
- internal override int GetParameterCount ()
+ internal override int GetParametersCount ()
{
if (parameters == null)
return 0;
diff --git a/mcs/class/corlib/System.Reflection.Emit/MethodOnTypeBuilderInst.cs b/mcs/class/corlib/System.Reflection.Emit/MethodOnTypeBuilderInst.cs
index aa19ecef3bf..1384f9971e4 100644
--- a/mcs/class/corlib/System.Reflection.Emit/MethodOnTypeBuilderInst.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/MethodOnTypeBuilderInst.cs
@@ -164,6 +164,11 @@ namespace System.Reflection.Emit
public override ParameterInfo [] GetParameters ()
{
+ return GetParametersInternal ();
+ }
+
+ internal override ParameterInfo [] GetParametersInternal ()
+ {
throw new NotSupportedException ();
}
@@ -173,9 +178,9 @@ namespace System.Reflection.Emit
}
}
- internal override int GetParameterCount ()
+ internal override int GetParametersCount ()
{
- return base_method.GetParameterCount ();
+ return base_method.GetParametersCount ();
}
public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
diff --git a/mcs/class/corlib/System.Reflection.Emit/MonoArrayMethod.cs b/mcs/class/corlib/System.Reflection.Emit/MonoArrayMethod.cs
index dc9ca4073ee..aa24bc34719 100644
--- a/mcs/class/corlib/System.Reflection.Emit/MonoArrayMethod.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/MonoArrayMethod.cs
@@ -79,12 +79,18 @@ namespace System.Reflection {
}
[MonoTODO("Not implemented. Always returns an empty array")]
- public override ParameterInfo[] GetParameters() {
- return new ParameterInfo [0];
+ public override ParameterInfo[] GetParameters()
+ {
+ return GetParametersInternal ();
}
+
+ internal override ParameterInfo[] GetParametersInternal ()
+ {
+ return EmptyArray<ParameterInfo>.Value;
+ }
[MonoTODO("Not implemented. Always returns 0")]
- internal override int GetParameterCount ()
+ internal override int GetParametersCount ()
{
return 0;
}
diff --git a/mcs/class/corlib/System.Reflection.Emit/PropertyOnTypeBuilderInst.cs b/mcs/class/corlib/System.Reflection.Emit/PropertyOnTypeBuilderInst.cs
index 578cf06a5d1..1035f494c86 100644
--- a/mcs/class/corlib/System.Reflection.Emit/PropertyOnTypeBuilderInst.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/PropertyOnTypeBuilderInst.cs
@@ -115,7 +115,8 @@ namespace System.Reflection.Emit
MethodInfo method = GetGetMethod (true);
if (method != null)
return method.GetParameters ();
- return new ParameterInfo [0];
+
+ return EmptyArray<ParameterInfo>.Value;
}
public override MethodInfo GetSetMethod (bool nonPublic)
diff --git a/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
index 462717057cc..882d125442d 100644
--- a/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
@@ -1459,7 +1459,7 @@ namespace System.Reflection.Emit
throw new Exception ("Error in customattr");
}
- var ctor_type = customBuilder.Ctor is ConstructorBuilder ? ((ConstructorBuilder)customBuilder.Ctor).parameters[0] : customBuilder.Ctor.GetParameters()[0].ParameterType;
+ var ctor_type = customBuilder.Ctor is ConstructorBuilder ? ((ConstructorBuilder)customBuilder.Ctor).parameters[0] : customBuilder.Ctor.GetParametersInternal()[0].ParameterType;
int pos = 6;
if (ctor_type.FullName == "System.Int16")
pos = 4;