mirror of
https://github.com/opensim/opensim.git
synced 2026-05-15 11:25:39 +08:00
a few changes fo yengine exec time check points on function calls
This commit is contained in:
@@ -65,42 +65,49 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
* For all others, we generate the call then a call to CheckRun().
|
||||
*/
|
||||
noCheckRuns = new HashSet<string>() {
|
||||
"llBase64ToString",
|
||||
"llCSV2List",
|
||||
"llDeleteSubList",
|
||||
"llDeleteSubString",
|
||||
"llDumpList2String",
|
||||
"llEscapeURL",
|
||||
"llEuler2Rot",
|
||||
"llAcos",
|
||||
"llAsin",
|
||||
"llAtan2",
|
||||
"llCeil",
|
||||
"llChar",
|
||||
"llCos",
|
||||
"llDetectedGrab",
|
||||
"llDetectedGroup",
|
||||
"llDetectedKey",
|
||||
"llDetectedLinkNumber",
|
||||
"llDetectedName",
|
||||
"llDetectedOwner",
|
||||
"llDetectedPos",
|
||||
"llDetectedRot",
|
||||
"llDetectedTouchBinormal",
|
||||
"llDetectedTouchFace",
|
||||
"llDetectedTouchNormal",
|
||||
"llDetectedTouchPos",
|
||||
"llDetectedTouchST",
|
||||
"llDetectedTouchUV",
|
||||
"llDetectedType",
|
||||
"llDetectedVel",
|
||||
"llFabs",
|
||||
"llFloor",
|
||||
"llFrand",
|
||||
"llLog",
|
||||
"llLog10",
|
||||
"llPow",
|
||||
"llSin",
|
||||
"llSqrt",
|
||||
"llTan",
|
||||
"llGetAccel",
|
||||
"llGetGMTClock",
|
||||
"llGetKey",
|
||||
"llGetListEntryType",
|
||||
"llGetListLength",
|
||||
"llGetSubString",
|
||||
"llGetOwner",
|
||||
"llGetUnixTime",
|
||||
"llInsertString",
|
||||
"llList2CSV",
|
||||
"llList2Float",
|
||||
"llList2Integer",
|
||||
"llList2Key",
|
||||
"llList2List",
|
||||
"llList2ListStrided",
|
||||
"llList2Rot",
|
||||
"llList2String",
|
||||
"llList2Vector",
|
||||
"llListFindList",
|
||||
"llListInsertList",
|
||||
"llListRandomize",
|
||||
"llListReplaceList",
|
||||
"llListSort",
|
||||
"llListStatistics",
|
||||
"llMD5String",
|
||||
"llParseString2List",
|
||||
"llParseStringKeepNulls",
|
||||
"llRot2Euler",
|
||||
"llStringLength",
|
||||
"llStringToBase64",
|
||||
"llStringTrim",
|
||||
"llSubStringIndex",
|
||||
"llUnescapeURL",
|
||||
"osGetSitActiveRange",
|
||||
"osIsNotValidNumber",
|
||||
"osSlerp",
|
||||
@@ -151,25 +158,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
VarDict ifd = new VarDict(false);
|
||||
Type[] oneDoub = new Type[] { typeof(double) };
|
||||
Type[] twoDoubs = new Type[] { typeof(double), typeof(double) };
|
||||
|
||||
/*
|
||||
* Mono generates an FPU instruction for many math calls.
|
||||
*/
|
||||
/* just use lsl api alos this have cast issues
|
||||
new TokenDeclInline_LLAbs(ifd);
|
||||
new TokenDeclInline_Math(ifd, "llAcos(float)", "Acos", oneDoub);
|
||||
new TokenDeclInline_Math(ifd, "llAsin(float)", "Asin", oneDoub);
|
||||
new TokenDeclInline_Math(ifd, "llAtan2(float,float)", "Atan2", twoDoubs);
|
||||
new TokenDeclInline_Math(ifd, "llCos(float)", "Cos", oneDoub);
|
||||
new TokenDeclInline_Math(ifd, "llFabs(float)", "Abs", oneDoub);
|
||||
new TokenDeclInline_Math(ifd, "llLog(float)", "Log", oneDoub);
|
||||
new TokenDeclInline_Math(ifd, "llLog10(float)", "Log10", oneDoub);
|
||||
new TokenDeclInline_Math(ifd, "llPow(float,float)", "Pow", twoDoubs);
|
||||
new TokenDeclInline_LLRound(ifd);
|
||||
new TokenDeclInline_Math(ifd, "llSin(float)", "Sin", oneDoub);
|
||||
new TokenDeclInline_Math(ifd, "llSqrt(float)", "Sqrt", oneDoub);
|
||||
new TokenDeclInline_Math(ifd, "llTan(float)", "Tan", oneDoub);
|
||||
*/
|
||||
|
||||
/*
|
||||
* Something weird about the code generation for these calls, so they all have their own handwritten code generators.
|
||||
*/
|
||||
@@ -212,14 +201,11 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
// this one accepts all methods given to it
|
||||
public static void AddInterfaceMethods(VarDict ifd, IEnumerator<MethodInfo> ifaceMethods, FieldInfo acf)
|
||||
{
|
||||
if(ifd == null)
|
||||
ifd = inlineFunctions;
|
||||
ifd ??= inlineFunctions;
|
||||
|
||||
for(ifaceMethods.Reset(); ifaceMethods.MoveNext();)
|
||||
{
|
||||
MethodInfo ifaceMethod = ifaceMethods.Current;
|
||||
string key = ifaceMethod.Name;
|
||||
|
||||
try
|
||||
{
|
||||
/*
|
||||
@@ -228,9 +214,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
* If function begins with xmr, assume we will not call CheckRun()
|
||||
* Otherwise, assume we will call CheckRun()
|
||||
*/
|
||||
bool dcr = !key.StartsWith("xmr");
|
||||
if(dcr && noCheckRuns.Contains(key))
|
||||
dcr = false;
|
||||
bool dcr = !(ifaceMethod.Name.StartsWith("xmr") || noCheckRuns.Contains(ifaceMethod.Name));
|
||||
|
||||
/*
|
||||
* Add function to dictionary.
|
||||
@@ -305,8 +289,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
triviality = (doCheckRun || isTaggedCallsCheckRun) ? Triviality.complex : Triviality.trivial;
|
||||
location = new CompValuInline(this);
|
||||
|
||||
if(ifd == null)
|
||||
ifd = inlineFunctions;
|
||||
ifd ??= inlineFunctions;
|
||||
ifd.AddEntry(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user