diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Methods.cs | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Methods.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Methods.cs deleted file mode 100644 index 7da2012..0000000 --- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Methods.cs +++ /dev/null | |||
@@ -1,104 +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 | |||
30 | namespace OpenSim.Region.ExtensionsScriptModule.Engines.JVMEngine.JVM | ||
31 | { | ||
32 | partial class Thread | ||
33 | { | ||
34 | private partial class Interpreter | ||
35 | { | ||
36 | private bool IsMethodOpCode(byte opcode) | ||
37 | { | ||
38 | bool result = false; | ||
39 | switch (opcode) | ||
40 | { | ||
41 | case 184: | ||
42 | short refIndex = | ||
43 | (short) | ||
44 | ((GlobalMemory.MethodArea.MethodBuffer[m_thread.PC] << 8) + | ||
45 | GlobalMemory.MethodArea.MethodBuffer[m_thread.PC + 1]); | ||
46 | if (m_thread.currentClass.m_constantsPool[refIndex - 1] is ClassRecord.PoolMethodRef) | ||
47 | { | ||
48 | string typ = | ||
49 | ((ClassRecord.PoolMethodRef) m_thread.currentClass.m_constantsPool[refIndex - 1]). | ||
50 | mNameType.Type.Value; | ||
51 | string typeparam = String.Empty; | ||
52 | string typereturn = String.Empty; | ||
53 | int firstbrak = 0; | ||
54 | int secondbrak = 0; | ||
55 | firstbrak = typ.LastIndexOf('('); | ||
56 | secondbrak = typ.LastIndexOf(')'); | ||
57 | typeparam = typ.Substring(firstbrak + 1, secondbrak - firstbrak - 1); | ||
58 | typereturn = typ.Substring(secondbrak + 1, typ.Length - secondbrak - 1); | ||
59 | if ( | ||
60 | ((ClassRecord.PoolMethodRef) m_thread.currentClass.m_constantsPool[refIndex - 1]).mClass | ||
61 | .Name.Value == m_thread.currentClass.MClass.Name.Value) | ||
62 | { | ||
63 | //calling a method in this class | ||
64 | if (typeparam.Length == 0) | ||
65 | { | ||
66 | m_thread.JumpToStaticVoidMethod( | ||
67 | ((ClassRecord.PoolMethodRef) m_thread.currentClass.m_constantsPool[refIndex - 1]) | ||
68 | .mNameType.Name.Value, (m_thread.PC + 2)); | ||
69 | } | ||
70 | else | ||
71 | { | ||
72 | m_thread.JumpToStaticParamMethod( | ||
73 | ((ClassRecord.PoolMethodRef) m_thread.currentClass.m_constantsPool[refIndex - 1]) | ||
74 | .mNameType.Name.Value, typeparam, (m_thread.PC + 2)); | ||
75 | } | ||
76 | } | ||
77 | else | ||
78 | { | ||
79 | //calling a method of a different class | ||
80 | |||
81 | // OpenSimAPI Class | ||
82 | if ( | ||
83 | ((ClassRecord.PoolMethodRef) m_thread.currentClass.m_constantsPool[refIndex - 1]). | ||
84 | mClass.Name.Value == "OpenSimAPI") | ||
85 | { | ||
86 | m_thread.scriptInfo.api.CallMethod( | ||
87 | ((ClassRecord.PoolMethodRef) m_thread.currentClass.m_constantsPool[refIndex - 1]) | ||
88 | .mNameType.Name.Value, null); | ||
89 | } | ||
90 | } | ||
91 | } | ||
92 | else | ||
93 | { | ||
94 | m_thread.PC += 2; | ||
95 | } | ||
96 | result = true; | ||
97 | break; | ||
98 | } | ||
99 | |||
100 | return result; | ||
101 | } | ||
102 | } | ||
103 | } | ||
104 | } \ No newline at end of file | ||