bytecodeStream.hpp revision 726
1008N/A * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. 1008N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1008N/A * This code is free software; you can redistribute it and/or modify it 1008N/A * under the terms of the GNU General Public License version 2 only, as 1008N/A * published by the Free Software Foundation. 1008N/A * This code is distributed in the hope that it will be useful, but WITHOUT 1008N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1008N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1008N/A * version 2 for more details (a copy is included in the LICENSE file that 1008N/A * You should have received a copy of the GNU General Public License version 1008N/A * 2 along with this work; if not, write to the Free Software Foundation, 1008N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1008N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1008N/A * CA 95054 USA or visit www.sun.com if you need additional information or 1008N/A// A BytecodeStream is used for fast iteration over the bytecodes 1008N/A// BytecodeStream s(method); 1008N/A// while ((c = s.next()) >= 0) { 1008N/A// A RawBytecodeStream is a simple version of BytecodeStream. 1008N/A// It is used ONLY when we know the bytecodes haven't been rewritten 1008N/A// yet, such as in the rewriter or the verifier. Currently only the 1008N/A// verifier uses this class. 1008N/A // iterate over the interval [beg_bci, end_bci) 1008N/A // setup of iteration pointers 1008N/A // Use raw_next() rather than next() for faster method reference 1008N/A // set next bytecode position 1008N/A // Bytecode-specific attributes 1008N/A // Unsigned indices, widening 1008N/A// In BytecodeStream, non-java bytecodes will be translated into the 1008N/A// corresponding java bytecodes. 1008N/A // indicate end of bytecode stream 1008N/A // set next bytecode position 1008N/A // note that we cannot advance before having the 1008N/A // tty bytecode otherwise the stepping is wrong! 1008N/A // (carefull: length_for(...) must be used first!) 1008N/A // check for special (uncommon) cases