diff options
author | Sean Dague | 2007-07-16 15:40:11 +0000 |
---|---|---|
committer | Sean Dague | 2007-07-16 15:40:11 +0000 |
commit | 2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6 (patch) | |
tree | e3f80ad51736cf17e856547b1bcf956010927434 /OpenSim/Region/Environment/Scenes/scripting/Engines/JVMEngine/JVM/Thread.cs | |
parent | *Trunk compiles now (diff) | |
download | opensim-SC-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.zip opensim-SC-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.gz opensim-SC-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.bz2 opensim-SC-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.xz |
changed to native line ending encoding
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/scripting/Engines/JVMEngine/JVM/Thread.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/scripting/Engines/JVMEngine/JVM/Thread.cs | 238 |
1 files changed, 119 insertions, 119 deletions
diff --git a/OpenSim/Region/Environment/Scenes/scripting/Engines/JVMEngine/JVM/Thread.cs b/OpenSim/Region/Environment/Scenes/scripting/Engines/JVMEngine/JVM/Thread.cs index 59f3042..eda2640 100644 --- a/OpenSim/Region/Environment/Scenes/scripting/Engines/JVMEngine/JVM/Thread.cs +++ b/OpenSim/Region/Environment/Scenes/scripting/Engines/JVMEngine/JVM/Thread.cs | |||
@@ -1,119 +1,119 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 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. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Text; | 30 | using System.Text; |
31 | using OpenSim.Region.Scripting.EmbeddedJVM.Types; | 31 | using OpenSim.Region.Scripting.EmbeddedJVM.Types; |
32 | using OpenSim.Region.Scripting.EmbeddedJVM.Types.PrimitiveTypes; | 32 | using OpenSim.Region.Scripting.EmbeddedJVM.Types.PrimitiveTypes; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Interfaces; | 34 | using OpenSim.Framework.Interfaces; |
35 | using OpenSim.Region.Environment.Scenes; | 35 | using OpenSim.Region.Environment.Scenes; |
36 | using OpenSim.Region.Scripting; | 36 | using OpenSim.Region.Scripting; |
37 | 37 | ||
38 | namespace OpenSim.Region.Scripting.EmbeddedJVM | 38 | namespace OpenSim.Region.Scripting.EmbeddedJVM |
39 | { | 39 | { |
40 | public partial class Thread | 40 | public partial class Thread |
41 | { | 41 | { |
42 | // Is this smart? | 42 | // Is this smart? |
43 | public static MainMemory GlobalMemory; | 43 | public static MainMemory GlobalMemory; |
44 | public static Scene World; | 44 | public static Scene World; |
45 | private int PC = 0; | 45 | private int PC = 0; |
46 | private Stack stack; | 46 | private Stack stack; |
47 | private Interpreter mInterpreter; | 47 | private Interpreter mInterpreter; |
48 | public ClassRecord currentClass; | 48 | public ClassRecord currentClass; |
49 | public ClassInstance currentInstance; | 49 | public ClassInstance currentInstance; |
50 | private StackFrame currentFrame; | 50 | private StackFrame currentFrame; |
51 | public int excutionCounter = 0; | 51 | public int excutionCounter = 0; |
52 | public bool running = false; | 52 | public bool running = false; |
53 | 53 | ||
54 | public ScriptInfo scriptInfo; | 54 | public ScriptInfo scriptInfo; |
55 | 55 | ||
56 | public Thread() | 56 | public Thread() |
57 | { | 57 | { |
58 | this.mInterpreter = new Interpreter(this); | 58 | this.mInterpreter = new Interpreter(this); |
59 | this.stack = new Stack(); | 59 | this.stack = new Stack(); |
60 | } | 60 | } |
61 | 61 | ||
62 | public void SetPC(int methodpointer) | 62 | public void SetPC(int methodpointer) |
63 | { | 63 | { |
64 | //Console.WriteLine("Thread PC has been set to " + methodpointer); | 64 | //Console.WriteLine("Thread PC has been set to " + methodpointer); |
65 | PC = methodpointer; | 65 | PC = methodpointer; |
66 | } | 66 | } |
67 | 67 | ||
68 | public void StartMethod(ClassRecord rec, string methName) | 68 | public void StartMethod(ClassRecord rec, string methName) |
69 | { | 69 | { |
70 | currentFrame = new StackFrame(); | 70 | currentFrame = new StackFrame(); |
71 | this.stack.StackFrames.Push(currentFrame); | 71 | this.stack.StackFrames.Push(currentFrame); |
72 | this.currentClass = rec; | 72 | this.currentClass = rec; |
73 | currentClass.StartMethod(this, methName); | 73 | currentClass.StartMethod(this, methName); |
74 | } | 74 | } |
75 | 75 | ||
76 | public void StartMethod( string methName) | 76 | public void StartMethod( string methName) |
77 | { | 77 | { |
78 | currentFrame = new StackFrame(); | 78 | currentFrame = new StackFrame(); |
79 | this.stack.StackFrames.Push(currentFrame); | 79 | this.stack.StackFrames.Push(currentFrame); |
80 | currentClass.StartMethod(this, methName); | 80 | currentClass.StartMethod(this, methName); |
81 | } | 81 | } |
82 | 82 | ||
83 | public void JumpToStaticVoidMethod(string methName, int returnPC) | 83 | public void JumpToStaticVoidMethod(string methName, int returnPC) |
84 | { | 84 | { |
85 | currentFrame = new StackFrame(); | 85 | currentFrame = new StackFrame(); |
86 | currentFrame.ReturnPC = returnPC; | 86 | currentFrame.ReturnPC = returnPC; |
87 | this.stack.StackFrames.Push(currentFrame); | 87 | this.stack.StackFrames.Push(currentFrame); |
88 | currentClass.StartMethod(this, methName); | 88 | currentClass.StartMethod(this, methName); |
89 | } | 89 | } |
90 | 90 | ||
91 | public void JumpToStaticParamMethod(string methName, string param, int returnPC) | 91 | public void JumpToStaticParamMethod(string methName, string param, int returnPC) |
92 | { | 92 | { |
93 | if (param == "I") | 93 | if (param == "I") |
94 | { | 94 | { |
95 | BaseType bs1 = currentFrame.OpStack.Pop(); | 95 | BaseType bs1 = currentFrame.OpStack.Pop(); |
96 | currentFrame = new StackFrame(); | 96 | currentFrame = new StackFrame(); |
97 | currentFrame.ReturnPC = returnPC; | 97 | currentFrame.ReturnPC = returnPC; |
98 | this.stack.StackFrames.Push(currentFrame); | 98 | this.stack.StackFrames.Push(currentFrame); |
99 | currentFrame.LocalVariables[0] = ((Int)bs1); | 99 | currentFrame.LocalVariables[0] = ((Int)bs1); |
100 | currentClass.StartMethod(this, methName); | 100 | currentClass.StartMethod(this, methName); |
101 | } | 101 | } |
102 | if (param == "F") | 102 | if (param == "F") |
103 | { | 103 | { |
104 | 104 | ||
105 | } | 105 | } |
106 | } | 106 | } |
107 | 107 | ||
108 | public void JumpToClassStaticVoidMethod(string className, string methName, int returnPC) | 108 | public void JumpToClassStaticVoidMethod(string className, string methName, int returnPC) |
109 | { | 109 | { |
110 | 110 | ||
111 | } | 111 | } |
112 | 112 | ||
113 | public bool Excute() | 113 | public bool Excute() |
114 | { | 114 | { |
115 | excutionCounter++; | 115 | excutionCounter++; |
116 | return this.mInterpreter.Excute(); | 116 | return this.mInterpreter.Excute(); |
117 | } | 117 | } |
118 | } | 118 | } |
119 | } | 119 | } |