diff options
author | Adam Frisby | 2008-05-08 05:09:35 +0000 |
---|---|---|
committer | Adam Frisby | 2008-05-08 05:09:35 +0000 |
commit | 8a48516bcfcce1a49499d33db0e8eab2f59f7c1a (patch) | |
tree | ead8b2684a00546180dc5ccbcedbce48427faeb5 /OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.cs | |
parent | * Fixes Prim ExtraParams (diff) | |
download | opensim-SC-8a48516bcfcce1a49499d33db0e8eab2f59f7c1a.zip opensim-SC-8a48516bcfcce1a49499d33db0e8eab2f59f7c1a.tar.gz opensim-SC-8a48516bcfcce1a49499d33db0e8eab2f59f7c1a.tar.bz2 opensim-SC-8a48516bcfcce1a49499d33db0e8eab2f59f7c1a.tar.xz |
* Spring cleaning, round 3029
Diffstat (limited to 'OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.cs')
-rw-r--r-- | OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.cs | 132 |
1 files changed, 0 insertions, 132 deletions
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.cs deleted file mode 100644 index 2dd711f..0000000 --- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.cs +++ /dev/null | |||
@@ -1,132 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.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 OpenSim.Region.ExtensionsScriptModule.Engines.JVMEngine.Types; | ||
30 | using OpenSim.Region.ExtensionsScriptModule.Engines.JVMEngine.Types.PrimitiveTypes; | ||
31 | |||
32 | namespace OpenSim.Region.ExtensionsScriptModule.Engines.JVMEngine.JVM | ||
33 | { | ||
34 | partial class Thread | ||
35 | { | ||
36 | private partial class Interpreter | ||
37 | { | ||
38 | private Thread m_thread; | ||
39 | |||
40 | public Interpreter(Thread parentThread) | ||
41 | { | ||
42 | m_thread = parentThread; | ||
43 | } | ||
44 | |||
45 | public bool Excute() | ||
46 | { | ||
47 | bool run = true; | ||
48 | byte currentOpCode = GlobalMemory.MethodArea.MethodBuffer[m_thread.PC++]; | ||
49 | // Console.WriteLine("opCode is: " + currentOpCode); | ||
50 | bool handled = false; | ||
51 | |||
52 | handled = IsLogicOpCode(currentOpCode); | ||
53 | if (!handled) | ||
54 | { | ||
55 | handled = IsMethodOpCode(currentOpCode); | ||
56 | } | ||
57 | if (!handled) | ||
58 | { | ||
59 | if (currentOpCode == 172) | ||
60 | { | ||
61 | if (m_thread.stack.StackFrames.Count > 1) | ||
62 | { | ||
63 | Console.WriteLine("returning int from function"); | ||
64 | int retPC1 = m_thread.m_currentFrame.ReturnPC; | ||
65 | BaseType bas1 = m_thread.m_currentFrame.OpStack.Pop(); | ||
66 | m_thread.stack.StackFrames.Pop(); | ||
67 | m_thread.m_currentFrame = m_thread.stack.StackFrames.Peek(); | ||
68 | m_thread.PC = retPC1; | ||
69 | if (bas1 is Int) | ||
70 | { | ||
71 | m_thread.m_currentFrame.OpStack.Push((Int) bas1); | ||
72 | } | ||
73 | } | ||
74 | else | ||
75 | { | ||
76 | // Console.WriteLine("No parent function so ending program"); | ||
77 | m_thread.stack.StackFrames.Pop(); | ||
78 | run = false; | ||
79 | } | ||
80 | handled = true; | ||
81 | } | ||
82 | if (currentOpCode == 174) | ||
83 | { | ||
84 | if (m_thread.stack.StackFrames.Count > 1) | ||
85 | { | ||
86 | Console.WriteLine("returning float from function"); | ||
87 | int retPC1 = m_thread.m_currentFrame.ReturnPC; | ||
88 | BaseType bas1 = m_thread.m_currentFrame.OpStack.Pop(); | ||
89 | m_thread.stack.StackFrames.Pop(); | ||
90 | m_thread.m_currentFrame = m_thread.stack.StackFrames.Peek(); | ||
91 | m_thread.PC = retPC1; | ||
92 | if (bas1 is Float) | ||
93 | { | ||
94 | m_thread.m_currentFrame.OpStack.Push((Float) bas1); | ||
95 | } | ||
96 | } | ||
97 | else | ||
98 | { | ||
99 | // Console.WriteLine("No parent function so ending program"); | ||
100 | m_thread.stack.StackFrames.Pop(); | ||
101 | run = false; | ||
102 | } | ||
103 | handled = true; | ||
104 | } | ||
105 | if (currentOpCode == 177) | ||
106 | { | ||
107 | if (m_thread.stack.StackFrames.Count > 1) | ||
108 | { | ||
109 | Console.WriteLine("returning from function"); | ||
110 | int retPC = m_thread.m_currentFrame.ReturnPC; | ||
111 | m_thread.stack.StackFrames.Pop(); | ||
112 | m_thread.m_currentFrame = m_thread.stack.StackFrames.Peek(); | ||
113 | m_thread.PC = retPC; | ||
114 | } | ||
115 | else | ||
116 | { | ||
117 | // Console.WriteLine("No parent function so ending program"); | ||
118 | m_thread.stack.StackFrames.Pop(); | ||
119 | run = false; | ||
120 | } | ||
121 | handled = true; | ||
122 | } | ||
123 | } | ||
124 | if (!handled) | ||
125 | { | ||
126 | Console.WriteLine("opcode " + currentOpCode + " not been handled "); | ||
127 | } | ||
128 | return run; | ||
129 | } | ||
130 | } | ||
131 | } | ||
132 | } \ No newline at end of file | ||