a few changes fo yengine exec time check points on function calls

This commit is contained in:
UbitUmarov
2023-02-09 12:11:18 +00:00
parent 45beb824af
commit 16b6bbd253
3 changed files with 42 additions and 59 deletions

View File

@@ -16801,13 +16801,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llSetSoundQueueing(int queue)
{
if (m_SoundModule != null)
if (m_SoundModule is not null)
m_SoundModule.SetSoundQueueing(m_host.UUID, queue == ScriptBaseClass.TRUE.value);
}
public void llLinkSetSoundQueueing(int linknumber, int queue)
{
if (m_SoundModule != null)
if (m_SoundModule is not null)
{
foreach (SceneObjectPart sop in GetLinkParts(linknumber))
m_SoundModule.SetSoundQueueing(sop.UUID, queue == ScriptBaseClass.TRUE.value);

View File

@@ -35,7 +35,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public partial class ScriptBaseClass
{
// SCRIPTS CONSTANTS
public static readonly LSLInteger OS_APIVERSION = 21;
public static readonly LSLInteger OS_APIVERSION = 22;
public static readonly LSLInteger TRUE = 1;
public static readonly LSLInteger FALSE = 0;

View File

@@ -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);
}