1 /* |
1 /* |
2 * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
22 * or visit www.oracle.com if you need additional information or have any |
22 * or visit www.oracle.com if you need additional information or have any |
23 * questions. |
23 * questions. |
24 */ |
24 */ |
25 |
25 |
26 package com.sun.tools.classfile; |
26 package com.sun.tools.classfile; |
|
27 |
|
28 import java.util.Locale; |
27 |
29 |
28 /** |
30 /** |
29 * See JVMS, chapter 6. |
31 * See JVMS, chapter 6. |
30 * |
32 * |
31 * <p><b>This is NOT part of any supported API. |
33 * <p><b>This is NOT part of any supported API. |
209 public String getMnemonic() { |
211 public String getMnemonic() { |
210 Opcode opcode = getOpcode(); |
212 Opcode opcode = getOpcode(); |
211 if (opcode == null) |
213 if (opcode == null) |
212 return "bytecode " + getUnsignedByte(0); |
214 return "bytecode " + getUnsignedByte(0); |
213 else |
215 else |
214 return opcode.toString().toLowerCase(); |
216 return opcode.toString().toLowerCase(Locale.US); |
215 } |
217 } |
216 |
218 |
217 /** Get the length, in bytes, of this instruction, including the opcode |
219 /** Get the length, in bytes, of this instruction, including the opcode |
218 * and all its operands. */ |
220 * and all its operands. */ |
219 public int length() { |
221 public int length() { |