verifier.hpp revision 0
0N/A * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 0N/A// The verifier class 0N/A * Verify the bytecodes for a class. If 'throw_exception' is true 0N/A * then the appropriate VerifyError or ClassFormatError will be thrown. 0N/A * Otherwise, no exception is thrown and the return indicates the 0N/A // Return false if the class is loaded by the bootstrap loader. 0N/A // Relax certain verifier checks to enable some broken 1.1 apps to run on 1.2. 0N/A// Summary of verifier's memory usage: 0N/A// StackMapTable is stack allocated. 0N/A// StackMapFrame are resource allocated. There is one ResourceMark 0N/A// There is one mutable StackMapFrame (current_frame) which is updated 0N/A// by abstract bytecode interpretation. frame_in_exception_handler() returns 0N/A// a frame that has a mutable one-item stack (ready for pushing the 0N/A// catch type exception object). All the other StackMapFrame's 0N/A// are immutable (including their locals and stack arrays) after 0N/A// their constructions. 0N/A// the mutable StackMapFrame (current_frame). 0N/A// Care needs to be taken to make sure resource objects don't outlive 0N/A// the lifetime of their ResourceMark. 0N/A// These macros are used similarly to CHECK macros but also check 0N/A// the status of the verifier and return if that has an error. 0N/A// A new instance of this class is created for each class being verified 0N/A // Verifies the class. If a verify or class file format error occurs, 0N/A // the '_exception_name' symbols will set to the exception name and 0N/A // the message_buffer will be filled in with the exception message. 0N/A // Return status modes 0N/A // Called when verify or class format errors are encountered. 0N/A // May throw an exception based upon the mode.