Esempio n. 1
0
 internal static Property CreateProperty(Class declaringType, string name, Method getMethod, Method setMethod)
 {
     Property property = new Property();
     property.DeclaringClass = declaringType;
     property.Name = name;
     property.GetMethod = getMethod;
     property.SetMethod = setMethod;
     declaringType.Properties.Push(property);
     return property;
 }
Esempio n. 2
0
 internal static Method CreateMethod(Class declaringType, string name, NativeFunction function, int vtableSlot)
 {
     Method method = new Method();
     method.Name = name;
     method.Function = function;
     method.VTableSlot = vtableSlot;
     if (function != null)
     {
         function["m"] = var.Cast<Method>(method);
     }
     method.DeclaringClass = declaringType;
     declaringType.Methods.Push(method);
     return method;
 }
Esempio n. 3
0
        // TODO: This is a temp hack for property getters and setters!!
        public static object TrampolineInvokeMethod(Method method, object self, object[] args)
        {
            if (method.Function != null)
            {
                TempHackGenerateCodeForTrampolineInvokeMethod(method.Function, self, args);
            }
            else
            {
                if (method.DeclaringClass.IsInterface)
                {
                    if(method.VTableSlot == -1)
                    {
                        // TODO: Throw MissingMethodException
                        throw new ExecutionEngineException("No vtable slot!");
                    }
                    TempHackGenerateCodeForTrampolineInvokeInterfaceMethod(self, method.DeclaringClass.VTableDataPointer, method.VTableSlot, args);
                }
                throw new NotImplementedException("Method invocation through reflection is not yet implemented.  Though, the temp property hack is in place!");
            }

            // we should never get here!
            throw new ExecutionEngineException("Trampoline for method " + method + " failed");
        }
Esempio n. 4
0
 internal static CustomAttribute CreateCustomAttribute(ICustomAttributeProvider attributeProvider, Method constructor)
 {
     CustomAttribute attribute = new CustomAttribute();
     attribute.Constructor = constructor;
     attributeProvider.CustomAttributes.Push(attribute);
     return attribute;
 }
Esempio n. 5
0
 public RuntimeMethodInfo(Method method, RuntimeType declaringType)
 {
     _method = method;
     _declaringType = declaringType;
 }