diff options
author | lbsa71 | 2007-10-30 09:05:31 +0000 |
---|---|---|
committer | lbsa71 | 2007-10-30 09:05:31 +0000 |
commit | 67e12b95ea7b68f4904a7484d77ecfd787d16d0c (patch) | |
tree | 20b00d24c8a7617017960432ec044852e3ad5fa9 /OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Methods.cs | |
parent | * Deleted .user file (diff) | |
download | opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.zip opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.gz opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.bz2 opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.xz |
* Optimized usings
* Shortened type references
* Removed redundant 'this' qualifier
Diffstat (limited to 'OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Methods.cs')
-rw-r--r-- | OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Methods.cs | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Methods.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Methods.cs index a5bd48b..b27630a 100644 --- a/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Methods.cs +++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JVMEngine/JVM/Interpreter.Methods.cs | |||
@@ -25,15 +25,6 @@ | |||
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; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using OpenSim.Framework.Interfaces; | ||
32 | using OpenSim.Framework; | ||
33 | using OpenSim.Framework; | ||
34 | using OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types; | ||
35 | using OpenSim.Region.ExtensionsScriptModule.JVMEngine.Types.PrimitiveTypes; | ||
36 | |||
37 | namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM | 28 | namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM |
38 | { | 29 | { |
39 | partial class Thread | 30 | partial class Thread |
@@ -46,10 +37,15 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM | |||
46 | switch (opcode) | 37 | switch (opcode) |
47 | { | 38 | { |
48 | case 184: | 39 | case 184: |
49 | short refIndex = (short) ((GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this.m_thread.PC+1]); | 40 | short refIndex = |
50 | if (this.m_thread.currentClass.m_constantsPool[refIndex - 1] is ClassRecord.PoolMethodRef) | 41 | (short) |
42 | ((GlobalMemory.MethodArea.MethodBuffer[m_thread.PC] << 8) + | ||
43 | GlobalMemory.MethodArea.MethodBuffer[m_thread.PC + 1]); | ||
44 | if (m_thread.currentClass.m_constantsPool[refIndex - 1] is ClassRecord.PoolMethodRef) | ||
51 | { | 45 | { |
52 | string typ = ((ClassRecord.PoolMethodRef)this.m_thread.currentClass.m_constantsPool[refIndex - 1]).mNameType.Type.Value; | 46 | string typ = |
47 | ((ClassRecord.PoolMethodRef) m_thread.currentClass.m_constantsPool[refIndex - 1]). | ||
48 | mNameType.Type.Value; | ||
53 | string typeparam = ""; | 49 | string typeparam = ""; |
54 | string typereturn = ""; | 50 | string typereturn = ""; |
55 | int firstbrak = 0; | 51 | int firstbrak = 0; |
@@ -58,16 +54,22 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM | |||
58 | secondbrak = typ.LastIndexOf(')'); | 54 | secondbrak = typ.LastIndexOf(')'); |
59 | typeparam = typ.Substring(firstbrak + 1, secondbrak - firstbrak - 1); | 55 | typeparam = typ.Substring(firstbrak + 1, secondbrak - firstbrak - 1); |
60 | typereturn = typ.Substring(secondbrak + 1, typ.Length - secondbrak - 1); | 56 | typereturn = typ.Substring(secondbrak + 1, typ.Length - secondbrak - 1); |
61 | if (((ClassRecord.PoolMethodRef)this.m_thread.currentClass.m_constantsPool[refIndex - 1]).mClass.Name.Value == this.m_thread.currentClass.MClass.Name.Value) | 57 | if ( |
58 | ((ClassRecord.PoolMethodRef) m_thread.currentClass.m_constantsPool[refIndex - 1]).mClass | ||
59 | .Name.Value == m_thread.currentClass.MClass.Name.Value) | ||
62 | { | 60 | { |
63 | //calling a method in this class | 61 | //calling a method in this class |
64 | if (typeparam.Length == 0) | 62 | if (typeparam.Length == 0) |
65 | { | 63 | { |
66 | this.m_thread.JumpToStaticVoidMethod(((ClassRecord.PoolMethodRef)this.m_thread.currentClass.m_constantsPool[refIndex - 1]).mNameType.Name.Value, (this.m_thread.PC + 2)); | 64 | m_thread.JumpToStaticVoidMethod( |
65 | ((ClassRecord.PoolMethodRef) m_thread.currentClass.m_constantsPool[refIndex - 1]) | ||
66 | .mNameType.Name.Value, (m_thread.PC + 2)); | ||
67 | } | 67 | } |
68 | else | 68 | else |
69 | { | 69 | { |
70 | this.m_thread.JumpToStaticParamMethod(((ClassRecord.PoolMethodRef)this.m_thread.currentClass.m_constantsPool[refIndex - 1]).mNameType.Name.Value, typeparam, (this.m_thread.PC + 2)); | 70 | m_thread.JumpToStaticParamMethod( |
71 | ((ClassRecord.PoolMethodRef) m_thread.currentClass.m_constantsPool[refIndex - 1]) | ||
72 | .mNameType.Name.Value, typeparam, (m_thread.PC + 2)); | ||
71 | } | 73 | } |
72 | } | 74 | } |
73 | else | 75 | else |
@@ -75,15 +77,19 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM | |||
75 | //calling a method of a different class | 77 | //calling a method of a different class |
76 | 78 | ||
77 | // OpenSimAPI Class | 79 | // OpenSimAPI Class |
78 | if (((ClassRecord.PoolMethodRef)this.m_thread.currentClass.m_constantsPool[refIndex - 1]).mClass.Name.Value == "OpenSimAPI") | 80 | if ( |
81 | ((ClassRecord.PoolMethodRef) m_thread.currentClass.m_constantsPool[refIndex - 1]). | ||
82 | mClass.Name.Value == "OpenSimAPI") | ||
79 | { | 83 | { |
80 | this.m_thread.scriptInfo.api.CallMethod(((ClassRecord.PoolMethodRef)this.m_thread.currentClass.m_constantsPool[refIndex - 1]).mNameType.Name.Value, null); | 84 | m_thread.scriptInfo.api.CallMethod( |
85 | ((ClassRecord.PoolMethodRef) m_thread.currentClass.m_constantsPool[refIndex - 1]) | ||
86 | .mNameType.Name.Value, null); | ||
81 | } | 87 | } |
82 | } | 88 | } |
83 | } | 89 | } |
84 | else | 90 | else |
85 | { | 91 | { |
86 | this.m_thread.PC += 2; | 92 | m_thread.PC += 2; |
87 | } | 93 | } |
88 | result = true; | 94 | result = true; |
89 | break; | 95 | break; |
@@ -93,4 +99,4 @@ namespace OpenSim.Region.ExtensionsScriptModule.JVMEngine.JVM | |||
93 | } | 99 | } |
94 | } | 100 | } |
95 | } | 101 | } |
96 | } | 102 | } \ No newline at end of file |