From 38cd12b3cf00ac137fb474e76fa762f01dfe1283 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 5 Feb 2018 12:48:07 +0000 Subject: add mrieker fresh optimization on heap tracker --- .../Region/ScriptEngine/XMREngine/MMRScriptCodeGen.cs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/XMREngine/MMRScriptCodeGen.cs') diff --git a/OpenSim/Region/ScriptEngine/XMREngine/MMRScriptCodeGen.cs b/OpenSim/Region/ScriptEngine/XMREngine/MMRScriptCodeGen.cs index 5219fa8..3b0ba66 100644 --- a/OpenSim/Region/ScriptEngine/XMREngine/MMRScriptCodeGen.cs +++ b/OpenSim/Region/ScriptEngine/XMREngine/MMRScriptCodeGen.cs @@ -141,9 +141,6 @@ namespace OpenSim.Region.ScriptEngine.XMREngine new Type[] { typeof (LSL_Vector) }); private static MethodInfo scriptRestoreCatchExceptionUnwrap = GetStaticMethod (typeof (ScriptRestoreCatchException), "Unwrap", new Type[] { typeof (Exception) }); private static MethodInfo thrownExceptionWrapMethodInfo = GetStaticMethod (typeof (ScriptThrownException), "Wrap", new Type[] { typeof (object) }); - private static MethodInfo heapTrackerListPush = typeof (HeapTrackerList). GetMethod ("Push", new Type[0]); - private static MethodInfo heapTrackerObjectPush = typeof (HeapTrackerObject).GetMethod ("Push", new Type[0]); - private static MethodInfo heapTrackerStringPush = typeof (HeapTrackerString).GetMethod ("Push", new Type[0]); private static MethodInfo catchExcToStrMethodInfo = GetStaticMethod (typeof (ScriptCodeGen), "CatchExcToStr", @@ -1510,16 +1507,13 @@ namespace OpenSim.Region.ScriptEngine.XMREngine ilGen.Emit (curDeclFunc, OpCodes.Ldloc, lcl); Type t = lcl.type; if (t == typeof (HeapTrackerList)) { - ilGen.Emit (curDeclFunc, OpCodes.Call, heapTrackerListPush); - t = typeof (LSL_List); + t = HeapTrackerList.GenPush (curDeclFunc, ilGen); } if (t == typeof (HeapTrackerObject)) { - ilGen.Emit (curDeclFunc, OpCodes.Call, heapTrackerObjectPush); - t = typeof (object); + t = HeapTrackerObject.GenPush (curDeclFunc, ilGen); } - if (t == typeof (HeapTrackerString)) { - ilGen.Emit (curDeclFunc, OpCodes.Call, heapTrackerStringPush); - t = typeof (string); + if (t == typeof(HeapTrackerString)) { + t = HeapTrackerString.GenPush (curDeclFunc, ilGen); } if (t.IsValueType) { ilGen.Emit (curDeclFunc, OpCodes.Box, t); @@ -1615,7 +1609,9 @@ namespace OpenSim.Region.ScriptEngine.XMREngine ilGen.Emit (curDeclFunc, OpCodes.Castclass, u); } if (u != t) { - ilGen.Emit (curDeclFunc, OpCodes.Call, t.GetMethod ("Pop", new Type[] { u })); + if (t == typeof (HeapTrackerList)) HeapTrackerList.GenPop (curDeclFunc, ilGen); + if (t == typeof (HeapTrackerObject)) HeapTrackerObject.GenPop (curDeclFunc, ilGen); + if (t == typeof (HeapTrackerString)) HeapTrackerString.GenPop (curDeclFunc, ilGen); } else { ilGen.Emit (curDeclFunc, OpCodes.Stloc, lcl); } -- cgit v1.1