2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 05:23:13 +00:00

Static Calling

This commit is contained in:
2022-08-07 23:09:31 +03:00
parent 0dc457bf7e
commit af94ce318a
18 changed files with 784 additions and 259 deletions

View File

@ -24,6 +24,8 @@ public class FunctionTemplate : MemberTemplate
public RepresentationType ReturnType { get; set; }
public bool IsStatic { get; set; }
public ArgumentTemplate[] Arguments { get; set; }
public MethodInfo MethodInfo
@ -53,20 +55,20 @@ public class FunctionTemplate : MemberTemplate
var exp = DC.ToBytes(Annotation);
bl.AddInt32(exp.Length)
.AddUInt8Array(exp);
bl.InsertUInt8(0, Inherited ? (byte)0x90 : (byte)0x10);
bl.InsertUInt8(0, (byte)((Inherited ? (byte)0x90 : (byte)0x10) | (IsStatic ? 0x4 : 0)));
}
else
bl.InsertUInt8(0, Inherited ? (byte)0x80 : (byte)0x0);
bl.InsertUInt8(0, (byte)((Inherited ? (byte)0x80 : (byte)0x0) | (IsStatic ? 0x4 : 0)));
return bl.ToArray();
}
public FunctionTemplate(TypeTemplate template, byte index, string name, bool inherited, ArgumentTemplate[] arguments, RepresentationType returnType, string annotation = null)
public FunctionTemplate(TypeTemplate template, byte index, string name, bool inherited, bool isStatic, ArgumentTemplate[] arguments, RepresentationType returnType, string annotation = null)
: base(template, index, name, inherited)
{
//this.IsVoid = isVoid;
this.Arguments = arguments;
this.ReturnType = returnType;
this.Annotation = annotation;
this.IsStatic = isStatic;
}
}