Added compile-count property to callable symbols
This commit is contained in:
parent
08ca27a4b9
commit
e12607790f
1 changed files with 7 additions and 0 deletions
|
@ -102,11 +102,16 @@ namespace arookas {
|
|||
|
||||
abstract class sunCallableSymbol : sunSymbol {
|
||||
sunParameterInfo mParameters;
|
||||
protected int mCompiles;
|
||||
|
||||
public sunParameterInfo Parameters {
|
||||
get { return mParameters; }
|
||||
}
|
||||
|
||||
public int CompileCount {
|
||||
get { return mCompiles; }
|
||||
}
|
||||
|
||||
protected sunCallableSymbol(string name, sunParameterInfo parameterInfo)
|
||||
: base(name) {
|
||||
mParameters = parameterInfo;
|
||||
|
@ -136,6 +141,7 @@ namespace arookas {
|
|||
|
||||
public override void Compile(sunCompiler compiler) {
|
||||
// don't compile builtins
|
||||
++mCompiles;
|
||||
}
|
||||
public override sunRelocation CreateCallSite(sunCompiler compiler, int argCount) {
|
||||
return new sunBuiltinCallSite(this, compiler, argCount);
|
||||
|
@ -178,6 +184,7 @@ namespace arookas {
|
|||
mBody.Compile(compiler);
|
||||
compiler.Binary.WriteRET0();
|
||||
compiler.Context.Scopes.Pop();
|
||||
++mCompiles;
|
||||
}
|
||||
public override sunRelocation CreateCallSite(sunCompiler compiler, int argCount) {
|
||||
return new sunFunctionCallSite(this, compiler, argCount);
|
||||
|
|
Loading…
Add table
Reference in a new issue