aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDr Scofield2009-02-16 20:01:54 +0000
committerDr Scofield2009-02-16 20:01:54 +0000
commit4e1f060dd19bf502f2e13cabcd55bdf573bfc89f (patch)
tree592cf01e52bbd9ce342c58648059106a456842d4 /OpenSim
parent* Apply http://opensimulator.org/mantis/view.php?id=3166 (diff)
downloadopensim-SC_OLD-4e1f060dd19bf502f2e13cabcd55bdf573bfc89f.zip
opensim-SC_OLD-4e1f060dd19bf502f2e13cabcd55bdf573bfc89f.tar.gz
opensim-SC_OLD-4e1f060dd19bf502f2e13cabcd55bdf573bfc89f.tar.bz2
opensim-SC_OLD-4e1f060dd19bf502f2e13cabcd55bdf573bfc89f.tar.xz
From: alan webb <alan_webb@us.ibm.com> & dr scofield <drscofield@xyzzyxyzzy.net>
This changeset fixes a rather nasty script compile bug that manifests itself under heavy load.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs25
1 files changed, 17 insertions, 8 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
index 0f4e7e5..1734a16 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
@@ -71,9 +71,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
71 71
72 private string FilePrefix; 72 private string FilePrefix;
73 private string ScriptEnginesPath = "ScriptEngines"; 73 private string ScriptEnginesPath = "ScriptEngines";
74 // mapping between LSL and C# line/column numbers
75 private Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap;
76 private ICodeConverter LSL_Converter;
77
78 // private object m_syncy = new object();
74 79
75 private static ICodeConverter LSL_Converter;
76 private static Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap; // mapping between LSL and C# line/column numbers
77 private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); 80 private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider();
78 private static VBCodeProvider VBcodeProvider = new VBCodeProvider(); 81 private static VBCodeProvider VBcodeProvider = new VBCodeProvider();
79 private static JScriptCodeProvider JScodeProvider = new JScriptCodeProvider(); 82 private static JScriptCodeProvider JScodeProvider = new JScriptCodeProvider();
@@ -89,6 +92,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
89 m_scriptEngine = scriptEngine; 92 m_scriptEngine = scriptEngine;
90 ReadConfig(); 93 ReadConfig();
91 } 94 }
95
92 public bool in_startup = true; 96 public bool in_startup = true;
93 public void ReadConfig() 97 public void ReadConfig()
94 { 98 {
@@ -255,8 +259,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
255 /// <returns>Filename to .dll assembly</returns> 259 /// <returns>Filename to .dll assembly</returns>
256 public string PerformScriptCompile(string Script, string asset) 260 public string PerformScriptCompile(string Script, string asset)
257 { 261 {
262 // lock(m_syncy)
258 m_positionMap = null; 263 m_positionMap = null;
259 264
260 string OutFile = Path.Combine(ScriptEnginesPath, Path.Combine( 265 string OutFile = Path.Combine(ScriptEnginesPath, Path.Combine(
261 m_scriptEngine.World.RegionInfo.RegionID.ToString(), 266 m_scriptEngine.World.RegionInfo.RegionID.ToString(),
262 FilePrefix + "_compiled_" + asset + ".dll")); 267 FilePrefix + "_compiled_" + asset + ".dll"));
@@ -334,6 +339,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
334 LSL_Converter = (ICodeConverter)new CSCodeGenerator(); 339 LSL_Converter = (ICodeConverter)new CSCodeGenerator();
335 compileScript = LSL_Converter.Convert(Script); 340 compileScript = LSL_Converter.Convert(Script);
336 341
342 // lock(m_syncy)
337 m_positionMap = ((CSCodeGenerator) LSL_Converter).PositionMap; 343 m_positionMap = ((CSCodeGenerator) LSL_Converter).PositionMap;
338 } 344 }
339 345
@@ -580,6 +586,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
580 586
581 public KeyValuePair<int, int> FindErrorPosition(int line, int col) 587 public KeyValuePair<int, int> FindErrorPosition(int line, int col)
582 { 588 {
589 // lock(m_syncy)
583 return FindErrorPosition(line, col, m_positionMap); 590 return FindErrorPosition(line, col, m_positionMap);
584 } 591 }
585 592
@@ -654,19 +661,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
654 return message; 661 return message;
655 } 662 }
656 663
657 public Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> 664 public Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> LineMap()
658 LineMap()
659 { 665 {
666 // lock(m_syncy)
667 // {
660 if (m_positionMap == null) 668 if (m_positionMap == null)
661 return null; 669 return null;
662 670
663 Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> ret = 671 Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> ret =
664 new Dictionary<KeyValuePair<int,int>, KeyValuePair<int, int>>(); 672 new Dictionary<KeyValuePair<int,int>, KeyValuePair<int, int>>();
665 673
666 foreach (KeyValuePair<int, int> kvp in m_positionMap.Keys) 674 foreach (KeyValuePair<int, int> kvp in m_positionMap.Keys)
667 ret.Add(kvp, m_positionMap[kvp]); 675 ret.Add(kvp, m_positionMap[kvp]);
668 676
669 return ret; 677 return ret;
678 // }
670 } 679 }
671 } 680 }
672} 681}