162 int hi = getBytecodeOrBPAt(bci); |
162 int hi = getBytecodeOrBPAt(bci); |
163 int lo = getBytecodeOrBPAt(bci + 1); |
163 int lo = getBytecodeOrBPAt(bci + 1); |
164 return (short) ((hi << 8) | lo); |
164 return (short) ((hi << 8) | lo); |
165 } |
165 } |
166 |
166 |
|
167 /** Fetches a 16-bit native ordered value from the |
|
168 bytecode stream */ |
|
169 public short getNativeShortArg(int bci) { |
|
170 int hi = getBytecodeOrBPAt(bci); |
|
171 int lo = getBytecodeOrBPAt(bci + 1); |
|
172 if (VM.getVM().isBigEndian()) { |
|
173 return (short) ((hi << 8) | lo); |
|
174 } else { |
|
175 return (short) ((lo << 8) | hi); |
|
176 } |
|
177 } |
|
178 |
167 /** Fetches a 32-bit big-endian ("Java ordered") value from the |
179 /** Fetches a 32-bit big-endian ("Java ordered") value from the |
168 bytecode stream */ |
180 bytecode stream */ |
169 public int getBytecodeIntArg(int bci) { |
181 public int getBytecodeIntArg(int bci) { |
170 int b4 = getBytecodeOrBPAt(bci); |
182 int b4 = getBytecodeOrBPAt(bci); |
171 int b3 = getBytecodeOrBPAt(bci + 1); |
183 int b3 = getBytecodeOrBPAt(bci + 1); |
172 int b2 = getBytecodeOrBPAt(bci + 2); |
184 int b2 = getBytecodeOrBPAt(bci + 2); |
173 int b1 = getBytecodeOrBPAt(bci + 3); |
185 int b1 = getBytecodeOrBPAt(bci + 3); |
174 |
186 |
175 return (b4 << 24) | (b3 << 16) | (b2 << 8) | b1; |
187 return (b4 << 24) | (b3 << 16) | (b2 << 8) | b1; |
|
188 } |
|
189 |
|
190 /** Fetches a 32-bit native ordered value from the |
|
191 bytecode stream */ |
|
192 public int getNativeIntArg(int bci) { |
|
193 int b4 = getBytecodeOrBPAt(bci); |
|
194 int b3 = getBytecodeOrBPAt(bci + 1); |
|
195 int b2 = getBytecodeOrBPAt(bci + 2); |
|
196 int b1 = getBytecodeOrBPAt(bci + 3); |
|
197 |
|
198 if (VM.getVM().isBigEndian()) { |
|
199 return (b4 << 24) | (b3 << 16) | (b2 << 8) | b1; |
|
200 } else { |
|
201 return (b1 << 24) | (b2 << 16) | (b3 << 8) | b4; |
|
202 } |
176 } |
203 } |
177 |
204 |
178 public byte[] getByteCode() { |
205 public byte[] getByteCode() { |
179 byte[] bc = new byte[ (int) getCodeSize() ]; |
206 byte[] bc = new byte[ (int) getCodeSize() ]; |
180 for( int i=0; i < bc.length; i++ ) |
207 for( int i=0; i < bc.length; i++ ) |