equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. |
2 * Copyright 2005-2010 Sun Microsystems, Inc. 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. |
7 * published by the Free Software Foundation. |
636 assert(Bytecodes::is_java_code(code), "sanity check"); |
636 assert(Bytecodes::is_java_code(code), "sanity check"); |
637 assert(code != Bytecodes::_breakpoint, "sanity check"); |
637 assert(code != Bytecodes::_breakpoint, "sanity check"); |
638 |
638 |
639 // length of bytecode (mnemonic + operands) |
639 // length of bytecode (mnemonic + operands) |
640 address bcp = bs.bcp(); |
640 address bcp = bs.bcp(); |
641 int len = bs.next_bcp() - bcp; |
641 int len = bs.instruction_size(); |
642 assert(len > 0, "length must be > 0"); |
642 assert(len > 0, "length must be > 0"); |
643 |
643 |
644 // copy the bytecodes |
644 // copy the bytecodes |
645 *p = (unsigned char) (bs.is_wide()? Bytecodes::_wide : code); |
645 *p = (unsigned char) (bs.is_wide()? Bytecodes::_wide : code); |
646 if (len > 1) { |
646 if (len > 1) { |