diff options
Taken the old scripting engine out of Region.Environment and moved it into a separate module: OpenSim.Region.ExtensionsScriptModule (named as such because the purpose of it is to script server extensions, rather than "user scripting" like Tedd's engine.)
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scripting/Engines/JVMEngine/JVM/Interpreter.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scripting/Engines/JVMEngine/JVM/Interpreter.cs | 135 |
1 files changed, 0 insertions, 135 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/Engines/JVMEngine/JVM/Interpreter.cs b/OpenSim/Region/Environment/Scenes/Scripting/Engines/JVMEngine/JVM/Interpreter.cs deleted file mode 100644 index e718328..0000000 --- a/OpenSim/Region/Environment/Scenes/Scripting/Engines/JVMEngine/JVM/Interpreter.cs +++ /dev/null | |||
@@ -1,135 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using OpenSim.Region.Scripting.EmbeddedJVM.Types; | ||
32 | using OpenSim.Region.Scripting.EmbeddedJVM.Types.PrimitiveTypes; | ||
33 | |||
34 | namespace OpenSim.Region.Scripting.EmbeddedJVM | ||
35 | { | ||
36 | partial class Thread | ||
37 | { | ||
38 | private partial class Interpreter | ||
39 | { | ||
40 | private Thread m_thread; | ||
41 | |||
42 | public Interpreter(Thread parentThread) | ||
43 | { | ||
44 | m_thread = parentThread; | ||
45 | } | ||
46 | |||
47 | public bool Excute() | ||
48 | { | ||
49 | bool run = true; | ||
50 | byte currentOpCode = GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC++]; | ||
51 | // Console.WriteLine("opCode is: " + currentOpCode); | ||
52 | bool handled = false; | ||
53 | |||
54 | handled = this.IsLogicOpCode(currentOpCode); | ||
55 | if (!handled) | ||
56 | { | ||
57 | handled = this.IsMethodOpCode(currentOpCode); | ||
58 | } | ||
59 | if (!handled) | ||
60 | { | ||
61 | if (currentOpCode == 172) | ||
62 | { | ||
63 | if (this.m_thread.stack.StackFrames.Count > 1) | ||
64 | { | ||
65 | Console.WriteLine("returning int from function"); | ||
66 | int retPC1 = this.m_thread.m_currentFrame.ReturnPC; | ||
67 | BaseType bas1 = this.m_thread.m_currentFrame.OpStack.Pop(); | ||
68 | this.m_thread.stack.StackFrames.Pop(); | ||
69 | this.m_thread.m_currentFrame = this.m_thread.stack.StackFrames.Peek(); | ||
70 | this.m_thread.PC = retPC1; | ||
71 | if (bas1 is Int) | ||
72 | { | ||
73 | this.m_thread.m_currentFrame.OpStack.Push((Int)bas1); | ||
74 | } | ||
75 | } | ||
76 | else | ||
77 | { | ||
78 | // Console.WriteLine("No parent function so ending program"); | ||
79 | this.m_thread.stack.StackFrames.Pop(); | ||
80 | run = false; | ||
81 | } | ||
82 | handled = true; | ||
83 | } | ||
84 | if (currentOpCode == 174) | ||
85 | { | ||
86 | if (this.m_thread.stack.StackFrames.Count > 1) | ||
87 | { | ||
88 | Console.WriteLine("returning float from function"); | ||
89 | int retPC1 = this.m_thread.m_currentFrame.ReturnPC; | ||
90 | BaseType bas1 = this.m_thread.m_currentFrame.OpStack.Pop(); | ||
91 | this.m_thread.stack.StackFrames.Pop(); | ||
92 | this.m_thread.m_currentFrame = this.m_thread.stack.StackFrames.Peek(); | ||
93 | this.m_thread.PC = retPC1; | ||
94 | if (bas1 is Float) | ||
95 | { | ||
96 | this.m_thread.m_currentFrame.OpStack.Push((Float)bas1); | ||
97 | } | ||
98 | } | ||
99 | else | ||
100 | { | ||
101 | // Console.WriteLine("No parent function so ending program"); | ||
102 | this.m_thread.stack.StackFrames.Pop(); | ||
103 | run = false; | ||
104 | } | ||
105 | handled = true; | ||
106 | } | ||
107 | if (currentOpCode == 177) | ||
108 | { | ||
109 | if (this.m_thread.stack.StackFrames.Count > 1) | ||
110 | { | ||
111 | Console.WriteLine("returning from function"); | ||
112 | int retPC = this.m_thread.m_currentFrame.ReturnPC; | ||
113 | this.m_thread.stack.StackFrames.Pop(); | ||
114 | this.m_thread.m_currentFrame = this.m_thread.stack.StackFrames.Peek(); | ||
115 | this.m_thread.PC = retPC; | ||
116 | } | ||
117 | else | ||
118 | { | ||
119 | // Console.WriteLine("No parent function so ending program"); | ||
120 | this.m_thread.stack.StackFrames.Pop(); | ||
121 | run = false; | ||
122 | } | ||
123 | handled = true; | ||
124 | } | ||
125 | } | ||
126 | if (!handled) | ||
127 | { | ||
128 | Console.WriteLine("opcode " + currentOpCode + " not been handled "); | ||
129 | } | ||
130 | return run; | ||
131 | |||
132 | } | ||
133 | } | ||
134 | } | ||
135 | } | ||