exceptionHandlerTable.hpp revision 0
3909N/A * Copyright 1998-2005 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 2362N/A * published by the Free Software Foundation. 2362N/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// A HandlerTableEntry describes an individual entry of a subtable 0N/A// of ExceptionHandlerTable. An entry consists of a pair(bci, pco), 0N/A// where bci is the exception handler bci, and pco is the pc offset 0N/A// relative to the nmethod code start for the compiled exception 0N/A// handler corresponding to the (interpreted) exception handler 0N/A// The first HandlerTableEntry of each subtable holds the length 0N/A// and catch_pco for the subtable (the length is the number of 0N/A// subtable entries w/o header). 0N/A int len()
const {
return _bci; }
// for entry at subtable begin 0N/A// An ExceptionHandlerTable is an abstraction over a list of subtables 0N/A// of exception handlers for CatchNodes. Each subtable has a one-entry 0N/A// header holding length and catch_pco of the subtable, followed 0N/A// by 'length' entries for each exception handler that can be reached 0N/A// from the corresponding CatchNode. The catch_pco is the pc offset of 0N/A// the CatchNode in the corresponding nmethod. Empty subtables are dis- 0N/A// Structure of the table: 0N/A// table = { subtable }. 0N/A// subtable = header entry { entry }. 0N/A// header = a pair (number of subtable entries, catch pc offset, [unused]) 0N/A// entry = a pair (handler bci, handler pc offset, scope depth) 0N/A// An ExceptionHandlerTable can be created from scratch, in which case 3686N/A// it is possible to add subtables. It can also be created from an 0N/A// nmethod (for lookup purposes) in which case the table cannot be 0N/A int _size;
// the number of allocated entries 0N/A // add the entry & grow the table if needed 0N/A // (compile-time) construction within compiler 1220N/A // (run-time) construction from nmethod 0N/A // (compile-time) add entries 0N/A // if representing exception handlers in multiple 0N/A // inlined scopes, indicates which scope relative to 0N/A // the lookup; zero (or null GrowableArray) indicates // ---------------------------------------------------------------------------- // Implicit null exception tables. Maps an exception PC offset to a // continuation PC offset. During construction it's a variable sized // array with a max size and current length. When stored inside an // nmethod a zero length table takes no space. This is detected by // nul_chk_table_size() == 0. Otherwise the table has a length word // followed by pairs of <excp-offset, const-offset>. // Use 32-bit representation for offsets // (run-time) construction from nmethod